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: package org.apache.axis2.deployment;
20:
21: import junit.framework.TestCase;
22: import org.apache.axis2.AbstractTestCase;
23: import org.apache.axis2.deployment.deployers.CustomDeployer;
24: import org.apache.axis2.context.ConfigurationContextFactory;
25: import org.apache.axis2.engine.AxisConfiguration;
26:
27: public class CustomDeployerTest extends TestCase {
28: public void testCustomDeployer() throws Exception {
29: String filename = AbstractTestCase.basedir
30: + "/test-resources/deployment/CustomDeployerRepo";
31: AxisConfiguration axisConfig = ConfigurationContextFactory
32: .createConfigurationContextFromFileSystem(filename)
33: .getAxisConfiguration();
34:
35: // OK, let's see what we've got here...
36: assertTrue("Init was not called", CustomDeployer.initCalled);
37: assertEquals("Wrong directory", "widgets",
38: CustomDeployer.directory);
39: assertEquals("Wrong extension", "svc", CustomDeployer.extension);
40: assertEquals("Wrong number of deployed items", 2,
41: CustomDeployer.deployedItems);
42: assertTrue("George wasn't found", CustomDeployer.georgeDeployed);
43: assertTrue("Mary wasn't found", CustomDeployer.maryDeployed);
44:
45: assertEquals("Parameter not set correctly",
46: CustomDeployer.PARAM_VAL, axisConfig
47: .getParameterValue(CustomDeployer.PARAM_NAME));
48: }
49: }
|