EMBJOPR SVN: r911 - branches/EmbJopr-1.4.0-SN-EAP5/jsfunit.
by embjopr-commits@lists.jboss.org
Author: ozizka(a)redhat.com
Date: 2010-04-06 20:06:55 -0400 (Tue, 06 Apr 2010)
New Revision: 911
Modified:
branches/EmbJopr-1.4.0-SN-EAP5/jsfunit/pom.xml
Log:
* POM reorganized.
Modified: branches/EmbJopr-1.4.0-SN-EAP5/jsfunit/pom.xml
===================================================================
--- branches/EmbJopr-1.4.0-SN-EAP5/jsfunit/pom.xml 2010-04-02 17:33:06 UTC (rev 910)
+++ branches/EmbJopr-1.4.0-SN-EAP5/jsfunit/pom.xml 2010-04-07 00:06:55 UTC (rev 911)
@@ -1,10 +1,17 @@
<?xml version="1.0"?>
+<!--
+ - metainfo
+ - deps
+ - profiles
+ - build
+ -->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<properties>
+ <container></container> <!-- jboss5x | jboss6x -->
<as5></as5>
<as6></as6>
@@ -510,9 +517,9 @@
<configuration>
<wait>false</wait>
<container>
- <containerId>jboss5x</containerId>
+ <containerId>${container}</containerId>
<home>${JBOSS_HOME}</home> <!-- Binaries used by Cargo. -->
- <log>${basedir}/target/jboss5x-logs/cargo.log</log>
+ <log>${basedir}/target/${container}-logs/cargo.log</log>
<timeout>420000</timeout> <!-- 7 minutes -->
<systemProperties>
<!-- Used in jboss-log4j.xml. See /testdata/... -->
@@ -562,7 +569,7 @@
</configfile>
<!-- Open Tomcat's HTTP logging valve -->
<configfile>
- <file>${basedir}/testdata/jboss-configuration/deploy/jbossweb.sar/server.xml</file>
+ <file>${basedir}/testdata/${container}-configuration/deploy/jbossweb.sar/server.xml</file>
<tofile>deploy/jbossweb.sar/server.xml</tofile>
</configfile>
<!-- JMX Console Users -->
@@ -584,19 +591,21 @@
<!-- Deploy the test files -->
<files>
+ <!-- Only for 5.x -->
<copy>
<file>${basedir}/testdata/destinations</file>
<toDir>deploy</toDir>
</copy>
+
<copy>
<file>${basedir}/testdata/datasources/testFiles</file>
<toDir>deploy</toDir>
</copy>
- <copy>
+ <copy>
<file>${basedir}/testdata/connfactories</file>
<toDir>deploy</toDir>
- </copy>
- <copy>
+ </copy>
+ <copy>
<file>${basedir}/testdata/rar/embjoprtestadapter.rar</file>
<toDir>deploy</toDir>
</copy>
@@ -626,91 +635,20 @@
+ <!--=============================================================
+ == JBoss 5.x ==
+ =============================================================-->
<profile>
<id>jboss5x</id>
<properties>
<jboss5x>true</jboss5x>
+ <container>jboss5x</container>
</properties>
<build>
<plugins>
- <!-- AntRun - Exctract the war to let Cargo plugin deploy it. -->
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-antrun-plugin</artifactId>
- <executions>
- <!-- Extract WAR (SEAM bug) - rename to _archive.war and unzip to a .war dir. . -->
- <execution>
- <id>extract_war_for_cargo</id>
- <phase>package</phase> <goals><goal>run</goal></goals>
- <configuration><tasks>
- <echo>Extracting war...</echo>
- <move file="${project.build.directory}/${project.build.finalName}.${project.packaging}"
- toFile="${project.build.directory}/${project.build.finalName}_archive.${project.packaging}"/>
- <unzip src="${project.build.directory}/${project.build.finalName}_archive.${project.packaging}"
- dest="${project.build.directory}/${project.build.finalName}.${project.packaging}"/>
- <echo> *** Disabling navtree AJAX... *** </echo>
- <replace file="${project.build.directory}/${project.build.finalName}.${project.packaging}/WEB-INF/facelets/resourceNavigation.xhtml"
- token="switchType="ajax" value="switchType="server"/>
- </tasks></configuration>
- </execution>
- <!-- Write "Don't kill" to hudson log/ -->
- <execution>
- <id>dont_kill_appeal</id>
- <phase>pre-integration-test</phase> <goals><goal>run</goal></goals>
- <configuration><tasks>
- <echo>########################## Please don't kill this job unless it takes more than four hours.</echo>
- <echo>########################## There's no logging visible on Hudson during test run.</echo>
- </tasks></configuration>
- </execution>
- <!-- Delete the exploded WAR and rename the archive back. -->
- <execution>
- <id>rename-the-artifact-back</id>
- <phase>post-integration-test</phase> <goals><goal>run</goal></goals>
- <configuration><tasks>
- <echo>Renaming exploded war and renaming the zip back to the artifact name.</echo>
- <move file="${project.build.directory}/${project.build.finalName}.${project.packaging}" toFile="${project.build.directory}/${project.build.finalName}_exploded.${project.packaging}"/>
- <move file="${project.build.directory}/${project.build.finalName}_archive.${project.packaging}"
- toFile="${project.build.directory}/${project.build.finalName}.${project.packaging}"/>
- </tasks></configuration>
- </execution>
- </executions>
- </plugin>
-
- <!-- Exctract the war to let Cargo plugin deploy it.
- <plugin>
- <artifactId>maven-dependency-plugin</artifactId>
- <executions>
- <execution>
- <id>explode-war</id>
- <phase>pre-integration-test</phase>
- <goals>
- <goal>unpack</goal>
- </goals>
- <configuration>
- <outputDirectory>${project.build.directory}/${project.build.finalName}_for_cargo_EMBJOPR-235.${project.packaging}</outputDirectory>
- <overWriteReleases>true</overWriteReleases>
- <overWriteSnapshots>true</overWriteSnapshots>
- <includes>**\/*</includes>
- <excludes></excludes>
- <artifactItems>
- <artifactItem>
- <groupId>org.jboss.jopr</groupId>
- <artifactId>jopr-embedded-jsfunit</artifactId>
- <version>${project.version}</version>
- <type>war</type>
- </artifactItem>
- </artifactItems>
- </configuration>
- </execution>
- </executions>
- </plugin>
- -->
-
-
-
<!-- Surefire plugin (for AS 5) -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
@@ -788,64 +726,46 @@
</executions>
</plugin>
- <!-- XSLT plugin - To separate the reports by package. Each execution separates one. -->
- <!-- Disabled - bug:
- javax.xml.transform.TransformerException: javax.xml.transform.TransformerException:
- com.sun.org.apache.xml.internal.utils.WrappedRuntimeException: Premature end of file.
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>xslt-maven-plugin</artifactId>
- <executions>
- <execution><id>xslt-as5</id><phase>post-integration-test</phase><goals><goal>transform</goal></goals>
- <configuration>
- <fileNameReplacement>TEST-org.jboss.jopr.jsfunit.as5.xml</fileNameReplacement>
- <parameters><packageName>org.jboss.jopr.jsfunit.as5.</packageName></parameters>
- </configuration>
- </execution>
- <execution><id>xslt-war</id><phase>post-integration-test</phase><goals><goal>transform</goal></goals>
- <configuration>
- <fileNameReplacement>TEST-org.jboss.jopr.jsfunit.as5.app.war.xml</fileNameReplacement>
- <parameters><packageName>org.jboss.jopr.jsfunit.as5.app.war.</packageName></parameters>
- </configuration>
- </execution>
- <execution><id>xslt-ear</id><phase>post-integration-test</phase><goals><goal>transform</goal></goals>
- <configuration>
- <fileNameReplacement>TEST-org.jboss.jopr.jsfunit.as5.app.ear.xml</fileNameReplacement>
- <parameters><packageName>org.jboss.jopr.jsfunit.as5.app.ear.</packageName></parameters>
- </configuration>
- </execution>
- <execution><id>xslt-rar</id><phase>post-integration-test</phase><goals><goal>transform</goal></goals>
- <configuration>
- <fileNameReplacement>TEST-org.jboss.jopr.jsfunit.as5.app.rar.xml</fileNameReplacement>
- <parameters><packageName>org.jboss.jopr.jsfunit.as5.app.rar.</packageName></parameters>
- </configuration>
- </execution>
- <execution><id>xslt-ejb</id><phase>post-integration-test</phase><goals><goal>transform</goal></goals>
- <configuration>
- <fileNameReplacement>TEST-org.jboss.jopr.jsfunit.as5.app.ejb.xml</fileNameReplacement>
- <parameters><packageName>org.jboss.jopr.jsfunit.as5.app.ejb.</packageName></parameters>
- </configuration>
- </execution>
- <execution><id>xslt-datasources</id><phase>post-integration-test</phase><goals><goal>transform</goal></goals>
- <configuration>
- <fileNameReplacement>TEST-org.jboss.jopr.jsfunit.as5.app.datasources.xml</fileNameReplacement>
- <parameters><packageName>org.jboss.jopr.jsfunit.as5.app.datasources.</packageName></parameters>
- </configuration>
- </execution>
- <execution><id>xslt-jmsDestinations</id><phase>post-integration-test</phase><goals><goal>transform</goal></goals>
- <configuration>
- <fileNameReplacement>TEST-org.jboss.jopr.jsfunit.as5.app.jmsDestinations.xml</fileNameReplacement>
- <parameters><packageName>org.jboss.jopr.jsfunit.as5.app.jmsDestinations.</packageName></parameters>
- </configuration>
- </execution>
- </executions>
- </plugin>
- -->
-
</plugins>
</build>
</profile>
+
+ <!--=============================================================
+ == JBoss 6.x ==
+ =============================================================-->
+ <profile>
+ <id>jboss6x</id>
+ <properties>
+ <as6>true</as6>
+ <container>jboss6x</container>
+ </properties>
+
+ <!-- Exclude Seam's java.util.logging stuff to prevent java.lang.StackOverflowError
+ at org.jboss.logmanager.ExtLogRecord.<init>(ExtLogRecord.java:77) [jboss-logmanager.jar:] -->
+ <!-- But how? This would work for core, when creating the WAR.
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>jboss-seam</artifactId>
+ <version>${seam.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>jboss-seam-jul</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+ -->
+
+ </profile>
+
+
+
+
<!-- Debug profile - waits for debugger connection at port 4000.
The right time to connect is when Cargo plugin starts the server. -->
<profile>
@@ -1111,7 +1031,51 @@
<plugins>
+
+ <!-- AntRun - Exctract the war to let Cargo plugin deploy it. Originally in the jboss5x profile. -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <!-- Extract WAR (SEAM bug) - rename to _archive.war and unzip to a .war dir. . -->
+ <execution>
+ <id>extract_war_for_cargo</id>
+ <phase>package</phase> <goals><goal>run</goal></goals>
+ <configuration><tasks>
+ <echo>Extracting war...</echo>
+ <move file="${project.build.directory}/${project.build.finalName}.${project.packaging}"
+ toFile="${project.build.directory}/${project.build.finalName}_archive.${project.packaging}"/>
+ <unzip src="${project.build.directory}/${project.build.finalName}_archive.${project.packaging}"
+ dest="${project.build.directory}/${project.build.finalName}.${project.packaging}"/>
+ <echo> *** Disabling navtree AJAX... *** </echo>
+ <replace file="${project.build.directory}/${project.build.finalName}.${project.packaging}/WEB-INF/facelets/resourceNavigation.xhtml"
+ token="switchType="ajax" value="switchType="server"/>
+ </tasks></configuration>
+ </execution>
+ <!-- Write "Don't kill" to hudson log/ -->
+ <execution>
+ <id>dont_kill_appeal</id>
+ <phase>pre-integration-test</phase> <goals><goal>run</goal></goals>
+ <configuration><tasks>
+ <echo>########################## Please don't kill this job unless it takes more than four hours.</echo>
+ <echo>########################## There's no logging visible on Hudson during test run.</echo>
+ </tasks></configuration>
+ </execution>
+ <!-- Delete the exploded WAR and rename the archive back. -->
+ <execution>
+ <id>rename-the-artifact-back</id>
+ <phase>post-integration-test</phase> <goals><goal>run</goal></goals>
+ <configuration><tasks>
+ <echo>Renaming exploded war and renaming the zip back to the artifact name.</echo>
+ <move file="${project.build.directory}/${project.build.finalName}.${project.packaging}" toFile="${project.build.directory}/${project.build.finalName}_exploded.${project.packaging}"/>
+ <move file="${project.build.directory}/${project.build.finalName}_archive.${project.packaging}"
+ toFile="${project.build.directory}/${project.build.finalName}.${project.packaging}"/>
+ </tasks></configuration>
+ </execution>
+ </executions>
+ </plugin>
+
<!-- WAR: Add data to manifest, add JBoss Cache client JAR. -->
<plugin>
<artifactId>maven-war-plugin</artifactId>
14 years, 10 months
EMBJOPR SVN: r910 - in branches/EmbJopr-1.4.0-SN-EAP5/jsfunit: src/test/java/org/jboss/jopr/jsfunit/as5 and 3 other directories.
by embjopr-commits@lists.jboss.org
Author: ozizka(a)redhat.com
Date: 2010-04-02 13:33:06 -0400 (Fri, 02 Apr 2010)
New Revision: 910
Added:
branches/EmbJopr-1.4.0-SN-EAP5/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/connfactories/SubPoolStatsParser.java
branches/EmbJopr-1.4.0-SN-EAP5/jsfunit/src/test/java/org/jboss/jopr/jsfunit/util/ValuesMapValidator.java
Modified:
branches/EmbJopr-1.4.0-SN-EAP5/jsfunit/
branches/EmbJopr-1.4.0-SN-EAP5/jsfunit/pom.xml
branches/EmbJopr-1.4.0-SN-EAP5/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/ResourceTestBase.java
branches/EmbJopr-1.4.0-SN-EAP5/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/connfactories/ConnFactoryOperationsTest.java
branches/EmbJopr-1.4.0-SN-EAP5/jsfunit/testdata/war/
Log:
* POM: Moved Cargo to start-stop-server
* Fixed ConnectionFactories tests
Property changes on: branches/EmbJopr-1.4.0-SN-EAP5/jsfunit
___________________________________________________________________
Name: svn:ignore
- 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
target-233of308
+ 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
target-233of308
target-EAP501CR1-37of308
target-ConnFactories
Modified: branches/EmbJopr-1.4.0-SN-EAP5/jsfunit/pom.xml
===================================================================
--- branches/EmbJopr-1.4.0-SN-EAP5/jsfunit/pom.xml 2010-04-01 13:45:34 UTC (rev 909)
+++ branches/EmbJopr-1.4.0-SN-EAP5/jsfunit/pom.xml 2010-04-02 17:33:06 UTC (rev 910)
@@ -491,90 +491,17 @@
</plugins></build>
</profile>
- <profile>
- <id>jboss5x</id>
-
- <properties>
- <jboss5x>true</jboss5x>
- </properties>
- <build>
- <plugins>
- <!-- AntRun - Exctract the war to let Cargo plugin deploy it. -->
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-antrun-plugin</artifactId>
- <executions>
- <!-- Extract WAR (SEAM bug) - rename to _archive.war and unzip to a .war dir. . -->
- <execution>
- <id>extract_war_for_cargo</id>
- <phase>package</phase> <goals><goal>run</goal></goals>
- <configuration><tasks>
- <echo>Extracting war...</echo>
- <move file="${project.build.directory}/${project.build.finalName}.${project.packaging}"
- toFile="${project.build.directory}/${project.build.finalName}_archive.${project.packaging}"/>
- <unzip src="${project.build.directory}/${project.build.finalName}_archive.${project.packaging}"
- dest="${project.build.directory}/${project.build.finalName}.${project.packaging}"/>
- <echo> *** Disabling navtree AJAX... *** </echo>
- <replace file="${project.build.directory}/${project.build.finalName}.${project.packaging}/WEB-INF/facelets/resourceNavigation.xhtml"
- token="switchType="ajax" value="switchType="server"/>
- </tasks></configuration>
- </execution>
- <!-- Write "Don't kill" to hudson log/ -->
- <execution>
- <id>dont_kill_appeal</id>
- <phase>pre-integration-test</phase> <goals><goal>run</goal></goals>
- <configuration><tasks>
- <echo>########################## Please don't kill this job unless it takes more than four hours.</echo>
- <echo>########################## There's no logging visible on Hudson during test run.</echo>
- </tasks></configuration>
- </execution>
- <!-- Delete the exploded WAR and rename the archive back. -->
- <execution>
- <id>rename-the-artifact-back</id>
- <phase>post-integration-test</phase> <goals><goal>run</goal></goals>
- <configuration><tasks>
- <echo>Renaming exploded war and renaming the zip back to the artifact name.</echo>
- <move file="${project.build.directory}/${project.build.finalName}.${project.packaging}" toFile="${project.build.directory}/${project.build.finalName}_exploded.${project.packaging}"/>
- <move file="${project.build.directory}/${project.build.finalName}_archive.${project.packaging}"
- toFile="${project.build.directory}/${project.build.finalName}.${project.packaging}"/>
- </tasks></configuration>
- </execution>
- </executions>
- </plugin>
- <!-- Exctract the war to let Cargo plugin deploy it.
- <plugin>
- <artifactId>maven-dependency-plugin</artifactId>
- <executions>
- <execution>
- <id>explode-war</id>
- <phase>pre-integration-test</phase>
- <goals>
- <goal>unpack</goal>
- </goals>
- <configuration>
- <outputDirectory>${project.build.directory}/${project.build.finalName}_for_cargo_EMBJOPR-235.${project.packaging}</outputDirectory>
- <overWriteReleases>true</overWriteReleases>
- <overWriteSnapshots>true</overWriteSnapshots>
- <includes>**\/*</includes>
- <excludes></excludes>
- <artifactItems>
- <artifactItem>
- <groupId>org.jboss.jopr</groupId>
- <artifactId>jopr-embedded-jsfunit</artifactId>
- <version>${project.version}</version>
- <type>war</type>
- </artifactItem>
- </artifactItems>
- </configuration>
- </execution>
- </executions>
- </plugin>
- -->
+ <profile>
+ <id>start-stop-server</id>
+ <activation> <property><name>cargo</name></property> </activation>
+ <build>
+ <plugins>
+
<!-- Cargo plugin (for AS 5) -->
<plugin>
<groupId>org.codehaus.cargo</groupId>
@@ -692,6 +619,98 @@
</executions>
</plugin>
+ </plugins></build>
+ </profile>
+
+
+
+
+
+ <profile>
+ <id>jboss5x</id>
+
+ <properties>
+ <jboss5x>true</jboss5x>
+ </properties>
+ <build>
+ <plugins>
+
+
+ <!-- AntRun - Exctract the war to let Cargo plugin deploy it. -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <!-- Extract WAR (SEAM bug) - rename to _archive.war and unzip to a .war dir. . -->
+ <execution>
+ <id>extract_war_for_cargo</id>
+ <phase>package</phase> <goals><goal>run</goal></goals>
+ <configuration><tasks>
+ <echo>Extracting war...</echo>
+ <move file="${project.build.directory}/${project.build.finalName}.${project.packaging}"
+ toFile="${project.build.directory}/${project.build.finalName}_archive.${project.packaging}"/>
+ <unzip src="${project.build.directory}/${project.build.finalName}_archive.${project.packaging}"
+ dest="${project.build.directory}/${project.build.finalName}.${project.packaging}"/>
+ <echo> *** Disabling navtree AJAX... *** </echo>
+ <replace file="${project.build.directory}/${project.build.finalName}.${project.packaging}/WEB-INF/facelets/resourceNavigation.xhtml"
+ token="switchType="ajax" value="switchType="server"/>
+ </tasks></configuration>
+ </execution>
+ <!-- Write "Don't kill" to hudson log/ -->
+ <execution>
+ <id>dont_kill_appeal</id>
+ <phase>pre-integration-test</phase> <goals><goal>run</goal></goals>
+ <configuration><tasks>
+ <echo>########################## Please don't kill this job unless it takes more than four hours.</echo>
+ <echo>########################## There's no logging visible on Hudson during test run.</echo>
+ </tasks></configuration>
+ </execution>
+ <!-- Delete the exploded WAR and rename the archive back. -->
+ <execution>
+ <id>rename-the-artifact-back</id>
+ <phase>post-integration-test</phase> <goals><goal>run</goal></goals>
+ <configuration><tasks>
+ <echo>Renaming exploded war and renaming the zip back to the artifact name.</echo>
+ <move file="${project.build.directory}/${project.build.finalName}.${project.packaging}" toFile="${project.build.directory}/${project.build.finalName}_exploded.${project.packaging}"/>
+ <move file="${project.build.directory}/${project.build.finalName}_archive.${project.packaging}"
+ toFile="${project.build.directory}/${project.build.finalName}.${project.packaging}"/>
+ </tasks></configuration>
+ </execution>
+ </executions>
+ </plugin>
+
+ <!-- Exctract the war to let Cargo plugin deploy it.
+ <plugin>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>explode-war</id>
+ <phase>pre-integration-test</phase>
+ <goals>
+ <goal>unpack</goal>
+ </goals>
+ <configuration>
+ <outputDirectory>${project.build.directory}/${project.build.finalName}_for_cargo_EMBJOPR-235.${project.packaging}</outputDirectory>
+ <overWriteReleases>true</overWriteReleases>
+ <overWriteSnapshots>true</overWriteSnapshots>
+ <includes>**\/*</includes>
+ <excludes></excludes>
+ <artifactItems>
+ <artifactItem>
+ <groupId>org.jboss.jopr</groupId>
+ <artifactId>jopr-embedded-jsfunit</artifactId>
+ <version>${project.version}</version>
+ <type>war</type>
+ </artifactItem>
+ </artifactItems>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ -->
+
+
+
<!-- Surefire plugin (for AS 5) -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Modified: branches/EmbJopr-1.4.0-SN-EAP5/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/ResourceTestBase.java
===================================================================
--- branches/EmbJopr-1.4.0-SN-EAP5/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/ResourceTestBase.java 2010-04-01 13:45:34 UTC (rev 909)
+++ branches/EmbJopr-1.4.0-SN-EAP5/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/ResourceTestBase.java 2010-04-02 17:33:06 UTC (rev 910)
@@ -38,8 +38,10 @@
import java.util.LinkedHashMap;
import java.util.Properties;
import org.apache.commons.lang.StringUtils;
+import org.jboss.jopr.jsfunit.as5.connfactories.SubPoolStatsParser;
import org.jboss.jopr.jsfunit.util.EmbJoprTestToolkit.NavTreeNode;
import org.jboss.jopr.jsfunit.exceptions.*;
+import org.jboss.jopr.jsfunit.util.ValuesMapValidator;
import org.jboss.jsfunit.jsfsession.ComponentIDNotFoundException;
/**
@@ -592,28 +594,92 @@
StringBuffer expectedBuffer,
String errorMessage,
Boolean isRegEx) throws Exception {
- performResourceOperation(resourceCategory, resourceSubCategory,
+ performResourceOperation(resourceCategory, resourceSubCategory,
resourceName, operationName, takesParameters);
-
+
// Get the result of the operation
HtmlDivision historyPanel = (HtmlDivision)client.getElement(OPERATION_RESULTS);
- HtmlTextArea resultTextBox = (HtmlTextArea)historyPanel.getFirstByXPath(".//textarea[@class='property-value-input']");
+ HtmlTextArea resultTextBox = (HtmlTextArea)historyPanel.getFirstByXPath(".//textarea[@class='property-value-input']");
assertNotNull("Could not get the result of the operation", resultTextBox);
-
+
String actualResult = resultTextBox.getText();
+ validateMatchOrEqualityWithFail( expectedBuffer.toString(), actualResult, errorMessage, isRegEx );
+
+ }
+
+ /**
+ * @returns null if OK, error message if not OK.
+ */
+ private String validateMatchOrEquality( String exp, String act, boolean isRegEx ){
+ act = StringUtils.defaultString( act, "~null~" );
boolean isSuccess = isRegEx
- ? actualResult.matches(expectedBuffer.toString())
- : actualResult.contains(expectedBuffer.toString()) ;
+ ? act.matches(exp)
+ : act.contains(exp) ;
String condVerb = isRegEx ? "match" : "contain";
if( !isSuccess ){
- fail(errorMessage + " - \nexpected the result to "+condVerb+":\n\n>>>" + expectedBuffer.toString() + "<<<\n\nbut was:\n\n>>>" + actualResult + "<<<" );
+ String LINES = exp.contains("\n") || act.contains("\n") ? "\n\n" : "";
+ return "expected the result to "+condVerb+":"+LINES+"{{{"+exp+"}}}"+LINES+"but was:"+LINES+"{{{"+act+"}}}";
}
-
+ return null;
+ }
+
+ /**
+ * Calls #validateMatchOrEquality( String, String, true ) if exp starts with "@REGEX:"; otherwise with false.
+ */
+ private String validateMatchOrEquality( String exp, String act ){
+ if( exp.startsWith( REGEX_PREFIX ) ){
+ exp = exp.substring( REGEX_PREFIX.length() );
+ return validateMatchOrEquality(exp, act, true);
+ }
+ return validateMatchOrEquality(exp, act, false);
+ }
+
+ public void validateMatchOrEqualityWithFail( String exp, String act, String errorMessagePrefix ){
+ String errString = validateMatchOrEquality( exp, act );
+ if( null != errString )
+ fail( errorMessagePrefix + errString );
+ }
+ public void validateMatchOrEqualityWithFail( String exp, String act, String errorMessagePrefix, boolean isRegEx ){
+ String errString = validateMatchOrEquality( exp, act, isRegEx );
+ if( null != errString )
+ fail( errorMessagePrefix + errString );
+ }
+
+
+
+ /** Validates the given map (not a StringBuffer). */
+ protected void performResourceOperationAndCheckValueBox(String resourceCategory,
+ String resourceSubCategory,
+ String resourceName,
+ String operationName,
+ Boolean takesParameters,
+ Map<String, Object> expectedValues,
+ String errorMessage,
+ Boolean isRegEx) throws Exception {
+ performResourceOperation(resourceCategory, resourceSubCategory,
+ resourceName, operationName, takesParameters);
+
+ // Get the result of the operation
+ HtmlDivision historyPanel = (HtmlDivision)client.getElement(OPERATION_RESULTS);
+ HtmlTextArea resultTextBox = (HtmlTextArea)historyPanel.getFirstByXPath(".//textarea[@class='property-value-input']");
+
+ assertNotNull("Could not get the result of the operation", resultTextBox);
+
+ String actualResult = resultTextBox.getText();
+
+ String err = ValuesMapValidator.CONTAINS_ALL.validate(expectedValues, SubPoolStatsParser.parse(actualResult));
+
+ if( null != err ){
+ fail("Unexpected result values: >>>" + actualResult + "<<<\n\nError message:\n"+err );
+ }
+
}
-
+
+
+
/**
* Perform the given operation for the given resource and
* then check that the resulting table contains the correct values.
@@ -650,7 +716,10 @@
// The list of properties to check is not taken from the table, but given by the test.
Properties properties = ejtt.tabMenu.getTabContentBox().getTable(table).getProperties();
for( String key : expectedValues.keySet() ){
- assertEquals("Incorrect value for '" + key + "' - ", expectedValues.get(key), properties.getProperty(key));
+ //assertEquals("Incorrect value for '" + key + "' - ", expectedValues.get(key), properties.getProperty(key));
+ String expVal = expectedValues.get(key);
+ String actVal = properties.getProperty(key); // StringUtils.defaultString( properties.getProperty(key), "~null~" );
+ validateMatchOrEqualityWithFail( expVal, actVal, key+": " );
}
}
Modified: branches/EmbJopr-1.4.0-SN-EAP5/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/connfactories/ConnFactoryOperationsTest.java
===================================================================
--- branches/EmbJopr-1.4.0-SN-EAP5/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/connfactories/ConnFactoryOperationsTest.java 2010-04-01 13:45:34 UTC (rev 909)
+++ branches/EmbJopr-1.4.0-SN-EAP5/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/connfactories/ConnFactoryOperationsTest.java 2010-04-02 17:33:06 UTC (rev 910)
@@ -25,10 +25,13 @@
import junit.framework.Test;
import junit.framework.TestSuite;
import java.util.ArrayList;
+import java.util.HashMap;
import java.util.Map;
import java.util.LinkedHashMap;
import javax.resource.cci.Connection;
+import org.jboss.jopr.jsfunit.as5.ResourceTestBase;
import org.jboss.managed.api.ComponentType;
+import org.jboss.util.Strings.Range;
/**
* This class contains operations tests for Connection Factories.
@@ -330,12 +333,21 @@
expectedBuffer.append("Connections Destroyed Count:0\n");
expectedBuffer.append("Connections In Use Count:6\n");
expectedBuffer.append(".*");
+
+ // ^^^ NOT USED ^^^ //
+
+ Map<String, Object> expVals = new HashMap();
+ expVals.put("Sub Pool Count", 1);
+ expVals.put("Available Connections Count", 14);
+ expVals.put("Max Connections In Use Count", new Range(6,8)); // Give it some tolerance - sometimes we get 7 or 8 too.
+ expVals.put("Connections Destroyed Count", 0);
+ expVals.put("Connections In Use Count", 6);
- String errorMessage = "Incorrect sub pool statistics";
+ String errorMessage = "Incorrect sub pool statistics ";
performResourceOperationAndCheckValueBox(CF_NAV_LABEL, cfType.getLabel(),
jndiName, LIST_FORMATTED_SUB_POOL_STATISTICS,
- Boolean.TRUE, expectedBuffer, errorMessage, true);
+ Boolean.TRUE, expVals, errorMessage, true);
} finally {
// Clean up
@@ -423,13 +435,15 @@
connections.get(i).close();
connections.set(i, null);
}
-
+
+ /*
// Set up the expected results
StringBuffer expectedBuffer = new StringBuffer();
expectedBuffer.append("Sub Pool Statistics: \n");
expectedBuffer.append("Sub Pool Count: 1\n");
expectedBuffer.append(POOL_SEPARATOR);
expectedBuffer.append("\n\n");
+ */
// Deprecated property, was removed - JBAS-6918
/*if(cfType == CFType.NO_TX_CF) {
@@ -437,18 +451,30 @@
} else {
expectedBuffer.append("Track By Transaction: true\n");
}*/
-
+
+ /*
expectedBuffer.append("Available Connections Count: 12\n");
expectedBuffer.append("Max Connections In Use Count:1(0|1|2)\n"); // Sometimes old conns are counted.
expectedBuffer.append("Connections Destroyed Count:0\n");
expectedBuffer.append("Connections In Use Count:8");
expectedBuffer.append(".*");
+ */
+
+
+ Map<String, Object> expVals = new HashMap();
+
+ expVals.put("Sub Pool Count", 1);
+ expVals.put("Available Connections Count", 12);
+ expVals.put("Max Connections In Use Count", new Range(10, 12) ); // Sometimes old conns are counted.
+ expVals.put("Connections Destroyed Count", 0);
+ expVals.put("Connections In Use Count", 8);
+
String errorMessage = "Incorrect sub pool statistics";
performResourceOperationAndCheckValueBox(CF_NAV_LABEL, cfType.getLabel(),
jndiName, LIST_FORMATTED_SUB_POOL_STATISTICS,
- Boolean.TRUE, expectedBuffer, errorMessage, true);
+ Boolean.TRUE, expVals, errorMessage, true);
} finally {
// Clean up
@@ -501,8 +527,7 @@
// Additional statistics that need to be checked
expectedStatistics.put("criteria", "ByApplication");
- expectedStatistics.put("name", "jboss.jca:service=ManagedConnectionFactory,name="
- + jndiName);
+ expectedStatistics.put("name", "jboss.jca:service=ManagedConnectionFactory,name=" + jndiName);
expectedStatistics.put("subPoolCount", "0");
expectedStatistics.put("totalConnectionsInUseCount", "0");
//expectedStatistics.put("totalMaxConnectionsInUseCount", "0"); // Sometimes we get 1 - old connection is counted.
@@ -600,7 +625,7 @@
+ jndiName);
expectedStatistics.put("subPoolCount", "1");
expectedStatistics.put("totalConnectionsInUseCount", "6");
- expectedStatistics.put("totalMaxConnectionsInUseCount", "6");
+ expectedStatistics.put("totalMaxConnectionsInUseCount", REGEX_PREFIX+"[678]");
performResourceOperationAndCheckTable(CF_NAV_LABEL, cfType.getLabel(), jndiName,
LIST_STATISTICS, Boolean.FALSE, expectedStatistics);
@@ -706,7 +731,7 @@
+ jndiName);
expectedStatistics.put("subPoolCount", "1");
expectedStatistics.put("totalConnectionsInUseCount", "8");
- expectedStatistics.put("totalMaxConnectionsInUseCount", "10");
+ expectedStatistics.put("totalMaxConnectionsInUseCount", REGEX_PREFIX+"1[01]");
performResourceOperationAndCheckTable(CF_NAV_LABEL, cfType.getLabel(), jndiName,
LIST_STATISTICS, Boolean.FALSE, expectedStatistics);
Added: branches/EmbJopr-1.4.0-SN-EAP5/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/connfactories/SubPoolStatsParser.java
===================================================================
--- branches/EmbJopr-1.4.0-SN-EAP5/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/connfactories/SubPoolStatsParser.java (rev 0)
+++ branches/EmbJopr-1.4.0-SN-EAP5/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/connfactories/SubPoolStatsParser.java 2010-04-02 17:33:06 UTC (rev 910)
@@ -0,0 +1,52 @@
+
+package org.jboss.jopr.jsfunit.as5.connfactories;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.StringTokenizer;
+import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang.math.NumberUtils;
+
+/**
+ * Parses info like this:
+ *
+ Sub Pool Statistics:
+ Sub Pool Count: 1
+ ------------------------------------------------------
+
+ Available Connections Count: 12
+ Max Connections In Use Count:10
+ Connections Destroyed Count:0
+ Connections In Use Count:8
+ ...
+ *
+ * @author Ondrej Zizka
+ */
+public class SubPoolStatsParser {
+
+ public static Map<String, Integer> parse( String str )
+ {
+
+ Map<String, Integer> values = new HashMap();
+
+ StringTokenizer tok = new StringTokenizer(str, "\n\r");
+
+ while( tok.hasMoreTokens() ){
+ String line = tok.nextToken();
+ line = line.replace("-", "").trim();
+ if( line.length() == 0 ) continue;
+
+ String[] parts = line.split(":");
+ if( parts.length < 2 ) continue;
+
+ values.put( parts[0], NumberUtils.createInteger( parts[1].trim() ) );
+ }
+
+ return values;
+
+ }
+
+
+
+
+}// class
Added: branches/EmbJopr-1.4.0-SN-EAP5/jsfunit/src/test/java/org/jboss/jopr/jsfunit/util/ValuesMapValidator.java
===================================================================
--- branches/EmbJopr-1.4.0-SN-EAP5/jsfunit/src/test/java/org/jboss/jopr/jsfunit/util/ValuesMapValidator.java (rev 0)
+++ branches/EmbJopr-1.4.0-SN-EAP5/jsfunit/src/test/java/org/jboss/jopr/jsfunit/util/ValuesMapValidator.java 2010-04-02 17:33:06 UTC (rev 910)
@@ -0,0 +1,61 @@
+
+package org.jboss.jopr.jsfunit.util;
+
+import java.util.Map;
+import org.apache.commons.lang.ObjectUtils;
+import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang.math.NumberUtils;
+import org.jboss.util.Strings.Range;
+
+/**
+ *
+ * @author Ondrej Zizka
+ */
+public interface ValuesMapValidator {
+
+ /** Returns null if values are OK, or validation error description when validation fails. */
+ public String validate( Map<String, ? extends Object> expected, Map<String, ? extends Object> actual );
+
+ /** Checks whether the actual values map contains the set defined by expected values map. */
+ public static final ValuesMapValidator CONTAINS_ALL = new ValuesMapValidator() {
+ public String validate( Map<String, ? extends Object> exp, Map<String, ? extends Object> act ){
+
+ StringBuilder sb = new StringBuilder();
+
+ for( Map.Entry<String, ? extends Object> expectedEntry : exp.entrySet() )
+ {
+ String key = expectedEntry.getKey();
+ if( !act.containsKey(key) )
+ sb.append(key+": Not found.");
+
+ Object valExp = exp.get(key);
+ Object valAct = act.get(key);
+
+ // Range
+ if( valExp instanceof Range ){
+ Long numAct = NumberUtils.createLong( ObjectUtils.toString(valAct) );
+ Range range = (Range)valExp;
+ if( numAct < range.begin || numAct > range.end )
+ sb.append( String.format( key + ": Expected between %d and %d, was '%d'.", range.begin, range.end, numAct ) );
+ }
+ // String
+ else{
+ String strExp = ObjectUtils.toString( exp.get(key), "null" );
+ String strAct = ObjectUtils.toString( act.get(key), "null" );
+
+ if( !StringUtils.equals( strExp, strAct ) ){
+ sb.append( String.format( key + ": Expected '%s', actual '%s'.\n", strExp, strAct ) );
+ }
+ }
+ }
+
+ if( sb.length() == 0 )
+ return null;
+
+ return sb.toString();
+
+ }
+ };
+
+
+}// class
Property changes on: branches/EmbJopr-1.4.0-SN-EAP5/jsfunit/testdata/war
___________________________________________________________________
Name: svn:ignore
+ HQL-error-Tomcat-WAR.png
ExpirationException.png
14 years, 10 months
EMBJOPR SVN: r909 - branches/EmbJopr-1.4.0-SN-EAP5.
by embjopr-commits@lists.jboss.org
Author: ozizka(a)redhat.com
Date: 2010-04-01 09:45:34 -0400 (Thu, 01 Apr 2010)
New Revision: 909
Modified:
branches/EmbJopr-1.4.0-SN-EAP5/pom.xml
Log:
POM: RHQ 3.0.0 deps
Modified: branches/EmbJopr-1.4.0-SN-EAP5/pom.xml
===================================================================
--- branches/EmbJopr-1.4.0-SN-EAP5/pom.xml 2010-03-31 21:57:29 UTC (rev 908)
+++ branches/EmbJopr-1.4.0-SN-EAP5/pom.xml 2010-04-01 13:45:34 UTC (rev 909)
@@ -64,11 +64,11 @@
<seam.embedded.groupId>org.jboss.seam.embedded</seam.embedded.groupId>
<!-- dependency versions -->
+ <jopr.version>3.0.0-SNAPSHOT</jopr.version>
+ <rhq.version>3.0.0-SNAPSHOT</rhq.version>
<jaxb-api.version>2.1</jaxb-api.version>
<jaxb-impl.version>2.1.6</jaxb-impl.version>
- <jopr.version>1.4.0-SNAPSHOT</jopr.version>
<richfaces.version>3.3.3.BETA1</richfaces.version> <!-- 3.3.2.SR1 -->
- <rhq.version>1.4.0-SNAPSHOT</rhq.version>
<seam.version>2.1.0.SP1</seam.version>
<seam.embedded.version>beta3.SP3</seam.embedded.version>
<!-- This is a special patched version of not-yet-released Facelets 1.1.15,
14 years, 10 months