@@ -63,7 +63,6 @@ public void testLifeCycleMethod() throws Exception {
6363 runGetMethod ("/rest/lifecycle1" , 200 , "Resource: LifeCycleResource1" , true );
6464 runGetMethod ("/rest/lifecycle1" , 200 , "Resource: LifeCycleResource1" , true );
6565 runGetMethod ("/rest/lifecycle1" , 200 , "Resource: LifeCycleResource1" , true );
66- Thread .currentThread ();
6766 Thread .sleep (1500 );
6867
6968 assertLibertyMessage ("postConstruct method is called on com.ibm.ws.jaxrs20.cdi12.fat.lifecyclemethod.LifeCycleResource1" , 3 , "equal" );
@@ -74,30 +73,11 @@ public void testLifeCycleMethod() throws Exception {
7473 assertLibertyMessage ("preDestory method is called on com.ibm.ws.jaxrs20.cdi12.fat.lifecyclemethod.LifeCycleResource2" , 0 , "equal" );
7574
7675 Thread .sleep (1500 );
77- uninstallApplication ();
78- Thread .currentThread ();
76+ assertTrue ("Failed to remove app from dropins dir" , server .removeAndStopDropinsApplications (LIFECYCLEWAR ));
7977 Thread .sleep (1500 );
8078
8179 assertLibertyMessage ("preDestory method is called on com.ibm.ws.jaxrs20.cdi12.fat.lifecyclemethod.LifeCycleApplication" , 1 , "equal" );
8280 assertLibertyMessage ("preDestory method is called on com.ibm.ws.jaxrs20.cdi12.fat.lifecyclemethod.LifeCycleResource2" , 1 , "equal" );
8381
8482 }
85-
86- /*
87- * "remove the dropins app the way LibertyServer does (or just use the LibertyServer method)...
88- * Instead of deleting the file itself, move it to a path outside of dropins.
89- * That is more of an atomic operation and guarantees that for expanded applications
90- * we don't get one event with some file deletes, and then another with the rest."
91- */
92- protected void uninstallApplication () throws Exception {
93- boolean success = false ;
94- try {
95- String dropinsFilePath = server .getServerRoot () + "/dropins/" + LIFECYCLEWAR ;
96- String nonDropinsFilePath = server .getServerRoot () + "/" + LIFECYCLEWAR ;
97- success = LibertyFileManager .renameLibertyFile (server .getMachine (), dropinsFilePath , nonDropinsFilePath );
98- } catch (Exception e ) {
99- Log .warning (this .getClass (), e .getMessage ());
100- }
101- assertTrue ("Application lifecyclemethod does not appear to have removed." , success );
102- }
10383}
0 commit comments