KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > axis2 > deployment > BuildERWithDeploymentTest


1 /*
2  * Copyright 2004,2005 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16  
17 package org.apache.axis2.deployment;
18
19 import org.apache.axis2.AbstractTestCase;
20 import org.apache.axis2.context.ConfigurationContextFactory;
21 import org.apache.axis2.description.Flow;
22 import org.apache.axis2.description.OperationDescription;
23 import org.apache.axis2.description.ServiceDescription;
24 import org.apache.axis2.engine.AxisConfiguration;
25
26 import javax.xml.namespace.QName JavaDoc;
27
28 public class BuildERWithDeploymentTest extends AbstractTestCase {
29     /**
30      * @param testName
31      */

32     public BuildERWithDeploymentTest(String JavaDoc testName) {
33         super(testName);
34     }
35
36     public void testDeployment() throws Exception JavaDoc {
37         String JavaDoc filename = "./target/test-resources/deployment";
38         ConfigurationContextFactory builder = new ConfigurationContextFactory();
39         AxisConfiguration er = builder.buildConfigurationContext(filename).getAxisConfiguration();
40
41         assertNotNull(er);
42         ServiceDescription service = er.getService(new QName JavaDoc("service2"));
43         assertNotNull(service);
44         //commentd since there is no service based messgeRecivers
45
/*MessageReceiver provider = service.getMessageReceiver();
46         assertNotNull(provider);
47         assertTrue(provider instanceof RawXMLINOutMessageReceiver);*/

48         ClassLoader JavaDoc cl = service.getClassLoader();
49         assertNotNull(cl);
50         Class.forName("Echo2", true, cl);
51         assertNotNull(service.getName());
52        //no style for the service
53
// assertEquals(service.getStyle(),"rpc");
54

55         Flow flow = service.getFaultInFlow();
56         assertTrue(flow.getHandlerCount() > 0);
57         flow = service.getInFlow();
58         assertTrue(flow.getHandlerCount() > 0);
59         flow = service.getOutFlow();
60         assertTrue( flow.getHandlerCount() > 0);
61         assertNotNull(service.getParameter("para2"));
62
63         OperationDescription op = service.getOperation(new QName JavaDoc("opname"));
64         assertNotNull(op);
65
66     }
67 }
68
Popular Tags