1 package org.bsf.smartValueObject.container; 2 3 import org.bsf.smartValueObject.container.SmartContainer; 4 import org.bsf.smartValueObject.container.SmartSet; 5 import org.bsf.smartValueObject.container.AbstractTestSmartContainer; 6 import org.bsf.smartValueObject.TestVO; 7 8 import java.util.HashSet ; 9 10 15 public class TestSmartSet extends AbstractTestSmartContainer { 16 private SmartSet ss; 17 18 protected SmartContainer createContainer() { 19 ss = new SmartSet(new HashSet (), getVersionable()); 20 return ss; 21 } 22 23 protected Object addToContainer(TestVO t) { 24 return ss.add(t) ? t : null; 25 } 26 27 protected Object removeFromContainer(TestVO t) { 28 return ss.remove(t) ? t : null; 29 } 30 31 protected TestVO getOne() { 32 assertTrue(getSize() > 0); 33 return (TestVO) ss.iterator().next(); 34 } 35 36 public void testSize() { 37 createMany(); 38 assertEquals("Incorrect size", getSize(), ss.size()); 39 } 40 41 public void testSizeAfterDelete() { 42 createMany(); 43 deleteMany(getSize()); 44 testSize(); 45 } 46 } 47 | Popular Tags |