@SuppressWarnings("nls") public void testLoad() { DialogSettings settings = new DialogSettings("mysettings"); Criteria criteria = new Criteria(); criteria.setExpression("test"); criteria.setLifeLineSelected(true); criteria.setSyncMessageSelected(true); // Save the criteria to the dialog settings criteria.save(settings); // Load the criteria from the dialog settings Criteria copy = new Criteria(); copy.load(settings); assertTrue("testCompareTo", criteria.compareTo(copy)); assertTrue("testCompareTo", copy.compareTo(criteria)); }
@SuppressWarnings("nls") public void testCompareTo() { Criteria criteria = new Criteria(); criteria.setExpression("test"); criteria.setLifeLineSelected(true); criteria.setSyncMessageSelected(true); Criteria copy = new Criteria(criteria); assertTrue("testCompareTo", criteria.compareTo(copy)); assertTrue("testCompareTo", copy.compareTo(criteria)); assertTrue("testCompareTo", criteria.compareTo(criteria)); copy.setExpression(null); assertFalse("testCompareTo", criteria.compareTo(copy)); assertFalse("testCompareTo", copy.compareTo(criteria)); criteria.setExpression(null); assertTrue("testCompareTo", criteria.compareTo(copy)); assertTrue("testCompareTo", copy.compareTo(criteria)); criteria.setExpression("test"); copy.setExpression("test.*[12345]"); assertFalse("testCompareTo", criteria.compareTo(copy)); assertFalse("testCompareTo", copy.compareTo(criteria)); copy.setExpression("test"); copy.setAsyncMessageReturnSelected(true); assertFalse("testCompareTo", criteria.compareTo(copy)); assertFalse("testCompareTo", copy.compareTo(criteria)); }