@Test public void testCompare() throws Exception { ExperimentComparator experimentComparator = new ExperimentComparator(); HashMap<String, Integer> testCases = new HashMap<>(); testCases.put("-application_name", 1); testCases.put("experiment_label", -1); testCases.put("created_by", -1); testCases.put("creation_time", 0); testCases.put("-start_time", 1); testCases.put("end_time", -1); testCases.put("modification_time", 0); testCases.put("state", -1); for (Map.Entry<String, Integer> testCase : testCases.entrySet()) { experimentComparator.replaceSortorder(testCase.getKey()); int magnitudeResult = experimentComparator.compare(experiment1, experiment2); if (magnitudeResult != 0) { magnitudeResult /= Math.abs(magnitudeResult); } Assert.assertEquals("test case " + testCase.getKey() + " failed.", testCase.getValue().intValue(), magnitudeResult); } }
@Override public int compare(Experiment left, Experiment right) { return super.compare(left, right, Property.class); }
ExperimentComparator extends PaginationComparator<Experiment> { @Override public int compare(Experiment left, Experiment right) { return super.compare(left, right, Property.class); } }
ExperimentComparator extends PaginationComparator<Experiment> { @Override public int compare(Experiment left, Experiment right) { return super.compare(left, right, Property.class); } ExperimentComparator(); }
ExperimentComparator extends PaginationComparator<Experiment> { @Override public int compare(Experiment left, Experiment right) { return super.compare(left, right, Property.class); } ExperimentComparator(); @Override int compare(Experiment left, Experiment right); }
ExperimentComparator extends PaginationComparator<Experiment> { @Override public int compare(Experiment left, Experiment right) { return super.compare(left, right, Property.class); } ExperimentComparator(); @Override int compare(Experiment left, Experiment right);  }