|
@@ -25,6 +25,7 @@ import org.apache.hadoop.conf.Configuration;
|
|
|
import org.apache.hadoop.yarn.YarnException;
|
|
|
import org.apache.hadoop.yarn.service.CompositeService;
|
|
|
import org.apache.hadoop.yarn.service.Service.STATE;
|
|
|
+import org.junit.Before;
|
|
|
import org.junit.Test;
|
|
|
|
|
|
public class TestCompositeService {
|
|
@@ -33,6 +34,11 @@ public class TestCompositeService {
|
|
|
|
|
|
private static final int FAILED_SERVICE_SEQ_NUMBER = 2;
|
|
|
|
|
|
+ @Before
|
|
|
+ public void setup() {
|
|
|
+ CompositeServiceImpl.resetCounter();
|
|
|
+ }
|
|
|
+
|
|
|
@Test
|
|
|
public void testCallSequence() {
|
|
|
ServiceManager serviceManager = new ServiceManager("ServiceManager");
|
|
@@ -226,6 +232,10 @@ public class TestCompositeService {
|
|
|
counter = -1;
|
|
|
}
|
|
|
|
|
|
+ public static void resetCounter() {
|
|
|
+ counter = -1;
|
|
|
+ }
|
|
|
+
|
|
|
public void setThrowExceptionOnStart(boolean throwExceptionOnStart) {
|
|
|
this.throwExceptionOnStart = throwExceptionOnStart;
|
|
|
}
|