import static org.mockito.Mockito.doThrow;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.verify;
+
import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture;
import org.junit.Assert;
import org.opendaylight.mdsal.singleton.common.api.ServiceGroupIdentifier;
/**
- * Testing {@link DOMClusterSingletonServiceProviderImpl} implementation
+ * Testing {@link DOMClusterSingletonServiceProviderImpl} implementation.
*/
public class DOMClusterSingletonServiceProviderImplTest {
private final DOMEntity doubleEntity = new DOMEntity(CLOSE_SERVICE_ENTITY_TYPE, SERVICE_NAME);
/**
- * Initialization functionality for every Tests in this suite
+ * Initialization functionality for every Tests in this suite.
*
- * @throws Exception
+ * @throws Exception if the condition does not meet
*/
@Before
public void setup() throws Exception {
}
/**
- * Test checks NullPointer for null {@link DOMEntityOwnershipService} input value
+ * Test checks NullPointer for null {@link DOMEntityOwnershipService} input value.
*
- * @throws Exception
+ * @throws Exception if the condition does not meet
*/
@Test(expected = NullPointerException.class)
public void initializationClusterSingletonServiceProviderNullInputTest() throws Exception {
}
/**
- * Test GoldPath for close {@link DOMClusterSingletonServiceProviderImpl}
+ * Test GoldPath for close {@link DOMClusterSingletonServiceProviderImpl}.
*
- * @throws Exception
+ * @throws Exception if the condition does not meet
*/
@Test
public void closeClusterSingletonServiceProviderTest() throws Exception {
}
/**
- * Test parser ServiceIdentifier from Entity
+ * Test parser ServiceIdentifier from Entity.
*
- * @throws Exception
+ * @throws Exception if the condition does not meet
*/
@Test
public void makeEntityClusterSingletonServiceProviderTest() throws Exception {
}
/**
- * Test parser ServiceIdentifier from Entity
+ * Test parser ServiceIdentifier from Entity.
*
- * @throws Exception
+ * @throws Exception if the condition does not meet
*/
@Test
public void getIdentifierClusterSingletonServiceProviderTest() throws Exception {
}
/**
- * Test GoldPath for initialization {@link ClusterSingletonService}
+ * Test GoldPath for initialization {@link ClusterSingletonService}.
*
- * @throws Exception
+ * @throws Exception if the condition does not meet
*/
@Test
public void initializationClusterSingletonServiceTest() throws Exception {
}
/**
- * Test GoldPath for initialization with init ownership result SLAVE {@link ClusterSingletonService}
+ * Test GoldPath for initialization with init ownership result SLAVE {@link ClusterSingletonService}.
*
- * @throws Exception
+ * @throws Exception if the condition does not meet
*/
@Test
public void slaveInitClusterSingletonServiceTest() throws Exception {
}
/**
- * Test GoldPath for initialization with init ownership result SLAVE, but NO-MASTER {@link ClusterSingletonService}
+ * Test GoldPath for initialization with init ownership result SLAVE, but NO-MASTER {@link ClusterSingletonService}.
*
- * @throws Exception
+ * @throws Exception if the condition does not meet
*/
@Test
public void slaveInitNoMasterClusterSingletonServiceTest() throws Exception {
}
/**
- * Test GoldPath for initialization with init ownership result MASTER {@link ClusterSingletonService}
+ * Test GoldPath for initialization with init ownership result MASTER {@link ClusterSingletonService}.
*
- * @throws Exception
+ * @throws Exception if the condition does not meet
*/
@Test
public void masterInitClusterSingletonServiceTest() throws Exception {
}
/**
- * Test GoldPath for initialization with init ownership result MASTER {@link ClusterSingletonService}
+ * Test GoldPath for initialization with init ownership result MASTER {@link ClusterSingletonService}.
*
- * @throws Exception
+ * @throws Exception if the condition does not meet
*/
@Test
public void masterInitSlaveDoubleCandidateClusterSingletonServiceTest() throws Exception {
}
/**
- * Test GoldPath for takeLeadership with ownership result MASTER {@link ClusterSingletonService}
+ * Test GoldPath for takeLeadership with ownership result MASTER {@link ClusterSingletonService}.
*
- * @throws Exception
+ * @throws Exception if the condition does not meet
*/
@Test
public void takeLeadershipClusterSingletonServiceTest() throws Exception {
}
/**
- * Test GoldPath for initialization with init ownership result MASTER {@link ClusterSingletonService}
+ * Test GoldPath for initialization with init ownership result MASTER {@link ClusterSingletonService}.
*
- * @throws Exception
+ * @throws Exception if the condition does not meet
*/
@Test
public void masterInitClusterSingletonServiceTwoServicesTest() throws Exception {
}
/**
- * Test GoldPath for takeLeadership with ownership result MASTER {@link ClusterSingletonService}
+ * Test GoldPath for takeLeadership with ownership result MASTER {@link ClusterSingletonService}.
*
- * @throws Exception
+ * @throws Exception if the condition does not meet
*/
@Test
public void takeLeadershipClusterSingletonServiceTwoAddDuringWaitPhaseServicesTest() throws Exception {
}
/**
- * Test GoldPath for takeLeadership with ownership result MASTER {@link ClusterSingletonService}
+ * Test GoldPath for takeLeadership with ownership result MASTER {@link ClusterSingletonService}.
*
- * @throws Exception
+ * @throws Exception if the condition does not meet
*/
@Test
public void takeLeadershipClusterSingletonServiceTowServicesTest() throws Exception {
}
/**
- * Test checks CandidateAlreadyRegisteredException processing in initialization phase
+ * Test checks CandidateAlreadyRegisteredException processing in initialization phase.
*
- * @throws Exception
+ * @throws Exception if the condition does not meet
*/
@Test
public void initializationClusterSingletonServiceCandidateAlreadyRegistredTest() throws Exception {
/**
* Test GoldPath for lostLeadership during tryToTakeLeadership with ownership result MASTER
- * {@link ClusterSingletonService}
+ * {@link ClusterSingletonService}.
*
- * @throws Exception
+ * @throws Exception if the condition does not meet
*/
@Test
public void lostLeadershipDuringTryToTakeLeadershipClusterSingletonServiceTest() throws Exception {
}
/**
- * Test GoldPath for lostLeadership with ownership result MASTER-TO-SLAVE {@link ClusterSingletonService}
+ * Test GoldPath for lostLeadership with ownership result MASTER-TO-SLAVE {@link ClusterSingletonService}.
*
- * @throws Exception
+ * @throws Exception if the condition does not meet
*/
@Test
public void lostLeadershipClusterSingletonServiceTest() throws Exception {
}
/**
- * Test checks umexpected change for MASTER-TO-SLAVE double Candidate role change
+ * Test checks umexpected change for MASTER-TO-SLAVE double Candidate role change.
*
- * @throws Exception
+ * @throws Exception if the condition does not meet
*/
@Test
public void unexpectedLostLeadershipDoubleCandidateTest() throws Exception {
}
/**
- * Test checks inJeopardy Cluster Node state for Master Instance
+ * Test checks inJeopardy Cluster Node state for Master Instance.
*
- * @throws Exception
+ * @throws Exception if the condition does not meet
*/
@Test
public void inJeopardyMasterTest() throws Exception {
}
/**
- * Test checks inJeopardy Cluster Node state for Slave Instance
+ * Test checks inJeopardy Cluster Node state for Slave Instance.
*
- * @throws Exception
+ * @throws Exception if the condition does not meet
*/
@Test
public void inJeopardySlaveTest() throws Exception {
}
/**
- * Test checks close procesing for {@link ClusterSingletonServiceRegistration}
+ * Test checks close processing for {@link ClusterSingletonServiceRegistration}.
*
- * @throws Exception
+ * @throws Exception if the condition does not meet
*/
@Test
public void closeClusterSingletonServiceRegistrationNoRoleTest() throws Exception {
}
/**
- * Test checks close procesing for {@link ClusterSingletonServiceRegistration}
+ * Test checks close procesing for {@link ClusterSingletonServiceRegistration}.
*
- * @throws Exception
+ * @throws Exception if the condition does not meet
*/
@Test
public void closeClusterSingletonServiceRegistrationNoRoleTwoServicesTest() throws Exception {
}
/**
- * Test checks close procesing for {@link ClusterSingletonServiceRegistration}
+ * Test checks close procesing for {@link ClusterSingletonServiceRegistration}.
*
- * @throws Exception
+ * @throws Exception if the condition does not meet
*/
@Test
public void closeClusterSingletonServiceRegistrationSlaveTest() throws Exception {
}
/**
- * Test checks close procesing for {@link ClusterSingletonServiceRegistration}
+ * Test checks close procesing for {@link ClusterSingletonServiceRegistration}.
*
- * @throws Exception
+ * @throws Exception if the condition does not meet
*/
@Test
public void closeClusterSingletonServiceRegistrationSlaveTwoServicesTest() throws Exception {
}
/**
- * Test checks close procesing for {@link ClusterSingletonServiceRegistration}
+ * Test checks close procesing for {@link ClusterSingletonServiceRegistration}.
*
- * @throws Exception
+ * @throws Exception if the condition does not meet
*/
@Test
public void closeClusterSingletonServiceRegistrationMasterTest() throws Exception {
}
/**
- * Test checks close procesing for {@link ClusterSingletonServiceRegistration}
+ * Test checks close procesing for {@link ClusterSingletonServiceRegistration}.
*
- * @throws Exception
+ * @throws Exception if the condition does not meet
*/
@Test
public void closeClusterSingletonServiceRegistrationMasterTwoServicesTest() throws Exception {
}
/**
- * Test checks validation Error processing for SLAVE-TO-MASTER entity Candidate role change
+ * Test checks validation Error processing for SLAVE-TO-MASTER entity Candidate role change.
*
- * @throws Exception
+ * @throws Exception if the condition does not meet
*/
@Test
public void tryToTakeLeaderForClosedServiceRegistrationTest() throws Exception {
}
/**
- * Base states for AbstractClusterProjectProvider
+ * Base states for AbstractClusterProjectProvider.
*/
- static enum TestClusterSingletonServiceState {
+ enum TestClusterSingletonServiceState {
/**
- * State represents a correct Instantiated process
+ * State represents a correct Instantiated process.
*/
STARTED,
/**
- * State represents a correct call abstract method instantiatingProject
+ * State represents a correct call abstract method instantiatingProject.
*/
INITIALIZED,
/**
- * State represents a correct call abstract method destryingProject
+ * State represents a correct call abstract method destryingProject.
*/
DESTROYED;
}
/**
- * Test implementation of {@link ClusterSingletonService}
+ * Test implementation of {@link ClusterSingletonService}.
*/
class TestClusterSingletonServiceInstance implements ClusterSingletonService {
- private final ServiceGroupIdentifier SERVICE_IDENT = ServiceGroupIdentifier.create(SERVICE_NAME);
+ private final ServiceGroupIdentifier serviceIndent = ServiceGroupIdentifier.create(SERVICE_NAME);
private TestClusterSingletonServiceState serviceState;
- public TestClusterSingletonServiceInstance() {
+ TestClusterSingletonServiceInstance() {
this.serviceState = TestClusterSingletonServiceState.INITIALIZED;
}
@Override
public ServiceGroupIdentifier getIdentifier() {
- return SERVICE_IDENT;
+ return serviceIndent;
}
}
}