Endpoint endpoint2 = createEndpoint("endpoint2");
initEndpoint(endpoint2, null);
synapseConfig.addEndpoint(endpoint2.getName(), endpoint2);
SequenceMediator seq1 = createSequence("seq1", null);
SendMediator send = new SendMediator();
IndirectEndpoint endpointRef = new IndirectEndpoint();
endpointRef.setKey(endpoint.getName());
send.setEndpoint(endpointRef);
seq1.addChild(send);
synapseConfig.addSequence(seq1.getName(), seq1);
assertDependency(ConfigurationObject.TYPE_ENDPOINT, endpoint.getName(), seq1.getName());
synapseConfig.removeSequence(seq1.getName());
seq1.removeChild(0);
send = new SendMediator();
endpointRef = new IndirectEndpoint();
endpointRef.setKey(endpoint2.getName());
send.setEndpoint(endpointRef);
seq1.addChild(send);
synapseConfig.addSequence(seq1.getName(), seq1);
assertNoDependency(ConfigurationObject.TYPE_ENDPOINT, endpoint.getName());
assertDependency(ConfigurationObject.TYPE_ENDPOINT, endpoint2.getName(), seq1.getName());
SequenceMediator seq2 = createSequence("seq2", null);
synapseConfig.addSequence(seq2.getName(), seq2);
ProxyService proxy = createProxy("proxy", seq1.getName(), null, null);
synapseConfig.addProxyService(proxy.getName(), proxy);
assertDependency(ConfigurationObject.TYPE_SEQUENCE, seq1.getName(), proxy.getName());
synapseConfig.removeProxyService(proxy.getName());
proxy = createProxy("proxy", null, seq2.getName(), null);
synapseConfig.addProxyService(proxy.getName(), proxy);
assertNoDependency(ConfigurationObject.TYPE_SEQUENCE, seq1.getName());
assertDependency(ConfigurationObject.TYPE_SEQUENCE, seq2.getName(), proxy.getName());
System.out.println("All tests were successful...");
}