示例#1
0
  @Ignore
  public void test05CommitWithoutResolutionErrors() {
    SevereLoggingMonitor monitorLog = new SevereLoggingMonitor();
    OseeLog.registerLoggerListener(monitorLog);
    try {
      ConflictManagerExternal conflictManager =
          new ConflictManagerExternal(
              ConflictTestManager.getDestBranch(), ConflictTestManager.getSourceBranch());
      BranchManager.commitBranch(null, conflictManager, false, false);
      assertTrue("Commit did not complete as expected", ConflictTestManager.validateCommit());

      assertEquals(
          "Source Branch state incorrect",
          BranchState.COMMITTED,
          ConflictTestManager.getSourceBranch().getBranchState());

    } catch (Exception ex) {
      fail(
          "No Exceptions should have been thrown. Not even the "
              + ex.getLocalizedMessage()
              + "Exception");
    }

    assertTrue(
        String.format("%d SevereLogs during test.", monitorLog.getSevereLogs().size()),
        monitorLog.getSevereLogs().isEmpty());
  }
示例#2
0
  /**
   * Test method for {@link
   * org.eclipse.osee.framework.skynet.core.artifact.BranchManager#getMergeBranch(Branch, Branch)} .
   */
  @org.junit.Test
  public void test01GetMergeBranchNotCreated() throws Exception {
    SevereLoggingMonitor monitorLog = new SevereLoggingMonitor();
    OseeLog.registerLoggerListener(monitorLog);
    try {
      Branch mergeBranch =
          BranchManager.getMergeBranch(
              ConflictTestManager.getSourceBranch(), ConflictTestManager.getDestBranch());

      assertTrue(
          "The merge branch should be null as it hasn't been created yet", mergeBranch == null);
    } catch (Exception ex) {
      fail(ex.getMessage());
    }
    assertTrue(
        String.format("%d SevereLogs during test.", monitorLog.getSevereLogs().size()),
        monitorLog.getSevereLogs().isEmpty());
  }
示例#3
0
 /**
  * Test method for {@link
  * org.eclipse.osee.framework.skynet.core.revision.ConflictManagerInternal#getConflictsPerBranch(org.eclipse.osee.framework.core.model.Branch,
  * org.eclipse.osee.framework.core.model.Branch,
  * org.eclipse.osee.framework.skynet.core.transaction.TransactionId)} .
  */
 @org.junit.Test
 public void test02GetConflictsPerBranch() {
   SevereLoggingMonitor monitorLog = new SevereLoggingMonitor();
   OseeLog.registerLoggerListener(monitorLog);
   Collection<Conflict> conflicts = null;
   try {
     conflicts =
         ConflictManagerInternal.getConflictsPerBranch(
             ConflictTestManager.getSourceBranch(),
             ConflictTestManager.getDestBranch(),
             ConflictTestManager.getSourceBranch().getBaseTransaction(),
             new NullProgressMonitor());
   } catch (Exception ex) {
     fail(Lib.exceptionToString(ex));
   }
   int expectedNumber = ConflictTestManager.numberOfConflicts();
   int actualNumber = conflicts.size();
   assertTrue(
       "(Intermittent failures - needs re-write) - Number of conflicts found is not equal to the number of conflicts expected",
       (expectedNumber <= actualNumber) && (actualNumber <= (expectedNumber + 1)));
   assertTrue(
       String.format("%d SevereLogs during test.", monitorLog.getSevereLogs().size()),
       monitorLog.getSevereLogs().isEmpty());
 }