1 37 package net.sourceforge.cruisecontrol; 38 39 import junit.framework.TestCase; 40 41 public class AttributeTest extends TestCase { 42 private Attribute cvsRoot; 43 private Attribute exitOnFailure; 44 45 protected void setUp() throws Exception { 46 super.setUp(); 47 48 cvsRoot = new Attribute("cvsRoot", String .class); 49 exitOnFailure = new Attribute("exitOnFailure", Boolean.TYPE); 50 } 51 52 public void testGettingName() { 53 assertEquals("cvsRoot", cvsRoot.getName()); 54 assertEquals("exitOnFailure", exitOnFailure.getName()); 55 } 56 57 public void testGettingType() { 58 assertEquals(String .class, cvsRoot.getType()); 59 assertEquals(Boolean.TYPE, exitOnFailure.getType()); 60 } 61 62 public void testComparing() { 63 assertEquals(0, cvsRoot.compareTo(cvsRoot)); 64 assertEquals(0, exitOnFailure.compareTo(exitOnFailure)); 65 assertTrue(cvsRoot.compareTo(exitOnFailure) < 0); 66 assertTrue(exitOnFailure.compareTo(cvsRoot) > 0); 67 } 68 } 69 | Popular Tags |