KickJava   Java API By Example, From Geeks To Geeks.

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


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

24
25 /**
26  * Author : Deepal Jayasinghe
27  * Date: May 16, 2005
28  * Time: 12:13:53 PM
29  */

30 public class InvalidServiceTest extends TestCase {
31     /**
32      * This is used to test whether service specific module try to add handlers to system pre defined phases
33      */

34
35     AxisConfiguration er;
36
37     public void testInvalidService() {
38         try {
39             String JavaDoc filename = "./target/test-resources/InvalidDeployment";
40             ConfigurationContextFactory builder = new ConfigurationContextFactory();
41             er = builder.buildConfigurationContext(filename).getAxisConfiguration();
42             String JavaDoc msg = (String JavaDoc) er.getFaulytServices().get("invalidService");
43             if (msg == null || msg.equals("")) {
44                 fail("this must failed gracefully with AxisFault ervice specifi module can not" +
45                         "refer system pre defined phases");
46             }
47         } catch (DeploymentException e) {
48             return;
49         }
50     }
51 }
52
Popular Tags