[seam-commits] Seam SVN: r11558 - branches/enterprise/JBPAPP_5_0/src/test/ftest/seamgen/src/main/org/jboss/seam/test/functional/seamgen.
seam-commits at lists.jboss.org
seam-commits at lists.jboss.org
Thu Oct 8 10:26:16 EDT 2009
Author: mgencur at redhat.com
Date: 2009-10-08 10:26:16 -0400 (Thu, 08 Oct 2009)
New Revision: 11558
Modified:
branches/enterprise/JBPAPP_5_0/src/test/ftest/seamgen/src/main/org/jboss/seam/test/functional/seamgen/NewProjectTest.java
branches/enterprise/JBPAPP_5_0/src/test/ftest/seamgen/src/main/org/jboss/seam/test/functional/seamgen/SeleniumSeamGenTest.java
branches/enterprise/JBPAPP_5_0/src/test/ftest/seamgen/src/main/org/jboss/seam/test/functional/seamgen/VehicleTest.java
Log:
JBPAPP-2897 Created automated test method in seamgen testsuite, method for testing difference between explode and restart
Modified: branches/enterprise/JBPAPP_5_0/src/test/ftest/seamgen/src/main/org/jboss/seam/test/functional/seamgen/NewProjectTest.java
===================================================================
--- branches/enterprise/JBPAPP_5_0/src/test/ftest/seamgen/src/main/org/jboss/seam/test/functional/seamgen/NewProjectTest.java 2009-10-08 13:54:01 UTC (rev 11557)
+++ branches/enterprise/JBPAPP_5_0/src/test/ftest/seamgen/src/main/org/jboss/seam/test/functional/seamgen/NewProjectTest.java 2009-10-08 14:26:16 UTC (rev 11558)
@@ -75,4 +75,37 @@
assertTrue(browser.isElementPresent(LOGIN), "User should not be logged in.");
assertTrue(browser.getText(MESSAGES).contains(LOGIN_FAILED_MESSAGE), LOGIN_FAILED_MESSAGE + " expected.");
}
+
+ /**
+ * This method tests a difference between ./seam explode and ./seam restart . Calling the former
+ * one should not cause application redeploy.
+ *
+ */
+ @Test(groups = { "newProjectGroup" })
+ public void explodeAndRestartDifferenceTest()
+ {
+ login();
+ // verify login
+ assertTrue(browser.isElementPresent(LOGOUT), "Logout link expected.");
+ assertTrue(browser.getText(SIGNED_USER).contains(DEFAULT_USERNAME), "Username not found. " + browser.getText(SIGNED_USER) + " found instead.");
+ // logout
+
+ boolean explode = seamGen.isExplode();
+ seamGen.setExplode(true);
+ seamGen.hotDeploy();
+ seamGen.setExplode(explode);
+
+ try
+ {
+ Thread.sleep(HOTDEPLOY_TIMEOUT);
+ }
+ catch (InterruptedException ie)
+ {
+ throw new RuntimeException(ie);
+ }
+
+ browser.refreshAndWait();
+ assertTrue(browser.isElementPresent(LOGOUT),
+ "Logout link expected. This means that the application was redeployed and caused the user not to be logged in");
+ }
}
Modified: branches/enterprise/JBPAPP_5_0/src/test/ftest/seamgen/src/main/org/jboss/seam/test/functional/seamgen/SeleniumSeamGenTest.java
===================================================================
--- branches/enterprise/JBPAPP_5_0/src/test/ftest/seamgen/src/main/org/jboss/seam/test/functional/seamgen/SeleniumSeamGenTest.java 2009-10-08 13:54:01 UTC (rev 11557)
+++ branches/enterprise/JBPAPP_5_0/src/test/ftest/seamgen/src/main/org/jboss/seam/test/functional/seamgen/SeleniumSeamGenTest.java 2009-10-08 14:26:16 UTC (rev 11558)
@@ -54,6 +54,8 @@
public static final String DEFAULT_USERNAME = "admin";
public static final String DEFAULT_PASSWORD = "";
+
+ protected static Long HOTDEPLOY_TIMEOUT = 30000L;
public static SeamSelenium browser;
Modified: branches/enterprise/JBPAPP_5_0/src/test/ftest/seamgen/src/main/org/jboss/seam/test/functional/seamgen/VehicleTest.java
===================================================================
--- branches/enterprise/JBPAPP_5_0/src/test/ftest/seamgen/src/main/org/jboss/seam/test/functional/seamgen/VehicleTest.java 2009-10-08 13:54:01 UTC (rev 11557)
+++ branches/enterprise/JBPAPP_5_0/src/test/ftest/seamgen/src/main/org/jboss/seam/test/functional/seamgen/VehicleTest.java 2009-10-08 14:26:16 UTC (rev 11558)
@@ -43,6 +43,9 @@
public static final String VIEW_MAKE = "xpath=id('make')/div/span[2]";
public static final String VIEW_MODEL = "xpath=id('model')/div/span[2]";
public static final String VIEW_YEAR = "xpath=id('year')/div/span[2]";
+
+ protected static String REGISTRATION_TEXT = "Registration";
+ protected static String ERROR_TEXT = "An Error Occurred";
@Test(groups = "generate-entitiesTest", dependsOnGroups = { "newProjectGroup" })
public void newVehicleTest()
@@ -139,14 +142,36 @@
assertTrue(browser.isElementPresent(String.format(VEHICLE_LIST_ROW_BY_OWNER_NAME, registration, username)), "Person not assigned to vehicle.");
}
+ /**
+ * This method verifies that JBSEAM3866 issue is already resolved
+ */
@Test(groups = "generate-entitiesTest", dependsOnGroups = { "newProjectGroup" })
- public void searchTest()
+ public void testForJBSEAM3866()
{
- final String searchString = "9999999"; // should return two Audis
-
login();
browser.clickAndWait(VEHICLE_LINK);
- assertEquals(search(searchString), 2, "Unexpected number of search results for " + searchString);
+ assertTrue(browser.isTextPresent(REGISTRATION_TEXT),
+ "Page should contain text Registration");
+
+ boolean explode = seamGen.isExplode();
+ seamGen.setExplode(true);
+ seamGen.hotDeploy();
+ seamGen.setExplode(explode);
+
+ try
+ {
+ Thread.sleep(HOTDEPLOY_TIMEOUT);
+ }
+ catch (InterruptedException ie)
+ {
+ throw new RuntimeException(ie);
+ }
+
+ browser.refreshAndWait();
+ assertTrue(browser.isTextPresent(REGISTRATION_TEXT),
+ "Page should contain text Registration, which indicates that the error JBSEAM3866 is not present anymore");
+ assertTrue(!browser.isTextPresent(ERROR_TEXT),
+ "Page contains \"ERROR_TEXT\" which means that JBSEAM3866 error still exists");
}
public int search(String pattern)
More information about the seam-commits
mailing list