Author: ozizka(a)redhat.com
Date: 2009-07-14 14:11:59 -0400 (Tue, 14 Jul 2009)
New Revision: 556
Modified:
trunk/jsfunit/
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/ApplicationTestBaseAS5.java
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/EmbjoprTestCase.java
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/app/ejb/EjbTestBase.java
Log:
Ejb20 tests updated
Property changes on: trunk/jsfunit
___________________________________________________________________
Name: svn:ignore
- nb-configuration.xml
TEST-TestSuite-01.xsl
CHANGES.txt
pom_1.xml
TEST-TestSuite-02.xsl
pom_05-XSLT.xml
pom_3.xml
pom_2.xml
pom_pure_maven.xml
target
TEST-TestSuite.xsl
pom_4.xml
nbactions.xml
+ nb-configuration.xml
TEST-TestSuite-01.xsl
parent
CHANGES.txt
pom_1.xml
TEST-TestSuite-02.xsl
pom_05-XSLT.xml
pom_3.xml
pom_2.xml
pom_pure_maven.xml
target
TEST-TestSuite.xsl
pom_4.xml
nbactions.xml
Modified: trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/ApplicationTestBaseAS5.java
===================================================================
---
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/ApplicationTestBaseAS5.java 2009-07-13
14:18:10 UTC (rev 555)
+++
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/ApplicationTestBaseAS5.java 2009-07-14
18:11:59 UTC (rev 556)
@@ -166,19 +166,19 @@
/* RAR */
public boolean isRarDeployed(String rarName) throws RuntimeException
- {
- try {
- String query = "jboss.deployment:id=\"vfszip:" +
-
System.getProperty("jsfunit.deploy.dir") + "/" + rarName +
"/\",*";
- //String query =
String.format("jboss.deployment:id=\"vfszip:%s/%s/\",*",
- //
System.getProperty("jsfunit.deploy.dir"), rarName );
+ {
+ try {
+ String query = "jboss.deployment:id=\"vfszip:" +
+ System.getProperty("jsfunit.deploy.dir") + "/" + rarName +
"/\",*";
+ //String query =
String.format("jboss.deployment:id=\"vfszip:%s/%s/\",*",
+ // System.getProperty("jsfunit.deploy.dir"),
rarName );
- return isMBeanStateDeployedByQuery(query);
- }
- catch (Exception e) {
- throw new RuntimeException(e);
- }
- }
+ return isMBeanStateDeployedByQuery(query);
+ }
+ catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
/* RAR in EAR */
Modified: trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/EmbjoprTestCase.java
===================================================================
--- trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/EmbjoprTestCase.java 2009-07-13
14:18:10 UTC (rev 555)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/EmbjoprTestCase.java 2009-07-14
18:11:59 UTC (rev 556)
@@ -93,6 +93,7 @@
* because setUp() is called before each test, a new HttpSession will be
* created each time a test is run.
*/
+ @Override
public void setUp() throws IOException
{
@@ -172,7 +173,7 @@
*/
public HtmlAnchor getNavTreeLink(String linkLabel)
{
- return getLinkInsideForm("navTreeForm", linkLabel);
+ return getLinkInsideForm("navTreeForm", linkLabel);
}
/**
@@ -181,14 +182,14 @@
*/
public HtmlButtonInput getDeleteButton(String formId, String resourceName)
{
- HtmlAnchor link = getLinkInsideForm(formId, resourceName);
- // The id will look like
"resourceSummaryForm:dataTable:2:resourceName"
- // I need the row number. (2 in the above example)
- String id = link.getIdAttribute();
- String[] idElements = id.split(":");
- String row = idElements[idElements.length - 2];
- // resourceSummaryForm:dataTable:2:removeButton
- return (HtmlButtonInput)client.getElement(formId + ":dataTable:" + row
+ ":removeButton");
+ HtmlAnchor link = getLinkInsideForm(formId, resourceName);
+ // The id will look like "resourceSummaryForm:dataTable:2:resourceName"
+ // I need the row number. (2 in the above example)
+ String id = link.getIdAttribute();
+ String[] idElements = id.split(":");
+ String row = idElements[idElements.length - 2];
+ // resourceSummaryForm:dataTable:2:removeButton
+ return (HtmlButtonInput)client.getElement(formId + ":dataTable:" + row +
":removeButton");
}
/**
@@ -196,19 +197,19 @@
*/
public HtmlAnchor getLinkInsideForm(String formId, String linkLabel)
{
- HtmlForm form = (HtmlForm)client.getElement(formId);
- List links = form.getByXPath(".//a"); // get all <a> tags inside
form
+ HtmlForm form = (HtmlForm)client.getElement(formId);
+ List links = form.getByXPath(".//a"); // get all <a> tags inside form
- for (Iterator i = links.iterator(); i.hasNext();)
- {
- HtmlAnchor link = (HtmlAnchor)i.next();
- String linkText = link.getTextContent();
-
- linkText = linkText.trim(); // ignore any leading or trailing spaces
- if (linkText.equals(linkLabel)) return link;
- }
+ for (Iterator i = links.iterator(); i.hasNext();)
+ {
+ HtmlAnchor link = (HtmlAnchor)i.next();
+ String linkText = link.getTextContent();
- throw new IllegalStateException("Link for '"+ linkLabel
+"' not found in form #"+formId);
+ linkText = linkText.trim(); // ignore any leading or trailing spaces
+ if (linkText.equals(linkLabel)) return link;
+ }
+
+ throw new IllegalStateException("Link for '"+ linkLabel +"' not
found in form #"+formId);
}
/**
Modified: trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/app/ejb/EjbTestBase.java
===================================================================
---
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/app/ejb/EjbTestBase.java 2009-07-13
14:18:10 UTC (rev 555)
+++
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/app/ejb/EjbTestBase.java 2009-07-14
18:11:59 UTC (rev 556)
@@ -76,6 +76,8 @@
final String DEPLOYABLE_NAME = getArchiveNameBasic();
+ DebugUtils.writeFile("target/noForm.html", client.getPageAsText());///
+
try {
// Navigate to EJB Applications
HtmlAnchor ejbLink = getNavTreeLink(APP_TYPE.getNavTreeLabel());
@@ -159,7 +161,7 @@
Upload the fixed the achive, redeploy and
verify the archive has been successfully deployed.
*/
- public void testEjbDeployBadAndRedeploy() throws IOException,
HtmlElementNotFoundException, ActionNotAvailableException {
+ public void testEjbDeployBadAndRedeploy() throws IOException,
HtmlElementNotFoundException, ActionNotAvailableException, EmbJoprTestException {
final String REDEPLOY_JAR_NAME = getArchiveNameRedeploy();
@@ -183,7 +185,7 @@
assertTrue(FacesMessage.SEVERITY_INFO.equals(successMessage.getSeverity()));
assertTrue(successMessage.getDetail().contains("Resource " +
REDEPLOY_JAR_NAME + " created successfully!"));
// Use JMX to assert that the EJB components really did deploy successfully.
- assertTrue("JMX should report " + REDEPLOY_JAR_NAME + " as
deployed.", isEJBDeployed(REDEPLOY_JAR_NAME));
+ assertTrue("JMX should report " + REDEPLOY_JAR_NAME + " as
deployed.", ejtt.deployment.isDeployedAccordingToJMX(APP_TYPE, REDEPLOY_JAR_NAME));
}
finally {
Show replies by date