YARN-28. Fixed TestCompositeService to not depend on test-order and thus made it pass on JDK7. Contributed by Thomas Graves.
svn merge --ignore-ancestry -c 1386907 ../../trunk/ git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1386937 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
bd85d36592
commit
02416b04ea
|
@ -14,6 +14,9 @@ Release 2.0.3-alpha - Unreleased
|
||||||
YARN-93. Fixed RM to propagate diagnostics from applications that have
|
YARN-93. Fixed RM to propagate diagnostics from applications that have
|
||||||
finished but failed (Jason Lowe via vinodkv).
|
finished but failed (Jason Lowe via vinodkv).
|
||||||
|
|
||||||
|
YARN-28. Fixed TestCompositeService to not depend on test-order and thus
|
||||||
|
made it pass on JDK7 (Thomas Graves via vinodkv).
|
||||||
|
|
||||||
OPTIMIZATIONS
|
OPTIMIZATIONS
|
||||||
|
|
||||||
BUG FIXES
|
BUG FIXES
|
||||||
|
|
|
@ -25,6 +25,7 @@ import org.apache.hadoop.conf.Configuration;
|
||||||
import org.apache.hadoop.yarn.YarnException;
|
import org.apache.hadoop.yarn.YarnException;
|
||||||
import org.apache.hadoop.yarn.service.CompositeService;
|
import org.apache.hadoop.yarn.service.CompositeService;
|
||||||
import org.apache.hadoop.yarn.service.Service.STATE;
|
import org.apache.hadoop.yarn.service.Service.STATE;
|
||||||
|
import org.junit.Before;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
public class TestCompositeService {
|
public class TestCompositeService {
|
||||||
|
@ -33,6 +34,11 @@ public class TestCompositeService {
|
||||||
|
|
||||||
private static final int FAILED_SERVICE_SEQ_NUMBER = 2;
|
private static final int FAILED_SERVICE_SEQ_NUMBER = 2;
|
||||||
|
|
||||||
|
@Before
|
||||||
|
public void setup() {
|
||||||
|
CompositeServiceImpl.resetCounter();
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testCallSequence() {
|
public void testCallSequence() {
|
||||||
ServiceManager serviceManager = new ServiceManager("ServiceManager");
|
ServiceManager serviceManager = new ServiceManager("ServiceManager");
|
||||||
|
@ -226,6 +232,10 @@ public class TestCompositeService {
|
||||||
counter = -1;
|
counter = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void resetCounter() {
|
||||||
|
counter = -1;
|
||||||
|
}
|
||||||
|
|
||||||
public void setThrowExceptionOnStart(boolean throwExceptionOnStart) {
|
public void setThrowExceptionOnStart(boolean throwExceptionOnStart) {
|
||||||
this.throwExceptionOnStart = throwExceptionOnStart;
|
this.throwExceptionOnStart = throwExceptionOnStart;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue