-
Notifications
You must be signed in to change notification settings - Fork 753
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/master' into fix-worker
- Loading branch information
Showing
10 changed files
with
145 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
misc/xml-to-record-converter/src/test/resources/ballerina/sample_25.bal
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
type Book_Title record { | ||
string __text; | ||
@xmldata:Attribute | ||
string edition; | ||
@xmldata:Attribute | ||
string lang; | ||
}; | ||
|
||
type Book_Author record { | ||
string __text; | ||
@xmldata:Attribute | ||
string gender; | ||
@xmldata:Attribute | ||
string nationality; | ||
}; | ||
|
||
type Book_Book record { | ||
Book_Title title; | ||
Book_Author author; | ||
string publish_date; | ||
string description; | ||
}; | ||
|
||
type Books record { | ||
string genre; | ||
Book_Book book; | ||
}; | ||
|
||
@xmldata:Name {value: "library"} | ||
type Library record { | ||
Books books; | ||
@xmldata:Attribute | ||
string genre; | ||
}; |
11 changes: 11 additions & 0 deletions
11
misc/xml-to-record-converter/src/test/resources/xml/sample_25.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<library xmlns:book="http://example.com/books" genre="genre"> | ||
<books> | ||
<genre>Programming</genre> | ||
<book:book> | ||
<book:title lang="en" edition="1st">XML Developer's Guide</book:title> | ||
<book:author gender="male" nationality="American">Gambardella, Matthew</book:author> | ||
<book:publish_date>2000-10-01</book:publish_date> | ||
<book:description>An in-depth look at creating applications with XML.</book:description> | ||
</book:book> | ||
</books> | ||
</library> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
tests/jballerina-unit-test/src/test/resources/test-src/workers/fork-within-if-condition.bal
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// Copyright (c) 2024 WSO2 LLC. (http://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. | ||
|
||
function testForkWithinIfCondition() returns int { | ||
boolean isForked = false; | ||
if isForked { | ||
fork { | ||
worker A { | ||
5 -> B; | ||
string value = <- B; | ||
} | ||
|
||
worker B { | ||
int value = <- A; | ||
"a" -> A; | ||
} | ||
} | ||
return 0; | ||
} | ||
return 1; | ||
} |