@@ -0,0 +1,2402 @@
+package org.pyyaml;%0D%0A%0D%0Aimport java.io.File;%0D%0Aimport java.io.FileInputStream;%0D%0Aimport java.io.IOException;%0D%0Aimport java.io.InputStream;%0D%0Aimport java.util.LinkedList;%0D%0Aimport java.util.List;%0D%0A%0D%0Aimport org.yaml.snakeyaml.events.Event;%0D%0Aimport org.yaml.snakeyaml.tokens.Token;%0D%0A%0D%0A/**%0D%0A * @see imported from PyYAML%0D%0A */%0D%0Apublic class PyCanonicalTest extends PyImportTest %7B%0D%0A%0D%0A    public void testCanonicalScanner() throws IOException %7B%0D%0A        File%5B%5D files = getStreamsByExtension(%22.canonical%22);%0D%0A        assertTrue(%22No test files found.%22, files.length %3E 0);%0D%0A        for (int i = 0; i %3C files.length; i++) %7B%0D%0A            System.out.println(%22Try: %22 + files%5Bi%5D);%0D%0A            List%3CToken%3E tokens = canonicalScan(new FileInputStream(files%5Bi%5D));%0D%0A            assertFalse(tokens.isEmpty());%0D%0A            break;%0D%0A        %7D%0D%0A    %7D%0D%0A%0D%0A    private List%3CToken%3E canonicalScan(InputStream input) throws IOException %7B%0D%0A        int ch = input.read();%0D%0A        StringBuffer buffer = new StringBuffer();%0D%0A        while (ch != -1) %7B%0D%0A            buffer.append((char) ch);%0D%0A            ch = input.read();%0D%0A        %7D%0D%0A        CanonicalScanner scanner = new CanonicalScanner(buffer.toString());%0D%0A        List%3CToken%3E result = new LinkedList%3CToken%3E();%0D%0A        while (scanner.peekToken() != null) %7B%0D%0A            System.out.println(%22added: %22 + scanner.peekToken());%0D%0A            result.add(scanner.getToken());%0D%0A        %7D%0D%0A        return result;%0D%0A    %7D%0D%0A%0D%0A    public void qtestCanonicalParser() throws IOException %7B%0D%0A        File%5B%5D files = getStreamsByExtension(%22.canonical%22);%0D%0A        assertTrue(%22No test files found.%22, files.length %3E 0);%0D%0A        for (int i = 0; i %3C files.length; i++) %7B%0D%0A            System.out.println(%22Try111: %22 + files%5Bi%5D);%0D%0A            List%3CEvent%3E tokens = canonicalParse(new FileInputStream(files%5Bi%5D));%0D%0A            assertFalse(tokens.isEmpty());%0D%0A        %7D%0D%0A    %7D%0D%0A%0D%0A    private List%3CEvent%3E canonicalParse(InputStream input) throws IOException %7B%0D%0A        int ch = input.read();%0D%0A        StringBuffer buffer = new StringBuffer();%0D%0A        while (ch != -1) %7B%0D%0A            buffer.append((char) ch);%0D%0A            ch = input.read();%0D%0A        %7D%0D%0A        CanonicalParser parser = new CanonicalParser(buffer.toString());%0D%0A        List%3CEvent%3E result = new LinkedList%3CEvent%3E();%0D%0A        while (parser.peekEvent() != null) %7B%0D%0A            result.add(parser.getEvent());%0D%0A        %7D%0D%0A        return result;%0D%0A    %7D%0D%0A%7D%0D%0A

add PyCanonicalTest