KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > axis2 > engine > ModuleEngageTest


1 package org.apache.axis2.engine;
2
3 import junit.framework.TestCase;
4 import org.apache.axis2.context.ConfigurationContextFactory;
5 import org.apache.axis2.deployment.DeploymentException;
6 import org.apache.axis2.description.ModuleDescription;
7 import org.apache.axis2.description.OperationDescription;
8 import org.apache.axis2.description.ServiceDescription;
9 import org.apache.axis2.phaseresolver.PhaseException;
10
11 import javax.xml.namespace.QName JavaDoc;
12 import javax.xml.stream.XMLStreamException;
13
14 /*
15 * Copyright 2004,2005 The Apache Software Foundation.
16 *
17 * Licensed under the Apache License, Version 2.0 (the "License");
18 * you may not use this file except in compliance with the License.
19 * You may obtain a copy of the License at
20 *
21 * http://www.apache.org/licenses/LICENSE-2.0
22 *
23 * Unless required by applicable law or agreed to in writing, software
24 * distributed under the License is distributed on an "AS IS" BASIS,
25 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
26 * See the License for the specific language governing permissions and
27 * limitations under the License.
28 *
29 *
30 */

31
32 /**
33  * Author : Deepal Jayasinghe
34  * Date: Jun 21, 2005
35  * Time: 2:09:04 PM
36  */

37 public class ModuleEngageTest extends TestCase{
38     AxisConfiguration ac;
39
40     public void testModuleEngageMent() throws PhaseException, DeploymentException, AxisFault, XMLStreamException {
41         String JavaDoc filename = "./target/test-resources/deployment";
42         ConfigurationContextFactory builder = new ConfigurationContextFactory();
43         ac = builder.buildConfigurationContext(filename).getAxisConfiguration();
44         ModuleDescription module = ac.getModule(new QName JavaDoc("module1"));
45         assertNotNull(module);
46         ac.engageModule(new QName JavaDoc("module1"));
47         ServiceDescription service = ac.getService(new QName JavaDoc("service2"));
48         assertNotNull(service);
49         OperationDescription moduleOperation = service.getOperation(new QName JavaDoc("creatSeq"));
50         assertNotNull(moduleOperation);
51     }
52
53 }
54
Popular Tags