Skip to content

Commit

Permalink
Merge pull request #10 from SasinduDilshara/development-2
Browse files Browse the repository at this point in the history
Add licenses for tests & add java17 features for native
  • Loading branch information
SasinduDilshara authored Jul 29, 2024
2 parents 9409dd3 + e4184a6 commit d1d227b
Show file tree
Hide file tree
Showing 89 changed files with 1,471 additions and 534 deletions.
28 changes: 0 additions & 28 deletions .vscode/launch.json

This file was deleted.

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ The Ballerina CSV Data Library is a comprehensive toolkit designed to facilitate

### Converting CSV string to a record array

To convert an CSV document value to a record value, you can utilize the `parseStringToRecord` function provided by the library. The example below showcases the transformation of a CSV document into a record array.
To convert a CSV string into a record value, you can use the `parseStringToRecord` function from the library. The following example demonstrates how to transform a CSV document into an array of records.

```ballerina
import ballerina/data.csv;
Expand Down Expand Up @@ -194,4 +194,4 @@ All contributors are encouraged to read the [Ballerina code of conduct](https://
## Useful links

* Chat live with us via our [Discord server](https://discord.gg/ballerinalang).
* Post all technical questions on Stack Overflow with the [#ballerina](https://stackoverflow.com/questions/tagged/ballerina) tag.
* Post all technical questions on Stack Overflow with the [#ballerina](https://stackoverflow.com/questions/tagged/ballerina) tag.
6 changes: 2 additions & 4 deletions ballerina-tests/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2024, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
* Copyright (c) 2024, WSO2 LLC. (https://www.wso2.com).
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -18,8 +18,6 @@ plugins {
id 'jacoco'
}

//apply plugin: 'java'

import org.apache.tools.ant.taskdefs.condition.Os

description = 'Ballerina - HTTP/WS Ballerina Tests'
Expand All @@ -32,7 +30,7 @@ def testCommonTomlFilePlaceHolder = new File("${project.rootDir}/build-config/re
def ballerinaDist = "${project.rootDir}/target/ballerina-runtime"
def distributionBinPath = "${ballerinaDist}/bin"
def testCoverageParam = "--code-coverage --coverage-format=xml --includes=io.ballerina.stdlib.data.*:ballerina.*"
def testPackages = ["user-config-tests", "parse-string-array-types-tests", "type-compatible-tests", "unicode-tests", "constraint-validation-tests",
def testPackages = ["user-config-tests", "type-compatible-tests", "parse-string-array-types-tests", "unicode-tests", "constraint-validation-tests",
"parse-list-types-tests", "parse-record-types-tests", "parse-string-record-types-tests", "union-type-tests"]
def testCommonPackage = "csv-commons"

Expand Down
3 changes: 3 additions & 0 deletions ballerina-tests/constraint-validation-tests/Ballerina.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,6 @@ version = "0.1.0"

[platform.java17]
graalvmCompatible = true

[build-options]
graalvmBuildOptions = "-H:IncludeLocales=en_US,fr_FR"
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
// Copyright (c) 2024, 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/constraint;
import ballerina/data.csv as csv;
import ballerina/data.csv;
import ballerina/test;

type ConstrainedRec record {
Expand Down
3 changes: 3 additions & 0 deletions ballerina-tests/csv-commons/Ballerina.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@
org = "ballerina"
name = "csv_commons"
version = "0.1.0"

[platform.java17]
graalvmCompatible = true
16 changes: 16 additions & 0 deletions ballerina-tests/csv-commons/test_utils.bal
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
// Copyright (c) 2024, 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.

public function generateErrorMessageForMissingRequiredField(string 'field) returns string {
return string `no matching header value is found for the required field '${'field}'`;
}
Expand Down
3 changes: 3 additions & 0 deletions ballerina-tests/parse-list-types-tests/Ballerina.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,6 @@ version = "0.1.0"

[platform.java17]
graalvmCompatible = true

[build-options]
graalvmBuildOptions = "-H:IncludeLocales=en_US,fr_FR"
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
// Copyright (c) 2024, 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/csv_commons as common;
import ballerina/data.csv as csv;
import ballerina/data.csv;
import ballerina/test;

@test:Config
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
// Copyright (c) 2024, 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/csv_commons as common;
import ballerina/data.csv as csv;
import ballerina/data.csv;
import ballerina/test;

@test:Config
Expand Down
16 changes: 16 additions & 0 deletions ballerina-tests/parse-list-types-tests/tests/test_data_values.bal
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
// Copyright (c) 2024, 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.

boolean b1 = true;
false b2 = false;
boolean? b3 = ();
Expand Down
16 changes: 16 additions & 0 deletions ballerina-tests/parse-list-types-tests/tests/types.bal
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
// Copyright (c) 2024, 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.

type BooleanRecord1 record {
boolean b1;
boolean|string b2;
Expand Down
3 changes: 3 additions & 0 deletions ballerina-tests/parse-record-types-tests/Ballerina.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,6 @@ version = "0.1.0"

[platform.java17]
graalvmCompatible = true

[build-options]
graalvmBuildOptions = "-H:IncludeLocales=en_US,fr_FR"
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
// Copyright (c) 2024, 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/csv_commons as common;
import ballerina/data.csv as csv;
import ballerina/data.csv;
import ballerina/test;

@test:Config
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
// Copyright (c) 2024, 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/csv_commons as common;
import ballerina/data.csv as csv;
import ballerina/data.csv;
import ballerina/test;

@test:Config
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
// Copyright (c) 2024, 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.

boolean b1 = true;
false b2 = false;
boolean? b3 = ();
Expand Down
16 changes: 16 additions & 0 deletions ballerina-tests/parse-record-types-tests/tests/types.bal
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
// Copyright (c) 2024, 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.

type BooleanRecord1 record {
boolean b1;
boolean|string b2;
Expand Down
3 changes: 3 additions & 0 deletions ballerina-tests/parse-string-array-types-tests/Ballerina.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,6 @@ version = "0.1.0"

[platform.java17]
graalvmCompatible = true

[build-options]
graalvmBuildOptions = "-H:IncludeLocales=en_US,fr_FR"
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
// Copyright (c) 2024, 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/csv_commons as common;
import ballerina/data.csv as csv;
import ballerina/data.csv;
import ballerina/test;

@test:Config
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
// Copyright (c) 2024, 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/csv_commons as common;
import ballerina/data.csv as csv;
import ballerina/data.csv;
import ballerina/test;

@test:Config
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
// Copyright (c) 2024, 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.

boolean b1 = true;
false b2 = false;
boolean? b3 = ();
Expand Down
Loading

0 comments on commit d1d227b

Please sign in to comment.