1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package de.smartics.ci.config.load;
17
18 import static org.hamcrest.MatcherAssert.assertThat;
19 import static org.hamcrest.Matchers.equalTo;
20 import static org.hamcrest.Matchers.is;
21
22 import org.junit.Test;
23 import org.junit.experimental.categories.Category;
24
25 import de.smartics.testdoc.annotations.Uut;
26 import de.smartics.testdoc.categories.type.Construction;
27 import de.smartics.util.lang.BlankArgumentException;
28
29
30
31
32 @Uut(type = HudsonJobConfig.class)
33 @Category(Construction.class)
34 public class HudsonJobConfigTest
35 {
36
37
38
39
40 private static final String TEST_ID = "id";
41
42 private static final String TEST_CONFIG_XML = "<xml></xml>";
43
44
45
46
47
48
49
50
51
52
53
54
55
56 @Test(expected = BlankArgumentException.class)
57 public void requiresAnIdOnConstruction()
58 {
59 new HudsonJobConfig(null, TEST_CONFIG_XML);
60 }
61
62 @Test(expected = BlankArgumentException.class)
63 public void requiresTheXmlRepresentation()
64 {
65 new HudsonJobConfig(TEST_ID, "");
66 }
67
68 @Test
69 public void allowsToAccessAllProperties()
70 {
71 final HudsonJobConfig uut = new HudsonJobConfig(TEST_ID, TEST_CONFIG_XML);
72
73 assertThat(uut.getId(), is(equalTo(TEST_ID)));
74 assertThat(uut.getConfigXml(), is(equalTo(TEST_CONFIG_XML)));
75 }
76
77 }