this.messagingClient.setNeedsModel( needsModel()); this.messagingClient.setDomain( this.domain ); this.messagingClient.switchMessagingType( this.messagingType);
@Test public void testInvalidFactory_agent() throws Exception { // The internal client will be null. // But still, there will be no NPE or other exception. ReconfigurableClientAgent client = new ReconfigurableClientAgent(); client.setApplicationName( "app" ); client.setScopedInstancePath( "/root" ); client.switchMessagingType( null ); client.openConnection(); }
agentClient.setScopedInstancePath( "/" + rootInstance.getName()); agentClient.setExternalMapping( app.getExternalExports()); agentClient.switchMessagingType( getMessagingType()); this.clients.add( agentClient );
client1.setScopedInstancePath( "/" + instance1.getName()); client1.setExternalMapping( app.getExternalExports()); client1.switchMessagingType( getMessagingType()); this.clients.add( client1 ); client2.setScopedInstancePath( "/" + instance2.getName()); client2.setExternalMapping( app.getExternalExports()); client2.switchMessagingType( getMessagingType()); this.clients.add( client2 );
agentClient_11.setScopedInstancePath( "/" + app1_root1.getName()); agentClient_11.setExternalMapping( app1.getExternalExports()); agentClient_11.switchMessagingType( getMessagingType()); this.clients.add( agentClient_11 ); agentClient_12.setScopedInstancePath( "/" + app1_root2.getName()); agentClient_12.setExternalMapping( app1.getExternalExports()); agentClient_12.switchMessagingType( getMessagingType()); this.clients.add( agentClient_12 ); agentClient_2.setScopedInstancePath( "/" + app2_root.getName()); agentClient_2.setExternalMapping( app2.getExternalExports()); agentClient_2.switchMessagingType( getMessagingType()); this.clients.add( agentClient_2 );
app1_mysqlClient.setScopedInstancePath( InstanceHelpers.computeInstancePath( app1.getMySqlVm())); app1_mysqlClient.setExternalMapping( app1.getExternalExports()); app1_mysqlClient.switchMessagingType( getMessagingType()); this.clients.add( app1_mysqlClient ); app2_mysqlClient.setScopedInstancePath( InstanceHelpers.computeInstancePath( app2.getMySqlVm())); app2_mysqlClient.setExternalMapping( app2.getExternalExports()); app2_mysqlClient.switchMessagingType( getMessagingType()); this.clients.add( app2_mysqlClient ); app1_tomcatClient.setScopedInstancePath( InstanceHelpers.computeInstancePath( app1.getTomcatVm())); app1_tomcatClient.setExternalMapping( app1.getExternalExports()); app1_tomcatClient.switchMessagingType( getMessagingType()); this.clients.add( app1_tomcatClient ); app2_tomcatClient.setScopedInstancePath( InstanceHelpers.computeInstancePath( app2.getTomcatVm())); app2_tomcatClient.setExternalMapping( app2.getExternalExports()); app2_tomcatClient.switchMessagingType( getMessagingType()); this.clients.add( app2_tomcatClient );
app2_mysqlClient.setScopedInstancePath( InstanceHelpers.computeInstancePath( app2.getMySqlVm())); app2_mysqlClient.setExternalMapping( app2.getExternalExports()); app2_mysqlClient.switchMessagingType( getMessagingType()); this.clients.add( app2_mysqlClient ); app1_tomcatClient.setScopedInstancePath( InstanceHelpers.computeInstancePath( app1.getTomcatVm())); app1_tomcatClient.setExternalMapping( app1.getExternalExports()); app1_tomcatClient.switchMessagingType( getMessagingType()); this.clients.add( app1_tomcatClient );
tomcatClient.setScopedInstancePath( "/" + tomcat.getName()); tomcatClient.setExternalMapping( app1.getExternalExports()); tomcatClient.switchMessagingType( getMessagingType()); this.clients.add( tomcatClient ); apacheClient.setScopedInstancePath( "/" + apache.getName()); apacheClient.setExternalMapping( app1.getExternalExports()); apacheClient.switchMessagingType( getMessagingType()); this.clients.add( apacheClient ); mySqlClient.setScopedInstancePath( "/" + mysql.getName()); mySqlClient.setExternalMapping( app1.getExternalExports()); mySqlClient.switchMessagingType( getMessagingType()); this.clients.add( mySqlClient ); otherClient.setScopedInstancePath( "/" + other.getName()); otherClient.setExternalMapping( app2.getExternalExports()); otherClient.switchMessagingType( getMessagingType()); this.clients.add( otherClient );
client.switchMessagingType( "foo" ); Assert.assertEquals( "foo", client.getMessagingType()); Assert.assertEquals( "foo", client.getMessagingClient().getMessagingType()); client.switchMessagingType( "bar" ); Assert.assertEquals( "bar", client.getMessagingType()); Assert.assertEquals( "bar", client.getMessagingClient().getMessagingType()); client.switchMessagingType( null ); Assert.assertNull( client.getMessagingType()); Assert.assertEquals( JmxWrapperForMessagingClient.class, client.getMessagingClient().getClass());
tomcatClient.setScopedInstancePath( "/" + tomcat.getName()); tomcatClient.setExternalMapping( app1.getExternalExports()); tomcatClient.switchMessagingType( getMessagingType()); this.clients.add( tomcatClient ); apacheClient.setScopedInstancePath( "/" + apache.getName()); apacheClient.setExternalMapping( app1.getExternalExports()); apacheClient.switchMessagingType( getMessagingType()); this.clients.add( apacheClient ); mySqlClient.setScopedInstancePath( "/" + mysql.getName()); mySqlClient.setExternalMapping( app1.getExternalExports()); mySqlClient.switchMessagingType( getMessagingType()); this.clients.add( mySqlClient ); otherClient.setScopedInstancePath( "/" + other.getName()); otherClient.setExternalMapping( app2.getExternalExports()); otherClient.switchMessagingType( getMessagingType()); this.clients.add( otherClient );
tomcatClient.setScopedInstancePath( "/" + tomcat.getName()); tomcatClient.setExternalMapping( app1.getExternalExports()); tomcatClient.switchMessagingType( getMessagingType()); tomcatClient.listenToTheDm( ListenerCommand.START ); tomcatClient.listenToExportsFromOtherAgents( ListenerCommand.START, tomcat ); apacheClient.setScopedInstancePath( "/" + apache.getName()); apacheClient.setExternalMapping( app1.getExternalExports()); apacheClient.switchMessagingType( getMessagingType()); apacheClient.listenToTheDm( ListenerCommand.START ); apacheClient.listenToExportsFromOtherAgents( ListenerCommand.START, apache ); mySqlClient.setScopedInstancePath( "/" + mysql.getName()); mySqlClient.setExternalMapping( app1.getExternalExports()); mySqlClient.switchMessagingType( getMessagingType()); mySqlClient.listenToTheDm( ListenerCommand.START ); mySqlClient.listenToExportsFromOtherAgents( ListenerCommand.START, mysql ); otherClient.setScopedInstancePath( "/" + other.getName()); otherClient.setExternalMapping( app2.getExternalExports()); otherClient.switchMessagingType( getMessagingType()); otherClient.listenToTheDm( ListenerCommand.START ); otherClient.listenToExportsFromOtherAgents( ListenerCommand.START, other );