And extends Logic { @Override public String toString() { return new StringBuilder().append("And(").append(super.toString()) .append(")").toString(); } And();  And(Constraint... subConstraints);  And(List<Constraint> subConstraints); @Override String toString(); @Override boolean equals(Object a); @Override int hashCode();  }
@Test public void testGetResultIteratorWithNull() { Constraint myconstraint1 = createMock(Constraint.class); Constraint myconstraint2 = createMock(Constraint.class); TableAdapter table = createMock(TableAdapter.class); And myand = new And(myconstraint1, myconstraint2); boolean exceptionSiteIsMeaningful = false; try { myand.getResultIterator(); } catch (NullPointerException e) { if (e.getMessage().contains(myconstraint1.toString())) { exceptionSiteIsMeaningful = true; } } assertTrue("Exception site should be meaninful", exceptionSiteIsMeaningful); }
@Test public void testToString() { Constraint myconstraint1 = createMock(Constraint.class); Constraint myconstraint2 = createMock(Constraint.class); And myand = new And(myconstraint1, myconstraint2); Assert .assertEquals( "And([EasyMock for class com.bah.culvert.constraints.Constraint,EasyMock for class com.bah.culvert.constraints.Constraint])", myand.toString()); }