File tree Expand file tree Collapse file tree 1 file changed +19
-6
lines changed
vanillajava/src/test/java/com/example Expand file tree Collapse file tree 1 file changed +19
-6
lines changed Original file line number Diff line number Diff line change @@ -16,19 +16,32 @@ public class SimpleTest {
1616 public static void main (String [] args ) {
1717 SimpleTest test = new SimpleTest ();
1818
19+ boolean allTestsPassed = true ;
20+
21+ System .out .println ("Starting Add to Cart test..." );
1922 try {
20- System .out .println ("Starting Add to Cart test..." );
2123 test .testAddToCartBStackDemo ();
2224 System .out .println ("Add to Cart test completed successfully!" );
23-
24- System .out .println ("\n Starting Checkout Flow test..." );
25+ } catch (Exception e ) {
26+ System .err .println ("Add to Cart test failed: " + e .getMessage ());
27+ e .printStackTrace ();
28+ allTestsPassed = false ;
29+ }
30+
31+ System .out .println ("\n Starting Checkout Flow test..." );
32+ try {
2533 test .testCheckoutFlowBStackDemo ();
2634 System .out .println ("Checkout Flow test completed successfully!" );
27-
28- System .out .println ("\n All tests passed!" );
2935 } catch (Exception e ) {
30- System .err .println ("Test failed: " + e .getMessage ());
36+ System .err .println ("Checkout Flow test failed: " + e .getMessage ());
3137 e .printStackTrace ();
38+ allTestsPassed = false ;
39+ }
40+
41+ if (allTestsPassed ) {
42+ System .out .println ("\n All tests passed!" );
43+ } else {
44+ System .err .println ("\n One or more tests failed." );
3245 System .exit (1 );
3346 }
3447 }
You can’t perform that action at this time.
0 commit comments