コード例 #1
0
 /** Method createLinkedAnomalies */
 private void createLinkedAnomalies() {
   R4EUIContent content =
       fItem
           .getFileContexts()
           .get(fAnomalyFileIndex)
           .getContentsContainerElement()
           .getContentsList()
           .get(0);
   fLinkedAnomaly =
       fProxy
           .getAnomalyProxy()
           .createLinkedAnomaly(
               content,
               TestConstants.LINKED_ANOMALY_TEST_TITLE,
               TestConstants.LINKED_ANOMALY_TEST_DESCRIPTION,
               TestConstants.ANOMALY_TEST_CLASS_IMPROVEMENT,
               TestConstants.ANOMALY_TEST_RANK_MAJOR,
               TestConstants.ANOMALY_TEST_DUE_DATE,
               TestConstants.PARTICIPANT_ASSIGN_TO,
               null);
   Assert.assertNotNull(fLinkedAnomaly);
   Assert.assertEquals(
       TestConstants.LINKED_ANOMALY_TEST_TITLE, fLinkedAnomaly.getAnomaly().getTitle());
   Assert.assertEquals(
       TestConstants.LINKED_ANOMALY_TEST_DESCRIPTION,
       fLinkedAnomaly.getAnomaly().getDescription());
   Assert.assertEquals(
       TestConstants.ANOMALY_TEST_CLASS_IMPROVEMENT,
       ((R4ECommentType) fLinkedAnomaly.getAnomaly().getType()).getType());
   Assert.assertEquals(
       TestConstants.ANOMALY_TEST_RANK_MAJOR, fLinkedAnomaly.getAnomaly().getRank());
   Assert.assertEquals(
       TestConstants.ANOMALY_TEST_DUE_DATE, fLinkedAnomaly.getAnomaly().getDueDate());
   Assert.assertEquals(
       TestConstants.PARTICIPANT_ASSIGN_TO, fLinkedAnomaly.getAnomaly().getAssignedTo().get(0));
   Assert.assertEquals(
       ((R4EUITextPosition) content.getPosition()).getOffset(),
       ((R4ETextPosition)
               ((R4ETextContent) fLinkedAnomaly.getAnomaly().getLocations().get(0)).getLocation())
           .getStartPosition());
   Assert.assertEquals(
       ((R4EUITextPosition) content.getPosition()).getLength(),
       ((R4ETextPosition)
               ((R4ETextContent) fLinkedAnomaly.getAnomaly().getLocations().get(0)).getLocation())
           .getLength());
   Assert.assertTrue(
       fProxy
           .getCommandProxy()
           .verifyAnnotation(fLinkedAnomaly, true, R4EUIConstants.ANOMALY_OPEN_ANNOTATION_ID));
 }
コード例 #2
0
 /** Method createEditorAnomalies */
 private void createCompareEditorAnomalies() {
   fCompareEditorAnomaly =
       fProxy
           .getAnomalyProxy()
           .createCompareEditorAnomaly(
               fItem.getFileContexts().get(fAnomalyFileIndex),
               20,
               50,
               TestConstants.COMPARE_EDITOR_ANOMALY_TEST_TITLE,
               TestConstants.COMPARE_EDITOR_ANOMALY_TEST_DESCRIPTION,
               TestConstants.ANOMALY_TEST_CLASS_ERRONEOUS,
               TestConstants.ANOMALY_TEST_RANK_MINOR,
               TestConstants.ANOMALY_TEST_DUE_DATE,
               TestConstants.PARTICIPANT_ASSIGN_TO,
               null);
   Assert.assertNotNull(fCompareEditorAnomaly);
   Assert.assertEquals(
       TestConstants.COMPARE_EDITOR_ANOMALY_TEST_TITLE,
       fCompareEditorAnomaly.getAnomaly().getTitle());
   Assert.assertEquals(
       TestConstants.COMPARE_EDITOR_ANOMALY_TEST_DESCRIPTION,
       fCompareEditorAnomaly.getAnomaly().getDescription());
   Assert.assertEquals(
       TestConstants.ANOMALY_TEST_CLASS_ERRONEOUS,
       ((R4ECommentType) fCompareEditorAnomaly.getAnomaly().getType()).getType());
   Assert.assertEquals(
       TestConstants.ANOMALY_TEST_RANK_MINOR, fCompareEditorAnomaly.getAnomaly().getRank());
   Assert.assertEquals(
       TestConstants.ANOMALY_TEST_DUE_DATE, fCompareEditorAnomaly.getAnomaly().getDueDate());
   Assert.assertEquals(
       TestConstants.PARTICIPANT_ASSIGN_TO,
       fCompareEditorAnomaly.getAnomaly().getAssignedTo().get(0));
   Assert.assertEquals(
       20,
       ((R4ETextPosition)
               ((R4ETextContent) fCompareEditorAnomaly.getAnomaly().getLocations().get(0))
                   .getLocation())
           .getStartPosition());
   Assert.assertEquals(
       50,
       ((R4ETextPosition)
               ((R4ETextContent) fCompareEditorAnomaly.getAnomaly().getLocations().get(0))
                   .getLocation())
           .getLength());
   Assert.assertTrue(
       fProxy
           .getCommandProxy()
           .verifyAnnotation(
               fCompareEditorAnomaly, true, R4EUIConstants.ANOMALY_OPEN_ANNOTATION_ID));
 }
コード例 #3
0
  /** Method progressLinkedAnomalies */
  private void progressLinkedAnomalies() {
    Assert.assertNotNull(fLinkedAnomaly);
    fProxy.getAnomalyProxy().progressAnomaly(fLinkedAnomaly, TestConstants.ANOMALY_STATE_FIXED);

    Assert.assertEquals(TestConstants.ANOMALY_STATE_FIXED, fLinkedAnomaly.getAnomaly().getState());
    Assert.assertFalse(
        fProxy
            .getCommandProxy()
            .verifyAnnotation(fLinkedAnomaly, true, R4EUIConstants.ANOMALY_OPEN_ANNOTATION_ID));
    Assert.assertTrue(
        fProxy
            .getCommandProxy()
            .verifyAnnotation(fLinkedAnomaly, true, R4EUIConstants.ANOMALY_CLOSED_ANNOTATION_ID));
  }
コード例 #4
0
 /** Method createExternalAnomalies */
 private void createExternalAnomalies() {
   fExternalAnomaly =
       fProxy
           .getAnomalyProxy()
           .createExternalAnomaly(
               TestUtils.FJavaFile3,
               TestConstants.EXTERNAL_ANOMALY_TEST_TITLE,
               TestConstants.EXTERNAL_ANOMALY_TEST_DESCRIPTION,
               TestConstants.ANOMALY_TEST_CLASS_QUESTION,
               TestConstants.ANOMALY_TEST_RANK_MINOR,
               TestConstants.ANOMALY_TEST_DUE_DATE,
               TestConstants.PARTICIPANT_ASSIGN_TO,
               null);
   Assert.assertNotNull(fExternalAnomaly);
   Assert.assertEquals(
       TestConstants.EXTERNAL_ANOMALY_TEST_TITLE, fExternalAnomaly.getAnomaly().getTitle());
   Assert.assertEquals(
       TestConstants.EXTERNAL_ANOMALY_TEST_DESCRIPTION,
       fExternalAnomaly.getAnomaly().getDescription());
   Assert.assertEquals(
       TestConstants.ANOMALY_TEST_CLASS_QUESTION,
       ((R4ECommentType) fExternalAnomaly.getAnomaly().getType()).getType());
   Assert.assertEquals(
       TestConstants.ANOMALY_TEST_RANK_MINOR, fExternalAnomaly.getAnomaly().getRank());
   Assert.assertEquals(
       TestConstants.ANOMALY_TEST_DUE_DATE, fExternalAnomaly.getAnomaly().getDueDate());
   Assert.assertEquals(
       TestConstants.PARTICIPANT_ASSIGN_TO, fExternalAnomaly.getAnomaly().getAssignedTo().get(0));
   Assert.assertEquals(
       0,
       ((R4ETextPosition)
               ((R4ETextContent) fExternalAnomaly.getAnomaly().getLocations().get(0))
                   .getLocation())
           .getStartPosition());
   Assert.assertEquals(
       755,
       ((R4ETextPosition)
               ((R4ETextContent) fExternalAnomaly.getAnomaly().getLocations().get(0))
                   .getLocation())
           .getLength());
   Assert.assertTrue(
       fProxy
           .getCommandProxy()
           .verifyAnnotation(fExternalAnomaly, false, R4EUIConstants.ANOMALY_OPEN_ANNOTATION_ID));
 }