pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/apache/axis-axis2-java-core/commit/c9a2c4e41c369f9ff349ca2d13c1a8fc7d8eaafe

AXIS2-5335 - applying test cases patch for codegen module. · apache/axis-axis2-java-core@c9a2c4e · GitHub
Skip to content

Commit c9a2c4e

Browse files
author
Sagara Gunathunga
committed
AXIS2-5335 - applying test cases patch for codegen module.
1 parent 0f45146 commit c9a2c4e

File tree

13 files changed

+885
-5
lines changed

13 files changed

+885
-5
lines changed

modules/codegen/pom.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,11 @@
7777
<artifactId>jaxws-rt</artifactId>
7878
<scope>test</scope>
7979
</dependency>
80+
<dependency>
81+
<groupId>xmlunit</groupId>
82+
<artifactId>xmlunit</artifactId>
83+
<scope>test</scope>
84+
</dependency>
8085
</dependencies>
8186
<url>http://axis.apache.org/axis2/java/core/</url>
8287
<scm>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.w3schools.com" attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://www.w3schools.com">
3+
<xs:element name="note">
4+
<xs:complexType>
5+
<xs:sequence>
6+
<xs:element name="to" type="xs:string"/>
7+
<xs:element name="from" type="xs:string"/>
8+
<xs:element name="heading" type="xs:string"/>
9+
<xs:element name="body" type="xs:string"/>
10+
</xs:sequence>
11+
</xs:complexType>
12+
</xs:element>
13+
</xs:schema>
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<!--
2+
~ Licensed to the Apache Software Foundation (ASF) under one
3+
~ or more contributor license agreements. See the NOTICE file
4+
~ distributed with this work for additional information
5+
~ regarding copyright ownership. The ASF licenses this file
6+
~ to you under the Apache License, Version 2.0 (the
7+
~ "License"); you may not use this file except in compliance
8+
~ with the License. You may obtain a copy of the License at
9+
~
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+
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns0="http://test2.com" xmlns:tns="http://test.com" attributeFormDefault="unqualified" elementFormDefault="unqualified" targetNamespace="http://test.com">
21+
<xsd:import namespace="http://test2.com"/>
22+
<xsd:element name="testElement6" type="ns0:testComplexType2"/>
23+
<xsd:element name="testElement1">
24+
<xsd:complexType>
25+
<xsd:sequence/>
26+
</xsd:complexType>
27+
</xsd:element>
28+
<xsd:complexType name="testComplexType2">
29+
<xsd:sequence/>
30+
</xsd:complexType>
31+
</xsd:schema>
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<!--
2+
~ Licensed to the Apache Software Foundation (ASF) under one
3+
~ or more contributor license agreements. See the NOTICE file
4+
~ distributed with this work for additional information
5+
~ regarding copyright ownership. The ASF licenses this file
6+
~ to you under the Apache License, Version 2.0 (the
7+
~ "License"); you may not use this file except in compliance
8+
~ with the License. You may obtain a copy of the License at
9+
~
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+
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://test2.com" attributeFormDefault="unqualified" elementFormDefault="unqualified" targetNamespace="http://test2.com">
21+
<xsd:complexType name="testComplexType2">
22+
<xsd:sequence/>
23+
</xsd:complexType>
24+
</xsd:schema>
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<!--
2+
~ Licensed to the Apache Software Foundation (ASF) under one
3+
~ or more contributor license agreements. See the NOTICE file
4+
~ distributed with this work for additional information
5+
~ regarding copyright ownership. The ASF licenses this file
6+
~ to you under the Apache License, Version 2.0 (the
7+
~ "License"); you may not use this file except in compliance
8+
~ with the License. You may obtain a copy of the License at
9+
~
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+
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns1="http://test.com" xmlns:tns="http://test1.com" attributeFormDefault="unqualified" elementFormDefault="unqualified" targetNamespace="http://test1.com">
21+
<xsd:import namespace="http://test.com"/>
22+
<xsd:element name="testElement5" type="ns1:testComplexType2"/>
23+
<xsd:element name="testElement4" type="tns:testComplexType1"/>
24+
<xsd:element name="testElement3" type="xsd:string"/>
25+
<xsd:element name="testElement2">
26+
<xsd:complexType>
27+
<xsd:sequence/>
28+
</xsd:complexType>
29+
</xsd:element>
30+
<xsd:complexType name="testComplexType1">
31+
<xsd:sequence/>
32+
</xsd:complexType>
33+
</xsd:schema>
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<?xml version="1.0"?>
2+
3+
<!--
4+
~ Licensed to the Apache Software Foundation (ASF) under one
5+
~ or more contributor license agreements. See the NOTICE file
6+
~ distributed with this work for additional information
7+
~ regarding copyright ownership. The ASF licenses this file
8+
~ to you under the Apache License, Version 2.0 (the
9+
~ "License"); you may not use this file except in compliance
10+
~ with the License. You may obtain a copy of the License at
11+
~
12+
~ http://www.apache.org/licenses/LICENSE-2.0
13+
~
14+
~ Unless required by applicable law or agreed to in writing,
15+
~ software distributed under the License is distributed on an
16+
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17+
~ KIND, either express or implied. See the License for the
18+
~ specific language governing permissions and limitations
19+
~ under the License.
20+
-->
21+
22+
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
23+
targetNamespace="http://www.w3schools.com"
24+
xmlns="http://www.w3schools.com"
25+
elementFormDefault="qualified">
26+
27+
<xs:element name="note">
28+
<xs:complexType>
29+
<xs:sequence>
30+
<xs:element name="to" type="xs:string"/>
31+
<xs:element name="from" type="xs:string"/>
32+
<xs:element name="heading" type="xs:string"/>
33+
<xs:element name="body" type="xs:string"/>
34+
</xs:sequence>
35+
</xs:complexType>
36+
</xs:element>
37+
38+
</xs:schema>
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<!--
2+
~ Licensed to the Apache Software Foundation (ASF) under one
3+
~ or more contributor license agreements. See the NOTICE file
4+
~ distributed with this work for additional information
5+
~ regarding copyright ownership. The ASF licenses this file
6+
~ to you under the Apache License, Version 2.0 (the
7+
~ "License"); you may not use this file except in compliance
8+
~ with the License. You may obtain a copy of the License at
9+
~
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+
21+
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
22+
xmlns:ord="http://www.w3schools.com">
23+
<xs:import namespace="http://www.w3schools.com"
24+
schemaLocation="test-resources/schemas/custom_schemas/sampleSchema1.xsd"/>
25+
<xs:element name="envelope" type="EnvelopeType"/>
26+
<xs:complexType name="EnvelopeType">
27+
<xs:sequence>
28+
<xs:element ref="ord:order" maxOccurs="unbounded"/>
29+
</xs:sequence>
30+
</xs:complexType>
31+
</xs:schema>
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
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+
21+
package org.apache.axis2.wsdl.codegen;
22+
23+
import java.util.ArrayList;
24+
import java.util.HashMap;
25+
import java.util.List;
26+
import java.util.Map;
27+
28+
import org.apache.axis2.description.AxisService;
29+
import org.apache.axis2.wsdl.codegen.XMLSchemaTest;
30+
import org.apache.axis2.util.CommandLineOption;
31+
import org.apache.ws.commons.schema.XmlSchema;
32+
import org.junit.Test;
33+
34+
public class CodeGenConfigurationTest extends XMLSchemaTest{
35+
36+
protected AxisService service;
37+
private ArrayList<XmlSchema> schemas;
38+
39+
@Override
40+
protected void setUp() throws Exception {
41+
service = new AxisService();
42+
schemas = new ArrayList<XmlSchema>();
43+
loadSampleSchemaFile(schemas);
44+
service.addSchema(schemas);
45+
super.setUp();
46+
}
47+
48+
@Override
49+
protected void tearDown() throws Exception {
50+
service=null;
51+
schemas=null;
52+
53+
super.tearDown();
54+
}
55+
56+
@Test
57+
public void testGetSchemaListForAllServices(){
58+
Map<String, CommandLineOption> optionMap = new HashMap<String, CommandLineOption>();
59+
CodeGenConfiguration configuration = new CodeGenConfiguration(optionMap);
60+
configuration.addAxisService(service);
61+
List<XmlSchema> list=configuration.getSchemaListForAllServices();
62+
assertEquals(schemas.get(0), list.get(0));
63+
}
64+
65+
66+
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy