/** Method createReviewItems */ private void createReviewItems() throws CoreException { fItem = fProxy.getItemProxy().createCommitItem(TestUtils.FJavaIProject, 0); // close and re-open, so the validation takes de-serialized information String itemName = fItem.getName(); fProxy.getCommandProxy().closeElement(fReview); fProxy.getCommandProxy().openElement(fReview); for (IR4EUIModelElement elem : fReview.getChildren()) { if (elem.getName().equals(itemName)) { fItem = (R4EUIReviewItem) elem; } } // Now validate Assert.assertNotNull(fItem); Assert.assertEquals(R4EUIModelController.getReviewer(), fItem.getItem().getAddedById()); Assert.assertEquals("*****@*****.**", fItem.getItem().getAuthorRep()); Assert.assertEquals("second Java Commit", fItem.getItem().getDescription()); Assert.assertEquals(4, fItem.getChildren().length); for (int i = 0; i < fItem.getChildren().length; i++) { if (((R4EUIFileContext) fItem.getChildren()[i]) .getName() .equals(TestUtils.JAVA_FILE1_PROJ_NAME)) { fAnomalyFileIndex = i; // Used later to add anomalies Assert.assertEquals( TestUtils.JAVA_FILE1_PROJ_NAME, fItem.getItem().getFileContextList().get(i).getBase().getName()); Assert.assertEquals( TestUtils.JAVA_FILE1_PROJ_NAME, fItem.getItem().getFileContextList().get(i).getTarget().getName()); Assert.assertEquals( 606, ((R4ETextPosition) fItem .getItem() .getFileContextList() .get(i) .getDeltas() .get(0) .getTarget() .getLocation()) .getStartPosition()); Assert.assertEquals( 25, ((R4ETextPosition) fItem .getItem() .getFileContextList() .get(i) .getDeltas() .get(0) .getTarget() .getLocation()) .getLength()); Assert.assertEquals( 665, ((R4ETextPosition) fItem .getItem() .getFileContextList() .get(i) .getDeltas() .get(1) .getTarget() .getLocation()) .getStartPosition()); Assert.assertEquals( 63, ((R4ETextPosition) fItem .getItem() .getFileContextList() .get(i) .getDeltas() .get(1) .getTarget() .getLocation()) .getLength()); Assert.assertEquals( 733, ((R4ETextPosition) fItem .getItem() .getFileContextList() .get(i) .getDeltas() .get(2) .getTarget() .getLocation()) .getStartPosition()); Assert.assertEquals( 61, ((R4ETextPosition) fItem .getItem() .getFileContextList() .get(i) .getDeltas() .get(2) .getTarget() .getLocation()) .getLength()); Assert.assertTrue( fProxy .getCommandProxy() .verifyAnnotations( ((R4EUIFileContext) fItem.getChildren()[i]) .getContentsContainerElement() .getChildren(), true, R4EUIConstants.DELTA_ANNOTATION_ID)); } else if (((R4EUIFileContext) fItem.getChildren()[i]) .getName() .equals(TestUtils.JAVA_FILE4_PROJ_NAME)) { Assert.assertNull(fItem.getItem().getFileContextList().get(i).getBase()); Assert.assertEquals( TestUtils.JAVA_FILE4_PROJ_NAME, fItem.getItem().getFileContextList().get(i).getTarget().getName()); } else if (((R4EUIFileContext) fItem.getChildren()[i]) .getName() .equals(TestUtils.JAVA_FILE3_PROJ_NAME)) { Assert.assertNull(fItem.getItem().getFileContextList().get(i).getBase()); Assert.assertEquals( TestUtils.JAVA_FILE3_PROJ_NAME, fItem.getItem().getFileContextList().get(i).getTarget().getName()); } else if (((R4EUIFileContext) fItem.getChildren()[i]) .getName() .equals(TestUtils.JAVA_FILE2_PROJ_NAME)) { Assert.assertEquals( TestUtils.JAVA_FILE2_PROJ_NAME, fItem.getItem().getFileContextList().get(i).getBase().getName()); Assert.assertNull(fItem.getItem().getFileContextList().get(i).getTarget()); } } fItem2 = fProxy.getItemProxy().createManualTreeItem(TestUtils.FJavaFile3); Assert.assertNotNull(fItem2); Assert.assertEquals(R4EUIModelController.getReviewer(), fItem2.getItem().getAddedById()); Assert.assertEquals( TestUtils.JAVA_FILE3_PROJ_NAME, fItem2.getItem().getFileContextList().get(0).getBase().getName()); Assert.assertEquals( TestUtils.JAVA_FILE3_PROJ_NAME, fItem2.getItem().getFileContextList().get(0).getTarget().getName()); Assert.assertEquals( 0, ((R4ETextPosition) fItem2 .getItem() .getFileContextList() .get(0) .getDeltas() .get(0) .getTarget() .getLocation()) .getStartPosition()); Assert.assertEquals( 755, ((R4ETextPosition) fItem2 .getItem() .getFileContextList() .get(0) .getDeltas() .get(0) .getTarget() .getLocation()) .getLength()); Assert.assertTrue( fProxy .getCommandProxy() .verifyAnnotations( ((R4EUIFileContext) fItem2.getChildren()[0]) .getContentsContainerElement() .getChildren(), false, R4EUIConstants.SELECTION_ANNOTATION_ID)); fItem3 = fProxy.getItemProxy().createManualTextItem(TestUtils.FJavaFile4, 50, 20); Assert.assertNotNull(fItem3); Assert.assertEquals(R4EUIModelController.getReviewer(), fItem3.getItem().getAddedById()); Assert.assertEquals( TestUtils.JAVA_FILE4_PROJ_NAME, fItem3.getItem().getFileContextList().get(0).getBase().getName()); Assert.assertEquals( TestUtils.JAVA_FILE4_PROJ_NAME, fItem3.getItem().getFileContextList().get(0).getTarget().getName()); Assert.assertEquals( 50, ((R4ETextPosition) fItem3 .getItem() .getFileContextList() .get(0) .getDeltas() .get(0) .getTarget() .getLocation()) .getStartPosition()); Assert.assertEquals( 20, ((R4ETextPosition) fItem3 .getItem() .getFileContextList() .get(0) .getDeltas() .get(0) .getTarget() .getLocation()) .getLength()); Assert.assertTrue( fProxy .getCommandProxy() .verifyAnnotations( ((R4EUIFileContext) fItem3.getChildren()[0]) .getContentsContainerElement() .getChildren(), true, R4EUIConstants.SELECTION_ANNOTATION_ID)); }