KickJava   Java API By Example, From Geeks To Geeks.

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


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.engine.AxisConfigurationImpl;
21
22 import java.io.FileInputStream JavaDoc;
23 import java.io.FileNotFoundException JavaDoc;
24 import java.io.InputStream JavaDoc;
25
26 public class BadModuleTest extends AbstractTestCase {
27     /**
28      * Constructor.
29      */

30     public BadModuleTest(String JavaDoc testName) {
31         super(testName);
32     }
33
34     public void testBadModuleXML() {
35         try {
36             InputStream JavaDoc in = new FileInputStream JavaDoc(getTestResourceFile("deployment/Badmodule.xml"));
37             DeploymentParser parser = new DeploymentParser(in, null);
38             AxisConfigurationImpl glabl = new AxisConfigurationImpl();
39             parser.processGlobalConfig(glabl,DeploymentConstants.AXIS2CONFIG);
40             fail("this must failed gracefully with DeploymentException or FileNotFoundException");
41         } catch (FileNotFoundException JavaDoc e) {
42             return;
43         } catch (DeploymentException e) {
44             return;
45         } catch (Exception JavaDoc e) {
46             return;
47         }
48
49     }
50 }
51
Popular Tags