コード例 #1
0
  /** test if the name of action is not in the list of actions */
  @Test
  public void testStrangeActionName() {
    String name = "abc";
    String lastState = "lastState";
    String lastAction = "lastAction";
    String lastErrorMessage = "lastErrorMessage";

    LocalStateResult temp =
        new LocalStateResult(
            new DataSource("shortName", "cloneString", RepoKind.HG, false, "parent"),
            name,
            lastState,
            lastAction,
            lastErrorMessage);
    assertNull("strange action", temp.getAction());
  }
コード例 #2
0
  /** test if the action name is ERROR */
  @Test
  public void testErrorActionNameConstructor() {
    String name = LocalStateResult.ERROR;
    String lastState = "lastState";
    String lastAction = "lastAction";
    String lastErrorMessage = "lastErrorMessage";

    LocalStateResult temp =
        new LocalStateResult(
            new DataSource("shortName", "cloneString", RepoKind.HG, false, "parent"),
            name,
            lastState,
            lastAction,
            lastErrorMessage);

    assertTrue("Error name", temp.getName().equals("ERROR"));
    assertNull("action with error name", temp.getAction());
  }
コード例 #3
0
 /** test toString format */
 @Test
 public void testToString() {
   assertTrue(
       "string representation",
       localState
           .toString()
           .equals(
               "LocalStateResult - "
                   + "shortName"
                   + " state: "
                   + LocalStateResult.TEST
                   + " and last state: "
                   + "lastState"
                   + "."));
 }
コード例 #4
0
 /** test getLastErrorMessage */
 @Test
 public void testGetLastErrorMessage() {
   assertTrue("last error message", localState.getLastErrorMessage().equals("lastErrorMessage"));
 }
コード例 #5
0
 /** test getErrorMessage */
 @Test
 public void testGetNoErrorMessage() {
   assertNull("no error message", localState.getErrorMessage());
 }
コード例 #6
0
 /** test getName */
 @Test
 public void testGetName() {
   assertTrue("name", localState.getName().equals(LocalStateResult.TEST));
 }
コード例 #7
0
 /** test getLastAction */
 @Test
 public void testGetLastAction() {
   assertTrue("last action", localState.getLastAction().equals("lastAction"));
 }
コード例 #8
0
 /** test getAction method */
 @Test
 public void testGetAction() {
   assertTrue("Action", localState.getAction().equals(""));
 }
コード例 #9
0
 /** test getLastLocalState */
 @Test
 public void testGetLastLocalState() {
   assertTrue("last state", localState.getLastLocalState().equals("lastState"));
 }