Skip to content

Commit

Permalink
Add license headers for xsd related files
Browse files Browse the repository at this point in the history
  • Loading branch information
SasinduDilshara committed Nov 18, 2024
1 parent 0f4356c commit 3abafb7
Show file tree
Hide file tree
Showing 49 changed files with 546 additions and 43 deletions.
2 changes: 1 addition & 1 deletion ballerina/tests/resources/xsd_tests/schemas/schema_1.xsd
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="Book" type="xs:string"/>
</xs:schema>
</xs:schema>
2 changes: 1 addition & 1 deletion ballerina/tests/resources/xsd_tests/schemas/schema_2.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
</xs:schema>
2 changes: 1 addition & 1 deletion ballerina/tests/resources/xsd_tests/schemas/schema_3.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
<xs:attribute name="id" type="xs:string" use="required"/>
</xs:complexType>
</xs:element>
</xs:schema>
</xs:schema>
2 changes: 1 addition & 1 deletion ballerina/tests/resources/xsd_tests/schemas/schema_4.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
</xs:choice>
</xs:complexType>
</xs:element>
</xs:schema>
</xs:schema>
2 changes: 1 addition & 1 deletion ballerina/tests/resources/xsd_tests/schemas/schema_5.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
</xs:all>
</xs:complexType>
</xs:element>
</xs:schema>
</xs:schema>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<Book><Title>Sample</Title></Book>
<Book><Title>Sample</Title></Book>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<Book>Sample</Book>
<Book>Sample</Book>
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
<Book>
<Title>Sample Title</Title>
</Book>
</Library>
</Library>
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
<Title>Sample Title</Title>
<Author>Sample Author</Author>
</Book>
</Library>
</Library>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Person>
<Name>John Doe</Name>
<Age>30</Age>
</Person>
</Person>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Person id="123">
<Name>John Doe</Name>
<Age>30</Age>
</Person>
</Person>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Vehicle>
<Car>Toyota</Car>
<Bike>Yamaha</Bike>
</Vehicle>
</Vehicle>
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<Vehicle>
<Car>Toyota</Car>
</Vehicle>
</Vehicle>
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<Order>
<OrderID>12345</OrderID>
</Order>
</Order>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Order>
<OrderID>12345</OrderID>
<Product>Laptop</Product>
</Order>
</Order>
18 changes: 9 additions & 9 deletions ballerina/tests/toXml_test.bal
Original file line number Diff line number Diff line change
Expand Up @@ -45,20 +45,20 @@ function testToXmlBasic2() returns error? {
groups: ["toXml"]
}
function testToXmlBasic3() returns error? {
// xml xmlval1 = xml `<Data3><A>1</A><B>2</B></Data3>`;
// Data3 rec1 = check parseAsType(xmlval1);
// xml result1 = check toXml(rec1);
// test:assertTrue(result1 == xmlval1);
xml xmlval1 = xml `<Data3><A>1</A><B>2</B></Data3>`;
Data3 rec1 = check parseAsType(xmlval1);
xml result1 = check toXml(rec1);
test:assertTrue(result1 == xmlval1);

// xml xmlVal2 = xml `<Data3><A>1</A><B>2</B></Data3>`;
// Data4 rec2 = check parseAsType(xmlVal2);
// xml result2 = check toXml(rec2);
// test:assertTrue(result2 == xmlVal2);
xml xmlVal2 = xml `<Data3><A>1</A><B>2</B></Data3>`;
Data4 rec2 = check parseAsType(xmlVal2);
xml result2 = check toXml(rec2);
test:assertTrue(result2 == xmlVal2);

xml xmlVal3 = xml `<Data5><A><B>1</B></A><A><B>2</B></A><A><B>3</B></A></Data5>`;
Data5 rec3 = check parseAsType(xmlVal3);
xml result3 = check toXml(rec3);
test:assertEquals(result3, xmlVal3);
test:assertTrue(result3 == xmlVal3);
}

@test:Config {
Expand Down
16 changes: 16 additions & 0 deletions ballerina/tests/xsd_choice_array_test.bal
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
// Copyright (c) 2023, WSO2 LLC. (https://www.wso2.com).
//
// WSO2 LLC. licenses this file to you under the Apache License,
// Version 2.0 (the "License"); you may not use this file except
// in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.

import ballerina/test;

type XsdChoiceArray record {|
Expand Down
16 changes: 16 additions & 0 deletions ballerina/tests/xsd_choice_array_test_with_parse_type.bal
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
// Copyright (c) 2023, WSO2 LLC. (https://www.wso2.com).
//
// WSO2 LLC. licenses this file to you under the Apache License,
// Version 2.0 (the "License"); you may not use this file except
// in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.

import ballerina/test;

@Name {
Expand Down
16 changes: 16 additions & 0 deletions ballerina/tests/xsd_choice_test.bal
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
// Copyright (c) 2023, WSO2 LLC. (https://www.wso2.com).
//
// WSO2 LLC. licenses this file to you under the Apache License,
// Version 2.0 (the "License"); you may not use this file except
// in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.

import ballerina/test;

type XSDChoiceRecord record {|
Expand Down
16 changes: 16 additions & 0 deletions ballerina/tests/xsd_choice_test_with_element_annotation.bal
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
// Copyright (c) 2023, WSO2 LLC. (https://www.wso2.com).
//
// WSO2 LLC. licenses this file to you under the Apache License,
// Version 2.0 (the "License"); you may not use this file except
// in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.

import ballerina/test;

type XsdChoiceWithElementAnnotation record {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
// Copyright (c) 2023, WSO2 LLC. (https://www.wso2.com).
//
// WSO2 LLC. licenses this file to you under the Apache License,
// Version 2.0 (the "License"); you may not use this file except
// in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.

import ballerina/test;

@Name {
Expand Down
16 changes: 16 additions & 0 deletions ballerina/tests/xsd_choice_test_with_parse_type.bal
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
// Copyright (c) 2023, WSO2 LLC. (https://www.wso2.com).
//
// WSO2 LLC. licenses this file to you under the Apache License,
// Version 2.0 (the "License"); you may not use this file except
// in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.

import ballerina/test;

@Name {
Expand Down
16 changes: 16 additions & 0 deletions ballerina/tests/xsd_choice_with_name_annotations.bal
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
// Copyright (c) 2023, WSO2 LLC. (https://www.wso2.com).
//
// WSO2 LLC. licenses this file to you under the Apache License,
// Version 2.0 (the "License"); you may not use this file except
// in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.

import ballerina/test;

type XsdChoiceWithNameAnnotation record {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
// Copyright (c) 2023, WSO2 LLC. (https://www.wso2.com).
//
// WSO2 LLC. licenses this file to you under the Apache License,
// Version 2.0 (the "License"); you may not use this file except
// in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.

import ballerina/test;

type XsdChoiceWithNameAnnotationWithXmlValue record {
Expand Down
18 changes: 17 additions & 1 deletion ballerina/tests/xsd_element_test.bal
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
// Copyright (c) 2023, WSO2 LLC. (https://www.wso2.com).
//
// WSO2 LLC. licenses this file to you under the Apache License,
// Version 2.0 (the "License"); you may not use this file except
// in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.

import ballerina/test;

type ElementRecord record {
Expand Down Expand Up @@ -203,4 +219,4 @@ function testXsdElement4() returns error? {
rec = parseString(xmlStr);
test:assertTrue(rec is error);
test:assertEquals((<Error>rec).message(), "'firstName' occurs more than the max allowed times");
}
}
18 changes: 17 additions & 1 deletion ballerina/tests/xsd_element_test_with_parse_type.bal
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
// Copyright (c) 2023, WSO2 LLC. (https://www.wso2.com).
//
// WSO2 LLC. licenses this file to you under the Apache License,
// Version 2.0 (the "License"); you may not use this file except
// in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.

import ballerina/test;

type ElementRecordWithXmlValue record {
Expand Down Expand Up @@ -203,4 +219,4 @@ function testXsdElementWithXmlValue4() returns error? {
rec = parseAsType(xmlStr);
test:assertTrue(rec is error);
test:assertEquals((<Error>rec).message(), "'firstName' occurs more than the max allowed times");
}
}
16 changes: 16 additions & 0 deletions ballerina/tests/xsd_sequence_array_test.bal
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
// Copyright (c) 2023, WSO2 LLC. (https://www.wso2.com).
//
// WSO2 LLC. licenses this file to you under the Apache License,
// Version 2.0 (the "License"); you may not use this file except
// in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.

import ballerina/test;

type XsdSequenceArray record {|
Expand Down
16 changes: 16 additions & 0 deletions ballerina/tests/xsd_sequence_array_test_with_parse_type.bal
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
// Copyright (c) 2023, WSO2 LLC. (https://www.wso2.com).
//
// WSO2 LLC. licenses this file to you under the Apache License,
// Version 2.0 (the "License"); you may not use this file except
// in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.

import ballerina/test;

@Name {
Expand Down
16 changes: 16 additions & 0 deletions ballerina/tests/xsd_sequence_test_with_element_annotation.bal
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
// Copyright (c) 2023, WSO2 LLC. (https://www.wso2.com).
//
// WSO2 LLC. licenses this file to you under the Apache License,
// Version 2.0 (the "License"); you may not use this file except
// in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.

import ballerina/test;

// TODO: Add tests with attributes
Expand Down
Loading

0 comments on commit 3abafb7

Please sign in to comment.