Class TestNodeGraphCore
java.lang.Object
com.marginallyclever.nodegraphcore.TestGraphCore
public class TestNodeGraphCore
extends java.lang.Object
Test the NodeGraphCore elements.
- Since:
- 2022-02-21
-
Constructor Summary
Constructors Constructor Description TestNodeGraphCore()
-
Method Summary
Modifier and Type Method Description static void
beforeAll()
setup theNodeGraph
to use.void
beforeEach()
clear the graph.void
testAdd()
confirmAdd.update()
works as expected and sets itself to not dirtyvoid
testAddTwoConstants()
confirm adding two constants together viaNodeConnection
s works as expectedvoid
testAddTwoConstantsAndReport()
confirm adding two constants together viaNodeConnection
s works as expected.void
testAddTwoModelsTogether()
Test that two models can be added together without loss ofNode
s without loss ofNodeConnection
while preserving values in theNodeVariable
svoid
testAllNodesToJSONAndBack()
confirm allNode
s can be created by theNodeFactory
.void
testFactoryCreatesAllDefaultTypes()
confirm factory can create all registered nodes.void
testFactoryFailsOnBadRequests()
confirm factory will assert if asked for a node that doesn't exist.void
testFactoryWontRegisterTwoNodesWithSameName()
confirm registering an already registered node throws an exception.void
testModelClears()
confirm clearing aNodeGraph
really does set it back to nothing.void
testModelToJSONAndBack()
confirm aNodeGraph
can be serialized and de-serialized.void
testNodesAreNotEqual()
confirm two different nodes are not somehow equal when serialized.void
testNodeVariablesToJSONAndBack()
TestNodeVariable
serializationvoid
testSaveEmptyGraph()
Test that empty graph look as expected.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
TestNodeGraphCore
public TestNodeGraphCore()
-
-
Method Details
-
beforeAll
@BeforeAll public static void beforeAll()setup theNodeGraph
to use. -
beforeEach
@BeforeEach public void beforeEach()clear the graph. -
testSaveEmptyGraph
@Test public void testSaveEmptyGraph()Test that empty graph look as expected. -
testAdd
@Test public void testAdd()confirmAdd.update()
works as expected and sets itself to not dirty -
testAddTwoConstants
@Test public void testAddTwoConstants()confirm adding two constants together viaNodeConnection
s works as expected -
testAddTwoConstantsAndReport
@Test public void testAddTwoConstantsAndReport()confirm adding two constants together viaNodeConnection
s works as expected. confirmPrintToStdOut
works as expected. -
testFactoryFailsOnBadRequests
@Test public void testFactoryFailsOnBadRequests()confirm factory will assert if asked for a node that doesn't exist. confirm that there is no node with name "" or null. -
testFactoryCreatesAllDefaultTypes
@Test public void testFactoryCreatesAllDefaultTypes()confirm factory can create all registered nodes. -
testNodesAreNotEqual
@Test public void testNodesAreNotEqual()confirm two different nodes are not somehow equal when serialized. confirm two nodes of the same type in the same graph are not equal when serialized. -
testAllNodesToJSONAndBack
@Test public void testAllNodesToJSONAndBack()confirm allNode
s can be created by theNodeFactory
. confirm allNode
s can be serialized and de-serialized. confirm allNode
s are identical after being serialized and de-serialized. -
testModelToJSONAndBack
@Test public void testModelToJSONAndBack()confirm aNodeGraph
can be serialized and de-serialized. -
testModelClears
@Test public void testModelClears()confirm clearing aNodeGraph
really does set it back to nothing. -
testFactoryWontRegisterTwoNodesWithSameName
@Test public void testFactoryWontRegisterTwoNodesWithSameName()confirm registering an already registered node throws an exception. -
testNodeVariablesToJSONAndBack
@Test public void testNodeVariablesToJSONAndBack() throws java.lang.ExceptionTestNodeVariable
serialization- Throws:
java.lang.Exception
- if serialization fails.
-
testAddTwoModelsTogether
@Test public void testAddTwoModelsTogether()Test that two models can be added together- without loss of
Node
s - without loss of
NodeConnection
- while preserving values in the
NodeVariable
s
- without loss of
-