EMBJOPR SVN: r106 - in trunk/jsfunit: src/main/webapp and 4 other directories.
by embjopr-commits@lists.jboss.org
Author: stan.silvert(a)jboss.com
Date: 2009-01-13 16:39:30 -0500 (Tue, 13 Jan 2009)
New Revision: 106
Added:
trunk/jsfunit/src/main/webapp/WEB-INF/classes/
trunk/jsfunit/src/main/webapp/WEB-INF/classes/cactus.properties
trunk/jsfunit/src/main/webapp/cactus-report.xsl
Modified:
trunk/jsfunit/pom.xml
trunk/jsfunit/src/main/webapp/WEB-INF/web.xml
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/EmbjoprTestCase.java
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/DatasourceTest.java
Log:
Revert to HtmlUnit 2.3 and add support for kicking off tests from the browser.
Modified: trunk/jsfunit/pom.xml
===================================================================
--- trunk/jsfunit/pom.xml 2009-01-13 00:47:57 UTC (rev 105)
+++ trunk/jsfunit/pom.xml 2009-01-13 21:39:30 UTC (rev 106)
@@ -28,7 +28,22 @@
</pluginRepositories>
<dependencies>
+
+ <!-- Dropping back to HtmlUnit 2.3 with Rhino until bug can be addressed -->
<dependency>
+ <groupId>net.sourceforge.htmlunit</groupId>
+ <artifactId>htmlunit</artifactId>
+ <scope>compile</scope>
+ <version>2.3</version>
+ </dependency>
+ <dependency>
+ <groupId>rhino</groupId>
+ <artifactId>js</artifactId>
+ <scope>compile</scope>
+ <version>1.7R1</version>
+ </dependency>
+
+ <dependency>
<groupId>org.jboss.jsfunit</groupId>
<artifactId>jboss-jsfunit-core</artifactId>
<version>1.0.0.GA-SNAPSHOT</version>
@@ -38,6 +53,10 @@
<groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>
</exclusion>
+ <exclusion>
+ <groupId>net.sourceforge.htmlunit</groupId>
+ <artifactId>htmlunit</artifactId>
+ </exclusion>
</exclusions>
</dependency>
<dependency>
Added: trunk/jsfunit/src/main/webapp/WEB-INF/classes/cactus.properties
===================================================================
--- trunk/jsfunit/src/main/webapp/WEB-INF/classes/cactus.properties (rev 0)
+++ trunk/jsfunit/src/main/webapp/WEB-INF/classes/cactus.properties 2009-01-13 21:39:30 UTC (rev 106)
@@ -0,0 +1 @@
+cactus.servletRedirectorName=ServletRedirector.jsfunit
\ No newline at end of file
Modified: trunk/jsfunit/src/main/webapp/WEB-INF/web.xml
===================================================================
--- trunk/jsfunit/src/main/webapp/WEB-INF/web.xml 2009-01-13 00:47:57 UTC (rev 105)
+++ trunk/jsfunit/src/main/webapp/WEB-INF/web.xml 2009-01-13 21:39:30 UTC (rev 106)
@@ -69,7 +69,7 @@
<servlet-mapping>
<servlet-name>ServletTestRunner</servlet-name>
- <url-pattern>/ServletTestRunner</url-pattern>
+ <url-pattern>/ServletTestRunner.jsfunit</url-pattern>
</servlet-mapping>
Added: trunk/jsfunit/src/main/webapp/cactus-report.xsl
===================================================================
--- trunk/jsfunit/src/main/webapp/cactus-report.xsl (rev 0)
+++ trunk/jsfunit/src/main/webapp/cactus-report.xsl 2009-01-13 21:39:30 UTC (rev 106)
@@ -0,0 +1,355 @@
+<?xml version="1.0"?>
+<!--
+ The Apache Software License, Version 1.1
+
+ Copyright (c) 2001-2003 The Apache Software Foundation. All rights
+ reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ 1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in
+ the documentation and/or other materials provided with the
+ distribution.
+
+ 3. The end-user documentation included with the redistribution, if
+ any, must include the following acknowlegement:
+ "This product includes software developed by the
+ Apache Software Foundation (http://www.apache.org/)."
+ Alternately, this acknowlegement may appear in the software itself,
+ if and wherever such third-party acknowlegements normally appear.
+
+ 4. The names "The Jakarta Project", "Cactus", and "Apache Software
+ Foundation" must not be used to endorse or promote products derived
+ from this software without prior written permission. For written
+ permission, please contact apache(a)apache.org.
+
+ 5. Products derived from this software may not be called "Apache"
+ nor may "Apache" appear in their names without prior written
+ permission of the Apache Group.
+
+ THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ SUCH DAMAGE.
+ ====================================================================
+
+ This software consists of voluntary contributions made by many
+ individuals on behalf of the Apache Software Foundation. For more
+ information on the Apache Software Foundation, please see
+ <http://www.apache.org/>.
+ -->
+
+<!--
+
+ Sample stylesheet to be used with the Cactus ServletTestRunner output.
+ Based on the file junit-noframes.xsl from Apache Ant 1.5.
+
+ @author Stephane Bailliez <a href="mailto:sbailliez@apache.org"/>
+ @author Erik Hatcher <a href="mailto:ehatcher@apache.org"/>
+ @author Christopher Lenz <a href="mailto:cmlenz@apache.org"/>
+
+-->
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+ <xsl:output method="html" indent="yes" encoding="US-ASCII"/>
+ <xsl:decimal-format decimal-separator="." grouping-separator="," />
+ <xsl:template match="testsuites">
+ <html>
+ <head>
+ <style type="text/css">
+ body {
+ font:normal 68% verdana,arial,helvetica;
+ color:#000000;
+ }
+ table tr td, table tr th {
+ font-size: 68%;
+ }
+ table.details tr th{
+ font-weight: bold;
+ text-align:left;
+ background:#a6caf0;
+ }
+ table.details tr td{
+ background:#eeeee0;
+ }
+
+ p {
+ line-height:1.5em;
+ margin-top:0.5em; margin-bottom:1.0em;
+ }
+ h1 {
+ margin: 0px 0px 5px; font: 165% verdana,arial,helvetica
+ }
+ h2 {
+ margin-top: 1em; margin-bottom: 0.5em; font: bold 125% verdana,arial,helvetica
+ }
+ h3 {
+ margin-bottom: 0.5em; font: bold 115% verdana,arial,helvetica
+ }
+ h4 {
+ margin-bottom: 0.5em; font: bold 100% verdana,arial,helvetica
+ }
+ h5 {
+ margin-bottom: 0.5em; font: bold 100% verdana,arial,helvetica
+ }
+ h6 {
+ margin-bottom: 0.5em; font: bold 100% verdana,arial,helvetica
+ }
+ .Error {
+ font-weight:bold; color:red;
+ }
+ .Failure {
+ font-weight:bold; color:purple;
+ }
+ </style>
+ </head>
+ <body>
+ <a name="top"></a>
+ <xsl:call-template name="header"/>
+ <xsl:call-template name="summary"/>
+ <hr size="1" width="95%" align="left"/>
+ <xsl:call-template name="classes"/>
+ </body>
+ </html>
+ </xsl:template>
+
+ <xsl:template name="header">
+ <h1>Unit Test Results</h1>
+ <table width="100%">
+ <tr>
+ <td align="left"></td>
+ <td align="right">
+ Designed for use with
+ <a href='http://jakarta.apache.org/cactus/'>Cactus</a>.
+ </td>
+ </tr>
+ </table>
+ <hr size="1"/>
+ </xsl:template>
+
+ <xsl:template name="summary">
+ <h2>Summary</h2>
+ <xsl:variable name="testCount" select="sum(testsuite/@tests)"/>
+ <xsl:variable name="errorCount" select="sum(testsuite/@errors)"/>
+ <xsl:variable name="failureCount" select="sum(testsuite/@failures)"/>
+ <xsl:variable name="timeCount" select="sum(testsuite/@time)"/>
+ <xsl:variable name="successRate" select="($testCount - $failureCount - $errorCount) div $testCount"/>
+ <table class="details" border="0" cellpadding="5" cellspacing="2" width="95%">
+ <tr valign="top">
+ <th>Tests</th>
+ <th>Failures</th>
+ <th>Errors</th>
+ <th>Success rate</th>
+ <th>Time</th>
+ </tr>
+ <tr valign="top">
+ <xsl:attribute name="class">
+ <xsl:choose>
+ <xsl:when test="$failureCount > 0">Failure</xsl:when>
+ <xsl:when test="$errorCount > 0">Error</xsl:when>
+ </xsl:choose>
+ </xsl:attribute>
+ <td><xsl:value-of select="$testCount"/></td>
+ <td><xsl:value-of select="$failureCount"/></td>
+ <td><xsl:value-of select="$errorCount"/></td>
+ <td>
+ <xsl:call-template name="display-percent">
+ <xsl:with-param name="value" select="$successRate"/>
+ </xsl:call-template>
+ </td>
+ <td>
+ <xsl:call-template name="display-time">
+ <xsl:with-param name="value" select="$timeCount"/>
+ </xsl:call-template>
+ </td>
+ </tr>
+ </table>
+ <table border="0" width="95%">
+ <tr>
+ <td style="text-align: justify;">
+ Note: <i>failures</i> are anticipated and checked for with assertions
+ while <i>errors</i> are unanticipated.
+ </td>
+ </tr>
+ </table>
+ </xsl:template>
+
+ <xsl:template name="classes">
+ <xsl:for-each select="testsuite">
+ <xsl:sort select="@name"/>
+ <!-- create an anchor to this class name -->
+ <a name="{@name}"></a>
+ <h3>TestCase <xsl:value-of select="@name"/></h3>
+
+ <table class="details" border="0" cellpadding="5" cellspacing="2" width="95%">
+ <xsl:call-template name="testcase.test.header"/>
+ <!--
+ test can even not be started at all (failure to load the class)
+ so report the error directly
+ -->
+ <xsl:if test="./error">
+ <tr class="Error">
+ <td colspan="4"><xsl:apply-templates select="./error"/></td>
+ </tr>
+ </xsl:if>
+ <xsl:apply-templates select="./testcase" mode="print.test"/>
+ </table>
+ <p/>
+ <a href="#top">Back to top</a>
+ </xsl:for-each>
+ </xsl:template>
+
+ <xsl:template match="testsuite" mode="header">
+ <tr valign="top">
+ <th width="80%">Name</th>
+ <th>Tests</th>
+ <th>Errors</th>
+ <th>Failures</th>
+ <th nowrap="nowrap">Time(s)</th>
+ </tr>
+ </xsl:template>
+
+ <!-- class header -->
+ <xsl:template name="testsuite.test.header">
+ <tr valign="top">
+ <th width="80%">Name</th>
+ <th>Tests</th>
+ <th>Errors</th>
+ <th>Failures</th>
+ <th nowrap="nowrap">Time(s)</th>
+ </tr>
+ </xsl:template>
+
+ <!-- method header -->
+ <xsl:template name="testcase.test.header">
+ <tr valign="top">
+ <th>Name</th>
+ <th>Status</th>
+ <th width="80%">Type</th>
+ <th nowrap="nowrap">Time(s)</th>
+ </tr>
+ </xsl:template>
+
+ <!-- class information -->
+ <xsl:template match="testsuite" mode="print.test">
+ <tr valign="top">
+ <!-- set a nice color depending if there is an error/failure -->
+ <xsl:attribute name="class">
+ <xsl:choose>
+ <xsl:when test="@failures[.> 0]">Failure</xsl:when>
+ <xsl:when test="@errors[.> 0]">Error</xsl:when>
+ </xsl:choose>
+ </xsl:attribute>
+ <!-- print testsuite information -->
+ <td><a href="#{@name}"><xsl:value-of select="@name"/></a></td>
+ <td><xsl:value-of select="@tests"/></td>
+ <td><xsl:value-of select="@errors"/></td>
+ <td><xsl:value-of select="@failures"/></td>
+ <td>
+ <xsl:call-template name="display-time">
+ <xsl:with-param name="value" select="@time"/>
+ </xsl:call-template>
+ </td>
+ </tr>
+ </xsl:template>
+
+ <xsl:template match="testcase" mode="print.test">
+ <tr valign="top">
+ <xsl:attribute name="class">
+ <xsl:choose>
+ <xsl:when test="failure | error">Error</xsl:when>
+ </xsl:choose>
+ </xsl:attribute>
+ <td><xsl:value-of select="@name"/></td>
+ <xsl:choose>
+ <xsl:when test="failure">
+ <td>Failure</td>
+ <td><xsl:apply-templates select="failure"/></td>
+ </xsl:when>
+ <xsl:when test="error">
+ <td>Error</td>
+ <td><xsl:apply-templates select="error"/></td>
+ </xsl:when>
+ <xsl:otherwise>
+ <td>Success</td>
+ <td></td>
+ </xsl:otherwise>
+ </xsl:choose>
+ <td>
+ <xsl:call-template name="display-time">
+ <xsl:with-param name="value" select="@time"/>
+ </xsl:call-template>
+ </td>
+ </tr>
+ </xsl:template>
+
+ <xsl:template match="failure">
+ <xsl:call-template name="display-failures"/>
+ </xsl:template>
+
+ <xsl:template match="error">
+ <xsl:call-template name="display-failures"/>
+ </xsl:template>
+
+ <!-- Style for the error and failure in the tescase template -->
+ <xsl:template name="display-failures">
+ <xsl:choose>
+ <xsl:when test="not(@message)">N/A</xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="@message"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ <!-- display the stacktrace -->
+ <code>
+ <p/>
+ <xsl:call-template name="br-replace">
+ <xsl:with-param name="word" select="."/>
+ </xsl:call-template>
+ </code>
+ </xsl:template>
+
+ <!--
+ template that will convert a carriage return into a br tag
+ @param word the text from which to convert CR to BR tag
+ -->
+ <xsl:template name="br-replace">
+ <xsl:param name="word"/>
+ <xsl:choose>
+ <xsl:when test="contains($word,'
')">
+ <xsl:value-of select="substring-before($word,'
')"/>
+ <br/>
+ <xsl:call-template name="br-replace">
+ <xsl:with-param name="word" select="substring-after($word,'
')"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$word"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <xsl:template name="display-time">
+ <xsl:param name="value"/>
+ <xsl:value-of select="format-number($value,'0.000')"/>
+ </xsl:template>
+
+ <xsl:template name="display-percent">
+ <xsl:param name="value"/>
+ <xsl:value-of select="format-number($value,'0.00%')"/>
+ </xsl:template>
+
+</xsl:stylesheet>
+
Modified: trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/EmbjoprTestCase.java
===================================================================
--- trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/EmbjoprTestCase.java 2009-01-13 00:47:57 UTC (rev 105)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/EmbjoprTestCase.java 2009-01-13 21:39:30 UTC (rev 106)
@@ -22,7 +22,9 @@
package org.jboss.jopr.jsfunit;
+import com.gargoylesoftware.htmlunit.BrowserVersion;
import com.gargoylesoftware.htmlunit.WebClient;
+import com.gargoylesoftware.htmlunit.html.ClickableElement;
import com.gargoylesoftware.htmlunit.html.HtmlAnchor;
import com.gargoylesoftware.htmlunit.html.HtmlButtonInput;
import com.gargoylesoftware.htmlunit.html.HtmlForm;
@@ -72,7 +74,7 @@
.startsWith("4");
// Initial JSF request
- WebClientSpec wcSpec = new WebClientSpec("/");
+ WebClientSpec wcSpec = new WebClientSpec("/", BrowserVersion.FIREFOX_3);
// This is temporary because embedded Jopr can't find /js/rhq.js
wcSpec.getWebClient().setThrowExceptionOnFailingStatusCode(false);
@@ -137,16 +139,15 @@
* (eg. "Web Applications (WAR)", "Datasources", etc.) in the
* navigation tree.
*/
- public HtmlImage getNavTreeArrow(String resourceName) {
+ public ClickableElement getNavTreeArrow(String resourceName) {
HtmlAnchor link = getNavTreeLink(resourceName);
String id = link.getIdAttribute();
// An example id is: "navTreeForm:navTree:81:82:83:84::typeSummaryLink"
// The icon's id would be: "81:82:83:84::typeSummary:handle:img:collapsed"
int index = id.lastIndexOf("Link");
- id = id.substring("navTreeForm:navTree:".length(), index)
- + ":handle:img:collapsed";
- return (HtmlImage)client.getElement(id);
+ id = id.substring(0, index) + ":handle";
+ return (ClickableElement)client.getElement(id);
}
/**
Modified: trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/DatasourceTest.java
===================================================================
--- trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/DatasourceTest.java 2009-01-13 00:47:57 UTC (rev 105)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/DatasourceTest.java 2009-01-13 21:39:30 UTC (rev 106)
@@ -22,6 +22,7 @@
package org.jboss.jopr.jsfunit.as5;
+import com.gargoylesoftware.htmlunit.html.ClickableElement;
import org.jboss.jopr.jsfunit.*;
import com.gargoylesoftware.htmlunit.html.HtmlAnchor;
import com.gargoylesoftware.htmlunit.html.HtmlButtonInput;
@@ -77,9 +78,8 @@
Map<String, String> propertiesMap) throws IOException {
// Expand the "Datasources" tree node
- HtmlImage resourceNodeImage = getNavTreeArrow("Datasources");
- resourceNodeImage.click();
-
+ ClickableElement datasourcesArrow = getNavTreeArrow("Datasources");
+ datasourcesArrow.click();
HtmlAnchor datasourceLink = getNavTreeLink(datasourceType);
datasourceLink.click();
15 years, 11 months
EMBJOPR SVN: r105 - in trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit: as4 and 1 other directory.
by embjopr-commits@lists.jboss.org
Author: stan.silvert(a)jboss.com
Date: 2009-01-12 19:47:57 -0500 (Mon, 12 Jan 2009)
New Revision: 105
Modified:
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/HelloJoprTest.java
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as4/HelloJoprTest.java
Log:
Simulate Firefox instead of IE to work around HtmlUnit problem
Modified: trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/HelloJoprTest.java
===================================================================
--- trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/HelloJoprTest.java 2009-01-09 16:14:51 UTC (rev 104)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/HelloJoprTest.java 2009-01-13 00:47:57 UTC (rev 105)
@@ -22,6 +22,7 @@
package org.jboss.jopr.jsfunit;
+import com.gargoylesoftware.htmlunit.BrowserVersion;
import com.gargoylesoftware.htmlunit.WebClient;
import com.gargoylesoftware.htmlunit.html.HtmlAnchor;
import com.gargoylesoftware.htmlunit.html.HtmlButtonInput;
@@ -71,7 +72,7 @@
.startsWith("4");
// Initial JSF request
- WebClientSpec wcSpec = new WebClientSpec("/");
+ WebClientSpec wcSpec = new WebClientSpec("/", BrowserVersion.FIREFOX_3);
// This is temporary because embedded Jopr can't find /js/rhq.js
wcSpec.getWebClient().setThrowExceptionOnFailingStatusCode(false);
Modified: trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as4/HelloJoprTest.java
===================================================================
--- trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as4/HelloJoprTest.java 2009-01-09 16:14:51 UTC (rev 104)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as4/HelloJoprTest.java 2009-01-13 00:47:57 UTC (rev 105)
@@ -22,6 +22,7 @@
package org.jboss.jopr.jsfunit.as4;
+import com.gargoylesoftware.htmlunit.BrowserVersion;
import com.gargoylesoftware.htmlunit.WebClient;
import com.gargoylesoftware.htmlunit.html.HtmlAnchor;
import com.gargoylesoftware.htmlunit.html.HtmlButtonInput;
@@ -73,7 +74,7 @@
.startsWith("4");
// Initial JSF request
- WebClientSpec wcSpec = new WebClientSpec("/");
+ WebClientSpec wcSpec = new WebClientSpec("/", BrowserVersion.FIREFOX_3);
// This is temporary because embedded Jopr can't find /js/rhq.js
wcSpec.getWebClient().setThrowExceptionOnFailingStatusCode(false);
15 years, 11 months
EMBJOPR SVN: r104 - trunk/jsfunit.
by embjopr-commits@lists.jboss.org
Author: ozizka(a)redhat.com
Date: 2009-01-09 11:14:51 -0500 (Fri, 09 Jan 2009)
New Revision: 104
Modified:
trunk/jsfunit/pom.xml
Log:
Added: org.jboss.jopr.jsfunit.HelloJoprTest.java included in both profiles
Modified: trunk/jsfunit/pom.xml
===================================================================
--- trunk/jsfunit/pom.xml 2009-01-09 12:39:52 UTC (rev 103)
+++ trunk/jsfunit/pom.xml 2009-01-09 16:14:51 UTC (rev 104)
@@ -101,7 +101,7 @@
<build>
<plugins>
- <!-- Cargo plugin -->
+ <!-- Cargo plugin (for AS 4) -->
<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
@@ -140,7 +140,7 @@
</executions>
</plugin>
- <!-- Surefire plugin -->
+ <!-- Surefire plugin (for AS 4) -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
@@ -153,7 +153,10 @@
</goals>
<configuration>
<skip>false</skip>
- <includes><include>**/as4/**</include></includes>
+ <includes>
+ <include>**/as4/*Test.java</include>
+ <include>**/jsfunit/*Test.java</include>
+ </includes>
<excludes><exclude>**/as5/**</exclude></excludes>
<systemProperties>
<property>
@@ -195,7 +198,7 @@
<build>
<plugins>
- <!-- Cargo plugin -->
+ <!-- Cargo plugin (for AS 5) -->
<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
@@ -234,7 +237,7 @@
</executions>
</plugin>
- <!-- Surefire plugin -->
+ <!-- Surefire plugin (for AS 5) -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
@@ -247,7 +250,10 @@
</goals>
<configuration>
<skip>false</skip>
- <includes><include>**/as5/**</include></includes>
+ <includes>
+ <include>**/as5/*Test.java</include>
+ <include>**/jsfunit/*Test.java</include>
+ </includes>
<excludes><exclude>**/as4/**</exclude></excludes>
<systemProperties>
<property>
15 years, 11 months
EMBJOPR SVN: r103 - trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as4.
by embjopr-commits@lists.jboss.org
Author: ozizka(a)redhat.com
Date: 2009-01-09 07:39:52 -0500 (Fri, 09 Jan 2009)
New Revision: 103
Added:
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as4/HelloJoprTest.java
Log:
Added: HelloJoprTest.java to as4 tests, to investigate problem with ServletRedirector.jsfunit
Added: trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as4/HelloJoprTest.java
===================================================================
--- trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as4/HelloJoprTest.java (rev 0)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as4/HelloJoprTest.java 2009-01-09 12:39:52 UTC (rev 103)
@@ -0,0 +1,235 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.jopr.jsfunit.as4;
+
+import com.gargoylesoftware.htmlunit.WebClient;
+import com.gargoylesoftware.htmlunit.html.HtmlAnchor;
+import com.gargoylesoftware.htmlunit.html.HtmlButtonInput;
+import com.gargoylesoftware.htmlunit.html.HtmlFileInput;
+import com.gargoylesoftware.htmlunit.html.HtmlForm;
+import com.gargoylesoftware.htmlunit.html.HtmlPage;
+import java.io.IOException;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+import javax.faces.application.FacesMessage;
+import javax.faces.context.FacesContext;
+import javax.management.MBeanServer;
+import javax.management.ObjectName;
+import javax.servlet.http.HttpServletRequest;
+import junit.framework.Test;
+import junit.framework.TestSuite;
+import org.apache.cactus.ServletTestCase;
+import org.jboss.jopr.jsfunit.JoprLoginStrategy;
+import org.jboss.jopr.jsfunit.SimpleConfirmHandler;
+import org.jboss.jsfunit.framework.WebClientSpec;
+import org.jboss.jsfunit.jsfsession.JSFClientSession;
+import org.jboss.jsfunit.jsfsession.JSFServerSession;
+import org.jboss.jsfunit.jsfsession.JSFSession;
+import org.jboss.mx.util.MBeanServerLocator;
+
+/**
+ * Sample for testing Embedded Jopr. Here I present a fairly complex test
+ * case to show some of the things that JSFUnit can do.
+ *
+ * @author Stan Silvert
+ */
+public class HelloJoprTest extends ServletTestCase
+{
+ private boolean isJBoss4;
+
+ private JSFClientSession client;
+ private JSFServerSession server;
+
+ /**
+ * Start a JSFUnit session by logging in to the main page. Note that
+ * because setUp() is called before each test, a new HttpSession will be
+ * created each time a test is run.
+ */
+ public void setUp() throws IOException
+ {
+ isJBoss4 = Package.getPackage("org.jboss.system.server")
+ .getImplementationVersion()
+ .startsWith("4");
+
+ // Initial JSF request
+ WebClientSpec wcSpec = new WebClientSpec("/");
+
+ // This is temporary because embedded Jopr can't find /js/rhq.js
+ wcSpec.getWebClient().setThrowExceptionOnFailingStatusCode(false);
+
+ // Always press OK for confirm dialogs
+ wcSpec.getWebClient().setConfirmHandler(new SimpleConfirmHandler(true));
+
+ wcSpec.setInitialRequestStrategy(new JoprLoginStrategy()); // logs in
+
+ JSFSession jsfSession = new JSFSession(wcSpec);
+ this.client = jsfSession.getJSFClientSession();
+ this.server = jsfSession.getJSFServerSession();
+ }
+
+ /**
+ * @return the suite of tests being tested
+ */
+ public static Test suite()
+ {
+ return new TestSuite( HelloJoprTest.class );
+ }
+
+ public void testDeployWAR() throws IOException
+ {
+ // click the nave tree
+ HtmlAnchor warLink = getNavTreeLink("Web Application (WAR)");
+ warLink.click();
+
+ // click on the "Add new resource" button
+ client.click("actionHeaderForm:addNewContent"); // 404 if setThrowExceptionOnFailingStatusCode(true) above
+
+ // upload hellothere.war
+ HtmlFileInput fileInput = (HtmlFileInput)client.getElement("createContentForm:file");
+ fileInput.setContentType("application/war");
+ fileInput.setValueAttribute(System.getProperty("jsfunit.testdata") + "/war/hellothere.war");
+ client.click("createContentForm:addButton");
+
+ // assert that the success message appeared on the client side
+ assertTrue(client.getPageAsText().contains("hellothere.war created successfully"));
+
+ // assert text and sevrity 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("hellothere.war created successfully"));
+
+ // Use JMX to assert that the WAR really did deploy successfully
+ assertTrue(isWarDeployed("hellothere.war"));
+
+ // use HtmlUnit to test the newly deployed war in a new WebClient session
+ // note that I have full access to the FacesContext and the previous request
+ HttpServletRequest request = (HttpServletRequest)FacesContext.getCurrentInstance().getExternalContext().getRequest();
+ int port = request.getLocalPort();
+ WebClient webClient = new WebClient();
+ HtmlPage page = (HtmlPage)webClient.getPage("http://localhost:" + port + "/hellothere/hello.jsp");
+ assertTrue(page.asText().contains("HELLO WORLD"));
+
+ // Undeploy the WAR
+ HtmlButtonInput deleteButton = getDeleteButton("hellothere.war");
+ deleteButton.click();
+
+ // This assert doesn't work. jopr does remove the WAR, but for some
+ // reason, JBoss doesn't undeploy the MBeans
+ //assertFalse(isWarDeployed("hellothere.war"));
+ }
+
+ private boolean isWarDeployed(String warName)
+ {
+ if (isJBoss4)
+ {
+ return checkWarDeployment_4_2(warName);
+ }
+ else
+ {
+ return checkWarDeployment_5_0(warName);
+ }
+ }
+
+ // Query the MBean server to find if WAR is deployed
+ private boolean checkWarDeployment_4_2(String warName)
+ {
+ try {
+ MBeanServer jmxServer = MBeanServerLocator.locateJBoss();
+ ObjectName objName = new ObjectName("jboss.web.deployment:war=" + warName + ",*");
+ Set mBeans = jmxServer.queryNames(objName, null);
+ if (mBeans.size() != 1) return false;
+ ObjectName deploymentMBean = (ObjectName)mBeans.iterator().next();
+ String state = (String)jmxServer.getAttribute(deploymentMBean, "StateString");
+ return "Started".equals(state);
+ }
+ catch (Exception e)
+ {
+ throw new RuntimeException(e);
+ }
+ }
+
+ // Query the MBean server to find if WAR is deployed
+ private boolean checkWarDeployment_5_0(String warName)
+ {
+ if (warName.endsWith(".war"))
+ {
+ warName = warName.substring(0, warName.lastIndexOf(".war"));
+ }
+ else
+ {
+ warName = warName.substring(0, warName.lastIndexOf(".WAR"));
+ }
+
+ try {
+ MBeanServer jmxServer = MBeanServerLocator.locateJBoss();
+ ObjectName objName = new ObjectName("jboss.deployment:id=\"jboss.web.deployment:war=/" + warName + "\",*");
+ Set mBeans = jmxServer.queryNames(objName, null);
+ if (mBeans.size() != 1) return false;
+ ObjectName deploymentMBean = (ObjectName)mBeans.iterator().next();
+
+ // returns org.jboss.deployers.spi.DeploymentState
+ Object state = jmxServer.getAttribute(deploymentMBean, "State");
+ return "DEPLOYED".equals(state.toString());
+ }
+ catch (Exception e)
+ {
+ throw new RuntimeException(e);
+ }
+ }
+
+ // need a standard JSFUnit API to replace this code
+ private HtmlAnchor getNavTreeLink(String linkLabel)
+ {
+ return getLinkInsideForm("navTreeForm", linkLabel);
+ }
+
+ private HtmlButtonInput getDeleteButton(String resourceName)
+ {
+ HtmlAnchor link = getLinkInsideForm("resourceSummaryForm", 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];
+ return (HtmlButtonInput)client.getElement(row + ":removeButton");
+ }
+
+ // finds a <a> tag inside a form that has a particular label
+ private HtmlAnchor getLinkInsideForm(String formId, String linkLabel)
+ {
+ 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();
+ if (linkText.contains(linkLabel)) return link;
+ }
+
+ throw new IllegalStateException("Nav Tree link for '" + linkLabel + "' not found.");
+ }
+
+}
\ No newline at end of file
15 years, 11 months
EMBJOPR SVN: r102 - in trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit: as5 and 1 other directory.
by embjopr-commits@lists.jboss.org
Author: ozizka(a)redhat.com
Date: 2009-01-08 08:05:56 -0500 (Thu, 08 Jan 2009)
New Revision: 102
Added:
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/DatasourceTest.java
Removed:
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/DatasourceTest.java
Log:
Moved DatasourceTest to ...as5 package
Deleted: trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/DatasourceTest.java
===================================================================
--- trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/DatasourceTest.java 2009-01-08 11:57:04 UTC (rev 101)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/DatasourceTest.java 2009-01-08 13:05:56 UTC (rev 102)
@@ -1,394 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.jboss.jopr.jsfunit;
-
-import com.gargoylesoftware.htmlunit.html.HtmlAnchor;
-import com.gargoylesoftware.htmlunit.html.HtmlButtonInput;
-import com.gargoylesoftware.htmlunit.html.HtmlForm;
-import com.gargoylesoftware.htmlunit.html.HtmlImage;
-import com.gargoylesoftware.htmlunit.html.HtmlSelect;
-import com.gargoylesoftware.htmlunit.html.HtmlInput;
-import java.io.IOException;
-import junit.framework.Test;
-import junit.framework.TestSuite;
-import org.jboss.mx.util.MBeanServerLocator;
-import javax.management.MBeanServer;
-import javax.management.ObjectName;
-import java.util.Set;
-import java.util.Iterator;
-import org.jdom.Document;
-import org.jdom.Element;
-import org.jdom.input.SAXBuilder;
-import org.jdom.JDOMException;
-import java.io.File;
-import java.util.Map;
-import java.util.HashMap;
-import javax.naming.InitialContext;
-import java.sql.Connection;
-import javax.sql.DataSource;
-import javax.naming.Context;
-import java.sql.SQLException;
-import org.jboss.jopr.jsfunit.EmbjoprTestCase;
-
-/**
- * When complete, this class will contain tests for creating,
- * configuring, and deleting various types of datasources. This
- * test class should be run against JBAS 5.x.
- *
- * @author Farah Juma
- *
- */
-public class DatasourceTest extends EmbjoprTestCase {
-
- // Datasource types, as they appear in the left nav
- private final String LOCAL_TX_DATASOURCE="Local TX Datasources";
- private final String NO_TX_DATASOURCE="No TX Datasources";
- private final String XA_DATASOURCE="XA Datasources";
-
- /**
- * Create a new datasource using the given type, template, and properties.
- *
- * @param datasourceType must be the name of a datasource type, as it
- * appears in the left nav (eg. "Local TX Datasources")
- */
- private void createDatasource(String datasourceType,
- String datasourceTemplate,
- Map<String, String> propertiesMap) throws IOException {
-
- // Expand the "Datasources" tree node
- HtmlImage resourceNodeImage = getNavTreeArrow("Datasources");
- resourceNodeImage.click();
-
- HtmlAnchor datasourceLink = getNavTreeLink(datasourceType);
- datasourceLink.click();
-
- // Add a new datasource
- client.click("actionHeaderForm:addNewNotContent");
- HtmlSelect menu = (HtmlSelect)client.getElement("selectedTemplate");
- menu.setSelectedAttribute(datasourceTemplate, Boolean.TRUE);
- client.click("resourceCreateForm:addButton");
-
- // Configure the properties associated with this datasource
- fillOutForm(propertiesMap);
- }
-
- /**
- * Delete the datasource given by datasourceName.
- */
- private void deleteDatasource(String datasourceName) throws IOException {
- HtmlAnchor datasourceLink = getNavTreeLink("Datasources");
- datasourceLink.click();
- HtmlButtonInput deleteButton = getDeleteButton("categorySummaryForm",
- datasourceName);
- deleteButton.click();
- }
-
- /**
- * Use JMX to check if the datasource given by datasourceName is
- * deployed.
- */
- private boolean isDatasourceDeployed(String jndiName,
- String datasourceType) {
- try {
-
- ObjectName deploymentMBean;
- ObjectName objName;
- Object state;
- Set dsMBeans;
- String service;
-
- // One of the MBeans we will need to inspect depends on
- // the type of datasource
- if(datasourceType.equals(LOCAL_TX_DATASOURCE)) {
- service="LocalTxCM";
- } else if(datasourceType.equals(NO_TX_DATASOURCE)) {
- service="NoTxCM";
- } else {
- service="XATxCM";
- }
-
- String[] dsMBeanServices = {"DataSourceBinding",
- "ManagedConnectionPool",
- "ManagedConnectionFactory",
- service};
-
- // Query the MBean server to check if the datasource is deployed
- MBeanServer jmxServer = MBeanServerLocator.locateJBoss();
-
- // Inspect the following MBeans and make sure that the "State" attribute
- // is "DEPLOYED":
- // 1) "jboss.jca:name=TestDS,service=DataSourceBinding",type=Component
- // 2) "jboss.jca:name=TestDS,service=ManagedConnectionPool",type=Component
- // 3) "jboss.jca:name=TestDS,service=ManagedConnectionFactory",type=Component
- // 4) The fourth MBean inspected depends on the type of datasource
- for(int i = 0; i < dsMBeanServices.length; i++) {
-
- objName = new ObjectName("jboss.deployment:id=\"jboss.jca:name="
- + jndiName + ",service="
- + dsMBeanServices[i] + "\",type=Component");
-
- dsMBeans = jmxServer.queryNames(objName, null);
- if (dsMBeans.size() != 1) return false;
-
- deploymentMBean = (ObjectName)dsMBeans.iterator().next();
- state = jmxServer.getAttribute(deploymentMBean, "State");
- if(!("DEPLOYED".equals(state.toString()))) return false;
- }
-
- return true;
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
- }
-
-
- /**
- * checkProperties reads the *-ds.xml file corresponding to the datasource
- * given by jndiName and compares the property values in this file to the
- * given expected values. checkProperties returns true if all the given
- * properties are correctly set in the *-ds.xml file and false otherwise.
- */
- private boolean checkProperties(String jndiName,
- String datasourceType,
- Map<String, String> expectedValuesMap) {
-
- Map<String, String> actualValuesMap = new HashMap<String, String>();
- String datasourceElementName;
-
- try {
-
- // Parse the *-ds.xml file
- File file = new File(System.getProperty("jsfunit.deploy.dir")
- + "/" + jndiName + "-ds.xml");
-
- SAXBuilder builder = new SAXBuilder();
- Document doc = builder.build(file);
-
- Element root = doc.getRootElement();
- assertTrue(root.getName().equals("datasources"));
-
- // Get the datasource element
- if(datasourceType.equals(LOCAL_TX_DATASOURCE)) {
- datasourceElementName="local-tx-datasource";
- } else if(datasourceType.equals(NO_TX_DATASOURCE)) {
- datasourceElementName="no-tx-datasource";
- } else {
- datasourceElementName="xa-datasource";
- }
- Element datasource = root.getChild(datasourceElementName);
-
- // Create actualValuesMap by mapping property names to
- // property values
- Iterator itr = (datasource.getChildren()).iterator();
- while(itr.hasNext()) {
- Element property = (Element)itr.next();
- actualValuesMap.put(property.getName(), property.getValue());
- }
-
- // Compare the actual values to the expected ones
- itr = expectedValuesMap.keySet().iterator();
- while(itr.hasNext()) {
- String key = (String)itr.next();
- if(actualValuesMap.containsKey(key)) {
- if(!expectedValuesMap.get(key).equals(actualValuesMap.get(key))) {
- return false; // incorrect value
- }
- } else {
- return false; // value was not set
- }
- }
-
- return true;
-
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
- }
-
- /**
- * Connect to the database identified by the given JNDI name,
- * using the given username and password. Return the Connection
- * object.
- */
- public Connection connectDB(String jndiName, String username,
- String password) throws Exception{
- Context ctx = new InitialContext();
- DataSource ds = (DataSource)ctx.lookup(jndiName);
- return ds.getConnection(username, password);
- }
-
- /**
- * Disconnect from the database.
- */
- public void disconnectDB(Connection con) throws SQLException {
- if(con != null) {
- con.close();
- }
- }
-
- /**
- * @return the suite of tests being tested
- */
- public static Test suite()
- {
- return new TestSuite(DatasourceTest.class);
- }
-
- /*
- * Some preliminary creation tests
- */
-
- /**
- * Create a new datasource. Leave some property values that aren't
- * required unset.
- */
- public void testCreateDatasource() throws IOException {
- Map<String, String> propertiesMap = new HashMap<String, String>();
-
- // The properties we want to configure
- propertiesMap.put("jndi-name", "TestDS");
- propertiesMap.put("user-name", "testUser");
- propertiesMap.put("password", "password");
- propertiesMap.put("min-pool-size", "5");
- propertiesMap.put("driver-class", "org.hsqldb.jdbcDriver");
- propertiesMap.put("connection-url", "jdbc:hsqldb:.");
- propertiesMap.put("idle-timeout-minutes", "20");
- propertiesMap.put("query-timeout", "180");
- propertiesMap.put("prepared-statement-cache-size", "2");
- propertiesMap.put("valid-connection-checker-class-name",
- "org.jboss.resource.adapter.jdbc.CheckValidConnectionSQL");
- propertiesMap.put("stale-connection-checker-class-name",
- "org.jboss.resource.adapter.jdbc.StaleConnectionChecker");
- propertiesMap.put("exception-sorter-class-name",
- "org.jboss.resource.adapter.jdbc.ExceptionSorter");
- propertiesMap.put("allocation-retry", "10000");
- propertiesMap.put("allocation-retry-wait-millis", "10000");
- propertiesMap.put("background-validation-millis", "15000");
- propertiesMap.put("use-try-lock", "61000");
- propertiesMap.put("prefill", "true");
- propertiesMap.put("share-prepared-statements", "false");
-
- createDatasource(LOCAL_TX_DATASOURCE,
- "default__Local TX Datasource",
- propertiesMap);
- client.click("resourceConfigurationForm:saveButton");
-
- // Check for the appropriate success messages
- String expectedMessage = "Successfully added new Local TX Datasource";
- checkClientAndServerMessages(expectedMessage, expectedMessage, false);
-
- assertTrue(isDatasourceDeployed(propertiesMap.get("jndi-name"),
- LOCAL_TX_DATASOURCE));
- assertTrue(checkProperties(propertiesMap.get("jndi-name"),
- LOCAL_TX_DATASOURCE,
- propertiesMap));
-
- // TODO: need to verify that appropriate default values were
- // set for properties that were not specified above
-
- // Clean up
- deleteDatasource(propertiesMap.get("jndi-name"));
- expectedMessage = "Successfully deleted Local TX Datasource '"
- + propertiesMap.get("jndi-name") + "'";
- checkClientAndServerMessages(expectedMessage, expectedMessage, false);
- }
-
- /**
- * Attempt to create a new datasource but leave at least one required
- * value unset. An error should occur.
- */
- public void testCreateDatasourceMissingRequiredValues() throws IOException {
-
- // Leave jndi-name and connection-url unset
- Map<String, String> propertiesMap = new HashMap<String, String>();
- propertiesMap.put("user-name", "testUser");
- propertiesMap.put("max-pool-size", "10");
- propertiesMap.put("prefill", "true");
- propertiesMap.put("idle-timeout-minutes", "20");
- propertiesMap.put("set-tx-query-timeout", "true");
- propertiesMap.put("query-timeout", "1800");
-
- createDatasource(NO_TX_DATASOURCE, "default__No TX Datasource",
- propertiesMap);
- client.click("resourceConfigurationForm:saveButton");
-
- // Check for the appropriate error messages
- checkClientAndServerMessages("An invalid value was specified for one "
- + "or more properties",
- "Value is required",
- true);
- }
-
- /**
- * Attempt to create a new datasource but set a property value
- * beyond its expected range of values. An error should occur.
- */
- public void testCreateDatasourcePropertyOutOfRange() throws IOException {
- Map<String, String> propertiesMap = new HashMap<String, String>();
- propertiesMap.put("jndi-name", "InvalidDS");
- propertiesMap.put("user-name", "testUser");
- propertiesMap.put("password", "password");
- propertiesMap.put("xa-datasource-class", "org.postgresql.xa.PGXADataSource");
- propertiesMap.put("xa-resource-timeout", "36000");
-
- // This number is too big
- propertiesMap.put("max-pool-size", "100000000000000");
-
- createDatasource(XA_DATASOURCE, "default__XA Datasource",
- propertiesMap);
- client.click("resourceConfigurationForm:saveButton");
-
- // Check for the appropriate error messages
- checkClientAndServerMessages("An invalid value was specified for one or more properties",
- "Specified attribute is not between the expected values",
- true);
- }
-
- /**
- * Attempt to create a new datasource but set a property value
- * to an invalid type. An error should occur.
- */
- public void testCreateDatasourceInvalidPropertyType() throws IOException {
- Map<String, String> propertiesMap = new HashMap<String, String>();
- propertiesMap.put("jndi-name", "InvalidDS");
- propertiesMap.put("min-pool-size", "10");
- propertiesMap.put("max-pool-size", "20");
- propertiesMap.put("driver-class", "org.hsqldb.jdbcDriver");
- propertiesMap.put("connection-url", "jdbc:hsqldb:.");
- propertiesMap.put("share-prepared-statements", "false");
-
- // This property value is supposed to be an integer
- propertiesMap.put("background-validation-millis", "abcde");
-
- createDatasource(LOCAL_TX_DATASOURCE,
- "default__Local TX Datasource",
- propertiesMap);
- client.click("resourceConfigurationForm:saveButton");
-
- // Check for the appropriate error messages
- checkClientAndServerMessages("An invalid value was specified for one or more properties",
- "Value is not a valid integer",
- true);
- }
-}
-
Copied: trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/DatasourceTest.java (from rev 100, trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/DatasourceTest.java)
===================================================================
--- trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/DatasourceTest.java (rev 0)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/DatasourceTest.java 2009-01-08 13:05:56 UTC (rev 102)
@@ -0,0 +1,395 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.jopr.jsfunit.as5;
+
+import org.jboss.jopr.jsfunit.*;
+import com.gargoylesoftware.htmlunit.html.HtmlAnchor;
+import com.gargoylesoftware.htmlunit.html.HtmlButtonInput;
+import com.gargoylesoftware.htmlunit.html.HtmlForm;
+import com.gargoylesoftware.htmlunit.html.HtmlImage;
+import com.gargoylesoftware.htmlunit.html.HtmlSelect;
+import com.gargoylesoftware.htmlunit.html.HtmlInput;
+import java.io.IOException;
+import junit.framework.Test;
+import junit.framework.TestSuite;
+import org.jboss.mx.util.MBeanServerLocator;
+import javax.management.MBeanServer;
+import javax.management.ObjectName;
+import java.util.Set;
+import java.util.Iterator;
+import org.jdom.Document;
+import org.jdom.Element;
+import org.jdom.input.SAXBuilder;
+import org.jdom.JDOMException;
+import java.io.File;
+import java.util.Map;
+import java.util.HashMap;
+import javax.naming.InitialContext;
+import java.sql.Connection;
+import javax.sql.DataSource;
+import javax.naming.Context;
+import java.sql.SQLException;
+import org.jboss.jopr.jsfunit.EmbjoprTestCase;
+
+/**
+ * When complete, this class will contain tests for creating,
+ * configuring, and deleting various types of datasources. This
+ * test class should be run against JBAS 5.x.
+ *
+ * @author Farah Juma
+ *
+ */
+public class DatasourceTest extends EmbjoprTestCase {
+
+ // Datasource types, as they appear in the left nav
+ private final String LOCAL_TX_DATASOURCE="Local TX Datasources";
+ private final String NO_TX_DATASOURCE="No TX Datasources";
+ private final String XA_DATASOURCE="XA Datasources";
+
+ /**
+ * Create a new datasource using the given type, template, and properties.
+ *
+ * @param datasourceType must be the name of a datasource type, as it
+ * appears in the left nav (eg. "Local TX Datasources")
+ */
+ private void createDatasource(String datasourceType,
+ String datasourceTemplate,
+ Map<String, String> propertiesMap) throws IOException {
+
+ // Expand the "Datasources" tree node
+ HtmlImage resourceNodeImage = getNavTreeArrow("Datasources");
+ resourceNodeImage.click();
+
+ HtmlAnchor datasourceLink = getNavTreeLink(datasourceType);
+ datasourceLink.click();
+
+ // Add a new datasource
+ client.click("actionHeaderForm:addNewNotContent");
+ HtmlSelect menu = (HtmlSelect)client.getElement("selectedTemplate");
+ menu.setSelectedAttribute(datasourceTemplate, Boolean.TRUE);
+ client.click("resourceCreateForm:addButton");
+
+ // Configure the properties associated with this datasource
+ fillOutForm(propertiesMap);
+ }
+
+ /**
+ * Delete the datasource given by datasourceName.
+ */
+ private void deleteDatasource(String datasourceName) throws IOException {
+ HtmlAnchor datasourceLink = getNavTreeLink("Datasources");
+ datasourceLink.click();
+ HtmlButtonInput deleteButton = getDeleteButton("categorySummaryForm",
+ datasourceName);
+ deleteButton.click();
+ }
+
+ /**
+ * Use JMX to check if the datasource given by datasourceName is
+ * deployed.
+ */
+ private boolean isDatasourceDeployed(String jndiName,
+ String datasourceType) {
+ try {
+
+ ObjectName deploymentMBean;
+ ObjectName objName;
+ Object state;
+ Set dsMBeans;
+ String service;
+
+ // One of the MBeans we will need to inspect depends on
+ // the type of datasource
+ if(datasourceType.equals(LOCAL_TX_DATASOURCE)) {
+ service="LocalTxCM";
+ } else if(datasourceType.equals(NO_TX_DATASOURCE)) {
+ service="NoTxCM";
+ } else {
+ service="XATxCM";
+ }
+
+ String[] dsMBeanServices = {"DataSourceBinding",
+ "ManagedConnectionPool",
+ "ManagedConnectionFactory",
+ service};
+
+ // Query the MBean server to check if the datasource is deployed
+ MBeanServer jmxServer = MBeanServerLocator.locateJBoss();
+
+ // Inspect the following MBeans and make sure that the "State" attribute
+ // is "DEPLOYED":
+ // 1) "jboss.jca:name=TestDS,service=DataSourceBinding",type=Component
+ // 2) "jboss.jca:name=TestDS,service=ManagedConnectionPool",type=Component
+ // 3) "jboss.jca:name=TestDS,service=ManagedConnectionFactory",type=Component
+ // 4) The fourth MBean inspected depends on the type of datasource
+ for(int i = 0; i < dsMBeanServices.length; i++) {
+
+ objName = new ObjectName("jboss.deployment:id=\"jboss.jca:name="
+ + jndiName + ",service="
+ + dsMBeanServices[i] + "\",type=Component");
+
+ dsMBeans = jmxServer.queryNames(objName, null);
+ if (dsMBeans.size() != 1) return false;
+
+ deploymentMBean = (ObjectName)dsMBeans.iterator().next();
+ state = jmxServer.getAttribute(deploymentMBean, "State");
+ if(!("DEPLOYED".equals(state.toString()))) return false;
+ }
+
+ return true;
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+
+ /**
+ * checkProperties reads the *-ds.xml file corresponding to the datasource
+ * given by jndiName and compares the property values in this file to the
+ * given expected values. checkProperties returns true if all the given
+ * properties are correctly set in the *-ds.xml file and false otherwise.
+ */
+ private boolean checkProperties(String jndiName,
+ String datasourceType,
+ Map<String, String> expectedValuesMap) {
+
+ Map<String, String> actualValuesMap = new HashMap<String, String>();
+ String datasourceElementName;
+
+ try {
+
+ // Parse the *-ds.xml file
+ File file = new File(System.getProperty("jsfunit.deploy.dir")
+ + "/" + jndiName + "-ds.xml");
+
+ SAXBuilder builder = new SAXBuilder();
+ Document doc = builder.build(file);
+
+ Element root = doc.getRootElement();
+ assertTrue(root.getName().equals("datasources"));
+
+ // Get the datasource element
+ if(datasourceType.equals(LOCAL_TX_DATASOURCE)) {
+ datasourceElementName="local-tx-datasource";
+ } else if(datasourceType.equals(NO_TX_DATASOURCE)) {
+ datasourceElementName="no-tx-datasource";
+ } else {
+ datasourceElementName="xa-datasource";
+ }
+ Element datasource = root.getChild(datasourceElementName);
+
+ // Create actualValuesMap by mapping property names to
+ // property values
+ Iterator itr = (datasource.getChildren()).iterator();
+ while(itr.hasNext()) {
+ Element property = (Element)itr.next();
+ actualValuesMap.put(property.getName(), property.getValue());
+ }
+
+ // Compare the actual values to the expected ones
+ itr = expectedValuesMap.keySet().iterator();
+ while(itr.hasNext()) {
+ String key = (String)itr.next();
+ if(actualValuesMap.containsKey(key)) {
+ if(!expectedValuesMap.get(key).equals(actualValuesMap.get(key))) {
+ return false; // incorrect value
+ }
+ } else {
+ return false; // value was not set
+ }
+ }
+
+ return true;
+
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ /**
+ * Connect to the database identified by the given JNDI name,
+ * using the given username and password. Return the Connection
+ * object.
+ */
+ public Connection connectDB(String jndiName, String username,
+ String password) throws Exception{
+ Context ctx = new InitialContext();
+ DataSource ds = (DataSource)ctx.lookup(jndiName);
+ return ds.getConnection(username, password);
+ }
+
+ /**
+ * Disconnect from the database.
+ */
+ public void disconnectDB(Connection con) throws SQLException {
+ if(con != null) {
+ con.close();
+ }
+ }
+
+ /**
+ * @return the suite of tests being tested
+ */
+ public static Test suite()
+ {
+ return new TestSuite(DatasourceTest.class);
+ }
+
+ /*
+ * Some preliminary creation tests
+ */
+
+ /**
+ * Create a new datasource. Leave some property values that aren't
+ * required unset.
+ */
+ public void testCreateDatasource() throws IOException {
+ Map<String, String> propertiesMap = new HashMap<String, String>();
+
+ // The properties we want to configure
+ propertiesMap.put("jndi-name", "TestDS");
+ propertiesMap.put("user-name", "testUser");
+ propertiesMap.put("password", "password");
+ propertiesMap.put("min-pool-size", "5");
+ propertiesMap.put("driver-class", "org.hsqldb.jdbcDriver");
+ propertiesMap.put("connection-url", "jdbc:hsqldb:.");
+ propertiesMap.put("idle-timeout-minutes", "20");
+ propertiesMap.put("query-timeout", "180");
+ propertiesMap.put("prepared-statement-cache-size", "2");
+ propertiesMap.put("valid-connection-checker-class-name",
+ "org.jboss.resource.adapter.jdbc.CheckValidConnectionSQL");
+ propertiesMap.put("stale-connection-checker-class-name",
+ "org.jboss.resource.adapter.jdbc.StaleConnectionChecker");
+ propertiesMap.put("exception-sorter-class-name",
+ "org.jboss.resource.adapter.jdbc.ExceptionSorter");
+ propertiesMap.put("allocation-retry", "10000");
+ propertiesMap.put("allocation-retry-wait-millis", "10000");
+ propertiesMap.put("background-validation-millis", "15000");
+ propertiesMap.put("use-try-lock", "61000");
+ propertiesMap.put("prefill", "true");
+ propertiesMap.put("share-prepared-statements", "false");
+
+ createDatasource(LOCAL_TX_DATASOURCE,
+ "default__Local TX Datasource",
+ propertiesMap);
+ client.click("resourceConfigurationForm:saveButton");
+
+ // Check for the appropriate success messages
+ String expectedMessage = "Successfully added new Local TX Datasource";
+ checkClientAndServerMessages(expectedMessage, expectedMessage, false);
+
+ assertTrue(isDatasourceDeployed(propertiesMap.get("jndi-name"),
+ LOCAL_TX_DATASOURCE));
+ assertTrue(checkProperties(propertiesMap.get("jndi-name"),
+ LOCAL_TX_DATASOURCE,
+ propertiesMap));
+
+ // TODO: need to verify that appropriate default values were
+ // set for properties that were not specified above
+
+ // Clean up
+ deleteDatasource(propertiesMap.get("jndi-name"));
+ expectedMessage = "Successfully deleted Local TX Datasource '"
+ + propertiesMap.get("jndi-name") + "'";
+ checkClientAndServerMessages(expectedMessage, expectedMessage, false);
+ }
+
+ /**
+ * Attempt to create a new datasource but leave at least one required
+ * value unset. An error should occur.
+ */
+ public void testCreateDatasourceMissingRequiredValues() throws IOException {
+
+ // Leave jndi-name and connection-url unset
+ Map<String, String> propertiesMap = new HashMap<String, String>();
+ propertiesMap.put("user-name", "testUser");
+ propertiesMap.put("max-pool-size", "10");
+ propertiesMap.put("prefill", "true");
+ propertiesMap.put("idle-timeout-minutes", "20");
+ propertiesMap.put("set-tx-query-timeout", "true");
+ propertiesMap.put("query-timeout", "1800");
+
+ createDatasource(NO_TX_DATASOURCE, "default__No TX Datasource",
+ propertiesMap);
+ client.click("resourceConfigurationForm:saveButton");
+
+ // Check for the appropriate error messages
+ checkClientAndServerMessages("An invalid value was specified for one "
+ + "or more properties",
+ "Value is required",
+ true);
+ }
+
+ /**
+ * Attempt to create a new datasource but set a property value
+ * beyond its expected range of values. An error should occur.
+ */
+ public void testCreateDatasourcePropertyOutOfRange() throws IOException {
+ Map<String, String> propertiesMap = new HashMap<String, String>();
+ propertiesMap.put("jndi-name", "InvalidDS");
+ propertiesMap.put("user-name", "testUser");
+ propertiesMap.put("password", "password");
+ propertiesMap.put("xa-datasource-class", "org.postgresql.xa.PGXADataSource");
+ propertiesMap.put("xa-resource-timeout", "36000");
+
+ // This number is too big
+ propertiesMap.put("max-pool-size", "100000000000000");
+
+ createDatasource(XA_DATASOURCE, "default__XA Datasource",
+ propertiesMap);
+ client.click("resourceConfigurationForm:saveButton");
+
+ // Check for the appropriate error messages
+ checkClientAndServerMessages("An invalid value was specified for one or more properties",
+ "Specified attribute is not between the expected values",
+ true);
+ }
+
+ /**
+ * Attempt to create a new datasource but set a property value
+ * to an invalid type. An error should occur.
+ */
+ public void testCreateDatasourceInvalidPropertyType() throws IOException {
+ Map<String, String> propertiesMap = new HashMap<String, String>();
+ propertiesMap.put("jndi-name", "InvalidDS");
+ propertiesMap.put("min-pool-size", "10");
+ propertiesMap.put("max-pool-size", "20");
+ propertiesMap.put("driver-class", "org.hsqldb.jdbcDriver");
+ propertiesMap.put("connection-url", "jdbc:hsqldb:.");
+ propertiesMap.put("share-prepared-statements", "false");
+
+ // This property value is supposed to be an integer
+ propertiesMap.put("background-validation-millis", "abcde");
+
+ createDatasource(LOCAL_TX_DATASOURCE,
+ "default__Local TX Datasource",
+ propertiesMap);
+ client.click("resourceConfigurationForm:saveButton");
+
+ // Check for the appropriate error messages
+ checkClientAndServerMessages("An invalid value was specified for one or more properties",
+ "Value is not a valid integer",
+ true);
+ }
+}
+
15 years, 11 months
EMBJOPR SVN: r101 - trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit.
by embjopr-commits@lists.jboss.org
Author: ozizka(a)redhat.com
Date: 2009-01-08 06:57:04 -0500 (Thu, 08 Jan 2009)
New Revision: 101
Added:
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as4/
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/
Log:
Added org.jboss.jopr.jsfunit.as{4|5} packages
15 years, 11 months
EMBJOPR SVN: r100 - trunk/jsfunit.
by embjopr-commits@lists.jboss.org
Author: ozizka(a)redhat.com
Date: 2009-01-08 06:46:27 -0500 (Thu, 08 Jan 2009)
New Revision: 100
Modified:
trunk/jsfunit/pom.xml
Log:
Preparing pom to split tests for AS 4 and AS 5 into ...jsfunit.as{4|5} packages
Making the pom a bit more readable (empty lines and comments added)
Modified: trunk/jsfunit/pom.xml
===================================================================
--- trunk/jsfunit/pom.xml 2009-01-07 21:46:30 UTC (rev 99)
+++ trunk/jsfunit/pom.xml 2009-01-08 11:46:27 UTC (rev 100)
@@ -97,8 +97,11 @@
<type>war</type>
</dependency>
</dependencies>
+
<build>
<plugins>
+
+ <!-- Cargo plugin -->
<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
@@ -136,6 +139,8 @@
</execution>
</executions>
</plugin>
+
+ <!-- Surefire plugin -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
@@ -148,6 +153,8 @@
</goals>
<configuration>
<skip>false</skip>
+ <includes><include>**/as4/**</include></includes>
+ <excludes><exclude>**/as5/**</exclude></excludes>
<systemProperties>
<property>
<name>cactus.contextURL</name>
@@ -162,6 +169,7 @@
</execution>
</executions>
</plugin>
+
</plugins>
</build>
</profile>
@@ -183,6 +191,7 @@
<scope>compile</scope>
</dependency>
</dependencies>
+
<build>
<plugins>
@@ -238,6 +247,8 @@
</goals>
<configuration>
<skip>false</skip>
+ <includes><include>**/as5/**</include></includes>
+ <excludes><exclude>**/as4/**</exclude></excludes>
<systemProperties>
<property>
<name>cactus.contextURL</name>
15 years, 11 months
EMBJOPR SVN: r99 - trunk/jsfunit.
by embjopr-commits@lists.jboss.org
Author: stan.silvert(a)jboss.com
Date: 2009-01-07 16:46:30 -0500 (Wed, 07 Jan 2009)
New Revision: 99
Modified:
trunk/jsfunit/pom.xml
Log:
Update to depend on embjopr version 1.1.1-SNAPSHOT
Modified: trunk/jsfunit/pom.xml
===================================================================
--- trunk/jsfunit/pom.xml 2009-01-07 18:40:30 UTC (rev 98)
+++ trunk/jsfunit/pom.xml 2009-01-07 21:46:30 UTC (rev 99)
@@ -8,12 +8,12 @@
<parent>
<groupId>org.jboss.jopr</groupId>
<artifactId>jopr-embedded-parent</artifactId>
- <version>1.1.0-SNAPSHOT</version>
+ <version>1.1.1-SNAPSHOT</version>
</parent>
<groupId>org.jboss.jopr</groupId>
<artifactId>jopr-embedded-jsfunit</artifactId>
- <version>1.1.0-SNAPSHOT</version>
+ <version>1.1.1-SNAPSHOT</version>
<packaging>war</packaging>
<name>JSFUnit Tests for Embedded Admin Console</name>
15 years, 11 months
EMBJOPR SVN: r98 - trunk/jsfunit.
by embjopr-commits@lists.jboss.org
Author: ozizka(a)redhat.com
Date: 2009-01-07 13:40:30 -0500 (Wed, 07 Jan 2009)
New Revision: 98
Modified:
trunk/jsfunit/pom.xml
Log:
Making the pom a bit more readable (empty lines and comments added)
Modified: trunk/jsfunit/pom.xml
===================================================================
--- trunk/jsfunit/pom.xml 2009-01-06 20:07:46 UTC (rev 97)
+++ trunk/jsfunit/pom.xml 2009-01-07 18:40:30 UTC (rev 98)
@@ -4,16 +4,19 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"
>
<modelVersion>4.0.0</modelVersion>
+
<parent>
<groupId>org.jboss.jopr</groupId>
<artifactId>jopr-embedded-parent</artifactId>
<version>1.1.0-SNAPSHOT</version>
</parent>
+
<groupId>org.jboss.jopr</groupId>
<artifactId>jopr-embedded-jsfunit</artifactId>
<version>1.1.0-SNAPSHOT</version>
<packaging>war</packaging>
<name>JSFUnit Tests for Embedded Admin Console</name>
+
<pluginRepositories>
<pluginRepository>
<id>codehaus snapshot repository</id>
@@ -23,6 +26,7 @@
</releases>
</pluginRepository>
</pluginRepositories>
+
<dependencies>
<dependency>
<groupId>org.jboss.jsfunit</groupId>
@@ -78,7 +82,11 @@
<version>1.0</version>
</dependency>
</dependencies>
+
+
<profiles>
+
+ <!-- JBoss AS 4.2 -->
<profile>
<id>jboss4.2</id>
<dependencies>
@@ -157,6 +165,8 @@
</plugins>
</build>
</profile>
+
+ <!-- JBoss AS 5.x -->
<profile>
<id>jboss5x</id>
<dependencies>
@@ -175,6 +185,8 @@
</dependencies>
<build>
<plugins>
+
+ <!-- Cargo plugin -->
<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
@@ -212,6 +224,8 @@
</execution>
</executions>
</plugin>
+
+ <!-- Surefire plugin -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
@@ -238,10 +252,14 @@
</execution>
</executions>
</plugin>
+
</plugins>
</build>
</profile>
+
</profiles>
+
+
<build>
<sourceDirectory>src/test/java</sourceDirectory>
<testSourceDirectory>src/test/java</testSourceDirectory>
@@ -270,4 +288,5 @@
</plugin>
</plugins>
</build>
+
</project>
15 years, 11 months
EMBJOPR SVN: r97 - in trunk: jbas5 and 1 other directory.
by embjopr-commits@lists.jboss.org
Author: ips
Date: 2009-01-06 15:07:46 -0500 (Tue, 06 Jan 2009)
New Revision: 97
Modified:
trunk/jbas4/pom.xml
trunk/jbas5/pom.xml
Log:
revert version of jopr-embedded-core dep back to snapshot
Modified: trunk/jbas4/pom.xml
===================================================================
--- trunk/jbas4/pom.xml 2009-01-06 19:54:07 UTC (rev 96)
+++ trunk/jbas4/pom.xml 2009-01-06 20:07:46 UTC (rev 97)
@@ -9,8 +9,7 @@
</parent>
<groupId>org.jboss.jopr</groupId>
- <artifactId>jopr-embedded-jbas4</artifactId>
- <version>1.1.1-SNAPSHOT</version>
+ <artifactId>jopr-embedded-jbas4</artifactId>
<packaging>war</packaging>
<name>JBossAS 4.x Administration Console</name>
@@ -19,8 +18,7 @@
<developerConnection>scm:svn:https://svn.jboss.org/repos/embjopr/trunk/jbas4/</developerConnection>
</scm>
- <properties>
- <jopr-embedded-core.version>1.1.0.GA</jopr-embedded-core.version>
+ <properties>
<warDir>${basedir}/target/${project.build.finalName}</warDir>
<warFile>${warDir}.war</warFile>
<contextRoot>admin-console</contextRoot>
@@ -31,7 +29,7 @@
<dependency>
<groupId>org.jboss.jopr</groupId>
<artifactId>jopr-embedded-core</artifactId>
- <version>${jopr-embedded-core.version}</version>
+ <version>${project.version}</version>
<type>war</type>
</dependency>
Modified: trunk/jbas5/pom.xml
===================================================================
--- trunk/jbas5/pom.xml 2009-01-06 19:54:07 UTC (rev 96)
+++ trunk/jbas5/pom.xml 2009-01-06 20:07:46 UTC (rev 97)
@@ -9,8 +9,7 @@
</parent>
<groupId>org.jboss.jopr</groupId>
- <artifactId>jopr-embedded-jbas5</artifactId>
- <version>1.1.1-SNAPSHOT</version>
+ <artifactId>jopr-embedded-jbas5</artifactId>
<packaging>war</packaging>
<name>JBossAS 5.x Administration Console</name>
@@ -19,8 +18,7 @@
<developerConnection>scm:svn:https://svn.jboss.org/repos/embjopr/trunk/jbas5/</developerConnection>
</scm>
- <properties>
- <jopr-embedded-core.version>1.1.0.GA</jopr-embedded-core.version>
+ <properties>
<warDir>${basedir}/target/${project.build.finalName}</warDir>
<warFile>${warDir}.war</warFile>
<contextRoot>admin-console</contextRoot>
@@ -31,7 +29,7 @@
<dependency>
<groupId>org.jboss.jopr</groupId>
<artifactId>jopr-embedded-core</artifactId>
- <version>${jopr-embedded-core.version}</version>
+ <version>${project.version}</version>
<type>war</type>
</dependency>
15 years, 11 months