|
|
@ -24,6 +24,8 @@ public class LifecycleManagementTest {
|
|
|
|
private final String NON_UPDATABLE_STATE = "Removed";
|
|
|
|
private final String NON_UPDATABLE_STATE = "Removed";
|
|
|
|
private final String INSTALLABLE_STATE = "Published";
|
|
|
|
private final String INSTALLABLE_STATE = "Published";
|
|
|
|
private final String UNINSTALlABLE_STATE = "Removed";
|
|
|
|
private final String UNINSTALlABLE_STATE = "Removed";
|
|
|
|
|
|
|
|
private final String INITIAL_STATE = "Created";
|
|
|
|
|
|
|
|
private final String END_STATE = "Removed";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@BeforeClass
|
|
|
|
@BeforeClass
|
|
|
@ -49,36 +51,83 @@ public class LifecycleManagementTest {
|
|
|
|
proceedingStates.contains(BOGUS_STATE.toUpperCase()));
|
|
|
|
proceedingStates.contains(BOGUS_STATE.toUpperCase()));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// @Test
|
|
|
|
@Test
|
|
|
|
// public void CheckUpdatableState() {
|
|
|
|
public void CheckUpdatableState() throws LifecycleManagementException {
|
|
|
|
// boolean isUpdatableState = lifecycleStateManager.isUpdatableState(UPDATABLE_STATE);
|
|
|
|
boolean isUpdatable = lifecycleStateManager.isUpdatable(UPDATABLE_STATE);
|
|
|
|
// System.out.println(isUpdatableState);
|
|
|
|
System.out.println(isUpdatable);
|
|
|
|
// Assert.assertTrue("Updatable state: " + UPDATABLE_STATE, isUpdatableState);
|
|
|
|
Assert.assertTrue("Updatable state: " + UPDATABLE_STATE, isUpdatable);
|
|
|
|
// }
|
|
|
|
}
|
|
|
|
//
|
|
|
|
|
|
|
|
// @Test
|
|
|
|
@Test
|
|
|
|
// public void CheckNonUpdatableState() {
|
|
|
|
public void CheckNonUpdatableState() throws LifecycleManagementException {
|
|
|
|
// boolean isUpdatableState = lifecycleStateManager.isUpdatableState(NON_UPDATABLE_STATE);
|
|
|
|
boolean isUpdatable = lifecycleStateManager.isUpdatable(NON_UPDATABLE_STATE);
|
|
|
|
// Assert.assertFalse("Non Updatable state: " + NON_UPDATABLE_STATE, isUpdatableState);
|
|
|
|
Assert.assertFalse("Non Updatable state: " + NON_UPDATABLE_STATE, isUpdatable);
|
|
|
|
// }
|
|
|
|
}
|
|
|
|
//
|
|
|
|
|
|
|
|
// @Test
|
|
|
|
@Test
|
|
|
|
// public void CheckInstallableState() {
|
|
|
|
public void CheckInstallableState() throws LifecycleManagementException {
|
|
|
|
// boolean isInstallableState = lifecycleStateManager.isInstallableState(INSTALLABLE_STATE);
|
|
|
|
boolean isInstallable = lifecycleStateManager.isInstallable(INSTALLABLE_STATE);
|
|
|
|
// Assert.assertTrue("Installable state: " + INSTALLABLE_STATE, isInstallableState);
|
|
|
|
Assert.assertTrue("Installable state: " + INSTALLABLE_STATE, isInstallable);
|
|
|
|
// }
|
|
|
|
}
|
|
|
|
//
|
|
|
|
|
|
|
|
// @Test
|
|
|
|
@Test
|
|
|
|
// public void CheckUnInstallableState() {
|
|
|
|
public void CheckUnInstallableState() throws LifecycleManagementException {
|
|
|
|
// boolean isInstallableState = lifecycleStateManager.isInstallableState(UNINSTALlABLE_STATE);
|
|
|
|
boolean isInstallable = lifecycleStateManager.isInstallable(UNINSTALlABLE_STATE);
|
|
|
|
// Assert.assertFalse("UnInstallable state: " + UNINSTALlABLE_STATE, isInstallableState);
|
|
|
|
Assert.assertFalse("UnInstallable state: " + UNINSTALlABLE_STATE, isInstallable);
|
|
|
|
// }
|
|
|
|
}
|
|
|
|
//
|
|
|
|
|
|
|
|
// @Test
|
|
|
|
@Test
|
|
|
|
// public void check() {
|
|
|
|
public void CheckGetInitialState() throws LifecycleManagementException {
|
|
|
|
// Set<String> proceedingStates = lifecycleStateManager.getNextLifecycleStates(CURRENT_STATE);
|
|
|
|
boolean isInitialState = lifecycleStateManager.getInitialState().equalsIgnoreCase(INITIAL_STATE);
|
|
|
|
// Assert.assertFalse("Invalid proceeding state of: " + CURRENT_STATE,
|
|
|
|
Assert.assertTrue("Initial state: " + INITIAL_STATE, isInitialState);
|
|
|
|
// proceedingStates.contains(BOGUS_STATE.toUpperCase()));
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
|
|
|
public void CheckGetNonInitialState() throws LifecycleManagementException {
|
|
|
|
|
|
|
|
boolean isInitialState = lifecycleStateManager.getInitialState().equalsIgnoreCase(END_STATE);
|
|
|
|
|
|
|
|
Assert.assertFalse("Non initial state: " + END_STATE, isInitialState);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
|
|
|
public void CheckGetEndState() throws LifecycleManagementException {
|
|
|
|
|
|
|
|
boolean isEndState = lifecycleStateManager.getEndState().equalsIgnoreCase(END_STATE);
|
|
|
|
|
|
|
|
Assert.assertTrue("End State: " + END_STATE, isEndState);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
|
|
|
public void CheckGetNonEndState() throws LifecycleManagementException {
|
|
|
|
|
|
|
|
boolean isEndState = lifecycleStateManager.getEndState().equalsIgnoreCase(INITIAL_STATE);
|
|
|
|
|
|
|
|
Assert.assertFalse("Non End State : " + INITIAL_STATE, isEndState);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
|
|
|
public void CheckIsInitialState() throws LifecycleManagementException {
|
|
|
|
|
|
|
|
boolean isInitialState = lifecycleStateManager.isInitialState(INITIAL_STATE);
|
|
|
|
|
|
|
|
Assert.assertTrue("Initial state: " + INITIAL_STATE, isInitialState);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
|
|
|
public void CheckIsNonInitialState() throws LifecycleManagementException {
|
|
|
|
|
|
|
|
boolean isInitialState = lifecycleStateManager.isInitialState(END_STATE);
|
|
|
|
|
|
|
|
Assert.assertFalse("Non Initial state: " + END_STATE, isInitialState);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
|
|
|
public void CheckIsEndState() throws LifecycleManagementException {
|
|
|
|
|
|
|
|
boolean isEndState = lifecycleStateManager.isEndState(END_STATE);
|
|
|
|
|
|
|
|
Assert.assertTrue("End state: " + END_STATE, isEndState);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
|
|
|
public void CheckIsNonEndState() throws LifecycleManagementException {
|
|
|
|
|
|
|
|
boolean isEndState = lifecycleStateManager.isEndState(INITIAL_STATE);
|
|
|
|
|
|
|
|
Assert.assertFalse("Non End state: " + INITIAL_STATE, isEndState);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
|
|
|
public void check() {
|
|
|
|
|
|
|
|
Set<String> proceedingStates = lifecycleStateManager.getNextLifecycleStates(CURRENT_STATE);
|
|
|
|
|
|
|
|
Assert.assertFalse("Invalid proceeding state of: " + CURRENT_STATE,
|
|
|
|
|
|
|
|
proceedingStates.contains(BOGUS_STATE.toUpperCase()));
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|