Search in sources :

Example 1 with SvnInfoHandler

use of org.jetbrains.idea.svn.info.SvnInfoHandler in project intellij-community by JetBrains.

the class SvnParseCommandLineParseTest method testInfo.

public void testInfo() throws Exception {
    final String s = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + "<info>\n" + "<entry\n" + "   path=\"ReduceReturnOrYieldBreakTransformation.cs\"\n" + "   revision=\"91603\"\n" + "   kind=\"file\">\n" + "<url>http://svn.labs.intellij.net/resharper/trunk/ReSharper/src/Decompiler.Core/Src/Transformations/StatementStructure/ReduceReturnOrYieldBreakTransformation.cs</url>\n" + "<repository>\n" + "<root>http://svn.labs.intellij.net/resharper</root>\n" + "<uuid>ed0594e5-7722-0410-9c76-949374689613</uuid>\n" + "</repository>\n" + "<wc-info>\n" + "<wcroot-abspath>C:/TestProjects/sortedProjects/Subversion/Resharper17short</wcroot-abspath>\n" + "<schedule>normal</schedule>\n" + "<depth>infinity</depth>\n" + "<text-updated>2012-01-20T11:25:32.625000Z</text-updated>\n" + "<checksum>7af8adacb93afaa48b2cfb76de605824c220983a</checksum>\n" + "</wc-info>\n" + "<commit\n" + "   revision=\"87972\">\n" + "<author>Slava.Trenogin</author>\n" + "<date>2011-10-06T21:27:41.539022Z</date>\n" + "</commit>\n" + "</entry>\n" + "</info>";
    final Info[] info = new Info[1];
    final SvnInfoHandler handler = new SvnInfoHandler(new File("C:/base/"), info1 -> info[0] = info1);
    SAXParser parser = SAXParserFactory.newInstance().newSAXParser();
    parser.parse(new ByteArrayInputStream(s.getBytes(CharsetToolkit.UTF8_CHARSET)), handler);
    Assert.assertNotNull(info[0]);
}
Also used : SvnInfoHandler(org.jetbrains.idea.svn.info.SvnInfoHandler) ByteArrayInputStream(java.io.ByteArrayInputStream) SAXParser(javax.xml.parsers.SAXParser) Info(org.jetbrains.idea.svn.info.Info) SystemInfo(com.intellij.openapi.util.SystemInfo) File(java.io.File)

Aggregations

SystemInfo (com.intellij.openapi.util.SystemInfo)1 ByteArrayInputStream (java.io.ByteArrayInputStream)1 File (java.io.File)1 SAXParser (javax.xml.parsers.SAXParser)1 Info (org.jetbrains.idea.svn.info.Info)1 SvnInfoHandler (org.jetbrains.idea.svn.info.SvnInfoHandler)1