@Test public void sendDeploymentDeployingMessageTest() throws Exception { AmqpMessageReceiver receiver = new AmqpMessageReceiver(Configuration.amqpAddress, Configuration.amqpUsername, Configuration.amqpPassword, "APPLICATION.pepito.DEPLOYMENT.23.DEPLOYING", true); AmqpBasicListener listener = new AmqpBasicListener(); receiver.setMessageConsumer(listener); Deployment deployment = new Deployment(); deployment.setId(23); deployment.setStatus("DEPLOYING"); AmqpProducer.sendDeploymentDeployingMessage("pepito", deployment); Thread.sleep(700l); assertEquals("APPLICATION.pepito.DEPLOYMENT.23.DEPLOYING", listener.getDestination()); ApplicationManagerMessage amMessageReceived = ModelConverter.jsonToApplicationManagerMessage(listener.getMessage()); assertEquals("pepito", amMessageReceived.getApplicationId()); assertEquals("23", amMessageReceived.getDeploymentId()); assertEquals("DEPLOYING", amMessageReceived.getStatus()); receiver.close(); }
public static void sendDeploymentDeployingMessage(String applicationName, Deployment deployment) { ApplicationManagerMessage amMessage = MessageCreator.fromDeployment(applicationName, deployment, null); AmqpProducer.sendMessage(APPLLICATION_PATH + "." + applicationName + "." + DEPLOYMENT_PATH + "." + deployment.getId() + "." + Dictionary.APPLICATION_STATUS_DEPLOYING, amMessage, true); }
AmqpProducer { public static void sendDeploymentDeployingMessage(String applicationName, Deployment deployment) { ApplicationManagerMessage amMessage = MessageCreator.fromDeployment(applicationName, deployment, null); AmqpProducer.sendMessage(APPLLICATION_PATH + "." + applicationName + "." + DEPLOYMENT_PATH + "." + deployment.getId() + "." + Dictionary.APPLICATION_STATUS_DEPLOYING, amMessage, true); } }
AmqpProducer { public static void sendDeploymentDeployingMessage(String applicationName, Deployment deployment) { ApplicationManagerMessage amMessage = MessageCreator.fromDeployment(applicationName, deployment, null); AmqpProducer.sendMessage(APPLLICATION_PATH + "." + applicationName + "." + DEPLOYMENT_PATH + "." + deployment.getId() + "." + Dictionary.APPLICATION_STATUS_DEPLOYING, amMessage, true); }  }
AmqpProducer { public static void sendDeploymentDeployingMessage(String applicationName, Deployment deployment) { ApplicationManagerMessage amMessage = MessageCreator.fromDeployment(applicationName, deployment, null); AmqpProducer.sendMessage(APPLLICATION_PATH + "." + applicationName + "." + DEPLOYMENT_PATH + "." + deployment.getId() + "." + Dictionary.APPLICATION_STATUS_DEPLOYING, amMessage, true); }  static void sendMessage(String topic, ApplicationManagerMessage message, boolean toLog); static void sendNewApplicationMessage(Application application); static void sendDeploymentSubmittedMessage(Application application); static void sendDeploymentNegotiatingMessage(String applicationName, Deployment deployment); static void sendDeploymentNegotiatedMessage(String applicationName, Deployment deployment); static void sendDeploymentContextualizingMessage(String applicationName, Deployment deployment); static void sendDeploymentContextualizedMessage(String applicationName, Deployment deployment); static void sendDeploymentDeployingMessage(String applicationName, Deployment deployment); static void sendDeploymentDeployedMessage(String applicationName, Deployment deployment); static void sendDeploymentDeletedMessage(String applicationName, Deployment deployment); static void sendDeploymentErrorMessage(String applicationName, Deployment deployment); static void sendVMDeployingMessage(String applicationName, Deployment deployment, VM vm); static void sendVMDeployedMessage(String applicationName, Deployment deployment, VM vm); static void sendVMDeletedMessage(String applicationName, Deployment deployment, VM vm); static void sendDeploymentRenegotiatingMessage(String applicationName, Deployment deployment); static void sendDeploymentRenegotiatedMessage(String applicationName, Deployment deployment); }
AmqpProducer { public static void sendDeploymentDeployingMessage(String applicationName, Deployment deployment) { ApplicationManagerMessage amMessage = MessageCreator.fromDeployment(applicationName, deployment, null); AmqpProducer.sendMessage(APPLLICATION_PATH + "." + applicationName + "." + DEPLOYMENT_PATH + "." + deployment.getId() + "." + Dictionary.APPLICATION_STATUS_DEPLOYING, amMessage, true); }  static void sendMessage(String topic, ApplicationManagerMessage message, boolean toLog); static void sendNewApplicationMessage(Application application); static void sendDeploymentSubmittedMessage(Application application); static void sendDeploymentNegotiatingMessage(String applicationName, Deployment deployment); static void sendDeploymentNegotiatedMessage(String applicationName, Deployment deployment); static void sendDeploymentContextualizingMessage(String applicationName, Deployment deployment); static void sendDeploymentContextualizedMessage(String applicationName, Deployment deployment); static void sendDeploymentDeployingMessage(String applicationName, Deployment deployment); static void sendDeploymentDeployedMessage(String applicationName, Deployment deployment); static void sendDeploymentDeletedMessage(String applicationName, Deployment deployment); static void sendDeploymentErrorMessage(String applicationName, Deployment deployment); static void sendVMDeployingMessage(String applicationName, Deployment deployment, VM vm); static void sendVMDeployedMessage(String applicationName, Deployment deployment, VM vm); static void sendVMDeletedMessage(String applicationName, Deployment deployment, VM vm); static void sendDeploymentRenegotiatingMessage(String applicationName, Deployment deployment); static void sendDeploymentRenegotiatedMessage(String applicationName, Deployment deployment); static final String APPLLICATION_PATH; static final String DEPLOYMENT_PATH; static final String VM_PATH; static final String DELETED; }