Lines 85-88
Link Here
|
85 |
assertEquals(firstTRs[1], s2.getTextRuns()[0].getText()); |
85 |
assertEquals(firstTRs[1], s2.getTextRuns()[0].getText()); |
86 |
assertEquals(firstTRs[2], s3.getTextRuns()[0].getText()); |
86 |
assertEquals(firstTRs[2], s3.getTextRuns()[0].getText()); |
87 |
} |
87 |
} |
|
|
88 |
|
89 |
/** |
90 |
* Assert that the order of slides is correct. |
91 |
* |
92 |
* @param filename file name of the slide show to assert |
93 |
* @param titles array of reference slide titles |
94 |
*/ |
95 |
protected void assertSlideOrdering(String filename, String[] titles) throws Exception { |
96 |
SlideShow ppt = new SlideShow(new HSLFSlideShow(filename)); |
97 |
Slide[] slide = ppt.getSlides(); |
98 |
|
99 |
assertEquals(titles.length, slide.length); |
100 |
for (int i = 0; i < slide.length; i++) { |
101 |
String title = slide[i].getTitle(); |
102 |
assertEquals("Wrong slide title in " + filename, titles[i], title); |
103 |
} |
104 |
} |
105 |
|
106 |
public void testTitles() throws Exception{ |
107 |
String dirname = System.getProperty("HSLF.testdata.path"); |
108 |
|
109 |
assertSlideOrdering(dirname + "/basic_test_ppt_file.ppt", |
110 |
new String[]{ |
111 |
"This is a test title", |
112 |
"This is the title on page 2" |
113 |
}); |
114 |
|
115 |
assertSlideOrdering(dirname + "/incorrect_slide_order.ppt", |
116 |
new String[]{ |
117 |
"Slide 1", |
118 |
"Slide 2", |
119 |
"Slide 3" |
120 |
}); |
121 |
|
122 |
assertSlideOrdering(dirname + "/next_test_ppt_file.ppt", |
123 |
new String[]{ |
124 |
"This is a test title", |
125 |
"This is the title on page 2" |
126 |
}); |
127 |
|
128 |
assertSlideOrdering(dirname + "/Single_Coloured_Page.ppt", |
129 |
new String[]{ |
130 |
"This is a title, its in black" |
131 |
}); |
132 |
|
133 |
assertSlideOrdering(dirname + "/Single_Coloured_Page_With_Fonts_and_Alignments.ppt", |
134 |
new String[]{ |
135 |
"This is a title, its in black" |
136 |
}); |
137 |
|
138 |
assertSlideOrdering(dirname + "/ParagraphStylesShorterThanCharStyles.ppt", |
139 |
new String[]{ |
140 |
"ROMANCE: AN ANALYSIS", |
141 |
"AGENDA", |
142 |
"You are an important supplier of various items that I need", |
143 |
(char)0x0B + "Although The Psycho set back my relationship process, recovery is luckily enough under way", |
144 |
"Since the time that we seriously go out together, you rank highly among existing relationships", |
145 |
"Although our personal interests are mostly compatible, the greatest gap exists in Sex and Shopping", |
146 |
"Your physical characteristics are strong when compared with your competition", |
147 |
"The combination of your high physical appearance and personality rank you highly, although your sister is also a top prospect", |
148 |
"When people found out that we were going out, their responses have been mixed", |
149 |
"The benchmark of relationship lifecycles, suggests that we are on schedule", |
150 |
"In summary we can say that we are on the right track, but we must remain aware of possible roadblocks ", |
151 |
"THE ANSWER", |
152 |
"Unfortunately a huge disconnect exists between my needs and your existing service", |
153 |
"SUMMARY", |
154 |
}); |
155 |
} |
88 |
} |
156 |
} |