Author: adietish
Date: 2011-10-05 17:58:25 -0400 (Wed, 05 Oct 2011)
New Revision: 35401
Modified:
trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/ApplicationIntegrationTest.java
trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/utils/ApplicationUtils.java
Log:
[JBIDE-9854] created test
Modified:
trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/ApplicationIntegrationTest.java
===================================================================
---
trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/ApplicationIntegrationTest.java 2011-10-05
21:56:11 UTC (rev 35400)
+++
trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/ApplicationIntegrationTest.java 2011-10-05
21:58:25 UTC (rev 35401)
@@ -230,14 +230,21 @@
*/
@Test
public void returnsCreationTimeOn2ndApplication() throws Exception {
- String applicationName = ApplicationUtils.createRandomApplicationName();
+ String applicationName = null;
+ String applicationName2 = null;
try {
- IApplication application = service.createApplication(applicationName,
ICartridge.JBOSSAS_7, user);
+ applicationName = ApplicationUtils.createRandomApplicationName();
+ IApplication application = user.createApplication(applicationName,
ICartridge.JBOSSAS_7);
Date creationTime = application.getCreationTime();
assertNotNull(creationTime);
- assertTrue(creationTime.compareTo(new Date()) == -1);
+ applicationName2 = ApplicationUtils.createRandomApplicationName();
+ IApplication application2 = user.createApplication(applicationName2,
ICartridge.JBOSSAS_7);
+ Date creationTime2 = application2.getCreationTime();
+ assertNotNull(creationTime2);
+ assertTrue(creationTime.compareTo(creationTime2) == -1);
} finally {
ApplicationUtils.silentlyDestroyAS7Application(applicationName, user, service);
+ ApplicationUtils.silentlyDestroyAS7Application(applicationName2, user, service);
}
}
}
Modified:
trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/utils/ApplicationUtils.java
===================================================================
---
trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/utils/ApplicationUtils.java 2011-10-05
21:56:11 UTC (rev 35400)
+++
trunk/as/tests/org.jboss.tools.openshift.express.client.test/src/org/jboss/tools/openshift/express/internal/client/test/utils/ApplicationUtils.java 2011-10-05
21:58:25 UTC (rev 35401)
@@ -32,6 +32,9 @@
public static void silentlyDestroyAS7Application(String name, User user,
IOpenshiftService service) {
try {
+ if (name == null) {
+ return;
+ }
service.destroyApplication(name, ICartridge.JBOSSAS_7, user);
} catch (OpenshiftException e) {
e.printStackTrace();
Show replies by date