/** Test execution with a valid <code>RefId</code>. */ public void testExecuteWhenUsingValidRefId() { Project antProject = new Project(); antProject.init(); this.task.setProject(antProject); this.task.setId("testRefId"); this.task.setHome("home"); this.task.execute(); CargoTask task2 = new CargoTask(); task2.setProject(antProject); task2.setRefId(new Reference("testRefId")); task2.setAction("start"); task2.execute(); }
/** Test the creation of a container with one deployable. */ public void testMakeContainerWithOneDeployable() { CargoTask task = new CargoTask(); task.setContainerId("resin2x"); task.setType(ContainerType.INSTALLED); ConfigurationElement configurationElement = task.createConfiguration(); configurationElement.setType("standalone"); DeployableElement warElement = new DeployableElement(); warElement.setType(DeployableType.WAR.getType()); warElement.setFile("some/war"); configurationElement.addConfiguredDeployable(warElement); configurationElement.setHome("somewhere"); LocalContainer container = (LocalContainer) task.makeContainer(); assertEquals( Resin2xStandaloneLocalConfiguration.class.getName(), container.getConfiguration().getClass().getName()); assertEquals(1, container.getConfiguration().getDeployables().size()); Deployable deployable = container.getConfiguration().getDeployables().get(0); assertEquals(WAR.class.getName(), deployable.getClass().getName()); assertEquals("some/war", deployable.getFile()); }