1 7 8 package test.compliance.varia; 9 10 import java.io.ByteArrayInputStream; 11 import java.io.ByteArrayOutputStream; 12 import java.io.IOException; 13 import java.io.ObjectInputStream; 14 import java.io.ObjectOutputStream; 15 16 import java.util.Vector; 17 18 import junit.framework.TestCase; 19 20 import javax.management.*; 21 22 26 public class AttributeChangeNotificationFilterTEST 27 extends TestCase 28 { 29 30 32 35 public AttributeChangeNotificationFilterTEST(String s) 36 { 37 super(s); 38 } 39 40 42 public void testGetEnabledAttributes() 43 { 44 AttributeChangeNotificationFilter filter = new AttributeChangeNotificationFilter(); 45 46 assertTrue(filter.getEnabledAttributes().size() == 0); 47 48 filter.enableAttribute("foo"); 49 filter.enableAttribute("bar"); 50 51 assertTrue(filter.getEnabledAttributes().size() == 2); 52 } 53 54 public void testDisableAttribute() 55 { 56 AttributeChangeNotificationFilter filter = new AttributeChangeNotificationFilter(); 57 58 filter.enableAttribute("foo"); 59 filter.enableAttribute("bar"); 60 61 assertTrue(filter.getEnabledAttributes().size() == 2); 62 63 filter.disableAttribute("foo"); 64 65 assertTrue(filter.getEnabledAttributes().size() == 1); 66 assertTrue(filter.getEnabledAttributes().get(0).equals("bar")); 67 68 filter.disableAllAttributes(); 69 70 assertTrue(filter.getEnabledAttributes().size() == 0); 71 72 } 73 74 } 75 | Popular Tags |