1 37 package net.sourceforge.cruisecontrol.labelincrementers; 38 39 import junit.framework.TestCase; 40 41 public class CVSLabelIncrementerTest extends TestCase { 42 43 private CVSLabelIncrementer incrementer; 44 45 public CVSLabelIncrementerTest(String name) { 46 super(name); 47 } 48 49 public void setUp() { 50 incrementer = new CVSLabelIncrementer(); 51 } 52 53 public void testIsValidLabel() { 54 assertEquals(incrementer.isValidLabel("x-88"), true); 55 assertEquals(incrementer.isValidLabel("x-y"), false); 56 assertEquals(incrementer.isValidLabel("x88"), false); 57 } 58 59 public void testIncrementLabel() { 60 assertEquals(incrementer.incrementLabel("x-88", null), "x-89"); 61 } 62 63 public void testSetPreBuildIncrementer() { 64 assertEquals(false, incrementer.isPreBuildIncrementer()); 65 incrementer.setPreBuildIncrementer(true); 66 assertEquals(true, incrementer.isPreBuildIncrementer()); 67 } 68 69 public void testGetDefaultLabel() { 70 assertEquals("build-1", incrementer.getDefaultLabel()); 71 assertTrue(incrementer.isValidLabel(incrementer.getDefaultLabel())); 72 } 73 } 74 | Popular Tags |