1 4 package org.springframework.util; 5 6 import java.util.HashMap ; 7 import java.util.HashSet ; 8 import java.util.Set ; 9 10 import junit.framework.TestCase; 11 12 16 public class AssertTests extends TestCase { 17 public void testInstanceOf() { 18 Set set = new HashSet (); 19 Assert.isInstanceOf(HashSet .class, set); 20 try { 21 Assert.isInstanceOf(HashMap .class, set); 22 fail("Should have failed - a hash map is not a set"); 23 } catch (IllegalArgumentException e) { 24 return; 25 } 26 } 27 } 28 | Popular Tags |