[embjopr-commits] EMBJOPR SVN: r153 - trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5.

embjopr-commits at lists.jboss.org embjopr-commits at lists.jboss.org
Mon Feb 16 15:15:10 EST 2009


Author: ozizka at redhat.com
Date: 2009-02-16 15:15:08 -0500 (Mon, 16 Feb 2009)
New Revision: 153

Modified:
   trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/EjbTest.java
Log:
EJB test: log messages added to see whether we get HTTP 500; + basic check wheter EJB is listed after deployment.

Modified: trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/EjbTest.java
===================================================================
--- trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/EjbTest.java	2009-02-13 17:16:43 UTC (rev 152)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/EjbTest.java	2009-02-16 20:15:08 UTC (rev 153)
@@ -22,20 +22,14 @@
 
 package org.jboss.jopr.jsfunit.as5;
 
+import java.util.logging.Level;
+import java.util.logging.Logger;
 import org.jboss.jopr.jsfunit.*;
 import com.gargoylesoftware.htmlunit.html.*;
 import java.io.IOException;
-import java.util.*;
 import junit.framework.Test;
 import junit.framework.TestSuite;
-import java.util.Map;
 import javax.faces.application.FacesMessage;
-import javax.faces.context.FacesContext;
-import javax.servlet.http.HttpServletRequest;
-import com.gargoylesoftware.htmlunit.WebClient;
-import javax.management.MBeanServer;
-import javax.management.ObjectName;
-import org.jboss.mx.util.MBeanServerLocator;
 
 
 
@@ -82,8 +76,13 @@
 		fileInput.setValueAttribute(System.getProperty("jsfunit.testdata") + "/ejb/BASIC_JAR");
 		client.click("createContentForm:addButton");
 
+		log.info("HTTP status after EJB upload: "+client.getContentPage().getWebResponse().getStatusCode());
+		log.info("renderResponse() called: " + server.getFacesContext().getRenderResponse() );
+		log.info("responseComplete() called: " + server.getFacesContext().getResponseComplete() );
+
+		// FAILS because of NPE and HTTP 500.
 		// assert that the success message appeared on the client side
-		assertTrue(client.getPageAsText().contains("Resource " + BASIC_JAR + " created successfully!"));
+		assertTrue("Success message not found.", client.getPageAsText().contains("Resource " + BASIC_JAR + " created successfully!"));
 
 		// assert text and severity level for FacesMessage on server side
 		assertTrue(server.getFacesMessages().hasNext());
@@ -91,6 +90,11 @@
 		assertTrue(FacesMessage.SEVERITY_INFO.equals(successMessage.getSeverity()));
 		assertTrue(successMessage.getDetail().contains("Resource " + BASIC_JAR + " created successfully!"));
 
+
+		// TODO: Check if listed. See EMBJOPR-74.
+		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));
 




More information about the embjopr-commits mailing list