01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one
03: * or more contributor license agreements. See the NOTICE file
04: * distributed with this work for additional information
05: * regarding copyright ownership. The ASF licenses this file
06: * to you under the Apache License, Version 2.0 (the
07: * "License"); you may not use this file except in compliance
08: * with the License. You may obtain a copy of the License at
09: *
10: * http://www.apache.org/licenses/LICENSE-2.0
11: *
12: * Unless required by applicable law or agreed to in writing,
13: * software distributed under the License is distributed on an
14: * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15: * KIND, either express or implied. See the License for the
16: * specific language governing permissions and limitations
17: * under the License.
18: */
19:
20: package org.apache.axis2.deployment;
21:
22: import org.apache.axis2.AbstractTestCase;
23: import org.apache.axis2.AxisFault;
24:
25: import java.io.File;
26:
27: public class BuilderSelectorDeploymentTest extends AbstractTestCase {
28: /**
29: * Constructor.
30: */
31: public BuilderSelectorDeploymentTest(String testName) {
32: super (testName);
33: }
34:
35: public void testBuilderSelection() throws AxisFault {
36: // String repositoryName =System.getProperty("basedir",".")+"/"+"target/test-resources/deployment";
37: // File repo = new File(repositoryName);
38: // String xmlFile = System.getProperty("basedir",".")+"/"+"test-resources/deployment/builderSelectorTest/axis2.xml";
39: // File xml = new File(xmlFile);
40: // FileSystemConfigurator fsc = new FileSystemConfigurator(repo.getAbsolutePath(), xml.getAbsolutePath());
41: // AxisConfiguration axisConfig = fsc.getAxisConfiguration();
42: // String className = axisConfig.getMessageBuilder("text/xml").getClass().getName();
43: // assertEquals(className,"org.apache.axiom.om.impl.builder.StAXOMBuilder");
44: // className = axisConfig.getMessageBuilder("application/soap+xml").getClass().getName();
45: // assertEquals(className,"org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder");
46: }
47:
48: public void testBuilderSelectionInvalidEntry() throws AxisFault {
49: String repositoryName = System.getProperty("basedir", ".")
50: + "/" + "target/test-resources/deployment";
51: File repo = new File(repositoryName);
52: String xmlFile = System.getProperty("basedir", ".")
53: + "/"
54: + "test-resources/deployment/builderSelectorTest/bad-axis2.xml";
55: File xml = new File(xmlFile);
56: FileSystemConfigurator fsc = new FileSystemConfigurator(repo
57: .getAbsolutePath(), xml.getAbsolutePath());
58: AxisFault testFault = null;
59: try {
60: fsc.getAxisConfiguration();
61: } catch (AxisFault e) {
62: testFault = e;
63: }
64: assertNotNull(testFault);
65: }
66: }
|