Unverified Commit 124c0a8d authored by Jeffrey Phillips Freeman's avatar Jeffrey Phillips Freeman 💥
Browse files

fix: fixed all the bugs caught by the new units tests and updated the changelog.

parent 716acbfb
......@@ -2,6 +2,15 @@
## 3.2.1
* Removed `throws exception` from the signature of the TxActions.
* Fixed a bug where the `VertexFrame.toJson()` and `EdgeFrame.toJson()` methods wouldn't encode properties that werent
of the type `Number` or `String`
* When constructing a `DelegatingFramedGraph` if a the delegate graph argument is null the constructor now throws an
exception.
* `AbstractAnnotationFrameFactory.constructClass()` method now throws an exception if the element argument is neither an
`Edge` or a `Vertex`.
* Added several more unit tests bring test coverage up an additional 5%.
## 3.2.0
* Added nexus staging deployment plugin.
......
......@@ -60,8 +60,12 @@ public abstract class AbstractEdgeFrame extends AbstractElementFrame implements
final Object value = getProperty(key);
if (value instanceof Number)
json.addProperty(key, (Number) value);
else if (value instanceof String)
json.addProperty(key, (String) value);
else if (value instanceof Boolean)
json.addProperty(key, (Boolean) value);
else if (value instanceof Character)
json.addProperty(key, (Character) value);
else
json.addProperty(key, value.toString());
}
return json;
}
......
......@@ -245,8 +245,12 @@ public abstract class AbstractVertexFrame extends AbstractElementFrame implement
final Object value = getProperty(key);
if (value instanceof Number)
json.addProperty(key, (Number) value);
else if (value instanceof String)
json.addProperty(key, (String) value);
else if(value instanceof Boolean)
json.addProperty(key, (Boolean) value);
else if(value instanceof Character)
json.addProperty(key, (Character) value);
else
json.addProperty(key, value.toString());
}
return json;
}
......
......@@ -63,13 +63,14 @@ public class DelegatingFramedGraph<G extends Graph> implements WrappedFramedGrap
* The type defaultResolver that will decide the final frame type.
*/
public DelegatingFramedGraph(final G delegate, final FrameFactory builder, final TypeResolver defaultResolver) {
this.delegate = delegate;
if( builder == null )
throw new IllegalArgumentException("builder can not be null");
else if( defaultResolver == null )
throw new IllegalArgumentException("defaultResolver can not be null");
else if( delegate == null )
throw new IllegalArgumentException("delegate can not be null");
this.delegate = delegate;
this.defaultResolver = defaultResolver;
this.untypedResolver = new UntypedTypeResolver();
this.builder = builder;
......
......@@ -84,9 +84,11 @@ public class AbstractAnnotationFrameFactory implements FrameFactory {
else
throw new IllegalStateException("class is neither an Edge or a vertex!");
else {
if (element instanceof Vertex && !VertexFrame.class.isAssignableFrom(clazz))
if( !(element instanceof Vertex || element instanceof Edge) )
throw new IllegalStateException("element is neither an edge nor a vertex");
else if (element instanceof Vertex && !VertexFrame.class.isAssignableFrom(clazz))
throw new IllegalStateException(clazz.getName() + " Class is not a type of VertexFrame");
if (element instanceof Edge && !EdgeFrame.class.isAssignableFrom(clazz))
else if (element instanceof Edge && !EdgeFrame.class.isAssignableFrom(clazz))
throw new IllegalStateException(clazz.getName() + " Class is not a type of EdgeFrame");
classBuilder = new ByteBuddy().subclass(clazz);
}
......
......@@ -18,6 +18,6 @@ package com.syncleus.ferma.tx;
@FunctionalInterface
public interface TxAction<T> {
T handle(Tx tx) throws Exception;
T handle(Tx tx);
}
......@@ -18,6 +18,6 @@ package com.syncleus.ferma.tx;
@FunctionalInterface
public interface TxAction0 {
void handle() throws Exception;
void handle();
}
......@@ -18,6 +18,6 @@ package com.syncleus.ferma.tx;
@FunctionalInterface
public interface TxAction1<T> {
T handle() throws Exception;
T handle();
}
......@@ -18,6 +18,6 @@ package com.syncleus.ferma.tx;
@FunctionalInterface
public interface TxAction2 {
void handle(Tx tx) throws Exception;
void handle(Tx tx);
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment