KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > test > webservice > version > VersionTestCase


1 /*
2  * JBoss, the OpenSource J2EE webOS
3  *
4  * Distributable under LGPL license.
5  * See terms of license at gnu.org.
6  */

7 package org.jboss.test.webservice.version;
8
9 // $Id: VersionTestCase.java,v 1.1.2.2 2005/03/04 22:11:54 tdiesler Exp $
10

11 import junit.framework.Test;
12 import org.jboss.test.webservice.WebserviceTestBase;
13
14 import javax.naming.InitialContext JavaDoc;
15 import javax.xml.rpc.Service JavaDoc;
16
17 /**
18  * Test access to the /ws4ee/services/Version service
19  *
20  * @author Thomas.Diesler@jboss.org
21  * @since 08-Feb-2005
22  */

23 public class VersionTestCase extends WebserviceTestBase
24 {
25    /** Construct the test case with a given name
26     */

27    public VersionTestCase(String JavaDoc name)
28    {
29       super(name);
30    }
31
32    /** Deploy the test */
33    public static Test suite() throws Exception JavaDoc
34    {
35       return getDeploySetup(VersionTestCase.class, "ws4ee-version-client.jar");
36    }
37
38    /**
39     * Test JSE endpoint
40     */

41    public void testEndpoint() throws Exception JavaDoc
42    {
43       InitialContext JavaDoc iniCtx = getClientContext();
44       Service JavaDoc service = (Service JavaDoc)iniCtx.lookup("java:comp/env/service/VersionService");
45       Version port = (Version)service.getPort(Version.class);
46
47       String JavaDoc versionStr = port.getVersion();
48       System.out.println("Version: " + versionStr);
49       assertNotNull(versionStr);
50    }
51 }
52
Popular Tags