@Test public void setReplicationConfig() throws Exception { ReplicationConfiguration r = new ReplicationConfiguration(); Operator op = new Operator(); op.setOperatorNodeID("test_node"); op.setSoapReplicationURL("http://localhost"); op.setOperatorStatus(OperatorStatusType.NORMAL); r.getOperator().add(op); r.setCommunicationGraph(new CommunicationGraph()); r.setRegistryContact(new ReplicationConfiguration.RegistryContact()); r.getRegistryContact().setContact(new Contact()); r.getRegistryContact().getContact().getPersonName().add(new PersonName("test", null)); // r.getCommunicationGraph().getEdge().add(new CommunicationGraph.Edge()); r.getCommunicationGraph().getNode().add("test_node"); JAXB.marshal(r, System.out); DispositionReport setReplicationNodes = juddi.setReplicationNodes(authInfoRoot, r); ReplicationConfiguration replicationNodes = juddi.getReplicationNodes(authInfoRoot); Assert.assertNotNull(replicationNodes.getCommunicationGraph()); Assert.assertNotNull(replicationNodes.getCommunicationGraph().getNode()); Assert.assertEquals("test_node", replicationNodes.getCommunicationGraph().getNode().get(0)); Assert.assertNotNull(replicationNodes.getMaximumTimeToGetChanges()); Assert.assertNotNull(replicationNodes.getMaximumTimeToSyncRegistry()); Assert.assertNotNull(replicationNodes.getTimeOfConfigurationUpdate()); Assert.assertNotNull(replicationNodes.getSerialNumber()); long firstcommit = replicationNodes.getSerialNumber(); r = new ReplicationConfiguration(); r.getOperator().add(op); r.setCommunicationGraph(new CommunicationGraph()); r.setRegistryContact(new ReplicationConfiguration.RegistryContact()); r.getRegistryContact().setContact(new Contact()); r.getRegistryContact().getContact().getPersonName().add(new PersonName("test", null)); // r.getCommunicationGraph().getEdge().add(new CommunicationGraph.Edge()); r.getCommunicationGraph().getNode().add("test_node"); JAXB.marshal(r, System.out); setReplicationNodes = juddi.setReplicationNodes(authInfoRoot, r); replicationNodes = juddi.getReplicationNodes(authInfoRoot); Assert.assertNotNull(replicationNodes.getCommunicationGraph()); Assert.assertNotNull(replicationNodes.getCommunicationGraph().getNode()); Assert.assertEquals("test_node", replicationNodes.getCommunicationGraph().getNode().get(0)); Assert.assertNotNull(replicationNodes.getMaximumTimeToGetChanges()); Assert.assertNotNull(replicationNodes.getMaximumTimeToSyncRegistry()); Assert.assertNotNull(replicationNodes.getTimeOfConfigurationUpdate()); Assert.assertNotNull(replicationNodes.getSerialNumber()); Assert.assertTrue(firstcommit < replicationNodes.getSerialNumber()); }
@Test public void setReplicationConfig2() throws Exception { ReplicationConfiguration r = new ReplicationConfiguration(); Operator op = new Operator(); op.setOperatorNodeID("test_node"); op.setSoapReplicationURL("http://localhost"); op.setOperatorStatus(OperatorStatusType.NORMAL); r.getOperator().add(op); op = new Operator(); op.setOperatorNodeID("test_node2"); op.setSoapReplicationURL("http://localhost"); op.setOperatorStatus(OperatorStatusType.NORMAL); r.getOperator().add(op); r.setCommunicationGraph(new CommunicationGraph()); r.setRegistryContact(new ReplicationConfiguration.RegistryContact()); r.getRegistryContact().setContact(new Contact()); r.getRegistryContact().getContact().getPersonName().add(new PersonName("test", null)); // r.getCommunicationGraph().getEdge().add(new CommunicationGraph.Edge()); r.getCommunicationGraph().getNode().add("test_node"); r.getCommunicationGraph().getNode().add("test_node2"); r.getCommunicationGraph().getControlledMessage().add("doPing"); r.getCommunicationGraph().getEdge().add(new CommunicationGraph.Edge()); r.getCommunicationGraph().getEdge().get(0).setMessageReceiver("test_node"); r.getCommunicationGraph().getEdge().get(0).setMessageSender("test_node2"); r.getCommunicationGraph().getEdge().get(0).getMessage().add("doPing"); r.getCommunicationGraph().getEdge().get(0).getMessageReceiverAlternate().add("test_node2"); DispositionReport setReplicationNodes = juddi.setReplicationNodes(authInfoRoot, r); ReplicationConfiguration replicationNodes = juddi.getReplicationNodes(authInfoRoot); Assert.assertNotNull(replicationNodes.getCommunicationGraph()); Assert.assertNotNull(replicationNodes.getCommunicationGraph().getNode()); Assert.assertEquals("test_node", replicationNodes.getCommunicationGraph().getNode().get(0)); Assert.assertNotNull(replicationNodes.getMaximumTimeToGetChanges()); Assert.assertNotNull(replicationNodes.getMaximumTimeToSyncRegistry()); Assert.assertNotNull(replicationNodes.getTimeOfConfigurationUpdate()); Assert.assertNotNull(replicationNodes.getSerialNumber()); }