import java.util.List;
import java.util.Set;
-import org.junit.BeforeClass;
import org.junit.Test;
+
import org.opendaylight.controller.hosttracker.hostAware.HostNodeConnector;
import org.opendaylight.controller.sal.core.ConstructionException;
import org.opendaylight.controller.sal.core.Node;
*/
private byte[] hostMac = new byte [] { 0x00, 0x00, 0x00, 0x11, 0x22, 0x33};
-
- @BeforeClass
- public static void beforeClass() {
- stubMode = 2;
+ /**
+ * Construct a new instance.
+ */
+ public ArpHandlerTest() {
+ super(2);
}
/**
import java.util.Map;
import java.util.Set;
-import org.junit.BeforeClass;
import org.junit.Test;
import org.opendaylight.controller.sal.core.Edge;
*/
public class EdgeUpdateStateTest extends TestUseVTNManagerBase {
/**
- * Called when the test class is loaded.
+ * Construct a new instance.
*/
- @BeforeClass
- public static void beforeClass() {
- stubMode = 2;
+ public EdgeUpdateStateTest() {
+ super(2);
}
/**
/*
- * Copyright (c) 2013 NEC Corporation
+ * Copyright (c) 2013-2014 NEC Corporation
* All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 which accompanies this
* distribution, and is available at http://www.eclipse.org/legal/epl-v10.html
*/
+
package org.opendaylight.vtn.manager.internal;
import java.util.Hashtable;
import org.apache.felix.dm.impl.ComponentImpl;
import org.junit.Before;
-import org.junit.BeforeClass;
+
import org.opendaylight.controller.clustering.services.IClusterGlobalServices;
import org.opendaylight.controller.forwardingrulesmanager.FlowConfig;
import org.opendaylight.controller.forwardingrulesmanager.FlowEntry;
}
}
-
- @BeforeClass
- static public void beforeClass() {
- stubMode = 2;
+ /**
+ * Construct a new instance.
+ */
+ public FlowModTaskTestBase() {
+ super(2);
}
@Before
import java.util.concurrent.ConcurrentMap;
import org.apache.felix.dm.impl.ComponentImpl;
-import org.junit.BeforeClass;
+
import org.junit.Test;
import org.opendaylight.controller.sal.core.ConstructionException;
}
/**
- * setup a test environment for MacAddressTableTest.
+ * Construct a new instance.
*/
- @BeforeClass
- static public void beforeClass() {
- stubMode = 2;
+ public MacAddressTableTest() {
+ super(2);
}
-
/**
* Test case for {@link MacAddressTable#getTableKey(byte [])}.
*/
import java.util.Set;
import java.util.concurrent.ConcurrentMap;
-import org.junit.BeforeClass;
import org.junit.Test;
+
import org.opendaylight.controller.sal.core.ConstructionException;
import org.opendaylight.controller.sal.core.Node;
import org.opendaylight.controller.sal.core.NodeConnector;
* JUnit test for {@link PacketContext}.
*/
public class PacketContextTest extends TestUseVTNManagerBase {
-
- @BeforeClass
- public static void beforeClass() {
- stubMode = 2;
+ /**
+ * Construct a new instance.
+ */
+ public PacketContextTest() {
+ super(2);
}
/**
/*
- * Copyright (c) 2013 NEC Corporation
+ * Copyright (c) 2013-2014 NEC Corporation
* All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 which accompanies this
* distribution, and is available at http://www.eclipse.org/legal/epl-v10.html
*/
+
package org.opendaylight.vtn.manager.internal;
import java.util.HashSet;
import java.util.Timer;
import java.util.TimerTask;
-import org.junit.BeforeClass;
import org.junit.Test;
+
import org.opendaylight.controller.forwardingrulesmanager.FlowEntry;
import org.opendaylight.controller.sal.core.Node;
import org.opendaylight.controller.sal.core.NodeConnector;
*/
public class RemoteFlowRequestTest extends TestUseVTNManagerBase {
- @BeforeClass
- static public void beforeClass() {
- stubMode = 2;
+ /**
+ * Construct a new instance.
+ */
+ public RemoteFlowRequestTest() {
+ super(2);
}
/**
/*
- * Copyright (c) 2013 NEC Corporation
+ * Copyright (c) 2013-2014 NEC Corporation
* All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 which accompanies this
* distribution, and is available at http://www.eclipse.org/legal/epl-v10.html
*/
+
package org.opendaylight.vtn.manager.internal;
import java.io.File;
* Common class for test of using VTNManager.
*/
public class TestUseVTNManagerBase extends TestBase {
- protected VTNManagerImpl vtnMgr = null;
+ protected VTNManagerImpl vtnMgr;
protected GlobalResourceManager resMgr;
- protected TestStub stubObj = null;
- protected static int stubMode = 0;
- protected static int clusterMode = 0;
+ protected TestStub stubObj;
+ protected int stubMode;
+
+ /**
+ * Construct a new instance.
+ *
+ * @param stub An integer value to be passed to {@link TestStub}.
+ */
+ protected TestUseVTNManagerBase(int stub) {
+ stubMode = stub;
+ }
@Before
public void before() {
/*
- * Copyright (c) 2013 NEC Corporation
+ * Copyright (c) 2013-2014 NEC Corporation
* All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 which accompanies this
* distribution, and is available at http://www.eclipse.org/legal/epl-v10.html
*/
+
package org.opendaylight.vtn.manager.internal;
import java.util.ArrayList;
import java.util.concurrent.locks.ReentrantReadWriteLock.ReadLock;
import org.apache.felix.dm.impl.ComponentImpl;
+
import org.junit.Before;
-import org.junit.BeforeClass;
+
import org.opendaylight.controller.clustering.services.IClusterContainerServices;
import org.opendaylight.vtn.manager.internal.cluster.ClusterEvent;
import org.opendaylight.vtn.manager.internal.cluster.ClusterEventId;
*/
public class VNodeEventTestBase extends TestUseVTNManagerBase {
- @BeforeClass
- public static void beforeClass() {
- stubMode = 3;
+ /**
+ * Construct a new instance.
+ */
+ public VNodeEventTestBase() {
+ super(3);
}
@Before
lock.lock();
vtnMgr.unlock(lock, false);
}
-}
\ No newline at end of file
+}
import java.util.Set;
import java.util.concurrent.ConcurrentMap;
-import org.junit.BeforeClass;
import org.junit.Test;
import org.opendaylight.vtn.manager.VBridgeIfPath;
*/
public class VTNFlowDatabaseTest extends TestUseVTNManagerBase {
- @BeforeClass
- public static void beforeClass() {
- stubMode = 2;
+ /**
+ * Construct a new instance.
+ */
+ public VTNFlowDatabaseTest() {
+ super(2);
}
/**
import org.apache.felix.dm.Component;
import org.apache.felix.dm.impl.ComponentImpl;
+
import org.junit.Before;
-import org.junit.BeforeClass;
import org.junit.Test;
import org.opendaylight.controller.forwardingrulesmanager.FlowEntry;
* </p>
*/
public class VTNManagerImplClusterTest extends VTNManagerImplTestCommon {
-
- @BeforeClass
- public static void beforeClass() {
- stubMode = 3;
+ /**
+ * Construct a new instance.
+ */
+ public VTNManagerImplClusterTest() {
+ super(3);
}
@Before
import org.apache.felix.dm.Component;
import org.apache.felix.dm.impl.ComponentImpl;
-import org.junit.BeforeClass;
+
import org.junit.Test;
import org.opendaylight.vtn.manager.IVTNManagerAware;
* </p>
*/
public class VTNManagerImplTest extends VTNManagerImplTestCommon {
-
- @BeforeClass
- public static void beforeClass() {
- stubMode = 0;
+ /**
+ * Construct a new instance.
+ */
+ public VTNManagerImplTest() {
+ super(0);
}
/**
* terms of the Eclipse Public License v1.0 which accompanies this
* distribution, and is available at http://www.eclipse.org/legal/epl-v10.html
*/
+
package org.opendaylight.vtn.manager.internal;
import java.util.List;
* Common class for tests of {@link VTNManagerImpl}.
*/
public class VTNManagerImplTestCommon extends TestUseVTNManagerBase {
+ /**
+ * Construct a new instance.
+ *
+ * @param stub An integer value to be passed to {@link TestStub}.
+ */
+ protected VTNManagerImplTestCommon(int stub) {
+ super(stub);
+ }
/**
* method for setup the environment.
import org.apache.felix.dm.Component;
import org.apache.felix.dm.impl.ComponentImpl;
-import org.junit.BeforeClass;
+
import org.junit.Test;
import org.opendaylight.controller.clustering.services.IClusterContainerServices;
* </p>
*/
public class VTNManagerImplWithNodesTest extends VTNManagerImplTestCommon {
-
- @BeforeClass
- public static void beforeClass() {
- stubMode = 2;
+ /**
+ * Construct a new instance.
+ */
+ public VTNManagerImplWithNodesTest() {
+ super(2);
}
/**
/*
- * Copyright (c) 2013 NEC Corporation
+ * Copyright (c) 2013-2014 NEC Corporation
* All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 which accompanies this
* distribution, and is available at http://www.eclipse.org/legal/epl-v10.html
*/
+
package org.opendaylight.vtn.manager.internal;
import java.util.HashSet;
import java.util.concurrent.locks.ReentrantReadWriteLock;
import org.junit.Test;
+
import org.opendaylight.controller.sal.core.Node;
import org.opendaylight.controller.sal.core.NodeConnector;
import org.opendaylight.controller.sal.match.Match;
import org.opendaylight.vtn.manager.internal.cluster.VTNFlow;
/**
- * JUnit Test for {@link VTNThreadData}
+ * JUnit Test for {@link VTNThreadData}.
*/
public class VTNThreadDataTest extends TestUseVTNManagerBase {
+ /**
+ * Construct a new instance.
+ */
+ public VTNThreadDataTest() {
+ super(2);
+ }
/**
* Test method for {@link VTNThreadData#create(Lock)}.