-
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 pull request #43436 from poorna2152/test_package
Fix `CCE` for annotation symbols in tests in SymbolFinder
- Loading branch information
Showing
7 changed files
with
196 additions
and
19 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
7 changes: 7 additions & 0 deletions
7
...compiler-api-test/src/test/resources/test-src/annotations_in_tests_project/Ballerina.toml
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,7 @@ | ||
[package] | ||
org = "testorg" | ||
name = "annotations_in_tests_project" | ||
version = "0.1.0" | ||
|
||
[build-options] | ||
observabilityIncluded = true |
88 changes: 88 additions & 0 deletions
88
...ompiler-api-test/src/test/resources/test-src/annotations_in_tests_project/tests/tests.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,88 @@ | ||
// 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 type MetaInfo record {| | ||
string name; | ||
|}; | ||
|
||
type Annot record { | ||
string foo; | ||
int bar?; | ||
}; | ||
|
||
public const annotation MetaInfo Meta on record field; | ||
|
||
public const annotation Annot v1 on source const, type, source worker; | ||
annotation Annot[] v2 on class; | ||
public annotation Annot v3 on function; | ||
annotation Annot v4 on parameter; | ||
public annotation v5 on field; | ||
|
||
public type QueryWithDifferentAnnotation record {| | ||
@Meta { | ||
name: "Potter" | ||
} | ||
string firstName; | ||
int age; | ||
|}; | ||
|
||
@v1 { | ||
foo: "annot on constant" | ||
} | ||
const strValue = "v1 value"; | ||
|
||
@v1 { | ||
foo: strValue, | ||
bar: 1 | ||
} | ||
public type T1 record { | ||
@v5 string name; | ||
}; | ||
|
||
@v2 { | ||
foo: "value 1" | ||
} | ||
@v2 { | ||
foo: "value 2" | ||
} | ||
class Foo { | ||
@v5 string name = "ballerina"; | ||
|
||
@v3 { | ||
foo: "v31 value" | ||
} | ||
public function setName(@v4 { foo: "v41 value required" } string name, | ||
@v4 { foo: "v41 value defaultable" } int id = 0, | ||
@v4 { foo: "v41 value rest" } string... others) returns @v5 () { | ||
self.name = name; | ||
} | ||
} | ||
|
||
@v3 { | ||
foo: "annot on function" | ||
} | ||
public function sum(int x, int y) returns int => x + y; | ||
|
||
function test() { | ||
int a = 10; | ||
|
||
@v1 { | ||
foo: "annot on worker" | ||
} | ||
worker w1 { | ||
a += 10; | ||
} | ||
} |
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
21 changes: 16 additions & 5 deletions
21
...tion-test/src/test/resources/command-outputs/unix/BasicCasesTest-testAnnotationAccess.txt
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 |
---|---|---|
@@ -1,10 +1,21 @@ | ||
Compiling source | ||
intg_tests/annotation_access:0.0.0 | ||
HINT [tests/main_test.bal:(73:5,73:5)] concurrent calls will not be made to this method since the service is not an 'isolated' service | ||
ballerina: Oh no, something really went wrong. Bad. Sad. | ||
|
||
We appreciate it if you can report the code that broke Ballerina in | ||
https://github.com/ballerina-platform/ballerina-lang/issues with the | ||
log you get below and your sample code. | ||
Running Tests with Coverage | ||
|
||
We thank you for helping make us better.***** SEVERE {b7a.log.crash} - class org.wso2.ballerinalang.compiler.semantics.model.symbols.BSymbol cannot be cast to class org.wso2.ballerinalang.compiler.semantics.model.symbols.BAnnotationSymbol (org.wso2.ballerinalang.compiler.semantics.model.symbols.BSymbol and org.wso2.ballerinalang.compiler.semantics.model.symbols.BAnnotationSymbol are in unnamed module of loader 'app')************* | ||
annotation_access | ||
[pass] testServiceAnnotReordering | ||
[pass] testTestConstructSrcAnnotAccess | ||
[pass] testTestConstructTestAnnotAccess | ||
[pass] testTestSrcConstructSrcAnnotAccess | ||
|
||
|
||
4 passing | ||
0 failing | ||
0 skipped | ||
|
||
Test execution time :*****s | ||
|
||
Generating Test Report | ||
annotation-access/target/report/test_results.json |
22 changes: 17 additions & 5 deletions
22
...n-test/src/test/resources/command-outputs/windows/BasicCasesTest-testAnnotationAccess.txt
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 |
---|---|---|
@@ -1,10 +1,22 @@ | ||
Compiling source | ||
intg_tests/annotation_access:0.0.0 | ||
HINT [tests\main_test.bal:(73:5,73:5)] concurrent calls will not be made to this method since the service is not an 'isolated' service | ||
ballerina: Oh no, something really went wrong. Bad. Sad. | ||
|
||
We appreciate it if you can report the code that broke Ballerina in | ||
https://github.com/ballerina-platform/ballerina-lang/issues with the | ||
log you get below and your sample code. | ||
Running Tests with Coverage | ||
|
||
annotation_access | ||
[pass] testServiceAnnotReordering | ||
[pass] testTestConstructSrcAnnotAccess | ||
[pass] testTestConstructTestAnnotAccess | ||
[pass] testTestSrcConstructSrcAnnotAccess | ||
|
||
|
||
4 passing | ||
0 failing | ||
0 skipped | ||
|
||
Test execution time :*****s | ||
|
||
Generating Test Report | ||
annotation-access\target\report\test_results.json | ||
|
||
We thank you for helping make us better.***** SEVERE {b7a.log.crash} - class org.wso2.ballerinalang.compiler.semantics.model.symbols.BSymbol cannot be cast to class org.wso2.ballerinalang.compiler.semantics.model.symbols.BAnnotationSymbol (org.wso2.ballerinalang.compiler.semantics.model.symbols.BSymbol and org.wso2.ballerinalang.compiler.semantics.model.symbols.BAnnotationSymbol are in unnamed module of loader 'app')************* |