Author: alessio.soldano(a)jboss.com
Date: 2009-02-03 06:20:15 -0500 (Tue, 03 Feb 2009)
New Revision: 9219
Added:
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/smoke/tools/StackConfigurable.java
Modified:
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/smoke/tools/PluginBase.java
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/smoke/tools/WSConsumerPlugin.java
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/smoke/tools/WSConsumerTestCase.java
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/smoke/tools/WSProviderTestCase.java
Log:
Allowing isIntegrationXYZ() from WSConsumerPlugin
Modified:
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/smoke/tools/PluginBase.java
===================================================================
---
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/smoke/tools/PluginBase.java 2009-02-03
10:43:19 UTC (rev 9218)
+++
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/smoke/tools/PluginBase.java 2009-02-03
11:20:15 UTC (rev 9219)
@@ -26,6 +26,7 @@
import java.lang.reflect.InvocationTargetException;
import java.net.URL;
import java.net.URLClassLoader;
+import java.util.Arrays;
import java.util.List;
import java.util.LinkedList;
import java.util.StringTokenizer;
@@ -40,6 +41,9 @@
protected Object delegate = null;
protected ClassLoader origClassLoader;
protected String oldCPProp;
+ protected boolean integrationNative = false;
+ protected boolean integrationMetro = false;
+ protected boolean integrationCXF = false;
protected void dispatch(String methodName) throws Exception
{
@@ -53,9 +57,30 @@
throw e;
}
}
+
+ protected void setDelegate(Class<?> clazz) throws Exception
+ {
+ delegate = clazz.newInstance();
+ List<String> list = new LinkedList<String>();
+ for (Class<?> c : clazz.getInterfaces())
+ {
+ list.add(c.getName());
+ }
+ if (list.contains(StackConfigurable.class.getName()))
+ {
+ clazz.getMethod("setIntegrationNative",
boolean.class).invoke(delegate, integrationNative);
+ clazz.getMethod("setIntegrationMetro", boolean.class).invoke(delegate,
integrationMetro);
+ clazz.getMethod("setIntegrationCXF", boolean.class).invoke(delegate,
integrationCXF);
+ }
+ }
protected void setupClasspath() throws Exception
{
+ if (!(integrationCXF || integrationMetro || integrationNative))
+ {
+ //the integration stack is not set yet, doing it before mangling with the
classpath
+ readIntegrationStack();
+ }
String classpath = System.getProperty("surefire.test.class.path");
if (classpath == null) //no maven surefire classpath hacks required
return;
@@ -109,4 +134,11 @@
System.setProperty("java.class.path", oldCPProp);
}
}
+
+ protected void readIntegrationStack()
+ {
+ this.integrationNative = isIntegrationNative();
+ this.integrationMetro = isIntegrationMetro();
+ this.integrationCXF = isIntegrationCXF();
+ }
}
Added:
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/smoke/tools/StackConfigurable.java
===================================================================
---
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/smoke/tools/StackConfigurable.java
(rev 0)
+++
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/smoke/tools/StackConfigurable.java 2009-02-03
11:20:15 UTC (rev 9219)
@@ -0,0 +1,31 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.smoke.tools;
+
+public interface StackConfigurable
+{
+ public void setIntegrationNative(boolean integrationNative);
+
+ public void setIntegrationMetro(boolean integrationMetro);
+
+ public void setIntegrationCXF(boolean integrationCXF);
+}
Property changes on:
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/smoke/tools/StackConfigurable.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified:
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/smoke/tools/WSConsumerPlugin.java
===================================================================
---
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/smoke/tools/WSConsumerPlugin.java 2009-02-03
10:43:19 UTC (rev 9218)
+++
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/smoke/tools/WSConsumerPlugin.java 2009-02-03
11:20:15 UTC (rev 9219)
@@ -36,8 +36,9 @@
/**
* @author Heiko.Braun <heiko.braun(a)jboss.com>
+ * @author alessio.soldano(a)jboss.com
*/
-public class WSConsumerPlugin extends JBossWSTest implements WSConsumerPluginDelegate
+public class WSConsumerPlugin extends JBossWSTest implements WSConsumerPluginDelegate,
StackConfigurable
{
// Tools delegate. Recreated for every test. See setup(...)
WSContractConsumer consumer;
@@ -49,6 +50,10 @@
boolean toogleMessageOut =
Boolean.getBoolean(WSConsumerPlugin.class.getName()+".verbose");
private File workDirectory;
+
+ protected boolean integrationNative;
+ protected boolean integrationMetro;
+ protected boolean integrationCXF;
public WSConsumerPlugin()
@@ -272,11 +277,11 @@
consumer.setTarget("2.1");
consumer.setNoCompile(false);
- //this test is run in binary distribution mode only because the way Maven builds
classpath doesn't allow to run the
- //wsimport tool in Native stack from a Surefire test (the jaxws classes are of
course loaded from the included
+ //with Native stack, this test is run in binary distribution mode only because the
way Maven builds classpath doesn't allow
+ //to run the wsimport tool in Native stack from a Surefire test (the jaxws classes
are of course loaded from the included
//jaxws source module and that causes the Sun's ParallelWorldClassLoader to
throw an exception as EndpointReference
//is not loaded from a jar resource)
- if (Boolean.getBoolean("binary.distribution"))
+ if (!isIntegrationNative() || Boolean.getBoolean("binary.distribution"))
{
consumeWSDL();
ClassLoader loader = getArtefactClassLoader();
@@ -346,4 +351,37 @@
return loader;
}
+
+ @Override
+ public boolean isIntegrationNative()
+ {
+ return integrationNative;
+ }
+
+ @Override
+ public boolean isIntegrationMetro()
+ {
+ return integrationMetro;
+ }
+
+ @Override
+ public boolean isIntegrationCXF()
+ {
+ return integrationCXF;
+ }
+
+ public void setIntegrationNative(boolean integrationNative)
+ {
+ this.integrationNative = integrationNative;
+ }
+
+ public void setIntegrationMetro(boolean integrationMetro)
+ {
+ this.integrationMetro = integrationMetro;
+ }
+
+ public void setIntegrationCXF(boolean integrationCXF)
+ {
+ this.integrationCXF = integrationCXF;
+ }
}
Modified:
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/smoke/tools/WSConsumerTestCase.java
===================================================================
---
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/smoke/tools/WSConsumerTestCase.java 2009-02-03
10:43:19 UTC (rev 9218)
+++
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/smoke/tools/WSConsumerTestCase.java 2009-02-03
11:20:15 UTC (rev 9219)
@@ -26,6 +26,7 @@
* NOTE: All tests expect to be executed below 'output/tests'.
*
* @author Heiko.Braun(a)jboss.com
+ * @author alessio.soldano(a)jboss.com
*/
public class WSConsumerTestCase extends PluginBase implements WSConsumerPluginDelegate
{
@@ -40,8 +41,8 @@
// JBWS-2175
setupClasspath();
- Class wscClass =
Thread.currentThread().getContextClassLoader().loadClass("org.jboss.test.ws.jaxws.smoke.tools.WSConsumerPlugin");
- delegate = wscClass.newInstance();
+ Class<?> wscClass =
Thread.currentThread().getContextClassLoader().loadClass("org.jboss.test.ws.jaxws.smoke.tools.WSConsumerPlugin");
+ setDelegate(wscClass);
}
Modified:
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/smoke/tools/WSProviderTestCase.java
===================================================================
---
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/smoke/tools/WSProviderTestCase.java 2009-02-03
10:43:19 UTC (rev 9218)
+++
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/smoke/tools/WSProviderTestCase.java 2009-02-03
11:20:15 UTC (rev 9219)
@@ -35,9 +35,9 @@
setupClasspath();
- Class wspClass = Thread.currentThread().getContextClassLoader()
+ Class<?> wspClass = Thread.currentThread().getContextClassLoader()
.loadClass("org.jboss.test.ws.jaxws.smoke.tools.WSProviderPlugin");
- delegate = wspClass.newInstance();
+ setDelegate(wspClass);
}