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: */package org.apache.cxf.systest.jaxb;
19:
20: import org.apache.cxf.systest.jaxb.model.ExtendedWidget;
21: import org.apache.cxf.systest.jaxb.model.Widget;
22: import org.apache.cxf.systest.jaxb.service.TestService;
23: import org.junit.Test;
24: import org.springframework.test.AbstractDependencyInjectionSpringContextTests;
25:
26: public class TestServiceTest extends
27: AbstractDependencyInjectionSpringContextTests {
28:
29: private TestService testClient;
30:
31: public TestServiceTest() {
32: setAutowireMode(AbstractDependencyInjectionSpringContextTests.AUTOWIRE_BY_NAME);
33: }
34:
35: @Test
36: public void testExtraSubClassWithJaxb() throws Throwable {
37:
38: Widget expected = new ExtendedWidget(42, "blah", "blah", true,
39: true);
40:
41: Widget widgetFromService = testClient.getWidgetById((long) 42);
42:
43: assertEquals(expected, widgetFromService);
44:
45: }
46:
47: /*
48: * (non-Javadoc)
49: *
50: * @see org.springframework.test.AbstractSingleSpringContextTests#getConfigLocations()
51: */
52: @Override
53: protected String[] getConfigLocations() {
54: return new String[] { "classpath:extrajaxbclass.xml" };
55: }
56:
57: /**
58: * @return the testClient
59: */
60: public TestService getTestClient() {
61: return testClient;
62: }
63:
64: /**
65: * @param testClient the testClient to set
66: */
67: public void setTestClient(TestService testClient) {
68: this.testClient = testClient;
69: }
70:
71: }
|