svn commit: r1757360 - /ofbiz/trunk/framework/start/src/test/java/org/apache/ofbiz/base/start/OfbizStartupUnitTests.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r1757360 - /ofbiz/trunk/framework/start/src/test/java/org/apache/ofbiz/base/start/OfbizStartupUnitTests.java

Taher Alkhateeb
Author: taher
Date: Tue Aug 23 11:42:21 2016
New Revision: 1757360

URL: http://svn.apache.org/viewvc?rev=1757360&view=rev
Log:
remove unit tests from the start component that cause a regression - OFBIZ-7897

There were two tests in the start component that have a hidden regression which
can be repeated as follows:

- start ofbiz with a normal ./gradlew "ofbiz --start"
- Make some changes to the code
- stop ofbiz with ./gradlew "ofbiz --shutdown"

OFBiz will fail to stop because the unit tests will fail due to changed code
while OFBiz is still active.

The correct solution is to convert these tests to integration tests and handle the different
scenarios while the AdminServer is up.

Modified:
    ofbiz/trunk/framework/start/src/test/java/org/apache/ofbiz/base/start/OfbizStartupUnitTests.java

Modified: ofbiz/trunk/framework/start/src/test/java/org/apache/ofbiz/base/start/OfbizStartupUnitTests.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/start/src/test/java/org/apache/ofbiz/base/start/OfbizStartupUnitTests.java?rev=1757360&r1=1757359&r2=1757360&view=diff
==============================================================================
--- ofbiz/trunk/framework/start/src/test/java/org/apache/ofbiz/base/start/OfbizStartupUnitTests.java (original)
+++ ofbiz/trunk/framework/start/src/test/java/org/apache/ofbiz/base/start/OfbizStartupUnitTests.java Tue Aug 23 11:42:21 2016
@@ -68,23 +68,4 @@ public class OfbizStartupUnitTests {
         assertThat(startupCommands.size(), equalTo(1));
         assertThat(startupCommands.get(0).getProperties().size(), equalTo(3));
     }
-
-    @Test
-    public void adminClientReturnsTheCorrectMessageIfServerIsDownOnStatus() throws StartupException {
-        Config config = sendRequestToAdminClient("--status");
-
-        assertThat(AdminClient.requestStatus(config), equalTo("OFBiz is Down"));
-    }
-
-    @Test
-    public void adminClientReturnsTheCorrectMessageIfServerIsDownOnShutdown() throws StartupException {
-        Config config = sendRequestToAdminClient("--shutdown");
-
-        assertThat(AdminClient.requestShutdown(config), equalTo("OFBiz is Down"));
-    }
-
-    private Config sendRequestToAdminClient(String request) throws StartupException {
-        List<StartupCommand> startupCommands = StartupCommandUtil.parseOfbizCommands(new String[]{request});
-        return new Config(startupCommands);
-    }
 }