Author: thomas.diesler(a)jboss.com
Date: 2007-08-10 09:31:26 -0400 (Fri, 10 Aug 2007)
New Revision: 4311
Modified:
stack/native/branches/native-2.0/src/test/java/org/jboss/test/ws/jaxws/jbws1733/JBWS1733Impl.java
stack/native/branches/native-2.0/src/test/java/org/jboss/test/ws/jaxws/jbws1733/JBWS1733TestCase.java
Log:
Layout code using JBossWSCodeStyle.xml
Modified:
stack/native/branches/native-2.0/src/test/java/org/jboss/test/ws/jaxws/jbws1733/JBWS1733Impl.java
===================================================================
---
stack/native/branches/native-2.0/src/test/java/org/jboss/test/ws/jaxws/jbws1733/JBWS1733Impl.java 2007-08-10
09:49:23 UTC (rev 4310)
+++
stack/native/branches/native-2.0/src/test/java/org/jboss/test/ws/jaxws/jbws1733/JBWS1733Impl.java 2007-08-10
13:31:26 UTC (rev 4311)
@@ -21,36 +21,39 @@
*/
package org.jboss.test.ws.jaxws.jbws1733;
+import javax.annotation.Resource;
import javax.jws.WebService;
-import javax.annotation.Resource;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpSession;
import javax.xml.ws.WebServiceContext;
import javax.xml.ws.WebServiceException;
import javax.xml.ws.handler.MessageContext;
-import javax.servlet.http.HttpSession;
-import javax.servlet.http.HttpServletRequest;
-@WebService(name="JBWS1733", serviceName="JBWS1733Service",
endpointInterface="org.jboss.test.ws.jaxws.jbws1733.JBWS1733")
+@WebService(name = "JBWS1733", serviceName = "JBWS1733Service",
endpointInterface = "org.jboss.test.ws.jaxws.jbws1733.JBWS1733")
public class JBWS1733Impl implements JBWS1733
{
-
+
@Resource
private WebServiceContext wsContext;
-
+
public int getCounter()
{
- MessageContext mc = wsContext.getMessageContext();
- HttpSession session =
((HttpServletRequest)mc.get(MessageContext.SERVLET_REQUEST)).getSession();
- // Get a session property "counter" from context
- if (session == null)
- throw new WebServiceException("No session in WebServiceContext");
- Integer counter = (Integer)session.getAttribute("counter");
- if (counter == null) {
- counter = new Integer(0);
- System.out.println("Starting the Session");
- }
- counter = new Integer(counter.intValue() + 1);
- session.setAttribute("counter", counter);
- return counter;
+ MessageContext mc = wsContext.getMessageContext();
+ HttpSession session =
((HttpServletRequest)mc.get(MessageContext.SERVLET_REQUEST)).getSession();
+
+ // Get a session property "counter" from context
+ if (session == null)
+ throw new WebServiceException("No session in WebServiceContext");
+
+ Integer counter = (Integer)session.getAttribute("counter");
+ if (counter == null)
+ {
+ counter = new Integer(0);
+ System.out.println("Starting the Session");
+ }
+ counter = new Integer(counter.intValue() + 1);
+ session.setAttribute("counter", counter);
+ return counter;
}
}
Modified:
stack/native/branches/native-2.0/src/test/java/org/jboss/test/ws/jaxws/jbws1733/JBWS1733TestCase.java
===================================================================
---
stack/native/branches/native-2.0/src/test/java/org/jboss/test/ws/jaxws/jbws1733/JBWS1733TestCase.java 2007-08-10
09:49:23 UTC (rev 4310)
+++
stack/native/branches/native-2.0/src/test/java/org/jboss/test/ws/jaxws/jbws1733/JBWS1733TestCase.java 2007-08-10
13:31:26 UTC (rev 4311)
@@ -24,8 +24,8 @@
import java.net.URL;
import javax.xml.namespace.QName;
-import javax.xml.ws.Service;
import javax.xml.ws.BindingProvider;
+import javax.xml.ws.Service;
import junit.framework.Test;
@@ -47,7 +47,7 @@
{
return new JBossWSTestSetup(JBWS1733TestCase.class,
"jaxws-jbws1733.war");
}
-
+
@Override
protected void setUp() throws Exception
{
@@ -59,14 +59,13 @@
Service service = Service.create(wsdlURL, serviceName);
proxy = (JBWS1733)service.getPort(JBWS1733.class);
}
-
- public void testIssue() throws Exception {
- ((BindingProvider)proxy)
- .getRequestContext()
- .put(BindingProvider.SESSION_MAINTAIN_PROPERTY,true);
- for ( int i = 1; i <= 10; i++ ) {
- assertTrue( proxy.getCounter() == i );
+ public void testIssue() throws Exception
+ {
+
((BindingProvider)proxy).getRequestContext().put(BindingProvider.SESSION_MAINTAIN_PROPERTY,
true);
+ for (int i = 1; i <= 10; i++)
+ {
+ assertTrue(proxy.getCounter() == i);
}
}
Show replies by date