1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.mina.example.haiku;
20
21 import junit.framework.TestCase;
22
23
24
25
26 public class HaikuValidatorTest extends TestCase {
27
28 private static final String[] HAIKUS = {
29 "This class is boring.\n" + "Will David ever shut up?\n"
30 + "What is Steph wearing?",
31
32 "Oh, I drank too much.\n" + "Why, oh why did I sign up\n"
33 + "For an eight thirty?",
34
35 "Which one should I do?\n" + "Wax my chest or perm my hair?\n"
36 + "Can’t wait to decide.",
37
38 "Watch my video.\n" + "I can't stop this fee-ee-ling!\n"
39 + "What is wrong with me?",
40
41 "The car chases me.\n" + "I must get away from it.\n"
42 + "Turbo Boost! Oh, yeah.",
43
44 "My new slogan is\n" + "Don't hassle me... I'm oiling.\n"
45 + "You know it’s so true.",
46
47 "Michael, I love you.\n" + "I long for you to tell me\n"
48 + "\"KITT, need you buddy.\"",
49
50 "In Knight Rider, I’m\n" + "A Man Who Does Not Exist.\n"
51 + "(Except in your dreams).",
52
53 "Yes, I’m Michael Knight\n" + "Check out my unbuttoned shirt.\n"
54 + "And sexy tight pants.",
55
56 "My bitch ex-wife sucks.\n" + "And so do all the airlines.\n"
57 + "I miss Knight Rider.",
58
59 "I am Michael Knight.\n" + "I am David Hasselhoff.\n"
60 + "I’m not Rick James, bitch." };
61
62 private HaikuValidator validator;
63
64 @Override
65 protected void setUp() throws Exception {
66 super.setUp();
67
68 validator = new HaikuValidator();
69 }
70
71 public void testValidateHaikus() throws Exception {
72 for (String s : HAIKUS) {
73 String[] lines = s.split("\n");
74
75 Haiku haiku = new Haiku(lines);
76
77 validator.validate(haiku);
78 }
79 }
80 }