From b455e547499895e803115721a39112c0523ad39a Mon Sep 17 00:00:00 2001 From: Todd Lipcon Date: Fri, 6 Apr 2012 05:32:02 +0000 Subject: [PATCH] Fix trivial mistake in test code in previous merge - tests were failing due to misuse of NodeFencer.create git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/HDFS-3042@1310176 13f79535-47bb-0310-9956-ffa450edef68 --- .../src/test/java/org/apache/hadoop/ha/DummyHAService.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ha/DummyHAService.java b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ha/DummyHAService.java index 3173310032..62a381bd21 100644 --- a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ha/DummyHAService.java +++ b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ha/DummyHAService.java @@ -37,6 +37,7 @@ */ class DummyHAService extends HAServiceTarget { public static final Log LOG = LogFactory.getLog(DummyHAService.class); + private static final String DUMMY_FENCE_KEY = "dummy.fence.key"; volatile HAServiceState state; HAServiceProtocol proxy; NodeFencer fencer; @@ -55,8 +56,9 @@ class DummyHAService extends HAServiceTarget { this.proxy = makeMock(); try { Configuration conf = new Configuration(); - this.fencer = Mockito.spy(NodeFencer.create(conf, - DummyFencer.class.getName())); + conf.set(DUMMY_FENCE_KEY, DummyFencer.class.getName()); + this.fencer = Mockito.spy( + NodeFencer.create(conf, DUMMY_FENCE_KEY)); } catch (BadFencingConfigurationException e) { throw new RuntimeException(e); }