Author: chris.laprun(a)jboss.com
Date: 2009-11-10 13:25:26 -0500 (Tue, 10 Nov 2009)
New Revision: 552
Added:
components/wsrp/trunk/test/
components/wsrp/trunk/test/pom.xml
components/wsrp/trunk/test/src/
components/wsrp/trunk/test/src/main/
components/wsrp/trunk/test/src/main/java/
components/wsrp/trunk/test/src/main/java/org/
components/wsrp/trunk/test/src/main/java/org/gatein/
components/wsrp/trunk/test/src/main/java/org/gatein/wsrp/
components/wsrp/trunk/test/src/main/java/org/gatein/wsrp/test/
components/wsrp/trunk/test/src/main/java/org/gatein/wsrp/test/ExtendedAssert.java
components/wsrp/trunk/test/src/main/java/org/gatein/wsrp/test/handler/
components/wsrp/trunk/test/src/main/java/org/gatein/wsrp/test/handler/MockSOAPBody.java
components/wsrp/trunk/test/src/main/java/org/gatein/wsrp/test/handler/MockSOAPMessage.java
components/wsrp/trunk/test/src/main/java/org/gatein/wsrp/test/handler/MockSOAPMessageContext.java
Removed:
components/wsrp/trunk/common/src/test/java/org/gatein/wsrp/handler/MockSOAPBody.java
components/wsrp/trunk/common/src/test/java/org/gatein/wsrp/handler/MockSOAPMessage.java
components/wsrp/trunk/common/src/test/java/org/gatein/wsrp/handler/MockSOAPMessageContext.java
Modified:
components/wsrp/trunk/common/pom.xml
components/wsrp/trunk/common/src/test/java/org/gatein/wsrp/handler/WSRPExtensionHandlerTestCase.java
components/wsrp/trunk/pom.xml
Log:
- Added module for common test framework classes. Moved MockSOAP* classes to it.
Modified: components/wsrp/trunk/common/pom.xml
===================================================================
--- components/wsrp/trunk/common/pom.xml 2009-11-10 15:45:52 UTC (rev 551)
+++ components/wsrp/trunk/common/pom.xml 2009-11-10 18:25:26 UTC (rev 552)
@@ -68,5 +68,11 @@
<artifactId>slf4j-jdk14</artifactId>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.gatein.wsrp</groupId>
+ <artifactId>test-framework</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
</dependencies>
</project>
\ No newline at end of file
Deleted:
components/wsrp/trunk/common/src/test/java/org/gatein/wsrp/handler/MockSOAPBody.java
===================================================================
---
components/wsrp/trunk/common/src/test/java/org/gatein/wsrp/handler/MockSOAPBody.java 2009-11-10
15:45:52 UTC (rev 551)
+++
components/wsrp/trunk/common/src/test/java/org/gatein/wsrp/handler/MockSOAPBody.java 2009-11-10
18:25:26 UTC (rev 552)
@@ -1,57 +0,0 @@
-/*
-* JBoss, a division of Red Hat
-* Copyright 2008, 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.gatein.wsrp.handler;
-
-import org.jboss.util.xml.DOMUtils;
-import org.w3c.dom.Element;
-
-import javax.xml.soap.SOAPBody;
-import java.io.IOException;
-import java.lang.reflect.InvocationHandler;
-import java.lang.reflect.Method;
-import java.lang.reflect.Proxy;
-
-/**
- * @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
- * @version $Revision$
- */
-public class MockSOAPBody implements InvocationHandler
-{
- Element body;
-
- public MockSOAPBody(Element body)
- {
- this.body = body;
- }
-
- public static SOAPBody newInstance(String body) throws IOException
- {
- return (SOAPBody)Proxy.newProxyInstance(MockSOAPBody.class.getClassLoader(), new
Class[]{SOAPBody.class},
- new MockSOAPBody(DOMUtils.parse(body)));
- }
-
- public Object invoke(Object proxy, Method method, Object[] args) throws Throwable
- {
- return method.invoke(body, args);
- }
-}
Deleted:
components/wsrp/trunk/common/src/test/java/org/gatein/wsrp/handler/MockSOAPMessage.java
===================================================================
---
components/wsrp/trunk/common/src/test/java/org/gatein/wsrp/handler/MockSOAPMessage.java 2009-11-10
15:45:52 UTC (rev 551)
+++
components/wsrp/trunk/common/src/test/java/org/gatein/wsrp/handler/MockSOAPMessage.java 2009-11-10
18:25:26 UTC (rev 552)
@@ -1,158 +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.gatein.wsrp.handler;
-
-import javax.xml.soap.AttachmentPart;
-import javax.xml.soap.MimeHeaders;
-import javax.xml.soap.SOAPBody;
-import javax.xml.soap.SOAPElement;
-import javax.xml.soap.SOAPException;
-import javax.xml.soap.SOAPMessage;
-import javax.xml.soap.SOAPPart;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.util.Iterator;
-
-/**
- * @author <a
href="mailto:chris.laprun@jboss.com?subject=org.gatein.wsrp.wsrp.handler.MockSOAPMessage">Chris
- * Laprun</a>
- * @version $Revision: 12277 $
- * @since 2.4
- */
-public class MockSOAPMessage extends SOAPMessage
-{
- MimeHeaders headers;
- String messageBody;
-
- public MockSOAPMessage()
- {
- headers = new MimeHeaders();
- }
-
- public MockSOAPMessage(MimeHeaders headers)
- {
- this.headers = headers;
- }
-
- public void setMessageBody(String messageBody)
- {
- this.messageBody = messageBody;
- }
-
- @Override
- public SOAPBody getSOAPBody() throws SOAPException
- {
- try
- {
- return MockSOAPBody.newInstance(messageBody);
- }
- catch (IOException e)
- {
- throw new SOAPException(e);
- }
- }
-
- public MimeHeaders getMimeHeaders()
- {
- return headers;
- }
-
- public void setMimeHeaders(MimeHeaders mimeHeaders)
- {
- this.headers = mimeHeaders;
- }
-
- public void addAttachmentPart(AttachmentPart attachmentPart)
- {
- throw new UnsupportedOperationException();
- }
-
- public AttachmentPart createAttachmentPart()
- {
- throw new UnsupportedOperationException();
- }
-
- public String getContentDescription()
- {
- throw new UnsupportedOperationException();
- }
-
- public void setContentDescription(String string)
- {
- throw new UnsupportedOperationException();
- }
-
- public SOAPPart getSOAPPart()
- {
- throw new UnsupportedOperationException();
- }
-
- public void removeAllAttachments()
- {
- throw new UnsupportedOperationException();
- }
-
- public int countAttachments()
- {
- throw new UnsupportedOperationException();
- }
-
- public Iterator getAttachments()
- {
- throw new UnsupportedOperationException();
- }
-
- /*
- * For JDK 1.6
- */
- public AttachmentPart getAttachment(SOAPElement element)
- {
- throw new UnsupportedOperationException();
- }
-
- public Iterator getAttachments(MimeHeaders mimeHeaders)
- {
- throw new UnsupportedOperationException();
- }
-
- public void saveChanges() throws SOAPException
- {
- throw new UnsupportedOperationException();
- }
-
- public boolean saveRequired()
- {
- throw new UnsupportedOperationException();
- }
-
- public void writeTo(OutputStream outputStream) throws SOAPException, IOException
- {
- throw new UnsupportedOperationException();
- }
-
- public void removeAttachments(MimeHeaders mimeHeaders)
- {
- throw new UnsupportedOperationException();
- }
-}
Deleted:
components/wsrp/trunk/common/src/test/java/org/gatein/wsrp/handler/MockSOAPMessageContext.java
===================================================================
---
components/wsrp/trunk/common/src/test/java/org/gatein/wsrp/handler/MockSOAPMessageContext.java 2009-11-10
15:45:52 UTC (rev 551)
+++
components/wsrp/trunk/common/src/test/java/org/gatein/wsrp/handler/MockSOAPMessageContext.java 2009-11-10
18:25:26 UTC (rev 552)
@@ -1,82 +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.gatein.wsrp.handler;
-
-import javax.xml.ws.handler.soap.SOAPMessageContext;
-import java.lang.reflect.InvocationHandler;
-import java.lang.reflect.Method;
-import java.lang.reflect.Proxy;
-
-/**
- * @author <a
href="mailto:chris.laprun@jboss.com?subject=org.gatein.wsrp.wsrp.handler.MockSOAPMessageContext">Chris
- * Laprun</a>
- * @version $Revision: 8784 $
- * @since 2.4
- */
-public class MockSOAPMessageContext implements InvocationHandler
-{
- MockSOAPMessage message;
-
-
- public MockSOAPMessageContext(MockSOAPMessage message)
- {
- this.message = message;
- }
-
- public MockSOAPMessage getMessage()
- {
- return message;
- }
-
- public void setMessage(MockSOAPMessage message)
- {
- this.message = message;
- }
-
- public Object invoke(Object proxy, Method method, Object[] args) throws Throwable
- {
- String methodName = method.getName();
-
- if ("getMessage".equals(methodName))
- {
- return getMessage();
- }
- else if ("getProperty".equals(methodName))
- {
- return "http://jboss.com"; // should only be called to get the
endpoint address
- }
- else if ("toString".equals(methodName))
- {
- return this.toString();
- }
-
- throw new UnsupportedOperationException("MockSOAPMessageContext does not
support " + methodName + " method");
- }
-
- public static SOAPMessageContext createMessageContext(MockSOAPMessage message,
ClassLoader classLoader)
- {
- return (SOAPMessageContext)Proxy.newProxyInstance(classLoader, new
Class[]{SOAPMessageContext.class},
- new MockSOAPMessageContext(message));
- }
-}
Modified:
components/wsrp/trunk/common/src/test/java/org/gatein/wsrp/handler/WSRPExtensionHandlerTestCase.java
===================================================================
---
components/wsrp/trunk/common/src/test/java/org/gatein/wsrp/handler/WSRPExtensionHandlerTestCase.java 2009-11-10
15:45:52 UTC (rev 551)
+++
components/wsrp/trunk/common/src/test/java/org/gatein/wsrp/handler/WSRPExtensionHandlerTestCase.java 2009-11-10
18:25:26 UTC (rev 552)
@@ -23,6 +23,8 @@
package org.gatein.wsrp.handler;
import junit.framework.TestCase;
+import org.gatein.wsrp.test.handler.MockSOAPMessage;
+import org.gatein.wsrp.test.handler.MockSOAPMessageContext;
import javax.xml.soap.SOAPBody;
import javax.xml.soap.SOAPException;
Modified: components/wsrp/trunk/pom.xml
===================================================================
--- components/wsrp/trunk/pom.xml 2009-11-10 15:45:52 UTC (rev 551)
+++ components/wsrp/trunk/pom.xml 2009-11-10 18:25:26 UTC (rev 552)
@@ -21,181 +21,183 @@
~ 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-->
-<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>
-
- <name>GateIn WSRP</name>
-
- <groupId>org.gatein.wsrp</groupId>
- <artifactId>wsrp-parent</artifactId>
- <version>1.0.0-Beta02-SNAPSHOT</version>
- <url>http://www.gatein.org</url>
-
- <packaging>pom</packaging>
-
- <parent>
- <groupId>org.gatein</groupId>
- <artifactId>gatein-parent</artifactId>
- <version>1.0.0-Beta03</version>
- </parent>
-
- <scm>
-
<
connection>scm:svn:http://anonsvn.jboss.org/repos/gatein/components/ws...
-
<
developerConnection>scm:svn:https://svn.jboss.org/repos/gatein/compone...
- <
url>http://fisheye.jboss.org/browse/gatein/components/wsrp/trunk/</...
- </scm>
-
- <properties>
- <version.gatein.pc>2.1.0-Beta02</version.gatein.pc>
- <version.gatein.common>2.0.0-Beta03</version.gatein.common>
- <version.gatein.wci>2.0.0-Beta02</version.gatein.wci>
-
- <version.jsf>1.2_12</version.jsf>
-
<version.apache.commons-fileupload>1.2.1</version.apache.commons-fileupload>
- <version.javax.mail>1.4.1</version.javax.mail>
- <version.javax.xml.ws>2.1</version.javax.xml.ws>
- <version.javax.xml.soap.saaj>1.3</version.javax.xml.soap.saaj>
- <version.hibernate>3.3.1.GA</version.hibernate>
- </properties>
+<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">
- <dependencyManagement>
- <dependencies>
- <!-- Import dependency management configuration -->
- <dependency>
- <groupId>org.gatein</groupId>
- <artifactId>gatein-dep</artifactId>
- <version>1.0.0-Beta02</version>
- <type>pom</type>
- <scope>import</scope>
- </dependency>
-
- <!-- internal dependencies -->
- <dependency>
- <groupId>org.gatein.wsrp</groupId>
- <artifactId>wsrp-common</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.gatein.wsrp</groupId>
- <artifactId>wsrp-consumer</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.gatein.wsrp</groupId>
- <artifactId>wsrp-producer-lib</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.gatein.wsrp</groupId>
- <artifactId>wsrp-wsrp1-ws</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.gatein.wsrp</groupId>
- <artifactId>wsrp-integration-api</artifactId>
- <version>${project.version}</version>
- </dependency>
-
- <dependency>
- <groupId>org.gatein.common</groupId>
- <artifactId>common-common</artifactId>
- <version>${version.gatein.common}</version>
- </dependency>
- <dependency>
- <groupId>org.gatein.common</groupId>
- <artifactId>common-mc</artifactId>
- <version>${version.gatein.common}</version>
- </dependency>
-
- <dependency>
- <groupId>org.gatein.pc</groupId>
- <artifactId>pc-api</artifactId>
- <version>${version.gatein.pc}</version>
- </dependency>
- <dependency>
- <groupId>org.gatein.pc</groupId>
- <artifactId>pc-portlet</artifactId>
- <version>${version.gatein.pc}</version>
- </dependency>
- <dependency>
- <groupId>org.gatein.pc</groupId>
- <artifactId>pc-federation</artifactId>
- <version>${version.gatein.pc}</version>
- </dependency>
-
- <!-- external dependencies -->
- <dependency>
- <groupId>javax.faces</groupId>
- <artifactId>jsf-api</artifactId>
- <version>${version.jsf}</version>
- </dependency>
-
- <dependency>
- <groupId>commons-fileupload</groupId>
- <artifactId>commons-fileupload</artifactId>
- <version>${version.apache.commons-fileupload}</version>
- </dependency>
-
- <dependency>
- <groupId>javax.mail</groupId>
- <artifactId>mail</artifactId>
- <version>${version.javax.mail}</version>
- </dependency>
-
- <dependency>
- <groupId>javax.xml.ws</groupId>
- <artifactId>jaxws-api</artifactId>
- <version>${version.javax.xml.ws}</version>
- </dependency>
+ <modelVersion>4.0.0</modelVersion>
- <dependency>
- <groupId>javax.xml.soap</groupId>
- <artifactId>saaj-api</artifactId>
- <version>${version.javax.xml.soap.saaj}</version>
- </dependency>
-
- <dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate-core</artifactId>
- <version>${version.hibernate}</version>
- </dependency>
-
- </dependencies>
- </dependencyManagement>
-
- <modules>
- <module>api</module>
- <module>wsrp1-ws</module>
- <module>common</module>
- <module>producer</module>
- <module>consumer</module>
- <module>admin-gui</module>
- <module>wsrp-producer-war</module>
- </modules>
-
- <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>
-
+ <name>GateIn WSRP</name>
+
+ <groupId>org.gatein.wsrp</groupId>
+ <artifactId>wsrp-parent</artifactId>
+ <version>1.0.0-Beta02-SNAPSHOT</version>
+ <url>http://www.gatein.org</url>
+
+ <packaging>pom</packaging>
+
+ <parent>
+ <groupId>org.gatein</groupId>
+ <artifactId>gatein-parent</artifactId>
+ <version>1.0.0-Beta03</version>
+ </parent>
+
+ <scm>
+
<
connection>scm:svn:http://anonsvn.jboss.org/repos/gatein/components/ws...
+
<
developerConnection>scm:svn:https://svn.jboss.org/repos/gatein/compone...
+
<
url>http://fisheye.jboss.org/browse/gatein/components/wsrp/trunk/</...
+ </scm>
+
+ <properties>
+ <version.gatein.pc>2.1.0-Beta02</version.gatein.pc>
+ <version.gatein.common>2.0.0-Beta03</version.gatein.common>
+ <version.gatein.wci>2.0.0-Beta02</version.gatein.wci>
+
+ <version.jsf>1.2_12</version.jsf>
+
<version.apache.commons-fileupload>1.2.1</version.apache.commons-fileupload>
+ <version.javax.mail>1.4.1</version.javax.mail>
+ <version.javax.xml.ws>2.1</version.javax.xml.ws>
+ <version.javax.xml.soap.saaj>1.3</version.javax.xml.soap.saaj>
+ <version.hibernate>3.3.1.GA</version.hibernate>
+ </properties>
+
+ <dependencyManagement>
+ <dependencies>
+ <!-- Import dependency management configuration -->
+ <dependency>
+ <groupId>org.gatein</groupId>
+ <artifactId>gatein-dep</artifactId>
+ <version>1.0.0-Beta02</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+
+ <!-- internal dependencies -->
+ <dependency>
+ <groupId>org.gatein.wsrp</groupId>
+ <artifactId>wsrp-common</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.gatein.wsrp</groupId>
+ <artifactId>wsrp-consumer</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.gatein.wsrp</groupId>
+ <artifactId>wsrp-producer-lib</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.gatein.wsrp</groupId>
+ <artifactId>wsrp-wsrp1-ws</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.gatein.wsrp</groupId>
+ <artifactId>wsrp-integration-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.gatein.common</groupId>
+ <artifactId>common-common</artifactId>
+ <version>${version.gatein.common}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.gatein.common</groupId>
+ <artifactId>common-mc</artifactId>
+ <version>${version.gatein.common}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.gatein.pc</groupId>
+ <artifactId>pc-api</artifactId>
+ <version>${version.gatein.pc}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.gatein.pc</groupId>
+ <artifactId>pc-portlet</artifactId>
+ <version>${version.gatein.pc}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.gatein.pc</groupId>
+ <artifactId>pc-federation</artifactId>
+ <version>${version.gatein.pc}</version>
+ </dependency>
+
+ <!-- external dependencies -->
+ <dependency>
+ <groupId>javax.faces</groupId>
+ <artifactId>jsf-api</artifactId>
+ <version>${version.jsf}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-fileupload</groupId>
+ <artifactId>commons-fileupload</artifactId>
+ <version>${version.apache.commons-fileupload}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.mail</groupId>
+ <artifactId>mail</artifactId>
+ <version>${version.javax.mail}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.xml.ws</groupId>
+ <artifactId>jaxws-api</artifactId>
+ <version>${version.javax.xml.ws}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.xml.soap</groupId>
+ <artifactId>saaj-api</artifactId>
+ <version>${version.javax.xml.soap.saaj}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-core</artifactId>
+ <version>${version.hibernate}</version>
+ </dependency>
+
+ </dependencies>
+ </dependencyManagement>
+
+ <modules>
+ <module>api</module>
+ <module>wsrp1-ws</module>
+ <module>common</module>
+ <module>test</module>
+ <module>producer</module>
+ <module>consumer</module>
+ <module>admin-gui</module>
+ <module>wsrp-producer-war</module>
+ </modules>
+
+ <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>
+
</project>
Added: components/wsrp/trunk/test/pom.xml
===================================================================
--- components/wsrp/trunk/test/pom.xml (rev 0)
+++ components/wsrp/trunk/test/pom.xml 2009-11-10 18:25:26 UTC (rev 552)
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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/xsd/maven-4.0.0.xsd">
+ <parent>
+ <groupId>org.gatein.wsrp</groupId>
+ <artifactId>wsrp-parent</artifactId>
+ <version>1.0.0-Beta02-SNAPSHOT</version>
+ </parent>
+
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>test-framework</artifactId>
+ <packaging>jar</packaging>
+ <name>GateIn WSRP Test Framework</name>
+
+ <dependencies>
+ <!--<dependency>
+ <groupId>org.gatein.wsrp</groupId>
+ <artifactId>wsrp-common</artifactId>
+ </dependency>-->
+ <dependency>
+ <groupId>org.gatein.wsrp</groupId>
+ <artifactId>wsrp-wsrp1-ws</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.gatein.pc</groupId>
+ <artifactId>pc-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.gatein.pc</groupId>
+ <artifactId>pc-portlet</artifactId>
+ </dependency>
+ </dependencies>
+
+
+</project>
\ No newline at end of file
Added: components/wsrp/trunk/test/src/main/java/org/gatein/wsrp/test/ExtendedAssert.java
===================================================================
--- components/wsrp/trunk/test/src/main/java/org/gatein/wsrp/test/ExtendedAssert.java
(rev 0)
+++
components/wsrp/trunk/test/src/main/java/org/gatein/wsrp/test/ExtendedAssert.java 2009-11-10
18:25:26 UTC (rev 552)
@@ -0,0 +1,247 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2009, 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.gatein.wsrp.test;
+
+import junit.framework.Assert;
+
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * Add more assert methods.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 7374 $
+ */
+public class ExtendedAssert extends Assert
+{
+
+ /** @see #assertEquals(Object[],Object[]) */
+ public static void assertEquals(Object[] expected, Object[] actual)
+ {
+ assertEquals(null, expected, actual);
+ }
+
+ /** Test equality as defined by java.util.Array#equals(Object[], Object[]). */
+ public static void assertEquals(String message, Object[] expected, Object[] actual)
+ {
+ if (Arrays.equals(expected, actual))
+ {
+ return;
+ }
+ fail(format(message, expected, actual));
+ }
+
+ /** @see #assertEquals(char[],char[]) */
+ public static void assertEquals(char[] expected, char[] actual)
+ {
+ assertEquals(null, expected, actual);
+ }
+
+ /** Test equality as defined by java.util.Array#equals(char[], char[]). */
+ public static void assertEquals(String message, char[] expected, char[] actual)
+ {
+ if (Arrays.equals(expected, actual))
+ {
+ return;
+ }
+ fail(format(message, expected, actual));
+ }
+
+ /** @see #assertEquals(byte[],byte[]) */
+ public static void assertEquals(byte[] expected, byte[] actual)
+ {
+ assertEquals(null, expected, actual);
+ }
+
+ /** Test equality as defined by java.util.Array#equals(char[], char[]). */
+ public static void assertEquals(String message, byte[] expected, byte[] actual)
+ {
+ if (Arrays.equals(expected, actual))
+ {
+ return;
+ }
+
+ //
+ fail(format(message, toString(expected), toString(actual)));
+ }
+
+ private static String toString(byte[] expected)
+ {
+ StringBuffer expectedBuffer = new StringBuffer("[");
+
+ //
+ for (byte expectedByte : expected)
+ {
+ expectedBuffer.append(expectedByte).append(',');
+ }
+
+ //
+ if (expectedBuffer.length() == 1)
+ {
+ expectedBuffer.append(']');
+ }
+ else
+ {
+ expectedBuffer.setCharAt(expectedBuffer.length(), ']');
+ }
+
+ //
+ return expectedBuffer.toString();
+ }
+
+ private static String format(String message, Object expected, Object actual)
+ {
+ String formatted = "";
+ if (message != null)
+ {
+ formatted = message + " ";
+ }
+ return formatted + "expected:<" + format(expected) + "> but
was:<" + format(actual) + ">";
+ }
+
+ private static String format(Object o)
+ {
+ if (o instanceof Object[])
+ {
+ Object[] array = (Object[])o;
+ StringBuffer buffer = new StringBuffer("[");
+ for (int i = 0; i < array.length; i++)
+ {
+ buffer.append(i == 0 ? "" :
",").append(String.valueOf(array[i]));
+ }
+ buffer.append("]");
+ return buffer.toString();
+ }
+ else
+ {
+ return String.valueOf(o);
+ }
+ }
+
+ public static void assertEquals(Object[] expected, Object[] tested, boolean
isOrderRelevant, String failMessage)
+ {
+ if (isOrderRelevant)
+ {
+ if (!Arrays.equals(expected, tested))
+ {
+ fail(failMessage);
+ }
+ }
+ else
+ {
+ boolean equals = (expected == tested);
+
+ if (!equals)
+ {
+ if (expected == null || tested == null)
+ {
+ fail(failMessage + " Not both null.");
+ }
+
+ if (expected.getClass().getComponentType() !=
tested.getClass().getComponentType())
+ {
+ fail(failMessage + " Different classes.");
+ }
+
+ if (expected.length != tested.length)
+ {
+ fail(failMessage + " Different sizes (tested: " + tested.length
+ ", expected: " + expected.length + ").");
+ }
+
+ List expectedList = Arrays.asList(expected);
+ List testedList = Arrays.asList(tested);
+ if (!expectedList.containsAll(testedList))
+ {
+ fail(failMessage);
+ }
+ }
+ }
+ }
+
+ public static void assertEquals(Object[] expected, Object[] tested, boolean
isOrderRelevant, String failMessage, Decorator decorator)
+ {
+ Object[] decoratedExpected = null, decoratedTested = null;
+ if (decorator != null)
+ {
+ decoratedExpected = decorate(expected, decorator);
+ decoratedTested = decorate(tested, decorator);
+ }
+
+ assertEquals(decoratedExpected, decoratedTested, isOrderRelevant, failMessage);
+ }
+
+ public static Object[] decorate(Object[] toBeDecorated, Decorator decorator)
+ {
+ if (toBeDecorated != null)
+ {
+ DecoratedObject[] decorated = new DecoratedObject[toBeDecorated.length];
+ for (int i = 0; i < decorated.length; i++)
+ {
+ decorated[i] = new DecoratedObject(toBeDecorated[i], decorator);
+ }
+ return decorated;
+ }
+ return null;
+
+ }
+
+ public static void assertString1ContainsString2(String string1, String string2)
+ {
+ assertTrue("<" + string1 + "> does not contain <" +
string2 + ">", string1.indexOf(string2) >= 0);
+ }
+
+ public static interface Decorator
+ {
+ void decorate(Object decorated);
+ }
+
+ public static class DecoratedObject
+ {
+ private Decorator decorator;
+ private Object decorated;
+
+ public Object getDecorated()
+ {
+ return decorated;
+ }
+
+ public DecoratedObject(Object decorated, Decorator decorator)
+ {
+ this.decorator = decorator;
+ this.decorated = decorated;
+ }
+
+ public boolean equals(Object obj)
+ {
+ decorator.decorate(decorated);
+ return decorator.equals(obj);
+ }
+
+ public String toString()
+ {
+ decorator.decorate(decorated);
+ return decorator.toString();
+ }
+ }
+}
\ No newline at end of file
Copied:
components/wsrp/trunk/test/src/main/java/org/gatein/wsrp/test/handler/MockSOAPBody.java
(from rev 530,
components/wsrp/trunk/common/src/test/java/org/gatein/wsrp/handler/MockSOAPBody.java)
===================================================================
---
components/wsrp/trunk/test/src/main/java/org/gatein/wsrp/test/handler/MockSOAPBody.java
(rev 0)
+++
components/wsrp/trunk/test/src/main/java/org/gatein/wsrp/test/handler/MockSOAPBody.java 2009-11-10
18:25:26 UTC (rev 552)
@@ -0,0 +1,57 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2008, 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.gatein.wsrp.test.handler;
+
+import org.jboss.util.xml.DOMUtils;
+import org.w3c.dom.Element;
+
+import javax.xml.soap.SOAPBody;
+import java.io.IOException;
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.Method;
+import java.lang.reflect.Proxy;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
+ * @version $Revision$
+ */
+public class MockSOAPBody implements InvocationHandler
+{
+ Element body;
+
+ public MockSOAPBody(Element body)
+ {
+ this.body = body;
+ }
+
+ public static SOAPBody newInstance(String body) throws IOException
+ {
+ return (SOAPBody)Proxy.newProxyInstance(MockSOAPBody.class.getClassLoader(), new
Class[]{SOAPBody.class},
+ new MockSOAPBody(DOMUtils.parse(body)));
+ }
+
+ public Object invoke(Object proxy, Method method, Object[] args) throws Throwable
+ {
+ return method.invoke(body, args);
+ }
+}
Property changes on:
components/wsrp/trunk/test/src/main/java/org/gatein/wsrp/test/handler/MockSOAPBody.java
___________________________________________________________________
Name: svn:executable
+ *
Copied:
components/wsrp/trunk/test/src/main/java/org/gatein/wsrp/test/handler/MockSOAPMessage.java
(from rev 530,
components/wsrp/trunk/common/src/test/java/org/gatein/wsrp/handler/MockSOAPMessage.java)
===================================================================
---
components/wsrp/trunk/test/src/main/java/org/gatein/wsrp/test/handler/MockSOAPMessage.java
(rev 0)
+++
components/wsrp/trunk/test/src/main/java/org/gatein/wsrp/test/handler/MockSOAPMessage.java 2009-11-10
18:25:26 UTC (rev 552)
@@ -0,0 +1,158 @@
+/******************************************************************************
+ * 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.gatein.wsrp.test.handler;
+
+import javax.xml.soap.AttachmentPart;
+import javax.xml.soap.MimeHeaders;
+import javax.xml.soap.SOAPBody;
+import javax.xml.soap.SOAPElement;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPMessage;
+import javax.xml.soap.SOAPPart;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.util.Iterator;
+
+/**
+ * @author <a
href="mailto:chris.laprun@jboss.com?subject=org.gatein.wsrp.wsrp.handler.MockSOAPMessage">Chris
+ * Laprun</a>
+ * @version $Revision: 12277 $
+ * @since 2.4
+ */
+public class MockSOAPMessage extends SOAPMessage
+{
+ MimeHeaders headers;
+ String messageBody;
+
+ public MockSOAPMessage()
+ {
+ headers = new MimeHeaders();
+ }
+
+ public MockSOAPMessage(MimeHeaders headers)
+ {
+ this.headers = headers;
+ }
+
+ public void setMessageBody(String messageBody)
+ {
+ this.messageBody = messageBody;
+ }
+
+ @Override
+ public SOAPBody getSOAPBody() throws SOAPException
+ {
+ try
+ {
+ return MockSOAPBody.newInstance(messageBody);
+ }
+ catch (IOException e)
+ {
+ throw new SOAPException(e);
+ }
+ }
+
+ public MimeHeaders getMimeHeaders()
+ {
+ return headers;
+ }
+
+ public void setMimeHeaders(MimeHeaders mimeHeaders)
+ {
+ this.headers = mimeHeaders;
+ }
+
+ public void addAttachmentPart(AttachmentPart attachmentPart)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public AttachmentPart createAttachmentPart()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public String getContentDescription()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public void setContentDescription(String string)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public SOAPPart getSOAPPart()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public void removeAllAttachments()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public int countAttachments()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public Iterator getAttachments()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ /*
+ * For JDK 1.6
+ */
+ public AttachmentPart getAttachment(SOAPElement element)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public Iterator getAttachments(MimeHeaders mimeHeaders)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public void saveChanges() throws SOAPException
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public boolean saveRequired()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public void writeTo(OutputStream outputStream) throws SOAPException, IOException
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public void removeAttachments(MimeHeaders mimeHeaders)
+ {
+ throw new UnsupportedOperationException();
+ }
+}
Property changes on:
components/wsrp/trunk/test/src/main/java/org/gatein/wsrp/test/handler/MockSOAPMessage.java
___________________________________________________________________
Name: svn:executable
+ *
Copied:
components/wsrp/trunk/test/src/main/java/org/gatein/wsrp/test/handler/MockSOAPMessageContext.java
(from rev 530,
components/wsrp/trunk/common/src/test/java/org/gatein/wsrp/handler/MockSOAPMessageContext.java)
===================================================================
---
components/wsrp/trunk/test/src/main/java/org/gatein/wsrp/test/handler/MockSOAPMessageContext.java
(rev 0)
+++
components/wsrp/trunk/test/src/main/java/org/gatein/wsrp/test/handler/MockSOAPMessageContext.java 2009-11-10
18:25:26 UTC (rev 552)
@@ -0,0 +1,82 @@
+/******************************************************************************
+ * 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.gatein.wsrp.test.handler;
+
+import javax.xml.ws.handler.soap.SOAPMessageContext;
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.Method;
+import java.lang.reflect.Proxy;
+
+/**
+ * @author <a
href="mailto:chris.laprun@jboss.com?subject=org.gatein.wsrp.wsrp.handler.MockSOAPMessageContext">Chris
+ * Laprun</a>
+ * @version $Revision: 8784 $
+ * @since 2.4
+ */
+public class MockSOAPMessageContext implements InvocationHandler
+{
+ MockSOAPMessage message;
+
+
+ public MockSOAPMessageContext(MockSOAPMessage message)
+ {
+ this.message = message;
+ }
+
+ public MockSOAPMessage getMessage()
+ {
+ return message;
+ }
+
+ public void setMessage(MockSOAPMessage message)
+ {
+ this.message = message;
+ }
+
+ public Object invoke(Object proxy, Method method, Object[] args) throws Throwable
+ {
+ String methodName = method.getName();
+
+ if ("getMessage".equals(methodName))
+ {
+ return getMessage();
+ }
+ else if ("getProperty".equals(methodName))
+ {
+ return "http://jboss.com"; // should only be called to get the
endpoint address
+ }
+ else if ("toString".equals(methodName))
+ {
+ return this.toString();
+ }
+
+ throw new UnsupportedOperationException("MockSOAPMessageContext does not
support " + methodName + " method");
+ }
+
+ public static SOAPMessageContext createMessageContext(MockSOAPMessage message,
ClassLoader classLoader)
+ {
+ return (SOAPMessageContext)Proxy.newProxyInstance(classLoader, new
Class[]{SOAPMessageContext.class},
+ new MockSOAPMessageContext(message));
+ }
+}
Property changes on:
components/wsrp/trunk/test/src/main/java/org/gatein/wsrp/test/handler/MockSOAPMessageContext.java
___________________________________________________________________
Name: svn:executable
+ *