baseMojo.setDeploymentPlan(new File("deploymentPlan"));
CommandFactoryImpl commandFactory = new CommandFactoryImpl();
Command command = commandFactory.createCommand(baseMojo);
Assert.assertNotNull(command);
Assert.assertEquals("artifact", command.getArtifact());
Assert.assertEquals(new File("deploymentPlan"), command.getDeploymentPlan());
Assert.assertEquals("deploymentFactoryManagerClassName",
command.getDeploymentFactoryManagerClassName());
Assert.assertEquals("deploymentManagerUri", command.getDeploymentManagerURI());
Assert.assertEquals("password", command.getPassword());
Assert.assertEquals("username", command.getUsername());
Assert.assertTrue(command.isVerbose());
Assert.assertEquals(3, command.getTargetList().size());
Assert.assertEquals("server1", command.getTargetList().get(0));
Assert.assertEquals("server2", command.getTargetList().get(1));
Assert.assertEquals("server3", command.getTargetList().get(2));
Assert.assertEquals("ear", command.getModuleType());
// test null module type
baseMojo.setModuleType(null);
command = commandFactory.createCommand(baseMojo);
Assert.assertNull(command.getModuleType());
// test empty module type
baseMojo.setModuleType("");
command = commandFactory.createCommand(baseMojo);
Assert.assertNull(command.getModuleType());
}