HDDS-911. Make TestOzoneManager unit tests independent. Contributed by Elek Marton.

This commit is contained in:
Bharat Viswanadham 2018-12-18 10:52:29 -08:00
parent c5c73182e5
commit 2f6bc25044
1 changed files with 14 additions and 14 deletions

View File

@ -63,9 +63,9 @@ import org.apache.hadoop.utils.db.Table;
import org.apache.hadoop.utils.db.Table.KeyValue; import org.apache.hadoop.utils.db.Table.KeyValue;
import org.apache.hadoop.utils.db.TableIterator; import org.apache.hadoop.utils.db.TableIterator;
import org.apache.ratis.util.LifeCycle; import org.apache.ratis.util.LifeCycle;
import org.junit.AfterClass; import org.junit.After;
import org.junit.Assert; import org.junit.Assert;
import org.junit.BeforeClass; import org.junit.Before;
import org.junit.Ignore; import org.junit.Ignore;
import org.junit.Rule; import org.junit.Rule;
import org.junit.Test; import org.junit.Test;
@ -98,14 +98,14 @@ import static org.apache.hadoop.hdds.scm.ScmConfigKeys
* Test Ozone Manager operation in distributed handler scenario. * Test Ozone Manager operation in distributed handler scenario.
*/ */
public class TestOzoneManager { public class TestOzoneManager {
private static MiniOzoneCluster cluster = null; private MiniOzoneCluster cluster = null;
private static StorageHandler storageHandler; private StorageHandler storageHandler;
private static UserArgs userArgs; private UserArgs userArgs;
private static OMMetrics omMetrics; private OMMetrics omMetrics;
private static OzoneConfiguration conf; private OzoneConfiguration conf;
private static String clusterId; private String clusterId;
private static String scmId; private String scmId;
private static String omId; private String omId;
@Rule @Rule
public ExpectedException exception = ExpectedException.none(); public ExpectedException exception = ExpectedException.none();
@ -117,8 +117,8 @@ public class TestOzoneManager {
* *
* @throws IOException * @throws IOException
*/ */
@BeforeClass @Before
public static void init() throws Exception { public void init() throws Exception {
conf = new OzoneConfiguration(); conf = new OzoneConfiguration();
clusterId = UUID.randomUUID().toString(); clusterId = UUID.randomUUID().toString();
scmId = UUID.randomUUID().toString(); scmId = UUID.randomUUID().toString();
@ -140,8 +140,8 @@ public class TestOzoneManager {
/** /**
* Shutdown MiniDFSCluster. * Shutdown MiniDFSCluster.
*/ */
@AfterClass @After
public static void shutdown() { public void shutdown() {
if (cluster != null) { if (cluster != null) {
cluster.shutdown(); cluster.shutdown();
} }