Package org.apache.karaf.shell.commands.impl

Examples of org.apache.karaf.shell.commands.impl.SortAction


    public void testSortToStdout() throws Exception {
        String newLine = System.getProperty("line.separator");
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        byte[] input = ("abc" + newLine + "def" + newLine).getBytes();
        new SortAction().sort(new ByteArrayInputStream(input), new PrintStream(baos));
        assertEquals(new String(input), new String(baos.toByteArray()));
    }
View Full Code Here


        String newLine = System.getProperty("line.separator");
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        String inputString = "def" + newLine + "def" + newLine + "abc" + newLine + "abc" + newLine + "def" + newLine;
        byte[] input = inputString.getBytes();
        String outputString = ("abc" + newLine + "def" + newLine);
        SortAction sort = new SortAction();
        Field unique = SortAction.class.getDeclaredField("unique");
        unique.setAccessible(true);
        unique.set(sort, true);
        sort.sort(new ByteArrayInputStream(input), new PrintStream(baos));
        assertEquals(outputString, new String(baos.toByteArray()));
    }
View Full Code Here

TOP

Related Classes of org.apache.karaf.shell.commands.impl.SortAction

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.