Skip to content

Commit

Permalink
Fix test failures
Browse files Browse the repository at this point in the history
  • Loading branch information
Bhashinee committed Feb 28, 2024
1 parent fef0e47 commit 1bf5b9f
Show file tree
Hide file tree
Showing 130 changed files with 503 additions and 99 deletions.
12 changes: 6 additions & 6 deletions examples/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ task initDbExamples {
delete "${project.projectDir}/build/generated-examples/${example}/generated"
workingDir "${project.projectDir}/build/generated-examples/${example}"
if (!Os.isFamily(Os.FAMILY_WINDOWS)) {
commandLine 'sh', '-c', "${ballerinaDist}/bin/bal persist init --module=entities --datastore=mysql"
commandLine 'sh', '-c', "${ballerinaDist}/bin/bal persist generate --module entities --datastore mysql"
} else {
commandLine 'cmd', 'slmgr /dlv'
println('\n' + "Windows Instance detected")
Expand All @@ -164,9 +164,9 @@ task initInMemoryExamples {
exec {
workingDir "${project.projectDir}/build/generated-examples/${example}"
if (!Os.isFamily(Os.FAMILY_WINDOWS)) {
commandLine 'sh', '-c', "${ballerinaDist}/bin/bal persist init --module=entities"
commandLine 'sh', '-c', "${ballerinaDist}/bin/bal persist generate --module entities --datastore inmemory"
} else {
commandLine 'cmd', '/c', "${ballerinaDist}/bin/bal.bat persist init --module=entities"
commandLine 'cmd', '/c', "${ballerinaDist}/bin/bal.bat persist generate --module entities --datastore inmemory"
}
}
} catch (Exception e) {
Expand Down Expand Up @@ -211,7 +211,7 @@ task generateDbExamples {
exec {
workingDir "${project.projectDir}/build/generated-examples/${example}"
if (!Os.isFamily(Os.FAMILY_WINDOWS)) {
commandLine 'sh', '-c', "${ballerinaDist}/bin/bal persist generate"
commandLine 'sh', '-c', "${ballerinaDist}/bin/bal persist generate --module entities --datastore inmemory"
} else {
commandLine 'cmd', 'slmgr /dlv'
println('\n' + "Windows Instance detected")
Expand All @@ -234,9 +234,9 @@ task generateInMemoryExamples {
exec {
workingDir "${project.projectDir}/build/generated-examples/${example}"
if (!Os.isFamily(Os.FAMILY_WINDOWS)) {
commandLine 'sh', '-c', "${ballerinaDist}/bin/bal persist generate --datastore=inmemory"
commandLine 'sh', '-c', "${ballerinaDist}/bin/bal persist generate --datastore inmemory --module entities"
} else {
commandLine 'cmd', '/c', "${ballerinaDist}/bin/bal.bat persist generate"
commandLine 'cmd', '/c', "${ballerinaDist}/bin/bal.bat persist generate --datastore inmemory --module entities"
}
}
} catch (Exception e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@ filePath = "persist/model.bal"
groupId = "io.ballerina.stdlib"
artifactId = "persist.sql-native"
version = "1.2.2-SNAPSHOT"

Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ filePath = "persist/model.bal"
groupId = "io.ballerina.stdlib"
artifactId = "persist.inmemory-native"
version = "1.2.0"

Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ filePath = "persist/model.bal"
groupId = "io.ballerina.stdlib"
artifactId = "persist.sql-native"
version = "1.2.2-SNAPSHOT"

Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ filePath = "persist/model.bal"
groupId = "io.ballerina.stdlib"
artifactId = "persist.sql-native"
version = "1.2.2-SNAPSHOT"

Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,15 @@ port = 3306
user = "root"
password = ""
database = ""

[[tool.persist]]
id = "generate-db-client"
targetModule = "persist_add_2"
options.datastore = "inmemory"
filePath = "persist/model.bal"

[[platform.java17.dependency]]
groupId = "io.ballerina.stdlib"
artifactId = "persist.inmemory-native"
version = "1.2.0"

Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@ filePath = "persist/model.bal"
groupId = "io.ballerina.stdlib"
artifactId = "persist.sql-native"
version = "1.2.2-SNAPSHOT"

Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@ filePath = "persist/model.bal"
groupId = "io.ballerina.stdlib"
artifactId = "persist.sql-native"
version = "1.2.2-SNAPSHOT"

Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ filePath = "persist/model.bal"
groupId = "io.ballerina.stdlib"
artifactId = "persist.sql-native"
version = "1.2.2-SNAPSHOT"

Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@ filePath = "persist/model.bal"
groupId = "io.ballerina.stdlib"
artifactId = "persist.sql-native"
version = "1.2.2-SNAPSHOT"

Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[package]
org = "foo"
name = "persist_generate_20"
version = "0.1.0"
distribution = "2201.3.0"

[build-options]
observabilityIncluded = false

[[tool.persist]]
options.datastore = "mysql"
targetModule = "persist_generate_20.entities"
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[persist_generate_20.entities]
host = "localhost"
port = 3307
user = "root"
password = "Test123#"
database = "persist"
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// Copyright (c) 2022 WSO2 LLC. (http://www.wso2.org) All Rights Reserved.
//
// 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/io;

public function main() {
io:println("hello");
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
// Copyright (c) 2022 WSO2 LLC. (http://www.wso2.org) All Rights Reserved.
//
// 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/persist as _;

public type Company record {|
readonly int id;
string name;
Employee[] employee;
|};

public type Employee record {|
readonly int id;
string name;

Company company;
Vehicle[] vehicles;
|};

public type Vehicle record {|
readonly int model;
string name;

Employee employee;
|};
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,8 @@ distribution = "2201.3.0"
[build-options]
observabilityIncluded = false

[[platform.java17.dependency]]
groupId = "io.ballerina.stdlib"
artifactId = "persist.sql-native"
version = "1.2.2-SNAPSHOT"

Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// AUTO-GENERATED FILE. DO NOT MODIFY.

// This file is an auto-generated file by Ballerina persistence layer.
// It should not be modified by hand.

import ballerinax/mysql;

configurable int port = ?;
Expand All @@ -11,3 +9,4 @@ configurable string user = ?;
configurable string database = ?;
configurable string password = ?;
configurable mysql:Options & readonly connectionOptions = {};

Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ distribution = "2201.3.0"
[build-options]
observabilityIncluded = false

[persist]
[[tool.persist]]
options.datastore = "mysql"
module = "persist_generate_10.entities"
targetModule = "persist_generate_10.entities"
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,9 @@ distribution = "2201.3.0"

[build-options]
observabilityIncluded = true

[[platform.java17.dependency]]
groupId = "io.ballerina.stdlib"
artifactId = "persist.sql-native"
version = "1.2.2-SNAPSHOT"

Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// AUTO-GENERATED FILE. DO NOT MODIFY.

// This file is an auto-generated file by Ballerina persistence layer.
// It should not be modified by hand.

import ballerinax/mysql;

configurable int port = ?;
Expand All @@ -11,3 +9,4 @@ configurable string user = ?;
configurable string database = ?;
configurable string password = ?;
configurable mysql:Options & readonly connectionOptions = {};

Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,9 @@ distribution = "2201.3.0"

[build-options]
observabilityIncluded = true

[[platform.java17.dependency]]
groupId = "io.ballerina.stdlib"
artifactId = "persist.sql-native"
version = "1.2.2-SNAPSHOT"

Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,9 @@ distribution = "2201.3.0"

[build-options]
observabilityIncluded = false

[[platform.java17.dependency]]
groupId = "io.ballerina.stdlib"
artifactId = "persist.sql-native"
version = "1.2.2-SNAPSHOT"

Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ user = "root"
password = ""
database = ""


Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// AUTO-GENERATED FILE. DO NOT MODIFY.

// This file is an auto-generated file by Ballerina persistence layer.
// It should not be modified by hand.

import ballerinax/mysql;

configurable int port = ?;
Expand All @@ -11,3 +9,4 @@ configurable string user = ?;
configurable string database = ?;
configurable string password = ?;
configurable mysql:Options & readonly connectionOptions = {};

Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ distribution = "2201.3.0"
[build-options]
observabilityIncluded = false

[persist]
[[tool.persist]]
options.datastore = "mysql"
module = "persist_generate_14.entities"
targetModule = "persist_generate_14.entities"
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ distribution = "2201.3.0"
[build-options]
observabilityIncluded = false

[persist]
[[tool.persist]]
options.datastore = "mysql"
module = "persist_generate_15.entities1"
targetModule = "persist_generate_15.entities1"

[persist]
[[tool.persist]]
options.datastore = "mysql"
module = "persist_generate_15.entities"
targetModule = "persist_generate_15.entities"
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,9 @@ distribution = "2201.3.0"

[build-options]
observabilityIncluded = false

[[platform.java17.dependency]]
groupId = "io.ballerina.stdlib"
artifactId = "persist.sql-native"
version = "1.2.2-SNAPSHOT"

Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// AUTO-GENERATED FILE. DO NOT MODIFY.

// This file is an auto-generated file by Ballerina persistence layer.
// It should not be modified by hand.

import ballerinax/mysql;

configurable int port = ?;
Expand All @@ -11,3 +9,4 @@ configurable string user = ?;
configurable string database = ?;
configurable string password = ?;
configurable mysql:Options & readonly connectionOptions = {};

Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,9 @@ distribution = "2201.3.0"

[build-options]
observabilityIncluded = false

[[platform.java17.dependency]]
groupId = "io.ballerina.stdlib"
artifactId = "persist.sql-native"
version = "1.2.2-SNAPSHOT"

Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// AUTO-GENERATED FILE. DO NOT MODIFY.

// This file is an auto-generated file by Ballerina persistence layer.
// It should not be modified by hand.

import ballerinax/mysql;

configurable int port = ?;
Expand All @@ -11,3 +9,4 @@ configurable string user = ?;
configurable string database = ?;
configurable string password = ?;
configurable mysql:Options & readonly connectionOptions = {};

Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ distribution = "2201.3.0"
[build-options]
observabilityIncluded = false

[persist]
[[tool.persist]]
options.datastore = "mysql"
module = "persist_generate_18.entities"
targetModule = "persist_generate_18.entities"
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,9 @@ distribution = "2201.3.0"

[build-options]
observabilityIncluded = false

[[platform.java17.dependency]]
groupId = "io.ballerina.stdlib"
artifactId = "persist.sql-native"
version = "1.2.2-SNAPSHOT"

Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,8 @@ distribution = "2201.3.0"
[build-options]
observabilityIncluded = false

[[platform.java17.dependency]]
groupId = "io.ballerina.stdlib"
artifactId = "persist.sql-native"
version = "1.2.2-SNAPSHOT"

Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// AUTO-GENERATED FILE. DO NOT MODIFY.

// This file is an auto-generated file by Ballerina persistence layer.
// It should not be modified by hand.

import ballerinax/mysql;

configurable int port = ?;
Expand All @@ -11,3 +9,4 @@ configurable string user = ?;
configurable string database = ?;
configurable string password = ?;
configurable mysql:Options & readonly connectionOptions = {};

Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ distribution = "2201.3.0"
[build-options]
observabilityIncluded = false

[persist]
[[tool.persist]]
options.datastore = "mysql"
module = "persist_generate_20.entities"
targetModule = "persist_generate_20.entities"
Loading

0 comments on commit 1bf5b9f

Please sign in to comment.