Class TestNodeGraphCore
java.lang.Object
com.marginallyclever.nodegraphcore.TestGraph
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 voidbeforeAll()setup theNodeGraphto use.voidbeforeEach()clear the graph.voidtestAdd()confirmAdd.update()works as expected and sets itself to not dirtyvoidtestAddTwoConstants()confirm adding two constants together viaNodeConnections works as expectedvoidtestAddTwoConstantsAndReport()confirm adding two constants together viaNodeConnections works as expected.voidtestAddTwoModelsTogether()Test that two models can be added together without loss ofNodes without loss ofNodeConnectionwhile preserving values in theNodeVariablesvoidtestAllNodesToJSONAndBack()confirm allNodes can be created by theNodeFactory.voidtestFactoryCreatesAllDefaultTypes()confirm factory can create all registered nodes.voidtestFactoryFailsOnBadRequests()confirm factory will assert if asked for a node that doesn't exist.voidtestFactoryWontRegisterTwoNodesWithSameName()confirm registering an already registered node throws an exception.voidtestModelClears()confirm clearing aNodeGraphreally does set it back to nothing.voidtestModelToJSONAndBack()confirm aNodeGraphcan be serialized and de-serialized.voidtestNodesAreNotEqual()confirm two different nodes are not somehow equal when serialized.voidtestNodeVariablesToJSONAndBack()TestNodeVariableserializationvoidtestSaveEmptyGraph()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 theNodeGraphto 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 viaNodeConnections works as expected - 
testAddTwoConstantsAndReport
@Test public void testAddTwoConstantsAndReport()confirm adding two constants together viaNodeConnections works as expected. confirmPrintToStdOutworks 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 allNodes can be created by theNodeFactory. confirm allNodes can be serialized and de-serialized. confirm allNodes are identical after being serialized and de-serialized. - 
testModelToJSONAndBack
@Test public void testModelToJSONAndBack()confirm aNodeGraphcan be serialized and de-serialized. - 
testModelClears
@Test public void testModelClears()confirm clearing aNodeGraphreally 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.ExceptionTestNodeVariableserialization- Throws:
 java.lang.Exception- if serialization fails.
 - 
testAddTwoModelsTogether
@Test public void testAddTwoModelsTogether()Test that two models can be added together- without loss of 
Nodes - without loss of 
NodeConnection - while preserving values in the 
NodeVariables 
 - without loss of 
 
 -