Search in sources :

Example 6 with CastorXMLUtility

use of org.cristalise.kernel.utils.CastorXMLUtility in project kernel by cristal-ise.

the class CastorXMLTest method testGraphMultiPointEdge.

@Test
public void testGraphMultiPointEdge() throws Exception {
    CastorXMLUtility marshaller = Gateway.getMarshaller();
    GraphableEdge edge = new Next();
    edge.getMultiPoints().put(1, new GraphPoint(0, 0));
    edge.getMultiPoints().put(2, new GraphPoint(100, 100));
    edge.getMultiPoints().put(3, new GraphPoint(200, 100));
    GraphableEdge edgePrime = (GraphableEdge) marshaller.unmarshall(marshaller.marshall(edge));
    assertThat(edge).isEqualToComparingFieldByField(edgePrime);
    Logger.msg(marshaller.marshall(edge));
    Logger.msg(marshaller.marshall(edgePrime));
}
Also used : GraphPoint(org.cristalise.kernel.graph.model.GraphPoint) Next(org.cristalise.kernel.lifecycle.instance.Next) CastorXMLUtility(org.cristalise.kernel.utils.CastorXMLUtility) GraphableEdge(org.cristalise.kernel.graph.model.GraphableEdge) MainTest(org.cristalise.kernel.test.process.MainTest) Test(org.junit.Test)

Example 7 with CastorXMLUtility

use of org.cristalise.kernel.utils.CastorXMLUtility in project kernel by cristal-ise.

the class CastorXMLTest method testCastorAgentPath.

@Test
public void testCastorAgentPath() throws Exception {
    CastorXMLUtility marshaller = Gateway.getMarshaller();
    AgentPath agent = new AgentPath(UUID.randomUUID(), ior, "toto");
    AgentPath agentPrime = (AgentPath) marshaller.unmarshall(marshaller.marshall(agent));
    assertEquals(agent.getUUID(), agentPrime.getUUID());
    assertEquals(agent.getIORString(), agentPrime.getIORString());
    assertEquals(agent.getAgentName(), agentPrime.getAgentName());
    Logger.msg(marshaller.marshall(agentPrime));
}
Also used : AgentPath(org.cristalise.kernel.lookup.AgentPath) CastorXMLUtility(org.cristalise.kernel.utils.CastorXMLUtility) MainTest(org.cristalise.kernel.test.process.MainTest) Test(org.junit.Test)

Example 8 with CastorXMLUtility

use of org.cristalise.kernel.utils.CastorXMLUtility in project kernel by cristal-ise.

the class CastorXMLTest method testCastorRolePath.

@Test
public void testCastorRolePath() throws Exception {
    CastorXMLUtility marshaller = Gateway.getMarshaller();
    RolePath role = new RolePath("Minion", false);
    RolePath rolePrime = (RolePath) marshaller.unmarshall(marshaller.marshall(role));
    assertEquals(role.getStringPath(), rolePrime.getStringPath());
    assertEquals(role.hasJobList(), rolePrime.hasJobList());
    Logger.msg(marshaller.marshall(rolePrime));
}
Also used : CastorXMLUtility(org.cristalise.kernel.utils.CastorXMLUtility) RolePath(org.cristalise.kernel.lookup.RolePath) MainTest(org.cristalise.kernel.test.process.MainTest) Test(org.junit.Test)

Aggregations

CastorXMLUtility (org.cristalise.kernel.utils.CastorXMLUtility)8 MainTest (org.cristalise.kernel.test.process.MainTest)6 Test (org.junit.Test)6 InvalidDataException (org.cristalise.kernel.common.InvalidDataException)2 DomainPath (org.cristalise.kernel.lookup.DomainPath)2 ItemPath (org.cristalise.kernel.lookup.ItemPath)2 MalformedURLException (java.net.MalformedURLException)1 Properties (java.util.Properties)1 CannotManageException (org.cristalise.kernel.common.CannotManageException)1 ObjectNotFoundException (org.cristalise.kernel.common.ObjectNotFoundException)1 PersistencyException (org.cristalise.kernel.common.PersistencyException)1 GraphPoint (org.cristalise.kernel.graph.model.GraphPoint)1 GraphableEdge (org.cristalise.kernel.graph.model.GraphableEdge)1 Next (org.cristalise.kernel.lifecycle.instance.Next)1 AgentPath (org.cristalise.kernel.lookup.AgentPath)1 RolePath (org.cristalise.kernel.lookup.RolePath)1 ModuleManager (org.cristalise.kernel.process.module.ModuleManager)1 Resource (org.cristalise.kernel.process.resource.Resource)1 ObjectProperties (org.cristalise.kernel.utils.ObjectProperties)1