Author: alessio.soldano(a)jboss.com
Date: 2008-05-01 08:20:20 -0400 (Thu, 01 May 2008)
New Revision: 6833
Added:
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/news/NewsTestCase.java
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/news/SecureNewsTestCase.java
Modified:
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/dar/JMSClientTestCase.java
Log:
[JBWS-2030] Adding news test cases
Modified:
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/dar/JMSClientTestCase.java
===================================================================
---
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/dar/JMSClientTestCase.java 2008-05-01
10:51:23 UTC (rev 6832)
+++
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/dar/JMSClientTestCase.java 2008-05-01
12:20:20 UTC (rev 6833)
@@ -35,7 +35,7 @@
import org.jboss.wsf.test.JBossWSTestSetup;
/**
- * DAR client; invokes the DAR JMS endpoint
+ * Invokes the DAR JMS client
* (this is actually a weak test since we don't check if the
* response queue actually receives the response)
*
Added:
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/news/NewsTestCase.java
===================================================================
---
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/news/NewsTestCase.java
(rev 0)
+++
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/news/NewsTestCase.java 2008-05-01
12:20:20 UTC (rev 6833)
@@ -0,0 +1,66 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., 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.ws.jaxws.samples.news;
+
+//$Id$
+
+import java.net.URL;
+
+import junit.framework.Test;
+
+import org.jboss.wsf.test.JBossWSTest;
+import org.jboss.wsf.test.JBossWSTestSetup;
+
+/**
+ * Tests press agency and printer
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 01-May-2008
+ */
+public class NewsTestCase extends JBossWSTest
+{
+ public static Test suite()
+ {
+ return new JBossWSTestSetup(NewsTestCase.class,
"jaxws-samples-news-step1-newspaper.jar");
+ }
+
+ public void testAgency() throws Exception
+ {
+ URL wsdlURL = new URL("http://" + getServerHost() +
":8080/news/pressRelease?wsdl");
+ Agency agency = new Agency(wsdlURL);
+ agency.run("Press release title", "Press release body");
+ }
+
+ public void testPrinterSwa() throws Exception
+ {
+ URL wsdlURL = new URL("http://" + getServerHost() +
":8080/news/newspaper/swa?wsdl");
+ Printer printer = new Printer(wsdlURL, false);
+ printer.run();
+ }
+
+ public void testPrinterMTOM() throws Exception
+ {
+ URL wsdlURL = new URL("http://" + getServerHost() +
":8080/news/newspaper/mtom?wsdl");
+ Printer printer = new Printer(wsdlURL, true);
+ printer.run();
+ }
+}
Property changes on:
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/news/NewsTestCase.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/news/SecureNewsTestCase.java
===================================================================
---
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/news/SecureNewsTestCase.java
(rev 0)
+++
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/news/SecureNewsTestCase.java 2008-05-01
12:20:20 UTC (rev 6833)
@@ -0,0 +1,76 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., 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.ws.jaxws.samples.news;
+
+//$Id$
+
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.net.URLClassLoader;
+
+import junit.framework.Test;
+
+import org.jboss.wsf.test.JBossWSTest;
+import org.jboss.wsf.test.JBossWSTestHelper;
+import org.jboss.wsf.test.JBossWSTestSetup;
+
+/**
+ * Tests secure press agency
+ * (secure printer cannot be tested since it requires
+ * keystore & trustore in jboss-web tomcat configuration)
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 01-May-2008
+ */
+public class SecureNewsTestCase extends JBossWSTest
+{
+ public static Test suite()
+ {
+ addClientConfToClasspath("jaxws-samples-news-step2-agency.jar"); //this
way the ws-security conf is available
+ return new JBossWSTestSetup(SecureNewsTestCase.class,
"jaxws-samples-news-step2-newspaper.jar");
+ }
+
+ public void testAgency() throws Exception
+ {
+ URL wsdlURL = new URL("http://" + getServerHost() +
":8080/news/pressRelease?wsdl");
+ SecureAgency agency = new SecureAgency(wsdlURL);
+ agency.run("Press release title", "Press release body");
+ }
+
+
+ protected static void addClientConfToClasspath(String s)
+ {
+ try
+ {
+ // wrap the classloader upfront to allow inclusion of the client.jar
+ JBossWSTestHelper helper = new JBossWSTestHelper();
+ ClassLoader parent = Thread.currentThread().getContextClassLoader();
+ URLClassLoader replacement = new URLClassLoader(new URL[] {
helper.getArchiveFile(s).toURL() }, parent);
+ Thread.currentThread().setContextClassLoader(replacement);
+
+ }
+ catch (MalformedURLException e)
+ {
+ throw new IllegalStateException(e);
+ }
+ }
+}
Property changes on:
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/news/SecureNewsTestCase.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF