Search in sources :

Example 6 with HgAnnotationLine

use of org.zmlx.hg4idea.provider.annotate.HgAnnotationLine in project intellij-community by JetBrains.

the class HgAnnotateCommandTest method testParse.

@Test(dataProvider = "annotate_output")
public void testParse(String fileName, String annotationNativeOutput) throws NoSuchMethodException, InvocationTargetException, IllegalAccessException {
    HgAnnotateCommand command = new HgAnnotateCommand(myProject);
    Method parseMethod = HgAnnotateCommand.class.getDeclaredMethod("parse", List.class);
    parseMethod.setAccessible(true);
    List<String> annotations = Arrays.asList(annotationNativeOutput.split("(\n|\r|\r\n)"));
    List<HgAnnotationLine> result = (List<HgAnnotationLine>) parseMethod.invoke(command, annotations);
    assertEquals(result, myAnnotations);
}
Also used : HgAnnotationLine(org.zmlx.hg4idea.provider.annotate.HgAnnotationLine) HgAnnotateCommand(org.zmlx.hg4idea.command.HgAnnotateCommand) ArrayList(java.util.ArrayList) List(java.util.List) BeforeMethod(org.testng.annotations.BeforeMethod) Method(java.lang.reflect.Method) Test(org.testng.annotations.Test)

Aggregations

HgAnnotationLine (org.zmlx.hg4idea.provider.annotate.HgAnnotationLine)6 ArrayList (java.util.ArrayList)3 HgAnnotateCommand (org.zmlx.hg4idea.command.HgAnnotateCommand)3 VirtualFile (com.intellij.openapi.vfs.VirtualFile)2 XStream (com.thoughtworks.xstream.XStream)2 File (java.io.File)2 Matcher (java.util.regex.Matcher)2 HgFile (org.zmlx.hg4idea.HgFile)2 FileReader (java.io.FileReader)1 FileWriter (java.io.FileWriter)1 Method (java.lang.reflect.Method)1 ParseException (java.text.ParseException)1 SimpleDateFormat (java.text.SimpleDateFormat)1 List (java.util.List)1 Pattern (java.util.regex.Pattern)1 BeforeClass (org.testng.annotations.BeforeClass)1 BeforeMethod (org.testng.annotations.BeforeMethod)1 Test (org.testng.annotations.Test)1 HgRevisionNumber (org.zmlx.hg4idea.HgRevisionNumber)1