/*
 * JBoss, the OpenSource J2EE webOS
 *
 * Distributable under LGPL license.
 * See terms of license at gnu.org.
 */
package org.jboss.test.webservice.jbws217;

// $Id: JBWS217TestCase.java,v 1.1.2.2 2005/06/09 13:07:11 tdiesler Exp $

import junit.framework.Test;
import org.jboss.test.webservice.WebserviceTestBase;

import javax.naming.InitialContext;
import javax.xml.rpc.Service;

/** Test mapping of primitive types in jaxrpc-mapping.xml
 *
 * http://jira.jboss.com/jira/browse/JBWS-217
 *
 * @author Thomas.Diesler@jboss.org
 * @since 09-Jun-2005
 */
public class JBWS217TestCase extends WebserviceTestBase
{
   /** Construct the test case with a given name
    */
   public JBWS217TestCase(String name)
   {
      super(name);
   }

   /** Deploy the test */
   public static Test suite() throws Exception
   {
      return getDeploySetup(JBWS217TestCase.class, "ws4ee-jbws217.war, ws4ee-jbws217-client.jar");
   }

   /**
    * Test JSE endpoint
    */
   public void testEndpoint() throws Exception
   {
      InitialContext iniCtx = getClientContext();
      Service service = (Service)iniCtx.lookup("java:comp/env/service/HelloService");
      Hello hello = (Hello)service.getPort(Hello.class);

      int in0 = 100;
      int retObj = hello.hello(in0);
      assertEquals(in0, retObj);
   }
}
