[jboss-cvs] jbosstest/src/main/org/jboss/test/webservice/jbws1034 ...
Alex Guizar
alex.guizar at jboss.com
Sun Jul 16 19:23:39 EDT 2006
User: aguizar
Date: 06/07/16 19:23:39
Added: src/main/org/jboss/test/webservice/jbws1034 Tag:
JBoss_4_0_2_JBWS-1034 Echoer.java
JBWS1034TestCase.java
Log:
JBWS-1034
Revision Changes Path
No revision
No revision
1.1.2.1 +9 -0 jbosstest/src/main/org/jboss/test/webservice/jbws1034/Attic/Echoer.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: Echoer.java
===================================================================
RCS file: Echoer.java
diff -N Echoer.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ Echoer.java 16 Jul 2006 23:23:39 -0000 1.1.2.1
@@ -0,0 +1,9 @@
+package org.jboss.test.webservice.jbws1034;
+
+import java.rmi.Remote;
+import java.rmi.RemoteException;
+
+public interface Echoer extends Remote {
+
+ public String echo(String text) throws RemoteException;
+}
1.1.2.1 +65 -0 jbosstest/src/main/org/jboss/test/webservice/jbws1034/Attic/JBWS1034TestCase.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: JBWS1034TestCase.java
===================================================================
RCS file: JBWS1034TestCase.java
diff -N JBWS1034TestCase.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ JBWS1034TestCase.java 16 Jul 2006 23:23:39 -0000 1.1.2.1
@@ -0,0 +1,65 @@
+/*
+ * JBoss, the OpenSource J2EE webOS
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package org.jboss.test.webservice.jbws1034;
+
+// $Id: JBWS1034TestCase.java,v 1.1.2.1 2006/07/16 23:23:39 aguizar Exp $
+
+import javax.naming.InitialContext;
+import javax.xml.rpc.Service;
+
+import junit.framework.Test;
+
+import org.jboss.test.webservice.WebserviceTestBase;
+import org.jboss.test.webservice.jbws1034.client.CharsetHandler;
+
+/** Test encoding property is correctly applied
+ *
+ * @author Alejandro Guizar
+ * @since 11-Jul-2006
+ * @see http://jira.jboss.com/jira/browse/JBWS-1034
+ */
+public class JBWS1034TestCase extends WebserviceTestBase
+{
+ private Echoer echoer;
+
+ /** Construct the test case with a given name
+ */
+ public JBWS1034TestCase(String name)
+ {
+ super(name);
+ }
+
+ /** Deploy the test */
+ public static Test suite() throws Exception
+ {
+ return getDeploySetup(JBWS1034TestCase.class, "ws4ee-jbws1034.war, ws4ee-jbws1034-client.jar");
+ }
+
+ protected void setUp() throws Exception
+ {
+ InitialContext iniContext = getClientContext();
+ Service echoerService = (Service) iniContext.lookup("java:comp/env/service/Echoer");
+ echoer = (Echoer) echoerService.getPort(Echoer.class);
+ }
+
+ public void testDefaultEncoding() throws Exception
+ {
+ final String text = "jalapeño";
+ assertEquals(text, echoer.echo(text));
+ assertEquals("utf-8", CharsetHandler.getCurrentCharset());
+ }
+
+ public void testCustomEncoding() throws Exception
+ {
+ final String charset = "windows-1252";
+ CharsetHandler.setCurrentCharset(charset);
+
+ final String text = "jalapeño";
+ assertEquals(text, echoer.echo(text));
+ assertEquals(charset, CharsetHandler.getCurrentCharset());
+ }
+}
\ No newline at end of file
More information about the jboss-cvs-commits
mailing list