@@ -3,30 +3,30 @@ import { daytraderJavaAnalysis } from "../../../conftest";
33import { expect , test } from "bun:test" ;
44import { logger } from "../../../../src/utils" ;
55
6- test ( "Must get analysis object from JavaAnalysis object" , ( ) => {
6+ test ( "Should get analysis object from JavaAnalysis object" , ( ) => {
77 expect ( daytraderJavaAnalysis ) . toBeDefined ( ) ;
88} ) ;
99
10- test ( "Must get JApplication instance" , async ( ) => {
10+ test ( "Should get JApplication instance" , async ( ) => {
1111 const jApplication = await daytraderJavaAnalysis . getApplication ( ) ;
1212 expect ( jApplication ) . toBeDefined ( ) ;
1313} ) ;
1414
15- test ( "Must get Symbol Table" , async ( ) => {
15+ test ( "Should get Symbol Table" , async ( ) => {
1616 const symbolTable = await daytraderJavaAnalysis . getSymbolTable ( ) ;
1717 expect ( symbolTable ) . toBeDefined ( ) ;
1818} ) ;
1919
20- test ( "Must get all classes in a Java application" , async ( ) => {
20+ test ( "Should get all classes in a Java application" , async ( ) => {
2121 await expect ( daytraderJavaAnalysis . getAllClasses ( ) ) . toBeDefined ( ) ;
2222} ) ;
2323
24- test ( "Must get a specific class the application" , async ( ) => {
24+ test ( "Should get a specific class the application" , async ( ) => {
2525 const tradeDirectObject = await daytraderJavaAnalysis . getClassByQualifiedName ( "com.ibm.websphere.samples.daytrader.impl.direct.TradeDirect" ) ;
2626 expect ( async ( ) => JType . parse ( tradeDirectObject ) ) . not . toThrow ( ) ;
2727} ) ;
2828
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 ( ) => {
3030 /**
3131 * Quick note to self: There is a subtle difference between await expect(...) and expect(await ...)
3232 * 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"
3636 "Class this.class.does.not.Exist not found in the application." ) ;
3737} ) ;
3838
39- test ( "Must get all methods in the application" , ( ) => {
39+ test ( "Should get all methods in the application" , ( ) => {
4040 return daytraderJavaAnalysis . getAllMethods ( ) . then ( ( methods ) => {
4141 expect ( methods ) . toBeDefined ( )
4242 } ) ;
4343} ) ;
4444
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 ( ) => {
4646 expect (
4747 (
4848 await daytraderJavaAnalysis . getAllMethodsByClass ( "com.ibm.websphere.samples.daytrader.impl.direct.TradeDirect" ) ) . length
4949 ) . toBeGreaterThan ( 0 )
5050} ) ;
5151
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 ( ) => {
5353 const method = await daytraderJavaAnalysis . getMethodByQualifiedName (
5454 "com.ibm.websphere.samples.daytrader.impl.direct.TradeDirect" , "publishQuotePriceChange(QuoteDataBean, BigDecimal, BigDecimal, double)" ) ;
5555
5656 expect ( async ( ) => JCallable . parse ( method ) ) . not . toThrow ( ) ;
5757} ) ;
5858
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 ( ) => {
6060 const parameters = await daytraderJavaAnalysis . getMethodParameters (
6161 "com.ibm.websphere.samples.daytrader.impl.direct.TradeDirect" , "publishQuotePriceChange(QuoteDataBean, BigDecimal, BigDecimal, double)" ) ;
6262
@@ -70,7 +70,7 @@ test("Must get parameters of a specific method in a specific class in the applic
7070 logger . success ( "All parameters are valid JCallableParameter instances" ) ;
7171} ) ;
7272
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 ( ) => {
7474 const method = await daytraderJavaAnalysis . getMethodByQualifiedName (
7575 "com.ibm.websphere.samples.daytrader.impl.direct.TradeDirect" , "publishQuotePriceChange(QuoteDataBean, BigDecimal, BigDecimal, double)" ) ;
7676 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
8585 logger . success ( "All parameters are valid JCallableParameter instances" ) ;
8686} ) ;
8787
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