[embjopr-commits] EMBJOPR SVN: r400 - in trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit: as5/app/ejb and 1 other directory.

embjopr-commits at lists.jboss.org embjopr-commits at lists.jboss.org
Thu May 7 15:23:02 EDT 2009


Author: ozizka at redhat.com
Date: 2009-05-07 15:23:02 -0400 (Thu, 07 May 2009)
New Revision: 400

Modified:
   trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/AppConstants.java
   trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/app/ejb/
   trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/app/ejb/EjbTest.java
Log:
EjbTest updated

Modified: trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/AppConstants.java
===================================================================
--- trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/AppConstants.java	2009-05-07 19:09:52 UTC (rev 399)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/AppConstants.java	2009-05-07 19:23:02 UTC (rev 400)
@@ -119,7 +119,7 @@
     // Test Archives
 
 		// EJB 3.0
-    public static final String BASIC_JAR = "deployment-ejb.jar";
+    public static final String BASIC_EJB2 = "deployment-ejb.jar";
     public static final String BASIC_EJB3 = "basic-ejb3.jar";
 
 


Property changes on: trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/app/ejb
___________________________________________________________________
Name: svn:ignore
   + EjbTest_.java


Modified: trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/app/ejb/EjbTest.java
===================================================================
--- trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/app/ejb/EjbTest.java	2009-05-07 19:09:52 UTC (rev 399)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/app/ejb/EjbTest.java	2009-05-07 19:23:02 UTC (rev 400)
@@ -43,10 +43,12 @@
  */
 public class EjbTest extends ApplicationTestBaseAS5 {
 
+	public static final DeployableTypes APP_TYPE = DeployableTypes.EJB2;
+
+
 	/**
 	  * @return the suite of tests being tested
 	*/
-
 	public static Test suite()
 	{
 		return new TestSuite(EjbTest.class);
@@ -64,10 +66,11 @@
 
 	public void testBasicEjbDeployment() throws IOException, EmbJoprTestException
 	{
-		log.info(DebugUtils.getCurrentMethodFullName());
 
+		final String DEPLOYABLE_NAME = BASIC_EJB2;
+
 		// Navigate to EJB Applications
-		HtmlAnchor ejbLink = getNavTreeLink(NAV_EJB2);
+		HtmlAnchor ejbLink = getNavTreeLink(APP_TYPE.getNavTreeLabel());
 		ejbLink.click();
 
 		// click on the "Add new resource" button
@@ -76,11 +79,11 @@
 		// TODO: "/ejb/BASIC_JAR" causes exceptions in seam:
 		// http://wwwapps.rdu.redhat.com/w3xpastebin/pastebin.php?show=9842
 
-		String filePath = System.getProperty("jsfunit.testdata") + "/ejb/"+BASIC_JAR;
-		log.info("Uploading EJB archive: "+filePath);
+		String filePath = ejtt.getTestDataDir() + "/"+APP_TYPE.getDataDir()+"/"+DEPLOYABLE_NAME;
+		log.info("Uploading EJB2 archive: "+filePath);
 		File uploadFile = new File(filePath);
 		if( !uploadFile.exists() )
-			throw new EmbJoprTestException("Can't find EJB file to upload: '"+filePath+"'");
+			throw new EmbJoprTestException("Can't find EJB2 file to upload: '"+filePath+"'");
 
 		// upload ejb
 		HtmlFileInput fileInput = (HtmlFileInput)client.getElement("createContentForm:file");
@@ -88,7 +91,7 @@
 		fileInput.setValueAttribute(filePath);
 		client.click("createContentForm:addButton");
 
-		log.info("HTTP status after EJB upload: "+client.getContentPage().getWebResponse().getStatusCode());
+		log.info("HTTP status after EJB2 upload: "+client.getContentPage().getWebResponse().getStatusCode());
 		log.info("renderResponse() called: " + server.getFacesContext().getRenderResponse() );
 		log.info("responseComplete() called: " + server.getFacesContext().getResponseComplete() );
 
@@ -100,27 +103,33 @@
 
 		// FAILS because of NPE and HTTP 500.
 		// assert that the success message appeared on the client side
-		assertTrue("Success message not found."+errorMessage, client.getPageAsText().contains("Resource " + BASIC_JAR + " created successfully!"));
+		assertTrue("Success message not found."+errorMessage, client.getPageAsText().contains("Resource " + DEPLOYABLE_NAME + " created successfully!"));
 
 		// assert text and severity level for FacesMessage on server side
 		assertTrue(server.getFacesMessages().hasNext());
 		FacesMessage successMessage = server.getFacesMessages().next();
 		assertTrue(FacesMessage.SEVERITY_INFO.equals(successMessage.getSeverity()));
-		assertTrue(successMessage.getDetail().contains("Resource " + BASIC_JAR + " created successfully!"));
+		assertTrue(successMessage.getDetail().contains("Resource " + DEPLOYABLE_NAME + " created successfully!"));
 
 		assertFalse("Page contains 'Total: 0', EJBs probably not listed.",  client.getPageAsText().contains("Total: 0"));
 
 
 		// Use JMX to assert that the EJB components really did deploy successfully
-		assertTrue(isEJBDeployed(BASIC_JAR));
+		assertTrue(isEJBDeployed(DEPLOYABLE_NAME));
 
 		// Undeploy the EJB JAR 
-		HtmlButtonInput deleteButton = getAppDeleteButton(BASIC_JAR);
+		HtmlButtonInput deleteButton = getAppDeleteButton(DEPLOYABLE_NAME);
 		deleteButton.click();
 
-		assertTrue(client.getPageAsText().contains(EJB2_DEL_MSG + " '" + BASIC_JAR +"'."));
+		assertTrue("Page doesn't contain success message.", client.getPageAsText().contains(EJB2_DEL_MSG + " '" + DEPLOYABLE_NAME +"'."));
 
-		assertFalse(isEJBDeployed(BASIC_JAR));
-	}
+		assertFalse("Deployable seems not to be deployed: "+DEPLOYABLE_NAME, isEJBDeployed(DEPLOYABLE_NAME));
+		
+	}// testBasicEjbDeployment()
 
-}
+	
+
+}// class
+
+
+




More information about the embjopr-commits mailing list