Package kalashnikov.dmitry.lab3

Examples of kalashnikov.dmitry.lab3.SortTask.call()


    @Test
    public void testNormalMerge() throws Exception {
        int[] first = new int[]{1, 5, 20, 40};
        int[] second = new int[]{0, 9, 20};
        MergeTask mt = new MergeTask(first, second);
        Assert.assertArrayEquals(new int[]{0, 1, 5, 9, 20, 20, 40}, mt.call());
    }

    @Test(expected = NullPointerException.class)
    public void testMergeWithNull() {
        int[] second = new int[]{0, 9, 20};
View Full Code Here


    @Test
    public void testMergeWithEmpty() throws Exception {
        int[] first = new int[]{};
        int[] second = new int[]{0, 9, 20};
        MergeTask mt = new MergeTask(first, second);
        Assert.assertArrayEquals(new int[]{0, 9, 20}, mt.call());
        mt = new MergeTask(second, first);
        Assert.assertArrayEquals(new int[]{0, 9, 20}, mt.call());
    }
}
View Full Code Here

        int[] first = new int[]{};
        int[] second = new int[]{0, 9, 20};
        MergeTask mt = new MergeTask(first, second);
        Assert.assertArrayEquals(new int[]{0, 9, 20}, mt.call());
        mt = new MergeTask(second, first);
        Assert.assertArrayEquals(new int[]{0, 9, 20}, mt.call());
    }
}
View Full Code Here

        str[0] = "4";
        str[1] = "1";
        str[2] = "3";
        str[3] = "2";
        SortTask st = new SortTask(str);
        int[] res = st.call();
        Assert.assertArrayEquals(new int[]{1, 2, 3, 4}, res);
    }

    @Test(expected = NumberFormatException.class)
    public void testSortTaskWithNull() throws Exception {
View Full Code Here

        str[0] = "4";
        str[1] = null;
        str[2] = "3";
        str[3] = "2";
        SortTask st = new SortTask(str);
        int[] res = st.call();
        Assert.assertArrayEquals(new int[]{1, 2, 3, 4}, res);
    }

    @Test
    public void testSortTaskEmpty() throws Exception {
View Full Code Here

    @Test
    public void testSortTaskEmpty() throws Exception {
        String[] str = new String[0];
        SortTask st = new SortTask(str);
        int[] res = st.call();
        Assert.assertArrayEquals(new int[]{}, res);
    }
}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.