1 7 8 10 package org.jboss.test.jbossnet.external; 11 12 import junit.framework.Test; 13 import org.jboss.test.jbossnet.JBossNetTestBase; 14 15 import javax.xml.namespace.QName ; 16 import java.net.URL ; 17 18 24 public class ExternalUnitTestCase extends JBossNetTestBase 25 { 26 private QName FEDERATED_SERVICE = new QName ("http://" + getServerHost() + ":8080/jboss-net/services/FederatedService", "FederatedServiceLocalService"); 27 28 public ExternalUnitTestCase(String name) 30 { 31 super(name); 32 } 33 34 35 FederatedService federation; 36 37 38 public void setUp() throws Exception 39 { 40 super.setUp(); 41 URL wsdlURL = new URL (SERVICES_LOCATION + "/FederatedService?wsdl"); 42 federation = (FederatedService)createService(wsdlURL, FEDERATED_SERVICE).getPort(FederatedService.class); 43 } 44 45 46 public void testFederated() throws Exception 47 { 48 String result = federation.findAndTranslate("JBoss is a killer server and Mr. Fleury is a damned genius"); 49 assertNotNull("Result is null", result); 50 System.out.println("Result: " + result); 51 String shittimes = "This service is currently disabled."; 52 assertTrue(result, result.indexOf("JBoss") >= 0 || shittimes.equals(result)); 53 } 54 55 56 protected String getAxisConfiguration() 57 { 58 return "jbossnet/external/client/client-config.wsdd"; 59 } 60 61 62 public static Test suite() throws Exception 63 { 64 return getDeploySetup(ExternalUnitTestCase.class, "jbossnet-external.ear"); 65 } 66 67 public static void main(String [] args) 68 { 69 junit.textui.TestRunner.run(ExternalUnitTestCase.class); 70 } 71 } 72 | Popular Tags |