1 23 24 package com.sun.enterprise.cli.framework; 25 26 import junit.framework.*; 27 32 33 public class ValidPropertyTest extends TestCase { 34 public void testValueMutation(){ 35 ValidProperty vp = new ValidProperty("name", "value"); 36 assertEquals("name", vp.getName()); 37 assertEquals("value", vp.getValue()); 38 vp.setValue("foo"); 39 assertEquals("foo", vp.getValue()); 40 assertEquals("name", vp.getName()); 41 } 42 43 public void testNameMutation(){ 44 ValidProperty vp = new ValidProperty("name", "value"); 45 assertEquals("name", vp.getName()); 46 assertEquals("value", vp.getValue()); 47 vp.setName("foo"); 48 assertEquals("foo", vp.getName()); 49 assertEquals("value", vp.getValue()); 50 } 51 public void testSimpleConstructor(){ 52 ValidProperty vp = new ValidProperty("name", "value"); 53 assertEquals("name", vp.getName()); 54 assertEquals("value", vp.getValue()); 55 } 56 57 58 public void testEmptyConstructor() { 59 ValidProperty vp = new ValidProperty(); 60 assertNull(vp.getName()); 61 } 62 63 public ValidPropertyTest(String name){ 64 super(name); 65 } 66 67 protected void setUp() { 68 } 69 70 protected void tearDown() { 71 } 72 73 private void nyi(){ 74 fail("Not Yet Implemented"); 75 } 76 77 public static void main(String args[]){ 78 if (args.length == 0){ 79 junit.textui.TestRunner.run(ValidPropertyTest.class); 80 } else { 81 junit.textui.TestRunner.run(makeSuite(args)); 82 } 83 } 84 private static TestSuite makeSuite(String args[]){ 85 final TestSuite ts = new TestSuite(); 86 for (int i = 0; i < args.length; i++){ 87 ts.addTest(new ValidPropertyTest(args[i])); 88 } 89 return ts; 90 } 91 } 92 | Popular Tags |