Skip to content

Commit 0f1a163

Browse files
committed
Update TestGraph.java
1 parent a38d371 commit 0f1a163

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

src/test/java/com/marginallyclever/nodegraphcore/TestGraph.java

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ private void buildAddTwoConstants() {
6666
LoadNumber constant1 = (LoadNumber) graph.add(new LoadNumber());
6767
constant0.getPort(0).setValue(1);
6868
constant1.getPort(0).setValue(2);
69-
Add add = (Add) graph.add(new Add());
69+
var add = graph.add(new Add());
7070
graph.add(new Connection(constant0,1,add,0));
7171
graph.add(new Connection(constant1,1,add,1));
7272
}
@@ -205,11 +205,10 @@ public void testFactoryWontRegisterTwoNodesWithSameName() {
205205

206206
/**
207207
* Test {@link Port} serialization
208-
* @param myClass
209-
* @param instA
210-
* @param instB
211-
* @param <T>
212-
* @throws Exception
208+
* @param myClass the class of the variable to test
209+
* @param instA the first instance of the variable to test
210+
* @param instB the second instance of the variable to test
211+
* @param <T> the type of the variable to test
213212
*/
214213
private <T> void testNodeVariableToJSONAndBack(Class<T> myClass,T instA,T instB) {
215214
Port<?> a = new Input<>(myClass.getSimpleName(),myClass,instA);
@@ -230,7 +229,6 @@ private <T> void testNodeVariableToJSONAndBack(Class<T> myClass,T instA,T instB)
230229

231230
/**
232231
* Test {@link Port} serialization
233-
* @throws Exception if serialization fails.
234232
*/
235233
@Test
236234
public void testNodeVariablesToJSONAndBack() {
@@ -239,7 +237,7 @@ public void testNodeVariablesToJSONAndBack() {
239237
testNodeVariableToJSONAndBack(Number.class, 1.2,0.0);
240238
*/
241239
testNodeVariableToJSONAndBack(Rectangle.class, new Rectangle(),new Rectangle());
242-
testNodeVariableToJSONAndBack(String.class, "hello",new String());
240+
testNodeVariableToJSONAndBack(String.class, "hello", "");
243241
testNodeVariableToJSONAndBack(Number.class, 1.2D,0.0D);
244242
testNodeVariableToJSONAndBack(Number.class, 1,0);
245243
}

0 commit comments

Comments
 (0)