[embjopr-commits] EMBJOPR SVN: r870 - in branches/EmbJopr-1.4.0-SN-EAP5/jsfunit/src/test/java/org/jboss/jopr/jsfunit: as5 and 3 other directories.

embjopr-commits at lists.jboss.org embjopr-commits at lists.jboss.org
Mon Jan 25 08:07:36 EST 2010


Author: ozizka at redhat.com
Date: 2010-01-25 08:07:36 -0500 (Mon, 25 Jan 2010)
New Revision: 870

Modified:
   branches/EmbJopr-1.4.0-SN-EAP5/jsfunit/src/test/java/org/jboss/jopr/jsfunit/EjtsSelfTest.java
   branches/EmbJopr-1.4.0-SN-EAP5/jsfunit/src/test/java/org/jboss/jopr/jsfunit/EmbJoprTestConstants.java
   branches/EmbJopr-1.4.0-SN-EAP5/jsfunit/src/test/java/org/jboss/jopr/jsfunit/NamedLabels.java
   branches/EmbJopr-1.4.0-SN-EAP5/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/JBossASNodeTest.java
   branches/EmbJopr-1.4.0-SN-EAP5/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/app/ear/EarTest.java
   branches/EmbJopr-1.4.0-SN-EAP5/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/app/rar/RarTest.java
   branches/EmbJopr-1.4.0-SN-EAP5/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/app/war/WarTest.java
Log:
Tests now use dynamic labels.

Modified: branches/EmbJopr-1.4.0-SN-EAP5/jsfunit/src/test/java/org/jboss/jopr/jsfunit/EjtsSelfTest.java
===================================================================
--- branches/EmbJopr-1.4.0-SN-EAP5/jsfunit/src/test/java/org/jboss/jopr/jsfunit/EjtsSelfTest.java	2010-01-21 18:04:00 UTC (rev 869)
+++ branches/EmbJopr-1.4.0-SN-EAP5/jsfunit/src/test/java/org/jboss/jopr/jsfunit/EjtsSelfTest.java	2010-01-25 13:07:36 UTC (rev 870)
@@ -2,15 +2,12 @@
 package org.jboss.jopr.jsfunit;
 
 import java.io.BufferedReader;
-import java.io.FileReader;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.InputStreamReader;
-import java.net.URL;
 import java.util.Map.Entry;
 import java.util.jar.Attributes;
 import java.util.jar.Manifest;
-import java.util.logging.Level;
 import org.apache.cactus.ServletTestCase;
 import org.jboss.jopr.jsfunit.exceptions.EmbJoprTestException;
 import org.jboss.jopr.jsfunit.util.EjtsEnvironmentInfo;

Modified: branches/EmbJopr-1.4.0-SN-EAP5/jsfunit/src/test/java/org/jboss/jopr/jsfunit/EmbJoprTestConstants.java
===================================================================
--- branches/EmbJopr-1.4.0-SN-EAP5/jsfunit/src/test/java/org/jboss/jopr/jsfunit/EmbJoprTestConstants.java	2010-01-21 18:04:00 UTC (rev 869)
+++ branches/EmbJopr-1.4.0-SN-EAP5/jsfunit/src/test/java/org/jboss/jopr/jsfunit/EmbJoprTestConstants.java	2010-01-25 13:07:36 UTC (rev 870)
@@ -17,9 +17,10 @@
 	public static String SYSPROP_CARGO_JBOSS_HOME_DIR = "jsfunit.jboss.home.dir";
 
 
-	public static final String AS_NODE_NAME_FORMAT = "JBoss AS 6 (%s)";
+	// Moved to NamedLabels => ejtt.labels.*
+	//public static final String AS_NODE_NAME_FORMAT = "JBoss AS 6 (%s)";
 	//public static final String AS_NODE_NAME_FORMAT = "JBoss EAP 5 (%s)";
-	public static final String AS_NODE_DESCRIPTION = "JBoss Application Server";
+	//public static final String AS_NODE_DESCRIPTION = "JBoss Application Server";
 	//public static final String AS_NODE_DESCRIPTION = "JBoss Enterprise Application Platform (EAP)";
 
 	public static final String LABEL_AS_SERVERS_SUMMARY = "JBoss Application Server";

Modified: branches/EmbJopr-1.4.0-SN-EAP5/jsfunit/src/test/java/org/jboss/jopr/jsfunit/NamedLabels.java
===================================================================
--- branches/EmbJopr-1.4.0-SN-EAP5/jsfunit/src/test/java/org/jboss/jopr/jsfunit/NamedLabels.java	2010-01-21 18:04:00 UTC (rev 869)
+++ branches/EmbJopr-1.4.0-SN-EAP5/jsfunit/src/test/java/org/jboss/jopr/jsfunit/NamedLabels.java	2010-01-25 13:07:36 UTC (rev 870)
@@ -30,6 +30,9 @@
 	public Labels getLabels() {		return labels;	}
 	private Labels labels;
 	
+	public final String AS_NODE_NAME_FORMAT;
+	public final String AS_NODE_DESCRIPTION;
+
 	public final String NAV_APPLICATIONS;
 	public final String NAV_EJB2;
 	public final String NAV_EJB3;
@@ -45,6 +48,7 @@
 	public final String NAV_HBN;
 
 
+
 	// Const
 
 	/** Creates a Labels object and loads few strings to the named constants. */
@@ -55,6 +59,9 @@
 			log.error(ex);
 		}
 
+		AS_NODE_NAME_FORMAT = this.getLabels().get("AS_NODE_NAME_FORMAT");
+		AS_NODE_DESCRIPTION = this.getLabels().get("AS_NODE_DESCRIPTION");
+
 		NAV_APPLICATIONS = this.getLabels().get("NAV_APPLICATIONS");
     NAV_EJB2 = this.getLabels().get("NAV_EJB2");
     NAV_EJB3 = this.getLabels().get("NAV_EJB3");
@@ -69,7 +76,7 @@
     NAV_JBCACHE = this.getLabels().get("NAV_JBCACHE");
     NAV_HBN = this.getLabels().get("NAV_HBN");
 
-	}
+	}// const
 
 
 

Modified: branches/EmbJopr-1.4.0-SN-EAP5/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/JBossASNodeTest.java
===================================================================
--- branches/EmbJopr-1.4.0-SN-EAP5/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/JBossASNodeTest.java	2010-01-21 18:04:00 UTC (rev 869)
+++ branches/EmbJopr-1.4.0-SN-EAP5/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/JBossASNodeTest.java	2010-01-25 13:07:36 UTC (rev 870)
@@ -13,6 +13,7 @@
 import org.jboss.jopr.jsfunit.AppConstants;
 import org.jboss.jopr.jsfunit.EmbjoprTestCase;
 import org.jboss.jopr.jsfunit.JMXUtils;
+import org.jboss.jopr.jsfunit.NamedLabels;
 import org.jboss.jopr.jsfunit.exceptions.EmbJoprTestException;
 import org.jboss.jopr.jsfunit.util.EmbJoprTestToolkit.ContentInfoTable;
 import org.jboss.jopr.jsfunit.util.EmbJoprTestToolkit.ContentTable;
@@ -28,7 +29,7 @@
 		String jbossConfig = ejtt.getJBossConfig();
 
 		// Go to the AS node.
-		String nodeText = String.format(AS_NODE_NAME_FORMAT, jbossConfig);
+		String nodeText = String.format( ejtt.labels.AS_NODE_NAME_FORMAT, jbossConfig);
 		ejtt.getNavTree().getNodeByLabel(nodeText, true).click();
 
 
@@ -36,7 +37,7 @@
 		String pageText = client.getPageAsText();
 
 		// Whole page contains
-		String pageHeaderText = String.format(AS_NODE_NAME_FORMAT, jbossConfig);
+		String pageHeaderText = String.format( ejtt.labels.AS_NODE_NAME_FORMAT, jbossConfig);
 		//assertTrue("Page doesn't contain the header: "+headerText, pageText.contains(headerText));
 		if( ! client.getElement("content").getTextContent().contains(pageHeaderText) )
 			throw new EmbJoprTestException("Content doesn't contain the header: "+pageHeaderText, this);
@@ -69,7 +70,7 @@
 
 		assertTrue(LABEL_GENERAL_PROPERTIES+" / Version startsWith('"+versionPrefix+"')",
 						properties.getProperty("Version","~not found~").startsWith(versionPrefix) );
-		assertEquals(LABEL_GENERAL_PROPERTIES+" / Description", AS_NODE_DESCRIPTION, properties.get("Description") );
+		assertEquals(LABEL_GENERAL_PROPERTIES+" / Description", ejtt.labels.AS_NODE_DESCRIPTION, properties.get("Description") );
 
 
 		/*

Modified: branches/EmbJopr-1.4.0-SN-EAP5/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/app/ear/EarTest.java
===================================================================
--- branches/EmbJopr-1.4.0-SN-EAP5/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/app/ear/EarTest.java	2010-01-21 18:04:00 UTC (rev 869)
+++ branches/EmbJopr-1.4.0-SN-EAP5/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/app/ear/EarTest.java	2010-01-25 13:07:36 UTC (rev 870)
@@ -282,7 +282,7 @@
 			// Check whether the server is listed. If not, Exception is thrown.
 			ContentTableRow row =
 							ejtt.getTabMenu().getTabContentBox().getTableUnderHeader("JBoss Application Server")
-							.getFirstRowContainingLink( String.format(AS_NODE_NAME_FORMAT, ejtt.getJBossConfig() ) );
+							.getFirstRowContainingLink( String.format( ejtt.labels.AS_NODE_NAME_FORMAT, ejtt.getJBossConfig() ) );
 			// Click the server link
 			//HtmlAnchor link row.getLinkByLabel("JBAS (default)");
 			Node firstLink = row.getCellByColumnName("Name").getElementsByTagName("a").item(0);
@@ -296,7 +296,7 @@
 		{
 			String pageText = client.getPageAsText();
 
-			String headerText = String.format(AS_NODE_NAME_FORMAT, ejtt.getJBossConfig() );
+			String headerText = String.format( ejtt.labels.AS_NODE_NAME_FORMAT, ejtt.getJBossConfig() );
 			assertTrue("Page doesn't contain the header: "+headerText,
 							pageText.contains(headerText));
 

Modified: branches/EmbJopr-1.4.0-SN-EAP5/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/app/rar/RarTest.java
===================================================================
--- branches/EmbJopr-1.4.0-SN-EAP5/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/app/rar/RarTest.java	2010-01-21 18:04:00 UTC (rev 869)
+++ branches/EmbJopr-1.4.0-SN-EAP5/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/app/rar/RarTest.java	2010-01-25 13:07:36 UTC (rev 870)
@@ -147,7 +147,7 @@
 			// Check whether the server is listed. If not, Exception is thrown.
 			ContentTableRow row =
 							ejtt.getTabMenu().getTabContentBox().getTableUnderHeader("JBoss Application Server")
-							.getFirstRowContainingLink( String.format(AS_NODE_NAME_FORMAT, jbossConfig) );
+							.getFirstRowContainingLink( String.format( ejtt.labels.AS_NODE_NAME_FORMAT, jbossConfig) );
 			// Click the server link
 			//HtmlAnchor link row.getLinkByLabel("JBAS (default)");
 			Node firstLink = row.getCellByColumnName("Name").getElementsByTagName("a").item(0);
@@ -162,7 +162,7 @@
 			String pageText = client.getPageAsText();
 
 			String jbossConfig = ejtt.getJBossConfig();
-			String headerText = String.format(AS_NODE_NAME_FORMAT, jbossConfig);
+			String headerText = String.format( ejtt.labels.AS_NODE_NAME_FORMAT, jbossConfig);
 			assertTrue("Page doesn't contain the header: "+headerText,
 							pageText.contains(headerText));
 

Modified: branches/EmbJopr-1.4.0-SN-EAP5/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/app/war/WarTest.java
===================================================================
--- branches/EmbJopr-1.4.0-SN-EAP5/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/app/war/WarTest.java	2010-01-21 18:04:00 UTC (rev 869)
+++ branches/EmbJopr-1.4.0-SN-EAP5/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/app/war/WarTest.java	2010-01-25 13:07:36 UTC (rev 870)
@@ -299,10 +299,12 @@
 			assertTrue("EmbJopr should list at least one server (the one it is running on)" +
 							" and that should be in the UP sate.",
 							client.getPageAsText().contains("UP"));
+			
 			// Check whether the server is listed. If not, Exception is thrown.
 			ContentTableRow row =
 							ejtt.getTabMenu().getTabContentBox().getTableUnderHeader(LABEL_AS_SERVERS_SUMMARY)
-							.getFirstRowContainingLink( String.format(AS_NODE_NAME_FORMAT, jbossConfig)); // "JBoss EAP 5 (...)");
+							.getFirstRowContainingLink( String.format( NamedLabels.getInstance().AS_NODE_NAME_FORMAT, jbossConfig)); // "JBoss EAP 5 (...)");
+
 			// Click the server link
 			//HtmlAnchor link row.getLinkByLabel("JBoss App Server:default");
 			Node firstLink = row.getCellByColumnName("Name").getElementsByTagName("a").item(0);
@@ -317,7 +319,7 @@
 			String pageText = client.getPageAsText();
 
 			String jbossConfig = ejtt.getJBossConfig();
-			String headerText = String.format(AS_NODE_NAME_FORMAT, jbossConfig);
+			String headerText = String.format( NamedLabels.getInstance().AS_NODE_NAME_FORMAT, jbossConfig);
 			assertTrue("Page doesn't contain the header: "+headerText,
 							pageText.contains(headerText));
 



More information about the embjopr-commits mailing list