@@ -3,30 +3,30 @@ import { daytraderJavaAnalysis } from "../../../conftest";
3
3
import { expect , test } from "bun:test" ;
4
4
import { logger } from "../../../../src/utils" ;
5
5
6
- test ( "Must get analysis object from JavaAnalysis object" , ( ) => {
6
+ test ( "Should get analysis object from JavaAnalysis object" , ( ) => {
7
7
expect ( daytraderJavaAnalysis ) . toBeDefined ( ) ;
8
8
} ) ;
9
9
10
- test ( "Must get JApplication instance" , async ( ) => {
10
+ test ( "Should get JApplication instance" , async ( ) => {
11
11
const jApplication = await daytraderJavaAnalysis . getApplication ( ) ;
12
12
expect ( jApplication ) . toBeDefined ( ) ;
13
13
} ) ;
14
14
15
- test ( "Must get Symbol Table" , async ( ) => {
15
+ test ( "Should get Symbol Table" , async ( ) => {
16
16
const symbolTable = await daytraderJavaAnalysis . getSymbolTable ( ) ;
17
17
expect ( symbolTable ) . toBeDefined ( ) ;
18
18
} ) ;
19
19
20
- test ( "Must get all classes in a Java application" , async ( ) => {
20
+ test ( "Should get all classes in a Java application" , async ( ) => {
21
21
await expect ( daytraderJavaAnalysis . getAllClasses ( ) ) . toBeDefined ( ) ;
22
22
} ) ;
23
23
24
- test ( "Must get a specific class the application" , async ( ) => {
24
+ test ( "Should get a specific class the application" , async ( ) => {
25
25
const tradeDirectObject = await daytraderJavaAnalysis . getClassByQualifiedName ( "com.ibm.websphere.samples.daytrader.impl.direct.TradeDirect" ) ;
26
26
expect ( async ( ) => JType . parse ( tradeDirectObject ) ) . not . toThrow ( ) ;
27
27
} ) ;
28
28
29
- test ( "Must throw error when a requested class in the application does not exist" , async ( ) => {
29
+ test ( "Should throw error when a requested class in the application does not exist" , async ( ) => {
30
30
/**
31
31
* Quick note to self: There is a subtle difference between await expect(...) and expect(await ...)
32
32
* When there is an error, the reject happens even before the expect can be honored. So instead, we await the expect
@@ -36,27 +36,27 @@ test("Must throw error when a requested class in the application does not exist"
36
36
"Class this.class.does.not.Exist not found in the application." ) ;
37
37
} ) ;
38
38
39
- test ( "Must get all methods in the application" , ( ) => {
39
+ test ( "Should get all methods in the application" , ( ) => {
40
40
return daytraderJavaAnalysis . getAllMethods ( ) . then ( ( methods ) => {
41
41
expect ( methods ) . toBeDefined ( )
42
42
} ) ;
43
43
} ) ;
44
44
45
- test ( "Must get all methods in a specific class in the application" , async ( ) => {
45
+ test ( "Should get all methods in a specific class in the application" , async ( ) => {
46
46
expect (
47
47
(
48
48
await daytraderJavaAnalysis . getAllMethodsByClass ( "com.ibm.websphere.samples.daytrader.impl.direct.TradeDirect" ) ) . length
49
49
) . toBeGreaterThan ( 0 )
50
50
} ) ;
51
51
52
- test ( "Must get a specific method in a specific class in the application" , async ( ) => {
52
+ test ( "Should get a specific method in a specific class in the application" , async ( ) => {
53
53
const method = await daytraderJavaAnalysis . getMethodByQualifiedName (
54
54
"com.ibm.websphere.samples.daytrader.impl.direct.TradeDirect" , "publishQuotePriceChange(QuoteDataBean, BigDecimal, BigDecimal, double)" ) ;
55
55
56
56
expect ( async ( ) => JCallable . parse ( method ) ) . not . toThrow ( ) ;
57
57
} ) ;
58
58
59
- test ( "Must get parameters of a specific method in a specific class in the application" , async ( ) => {
59
+ test ( "Should get parameters of a specific method in a specific class in the application" , async ( ) => {
60
60
const parameters = await daytraderJavaAnalysis . getMethodParameters (
61
61
"com.ibm.websphere.samples.daytrader.impl.direct.TradeDirect" , "publishQuotePriceChange(QuoteDataBean, BigDecimal, BigDecimal, double)" ) ;
62
62
@@ -70,7 +70,7 @@ test("Must get parameters of a specific method in a specific class in the applic
70
70
logger . success ( "All parameters are valid JCallableParameter instances" ) ;
71
71
} ) ;
72
72
73
- test ( "Must get parameters of a specific method in a specific class in the application given the callable object" , async ( ) => {
73
+ test ( "Should get parameters of a specific method in a specific class in the application given the callable object" , async ( ) => {
74
74
const method = await daytraderJavaAnalysis . getMethodByQualifiedName (
75
75
"com.ibm.websphere.samples.daytrader.impl.direct.TradeDirect" , "publishQuotePriceChange(QuoteDataBean, BigDecimal, BigDecimal, double)" ) ;
76
76
const parameters = await daytraderJavaAnalysis . getMethodParametersFromCallable ( method ) ;
@@ -85,3 +85,10 @@ test("Must get parameters of a specific method in a specific class in the applic
85
85
logger . success ( "All parameters are valid JCallableParameter instances" ) ;
86
86
} ) ;
87
87
88
+
89
+ test ( "Should get file path for a specific class in the application" , async ( ) => {
90
+ const filePath = await daytraderJavaAnalysis . getJavaFilePathByQualifiedName ( "com.ibm.websphere.samples.daytrader.impl.direct.TradeDirect" ) ;
91
+ expect ( filePath ) . toBeDefined ( ) ;
92
+ expect ( filePath ) . toContain (
93
+ "main/java/com/ibm/websphere/samples/daytrader/impl/direct/TradeDirect.java" ) ;
94
+ } ) ;
0 commit comments