JBoss Portal SVN: r8517 - in branches/UIServer: uiserver and 3 other directories.
by portal-commits@lists.jboss.org
Author: sohil.shah(a)jboss.com
Date: 2007-10-02 16:48:23 -0400 (Tue, 02 Oct 2007)
New Revision: 8517
Added:
branches/UIServer/uiserver/gwt-dev-env/src/
branches/UIServer/uiserver/gwt-dev-env/src/org.jboss.portal.uiserver.ajax.PortalLayout/
branches/UIServer/uiserver/gwt-dev-env/src/org.jboss.portal.uiserver.ajax.PortalLayout/cmsPortlet.html
branches/UIServer/uiserver/gwt-dev-env/src/org.jboss.portal.uiserver.ajax.PortalLayout/jspPortlet.html
branches/UIServer/uiserver/gwt-dev-env/src/org.jboss.portal.uiserver.ajax.PortalLayout/weatherPortlet.html
Removed:
branches/UIServer/uiserver/gwt-compile
branches/UIServer/uiserver/gwt-dev-env/.gwt-cache/
branches/UIServer/uiserver/gwt-dev-env/tomcat/
branches/UIServer/uiserver/gwt-dev-env/www/
Modified:
branches/UIServer/build/build-thirdparty.xml
branches/UIServer/uiserver/build.xml
branches/UIServer/uiserver/gwt-dev-env/PartialRefresh(uiserver).launch
branches/UIServer/uiserver/gwt-dev-env/PortalLayout(uiserver).launch
Log:
cleanup
Modified: branches/UIServer/build/build-thirdparty.xml
===================================================================
--- branches/UIServer/build/build-thirdparty.xml 2007-10-02 19:09:12 UTC (rev 8516)
+++ branches/UIServer/build/build-thirdparty.xml 2007-10-02 20:48:23 UTC (rev 8517)
@@ -116,6 +116,7 @@
<componentref name="portals-bridges" version="1.0"/>
<!-- patched jsf-portlet bridge -->
<componentref name="portals-bridges/jsf-portlet" version="1.2-patched"/>
+ <componentref name="gwt" version="1.4.60"/>
</build>
<synchronizeinfo/>
Modified: branches/UIServer/uiserver/build.xml
===================================================================
--- branches/UIServer/uiserver/build.xml 2007-10-02 19:09:12 UTC (rev 8516)
+++ branches/UIServer/uiserver/build.xml 2007-10-02 20:48:23 UTC (rev 8517)
@@ -91,7 +91,7 @@
<path refid="sun.servlet.classpath"/>
<path refid="apache.log4j.classpath"/>
<path refid="junit.junit.classpath"/>
- <path refid="google.gwt.classpath"/>
+ <path refid="gwt.gwt.classpath"/>
</path>
<!-- Configure modules -->
@@ -250,7 +250,7 @@
<target name="deploy-poc" depends="output">
<!-- compile the GWT Java code into JavaScript/Web resources -->
<delete dir="${build.resources}/client/ajax/uiserver-poc.war/org.jboss.portal.uiserver.ajax.PortalLayout"/>
- <java classpathref="google.gwt.classpath" fork="true" classname="com.google.gwt.dev.GWTCompiler">
+ <java classpathref="gwt.gwt.classpath" fork="true" classname="com.google.gwt.dev.GWTCompiler">
<classpath>
<pathelement path="src/main"/>
<pathelement path="src/resources/client/ajax/src"/>
@@ -260,7 +260,7 @@
</java>
<delete dir="${build.resources}/client/ajax/uiserver-poc.war/org.jboss.portal.uiserver.ajax.PartialRefresh"/>
- <java classpathref="google.gwt.classpath" fork="true" classname="com.google.gwt.dev.GWTCompiler">
+ <java classpathref="gwt.gwt.classpath" fork="true" classname="com.google.gwt.dev.GWTCompiler">
<classpath>
<pathelement path="src/main"/>
<pathelement path="src/resources/client/ajax/src"/>
Deleted: branches/UIServer/uiserver/gwt-compile
===================================================================
--- branches/UIServer/uiserver/gwt-compile 2007-10-02 19:09:12 UTC (rev 8516)
+++ branches/UIServer/uiserver/gwt-compile 2007-10-02 20:48:23 UTC (rev 8517)
@@ -1,3 +0,0 @@
-#!/bin/sh
-ant clean main;
-java -cp "src/main:src/resources/client/ajax/src:output/classes:gwt-dev-env/gwt-user.jar:gwt-dev-env/gwt-dev-linux.jar" com.google.gwt.dev.GWTCompiler -out "output/resources/client/ajax" "$@" org.jboss.portal.uiserver.ajax.PortalLayout;
Modified: branches/UIServer/uiserver/gwt-dev-env/PartialRefresh(uiserver).launch
===================================================================
--- branches/UIServer/uiserver/gwt-dev-env/PartialRefresh(uiserver).launch 2007-10-02 19:09:12 UTC (rev 8516)
+++ branches/UIServer/uiserver/gwt-dev-env/PartialRefresh(uiserver).launch 2007-10-02 20:48:23 UTC (rev 8517)
@@ -9,6 +9,7 @@
<listEntry value="<?xml version="1.0" encoding="UTF-8"?> <runtimeClasspathEntry containerPath="org.eclipse.jdt.launching.JRE_CONTAINER" javaProject="UIServer" path="1" type="4"/> "/>
<listEntry value="<?xml version="1.0" encoding="UTF-8"?> <runtimeClasspathEntry internalArchive="/UIServer/uiserver/src/main" path="3" type="2"/> "/>
<listEntry value="<?xml version="1.0" encoding="UTF-8"?> <runtimeClasspathEntry internalArchive="/UIServer/uiserver/src/resources/client/ajax/src" path="3" type="2"/> "/>
+<listEntry value="<?xml version="1.0" encoding="UTF-8"?> <runtimeClasspathEntry internalArchive="/UIServer/uiserver/gwt-dev-env/src" path="3" type="2"/> "/>
<listEntry value="<?xml version="1.0" encoding="UTF-8"?> <runtimeClasspathEntry id="org.eclipse.jdt.launching.classpathentry.defaultClasspath"> <memento exportedEntriesOnly="false" project="UIServer"/> </runtimeClasspathEntry> "/>
<listEntry value="<?xml version="1.0" encoding="UTF-8"?> <runtimeClasspathEntry internalArchive="/UIServer/uiserver/gwt-dev-env/gwt-dev-linux.jar" path="3" type="2"/> "/>
</listAttribute>
Modified: branches/UIServer/uiserver/gwt-dev-env/PortalLayout(uiserver).launch
===================================================================
--- branches/UIServer/uiserver/gwt-dev-env/PortalLayout(uiserver).launch 2007-10-02 19:09:12 UTC (rev 8516)
+++ branches/UIServer/uiserver/gwt-dev-env/PortalLayout(uiserver).launch 2007-10-02 20:48:23 UTC (rev 8517)
@@ -9,6 +9,7 @@
<listEntry value="<?xml version="1.0" encoding="UTF-8"?> <runtimeClasspathEntry containerPath="org.eclipse.jdt.launching.JRE_CONTAINER" javaProject="UIServer" path="1" type="4"/> "/>
<listEntry value="<?xml version="1.0" encoding="UTF-8"?> <runtimeClasspathEntry internalArchive="/UIServer/uiserver/src/main" path="3" type="2"/> "/>
<listEntry value="<?xml version="1.0" encoding="UTF-8"?> <runtimeClasspathEntry internalArchive="/UIServer/uiserver/src/resources/client/ajax/src" path="3" type="2"/> "/>
+<listEntry value="<?xml version="1.0" encoding="UTF-8"?> <runtimeClasspathEntry internalArchive="/UIServer/uiserver/gwt-dev-env/src" path="3" type="2"/> "/>
<listEntry value="<?xml version="1.0" encoding="UTF-8"?> <runtimeClasspathEntry id="org.eclipse.jdt.launching.classpathentry.defaultClasspath"> <memento exportedEntriesOnly="false" project="UIServer"/> </runtimeClasspathEntry> "/>
<listEntry value="<?xml version="1.0" encoding="UTF-8"?> <runtimeClasspathEntry internalArchive="/UIServer/uiserver/gwt-dev-env/gwt-dev-linux.jar" path="3" type="2"/> "/>
</listAttribute>
Added: branches/UIServer/uiserver/gwt-dev-env/src/org.jboss.portal.uiserver.ajax.PortalLayout/cmsPortlet.html
===================================================================
--- branches/UIServer/uiserver/gwt-dev-env/src/org.jboss.portal.uiserver.ajax.PortalLayout/cmsPortlet.html (rev 0)
+++ branches/UIServer/uiserver/gwt-dev-env/src/org.jboss.portal.uiserver.ajax.PortalLayout/cmsPortlet.html 2007-10-02 20:48:23 UTC (rev 8517)
@@ -0,0 +1,81 @@
+<style type="text/css">
+ #welcomelogo {
+ float: left;
+ margin: 30px 0px 30px 15px;
+ }
+
+ #welcometext {
+ margin: 30px 50px 30px 225px;
+ }
+
+ #welcomegreybox {
+ padding: 15px;
+ margin-bottom: 30px;
+ }
+
+ #welcomegreyboxTD {
+ border-left: 1px solid #d5d5d5;
+ padding-left: 15px;
+ }
+
+ #welcomegreybox h3 {
+ color: #5078aa;
+ font: bold 13px Helvetica, Arial, sans-serif;
+ }
+</style>
+
+<!--
+<div>
+ <img src="/portal/content/default/images/homeimg_main.png" width="560" height="160"/>
+</div>
+-->
+
+<!--
+<div id="welcomelogo"><img src="/portal/content/default/images/homeimg_jbosslogo.png" width="143" height="64"/></div>
+-->
+
+
+<p id="welcometext">JBoss Portal provides an open source platform for hosting and serving a portal Web interface,
+ publishing and managing its content, and customizing its experience. While most packaged Portal frameworks help
+ enterprises launch Portals more quickly, only JBoss Portal delivers the benefits of a zero-cost open source license
+ combined with a flexible and scalable underling platform.</p>
+
+<div id="welcomegreybox">
+ <table width="100%">
+ <tr>
+ <td valign="top"><h3>Support Services</h3>
+ <p>
+ JBoss Inc. offers various support services tailored to fit your needs. <a href="portal/index.html">Explore</a>
+ support and service options for JBoss Portal.
+ </p>
+ </td>
+ <td valign="top" id="welcomegreyboxTD"><h3>PortletSwap</h3>
+ <p>
+ <a href="http://www.portletswap.com">Portletswap.com</a> is an open community sponsored by JBoss, Inc. to facilitate the exchange of portlets and layouts for use in JBoss Portal.
+ </p>
+ </td>
+ <td valign="top" id="welcomegreyboxTD"><h3>Project Information</h3>
+ <p>Learn more about the <a href="/portal/index.html">JBoss Portal project</a>, on-going development, open
+ issues, and our
+ user and developer communities.
+ </p>
+ </td>
+ </tr>
+ </table>
+
+</div>
+<p>Thank you for downloading and deploying JBoss Portal. We hope your enjoy working with it as much as we enjoy
+ developing it!</p>
+<p>Baci e abbracci,<br/>
+ The JBoss Portal Team.
+</p>
+
+<br/>
+
+<div>
+ <form name="testForm" method="post" action="portal/index.html">
+ <span>Param1:</span><input type="text" name="param1"/><br/>
+ <span>Param2:</span><input type="text" name="param2"/><br/>
+ <input type="submit"/>
+ </form>
+</div>
\ No newline at end of file
Added: branches/UIServer/uiserver/gwt-dev-env/src/org.jboss.portal.uiserver.ajax.PortalLayout/jspPortlet.html
===================================================================
--- branches/UIServer/uiserver/gwt-dev-env/src/org.jboss.portal.uiserver.ajax.PortalLayout/jspPortlet.html (rev 0)
+++ branches/UIServer/uiserver/gwt-dev-env/src/org.jboss.portal.uiserver.ajax.PortalLayout/jspPortlet.html 2007-10-02 20:48:23 UTC (rev 8517)
@@ -0,0 +1,42 @@
+<div class="portlet-container"><table width="100%" border="0" cellpadding="0" cellspacing="0"><tr><td class="portlet-titlebar-left"></td><td class="portlet-titlebar-center"><div class="portlet-titlebar-decoration"></div><span class="portlet-titlebar-title">Greetings!</span><div class="portlet-mode-container"><span title="minimized"><a class="portlet-mode-minimized" href="/portal/portal/default/default/JSPPortletWindow?windowstate=minimized"> </a></span><span title="maximized"><a class="portlet-mode-maximized" href="/portal/portal/default/default/JSPPortletWindow?windowstate=maximized"> </a></span></div></td><td class="portlet-titlebar-right"></td></tr><tr><td class="portlet-content-left"></td><td class="portlet-body"><div class="portlet-content-center">
+
+<table border="0" cellspacing="2" cellpadding="2">
+ <tr>
+ <td align="center"><a href="http://portal.demo.jboss.com" target="_blank"><img
+ src="/portal-jsp-samples/images/dodemo.gif" border="0"
+ alt="Try the latest release of JBoss Portal, live and online."></a>
+ <a href="http://labs.jboss.com/portal/jbossportal/download/index.html" target="_blank"><img
+ src="/portal-jsp-samples/images/getcode.gif" border="0"
+ alt="Download JBoss Portal and have it up and running in minutes."></a>
+ <a href="http://www.portletswap.com" target="_blank"><img
+ src="/portal-jsp-samples/images/accessorize.gif" border="0"
+ alt="Download portlets and layouts for your new JBoss Portal installation."></a></td>
+ </tr>
+ <tr>
+
+ <td></td>
+ </tr>
+ <tr>
+ <td class="portlet-section-alternate">
+ <font class="portlet-font">This is a basic installation of <b>JBoss Portal 2.8.0-SNAPSHOT</b>. You may
+ log in at any time, using the <i>Login</i> link at the top-right of this page, with the following
+ credentials:</font>
+ </td>
+
+ </tr>
+ <tr>
+ <td class="portlet-section-alternate" align="center">
+ <b>user/user</b> or <b>admin/admin</b>
+ </td>
+ </tr>
+ <tr>
+
+ <td align="center">
+ If you are in need of guidance with regards to navigating, configuring, or operating the portal, please view
+ our <a href="http://labs.jboss.com/portal/jbossportal/docs/index.html" target="_blank">online documentation</a>.
+ </td>
+ </tr>
+</table>
+</div></td><td class="portlet-content-right"></td></tr><tr><td class="portlet-footer-left"></td><td class="portlet-footer-center"></td><td class="portlet-footer-right"></td></tr></table>
+
+</div>
\ No newline at end of file
Added: branches/UIServer/uiserver/gwt-dev-env/src/org.jboss.portal.uiserver.ajax.PortalLayout/weatherPortlet.html
===================================================================
--- branches/UIServer/uiserver/gwt-dev-env/src/org.jboss.portal.uiserver.ajax.PortalLayout/weatherPortlet.html (rev 0)
+++ branches/UIServer/uiserver/gwt-dev-env/src/org.jboss.portal.uiserver.ajax.PortalLayout/weatherPortlet.html 2007-10-02 20:48:23 UTC (rev 8517)
@@ -0,0 +1,76 @@
+<div class="portlet-container"><table width="100%" border="0" cellpadding="0" cellspacing="0"><tr><td class="portlet-titlebar-left"></td><td class="portlet-titlebar-center"><div class="portlet-titlebar-decoration"></div><span class="portlet-titlebar-title">Weather Portlet</span><div class="portlet-mode-container"><span title="minimized"><a class="portlet-mode-minimized" href="/portal/portal/default/default/2?windowstate=minimized"> </a></span><span title="maximized"><a class="portlet-mode-maximized" href="/portal/portal/default/default/2?windowstate=maximized"> </a></span></div></td><td class="portlet-titlebar-right"></td></tr><tr><td class="portlet-content-left"></td><td class="portlet-body"><div class="portlet-content-center"><br/>
+<div align="center">
+<font>
+<b>Miami, FL, US</b>
+</font>
+
+<br/>
+<br/>
+<table border="0" width="130">
+<tr>
+<td>
+<table height="130" border="0">
+<tr>
+<td align="center" class="portlet-section-header">Currently</td>
+</tr>
+<tr>
+<td valign="top" align="center" class="portlet-section-alternate">
+<img src="http://us.i1.yimg.com/us.yimg.com/i/us/we/52//28.gif"/>
+</td>
+</tr>
+<tr>
+<td valign="top" align="center" class="portlet-section-alternate">Mostly Cloudy</td>
+
+</tr>
+<tr>
+<td valign="top" align="center" class="portlet-section-alternate">86F</td>
+</tr>
+</table>
+</td>
+<td>
+<table height="130" border="0">
+<tr>
+<td valign="top" align="center" class="portlet-section-header">Thu</td>
+</tr>
+<tr>
+<td valign="top" align="center" class="portlet-section-alternate">
+<img src="http://us.i1.yimg.com/us.yimg.com/i/us/we/52//38.gif"/>
+</td>
+
+</tr>
+<tr>
+<td valign="top" align="center" class="portlet-section-alternate">Scattered Thunderstorms</td>
+</tr>
+<tr>
+<td valign="top" align="center" class="portlet-section-alternate">76F/86F</td>
+</tr>
+</table>
+</td>
+<td>
+<table height="130" border="0">
+<tr>
+<td valign="top" align="center" class="portlet-section-header">Fri</td>
+</tr>
+
+<tr>
+<td valign="top" align="center" class="portlet-section-alternate">
+<img src="http://us.i1.yimg.com/us.yimg.com/i/us/we/52//38.gif"/>
+</td>
+</tr>
+<tr>
+<td valign="top" align="center" class="portlet-section-alternate">Scattered Thunderstorms</td>
+</tr>
+<tr>
+<td valign="top" align="center" class="portlet-section-alternate">78F/89F</td>
+</tr>
+</table>
+</td>
+</tr>
+</table>
+
+<br/>
+<a target="_blank" href="http://us.rd.yahoo.com/dailynews/rss/weather/Miami__FL/*http://weather.ya...">Complete Forecast</a>
+</div>
+</div></td><td class="portlet-content-right"></td></tr><tr><td class="portlet-footer-left"></td><td class="portlet-footer-center"></td><td class="portlet-footer-right"></td></tr></table>
+
+</div>
\ No newline at end of file
16 years, 8 months
JBoss Portal SVN: r8516 - in modules/test/trunk/unit/src/main/org/jboss: test/unit/pojo and 6 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-10-02 15:09:12 -0400 (Tue, 02 Oct 2007)
New Revision: 8516
Added:
modules/test/trunk/unit/src/main/org/jboss/test/unit/pojo/junit/
modules/test/trunk/unit/src/main/org/jboss/test/unit/pojo/junit/JUnitPOJOTests.java
modules/test/trunk/unit/src/main/org/jboss/test/unit/pojo/junit/JUnitTest1.java
modules/test/trunk/unit/src/main/org/jboss/test/unit/pojo/junit/JUnitTest2.java
modules/test/trunk/unit/src/main/org/jboss/test/unit/pojo/junit/JUnitTest3.java
modules/test/trunk/unit/src/main/org/jboss/test/unit/pojo/junit/JUnitTest4.java
modules/test/trunk/unit/src/main/org/jboss/test/unit/pojo/junit/JUnitTest5.java
modules/test/trunk/unit/src/main/org/jboss/test/unit/pojo/junit/JUnitTest6.java
modules/test/trunk/unit/src/main/org/jboss/unit/api/pojo/TestLifeCycle.java
modules/test/trunk/unit/src/main/org/jboss/unit/api/pojo/TestSuiteDescriptor.java
modules/test/trunk/unit/src/main/org/jboss/unit/api/pojo/junit/JUnitDescriptor.java
modules/test/trunk/unit/src/main/org/jboss/unit/api/pojo/junit/JUnitLifeCycle.java
modules/test/trunk/unit/src/main/org/jboss/unit/api/pojo/junit/JUnitTestMethod.java
modules/test/trunk/unit/src/main/org/jboss/unit/api/pojo/junit/JUnitTestMethodLifeCycle.java
modules/test/trunk/unit/src/main/org/jboss/unit/api/pojo/junit/TestCase.java
Removed:
modules/test/trunk/unit/src/main/org/jboss/unit/api/pojo/junit/JUnitTestHandler.java
Modified:
modules/test/trunk/unit/src/main/org/jboss/test/unit/AllTests.java
modules/test/trunk/unit/src/main/org/jboss/test/unit/PrintListener.java
modules/test/trunk/unit/src/main/org/jboss/test/unit/pojo/TestDriverPOJOTest.java
modules/test/trunk/unit/src/main/org/jboss/test/unit/pojo/TestDriverPOJOTests.java
modules/test/trunk/unit/src/main/org/jboss/test/unit/pojo/TestHandlerSupportPOJOTest.java
modules/test/trunk/unit/src/main/org/jboss/unit/Failure.java
modules/test/trunk/unit/src/main/org/jboss/unit/FailureType.java
modules/test/trunk/unit/src/main/org/jboss/unit/api/Assert.java
modules/test/trunk/unit/src/main/org/jboss/unit/api/pojo/TestHandler.java
modules/test/trunk/unit/src/main/org/jboss/unit/api/pojo/TestHandlerSupport.java
modules/test/trunk/unit/src/main/org/jboss/unit/unit/pojo/POJOTestSuiteDriver.java
modules/test/trunk/unit/src/main/org/jboss/unit/unit/pojo/POJOTestSuiteInfo.java
Log:
- split API of TestHandler to TestLifeCycle and TestSuiteDescriptor
- added basic support for junit test cases pattern
Modified: modules/test/trunk/unit/src/main/org/jboss/test/unit/AllTests.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/test/unit/AllTests.java 2007-10-02 18:18:13 UTC (rev 8515)
+++ modules/test/trunk/unit/src/main/org/jboss/test/unit/AllTests.java 2007-10-02 19:09:12 UTC (rev 8516)
@@ -25,6 +25,7 @@
import org.jboss.test.unit.api.AssertTests;
import org.jboss.test.unit.blah.BlahTests;
import org.jboss.test.unit.pojo.AbstractPOJOTests;
+import org.jboss.test.unit.pojo.junit.JUnitPOJOTests;
import org.jboss.test.unit.runner.CompositeTestRunnerTests;
import org.jboss.test.unit.runner.ParametrizationTests;
import org.jboss.test.unit.runner.event.TestRunnerEventBroadcasterSupportTests;
@@ -41,9 +42,8 @@
public static void main(String[] args) throws Exception
{
AssertTests.main(args);
-// TestHandlerSupportTests.main(args);
-// POJOTestDriverTests.main(args);
AbstractPOJOTests.main(args);
+ JUnitPOJOTests.main(args);
CompositeTestRunnerTests.main(args);
//
Modified: modules/test/trunk/unit/src/main/org/jboss/test/unit/PrintListener.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/test/unit/PrintListener.java 2007-10-02 18:18:13 UTC (rev 8515)
+++ modules/test/trunk/unit/src/main/org/jboss/test/unit/PrintListener.java 2007-10-02 19:09:12 UTC (rev 8516)
@@ -56,7 +56,7 @@
{
RunnerFailureEvent failureEvent = (RunnerFailureEvent)event;
Failure failure = failureEvent.getFailure();
- System.out.println("Runner failure: " + failure.getLevel() + " " + failure.getMessage());
+ System.out.println("Runner failure: " + failure.getType() + " " + failure.getMessage());
}
else if (event instanceof StartTestEvent)
{
@@ -76,7 +76,7 @@
{
TestFailure testFailure = (TestFailure)testResult;
Failure failure = testFailure.getFailure();
- System.out.println("Test id=" + testId + " " + failure.getLevel() + " failed " + failure.getMessage());
+ System.out.println("Test id=" + testId + " " + failure.getType() + " failed " + failure.getMessage());
if (failure.getCause() != null)
{
failure.getCause().printStackTrace();
Modified: modules/test/trunk/unit/src/main/org/jboss/test/unit/pojo/TestDriverPOJOTest.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/test/unit/pojo/TestDriverPOJOTest.java 2007-10-02 18:18:13 UTC (rev 8515)
+++ modules/test/trunk/unit/src/main/org/jboss/test/unit/pojo/TestDriverPOJOTest.java 2007-10-02 19:09:12 UTC (rev 8516)
@@ -105,7 +105,7 @@
else if (response instanceof FailureResponse)
{
FailureResponse failureResponse = (FailureResponse)response;
- switch (failureResponse.getFailure().getLevel())
+ switch (failureResponse.getFailure().getType())
{
case ERROR:
return InvokeResult.ERROR;
Modified: modules/test/trunk/unit/src/main/org/jboss/test/unit/pojo/TestDriverPOJOTests.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/test/unit/pojo/TestDriverPOJOTests.java 2007-10-02 18:18:13 UTC (rev 8515)
+++ modules/test/trunk/unit/src/main/org/jboss/test/unit/pojo/TestDriverPOJOTests.java 2007-10-02 19:09:12 UTC (rev 8516)
@@ -24,7 +24,7 @@
import org.jboss.unit.driver.TestDriver;
import org.jboss.unit.unit.pojo.POJOTestSuiteDriver;
-import static org.jboss.unit.api.Assert.fail;
+import static org.jboss.unit.api.Assert.*;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
@@ -40,6 +40,14 @@
new POJOTestSuiteDriver(clazz);
fail();
}
+ catch (InstantiationException e)
+ {
+ fail(e);
+ }
+ catch (IllegalAccessException e)
+ {
+ fail(e);
+ }
catch (IllegalArgumentException expected)
{
}
@@ -47,9 +55,20 @@
protected AbstractPOJOTest assertCanBuildSuite(Class clazz)
{
- TestDriver driver = new POJOTestSuiteDriver(clazz);
+ try
+ {
+ TestDriver driver = new POJOTestSuiteDriver(clazz);
- //
- return new TestDriverPOJOTest(driver);
+ //
+ return new TestDriverPOJOTest(driver);
+ }
+ catch (InstantiationException e)
+ {
+ throw createFailure(e);
+ }
+ catch (IllegalAccessException e)
+ {
+ throw createFailure(e);
+ }
}
}
Modified: modules/test/trunk/unit/src/main/org/jboss/test/unit/pojo/TestHandlerSupportPOJOTest.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/test/unit/pojo/TestHandlerSupportPOJOTest.java 2007-10-02 18:18:13 UTC (rev 8515)
+++ modules/test/trunk/unit/src/main/org/jboss/test/unit/pojo/TestHandlerSupportPOJOTest.java 2007-10-02 19:09:12 UTC (rev 8516)
@@ -48,29 +48,29 @@
public Set<String> getParameterNames()
{
- return handler.getParameters().keySet();
+ return handler.getDescriptor().getParameters().keySet();
}
public Set<String> getTestCaseNames()
{
- return handler.getTestCases().keySet();
+ return handler.getDescriptor().getTestCases().keySet();
}
public Set<String> getKeywords()
{
- return handler.getKeywords();
+ return handler.getDescriptor().getKeywords();
}
public Set<String> getTestCaseKeywords(String testCaseName)
{
- TestCaseDescriptor descriptor = handler.getTestCases().get(testCaseName);
+ TestCaseDescriptor descriptor = handler.getDescriptor().getTestCases().get(testCaseName);
assertNotNull(descriptor);
return descriptor.getKeywords();
}
public Set<String> getTestCaseParameterNames(String testCaseName)
{
- TestCaseDescriptor descriptor = handler.getTestCases().get(testCaseName);
+ TestCaseDescriptor descriptor = handler.getDescriptor().getTestCases().get(testCaseName);
assertNotNull(descriptor);
return descriptor.getParameters().keySet();
}
@@ -81,11 +81,11 @@
boolean invokeDestroy = false;
try
{
- testCase = handler.newTestCase(testName);
- handler.testCaseParametrize(testCase, parametrization);
+ testCase = handler.getLifeCycle().newTestCase(testName);
+ handler.getLifeCycle().testCaseParametrize(testCase, parametrization);
invokeDestroy = true;
- handler.testCaseCreate(testCase);
- handler.testCaseInvoke(testCase);
+ handler.getLifeCycle().testCaseCreate(testCase);
+ handler.getLifeCycle().testCaseInvoke(testCase);
return InvokeResult.PASS;
}
catch (TestCaseLifeCycleException e)
@@ -104,7 +104,7 @@
{
if (invokeDestroy)
{
- handler.testCaseDestroy(testCase);
+ handler.getLifeCycle().testCaseDestroy(testCase);
}
}
}
Added: modules/test/trunk/unit/src/main/org/jboss/test/unit/pojo/junit/JUnitPOJOTests.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/test/unit/pojo/junit/JUnitPOJOTests.java (rev 0)
+++ modules/test/trunk/unit/src/main/org/jboss/test/unit/pojo/junit/JUnitPOJOTests.java 2007-10-02 19:09:12 UTC (rev 8516)
@@ -0,0 +1,151 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt 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.test.unit.pojo.junit;
+
+import org.jboss.unit.unit.pojo.POJOTestSuiteDriver;
+
+import static org.jboss.unit.util.CollectionTools.*;
+import static org.jboss.unit.api.Assert.*;
+import org.jboss.unit.TestId;
+import org.jboss.unit.Failure;
+import org.jboss.unit.FailureType;
+import org.jboss.unit.info.TestInfo;
+import org.jboss.unit.info.TestSuiteInfo;
+import org.jboss.unit.driver.command.StartTestCommand;
+import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.driver.response.FailureResponse;
+import org.jboss.unit.driver.response.EndTestResponse;
+
+import java.util.HashMap;
+import java.util.HashSet;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class JUnitPOJOTests
+{
+
+ public static void main(String[] args)
+ {
+ test1();
+ test2();
+ test3();
+ test4();
+ }
+
+ private static void test1()
+ {
+ POJOTestSuiteDriver driver = createDriver(JUnitTest1.class);
+ TestInfo driverInfo = driver.getInfo();
+ TestSuiteInfo suiteInfo = assertInstanceOf(driverInfo, TestSuiteInfo.class);
+ assertEquals(JUnitTest1.class.getName(), suiteInfo.getName());
+ assertEquals(new HashMap(), suiteInfo.getParameters());
+ assertEquals(new HashSet(), suiteInfo.getNames());
+
+ // Try to invoke a no op
+ DriverResponse response = driver.invoke(new TestId("foo"), new StartTestCommand());
+ FailureResponse failureResponse = assertInstanceOf(response, FailureResponse.class);
+ Failure failure = failureResponse.getFailure();
+ assertEquals(FailureType.ERROR, failure.getType());
+ }
+
+ private static void test2()
+ {
+ POJOTestSuiteDriver driver = createDriver(JUnitTest2.class);
+ TestInfo driverInfo = driver.getInfo();
+ TestSuiteInfo suiteInfo = assertInstanceOf(driverInfo, TestSuiteInfo.class);
+ assertEquals(JUnitTest2.class.getName(), suiteInfo.getName());
+ assertEquals(new HashMap(), suiteInfo.getParameters());
+ assertEquals(set("testBlah"), suiteInfo.getNames());
+
+ // Try to invoke a no op
+ DriverResponse response = driver.invoke(new TestId("testBlah"), new StartTestCommand());
+ assertInstanceOf(response, EndTestResponse.class);
+ }
+
+ private static void test3()
+ {
+ POJOTestSuiteDriver driver = createDriver(JUnitTest3.class);
+ TestInfo driverInfo = driver.getInfo();
+ TestSuiteInfo suiteInfo = assertInstanceOf(driverInfo, TestSuiteInfo.class);
+ assertEquals(JUnitTest3.class.getName(), suiteInfo.getName());
+ assertEquals(new HashMap(), suiteInfo.getParameters());
+ assertEquals(set("testBlah"), suiteInfo.getNames());
+
+ // Try to invoke a no op
+ DriverResponse response = driver.invoke(new TestId("testBlah"), new StartTestCommand());
+ FailureResponse failureResponse = assertInstanceOf(response, FailureResponse.class);
+ Failure failure = failureResponse.getFailure();
+ assertEquals(FailureType.ERROR, failure.getType());
+ }
+
+ private static void test4()
+ {
+ POJOTestSuiteDriver driver = createDriver(JUnitTest4.class);
+ TestInfo driverInfo = driver.getInfo();
+ TestSuiteInfo suiteInfo = assertInstanceOf(driverInfo, TestSuiteInfo.class);
+ assertEquals(JUnitTest4.class.getName(), suiteInfo.getName());
+ assertEquals(new HashMap(), suiteInfo.getParameters());
+ assertEquals(set("testBlah"), suiteInfo.getNames());
+
+ // Try to invoke a no op
+ DriverResponse response = driver.invoke(new TestId("testBlah"), new StartTestCommand());
+ FailureResponse failureResponse = assertInstanceOf(response, FailureResponse.class);
+ Failure failure = failureResponse.getFailure();
+ assertEquals(FailureType.ERROR, failure.getType());
+ }
+
+ private static void test5()
+ {
+ POJOTestSuiteDriver driver = createDriver(JUnitTest5.class);
+ TestInfo driverInfo = driver.getInfo();
+ TestSuiteInfo suiteInfo = assertInstanceOf(driverInfo, TestSuiteInfo.class);
+ assertEquals(JUnitTest5.class.getName(), suiteInfo.getName());
+ assertEquals(new HashMap(), suiteInfo.getParameters());
+ assertEquals(set("testBlah"), suiteInfo.getNames());
+
+ // Try to invoke a no op
+ DriverResponse response = driver.invoke(new TestId("testBlah"), new StartTestCommand());
+ FailureResponse failureResponse = assertInstanceOf(response, FailureResponse.class);
+ Failure failure = failureResponse.getFailure();
+ assertEquals(FailureType.ERROR, failure.getType());
+ }
+
+ private static POJOTestSuiteDriver createDriver(Class clazz)
+ {
+ try
+ {
+ return new POJOTestSuiteDriver(clazz);
+ }
+ catch (InstantiationException e)
+ {
+ throw createFailure(e);
+ }
+ catch (IllegalAccessException e)
+ {
+ throw createFailure(e);
+ }
+ }
+
+}
Added: modules/test/trunk/unit/src/main/org/jboss/test/unit/pojo/junit/JUnitTest1.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/test/unit/pojo/junit/JUnitTest1.java (rev 0)
+++ modules/test/trunk/unit/src/main/org/jboss/test/unit/pojo/junit/JUnitTest1.java 2007-10-02 19:09:12 UTC (rev 8516)
@@ -0,0 +1,33 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt 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.test.unit.pojo.junit;
+
+import org.jboss.unit.api.pojo.junit.TestCase;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class JUnitTest1 extends TestCase
+{
+}
Added: modules/test/trunk/unit/src/main/org/jboss/test/unit/pojo/junit/JUnitTest2.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/test/unit/pojo/junit/JUnitTest2.java (rev 0)
+++ modules/test/trunk/unit/src/main/org/jboss/test/unit/pojo/junit/JUnitTest2.java 2007-10-02 19:09:12 UTC (rev 8516)
@@ -0,0 +1,39 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt 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.test.unit.pojo.junit;
+
+import org.jboss.unit.api.pojo.junit.TestCase;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class JUnitTest2 extends TestCase
+{
+
+ public void testBlah()
+ {
+
+ }
+
+}
Added: modules/test/trunk/unit/src/main/org/jboss/test/unit/pojo/junit/JUnitTest3.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/test/unit/pojo/junit/JUnitTest3.java (rev 0)
+++ modules/test/trunk/unit/src/main/org/jboss/test/unit/pojo/junit/JUnitTest3.java 2007-10-02 19:09:12 UTC (rev 8516)
@@ -0,0 +1,39 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt 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.test.unit.pojo.junit;
+
+import org.jboss.unit.api.pojo.junit.TestCase;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class JUnitTest3 extends TestCase
+{
+
+ public void testBlah()
+ {
+ throw new RuntimeException();
+ }
+
+}
Added: modules/test/trunk/unit/src/main/org/jboss/test/unit/pojo/junit/JUnitTest4.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/test/unit/pojo/junit/JUnitTest4.java (rev 0)
+++ modules/test/trunk/unit/src/main/org/jboss/test/unit/pojo/junit/JUnitTest4.java 2007-10-02 19:09:12 UTC (rev 8516)
@@ -0,0 +1,39 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt 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.test.unit.pojo.junit;
+
+import org.jboss.unit.api.pojo.junit.TestCase;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class JUnitTest4 extends TestCase
+{
+
+ public void testBlah() throws Exception
+ {
+ throw new Exception();
+ }
+
+}
Added: modules/test/trunk/unit/src/main/org/jboss/test/unit/pojo/junit/JUnitTest5.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/test/unit/pojo/junit/JUnitTest5.java (rev 0)
+++ modules/test/trunk/unit/src/main/org/jboss/test/unit/pojo/junit/JUnitTest5.java 2007-10-02 19:09:12 UTC (rev 8516)
@@ -0,0 +1,39 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt 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.test.unit.pojo.junit;
+
+import org.jboss.unit.api.pojo.junit.TestCase;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class JUnitTest5 extends TestCase
+{
+
+ public void testBlah()
+ {
+ throw new Error();
+ }
+
+}
Added: modules/test/trunk/unit/src/main/org/jboss/test/unit/pojo/junit/JUnitTest6.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/test/unit/pojo/junit/JUnitTest6.java (rev 0)
+++ modules/test/trunk/unit/src/main/org/jboss/test/unit/pojo/junit/JUnitTest6.java 2007-10-02 19:09:12 UTC (rev 8516)
@@ -0,0 +1,32 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt 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.test.unit.pojo.junit;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class JUnitTest6
+{
+
+}
Modified: modules/test/trunk/unit/src/main/org/jboss/unit/Failure.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/unit/Failure.java 2007-10-02 18:18:13 UTC (rev 8515)
+++ modules/test/trunk/unit/src/main/org/jboss/unit/Failure.java 2007-10-02 19:09:12 UTC (rev 8516)
@@ -71,7 +71,7 @@
return cause;
}
- public FailureType getLevel()
+ public FailureType getType()
{
return type;
}
Modified: modules/test/trunk/unit/src/main/org/jboss/unit/FailureType.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/unit/FailureType.java 2007-10-02 18:18:13 UTC (rev 8515)
+++ modules/test/trunk/unit/src/main/org/jboss/unit/FailureType.java 2007-10-02 19:09:12 UTC (rev 8516)
@@ -30,9 +30,7 @@
*/
public enum FailureType
{
-
ERROR,
ASSERTION,
-
-
+ INTERNAL_ERROR
}
Modified: modules/test/trunk/unit/src/main/org/jboss/unit/api/Assert.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/unit/api/Assert.java 2007-10-02 18:18:13 UTC (rev 8515)
+++ modules/test/trunk/unit/src/main/org/jboss/unit/api/Assert.java 2007-10-02 19:09:12 UTC (rev 8516)
@@ -253,7 +253,7 @@
public static Error createFailure()
{
- return createFailure(null);
+ return createFailure((String)null);
}
public static Error createFailure(String msg)
@@ -261,6 +261,11 @@
return createAssertionError(null, msg);
}
+ public static Error createFailure(Throwable throwable)
+ {
+ return createAssertionError(throwable, null);
+ }
+
public static Error createAssertionError(Throwable cause, String msg)
{
if (msg == null)
Modified: modules/test/trunk/unit/src/main/org/jboss/unit/api/pojo/TestHandler.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/unit/api/pojo/TestHandler.java 2007-10-02 18:18:13 UTC (rev 8515)
+++ modules/test/trunk/unit/src/main/org/jboss/unit/api/pojo/TestHandler.java 2007-10-02 19:09:12 UTC (rev 8516)
@@ -22,12 +22,6 @@
******************************************************************************/
package org.jboss.unit.api.pojo;
-import org.jboss.unit.api.pojo.ParameterDescriptor;
-import org.jboss.unit.api.pojo.TestCaseDescriptor;
-
-import java.util.Map;
-import java.util.Set;
-
/**
* Allow a pojo class to take care of providing its description and perform test case life cycle management.
*
@@ -37,80 +31,8 @@
public interface TestHandler
{
- /**
- * Return the test name.
- *
- * @return the test name
- */
- String getName();
+ TestSuiteDescriptor getDescriptor();
- /**
- * Return the test description.
- *
- * @return the test description
- */
- String getDescription();
+ TestLifeCycle getLifeCycle();
- /**
- * Returns the keywords for the test.
- *
- * @return the test keywords
- */
- Set<String> getKeywords();
-
- /**
- * Return the test parameters.
- *
- * @return the test parameters
- */
- Map<String,? extends ParameterDescriptor> getParameters();
-
- /**
- * Return the test case descriptions.
- *
- * @return the test case descriptions
- */
- Map<String,? extends TestCaseDescriptor> getTestCases();
-
- /**
- * Instantiate life cycle operation of a test case.
- *
- * @param name the test case name
- * @return the test case object
- * @throws TestCaseLifeCycleException
- */
- Object newTestCase(String name) throws TestCaseLifeCycleException;
-
- /**
- * Parametrize life cycle operation of a test case.
- *
- * @param testCase the test case
- * @param parametrization the parametrization
- * @throws TestCaseLifeCycleException
- */
- void testCaseParametrize(Object testCase, Map<String,String> parametrization) throws TestCaseLifeCycleException;
-
- /**
- * Create life cycle operation of a test case.
- *
- * @param testCase the test case
- * @throws TestCaseLifeCycleException
- */
- void testCaseCreate(Object testCase) throws TestCaseLifeCycleException;
-
- /**
- * Invocation life cycle operation of a test case.
- *
- * @param testCase the test case
- * @throws TestCaseLifeCycleException
- */
- void testCaseInvoke(Object testCase) throws TestCaseLifeCycleException;
-
- /**
- * Destroy life cycle operation of a test case.
- *
- * @param testCase the test case
- */
- void testCaseDestroy(Object testCase);
-
}
Modified: modules/test/trunk/unit/src/main/org/jboss/unit/api/pojo/TestHandlerSupport.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/unit/api/pojo/TestHandlerSupport.java 2007-10-02 18:18:13 UTC (rev 8515)
+++ modules/test/trunk/unit/src/main/org/jboss/unit/api/pojo/TestHandlerSupport.java 2007-10-02 19:09:12 UTC (rev 8516)
@@ -54,7 +54,7 @@
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
*/
-public class TestHandlerSupport implements TestHandler
+public class TestHandlerSupport implements TestHandler, TestLifeCycle, TestSuiteDescriptor
{
/** . */
@@ -421,6 +421,16 @@
this.destroy = destroy;
}
+ public TestSuiteDescriptor getDescriptor()
+ {
+ return this;
+ }
+
+ public TestLifeCycle getLifeCycle()
+ {
+ return this;
+ }
+
public String getName()
{
return suiteName;
Added: modules/test/trunk/unit/src/main/org/jboss/unit/api/pojo/TestLifeCycle.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/unit/api/pojo/TestLifeCycle.java (rev 0)
+++ modules/test/trunk/unit/src/main/org/jboss/unit/api/pojo/TestLifeCycle.java 2007-10-02 19:09:12 UTC (rev 8516)
@@ -0,0 +1,75 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt 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.unit.api.pojo;
+
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public interface TestLifeCycle
+{
+
+ /**
+ * Instantiate life cycle operation of a test case.
+ *
+ * @param name the test case name
+ * @return the test case object
+ * @throws TestCaseLifeCycleException
+ */
+ Object newTestCase(String name) throws TestCaseLifeCycleException;
+
+ /**
+ * Parametrize life cycle operation of a test case.
+ *
+ * @param testCase the test case
+ * @param parametrization the parametrization
+ * @throws TestCaseLifeCycleException
+ */
+ void testCaseParametrize(Object testCase, Map<String,String> parametrization) throws TestCaseLifeCycleException;
+
+ /**
+ * Create life cycle operation of a test case.
+ *
+ * @param testCase the test case
+ * @throws TestCaseLifeCycleException
+ */
+ void testCaseCreate(Object testCase) throws TestCaseLifeCycleException;
+
+ /**
+ * Invocation life cycle operation of a test case.
+ *
+ * @param testCase the test case
+ * @throws TestCaseLifeCycleException
+ */
+ void testCaseInvoke(Object testCase) throws TestCaseLifeCycleException;
+
+ /**
+ * Destroy life cycle operation of a test case.
+ *
+ * @param testCase the test case
+ */
+ void testCaseDestroy(Object testCase);
+
+}
Added: modules/test/trunk/unit/src/main/org/jboss/unit/api/pojo/TestSuiteDescriptor.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/unit/api/pojo/TestSuiteDescriptor.java (rev 0)
+++ modules/test/trunk/unit/src/main/org/jboss/unit/api/pojo/TestSuiteDescriptor.java 2007-10-02 19:09:12 UTC (rev 8516)
@@ -0,0 +1,70 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt 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.unit.api.pojo;
+
+import java.util.Set;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public interface TestSuiteDescriptor
+{
+
+ /**
+ * Return the test name.
+ *
+ * @return the test name
+ */
+ String getName();
+
+ /**
+ * Return the test description.
+ *
+ * @return the test description
+ */
+ String getDescription();
+
+ /**
+ * Returns the keywords for the test.
+ *
+ * @return the test keywords
+ */
+ Set<String> getKeywords();
+
+ /**
+ * Return the test parameters.
+ *
+ * @return the test parameters
+ */
+ Map<String,? extends ParameterDescriptor> getParameters();
+
+ /**
+ * Return the test case descriptions.
+ *
+ * @return the test case descriptions
+ */
+ Map<String,? extends TestCaseDescriptor> getTestCases();
+
+}
Added: modules/test/trunk/unit/src/main/org/jboss/unit/api/pojo/junit/JUnitDescriptor.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/unit/api/pojo/junit/JUnitDescriptor.java (rev 0)
+++ modules/test/trunk/unit/src/main/org/jboss/unit/api/pojo/junit/JUnitDescriptor.java 2007-10-02 19:09:12 UTC (rev 8516)
@@ -0,0 +1,128 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt 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.unit.api.pojo.junit;
+
+import org.jboss.unit.api.pojo.TestSuiteDescriptor;
+import org.jboss.unit.api.pojo.ParameterDescriptor;
+import org.jboss.unit.api.pojo.TestCaseDescriptor;
+
+import java.util.Map;
+import java.util.Set;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.HashMap;
+import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+class JUnitDescriptor implements TestSuiteDescriptor
+{
+
+ /** . */
+ final Class testClass;
+
+ /** . */
+ final Map<String,JUnitTestMethod> testMap;
+
+ public JUnitDescriptor(Class testClass)
+ {
+ this.testClass = testClass;
+ this.testMap = new HashMap<String, JUnitTestMethod>();
+
+ //
+ try
+ {
+ Method[] methods = testClass.getMethods();
+ for (int j = 0; j < methods.length; j++)
+ {
+ Method method = methods[j];
+
+ //
+ int modifiers = method.getModifiers();
+ if (Modifier.isPublic(modifiers) && !Modifier.isAbstract(modifiers) && !Modifier.isStatic(modifiers))
+ {
+ String methodName = method.getName();
+ if (methodName.startsWith("test") &&
+ method.getParameterTypes().length == 0)
+ {
+ JUnitTestMethod tm = new JUnitTestMethod(method);
+ testMap.put(method.getName(), tm);
+ }
+// else if (methodName.startsWith("set") &&
+// methodName.endsWith("Parameter") &&
+// method.getParameterTypes().length == 1)
+// {
+// String parameterName = methodName.substring(3, methodName.length() - 9);
+// setterMap.put(parameterName, method);
+// }
+ }
+ }
+
+ // Set all parameters on children
+// for (Iterator i = setterMap.keySet().iterator(); i.hasNext();)
+// {
+// String parameterName = (String)i.next();
+// for (Iterator j = testMap.keySet().iterator(); j.hasNext();)
+// {
+// String childName = (String)j.next();
+// TestInfo childInfo = (TestInfo)containerInfo.getChild(childName);
+// childInfo.addParameter(new TestParameterInfo(parameterName));
+// }
+// }
+ }
+ catch (Exception e)
+ {
+ IllegalArgumentException iae = new IllegalArgumentException();
+ iae.initCause(e);
+ throw iae;
+ }
+ }
+
+ public String getName()
+ {
+ return testClass.getName();
+ }
+
+ public String getDescription()
+ {
+ return "";
+ }
+
+ public Set<String> getKeywords()
+ {
+ return Collections.emptySet();
+ }
+
+ public Map<String, ? extends ParameterDescriptor> getParameters()
+ {
+ return Collections.emptyMap();
+ }
+
+ public Map<String, ? extends TestCaseDescriptor> getTestCases()
+ {
+ return Collections.unmodifiableMap(testMap);
+ }
+}
Added: modules/test/trunk/unit/src/main/org/jboss/unit/api/pojo/junit/JUnitLifeCycle.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/unit/api/pojo/junit/JUnitLifeCycle.java (rev 0)
+++ modules/test/trunk/unit/src/main/org/jboss/unit/api/pojo/junit/JUnitLifeCycle.java 2007-10-02 19:09:12 UTC (rev 8516)
@@ -0,0 +1,111 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt 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.unit.api.pojo.junit;
+
+import org.jboss.unit.api.pojo.TestLifeCycle;
+import org.jboss.unit.api.pojo.TestCaseLifeCycleException;
+
+import java.util.Map;
+import java.lang.reflect.InvocationTargetException;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+class JUnitLifeCycle implements TestLifeCycle
+{
+
+ /** . */
+ private final TestCase testCase;
+
+ public JUnitLifeCycle(TestCase testCase)
+ {
+ this.testCase = testCase;
+ }
+
+ public Object newTestCase(String name) throws TestCaseLifeCycleException
+ {
+ JUnitTestMethod method = testCase.descriptor.testMap.get(name);
+ if (method == null)
+ {
+ throw new TestCaseLifeCycleException("No test case " + name + " found");
+ }
+ return new JUnitTestMethodLifeCycle(method);
+ }
+
+ public void testCaseParametrize(Object _lifeCycle, Map<String, String> parametrization) throws TestCaseLifeCycleException
+ {
+ // No op
+ }
+
+ public void testCaseCreate(Object _lifeCycle) throws TestCaseLifeCycleException
+ {
+ try
+ {
+ testCase.setUp();
+ }
+ catch (Throwable e)
+ {
+ throw unwrap(e);
+ }
+ }
+
+ public void testCaseInvoke(Object _lifeCycle) throws TestCaseLifeCycleException
+ {
+ JUnitTestMethodLifeCycle lifeCycle = (JUnitTestMethodLifeCycle)_lifeCycle;
+
+ // Invoke test joinpoint
+ try
+ {
+ lifeCycle.testMethod.method.invoke(testCase, new Object[0]);
+ }
+ catch (IllegalAccessException e)
+ {
+ throw unwrap(e);
+ }
+ catch (InvocationTargetException e)
+ {
+ throw unwrap(e.getCause());
+ }
+ }
+
+ private TestCaseLifeCycleException unwrap(Throwable throwable)
+ {
+ // Look if it's an assertion failure from junit API
+ for (Class clazz = throwable.getClass();clazz != null;clazz = clazz.getSuperclass())
+ {
+ if ("junit.framework.AssertionFailedError".equals(clazz.getName()))
+ {
+ return new TestCaseLifeCycleException(new AssertionError(throwable));
+ }
+ }
+
+ //
+ return new TestCaseLifeCycleException(throwable);
+ }
+
+ public void testCaseDestroy(Object _testCase)
+ {
+ testCase.tearDown();
+ }
+}
Deleted: modules/test/trunk/unit/src/main/org/jboss/unit/api/pojo/junit/JUnitTestHandler.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/unit/api/pojo/junit/JUnitTestHandler.java 2007-10-02 18:18:13 UTC (rev 8515)
+++ modules/test/trunk/unit/src/main/org/jboss/unit/api/pojo/junit/JUnitTestHandler.java 2007-10-02 19:09:12 UTC (rev 8516)
@@ -1,33 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt 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.unit.api.pojo.junit;
-
-/**
- * @todo
- *
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public class JUnitTestHandler
-{
-}
Added: modules/test/trunk/unit/src/main/org/jboss/unit/api/pojo/junit/JUnitTestMethod.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/unit/api/pojo/junit/JUnitTestMethod.java (rev 0)
+++ modules/test/trunk/unit/src/main/org/jboss/unit/api/pojo/junit/JUnitTestMethod.java 2007-10-02 19:09:12 UTC (rev 8516)
@@ -0,0 +1,67 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt 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.unit.api.pojo.junit;
+
+import org.jboss.unit.api.pojo.TestCaseDescriptor;
+import org.jboss.unit.api.pojo.ParameterDescriptor;
+
+import java.util.Map;
+import java.util.Set;
+import java.util.Collections;
+import java.lang.reflect.Method;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+class JUnitTestMethod implements TestCaseDescriptor
+{
+
+ /** . */
+ final Method method;
+
+ public JUnitTestMethod(Method method)
+ {
+ this.method = method;
+ }
+
+ public String getName()
+ {
+ return method.getName();
+ }
+
+ public String getDescription()
+ {
+ return "";
+ }
+
+ public Map<String, ? extends ParameterDescriptor> getParameters()
+ {
+ return Collections.emptyMap();
+ }
+
+ public Set<String> getKeywords()
+ {
+ return Collections.emptySet();
+ }
+}
Added: modules/test/trunk/unit/src/main/org/jboss/unit/api/pojo/junit/JUnitTestMethodLifeCycle.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/unit/api/pojo/junit/JUnitTestMethodLifeCycle.java (rev 0)
+++ modules/test/trunk/unit/src/main/org/jboss/unit/api/pojo/junit/JUnitTestMethodLifeCycle.java 2007-10-02 19:09:12 UTC (rev 8516)
@@ -0,0 +1,39 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt 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.unit.api.pojo.junit;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+class JUnitTestMethodLifeCycle
+{
+
+ /** . */
+ final JUnitTestMethod testMethod;
+
+ public JUnitTestMethodLifeCycle(JUnitTestMethod testMethod)
+ {
+ this.testMethod = testMethod;
+ }
+}
Added: modules/test/trunk/unit/src/main/org/jboss/unit/api/pojo/junit/TestCase.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/unit/api/pojo/junit/TestCase.java (rev 0)
+++ modules/test/trunk/unit/src/main/org/jboss/unit/api/pojo/junit/TestCase.java 2007-10-02 19:09:12 UTC (rev 8516)
@@ -0,0 +1,67 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt 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.unit.api.pojo.junit;
+
+import org.jboss.unit.api.pojo.TestHandler;
+import org.jboss.unit.api.pojo.TestSuiteDescriptor;
+import org.jboss.unit.api.pojo.TestLifeCycle;
+
+
+/**
+ * @todo
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class TestCase implements TestHandler
+{
+
+ /** . */
+ final JUnitDescriptor descriptor;
+
+ final JUnitLifeCycle lifeCycle;
+
+ public TestCase()
+ {
+ descriptor = new JUnitDescriptor(getClass());
+ lifeCycle = new JUnitLifeCycle(this);
+ }
+
+ protected void setUp()
+ {
+ }
+
+ protected void tearDown()
+ {
+ }
+
+ public TestSuiteDescriptor getDescriptor()
+ {
+ return descriptor;
+ }
+
+ public TestLifeCycle getLifeCycle()
+ {
+ return lifeCycle;
+ }
+}
Modified: modules/test/trunk/unit/src/main/org/jboss/unit/unit/pojo/POJOTestSuiteDriver.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/unit/unit/pojo/POJOTestSuiteDriver.java 2007-10-02 18:18:13 UTC (rev 8515)
+++ modules/test/trunk/unit/src/main/org/jboss/unit/unit/pojo/POJOTestSuiteDriver.java 2007-10-02 19:09:12 UTC (rev 8516)
@@ -25,6 +25,7 @@
import org.jboss.unit.api.pojo.TestHandler;
import org.jboss.unit.api.pojo.TestHandlerSupport;
import org.jboss.unit.api.pojo.TestCaseLifeCycleException;
+import org.jboss.unit.api.pojo.TestLifeCycle;
import org.jboss.unit.driver.TestDriver;
import org.jboss.unit.driver.DriverResponse;
import org.jboss.unit.driver.DriverCommand;
@@ -51,10 +52,18 @@
/** . */
private TestSuiteInfo info;
- public POJOTestSuiteDriver(Class testClass)
+ public POJOTestSuiteDriver(Class testClass) throws InstantiationException, IllegalAccessException
{
- handler = new TestHandlerSupport(testClass);
- info = new POJOTestSuiteInfo(handler);
+ if (TestHandler.class.isAssignableFrom(testClass))
+ {
+ handler = (TestHandler)testClass.newInstance();
+ }
+ else
+ {
+ handler = new TestHandlerSupport(testClass);
+ }
+
+ info = new POJOTestSuiteInfo(handler.getDescriptor());
}
public TestInfo getInfo()
@@ -75,13 +84,16 @@
}
//
+ TestLifeCycle lifeCycle = handler.getLifeCycle();
+
+ //
String name = id.getName(0);
//
Object pojo;
try
{
- pojo = handler.newTestCase(name);
+ pojo = lifeCycle.newTestCase(name);
}
catch (Exception e)
{
@@ -94,7 +106,7 @@
//
try
{
- handler.testCaseParametrize(pojo, parametrization);
+ lifeCycle.testCaseParametrize(pojo, parametrization);
}
catch (Exception e)
{
@@ -104,10 +116,10 @@
//
try
{
- handler.testCaseCreate(pojo);
+ lifeCycle.testCaseCreate(pojo);
//
- handler.testCaseInvoke(pojo);
+ lifeCycle.testCaseInvoke(pojo);
}
catch (Exception e)
{
@@ -115,7 +127,7 @@
}
finally
{
- handler.testCaseDestroy(pojo);
+ lifeCycle.testCaseDestroy(pojo);
}
//
Modified: modules/test/trunk/unit/src/main/org/jboss/unit/unit/pojo/POJOTestSuiteInfo.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/unit/unit/pojo/POJOTestSuiteInfo.java 2007-10-02 18:18:13 UTC (rev 8515)
+++ modules/test/trunk/unit/src/main/org/jboss/unit/unit/pojo/POJOTestSuiteInfo.java 2007-10-02 19:09:12 UTC (rev 8516)
@@ -22,8 +22,8 @@
******************************************************************************/
package org.jboss.unit.unit.pojo;
-import org.jboss.unit.api.pojo.TestHandler;
import org.jboss.unit.api.pojo.TestCaseDescriptor;
+import org.jboss.unit.api.pojo.TestSuiteDescriptor;
import org.jboss.unit.info.TestSuiteInfo;
import org.jboss.unit.info.TestInfo;
import org.jboss.unit.TestId;
@@ -40,36 +40,36 @@
{
/** . */
- private TestHandler handler;
+ private TestSuiteDescriptor descriptor;
/** . */
private Map<String,POJOTestCaseInfo> testCases;
- public POJOTestSuiteInfo(TestHandler handler)
+ public POJOTestSuiteInfo(TestSuiteDescriptor descriptor)
{
- super(handler.getParameters(), handler.getKeywords());
+ super(descriptor.getParameters(), descriptor.getKeywords());
//
HashMap<String, POJOTestCaseInfo> testCases = new HashMap<String, POJOTestCaseInfo>();
- for (TestCaseDescriptor testCaseDescriptor : handler.getTestCases().values())
+ for (TestCaseDescriptor testCaseDescriptor : descriptor.getTestCases().values())
{
POJOTestCaseInfo testCase = new POJOTestCaseInfo(testCaseDescriptor);
testCases.put(testCase.getName(), testCase);
}
//
- this.handler = handler;
+ this.descriptor = descriptor;
this.testCases = testCases;
}
public String getName()
{
- return handler.getName();
+ return descriptor.getName();
}
public String getDescription()
{
- return handler.getDescription();
+ return descriptor.getDescription();
}
public TestInfo getTest(String name)
16 years, 8 months
JBoss Portal SVN: r8514 - in modules/test/trunk: tools/etc/buildfragments and 1 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-10-02 07:27:31 -0400 (Tue, 02 Oct 2007)
New Revision: 8514
Modified:
modules/test/trunk/build/ide/intellij/idea60/modules/unit/unit.iml
modules/test/trunk/tools/etc/buildfragments/buildmagic.ent
modules/test/trunk/tools/etc/buildfragments/defaults.ent
modules/test/trunk/unit/build.xml
Log:
update to produce correct javadocs for jboss unit
Modified: modules/test/trunk/build/ide/intellij/idea60/modules/unit/unit.iml
===================================================================
--- modules/test/trunk/build/ide/intellij/idea60/modules/unit/unit.iml 2007-10-02 03:59:50 UTC (rev 8513)
+++ modules/test/trunk/build/ide/intellij/idea60/modules/unit/unit.iml 2007-10-02 11:27:31 UTC (rev 8514)
@@ -10,5 +10,9 @@
<orderEntry type="sourceFolder" forTests="false" />
<orderEntryProperties />
</component>
+ <component name="VcsManagerConfiguration">
+ <option name="ACTIVE_VCS_NAME" value="svn" />
+ <option name="USE_PROJECT_VCS" value="false" />
+ </component>
</module>
Modified: modules/test/trunk/tools/etc/buildfragments/buildmagic.ent
===================================================================
--- modules/test/trunk/tools/etc/buildfragments/buildmagic.ent 2007-10-02 03:59:50 UTC (rev 8513)
+++ modules/test/trunk/tools/etc/buildfragments/buildmagic.ent 2007-10-02 11:27:31 UTC (rev 8514)
@@ -759,39 +759,9 @@
</i>
]]></bottom>
- <!--
- <link href="http://java.sun.com/j2se/1.3/docs/api"/>
- -->
-
- <!-- Added links and tags by Yanik Crepeau <yanik(a)exScriptis.com> 2003-05-13 -->
<!--Thes tag declarations will shut down the Unknown tag warning during the javadoc process -->
- <link href="http://java.sun.com/j2se/1.4.1/docs/api/"/>
- <tag name="ejb.interface-method" description="ejb interface method delcaration" enabled="false" />
- <tag name="ejb.persistence" description="ejb persistence declaration" enabled="false" />
- <tag name="ejb.pk-field" description="ejb primary-key field declaration" enabled="false" />
- <tag name="ejb.pk" description="ejb" enabled="false" />
- <tag name="ejb.bean" description="ejb" enabled="false" />
- <tag name="ejb.transaction" description="ejb" enabled="false" />
- <tag name="ejb.finder" description="ejb" enabled="false" />
- <tag name="ejb.relation" description="ejb" enabled="false" />
- <tag name="ejb.create-method" description="ejb" enabled="false" />
+ <link href="http://java.sun.com/j2se/1.5.0/docs/api/"/>
- <tag name="jboss.query" description="jboss" enabled="false" />
- <tag name="jboss.lazy-load-group" description="jboss" enabled="false" />
- <tag name="jboss.load-group" description="jboss" enabled="false" />
- <tag name="jboss.persistence" description="jboss" enabled="false" />
- <tag name="jboss.entity-command" description="jboss" enabled="false" />
- <tag name="jboss.method-attribute" description="jboss" enabled="false" />
- <tag name="jboss.relation" description="jboss" enabled="false" />
- <tag name="jboss.method-attribute" description="jboss" enabled="false" />
- <tag name="jboss.relation-read-ahead" description="jboss" enabled="false" />
- <tag name="jboss.relation-table" description="jboss" enabled="false" />
- <tag name="jboss.table-attribute" description="jboss" enabled="false" />
-
- <tag name="jmx.managed-attribute" description="jmx" enabled="false" />
- <tag name="jmx.managed-constructor" description="jmx" enabled="false" />
- <tag name="jboss.method-attributes" description="jboss" enabled="false" />
-
</javadoc>
</target>
@@ -805,7 +775,7 @@
destdir="${build.api}"
classpathref="javadoc.classpath"
windowtitle="${javadoc.windowtitle}"
- splitindex="${javadoc.splitindex}"
+ splitindex="${javadoc.splitindex}"
author="${javadoc.author}"
version="${javadoc.version}"
public="${javadoc.public}"
@@ -813,7 +783,7 @@
protected="${javadoc.protected}"
private="${javadoc.private}"
use="${javadoc.use}"
- verbose="${javadoc.verbose}">
+ verbose="${javadoc.verbose}">
<doctitle><![CDATA[<h1>${module.Name} API Documentation</h1>]]></doctitle>
<bottom><![CDATA[
<i>
Modified: modules/test/trunk/tools/etc/buildfragments/defaults.ent
===================================================================
--- modules/test/trunk/tools/etc/buildfragments/defaults.ent 2007-10-02 03:59:50 UTC (rev 8513)
+++ modules/test/trunk/tools/etc/buildfragments/defaults.ent 2007-10-02 11:27:31 UTC (rev 8514)
@@ -138,7 +138,6 @@
<path refid="javac.classpath"/>
</path>
-
<!-- Packages to include when generating api documentation -->
<property name="javadoc.packages" value="org.jboss.*"/>
Modified: modules/test/trunk/unit/build.xml
===================================================================
--- modules/test/trunk/unit/build.xml 2007-10-02 03:59:50 UTC (rev 8513)
+++ modules/test/trunk/unit/build.xml 2007-10-02 11:27:31 UTC (rev 8514)
@@ -96,16 +96,17 @@
<!--| Override any default properties here. |-->
<!--+=======================================+-->
- <!-- Configure defaults & build tools -->
- <call target="configure-defaults"/>
- <call target="configure-tools"/>
-
<!--+=======================================+-->
<!--| Define module specific elements here. |-->
<!--+=======================================+-->
- <property name="javadoc.private" value="true"/>
+ <property name="javadoc.private" value="false"/>
<property name="javadoc.protected" value="false"/>
+ <property name="javadoc.packages" value="org.jboss.unit.*"/>
+ <!-- Configure defaults & build tools -->
+ <call target="configure-defaults"/>
+ <call target="configure-tools"/>
+
</target>
<!--+====================================================================+-->
16 years, 8 months
JBoss Portal SVN: r8513 - modules/common/trunk/common.
by portal-commits@lists.jboss.org
Author: wesleyhales
Date: 2007-10-01 23:59:50 -0400 (Mon, 01 Oct 2007)
New Revision: 8513
Modified:
modules/common/trunk/common/pom.xml
Log:
Changes for deploy config and new structure
Modified: modules/common/trunk/common/pom.xml
===================================================================
--- modules/common/trunk/common/pom.xml 2007-10-02 03:59:15 UTC (rev 8512)
+++ modules/common/trunk/common/pom.xml 2007-10-02 03:59:50 UTC (rev 8513)
@@ -1,234 +1,232 @@
<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">
- <parent>
- <artifactId>modules</artifactId>
- <groupId>org.jboss.portal</groupId>
- <version>1.0-SNAPSHOT</version>
- </parent>
- <modelVersion>4.0.0</modelVersion>
- <groupId>org.jboss.portal</groupId>
- <artifactId>common</artifactId>
- <packaging>jar</packaging>
- <name>Jboss Portal Common</name>
- <version>1.0-SNAPSHOT</version>
+ <parent>
+ <artifactId>jboss-portal</artifactId>
+ <groupId>org.jboss.portal</groupId>
+ <version>1.0-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>jboss-portal-modules-common</artifactId>
+ <packaging>jar</packaging>
+ <name>Jboss Portal Common</name>
- <dependencies>
+ <dependencies>
- <dependency>
- <groupId>apache-log4j</groupId>
- <artifactId>log4j</artifactId>
- <version>1.2.14</version>
- </dependency>
+ <dependency>
+ <groupId>apache-log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <version>1.2.14</version>
+ </dependency>
- <dependency>
- <groupId>oswego-concurrent</groupId>
- <artifactId>concurrent</artifactId>
- <version>1.3.4</version>
- </dependency>
+ <dependency>
+ <groupId>oswego-concurrent</groupId>
+ <artifactId>concurrent</artifactId>
+ <version>1.3.4</version>
+ </dependency>
- <dependency>
- <groupId>javax.activation</groupId>
- <artifactId>activation</artifactId>
- <version>1.1</version>
- </dependency>
+ <dependency>
+ <groupId>javax.activation</groupId>
+ <artifactId>activation</artifactId>
+ <version>1.1</version>
+ </dependency>
- <!--<dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.1</version>
- </dependency>-->
+ <!--<dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.1</version>
+ </dependency>-->
- <dependency>
- <groupId>jboss</groupId>
- <artifactId>jboss-j2ee</artifactId>
- <version>4.2.0.GA</version>
- </dependency>
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>jboss-j2ee</artifactId>
+ <version>4.2.0.GA</version>
+ </dependency>
- <dependency>
- <groupId>jboss</groupId>
- <artifactId>jboss-common-core</artifactId>
- <version>2.2.0.GA</version>
- </dependency>
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>jboss-common-core</artifactId>
+ <version>2.2.0.GA</version>
+ </dependency>
- <dependency>
- <groupId>ant</groupId>
- <artifactId>ant</artifactId>
- <version>1.6.5</version>
- </dependency>
+ <dependency>
+ <groupId>ant</groupId>
+ <artifactId>ant</artifactId>
+ <version>1.6.5</version>
+ </dependency>
- <dependency>
- <groupId>jboss</groupId>
- <artifactId>jboss-jmx</artifactId>
- <version>4.2.0.GA</version>
- </dependency>
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>jboss-jmx</artifactId>
+ <version>4.2.0.GA</version>
+ </dependency>
- <dependency>
- <groupId>jboss</groupId>
- <artifactId>jboss-system</artifactId>
- <version>4.2.0.GA</version>
- </dependency>
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>jboss-system</artifactId>
+ <version>4.2.0.GA</version>
+ </dependency>
- <dependency>
- <groupId>apache-httpclient</groupId>
- <artifactId>commons-httpclient</artifactId>
- <version>2.0.2</version>
- </dependency>
+ <dependency>
+ <groupId>apache-httpclient</groupId>
+ <artifactId>commons-httpclient</artifactId>
+ <version>2.0.2</version>
+ </dependency>
- <dependency>
- <groupId>jboss</groupId>
- <artifactId>jboss-backport-concurrent</artifactId>
- <version>2.1.0.GA</version>
- </dependency>
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>jboss-backport-concurrent</artifactId>
+ <version>2.1.0.GA</version>
+ </dependency>
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- <version>2.4</version>
- </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>2.4</version>
+ </dependency>
- <dependency>
- <groupId>ant</groupId>
- <artifactId>ant-junit</artifactId>
- <version>1.6.5</version>
- </dependency>
+ <dependency>
+ <groupId>ant</groupId>
+ <artifactId>ant-junit</artifactId>
+ <version>1.6.5</version>
+ </dependency>
- <dependency>
- <groupId>org.codehaus.cargo</groupId>
- <artifactId>cargo-core-uberjar</artifactId>
- <version>0.8</version>
- </dependency>
+ <dependency>
+ <groupId>org.codehaus.cargo</groupId>
+ <artifactId>cargo-core-uberjar</artifactId>
+ <version>0.8</version>
+ </dependency>
- <dependency>
- <groupId>ant</groupId>
- <artifactId>ant-launcher</artifactId>
- <version>0.1</version>
- <scope>system</scope>
- <systemPath>${basedir}/../tools/lib/ant-launcher.jar</systemPath>
- </dependency>
+ <dependency>
+ <groupId>ant</groupId>
+ <artifactId>ant-launcher</artifactId>
+ <version>0.1</version>
+ <scope>system</scope>
+ <systemPath>${basedir}/../tools/lib/ant-launcher.jar</systemPath>
+ </dependency>
- <dependency>
- <groupId>ant</groupId>
- <artifactId>ant-nodeps</artifactId>
- <version>0.1</version>
- <scope>system</scope>
- <systemPath>${basedir}/../tools/lib/ant-nodeps.jar</systemPath>
- </dependency>
+ <dependency>
+ <groupId>ant</groupId>
+ <artifactId>ant-nodeps</artifactId>
+ <version>0.1</version>
+ <scope>system</scope>
+ <systemPath>${basedir}/../tools/lib/ant-nodeps.jar</systemPath>
+ </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>0.1</version>
- <scope>system</scope>
- <systemPath>${basedir}/../tools/lib/junit.jar</systemPath>
- </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>0.1</version>
+ <scope>system</scope>
+ <systemPath>${basedir}/../tools/lib/junit.jar</systemPath>
+ </dependency>
- </dependencies>
+ </dependencies>
- <build>
- <resources>
- <resource>
- <filtering>false</filtering>
- <directory>src/main/resources/format/code</directory>
- <includes>
- <include>*.tpl</include>
- </includes>
- </resource>
- </resources>
- <plugins>
+ <build>
+ <resources>
+ <resource>
+ <filtering>false</filtering>
+ <directory>src/main/resources/format/code</directory>
+ <includes>
+ <include>*.tpl</include>
+ </includes>
+ </resource>
+ </resources>
+ <plugins>
- <plugin>
- <artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <encoding>iso-8859-1</encoding>
- </configuration>
- </plugin>
+ <plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <encoding>iso-8859-1</encoding>
+ </configuration>
+ </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-jar-plugin</artifactId>
- <configuration>
- <archive>
- <manifest>
- <addClasspath>true</addClasspath>
- </manifest>
- </archive>
- </configuration>
- </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <configuration>
+ <archive>
+ <manifest>
+ <addClasspath>true</addClasspath>
+ </manifest>
+ </archive>
+ </configuration>
+ </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <excludes>
- <exclude>org/jboss/portal/test/common/BundleNameParserTestCase*.java</exclude>
- <exclude>org/jboss/portal/test/common/net/URLNavigatorTestCase.java</exclude>
- </excludes>
- </configuration>
- </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <excludes>
+ <exclude>org/jboss/portal/test/common/BundleNameParserTestCase*.java</exclude>
+ <exclude>org/jboss/portal/test/common/net/URLNavigatorTestCase.java</exclude>
+ </excludes>
+ </configuration>
+ </plugin>
- <!--<plugin>
- <artifactId>maven-antrun-plugin</artifactId>
- <executions>
- <execution>
- <phase>generate-sources</phase>
- <configuration>
- <tasks>
- <echo message="Run Ant tasks"/>
- <property name="build.resources" refid="maven.test.classpath"/>
- </tasks>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
- </executions>
- </plugin>-->
- </plugins>
+ <!--<plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <execution>
+ <phase>generate-sources</phase>
+ <configuration>
+ <tasks>
+ <echo message="Run Ant tasks"/>
+ <property name="build.resources" refid="maven.test.classpath"/>
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>-->
+ </plugins>
- <testSourceDirectory>src/test/java</testSourceDirectory>
+ <testSourceDirectory>src/test/java</testSourceDirectory>
- <testResources>
- <testResource>
- <directory>src/test/resources</directory>
- <filtering>false</filtering>
- </testResource>
- </testResources>
- </build>
+ <testResources>
+ <testResource>
+ <directory>src/test/resources</directory>
+ <filtering>false</filtering>
+ </testResource>
+ </testResources>
+ </build>
- <reporting>
- <plugins>
- <plugin>
- <artifactId>maven-changes-plugin</artifactId>
- </plugin>
- <plugin>
- <artifactId>maven-checkstyle-plugin</artifactId>
- </plugin>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>cobertura-maven-plugin</artifactId>
- <version>2.0</version>
- </plugin>
- <plugin>
- <artifactId>maven-javadoc-plugin</artifactId>
- </plugin>
- <plugin>
- <artifactId>maven-jxr-plugin</artifactId>
- </plugin>
- <plugin>
- <artifactId>maven-pmd-plugin</artifactId>
- <configuration>
- <linkXref>true</linkXref>
- <targetJdk>1.5</targetJdk>
- </configuration>
- </plugin>
- <plugin>
- <artifactId>maven-surefire-report-plugin</artifactId>
- </plugin>
- </plugins>
- </reporting>
-
- <properties>
- <!--<build.resources>src/test/resources</build.resources>-->
- <!--<env.build_resources>src/test/resources</env.build_resources>-->
- </properties>
+ <reporting>
+ <plugins>
+ <plugin>
+ <artifactId>maven-changes-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <artifactId>maven-checkstyle-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>cobertura-maven-plugin</artifactId>
+ <version>2.0</version>
+ </plugin>
+ <plugin>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <artifactId>maven-jxr-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <artifactId>maven-pmd-plugin</artifactId>
+ <configuration>
+ <linkXref>true</linkXref>
+ <targetJdk>1.5</targetJdk>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-surefire-report-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </reporting>
+
+ <properties>
+ <!--<build.resources>src/test/resources</build.resources>-->
+ <!--<env.build_resources>src/test/resources</env.build_resources>-->
+ </properties>
</project>
\ No newline at end of file
16 years, 8 months
JBoss Portal SVN: r8512 - /.
by portal-commits@lists.jboss.org
Author: wesleyhales
Date: 2007-10-01 23:59:15 -0400 (Mon, 01 Oct 2007)
New Revision: 8512
Modified:
pom.xml
Log:
Maven config for snapshot deployment and added plugins
Modified: pom.xml
===================================================================
--- pom.xml 2007-10-02 03:58:19 UTC (rev 8511)
+++ pom.xml 2007-10-02 03:59:15 UTC (rev 8512)
@@ -1,155 +1,204 @@
<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>
- <groupId>org.jboss.portal</groupId>
- <artifactId>jbossportal</artifactId>
- <packaging>pom</packaging>
- <name>Jboss Portal</name>
- <version>1.0-SNAPSHOT</version>
- <url>http://labs.jboss.com/jbossportal</url>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.jboss.portal</groupId>
+ <artifactId>jboss-portal</artifactId>
+ <packaging>pom</packaging>
+ <name>Jboss Portal</name>
+ <version>1.0-SNAPSHOT</version>
+ <url>http://labs.jboss.com/jbossportal</url>
- <dependencies/>
+ <dependencies/>
- <repositories>
- <repository>
- <id>repository.jboss.org</id>
- <url>http://repository.jboss.com/maven2/</url>
- </repository>
- </repositories>
+ <repositories>
+ <repository>
+ <id>repository.jboss.org</id>
+ <name>JBoss Repository</name>
+ <layout>default</layout>
+ <url>http://repository.jboss.org/maven2/</url>
+ <snapshots>
+ <enabled>false</enabled>
+ </snapshots>
+ </repository>
+ <repository>
+ <id>snapshots.jboss.org</id>
+ <name>JBoss Snapshots Repository</name>
+ <layout>default</layout>
+ <url>http://snapshots.jboss.org/maven2/</url>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ <releases>
+ <enabled>false</enabled>
+ </releases>
+ </repository>
+ </repositories>
- <build>
- <pluginManagement>
- <plugins>
- <plugin>
- <inherited>true</inherited>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <source>1.5</source>
- <target>1.5</target>
- </configuration>
- </plugin>
-
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>jboss-packaging-maven-plugin</artifactId>
- <version>2.0-SNAPSHOT</version>
- <extensions>true</extensions>
- </plugin>
-
- </plugins>
- </pluginManagement>
- </build>
-
- <!--<distributionManagement>
- <repository>
- Copy the distribution jar file to a local checkout of the maven repository
- - This variable can be set in $MAVEN_HOME/conf/settings.xml
- <id>repository.jboss.org</id>
- <url>file://${maven.repository.root}</url>
- </repository>
- <snapshotRepository>
- <id>snapshots.jboss.org</id>
- <name>JBoss Snapshot Repository</name>
- <url>dav:https://snapshots.jboss.org/maven2</url>
- </snapshotRepository>
- </distributionManagement>-->
-
- <modules>
- <module>modules</module>
- </modules>
-
-
- <issueManagement>
- <system>JIRA</system>
- <url>http://jira.jboss.com/jira/browse/JBPORTAL</url>
- </issueManagement>
- <ciManagement>
- <system>cruisecontrol</system>
- </ciManagement>
- <developers>
- <developer>
- <id>jviet</id>
- <name>Julien Viet</name>
- <email>jviet(a)redhat.com</email>
- <organization>Jboss a division of Red Hat</organization>
- <organizationUrl>http://www.jboss.org</organizationUrl>
- <roles>
- <role>Portal lead</role>
- </roles>
- <timezone>+1</timezone>
- </developer>
- <developer>
- <id>whales</id>
- <name>Wesley Hales</name>
- <email>whales(a)redhat.com</email>
- <organization>Jboss a division of Red Hat</organization>
- <organizationUrl>http://www.jboss.org</organizationUrl>
- <roles>
- <role>ui</role>
- <role>developer</role>
- </roles>
- <timezone>-4</timezone>
- </developer>
- <!--TODO: Add rest of team-->
- <!--developer>
- <id></id>
- <name></name>
- <email></email>
- <organization>Jboss a division of Red Hat</organization>
- <organizationUrl>http://www.jboss.org</organizationUrl>
- <roles>
- <role></role>
- </roles>
- <timezone></timezone>
- </developer-->
- </developers>
- <licenses>
- <license>
- <name>LGPL 2.1</name>
- <url>http://www.gnu.org/licenses/lgpl.html</url>
- <distribution>repo</distribution>
- <comments>
- GNU LESSER GENERAL PUBLIC LICENSE Version 2.1
- </comments>
- </license>
- </licenses>
- <scm>
- <connection>scm:svn:http://anonsvn.jboss.org/repos/portal/trunk</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/portal/trunk</developerConnection>
- <url>https://svn.jboss.org/repos/portal/trunk</url>
- </scm>
-
- <reporting>
- <plugins>
+ <build>
+ <extensions>
+ <extension>
+ <groupId>org.apache.maven.wagon</groupId>
+ <artifactId>wagon-webdav</artifactId>
+ <version>1.0-beta-2</version>
+ </extension>
+ </extensions>
+ <pluginManagement>
+ <plugins>
<plugin>
- <artifactId>maven-changes-plugin</artifactId>
+ <inherited>true</inherited>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ <showDeprecation>true</showDeprecation>
+ <showWarnings>true</showWarnings>
+ <optimize>true</optimize>
+ </configuration>
</plugin>
<plugin>
- <artifactId>maven-checkstyle-plugin</artifactId>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>jboss-packaging-maven-plugin</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <extensions>true</extensions>
</plugin>
<plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>cobertura-maven-plugin</artifactId>
- <version>2.0</version>
+ <artifactId>maven-idea-plugin</artifactId>
+ <configuration>
+ <downloadSources>true</downloadSources>
+ </configuration>
</plugin>
<plugin>
- <artifactId>maven-javadoc-plugin</artifactId>
+ <groupId>org.jboss.maven.plugins</groupId>
+ <artifactId>maven-jboss-deploy-plugin</artifactId>
+ <version>1.3</version>
+ <executions>
+ <execution>
+ <goals>
+ <goal>jboss-deploy</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <jbossDeployRoot>${jboss.repository.root}</jbossDeployRoot>
+ </configuration>
</plugin>
- <plugin>
- <artifactId>maven-jxr-plugin</artifactId>
- </plugin>
- <plugin>
- <artifactId>maven-pmd-plugin</artifactId>
- <configuration>
- <linkXref>true</linkXref>
- <targetJdk>1.5</targetJdk>
- </configuration>
- </plugin>
- <plugin>
- <artifactId>maven-surefire-report-plugin</artifactId>
- </plugin>
- </plugins>
- </reporting>
+ </plugins>
+ </pluginManagement>
+ </build>
+ <distributionManagement>
+ <!--<repository>-->
+ <!--Copy the distribution jar file to a local checkout of the maven repository
+ - This variable can be set in $MAVEN_HOME/conf/settings.xml-->
+ <!--<id>repository.jboss.org</id>-->
+ <!--<url>file://${jboss.repository.root}</url>-->
+ <!--</repository>-->
+ <snapshotRepository>
+ <id>snapshots.jboss.org</id>
+ <name>JBoss Snapshot Repository</name>
+ <url>dav:https://snapshots.jboss.org/maven2</url>
+ <uniqueVersion>true</uniqueVersion>
+ </snapshotRepository>
+ </distributionManagement>
+
+ <modules>
+ <module>modules/common/trunk/common</module>
+ </modules>
+
+
+ <issueManagement>
+ <system>JIRA</system>
+ <url>http://jira.jboss.com/jira/browse/JBPORTAL</url>
+ </issueManagement>
+ <ciManagement>
+ <system>cruisecontrol</system>
+ </ciManagement>
+ <developers>
+ <developer>
+ <id>jviet</id>
+ <name>Julien Viet</name>
+ <email>jviet(a)redhat.com</email>
+ <organization>Jboss a division of Red Hat</organization>
+ <organizationUrl>http://www.jboss.org</organizationUrl>
+ <roles>
+ <role>Portal lead</role>
+ </roles>
+ <timezone>+1</timezone>
+ </developer>
+ <developer>
+ <id>whales</id>
+ <name>Wesley Hales</name>
+ <email>whales(a)redhat.com</email>
+ <organization>Jboss a division of Red Hat</organization>
+ <organizationUrl>http://www.jboss.org</organizationUrl>
+ <roles>
+ <role>ui</role>
+ <role>developer</role>
+ </roles>
+ <timezone>-4</timezone>
+ </developer>
+ <!--TODO: Add rest of team-->
+ <!--developer>
+ <id></id>
+ <name></name>
+ <email></email>
+ <organization>Jboss a division of Red Hat</organization>
+ <organizationUrl>http://www.jboss.org</organizationUrl>
+ <roles>
+ <role></role>
+ </roles>
+ <timezone></timezone>
+ </developer-->
+ </developers>
+ <licenses>
+ <license>
+ <name>LGPL 2.1</name>
+ <url>http://www.gnu.org/licenses/lgpl.html</url>
+ <distribution>repo</distribution>
+ <comments>
+ GNU LESSER GENERAL PUBLIC LICENSE Version 2.1
+ </comments>
+ </license>
+ </licenses>
+ <scm>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/portal/trunk</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/portal/trunk</developerConnection>
+ <url>https://svn.jboss.org/repos/portal/trunk</url>
+ </scm>
+
+ <reporting>
+ <plugins>
+ <plugin>
+ <artifactId>maven-changes-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <artifactId>maven-checkstyle-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>cobertura-maven-plugin</artifactId>
+ <version>2.0</version>
+ </plugin>
+ <plugin>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <artifactId>maven-jxr-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <artifactId>maven-pmd-plugin</artifactId>
+ <configuration>
+ <linkXref>true</linkXref>
+ <targetJdk>1.5</targetJdk>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-surefire-report-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </reporting>
+
+ <properties/>
+
</project>
\ No newline at end of file
16 years, 8 months
JBoss Portal SVN: r8511 - modules.
by portal-commits@lists.jboss.org
Author: wesleyhales
Date: 2007-10-01 23:58:19 -0400 (Mon, 01 Oct 2007)
New Revision: 8511
Removed:
modules/pom.xml
Log:
Remove module pom.xml
Deleted: modules/pom.xml
===================================================================
--- modules/pom.xml 2007-10-02 01:42:51 UTC (rev 8510)
+++ modules/pom.xml 2007-10-02 03:58:19 UTC (rev 8511)
@@ -1,23 +0,0 @@
-<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">
- <parent>
- <artifactId>jbossportal</artifactId>
- <groupId>org.jboss.portal</groupId>
- <version>1.0-SNAPSHOT</version>
- </parent>
- <modelVersion>4.0.0</modelVersion>
- <groupId>org.jboss.portal</groupId>
- <artifactId>modules</artifactId>
- <packaging>pom</packaging>
- <name>Jboss Portal Modules</name>
- <version>1.0-SNAPSHOT</version>
-
- <dependencies/>
-
- <build/>
-
- <modules>
- <module>common/trunk/common</module>
- </modules>
-
-</project>
\ No newline at end of file
16 years, 8 months
JBoss Portal SVN: r8510 - in branches/JBoss_Portal_Branch_2_6/core-wsrp/src: resources/portal-wsrp-admin-war and 2 other directories.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2007-10-01 21:42:51 -0400 (Mon, 01 Oct 2007)
New Revision: 8510
Added:
branches/JBoss_Portal_Branch_2_6/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/LocalizedStringConverter.java
branches/JBoss_Portal_Branch_2_6/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ProducerBean.java
Modified:
branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/faces-config.xml
branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jboss-portlet.xml
branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jsf/producer.xhtml
branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/portlet-instances.xml
branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/portlet.xml
branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/wsrp-object.xml
branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/style.css
Log:
- JBPORTAL-1715: first pass at producer configuration, read-only for now.
- Renamed WSRP admin portlet (and related objects) to WSRPConfigurationPortlet (and related) as it deals with more than just consumers now.
- NOTE: ProducerBean required Java 5 (not actually needed, just switching to using Java 5 now).
Copied: branches/JBoss_Portal_Branch_2_6/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/LocalizedStringConverter.java (from rev 8509, trunk/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/LocalizedStringConverter.java)
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/LocalizedStringConverter.java (rev 0)
+++ branches/JBoss_Portal_Branch_2_6/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/LocalizedStringConverter.java 2007-10-02 01:42:51 UTC (rev 8510)
@@ -0,0 +1,48 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2007, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt 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.portal.wsrp.admin.ui;
+
+import org.jboss.portal.wsrp.registration.LocalizedString;
+
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.convert.Converter;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision$
+ * @since 2.6.3
+ */
+public class LocalizedStringConverter implements Converter
+{
+ public Object getAsObject(FacesContext facesContext, UIComponent uiComponent, String s)
+ {
+ return s == null ? null : new LocalizedString(s);
+ }
+
+ public String getAsString(FacesContext facesContext, UIComponent uiComponent, Object o)
+ {
+ return o == null ? null : ((LocalizedString)o).getValue();
+ }
+}
Copied: branches/JBoss_Portal_Branch_2_6/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ProducerBean.java (from rev 8509, trunk/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ProducerBean.java)
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ProducerBean.java (rev 0)
+++ branches/JBoss_Portal_Branch_2_6/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ProducerBean.java 2007-10-02 01:42:51 UTC (rev 8510)
@@ -0,0 +1,142 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2007, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt 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.portal.wsrp.admin.ui;
+
+import org.jboss.portal.registration.RegistrationPolicy;
+import org.jboss.portal.registration.policies.DefaultRegistrationPolicy;
+import org.jboss.portal.wsrp.producer.config.ProducerConfiguration;
+import org.jboss.portal.wsrp.producer.config.ProducerRegistrationRequirements;
+import org.jboss.portal.wsrp.registration.RegistrationPropertyDescription;
+
+import javax.faces.model.SelectItem;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision$
+ * @since 2.6.3
+ */
+public class ProducerBean extends ManagedBean
+{
+ private ProducerConfiguration configuration;
+ private String policyClassName;
+ private String validatorClassName;
+
+ public ProducerConfiguration getConfiguration()
+ {
+ return configuration;
+ }
+
+ public void setConfiguration(ProducerConfiguration configuration)
+ {
+ this.configuration = configuration;
+ }
+
+ public boolean isRegistrationRequiredForFullDescription()
+ {
+ return getRegRequirements().isRegistrationRequiredForFullDescription();
+ }
+
+ private ProducerRegistrationRequirements getRegRequirements()
+ {
+ return configuration.getRegistrationRequirements();
+ }
+
+ public void setRegistrationRequiredForFullDescription(boolean requireRegForFullDescription)
+ {
+ getRegRequirements().setRegistrationRequiredForFullDescription(requireRegForFullDescription);
+ }
+
+ public boolean isRegistrationRequired()
+ {
+ return getRegRequirements().isRegistrationRequired();
+ }
+
+ public void setRegistrationRequired(boolean requireRegistration)
+ {
+ getRegRequirements().setRegistrationRequired(requireRegistration);
+ }
+
+ public String getRegistrationPolicyClassName()
+ {
+ RegistrationPolicy policy = getRegRequirements().getPolicy();
+ if (policy != null)
+ {
+ return policy.getClass().getName();
+ }
+ else
+ {
+ return "RegistrationPolicy unset";
+ }
+ }
+
+ public void setRegistrationPolicyClassName(String className)
+ {
+ policyClassName = className;
+ }
+
+ public boolean isDefaultRegistrationPolicy()
+ {
+ return ProducerRegistrationRequirements.DEFAULT_POLICY_CLASS_NAME.equals(getRegistrationPolicyClassName());
+ }
+
+ public String getValidatorClassName()
+ {
+ if (isDefaultRegistrationPolicy())
+ {
+ return ((DefaultRegistrationPolicy)getRegRequirements().getPolicy()).getValidator().getClass().getName();
+ }
+ throw new IllegalStateException("getValidatorClassName shouldn't be called if we're not using the default registration");
+ }
+
+ public void setValidatorClassName(String className)
+ {
+ validatorClassName = className;
+ }
+
+ public List<RegistrationPropertyDescription> getRegistrationProperties()
+ {
+ Map descriptions = getRegRequirements().getRegistrationProperties();
+ Comparator<RegistrationPropertyDescription> descComparator = new Comparator<RegistrationPropertyDescription>()
+ {
+ public int compare(RegistrationPropertyDescription o1, RegistrationPropertyDescription o2)
+ {
+ return o1.getName().toString().compareTo(o2.getName().toString());
+ }
+ };
+
+ List<RegistrationPropertyDescription> result = new ArrayList<RegistrationPropertyDescription>(descriptions.values());
+ Collections.sort(result, descComparator);
+ return result;
+ }
+
+ public List<SelectItem> getSupportedPropertyTypes()
+ {
+ return Collections.singletonList(new SelectItem("xsd:string"));
+ }
+}
Modified: branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/faces-config.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/faces-config.xml 2007-10-02 01:40:39 UTC (rev 8509)
+++ branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/faces-config.xml 2007-10-02 01:42:51 UTC (rev 8510)
@@ -32,6 +32,11 @@
<view-handler>com.sun.facelets.FaceletPortletViewHandler</view-handler>
</application>
+ <converter>
+ <converter-for-class>org.jboss.portal.wsrp.registration.LocalizedString</converter-for-class>
+ <converter-class>org.jboss.portal.wsrp.admin.ui.LocalizedStringConverter</converter-class>
+ </converter>
+
<managed-bean>
<managed-bean-name>beanContext</managed-bean-name>
<managed-bean-class>org.jboss.portal.wsrp.admin.ui.JSFBeanContext</managed-bean-class>
@@ -75,6 +80,21 @@
<value>#{beanContext}</value>
</managed-property>
</managed-bean>
+ <managed-bean>
+ <managed-bean-name>producer</managed-bean-name>
+ <managed-bean-class>org.jboss.portal.wsrp.admin.ui.ProducerBean</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+ <managed-property>
+ <property-name>configuration</property-name>
+ <property-class>org.jboss.portal.wsrp.producer.config.ProducerConfiguration</property-class>
+ <value>#{applicationScope.ProducerConfigurationService.configuration}</value>
+ </managed-property>
+ <managed-property>
+ <property-name>beanContext</property-name>
+ <property-class>org.jboss.portal.wsrp.admin.ui.BeanContext</property-class>
+ <value>#{beanContext}</value>
+ </managed-property>
+ </managed-bean>
<navigation-rule>
<navigation-case>
Modified: branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jboss-portlet.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jboss-portlet.xml 2007-10-02 01:40:39 UTC (rev 8509)
+++ branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jboss-portlet.xml 2007-10-02 01:42:51 UTC (rev 8510)
@@ -20,10 +20,11 @@
~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. ~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
-<!DOCTYPE portlet-app PUBLIC "-//JBoss Portal//DTD JBoss Portlet 2.6//EN" "http://www.jboss.org/portal/dtd/jboss-portlet_2_6.dtd">
+<!DOCTYPE portlet-app PUBLIC "-//JBoss Portal//DTD JBoss Portlet 2.6//EN"
+ "http://www.jboss.org/portal/dtd/jboss-portlet_2_6.dtd">
<portlet-app>
<portlet>
- <portlet-name>WSRPConsumersConfigurationPortlet</portlet-name>
+ <portlet-name>WSRPConfigurationPortlet</portlet-name>
<transaction>
<trans-attribute>Required</trans-attribute>
</transaction>
@@ -36,5 +37,10 @@
<service-class>org.jboss.portal.wsrp.consumer.ConsumerRegistry</service-class>
<service-ref>portal.wsrp:service=ConsumerRegistry</service-ref>
</service>
+ <service>
+ <service-name>ProducerConfigurationService</service-name>
+ <service-class>org.jboss.portal.wsrp.producer.config.ProducerConfigurationService</service-class>
+ <service-ref>portal.wsrp:service=ProducerConfiguration</service-ref>
+ </service>
</portlet-app>
Modified: branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jsf/producer.xhtml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jsf/producer.xhtml 2007-10-02 01:40:39 UTC (rev 8509)
+++ branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jsf/producer.xhtml 2007-10-02 01:42:51 UTC (rev 8510)
@@ -8,24 +8,86 @@
<h:form>
<ul class="topnav">
<li><h:commandLink action="#{consumersMgr.listConsumers}" value="Consumers"/></li>
- <li class="currentTab">Producer</li>
+ <li id="currentTab">Producer</li>
</ul>
</h:form>
<ui:decorate template="common/tabContainer.xhtml">
<ui:define name="tab-container-content">
+
<h3 class="sectionTitle">Producer configuration</h3>
<!-- Status message -->
<h:message id="status" for="status" infoClass="portlet-msg-success" errorClass="portlet-msg-error"
fatalClass="portlet-msg-error" warnClass="portlet-msg-alert"/>
- <p>Feature not quite ready yet! Please refer to Portal's
- <a href="http://docs.jboss.com/jbportal/v2.6/referenceGuide/html/wsrp.html#d0e5264">documentation</a> to
- learn how to configure JBoss Portal's WSRP producer.
- </p>
+ <h:form>
+ <h:panelGrid columns="2" width="100%">
+ <h:selectBooleanCheckbox value="#{producer.registrationRequiredForFullDescription}"/>
+ <h:outputText value="Access to full service description requires consumers to be registered."/>
+ <h:selectBooleanCheckbox value="#{producer.registrationRequired}"/>
+ <h:outputText value="Requires registration."/>
+
+ <h:outputText value=" " rendered="#{producer.registrationRequired}"/>
+ <h:panelGroup>
+ <h:panelGrid columns="2" rendered="#{producer.registrationRequired}" width="100%">
+ <h:outputLabel value="Registration policy class name:" for="registrationPolicy"/>
+ <h:inputText id="registrationPolicy" value="#{producer.registrationPolicyClassName}" size="80"/>
+
+ <h:outputLabel value="Registration property validator class name:" for="validator"
+ rendered="#{producer.defaultRegistrationPolicy}"/>
+ <h:inputText id="validator" value="#{producer.validatorClassName}" size="80"
+ rendered="#{producer.defaultRegistrationPolicy}"/>
+
+ </h:panelGrid>
+ </h:panelGroup>
+
+ <h:outputText value=" " rendered="#{producer.registrationRequired}"/>
+ <h:panelGroup rendered="#{producer.registrationRequired}">
+ <h:outputText styleClass="portlet-area-header" value="Registration properties"/>
+ <h:panelGroup styleClass="portlet-area-body">
+ <c:choose>
+ <c:when test="#{!empty producer.registrationProperties}">
+ <h:dataTable var="property" id="registrationProperties" width="100%"
+ value="#{producer.registrationProperties}"
+ rendered="#{producer.registrationRequired}"
+ headerClass="portlet-section-header">
+ <h:column>
+ <f:facet name="header">Name</f:facet>
+ <h:inputText value="#{property.name}" size="60"/>
+ </h:column>
+ <h:column>
+ <f:facet name="header">Type</f:facet>
+ <h:selectOneListbox disabled="true">
+ <f:selectItems value="#{producer.supportedPropertyTypes}"/>
+ </h:selectOneListbox>
+ </h:column>
+ <h:column>
+ <f:facet name="header">Label</f:facet>
+ <h:inputText value="#{property.label}" size="60"/>
+ </h:column>
+ <h:column>
+ <f:facet name="header">Hint</f:facet>
+ <h:inputText value="#{property.hint}" size="60"/>
+ </h:column>
+ </h:dataTable>
+ <h:commandLink action="#{producer.addRegistrationProperty}" value="Add property"
+ styleClass="portlet-form-button"/>
+ </c:when>
+ <c:otherwise>
+ <h:outputText value="No specified required registration properties."/>
+ </c:otherwise>
+ </c:choose>
+ </h:panelGroup>
+ </h:panelGroup>
+
+ <h:outputText value=" "/>
+ <h:commandLink action="#{producer.save}" value="Save" styleClass="portlet-form-button"/>
+ </h:panelGrid>
+ </h:form>
+
</ui:define>
</ui:decorate>
</div>
\ No newline at end of file
Modified: branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/portlet-instances.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/portlet-instances.xml 2007-10-02 01:40:39 UTC (rev 8509)
+++ branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/portlet-instances.xml 2007-10-02 01:42:51 UTC (rev 8510)
@@ -25,8 +25,8 @@
<deployments>
<deployment>
<instance>
- <instance-id>WSRPConsumersConfigurationPortletInstance</instance-id>
- <portlet-ref>WSRPConsumersConfigurationPortlet</portlet-ref>
+ <instance-id>WSRPConfigurationPortletInstance</instance-id>
+ <portlet-ref>WSRPConfigurationPortlet</portlet-ref>
<security-constraint>
<policy-permission>
<role-name>Admin</role-name>
Modified: branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/portlet.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/portlet.xml 2007-10-02 01:40:39 UTC (rev 8509)
+++ branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/portlet.xml 2007-10-02 01:42:51 UTC (rev 8510)
@@ -26,9 +26,9 @@
xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
version="1.0">
<portlet>
- <description>Configuration portlet for WSRP remote producers.</description>
- <portlet-name>WSRPConsumersConfigurationPortlet</portlet-name>
- <display-name>WSRP Consumers Configuration</display-name>
+ <description>Configuration portlet for WSRP.</description>
+ <portlet-name>WSRPConfigurationPortlet</portlet-name>
+ <display-name>WSRP Configuration</display-name>
<portlet-class>org.jboss.portal.faces.loader.FacesPortlet</portlet-class>
<init-param>
<name>default-view</name>
@@ -39,7 +39,7 @@
<portlet-mode>VIEW</portlet-mode>
</supports>
<portlet-info>
- <title>WSRP Consumers Configuration</title>
+ <title>WSRP Configuration</title>
<keywords>management,admin,wsrp</keywords>
</portlet-info>
</portlet>
Modified: branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/wsrp-object.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/wsrp-object.xml 2007-10-02 01:40:39 UTC (rev 8509)
+++ branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/wsrp-object.xml 2007-10-02 01:42:51 UTC (rev 8510)
@@ -31,21 +31,21 @@
<if-exists>keep</if-exists>
<page>
<page-name>WSRP</page-name>
+ <properties>
+ <property>
+ <name>layout.id</name>
+ <value>1column</value>
+ </property>
+ </properties>
<security-constraint>
<policy-permission>
<action-name>viewrecursive</action-name>
<role-name>Admin</role-name>
</policy-permission>
</security-constraint>
- <properties>
- <property>
- <name>layout.id</name>
- <value>1column</value>
- </property>
- </properties>
<window>
- <window-name>WSRPConsumersConfigurationPortletWindow</window-name>
- <instance-ref>WSRPConsumersConfigurationPortletInstance</instance-ref>
+ <window-name>WSRPConfigurationPortletWindow</window-name>
+ <instance-ref>WSRPConfigurationPortletInstance</instance-ref>
<region>center</region>
<height>0</height>
<properties>
Modified: branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/style.css
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/style.css 2007-10-02 01:40:39 UTC (rev 8509)
+++ branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/style.css 2007-10-02 01:42:51 UTC (rev 8510)
@@ -265,4 +265,25 @@
.portlet-msg-alert:before {
content: "Warning: "
+}
+
+.wsrp-consumers-ui .portlet-area-header {
+ border: 1px solid #54708c;
+ font-weight: bold;
+ color: #fff;
+ font-size: 11px;
+ background-color: #5986b3;
+ padding: 2px;
+ padding-left: 4px;
+ margin: 0;
+ display: block;
+}
+
+.wsrp-consumers-ui .portlet-area-body {
+ border: 1px solid #d5d5d5;
+ border-top: 0px;
+ background-color: #fff;
+ padding: 4px;
+ margin: 0;
+ display: block;
}
\ No newline at end of file
16 years, 8 months
JBoss Portal SVN: r8509 - in trunk/core-wsrp/src: resources/portal-wsrp-admin-war and 2 other directories.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2007-10-01 21:40:39 -0400 (Mon, 01 Oct 2007)
New Revision: 8509
Added:
trunk/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/LocalizedStringConverter.java
trunk/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ProducerBean.java
Modified:
trunk/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/faces-config.xml
trunk/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jboss-portlet.xml
trunk/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jsf/producer.xhtml
trunk/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/portlet-instances.xml
trunk/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/portlet.xml
trunk/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/wsrp-object.xml
trunk/core-wsrp/src/resources/portal-wsrp-admin-war/style.css
Log:
- JBPORTAL-1715: first pass at producer configuration, read-only for now.
- Renamed WSRP admin portlet (and related objects) to WSRPConfigurationPortlet (and related) as it deals with more than just consumers now.
Added: trunk/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/LocalizedStringConverter.java
===================================================================
--- trunk/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/LocalizedStringConverter.java (rev 0)
+++ trunk/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/LocalizedStringConverter.java 2007-10-02 01:40:39 UTC (rev 8509)
@@ -0,0 +1,48 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2007, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt 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.portal.wsrp.admin.ui;
+
+import org.jboss.portal.wsrp.registration.LocalizedString;
+
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.convert.Converter;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision$
+ * @since 2.6.3
+ */
+public class LocalizedStringConverter implements Converter
+{
+ public Object getAsObject(FacesContext facesContext, UIComponent uiComponent, String s)
+ {
+ return s == null ? null : new LocalizedString(s);
+ }
+
+ public String getAsString(FacesContext facesContext, UIComponent uiComponent, Object o)
+ {
+ return o == null ? null : ((LocalizedString)o).getValue();
+ }
+}
Property changes on: trunk/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/LocalizedStringConverter.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Added: trunk/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ProducerBean.java
===================================================================
--- trunk/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ProducerBean.java (rev 0)
+++ trunk/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ProducerBean.java 2007-10-02 01:40:39 UTC (rev 8509)
@@ -0,0 +1,142 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2007, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt 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.portal.wsrp.admin.ui;
+
+import org.jboss.portal.registration.RegistrationPolicy;
+import org.jboss.portal.registration.policies.DefaultRegistrationPolicy;
+import org.jboss.portal.wsrp.producer.config.ProducerConfiguration;
+import org.jboss.portal.wsrp.producer.config.ProducerRegistrationRequirements;
+import org.jboss.portal.wsrp.registration.RegistrationPropertyDescription;
+
+import javax.faces.model.SelectItem;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision$
+ * @since 2.6.3
+ */
+public class ProducerBean extends ManagedBean
+{
+ private ProducerConfiguration configuration;
+ private String policyClassName;
+ private String validatorClassName;
+
+ public ProducerConfiguration getConfiguration()
+ {
+ return configuration;
+ }
+
+ public void setConfiguration(ProducerConfiguration configuration)
+ {
+ this.configuration = configuration;
+ }
+
+ public boolean isRegistrationRequiredForFullDescription()
+ {
+ return getRegRequirements().isRegistrationRequiredForFullDescription();
+ }
+
+ private ProducerRegistrationRequirements getRegRequirements()
+ {
+ return configuration.getRegistrationRequirements();
+ }
+
+ public void setRegistrationRequiredForFullDescription(boolean requireRegForFullDescription)
+ {
+ getRegRequirements().setRegistrationRequiredForFullDescription(requireRegForFullDescription);
+ }
+
+ public boolean isRegistrationRequired()
+ {
+ return getRegRequirements().isRegistrationRequired();
+ }
+
+ public void setRegistrationRequired(boolean requireRegistration)
+ {
+ getRegRequirements().setRegistrationRequired(requireRegistration);
+ }
+
+ public String getRegistrationPolicyClassName()
+ {
+ RegistrationPolicy policy = getRegRequirements().getPolicy();
+ if (policy != null)
+ {
+ return policy.getClass().getName();
+ }
+ else
+ {
+ return "RegistrationPolicy unset";
+ }
+ }
+
+ public void setRegistrationPolicyClassName(String className)
+ {
+ policyClassName = className;
+ }
+
+ public boolean isDefaultRegistrationPolicy()
+ {
+ return ProducerRegistrationRequirements.DEFAULT_POLICY_CLASS_NAME.equals(getRegistrationPolicyClassName());
+ }
+
+ public String getValidatorClassName()
+ {
+ if (isDefaultRegistrationPolicy())
+ {
+ return ((DefaultRegistrationPolicy)getRegRequirements().getPolicy()).getValidator().getClass().getName();
+ }
+ throw new IllegalStateException("getValidatorClassName shouldn't be called if we're not using the default registration");
+ }
+
+ public void setValidatorClassName(String className)
+ {
+ validatorClassName = className;
+ }
+
+ public List<RegistrationPropertyDescription> getRegistrationProperties()
+ {
+ Map descriptions = getRegRequirements().getRegistrationProperties();
+ Comparator<RegistrationPropertyDescription> descComparator = new Comparator<RegistrationPropertyDescription>()
+ {
+ public int compare(RegistrationPropertyDescription o1, RegistrationPropertyDescription o2)
+ {
+ return o1.getName().toString().compareTo(o2.getName().toString());
+ }
+ };
+
+ List<RegistrationPropertyDescription> result = new ArrayList<RegistrationPropertyDescription>(descriptions.values());
+ Collections.sort(result, descComparator);
+ return result;
+ }
+
+ public List<SelectItem> getSupportedPropertyTypes()
+ {
+ return Collections.singletonList(new SelectItem("xsd:string"));
+ }
+}
Property changes on: trunk/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ProducerBean.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: trunk/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/faces-config.xml
===================================================================
--- trunk/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/faces-config.xml 2007-10-02 01:36:35 UTC (rev 8508)
+++ trunk/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/faces-config.xml 2007-10-02 01:40:39 UTC (rev 8509)
@@ -32,6 +32,11 @@
<view-handler>com.sun.facelets.FaceletPortletViewHandler</view-handler>
</application>
+ <converter>
+ <converter-for-class>org.jboss.portal.wsrp.registration.LocalizedString</converter-for-class>
+ <converter-class>org.jboss.portal.wsrp.admin.ui.LocalizedStringConverter</converter-class>
+ </converter>
+
<managed-bean>
<managed-bean-name>beanContext</managed-bean-name>
<managed-bean-class>org.jboss.portal.wsrp.admin.ui.JSFBeanContext</managed-bean-class>
@@ -75,6 +80,21 @@
<value>#{beanContext}</value>
</managed-property>
</managed-bean>
+ <managed-bean>
+ <managed-bean-name>producer</managed-bean-name>
+ <managed-bean-class>org.jboss.portal.wsrp.admin.ui.ProducerBean</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+ <managed-property>
+ <property-name>configuration</property-name>
+ <property-class>org.jboss.portal.wsrp.producer.config.ProducerConfiguration</property-class>
+ <value>#{applicationScope.ProducerConfigurationService.configuration}</value>
+ </managed-property>
+ <managed-property>
+ <property-name>beanContext</property-name>
+ <property-class>org.jboss.portal.wsrp.admin.ui.BeanContext</property-class>
+ <value>#{beanContext}</value>
+ </managed-property>
+ </managed-bean>
<navigation-rule>
<navigation-case>
Modified: trunk/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jboss-portlet.xml
===================================================================
--- trunk/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jboss-portlet.xml 2007-10-02 01:36:35 UTC (rev 8508)
+++ trunk/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jboss-portlet.xml 2007-10-02 01:40:39 UTC (rev 8509)
@@ -20,10 +20,11 @@
~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. ~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
-<!DOCTYPE portlet-app PUBLIC "-//JBoss Portal//DTD JBoss Portlet 2.6//EN" "http://www.jboss.org/portal/dtd/jboss-portlet_2_6.dtd">
+<!DOCTYPE portlet-app PUBLIC "-//JBoss Portal//DTD JBoss Portlet 2.6//EN"
+ "http://www.jboss.org/portal/dtd/jboss-portlet_2_6.dtd">
<portlet-app>
<portlet>
- <portlet-name>WSRPConsumersConfigurationPortlet</portlet-name>
+ <portlet-name>WSRPConfigurationPortlet</portlet-name>
<transaction>
<trans-attribute>Required</trans-attribute>
</transaction>
@@ -36,5 +37,10 @@
<service-class>org.jboss.portal.wsrp.consumer.ConsumerRegistry</service-class>
<service-ref>portal.wsrp:service=ConsumerRegistry</service-ref>
</service>
+ <service>
+ <service-name>ProducerConfigurationService</service-name>
+ <service-class>org.jboss.portal.wsrp.producer.config.ProducerConfigurationService</service-class>
+ <service-ref>portal.wsrp:service=ProducerConfiguration</service-ref>
+ </service>
</portlet-app>
Modified: trunk/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jsf/producer.xhtml
===================================================================
--- trunk/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jsf/producer.xhtml 2007-10-02 01:36:35 UTC (rev 8508)
+++ trunk/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jsf/producer.xhtml 2007-10-02 01:40:39 UTC (rev 8509)
@@ -8,24 +8,86 @@
<h:form>
<ul class="topnav">
<li><h:commandLink action="#{consumersMgr.listConsumers}" value="Consumers"/></li>
- <li class="currentTab">Producer</li>
+ <li id="currentTab">Producer</li>
</ul>
</h:form>
<ui:decorate template="common/tabContainer.xhtml">
<ui:define name="tab-container-content">
+
<h3 class="sectionTitle">Producer configuration</h3>
<!-- Status message -->
<h:message id="status" for="status" infoClass="portlet-msg-success" errorClass="portlet-msg-error"
fatalClass="portlet-msg-error" warnClass="portlet-msg-alert"/>
- <p>Feature not quite ready yet! Please refer to Portal's
- <a href="http://docs.jboss.com/jbportal/v2.6/referenceGuide/html/wsrp.html#d0e5264">documentation</a> to
- learn how to configure JBoss Portal's WSRP producer.
- </p>
+ <h:form>
+ <h:panelGrid columns="2" width="100%">
+ <h:selectBooleanCheckbox value="#{producer.registrationRequiredForFullDescription}"/>
+ <h:outputText value="Access to full service description requires consumers to be registered."/>
+ <h:selectBooleanCheckbox value="#{producer.registrationRequired}"/>
+ <h:outputText value="Requires registration."/>
+
+ <h:outputText value=" " rendered="#{producer.registrationRequired}"/>
+ <h:panelGroup>
+ <h:panelGrid columns="2" rendered="#{producer.registrationRequired}" width="100%">
+ <h:outputLabel value="Registration policy class name:" for="registrationPolicy"/>
+ <h:inputText id="registrationPolicy" value="#{producer.registrationPolicyClassName}" size="80"/>
+
+ <h:outputLabel value="Registration property validator class name:" for="validator"
+ rendered="#{producer.defaultRegistrationPolicy}"/>
+ <h:inputText id="validator" value="#{producer.validatorClassName}" size="80"
+ rendered="#{producer.defaultRegistrationPolicy}"/>
+
+ </h:panelGrid>
+ </h:panelGroup>
+
+ <h:outputText value=" " rendered="#{producer.registrationRequired}"/>
+ <h:panelGroup rendered="#{producer.registrationRequired}">
+ <h:outputText styleClass="portlet-area-header" value="Registration properties"/>
+ <h:panelGroup styleClass="portlet-area-body">
+ <c:choose>
+ <c:when test="#{!empty producer.registrationProperties}">
+ <h:dataTable var="property" id="registrationProperties" width="100%"
+ value="#{producer.registrationProperties}"
+ rendered="#{producer.registrationRequired}"
+ headerClass="portlet-section-header">
+ <h:column>
+ <f:facet name="header">Name</f:facet>
+ <h:inputText value="#{property.name}" size="60"/>
+ </h:column>
+ <h:column>
+ <f:facet name="header">Type</f:facet>
+ <h:selectOneListbox disabled="true">
+ <f:selectItems value="#{producer.supportedPropertyTypes}"/>
+ </h:selectOneListbox>
+ </h:column>
+ <h:column>
+ <f:facet name="header">Label</f:facet>
+ <h:inputText value="#{property.label}" size="60"/>
+ </h:column>
+ <h:column>
+ <f:facet name="header">Hint</f:facet>
+ <h:inputText value="#{property.hint}" size="60"/>
+ </h:column>
+ </h:dataTable>
+ <h:commandLink action="#{producer.addRegistrationProperty}" value="Add property"
+ styleClass="portlet-form-button"/>
+ </c:when>
+ <c:otherwise>
+ <h:outputText value="No specified required registration properties."/>
+ </c:otherwise>
+ </c:choose>
+ </h:panelGroup>
+ </h:panelGroup>
+
+ <h:outputText value=" "/>
+ <h:commandLink action="#{producer.save}" value="Save" styleClass="portlet-form-button"/>
+ </h:panelGrid>
+ </h:form>
+
</ui:define>
</ui:decorate>
</div>
\ No newline at end of file
Modified: trunk/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/portlet-instances.xml
===================================================================
--- trunk/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/portlet-instances.xml 2007-10-02 01:36:35 UTC (rev 8508)
+++ trunk/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/portlet-instances.xml 2007-10-02 01:40:39 UTC (rev 8509)
@@ -25,8 +25,8 @@
<deployments>
<deployment>
<instance>
- <instance-id>WSRPConsumersConfigurationPortletInstance</instance-id>
- <portlet-ref>WSRPConsumersConfigurationPortlet</portlet-ref>
+ <instance-id>WSRPConfigurationPortletInstance</instance-id>
+ <portlet-ref>WSRPConfigurationPortlet</portlet-ref>
<security-constraint>
<policy-permission>
<role-name>Admin</role-name>
Modified: trunk/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/portlet.xml
===================================================================
--- trunk/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/portlet.xml 2007-10-02 01:36:35 UTC (rev 8508)
+++ trunk/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/portlet.xml 2007-10-02 01:40:39 UTC (rev 8509)
@@ -26,9 +26,9 @@
xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
version="1.0">
<portlet>
- <description>Configuration portlet for WSRP remote producers.</description>
- <portlet-name>WSRPConsumersConfigurationPortlet</portlet-name>
- <display-name>WSRP Consumers Configuration</display-name>
+ <description>Configuration portlet for WSRP.</description>
+ <portlet-name>WSRPConfigurationPortlet</portlet-name>
+ <display-name>WSRP Configuration</display-name>
<portlet-class>org.jboss.portal.faces.loader.FacesPortlet</portlet-class>
<init-param>
<name>default-view</name>
@@ -39,7 +39,7 @@
<portlet-mode>VIEW</portlet-mode>
</supports>
<portlet-info>
- <title>WSRP Consumers Configuration</title>
+ <title>WSRP Configuration</title>
<keywords>management,admin,wsrp</keywords>
</portlet-info>
</portlet>
Modified: trunk/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/wsrp-object.xml
===================================================================
--- trunk/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/wsrp-object.xml 2007-10-02 01:36:35 UTC (rev 8508)
+++ trunk/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/wsrp-object.xml 2007-10-02 01:40:39 UTC (rev 8509)
@@ -31,21 +31,21 @@
<if-exists>keep</if-exists>
<page>
<page-name>WSRP</page-name>
+ <properties>
+ <property>
+ <name>layout.id</name>
+ <value>1column</value>
+ </property>
+ </properties>
<security-constraint>
<policy-permission>
<action-name>viewrecursive</action-name>
<role-name>Admin</role-name>
</policy-permission>
</security-constraint>
- <properties>
- <property>
- <name>layout.id</name>
- <value>1column</value>
- </property>
- </properties>
<window>
- <window-name>WSRPConsumersConfigurationPortletWindow</window-name>
- <instance-ref>WSRPConsumersConfigurationPortletInstance</instance-ref>
+ <window-name>WSRPConfigurationPortletWindow</window-name>
+ <instance-ref>WSRPConfigurationPortletInstance</instance-ref>
<region>center</region>
<height>0</height>
<properties>
Modified: trunk/core-wsrp/src/resources/portal-wsrp-admin-war/style.css
===================================================================
--- trunk/core-wsrp/src/resources/portal-wsrp-admin-war/style.css 2007-10-02 01:36:35 UTC (rev 8508)
+++ trunk/core-wsrp/src/resources/portal-wsrp-admin-war/style.css 2007-10-02 01:40:39 UTC (rev 8509)
@@ -265,4 +265,25 @@
.portlet-msg-alert:before {
content: "Warning: "
+}
+
+.wsrp-consumers-ui .portlet-area-header {
+ border: 1px solid #54708c;
+ font-weight: bold;
+ color: #fff;
+ font-size: 11px;
+ background-color: #5986b3;
+ padding: 2px;
+ padding-left: 4px;
+ margin: 0;
+ display: block;
+}
+
+.wsrp-consumers-ui .portlet-area-body {
+ border: 1px solid #d5d5d5;
+ border-top: 0px;
+ background-color: #fff;
+ padding: 4px;
+ margin: 0;
+ display: block;
}
\ No newline at end of file
16 years, 8 months
JBoss Portal SVN: r8508 - in branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal: test/wsrp/other and 5 other directories.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2007-10-01 21:36:35 -0400 (Mon, 01 Oct 2007)
New Revision: 8508
Removed:
branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/services/RMIInvokerServiceFactory.java
branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/services/SOAPInvokerServiceFactory.java
Modified:
branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/test/wsrp/config/ProducerConfigurationTestCase.java
branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/test/wsrp/other/RegistrationPropertyDescriptionTestCase.java
branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/ReleaseSessionTestCase.java
branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/ServiceDescriptionTestCase.java
branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/V1ProducerBaseTest.java
branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/producer/RegistrationHandler.java
branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/producer/ServiceDescriptionHandler.java
branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/producer/WSRPProducerImpl.java
branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/producer/config/ProducerConfigurationFactory.java
branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/producer/config/ProducerRegistrationRequirements.java
branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/producer/config/impl/ProducerRegistrationRequirementsImpl.java
Log:
- Renamed ProducerRegistrationRequirements.requiresRegistration to isRegistrationRequired to follow Java Beans conventions.
- Renamed ProducerRegistrationRequirements.fullServiceDescriptionRequiresRegistration to isRegistrationRequiredForFullDescription to follow Java Beans conventions.
- Removed unused classes.
Modified: branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/test/wsrp/config/ProducerConfigurationTestCase.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/test/wsrp/config/ProducerConfigurationTestCase.java 2007-10-02 01:33:08 UTC (rev 8507)
+++ branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/test/wsrp/config/ProducerConfigurationTestCase.java 2007-10-02 01:36:35 UTC (rev 8508)
@@ -82,8 +82,8 @@
RegistrationPropertyValidator propertyValidator = ((DefaultRegistrationPolicy)policy).getValidator();
assertNotNull(propertyValidator);
assertTrue(propertyValidator instanceof DefaultRegistrationPropertyValidator);
- assertTrue(requirements.requiresRegistration());
- assertTrue(requirements.fullServiceDescriptionRequiresRegistration());
+ assertTrue(requirements.isRegistrationRequired());
+ assertTrue(requirements.isRegistrationRequiredForFullDescription());
Map properties = requirements.getRegistrationProperties();
assertNotNull(properties);
assertEquals(2, properties.size());
@@ -97,8 +97,8 @@
ProducerConfiguration producerConfiguration = getProducerConfiguration("minimal-registration.xml");
ProducerRegistrationRequirements requirements = producerConfiguration.getRegistrationRequirements();
assertNotNull(requirements);
- assertTrue(requirements.requiresRegistration());
- assertTrue(!requirements.fullServiceDescriptionRequiresRegistration());
+ assertTrue(requirements.isRegistrationRequired());
+ assertTrue(!requirements.isRegistrationRequiredForFullDescription());
Map properties = requirements.getRegistrationProperties();
assertNotNull(properties);
assertTrue(properties.isEmpty());
@@ -110,8 +110,8 @@
ProducerConfiguration producerConfiguration = getProducerConfiguration("minimal.xml");
ProducerRegistrationRequirements requirements = producerConfiguration.getRegistrationRequirements();
assertNotNull(requirements);
- assertFalse(requirements.requiresRegistration());
- assertFalse(requirements.fullServiceDescriptionRequiresRegistration());
+ assertFalse(requirements.isRegistrationRequired());
+ assertFalse(requirements.isRegistrationRequiredForFullDescription());
assertTrue(requirements.getRegistrationProperties().isEmpty());
assertNull(requirements.getPolicy());
}
Modified: branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/test/wsrp/other/RegistrationPropertyDescriptionTestCase.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/test/wsrp/other/RegistrationPropertyDescriptionTestCase.java 2007-10-02 01:33:08 UTC (rev 8507)
+++ branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/test/wsrp/other/RegistrationPropertyDescriptionTestCase.java 2007-10-02 01:36:35 UTC (rev 8508)
@@ -87,21 +87,21 @@
notifyCalled = false;
}
- public boolean requiresRegistration()
+ public boolean isRegistrationRequired()
{
return false;
}
- public void setRequiresRegistration(boolean requiresRegistration)
+ public void setRegistrationRequired(boolean requiresRegistration)
{
}
- public boolean fullServiceDescriptionRequiresRegistration()
+ public boolean isRegistrationRequiredForFullDescription()
{
return false;
}
- public void setFullServiceDescriptionRequiresRegistration(boolean fullServiceDescriptionRequiresRegistration)
+ public void setRegistrationRequiredForFullDescription(boolean fullServiceDescriptionRequiresRegistration)
{
}
@@ -171,5 +171,9 @@
{
return null;
}
+
+ public void reloadPolicyFrom(String policyClassName, String validatorClassName)
+ {
+ }
}
}
Modified: branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/ReleaseSessionTestCase.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/ReleaseSessionTestCase.java 2007-10-02 01:33:08 UTC (rev 8507)
+++ branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/ReleaseSessionTestCase.java 2007-10-02 01:36:35 UTC (rev 8508)
@@ -151,7 +151,7 @@
}
- if (producer.getProducerRegistrationRequirements().requiresRegistration())
+ if (producer.getProducerRegistrationRequirements().isRegistrationRequired())
{
message.append(" | with registration required.");
}
Modified: branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/ServiceDescriptionTestCase.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/ServiceDescriptionTestCase.java 2007-10-02 01:33:08 UTC (rev 8507)
+++ branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/ServiceDescriptionTestCase.java 2007-10-02 01:36:35 UTC (rev 8508)
@@ -55,7 +55,7 @@
public void testGetServiceDescriptionNotRequiringRegistration() throws Throwable
{
- producer.getProducerRegistrationRequirements().setRequiresRegistration(false);
+ producer.getProducerRegistrationRequirements().setRegistrationRequired(false);
GetServiceDescription gs = getNoRegistrationServiceDescriptionRequest();
Modified: branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/V1ProducerBaseTest.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/V1ProducerBaseTest.java 2007-10-02 01:33:08 UTC (rev 8507)
+++ branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/V1ProducerBaseTest.java 2007-10-02 01:36:35 UTC (rev 8508)
@@ -162,8 +162,8 @@
protected RegistrationPropertyDescription configureRegistrationSettings(boolean provideUnregisteredFullDescription)
{
// define expected registration infos
- producer.getProducerRegistrationRequirements().setRequiresRegistration(true);
- producer.getProducerRegistrationRequirements().setFullServiceDescriptionRequiresRegistration(provideUnregisteredFullDescription);
+ producer.getProducerRegistrationRequirements().setRegistrationRequired(true);
+ producer.getProducerRegistrationRequirements().setRegistrationRequiredForFullDescription(provideUnregisteredFullDescription);
// fix-me: http://jira.jboss.com/jira/browse/JBPORTAL-821
RegistrationPropertyDescription regProp = new RegistrationPropertyDescription("regProp",
@@ -176,7 +176,7 @@
protected void resetRegistrationInfo()
{
- producer.getProducerRegistrationRequirements().setRequiresRegistration(false);
+ producer.getProducerRegistrationRequirements().setRegistrationRequired(false);
producer.getProducerRegistrationRequirements().clearRegistrationProperties();
}
Modified: branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/producer/RegistrationHandler.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/producer/RegistrationHandler.java 2007-10-02 01:33:08 UTC (rev 8507)
+++ branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/producer/RegistrationHandler.java 2007-10-02 01:36:35 UTC (rev 8508)
@@ -227,7 +227,7 @@
{
if (reg == null)
{
- if (producer.getProducerRegistrationRequirements().requiresRegistration())
+ if (producer.getProducerRegistrationRequirements().isRegistrationRequired())
{
log.debug("Registration is required yet no RegistrationContext was provided: registration invalid!");
return false;
@@ -257,7 +257,7 @@
*/
Registration getRegistrationFrom(RegistrationContext registrationContext)
{
- if (producer.getProducerRegistrationRequirements().requiresRegistration())
+ if (producer.getProducerRegistrationRequirements().isRegistrationRequired())
{
if (registrationContext == null)
{
Modified: branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/producer/ServiceDescriptionHandler.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/producer/ServiceDescriptionHandler.java 2007-10-02 01:33:08 UTC (rev 8507)
+++ branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/producer/ServiceDescriptionHandler.java 2007-10-02 01:36:35 UTC (rev 8508)
@@ -83,11 +83,11 @@
ProducerRegistrationRequirements requirements = producer.getProducerRegistrationRequirements();
PortletDescription[] offeredPortlets = null;
- ServiceDescription serviceDescription = WSRPTypeFactory.createServiceDescription(requirements.requiresRegistration());
+ ServiceDescription serviceDescription = WSRPTypeFactory.createServiceDescription(requirements.isRegistrationRequired());
serviceDescription.setRequiresInitCookie(BEA_8_CONSUMER_FIX);
serviceDescription.setLocales(producer.getSupportedLocales());
- if (!requirements.requiresRegistration())
+ if (!requirements.isRegistrationRequired())
{
offeredPortlets = getPortletDescriptions(gs.getDesiredLocales(), null);
}
@@ -97,7 +97,7 @@
{
log.debug("Unregistered consumer while registration is required. Sending registration information.");
- if (requirements.fullServiceDescriptionRequiresRegistration())
+ if (requirements.isRegistrationRequiredForFullDescription())
{
log.debug("Sending offered portlets description despite not being registered, per Producer configuration.");
offeredPortlets = getPortletDescriptions(gs.getDesiredLocales(), null);
Modified: branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/producer/WSRPProducerImpl.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/producer/WSRPProducerImpl.java 2007-10-02 01:33:08 UTC (rev 8507)
+++ branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/producer/WSRPProducerImpl.java 2007-10-02 01:36:35 UTC (rev 8508)
@@ -273,7 +273,7 @@
super.startService();
producerConfiguration = configurationService.getConfiguration();
ProducerRegistrationRequirements registrationRequirements = getProducerRegistrationRequirements();
- if (registrationRequirements.requiresRegistration())
+ if (registrationRequirements.isRegistrationRequired())
{
registrationManager.setPolicy(registrationRequirements.getPolicy());
registrationRequirements.addRegistrationPropertyChangeListeners(registrationManager);
@@ -283,7 +283,7 @@
protected void stopService() throws Exception
{
ProducerRegistrationRequirements registrationRequirements = getProducerRegistrationRequirements();
- if (registrationRequirements.requiresRegistration())
+ if (registrationRequirements.isRegistrationRequired())
{
registrationRequirements.removeRegistrationPropertyChangeListener(registrationManager);
}
Modified: branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/producer/config/ProducerConfigurationFactory.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/producer/config/ProducerConfigurationFactory.java 2007-10-02 01:33:08 UTC (rev 8507)
+++ branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/producer/config/ProducerConfigurationFactory.java 2007-10-02 01:36:35 UTC (rev 8508)
@@ -80,15 +80,15 @@
}
ProducerRegistrationRequirements registrationRequirements = new ProducerRegistrationRequirementsImpl();
- registrationRequirements.setRequiresRegistration(true);
+ registrationRequirements.setRegistrationRequired(true);
String descRequiresRegistration = attrs.getValue("fullServiceDescriptionRequiresRegistration");
if ("true".equals(descRequiresRegistration))
{
- registrationRequirements.setFullServiceDescriptionRequiresRegistration(true);
+ registrationRequirements.setRegistrationRequiredForFullDescription(true);
}
else if (descRequiresRegistration == null || "false".equals(descRequiresRegistration))
{
- registrationRequirements.setFullServiceDescriptionRequiresRegistration(false);
+ registrationRequirements.setRegistrationRequiredForFullDescription(false);
}
else
{
Modified: branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/producer/config/ProducerRegistrationRequirements.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/producer/config/ProducerRegistrationRequirements.java 2007-10-02 01:33:08 UTC (rev 8507)
+++ branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/producer/config/ProducerRegistrationRequirements.java 2007-10-02 01:36:35 UTC (rev 8508)
@@ -37,14 +37,17 @@
*/
public interface ProducerRegistrationRequirements
{
- boolean requiresRegistration();
+ String DEFAULT_POLICY_CLASS_NAME = "org.jboss.portal.registration.policies.DefaultRegistrationPolicy";
+ String DEFAULT_VALIDATOR_CLASS_NAME = "org.jboss.portal.registration.policies.DefaultRegistrationPropertyValidator";
- void setRequiresRegistration(boolean requiresRegistration);
+ boolean isRegistrationRequired();
- boolean fullServiceDescriptionRequiresRegistration();
+ void setRegistrationRequired(boolean requiresRegistration);
- void setFullServiceDescriptionRequiresRegistration(boolean fullServiceDescriptionRequiresRegistration);
+ boolean isRegistrationRequiredForFullDescription();
+ void setRegistrationRequiredForFullDescription(boolean fullServiceDescriptionRequiresRegistration);
+
Map getRegistrationProperties();
void addRegistrationProperty(RegistrationPropertyDescription propertyDescription);
@@ -74,4 +77,6 @@
void setPolicy(RegistrationPolicy policy);
RegistrationPolicy getPolicy();
+
+ void reloadPolicyFrom(String policyClassName, String validatorClassName);
}
Modified: branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/producer/config/impl/ProducerRegistrationRequirementsImpl.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/producer/config/impl/ProducerRegistrationRequirementsImpl.java 2007-10-02 01:33:08 UTC (rev 8507)
+++ branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/producer/config/impl/ProducerRegistrationRequirementsImpl.java 2007-10-02 01:36:35 UTC (rev 8508)
@@ -59,8 +59,6 @@
/** property name (QName) -> PropertyDescription */
private Map registrationProperties;
- public final static String DEFAULT_POLICY_CLASS_NAME = "org.jboss.portal.registration.policies.DefaultRegistrationPolicy";
- public final static String DEFAULT_VALIDATOR_CLASS_NAME = "org.jboss.portal.registration.policies.DefaultRegistrationPropertyValidator";
public ProducerRegistrationRequirementsImpl(boolean requiresMarshalling, boolean requiresRegistration, boolean fullServiceDescriptionRequiresRegistration)
{
@@ -74,22 +72,22 @@
registrationProperties = new HashMap(7);
}
- public boolean requiresRegistration()
+ public boolean isRegistrationRequired()
{
return requiresRegistration;
}
- public void setRequiresRegistration(boolean requiresRegistration)
+ public void setRegistrationRequired(boolean requiresRegistration)
{
this.requiresRegistration = requiresRegistration;
}
- public boolean fullServiceDescriptionRequiresRegistration()
+ public boolean isRegistrationRequiredForFullDescription()
{
return fullServiceDescriptionRequiresRegistration;
}
- public void setFullServiceDescriptionRequiresRegistration(boolean fullServiceDescriptionRequiresRegistration)
+ public void setRegistrationRequiredForFullDescription(boolean fullServiceDescriptionRequiresRegistration)
{
this.fullServiceDescriptionRequiresRegistration = fullServiceDescriptionRequiresRegistration;
}
@@ -194,6 +192,10 @@
if (policy != null)
{
policyClassName = policy.getClass().getName();
+ if (DEFAULT_POLICY_CLASS_NAME.equals(policyClassName))
+ {
+ validatorClassName = ((DefaultRegistrationPolicy)policy).getValidator().getClass().getName();
+ }
}
}
@@ -202,78 +204,84 @@
{
if (policy == null && requiresRegistration)
{
- if (policyClassName != null)
+ reloadPolicyFrom(policyClassName, validatorClassName);
+ }
+
+ return policy;
+ }
+
+ public void reloadPolicyFrom(String policyClassName, String validatorClassName)
+ {
+ if (policyClassName != null)
+ {
+ log.debug("Using registration policy: " + policyClassName);
+ ClassLoader loader = Thread.currentThread().getContextClassLoader();
+ try
{
- log.debug("Using registration policy: " + policyClassName);
+ Class policyClass = loader.loadClass(policyClassName);
+ Class expectedInterface = loader.loadClass("org.jboss.portal.registration.RegistrationPolicy");
+ if (!expectedInterface.isAssignableFrom(policyClass))
+ {
+ throw new IllegalArgumentException("Policy class does not implement RegistrationPolicy!");
+ }
+ RegistrationPolicy policy = (RegistrationPolicy)policyClass.newInstance();
+ setPolicy(policy);
+ }
+ catch (ClassNotFoundException e)
+ {
+ IllegalArgumentException iae = new IllegalArgumentException("Couldn't find policy class " + policyClassName + ".");
+ iae.initCause(e);
+ throw iae;
+ }
+ catch (Exception e)
+ {
+ IllegalArgumentException iae = new IllegalArgumentException("Couldn't instantiate policy class.");
+ iae.initCause(e);
+ throw iae;
+ }
+ }
+ else
+ {
+ log.debug("Using default registration policy: " + DEFAULT_POLICY_CLASS_NAME);
+ RegistrationPropertyValidator validator;
+ if (validatorClassName != null)
+ {
+ log.debug("Using registration property validator: " + validatorClassName);
ClassLoader loader = Thread.currentThread().getContextClassLoader();
try
{
- Class policyClass = loader.loadClass(policyClassName);
- Class expectedInterface = loader.loadClass("org.jboss.portal.registration.RegistrationPolicy");
- if (!expectedInterface.isAssignableFrom(policyClass))
+ Class validatorClass = loader.loadClass(validatorClassName);
+ Class expectedInterface = loader.loadClass("org.jboss.portal.registration.policies.RegistrationPropertyValidator");
+ if (!expectedInterface.isAssignableFrom(validatorClass))
{
- throw new IllegalArgumentException("Policy class does not implement RegistrationPolicy!");
+ throw new IllegalArgumentException("Validator class does not implement RegistrationPropertyValidator!");
}
- RegistrationPolicy policy = (RegistrationPolicy)policyClass.newInstance();
- setPolicy(policy);
+ validator = (RegistrationPropertyValidator)validatorClass.newInstance();
}
catch (ClassNotFoundException e)
{
- IllegalArgumentException iae = new IllegalArgumentException("Couldn't find policy class " + policyClassName + ".");
+ IllegalArgumentException iae = new IllegalArgumentException("Couldn't find validator class " + validatorClassName + ".");
iae.initCause(e);
throw iae;
}
catch (Exception e)
{
- IllegalArgumentException iae = new IllegalArgumentException("Couldn't instantiate policy class.");
+ IllegalArgumentException iae = new IllegalArgumentException("Couldn't instantiate validator class.");
iae.initCause(e);
throw iae;
}
}
else
{
- log.debug("Using default registration policy: " + DEFAULT_POLICY_CLASS_NAME);
- RegistrationPropertyValidator validator;
- if (validatorClassName != null)
- {
- log.debug("Using registration property validator: " + validatorClassName);
- ClassLoader loader = Thread.currentThread().getContextClassLoader();
- try
- {
- Class validatorClass = loader.loadClass(validatorClassName);
- Class expectedInterface = loader.loadClass("org.jboss.portal.registration.policies.RegistrationPropertyValidator");
- if (!expectedInterface.isAssignableFrom(validatorClass))
- {
- throw new IllegalArgumentException("Validator class does not implement RegistrationPropertyValidator!");
- }
- validator = (RegistrationPropertyValidator)validatorClass.newInstance();
- }
- catch (ClassNotFoundException e)
- {
- IllegalArgumentException iae = new IllegalArgumentException("Couldn't find validator class " + validatorClassName + ".");
- iae.initCause(e);
- throw iae;
- }
- catch (Exception e)
- {
- IllegalArgumentException iae = new IllegalArgumentException("Couldn't instantiate validator class.");
- iae.initCause(e);
- throw iae;
- }
- }
- else
- {
- log.debug("Using default registration property validator: " + DEFAULT_VALIDATOR_CLASS_NAME);
- validator = new DefaultRegistrationPropertyValidator();
- }
+ log.debug("Using default registration property validator: " + DEFAULT_VALIDATOR_CLASS_NAME);
+ validator = new DefaultRegistrationPropertyValidator();
+ }
- policy = new DefaultRegistrationPolicy();
- ((DefaultRegistrationPolicy)policy).setValidator(validator);
- }
+ DefaultRegistrationPolicy policy = new DefaultRegistrationPolicy();
+ policy.setValidator(validator);
+ setPolicy(policy);
}
-
- return policy;
}
Deleted: branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/services/RMIInvokerServiceFactory.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/services/RMIInvokerServiceFactory.java 2007-10-02 01:33:08 UTC (rev 8507)
+++ branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/services/RMIInvokerServiceFactory.java 2007-10-02 01:36:35 UTC (rev 8508)
@@ -1,91 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt 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.portal.wsrp.services;
-
-import org.jboss.portal.wsrp.core.WSRP_v1_Markup_PortType;
-import org.jboss.portal.wsrp.core.WSRP_v1_PortletManagement_PortType;
-import org.jboss.portal.wsrp.core.WSRP_v1_Registration_PortType;
-import org.jboss.portal.wsrp.core.WSRP_v1_ServiceDescription_PortType;
-
-import java.util.Properties;
-
-/**
- * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
- * @version $Revision$
- * @since 2.4
- */
-public class RMIInvokerServiceFactory extends AbstractJNDIServiceFactory
-{
- public RMIInvokerServiceFactory()
- {
- portJNDIMapping = new Properties();
- portJNDIMapping.put(WSRP_v1_ServiceDescription_PortType.class.getName(), "wsrp/invoker/ServiceDescriptionService");
- portJNDIMapping.put(WSRP_v1_Markup_PortType.class.getName(), "wsrp/invoker/MarkupService");
- portJNDIMapping.put(WSRP_v1_Registration_PortType.class.getName(), "wsrp/invoker/RegistrationService");
- portJNDIMapping.put(WSRP_v1_PortletManagement_PortType.class.getName(), "wsrp/invoker/PortletManagementService");
- }
-
-
- public boolean isAvailable()
- {
- return true;
- }
-
-
- public String getServiceDescriptionURL()
- {
- return null;
- }
-
- public String getMarkupURL()
- {
- return null;
- }
-
- public String getRegistrationURL()
- {
- return null;
- }
-
- public String getPortletManagementURL()
- {
- return null;
- }
-
- public void setServiceDescriptionURL(String serviceDescriptionURL)
- {
- }
-
- public void setMarkupURL(String markupURL)
- {
- }
-
- public void setRegistrationURL(String registrationURL)
- {
- }
-
- public void setPortletManagementURL(String portletManagementURL)
- {
- }
-}
Deleted: branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/services/SOAPInvokerServiceFactory.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/services/SOAPInvokerServiceFactory.java 2007-10-02 01:33:08 UTC (rev 8507)
+++ branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/services/SOAPInvokerServiceFactory.java 2007-10-02 01:36:35 UTC (rev 8508)
@@ -1,132 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt 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.portal.wsrp.services;
-
-import org.jboss.portal.common.util.ParameterValidation;
-import org.jboss.portal.wsrp.core.WSRP_v1_Markup_PortType;
-import org.jboss.portal.wsrp.core.WSRP_v1_PortletManagement_PortType;
-import org.jboss.portal.wsrp.core.WSRP_v1_Registration_PortType;
-import org.jboss.portal.wsrp.core.WSRP_v1_ServiceDescription_PortType;
-
-import javax.xml.rpc.Service;
-import javax.xml.rpc.Stub;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision$
- * @since 2.4
- */
-public class SOAPInvokerServiceFactory extends AbstractSOAPServiceFactory
-{
-
- /** . */
- private static final Map PORT_NAMES = new HashMap();
-
- static
- {
- PORT_NAMES.put(WSRP_v1_ServiceDescription_PortType.class, "/ServiceDescriptionService");
- PORT_NAMES.put(WSRP_v1_Markup_PortType.class, "/MarkupService");
- PORT_NAMES.put(WSRP_v1_Registration_PortType.class, "/RegistrationService");
- PORT_NAMES.put(WSRP_v1_PortletManagement_PortType.class, "/PortletManagementService");
- }
-
- /** . */
- private String endpointURL;
-
- public String getEndpointURL()
- {
- return endpointURL;
- }
-
- public void setEndpointURL(String endpointURL)
- {
- ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(endpointURL, "Mandatory endpoint URL", null);
- this.endpointURL = endpointURL;
- }
-
- /** If retrieved object is of javax.xml.rpc.Service class, we're using the WS stack and we need to get the port. */
- protected Object getStubFromService(Class serviceClass, Service service) throws Exception
- {
- log.debug("Unwrapping service " + service + " for class " + serviceClass);
- Object stub = service.getPort(serviceClass);
-
- //
- if (endpointURL != null)
- {
- String portAddress = endpointURL + PORT_NAMES.get(serviceClass);
- log.debug("Setting the end point to: " + portAddress);
- ((Stub)stub)._setProperty(Stub.ENDPOINT_ADDRESS_PROPERTY, portAddress);
- }
- return stub;
- }
-
-
- public boolean isAvailable()
- {
- return endpointURL != null;
- }
-
- public String getServiceDescriptionURL()
- {
- return endpointURL + PORT_NAMES.get(WSRP_v1_ServiceDescription_PortType.class);
- }
-
- public String getMarkupURL()
- {
- return endpointURL + PORT_NAMES.get(WSRP_v1_Markup_PortType.class);
- }
-
- public String getRegistrationURL()
- {
- return endpointURL + PORT_NAMES.get(WSRP_v1_Registration_PortType.class);
- }
-
- public String getPortletManagementURL()
- {
- return endpointURL + PORT_NAMES.get(WSRP_v1_PortletManagement_PortType.class);
- }
-
- public void setServiceDescriptionURL(String serviceDescriptionURL)
- {
- throw new UnsupportedOperationException();
- }
-
- public void setMarkupURL(String markupURL)
- {
- throw new UnsupportedOperationException();
- }
-
- public void setRegistrationURL(String registrationURL)
- {
- throw new UnsupportedOperationException();
- }
-
- public void setPortletManagementURL(String portletManagementURL)
- {
- throw new UnsupportedOperationException();
- }
-}
16 years, 8 months
JBoss Portal SVN: r8507 - in trunk/wsrp/src/main/org/jboss/portal: test/wsrp/other and 5 other directories.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2007-10-01 21:33:08 -0400 (Mon, 01 Oct 2007)
New Revision: 8507
Removed:
trunk/wsrp/src/main/org/jboss/portal/wsrp/services/RMIInvokerServiceFactory.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/services/SOAPInvokerServiceFactory.java
Modified:
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/config/ProducerConfigurationTestCase.java
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/other/RegistrationPropertyDescriptionTestCase.java
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/ReleaseSessionTestCase.java
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/ServiceDescriptionTestCase.java
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/V1ProducerBaseTest.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/RegistrationHandler.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/ServiceDescriptionHandler.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/WSRPProducerImpl.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/config/ProducerConfigurationFactory.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/config/ProducerRegistrationRequirements.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/config/impl/ProducerRegistrationRequirementsImpl.java
Log:
- Renamed ProducerRegistrationRequirements.requiresRegistration to isRegistrationRequired to follow Java Beans conventions.
- Renamed ProducerRegistrationRequirements.fullServiceDescriptionRequiresRegistration to isRegistrationRequiredForFullDescription to follow Java Beans conventions.
- Removed unused classes.
Modified: trunk/wsrp/src/main/org/jboss/portal/test/wsrp/config/ProducerConfigurationTestCase.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/test/wsrp/config/ProducerConfigurationTestCase.java 2007-10-02 00:01:43 UTC (rev 8506)
+++ trunk/wsrp/src/main/org/jboss/portal/test/wsrp/config/ProducerConfigurationTestCase.java 2007-10-02 01:33:08 UTC (rev 8507)
@@ -82,8 +82,8 @@
RegistrationPropertyValidator propertyValidator = ((DefaultRegistrationPolicy)policy).getValidator();
assertNotNull(propertyValidator);
assertTrue(propertyValidator instanceof DefaultRegistrationPropertyValidator);
- assertTrue(requirements.requiresRegistration());
- assertTrue(requirements.fullServiceDescriptionRequiresRegistration());
+ assertTrue(requirements.isRegistrationRequired());
+ assertTrue(requirements.isRegistrationRequiredForFullDescription());
Map properties = requirements.getRegistrationProperties();
assertNotNull(properties);
assertEquals(2, properties.size());
@@ -97,8 +97,8 @@
ProducerConfiguration producerConfiguration = getProducerConfiguration("minimal-registration.xml");
ProducerRegistrationRequirements requirements = producerConfiguration.getRegistrationRequirements();
assertNotNull(requirements);
- assertTrue(requirements.requiresRegistration());
- assertTrue(!requirements.fullServiceDescriptionRequiresRegistration());
+ assertTrue(requirements.isRegistrationRequired());
+ assertTrue(!requirements.isRegistrationRequiredForFullDescription());
Map properties = requirements.getRegistrationProperties();
assertNotNull(properties);
assertTrue(properties.isEmpty());
@@ -110,8 +110,8 @@
ProducerConfiguration producerConfiguration = getProducerConfiguration("minimal.xml");
ProducerRegistrationRequirements requirements = producerConfiguration.getRegistrationRequirements();
assertNotNull(requirements);
- assertFalse(requirements.requiresRegistration());
- assertFalse(requirements.fullServiceDescriptionRequiresRegistration());
+ assertFalse(requirements.isRegistrationRequired());
+ assertFalse(requirements.isRegistrationRequiredForFullDescription());
assertTrue(requirements.getRegistrationProperties().isEmpty());
assertNull(requirements.getPolicy());
}
Modified: trunk/wsrp/src/main/org/jboss/portal/test/wsrp/other/RegistrationPropertyDescriptionTestCase.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/test/wsrp/other/RegistrationPropertyDescriptionTestCase.java 2007-10-02 00:01:43 UTC (rev 8506)
+++ trunk/wsrp/src/main/org/jboss/portal/test/wsrp/other/RegistrationPropertyDescriptionTestCase.java 2007-10-02 01:33:08 UTC (rev 8507)
@@ -87,21 +87,21 @@
notifyCalled = false;
}
- public boolean requiresRegistration()
+ public boolean isRegistrationRequired()
{
return false;
}
- public void setRequiresRegistration(boolean requiresRegistration)
+ public void setRegistrationRequired(boolean requiresRegistration)
{
}
- public boolean fullServiceDescriptionRequiresRegistration()
+ public boolean isRegistrationRequiredForFullDescription()
{
return false;
}
- public void setFullServiceDescriptionRequiresRegistration(boolean fullServiceDescriptionRequiresRegistration)
+ public void setRegistrationRequiredForFullDescription(boolean fullServiceDescriptionRequiresRegistration)
{
}
@@ -171,5 +171,9 @@
{
return null;
}
+
+ public void reloadPolicyFrom(String policyClassName, String validatorClassName)
+ {
+ }
}
}
Modified: trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/ReleaseSessionTestCase.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/ReleaseSessionTestCase.java 2007-10-02 00:01:43 UTC (rev 8506)
+++ trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/ReleaseSessionTestCase.java 2007-10-02 01:33:08 UTC (rev 8507)
@@ -151,7 +151,7 @@
}
- if (producer.getProducerRegistrationRequirements().requiresRegistration())
+ if (producer.getProducerRegistrationRequirements().isRegistrationRequired())
{
message.append(" | with registration required.");
}
Modified: trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/ServiceDescriptionTestCase.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/ServiceDescriptionTestCase.java 2007-10-02 00:01:43 UTC (rev 8506)
+++ trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/ServiceDescriptionTestCase.java 2007-10-02 01:33:08 UTC (rev 8507)
@@ -55,7 +55,7 @@
public void testGetServiceDescriptionNotRequiringRegistration() throws Throwable
{
- producer.getProducerRegistrationRequirements().setRequiresRegistration(false);
+ producer.getProducerRegistrationRequirements().setRegistrationRequired(false);
GetServiceDescription gs = getNoRegistrationServiceDescriptionRequest();
Modified: trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/V1ProducerBaseTest.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/V1ProducerBaseTest.java 2007-10-02 00:01:43 UTC (rev 8506)
+++ trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/V1ProducerBaseTest.java 2007-10-02 01:33:08 UTC (rev 8507)
@@ -162,8 +162,8 @@
protected RegistrationPropertyDescription configureRegistrationSettings(boolean provideUnregisteredFullDescription)
{
// define expected registration infos
- producer.getProducerRegistrationRequirements().setRequiresRegistration(true);
- producer.getProducerRegistrationRequirements().setFullServiceDescriptionRequiresRegistration(provideUnregisteredFullDescription);
+ producer.getProducerRegistrationRequirements().setRegistrationRequired(true);
+ producer.getProducerRegistrationRequirements().setRegistrationRequiredForFullDescription(provideUnregisteredFullDescription);
// fix-me: http://jira.jboss.com/jira/browse/JBPORTAL-821
RegistrationPropertyDescription regProp = new RegistrationPropertyDescription("regProp",
@@ -176,7 +176,7 @@
protected void resetRegistrationInfo()
{
- producer.getProducerRegistrationRequirements().setRequiresRegistration(false);
+ producer.getProducerRegistrationRequirements().setRegistrationRequired(false);
producer.getProducerRegistrationRequirements().clearRegistrationProperties();
}
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/RegistrationHandler.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/RegistrationHandler.java 2007-10-02 00:01:43 UTC (rev 8506)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/RegistrationHandler.java 2007-10-02 01:33:08 UTC (rev 8507)
@@ -227,7 +227,7 @@
{
if (reg == null)
{
- if (producer.getProducerRegistrationRequirements().requiresRegistration())
+ if (producer.getProducerRegistrationRequirements().isRegistrationRequired())
{
log.debug("Registration is required yet no RegistrationContext was provided: registration invalid!");
return false;
@@ -257,7 +257,7 @@
*/
Registration getRegistrationFrom(RegistrationContext registrationContext)
{
- if (producer.getProducerRegistrationRequirements().requiresRegistration())
+ if (producer.getProducerRegistrationRequirements().isRegistrationRequired())
{
if (registrationContext == null)
{
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/ServiceDescriptionHandler.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/ServiceDescriptionHandler.java 2007-10-02 00:01:43 UTC (rev 8506)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/ServiceDescriptionHandler.java 2007-10-02 01:33:08 UTC (rev 8507)
@@ -83,11 +83,11 @@
ProducerRegistrationRequirements requirements = producer.getProducerRegistrationRequirements();
PortletDescription[] offeredPortlets = null;
- ServiceDescription serviceDescription = WSRPTypeFactory.createServiceDescription(requirements.requiresRegistration());
+ ServiceDescription serviceDescription = WSRPTypeFactory.createServiceDescription(requirements.isRegistrationRequired());
serviceDescription.setRequiresInitCookie(BEA_8_CONSUMER_FIX);
serviceDescription.setLocales(producer.getSupportedLocales());
- if (!requirements.requiresRegistration())
+ if (!requirements.isRegistrationRequired())
{
offeredPortlets = getPortletDescriptions(gs.getDesiredLocales(), null);
}
@@ -97,7 +97,7 @@
{
log.debug("Unregistered consumer while registration is required. Sending registration information.");
- if (requirements.fullServiceDescriptionRequiresRegistration())
+ if (requirements.isRegistrationRequiredForFullDescription())
{
log.debug("Sending offered portlets description despite not being registered, per Producer configuration.");
offeredPortlets = getPortletDescriptions(gs.getDesiredLocales(), null);
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/WSRPProducerImpl.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/WSRPProducerImpl.java 2007-10-02 00:01:43 UTC (rev 8506)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/WSRPProducerImpl.java 2007-10-02 01:33:08 UTC (rev 8507)
@@ -273,7 +273,7 @@
super.startService();
producerConfiguration = configurationService.getConfiguration();
ProducerRegistrationRequirements registrationRequirements = getProducerRegistrationRequirements();
- if (registrationRequirements.requiresRegistration())
+ if (registrationRequirements.isRegistrationRequired())
{
registrationManager.setPolicy(registrationRequirements.getPolicy());
registrationRequirements.addRegistrationPropertyChangeListeners(registrationManager);
@@ -283,7 +283,7 @@
protected void stopService() throws Exception
{
ProducerRegistrationRequirements registrationRequirements = getProducerRegistrationRequirements();
- if (registrationRequirements.requiresRegistration())
+ if (registrationRequirements.isRegistrationRequired())
{
registrationRequirements.removeRegistrationPropertyChangeListener(registrationManager);
}
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/config/ProducerConfigurationFactory.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/config/ProducerConfigurationFactory.java 2007-10-02 00:01:43 UTC (rev 8506)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/config/ProducerConfigurationFactory.java 2007-10-02 01:33:08 UTC (rev 8507)
@@ -80,15 +80,15 @@
}
ProducerRegistrationRequirements registrationRequirements = new ProducerRegistrationRequirementsImpl();
- registrationRequirements.setRequiresRegistration(true);
+ registrationRequirements.setRegistrationRequired(true);
String descRequiresRegistration = attrs.getValue("fullServiceDescriptionRequiresRegistration");
if ("true".equals(descRequiresRegistration))
{
- registrationRequirements.setFullServiceDescriptionRequiresRegistration(true);
+ registrationRequirements.setRegistrationRequiredForFullDescription(true);
}
else if (descRequiresRegistration == null || "false".equals(descRequiresRegistration))
{
- registrationRequirements.setFullServiceDescriptionRequiresRegistration(false);
+ registrationRequirements.setRegistrationRequiredForFullDescription(false);
}
else
{
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/config/ProducerRegistrationRequirements.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/config/ProducerRegistrationRequirements.java 2007-10-02 00:01:43 UTC (rev 8506)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/config/ProducerRegistrationRequirements.java 2007-10-02 01:33:08 UTC (rev 8507)
@@ -37,14 +37,17 @@
*/
public interface ProducerRegistrationRequirements
{
- boolean requiresRegistration();
+ String DEFAULT_POLICY_CLASS_NAME = "org.jboss.portal.registration.policies.DefaultRegistrationPolicy";
+ String DEFAULT_VALIDATOR_CLASS_NAME = "org.jboss.portal.registration.policies.DefaultRegistrationPropertyValidator";
- void setRequiresRegistration(boolean requiresRegistration);
+ boolean isRegistrationRequired();
- boolean fullServiceDescriptionRequiresRegistration();
+ void setRegistrationRequired(boolean requiresRegistration);
- void setFullServiceDescriptionRequiresRegistration(boolean fullServiceDescriptionRequiresRegistration);
+ boolean isRegistrationRequiredForFullDescription();
+ void setRegistrationRequiredForFullDescription(boolean fullServiceDescriptionRequiresRegistration);
+
Map getRegistrationProperties();
void addRegistrationProperty(RegistrationPropertyDescription propertyDescription);
@@ -74,4 +77,6 @@
void setPolicy(RegistrationPolicy policy);
RegistrationPolicy getPolicy();
+
+ void reloadPolicyFrom(String policyClassName, String validatorClassName);
}
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/config/impl/ProducerRegistrationRequirementsImpl.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/config/impl/ProducerRegistrationRequirementsImpl.java 2007-10-02 00:01:43 UTC (rev 8506)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/config/impl/ProducerRegistrationRequirementsImpl.java 2007-10-02 01:33:08 UTC (rev 8507)
@@ -59,8 +59,6 @@
/** property name (QName) -> PropertyDescription */
private Map registrationProperties;
- public final static String DEFAULT_POLICY_CLASS_NAME = "org.jboss.portal.registration.policies.DefaultRegistrationPolicy";
- public final static String DEFAULT_VALIDATOR_CLASS_NAME = "org.jboss.portal.registration.policies.DefaultRegistrationPropertyValidator";
public ProducerRegistrationRequirementsImpl(boolean requiresMarshalling, boolean requiresRegistration, boolean fullServiceDescriptionRequiresRegistration)
{
@@ -74,22 +72,22 @@
registrationProperties = new HashMap(7);
}
- public boolean requiresRegistration()
+ public boolean isRegistrationRequired()
{
return requiresRegistration;
}
- public void setRequiresRegistration(boolean requiresRegistration)
+ public void setRegistrationRequired(boolean requiresRegistration)
{
this.requiresRegistration = requiresRegistration;
}
- public boolean fullServiceDescriptionRequiresRegistration()
+ public boolean isRegistrationRequiredForFullDescription()
{
return fullServiceDescriptionRequiresRegistration;
}
- public void setFullServiceDescriptionRequiresRegistration(boolean fullServiceDescriptionRequiresRegistration)
+ public void setRegistrationRequiredForFullDescription(boolean fullServiceDescriptionRequiresRegistration)
{
this.fullServiceDescriptionRequiresRegistration = fullServiceDescriptionRequiresRegistration;
}
@@ -194,6 +192,10 @@
if (policy != null)
{
policyClassName = policy.getClass().getName();
+ if (DEFAULT_POLICY_CLASS_NAME.equals(policyClassName))
+ {
+ validatorClassName = ((DefaultRegistrationPolicy)policy).getValidator().getClass().getName();
+ }
}
}
@@ -202,78 +204,84 @@
{
if (policy == null && requiresRegistration)
{
- if (policyClassName != null)
+ reloadPolicyFrom(policyClassName, validatorClassName);
+ }
+
+ return policy;
+ }
+
+ public void reloadPolicyFrom(String policyClassName, String validatorClassName)
+ {
+ if (policyClassName != null)
+ {
+ log.debug("Using registration policy: " + policyClassName);
+ ClassLoader loader = Thread.currentThread().getContextClassLoader();
+ try
{
- log.debug("Using registration policy: " + policyClassName);
+ Class policyClass = loader.loadClass(policyClassName);
+ Class expectedInterface = loader.loadClass("org.jboss.portal.registration.RegistrationPolicy");
+ if (!expectedInterface.isAssignableFrom(policyClass))
+ {
+ throw new IllegalArgumentException("Policy class does not implement RegistrationPolicy!");
+ }
+ RegistrationPolicy policy = (RegistrationPolicy)policyClass.newInstance();
+ setPolicy(policy);
+ }
+ catch (ClassNotFoundException e)
+ {
+ IllegalArgumentException iae = new IllegalArgumentException("Couldn't find policy class " + policyClassName + ".");
+ iae.initCause(e);
+ throw iae;
+ }
+ catch (Exception e)
+ {
+ IllegalArgumentException iae = new IllegalArgumentException("Couldn't instantiate policy class.");
+ iae.initCause(e);
+ throw iae;
+ }
+ }
+ else
+ {
+ log.debug("Using default registration policy: " + DEFAULT_POLICY_CLASS_NAME);
+ RegistrationPropertyValidator validator;
+ if (validatorClassName != null)
+ {
+ log.debug("Using registration property validator: " + validatorClassName);
ClassLoader loader = Thread.currentThread().getContextClassLoader();
try
{
- Class policyClass = loader.loadClass(policyClassName);
- Class expectedInterface = loader.loadClass("org.jboss.portal.registration.RegistrationPolicy");
- if (!expectedInterface.isAssignableFrom(policyClass))
+ Class validatorClass = loader.loadClass(validatorClassName);
+ Class expectedInterface = loader.loadClass("org.jboss.portal.registration.policies.RegistrationPropertyValidator");
+ if (!expectedInterface.isAssignableFrom(validatorClass))
{
- throw new IllegalArgumentException("Policy class does not implement RegistrationPolicy!");
+ throw new IllegalArgumentException("Validator class does not implement RegistrationPropertyValidator!");
}
- RegistrationPolicy policy = (RegistrationPolicy)policyClass.newInstance();
- setPolicy(policy);
+ validator = (RegistrationPropertyValidator)validatorClass.newInstance();
}
catch (ClassNotFoundException e)
{
- IllegalArgumentException iae = new IllegalArgumentException("Couldn't find policy class " + policyClassName + ".");
+ IllegalArgumentException iae = new IllegalArgumentException("Couldn't find validator class " + validatorClassName + ".");
iae.initCause(e);
throw iae;
}
catch (Exception e)
{
- IllegalArgumentException iae = new IllegalArgumentException("Couldn't instantiate policy class.");
+ IllegalArgumentException iae = new IllegalArgumentException("Couldn't instantiate validator class.");
iae.initCause(e);
throw iae;
}
}
else
{
- log.debug("Using default registration policy: " + DEFAULT_POLICY_CLASS_NAME);
- RegistrationPropertyValidator validator;
- if (validatorClassName != null)
- {
- log.debug("Using registration property validator: " + validatorClassName);
- ClassLoader loader = Thread.currentThread().getContextClassLoader();
- try
- {
- Class validatorClass = loader.loadClass(validatorClassName);
- Class expectedInterface = loader.loadClass("org.jboss.portal.registration.policies.RegistrationPropertyValidator");
- if (!expectedInterface.isAssignableFrom(validatorClass))
- {
- throw new IllegalArgumentException("Validator class does not implement RegistrationPropertyValidator!");
- }
- validator = (RegistrationPropertyValidator)validatorClass.newInstance();
- }
- catch (ClassNotFoundException e)
- {
- IllegalArgumentException iae = new IllegalArgumentException("Couldn't find validator class " + validatorClassName + ".");
- iae.initCause(e);
- throw iae;
- }
- catch (Exception e)
- {
- IllegalArgumentException iae = new IllegalArgumentException("Couldn't instantiate validator class.");
- iae.initCause(e);
- throw iae;
- }
- }
- else
- {
- log.debug("Using default registration property validator: " + DEFAULT_VALIDATOR_CLASS_NAME);
- validator = new DefaultRegistrationPropertyValidator();
- }
+ log.debug("Using default registration property validator: " + DEFAULT_VALIDATOR_CLASS_NAME);
+ validator = new DefaultRegistrationPropertyValidator();
+ }
- policy = new DefaultRegistrationPolicy();
- ((DefaultRegistrationPolicy)policy).setValidator(validator);
- }
+ DefaultRegistrationPolicy policy = new DefaultRegistrationPolicy();
+ policy.setValidator(validator);
+ setPolicy(policy);
}
-
- return policy;
}
Deleted: trunk/wsrp/src/main/org/jboss/portal/wsrp/services/RMIInvokerServiceFactory.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/services/RMIInvokerServiceFactory.java 2007-10-02 00:01:43 UTC (rev 8506)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/services/RMIInvokerServiceFactory.java 2007-10-02 01:33:08 UTC (rev 8507)
@@ -1,91 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt 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.portal.wsrp.services;
-
-import org.jboss.portal.wsrp.core.WSRP_v1_Markup_PortType;
-import org.jboss.portal.wsrp.core.WSRP_v1_PortletManagement_PortType;
-import org.jboss.portal.wsrp.core.WSRP_v1_Registration_PortType;
-import org.jboss.portal.wsrp.core.WSRP_v1_ServiceDescription_PortType;
-
-import java.util.Properties;
-
-/**
- * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
- * @version $Revision$
- * @since 2.4
- */
-public class RMIInvokerServiceFactory extends AbstractJNDIServiceFactory
-{
- public RMIInvokerServiceFactory()
- {
- portJNDIMapping = new Properties();
- portJNDIMapping.put(WSRP_v1_ServiceDescription_PortType.class.getName(), "wsrp/invoker/ServiceDescriptionService");
- portJNDIMapping.put(WSRP_v1_Markup_PortType.class.getName(), "wsrp/invoker/MarkupService");
- portJNDIMapping.put(WSRP_v1_Registration_PortType.class.getName(), "wsrp/invoker/RegistrationService");
- portJNDIMapping.put(WSRP_v1_PortletManagement_PortType.class.getName(), "wsrp/invoker/PortletManagementService");
- }
-
-
- public boolean isAvailable()
- {
- return true;
- }
-
-
- public String getServiceDescriptionURL()
- {
- return null;
- }
-
- public String getMarkupURL()
- {
- return null;
- }
-
- public String getRegistrationURL()
- {
- return null;
- }
-
- public String getPortletManagementURL()
- {
- return null;
- }
-
- public void setServiceDescriptionURL(String serviceDescriptionURL)
- {
- }
-
- public void setMarkupURL(String markupURL)
- {
- }
-
- public void setRegistrationURL(String registrationURL)
- {
- }
-
- public void setPortletManagementURL(String portletManagementURL)
- {
- }
-}
Deleted: trunk/wsrp/src/main/org/jboss/portal/wsrp/services/SOAPInvokerServiceFactory.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/services/SOAPInvokerServiceFactory.java 2007-10-02 00:01:43 UTC (rev 8506)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/services/SOAPInvokerServiceFactory.java 2007-10-02 01:33:08 UTC (rev 8507)
@@ -1,132 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt 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.portal.wsrp.services;
-
-import org.jboss.portal.common.util.ParameterValidation;
-import org.jboss.portal.wsrp.core.WSRP_v1_Markup_PortType;
-import org.jboss.portal.wsrp.core.WSRP_v1_PortletManagement_PortType;
-import org.jboss.portal.wsrp.core.WSRP_v1_Registration_PortType;
-import org.jboss.portal.wsrp.core.WSRP_v1_ServiceDescription_PortType;
-
-import javax.xml.rpc.Service;
-import javax.xml.rpc.Stub;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision$
- * @since 2.4
- */
-public class SOAPInvokerServiceFactory extends AbstractSOAPServiceFactory
-{
-
- /** . */
- private static final Map PORT_NAMES = new HashMap();
-
- static
- {
- PORT_NAMES.put(WSRP_v1_ServiceDescription_PortType.class, "/ServiceDescriptionService");
- PORT_NAMES.put(WSRP_v1_Markup_PortType.class, "/MarkupService");
- PORT_NAMES.put(WSRP_v1_Registration_PortType.class, "/RegistrationService");
- PORT_NAMES.put(WSRP_v1_PortletManagement_PortType.class, "/PortletManagementService");
- }
-
- /** . */
- private String endpointURL;
-
- public String getEndpointURL()
- {
- return endpointURL;
- }
-
- public void setEndpointURL(String endpointURL)
- {
- ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(endpointURL, "Mandatory endpoint URL", null);
- this.endpointURL = endpointURL;
- }
-
- /** If retrieved object is of javax.xml.rpc.Service class, we're using the WS stack and we need to get the port. */
- protected Object getStubFromService(Class serviceClass, Service service) throws Exception
- {
- log.debug("Unwrapping service " + service + " for class " + serviceClass);
- Object stub = service.getPort(serviceClass);
-
- //
- if (endpointURL != null)
- {
- String portAddress = endpointURL + PORT_NAMES.get(serviceClass);
- log.debug("Setting the end point to: " + portAddress);
- ((Stub)stub)._setProperty(Stub.ENDPOINT_ADDRESS_PROPERTY, portAddress);
- }
- return stub;
- }
-
-
- public boolean isAvailable()
- {
- return endpointURL != null;
- }
-
- public String getServiceDescriptionURL()
- {
- return endpointURL + PORT_NAMES.get(WSRP_v1_ServiceDescription_PortType.class);
- }
-
- public String getMarkupURL()
- {
- return endpointURL + PORT_NAMES.get(WSRP_v1_Markup_PortType.class);
- }
-
- public String getRegistrationURL()
- {
- return endpointURL + PORT_NAMES.get(WSRP_v1_Registration_PortType.class);
- }
-
- public String getPortletManagementURL()
- {
- return endpointURL + PORT_NAMES.get(WSRP_v1_PortletManagement_PortType.class);
- }
-
- public void setServiceDescriptionURL(String serviceDescriptionURL)
- {
- throw new UnsupportedOperationException();
- }
-
- public void setMarkupURL(String markupURL)
- {
- throw new UnsupportedOperationException();
- }
-
- public void setRegistrationURL(String registrationURL)
- {
- throw new UnsupportedOperationException();
- }
-
- public void setPortletManagementURL(String portletManagementURL)
- {
- throw new UnsupportedOperationException();
- }
-}
16 years, 8 months