/** * Tests the case-sensitive sorting on all attributes. */ public void testCaseSensitive() { m_Filter = getFilter(SortLabels.SORT_CASESENSITIVE, "first-last"); testBuffered(); Instances result = performTest(); String[] sorted = new String[]{"b", "g", "r"}; for (int i = 0; i < sorted.length; i++) assertEquals("Values differ for index #" + (i+1), result.attribute(0).value(i), sorted[i]); }
/** * Runs the test from commandline. * * @param args ignored */ public static void main(String[] args){ TestRunner.run(suite()); } }
fail("Exception thrown on setInputFormat(): \n" + ex.getMessage()); assertNotNull(result); fail("Exception thrown on useFilter(): \n" + ex.getMessage()); assertEquals("Number of attributes", icopy.numAttributes(), result.numAttributes()); assertEquals("Number of instances", icopy.numInstances(), m_Instances.numInstances()); for (int i = 0; i < result.numAttributes(); i++) { assertEquals("Number of values differ for attribute #" + (i+1), icopy.attribute(i).numValues(), result.attribute(i).numValues()); valuesResult.add(result.attribute(i).value(n)); assertEquals("Values differ for attribute #" + (i+1), valuesOriginal, valuesResult);
fail("Exception thrown on setInputFormat(): \n" + ex.getMessage()); assertNotNull(result); fail("Exception thrown on useFilter(): \n" + ex.getMessage()); assertEquals("Number of attributes", icopy.numAttributes(), result.numAttributes()); assertEquals("Number of instances", icopy.numInstances(), m_Instances.numInstances()); for (int i = 0; i < result.numAttributes(); i++) { assertEquals("Number of values differ for attribute #" + (i+1), icopy.attribute(i).numValues(), result.attribute(i).numValues()); valuesResult.add(result.attribute(i).value(n)); assertEquals("Values differ for attribute #" + (i+1), valuesOriginal, valuesResult);
/** * Tests the case-insensitive sorting on all attributes. */ public void testCaseInsensitive() { m_Filter = getFilter(SortLabels.SORT_CASEINSENSITIVE, "first-last"); testBuffered(); Instances result = performTest(); String[] sorted = new String[]{"b", "g", "r"}; for (int i = 0; i < sorted.length; i++) assertEquals("Values differ for index #" + (i+1), sorted[i], result.attribute(0).value(i)); }
/** * Runs the test from commandline. * * @param args ignored */ public static void main(String[] args){ TestRunner.run(suite()); } }
/** * Tests the case-insensitive sorting on all attributes. */ public void testCaseInsensitive() { m_Filter = getFilter(SortLabels.SORT_CASEINSENSITIVE, "first-last"); testBuffered(); Instances result = performTest(); String[] sorted = new String[]{"b", "g", "r"}; for (int i = 0; i < sorted.length; i++) assertEquals("Values differ for index #" + (i+1), sorted[i], result.attribute(0).value(i)); }
/** * Tests the case-sensitive sorting on all attributes. */ public void testCaseSensitive() { m_Filter = getFilter(SortLabels.SORT_CASESENSITIVE, "first-last"); testBuffered(); Instances result = performTest(); String[] sorted = new String[]{"b", "g", "r"}; for (int i = 0; i < sorted.length; i++) assertEquals("Values differ for index #" + (i+1), result.attribute(0).value(i), sorted[i]); }
/** * Tests that ordering didn't change. */ public void testUnchangedOrder() { m_Filter = getFilter(SortLabels.SORT_CASESENSITIVE, "first-last"); testBuffered(); Instances result = performTest(); for (int i = 0; i < m_Instances.attribute(2).numValues(); i++) assertEquals("Values differ for index #" + (i+1), m_Instances.attribute(2).value(i), result.attribute(2).value(i)); }
/** * Tests that ordering didn't change. */ public void testUnchangedOrder() { m_Filter = getFilter(SortLabels.SORT_CASESENSITIVE, "first-last"); testBuffered(); Instances result = performTest(); for (int i = 0; i < m_Instances.attribute(2).numValues(); i++) assertEquals("Values differ for index #" + (i+1), m_Instances.attribute(2).value(i), result.attribute(2).value(i)); }