Lines 104-114
Link Here
|
104 |
@Test |
104 |
@Test |
105 |
public void testGetSetBorderBottom() { |
105 |
public void testGetSetBorderBottom() { |
106 |
//default values |
106 |
//default values |
107 |
assertEquals(CellStyle.BORDER_NONE, cellStyle.getBorderBottom()); |
107 |
assertEquals(BorderStyle.NONE, cellStyle.getBorderBottom()); |
108 |
|
108 |
|
109 |
int num = stylesTable.getBorders().size(); |
109 |
int num = stylesTable.getBorders().size(); |
110 |
cellStyle.setBorderBottom(CellStyle.BORDER_MEDIUM); |
110 |
cellStyle.setBorderBottom(BorderStyle.MEDIUM); |
111 |
assertEquals(CellStyle.BORDER_MEDIUM, cellStyle.getBorderBottom()); |
111 |
assertEquals(BorderStyle.MEDIUM, cellStyle.getBorderBottom()); |
112 |
//a new border has been added |
112 |
//a new border has been added |
113 |
assertEquals(num + 1, stylesTable.getBorders().size()); |
113 |
assertEquals(num + 1, stylesTable.getBorders().size()); |
114 |
//id of the created border |
114 |
//id of the created border |
Lines 121-135
Link Here
|
121 |
num = stylesTable.getBorders().size(); |
121 |
num = stylesTable.getBorders().size(); |
122 |
//setting the same border multiple times should not change borderId |
122 |
//setting the same border multiple times should not change borderId |
123 |
for (int i = 0; i < 3; i++) { |
123 |
for (int i = 0; i < 3; i++) { |
124 |
cellStyle.setBorderBottom(CellStyle.BORDER_MEDIUM); |
124 |
cellStyle.setBorderBottom(BorderStyle.MEDIUM); |
125 |
assertEquals(CellStyle.BORDER_MEDIUM, cellStyle.getBorderBottom()); |
125 |
assertEquals(BorderStyle.MEDIUM, cellStyle.getBorderBottom()); |
126 |
} |
126 |
} |
127 |
assertEquals(borderId, cellStyle.getCoreXf().getBorderId()); |
127 |
assertEquals(borderId, cellStyle.getCoreXf().getBorderId()); |
128 |
assertEquals(num, stylesTable.getBorders().size()); |
128 |
assertEquals(num, stylesTable.getBorders().size()); |
129 |
assertSame(ctBorder, stylesTable.getBorderAt(borderId).getCTBorder()); |
129 |
assertSame(ctBorder, stylesTable.getBorderAt(borderId).getCTBorder()); |
130 |
|
130 |
|
131 |
//setting border to none removes the <bottom> element |
131 |
//setting border to none removes the <bottom> element |
132 |
cellStyle.setBorderBottom(CellStyle.BORDER_NONE); |
132 |
cellStyle.setBorderBottom(BorderStyle.NONE); |
133 |
assertEquals(num, stylesTable.getBorders().size()); |
133 |
assertEquals(num, stylesTable.getBorders().size()); |
134 |
borderId = (int)cellStyle.getCoreXf().getBorderId(); |
134 |
borderId = (int)cellStyle.getCoreXf().getBorderId(); |
135 |
ctBorder = stylesTable.getBorderAt(borderId).getCTBorder(); |
135 |
ctBorder = stylesTable.getBorderAt(borderId).getCTBorder(); |
Lines 139-149
Link Here
|
139 |
@Test |
139 |
@Test |
140 |
public void testGetSetBorderRight() { |
140 |
public void testGetSetBorderRight() { |
141 |
//default values |
141 |
//default values |
142 |
assertEquals(CellStyle.BORDER_NONE, cellStyle.getBorderRight()); |
142 |
assertEquals(BorderStyle.NONE, cellStyle.getBorderRight()); |
143 |
|
143 |
|
144 |
int num = stylesTable.getBorders().size(); |
144 |
int num = stylesTable.getBorders().size(); |
145 |
cellStyle.setBorderRight(CellStyle.BORDER_MEDIUM); |
145 |
cellStyle.setBorderRight(BorderStyle.MEDIUM); |
146 |
assertEquals(CellStyle.BORDER_MEDIUM, cellStyle.getBorderRight()); |
146 |
assertEquals(BorderStyle.MEDIUM, cellStyle.getBorderRight()); |
147 |
//a new border has been added |
147 |
//a new border has been added |
148 |
assertEquals(num + 1, stylesTable.getBorders().size()); |
148 |
assertEquals(num + 1, stylesTable.getBorders().size()); |
149 |
//id of the created border |
149 |
//id of the created border |
Lines 156-170
Link Here
|
156 |
num = stylesTable.getBorders().size(); |
156 |
num = stylesTable.getBorders().size(); |
157 |
//setting the same border multiple times should not change borderId |
157 |
//setting the same border multiple times should not change borderId |
158 |
for (int i = 0; i < 3; i++) { |
158 |
for (int i = 0; i < 3; i++) { |
159 |
cellStyle.setBorderRight(CellStyle.BORDER_MEDIUM); |
159 |
cellStyle.setBorderRight(BorderStyle.MEDIUM); |
160 |
assertEquals(CellStyle.BORDER_MEDIUM, cellStyle.getBorderRight()); |
160 |
assertEquals(BorderStyle.MEDIUM, cellStyle.getBorderRight()); |
161 |
} |
161 |
} |
162 |
assertEquals(borderId, cellStyle.getCoreXf().getBorderId()); |
162 |
assertEquals(borderId, cellStyle.getCoreXf().getBorderId()); |
163 |
assertEquals(num, stylesTable.getBorders().size()); |
163 |
assertEquals(num, stylesTable.getBorders().size()); |
164 |
assertSame(ctBorder, stylesTable.getBorderAt(borderId).getCTBorder()); |
164 |
assertSame(ctBorder, stylesTable.getBorderAt(borderId).getCTBorder()); |
165 |
|
165 |
|
166 |
//setting border to none removes the <right> element |
166 |
//setting border to none removes the <right> element |
167 |
cellStyle.setBorderRight(CellStyle.BORDER_NONE); |
167 |
cellStyle.setBorderRight(BorderStyle.NONE); |
168 |
assertEquals(num, stylesTable.getBorders().size()); |
168 |
assertEquals(num, stylesTable.getBorders().size()); |
169 |
borderId = (int)cellStyle.getCoreXf().getBorderId(); |
169 |
borderId = (int)cellStyle.getCoreXf().getBorderId(); |
170 |
ctBorder = stylesTable.getBorderAt(borderId).getCTBorder(); |
170 |
ctBorder = stylesTable.getBorderAt(borderId).getCTBorder(); |
Lines 174-184
Link Here
|
174 |
@Test |
174 |
@Test |
175 |
public void testGetSetBorderLeft() { |
175 |
public void testGetSetBorderLeft() { |
176 |
//default values |
176 |
//default values |
177 |
assertEquals(CellStyle.BORDER_NONE, cellStyle.getBorderLeft()); |
177 |
assertEquals(BorderStyle.NONE, cellStyle.getBorderLeft()); |
178 |
|
178 |
|
179 |
int num = stylesTable.getBorders().size(); |
179 |
int num = stylesTable.getBorders().size(); |
180 |
cellStyle.setBorderLeft(CellStyle.BORDER_MEDIUM); |
180 |
cellStyle.setBorderLeft(BorderStyle.MEDIUM); |
181 |
assertEquals(CellStyle.BORDER_MEDIUM, cellStyle.getBorderLeft()); |
181 |
assertEquals(BorderStyle.MEDIUM, cellStyle.getBorderLeft()); |
182 |
//a new border has been added |
182 |
//a new border has been added |
183 |
assertEquals(num + 1, stylesTable.getBorders().size()); |
183 |
assertEquals(num + 1, stylesTable.getBorders().size()); |
184 |
//id of the created border |
184 |
//id of the created border |
Lines 191-205
Link Here
|
191 |
num = stylesTable.getBorders().size(); |
191 |
num = stylesTable.getBorders().size(); |
192 |
//setting the same border multiple times should not change borderId |
192 |
//setting the same border multiple times should not change borderId |
193 |
for (int i = 0; i < 3; i++) { |
193 |
for (int i = 0; i < 3; i++) { |
194 |
cellStyle.setBorderLeft(CellStyle.BORDER_MEDIUM); |
194 |
cellStyle.setBorderLeft(BorderStyle.MEDIUM); |
195 |
assertEquals(CellStyle.BORDER_MEDIUM, cellStyle.getBorderLeft()); |
195 |
assertEquals(BorderStyle.MEDIUM, cellStyle.getBorderLeft()); |
196 |
} |
196 |
} |
197 |
assertEquals(borderId, cellStyle.getCoreXf().getBorderId()); |
197 |
assertEquals(borderId, cellStyle.getCoreXf().getBorderId()); |
198 |
assertEquals(num, stylesTable.getBorders().size()); |
198 |
assertEquals(num, stylesTable.getBorders().size()); |
199 |
assertSame(ctBorder, stylesTable.getBorderAt(borderId).getCTBorder()); |
199 |
assertSame(ctBorder, stylesTable.getBorderAt(borderId).getCTBorder()); |
200 |
|
200 |
|
201 |
//setting border to none removes the <left> element |
201 |
//setting border to none removes the <left> element |
202 |
cellStyle.setBorderLeft(CellStyle.BORDER_NONE); |
202 |
cellStyle.setBorderLeft(BorderStyle.NONE); |
203 |
assertEquals(num, stylesTable.getBorders().size()); |
203 |
assertEquals(num, stylesTable.getBorders().size()); |
204 |
borderId = (int)cellStyle.getCoreXf().getBorderId(); |
204 |
borderId = (int)cellStyle.getCoreXf().getBorderId(); |
205 |
ctBorder = stylesTable.getBorderAt(borderId).getCTBorder(); |
205 |
ctBorder = stylesTable.getBorderAt(borderId).getCTBorder(); |
Lines 209-219
Link Here
|
209 |
@Test |
209 |
@Test |
210 |
public void testGetSetBorderTop() { |
210 |
public void testGetSetBorderTop() { |
211 |
//default values |
211 |
//default values |
212 |
assertEquals(CellStyle.BORDER_NONE, cellStyle.getBorderTop()); |
212 |
assertEquals(BorderStyle.NONE, cellStyle.getBorderTop()); |
213 |
|
213 |
|
214 |
int num = stylesTable.getBorders().size(); |
214 |
int num = stylesTable.getBorders().size(); |
215 |
cellStyle.setBorderTop(CellStyle.BORDER_MEDIUM); |
215 |
cellStyle.setBorderTop(BorderStyle.MEDIUM); |
216 |
assertEquals(CellStyle.BORDER_MEDIUM, cellStyle.getBorderTop()); |
216 |
assertEquals(BorderStyle.MEDIUM, cellStyle.getBorderTop()); |
217 |
//a new border has been added |
217 |
//a new border has been added |
218 |
assertEquals(num + 1, stylesTable.getBorders().size()); |
218 |
assertEquals(num + 1, stylesTable.getBorders().size()); |
219 |
//id of the created border |
219 |
//id of the created border |
Lines 226-390
Link Here
|
226 |
num = stylesTable.getBorders().size(); |
226 |
num = stylesTable.getBorders().size(); |
227 |
//setting the same border multiple times should not change borderId |
227 |
//setting the same border multiple times should not change borderId |
228 |
for (int i = 0; i < 3; i++) { |
228 |
for (int i = 0; i < 3; i++) { |
229 |
cellStyle.setBorderTop(CellStyle.BORDER_MEDIUM); |
229 |
cellStyle.setBorderTop(BorderStyle.MEDIUM); |
230 |
assertEquals(CellStyle.BORDER_MEDIUM, cellStyle.getBorderTop()); |
230 |
assertEquals(BorderStyle.MEDIUM, cellStyle.getBorderTop()); |
231 |
} |
231 |
} |
232 |
assertEquals(borderId, cellStyle.getCoreXf().getBorderId()); |
232 |
assertEquals(borderId, cellStyle.getCoreXf().getBorderId()); |
233 |
assertEquals(num, stylesTable.getBorders().size()); |
233 |
assertEquals(num, stylesTable.getBorders().size()); |
234 |
assertSame(ctBorder, stylesTable.getBorderAt(borderId).getCTBorder()); |
234 |
assertSame(ctBorder, stylesTable.getBorderAt(borderId).getCTBorder()); |
235 |
|
235 |
|
236 |
//setting border to none removes the <top> element |
236 |
//setting border to none removes the <top> element |
237 |
cellStyle.setBorderTop(CellStyle.BORDER_NONE); |
237 |
cellStyle.setBorderTop(BorderStyle.NONE); |
238 |
assertEquals(num, stylesTable.getBorders().size()); |
238 |
assertEquals(num, stylesTable.getBorders().size()); |
239 |
borderId = (int)cellStyle.getCoreXf().getBorderId(); |
239 |
borderId = (int)cellStyle.getCoreXf().getBorderId(); |
240 |
ctBorder = stylesTable.getBorderAt(borderId).getCTBorder(); |
240 |
ctBorder = stylesTable.getBorderAt(borderId).getCTBorder(); |
241 |
assertFalse(ctBorder.isSetTop()); |
241 |
assertFalse(ctBorder.isSetTop()); |
242 |
} |
242 |
} |
243 |
|
243 |
|
244 |
@Test |
244 |
private void testGetSetBorderXMLBean(BorderStyle border, STBorderStyle.Enum expected) { |
245 |
public void testGetSetBorderThin() { |
245 |
cellStyle.setBorderTop(border); |
246 |
cellStyle.setBorderTop(CellStyle.BORDER_THIN); |
246 |
assertEquals(border, cellStyle.getBorderTop()); |
247 |
assertEquals(CellStyle.BORDER_THIN, cellStyle.getBorderTop()); |
|
|
248 |
int borderId = (int)cellStyle.getCoreXf().getBorderId(); |
247 |
int borderId = (int)cellStyle.getCoreXf().getBorderId(); |
249 |
assertTrue(borderId > 0); |
248 |
assertTrue(borderId > 0); |
250 |
//check changes in the underlying xml bean |
249 |
//check changes in the underlying xml bean |
251 |
CTBorder ctBorder = stylesTable.getBorderAt(borderId).getCTBorder(); |
250 |
CTBorder ctBorder = stylesTable.getBorderAt(borderId).getCTBorder(); |
252 |
assertEquals(STBorderStyle.THIN, ctBorder.getTop().getStyle()); |
251 |
assertEquals(expected, ctBorder.getTop().getStyle()); |
253 |
} |
252 |
} |
254 |
|
253 |
|
255 |
@Test |
254 |
|
256 |
public void testGetSetBorderMedium() { |
255 |
// Border Styles, in BorderStyle/STBorderStyle enum order |
257 |
cellStyle.setBorderTop(CellStyle.BORDER_MEDIUM); |
256 |
@Test |
258 |
assertEquals(CellStyle.BORDER_MEDIUM, cellStyle.getBorderTop()); |
257 |
public void testGetSetBorderNone() { |
|
|
258 |
cellStyle.setBorderTop(BorderStyle.NONE); |
259 |
assertEquals(BorderStyle.NONE, cellStyle.getBorderTop()); |
259 |
int borderId = (int)cellStyle.getCoreXf().getBorderId(); |
260 |
int borderId = (int)cellStyle.getCoreXf().getBorderId(); |
260 |
assertTrue(borderId > 0); |
261 |
assertTrue(borderId > 0); |
261 |
//check changes in the underlying xml bean |
262 |
//check changes in the underlying xml bean |
262 |
CTBorder ctBorder = stylesTable.getBorderAt(borderId).getCTBorder(); |
263 |
CTBorder ctBorder = stylesTable.getBorderAt(borderId).getCTBorder(); |
263 |
assertEquals(STBorderStyle.MEDIUM, ctBorder.getTop().getStyle()); |
264 |
assertNull(ctBorder.getTop()); |
264 |
} |
265 |
// no border style and STBorderStyle.NONE are equivalent |
265 |
|
266 |
// POI prefers to unset the border style than explicitly set it STBorderStyle.NONE |
266 |
@Test |
267 |
} |
|
|
268 |
|
269 |
@Test |
270 |
public void testGetSetBorderThin() { |
271 |
testGetSetBorderXMLBean(BorderStyle.THIN, STBorderStyle.THIN); |
272 |
} |
273 |
|
274 |
@Test |
275 |
public void testGetSetBorderMedium() { |
276 |
testGetSetBorderXMLBean(BorderStyle.MEDIUM, STBorderStyle.MEDIUM); |
277 |
} |
278 |
|
279 |
@Test |
280 |
public void testGetSetBorderDashed() { |
281 |
testGetSetBorderXMLBean(BorderStyle.DASHED, STBorderStyle.DASHED); |
282 |
} |
283 |
|
284 |
@Test |
285 |
public void testGetSetBorderDotted() { |
286 |
testGetSetBorderXMLBean(BorderStyle.DOTTED, STBorderStyle.DOTTED); |
287 |
} |
288 |
|
289 |
@Test |
267 |
public void testGetSetBorderThick() { |
290 |
public void testGetSetBorderThick() { |
268 |
cellStyle.setBorderTop(CellStyle.BORDER_THICK); |
291 |
testGetSetBorderXMLBean(BorderStyle.THICK, STBorderStyle.THICK); |
269 |
assertEquals(CellStyle.BORDER_THICK, cellStyle.getBorderTop()); |
292 |
} |
270 |
int borderId = (int)cellStyle.getCoreXf().getBorderId(); |
293 |
|
271 |
assertTrue(borderId > 0); |
294 |
@Test |
272 |
//check changes in the underlying xml bean |
295 |
public void testGetSetBorderDouble() { |
273 |
CTBorder ctBorder = stylesTable.getBorderAt(borderId).getCTBorder(); |
296 |
testGetSetBorderXMLBean(BorderStyle.DOUBLE, STBorderStyle.DOUBLE); |
274 |
assertEquals(STBorderStyle.THICK, ctBorder.getTop().getStyle()); |
297 |
} |
275 |
} |
298 |
|
276 |
|
299 |
@Test |
277 |
@Test |
|
|
278 |
public void testGetSetBorderHair() { |
300 |
public void testGetSetBorderHair() { |
279 |
cellStyle.setBorderTop(CellStyle.BORDER_HAIR); |
301 |
testGetSetBorderXMLBean(BorderStyle.HAIR, STBorderStyle.HAIR); |
280 |
assertEquals(CellStyle.BORDER_HAIR, cellStyle.getBorderTop()); |
302 |
} |
281 |
int borderId = (int)cellStyle.getCoreXf().getBorderId(); |
303 |
|
282 |
assertTrue(borderId > 0); |
304 |
@Test |
283 |
//check changes in the underlying xml bean |
305 |
public void testGetSetBorderMediumDashed() { |
284 |
CTBorder ctBorder = stylesTable.getBorderAt(borderId).getCTBorder(); |
306 |
testGetSetBorderXMLBean(BorderStyle.MEDIUM_DASHED, STBorderStyle.MEDIUM_DASHED); |
285 |
assertEquals(STBorderStyle.HAIR, ctBorder.getTop().getStyle()); |
307 |
} |
286 |
} |
308 |
|
287 |
|
309 |
@Test |
288 |
@Test |
|
|
289 |
public void testGetSetBorderDotted() { |
290 |
cellStyle.setBorderTop(CellStyle.BORDER_DOTTED); |
291 |
assertEquals(CellStyle.BORDER_DOTTED, cellStyle.getBorderTop()); |
292 |
int borderId = (int)cellStyle.getCoreXf().getBorderId(); |
293 |
assertTrue(borderId > 0); |
294 |
//check changes in the underlying xml bean |
295 |
CTBorder ctBorder = stylesTable.getBorderAt(borderId).getCTBorder(); |
296 |
assertEquals(STBorderStyle.DOTTED, ctBorder.getTop().getStyle()); |
297 |
} |
298 |
|
299 |
@Test |
300 |
public void testGetSetBorderDashed() { |
301 |
cellStyle.setBorderTop(CellStyle.BORDER_DASHED); |
302 |
assertEquals(CellStyle.BORDER_DASHED, cellStyle.getBorderTop()); |
303 |
int borderId = (int)cellStyle.getCoreXf().getBorderId(); |
304 |
assertTrue(borderId > 0); |
305 |
//check changes in the underlying xml bean |
306 |
CTBorder ctBorder = stylesTable.getBorderAt(borderId).getCTBorder(); |
307 |
assertEquals(STBorderStyle.DASHED, ctBorder.getTop().getStyle()); |
308 |
} |
309 |
|
310 |
@Test |
311 |
public void testGetSetBorderDashDot() { |
310 |
public void testGetSetBorderDashDot() { |
312 |
cellStyle.setBorderTop(CellStyle.BORDER_DASH_DOT); |
311 |
testGetSetBorderXMLBean(BorderStyle.DASH_DOT, STBorderStyle.DASH_DOT); |
313 |
assertEquals(CellStyle.BORDER_DASH_DOT, cellStyle.getBorderTop()); |
312 |
} |
314 |
int borderId = (int)cellStyle.getCoreXf().getBorderId(); |
313 |
|
315 |
assertTrue(borderId > 0); |
314 |
@Test |
316 |
//check changes in the underlying xml bean |
|
|
317 |
CTBorder ctBorder = stylesTable.getBorderAt(borderId).getCTBorder(); |
318 |
assertEquals(STBorderStyle.DASH_DOT, ctBorder.getTop().getStyle()); |
319 |
} |
320 |
|
321 |
@Test |
322 |
public void testGetSetBorderDashDotDot() { |
323 |
cellStyle.setBorderTop(CellStyle.BORDER_DASH_DOT_DOT); |
324 |
assertEquals(CellStyle.BORDER_DASH_DOT_DOT, cellStyle.getBorderTop()); |
325 |
int borderId = (int)cellStyle.getCoreXf().getBorderId(); |
326 |
assertTrue(borderId > 0); |
327 |
//check changes in the underlying xml bean |
328 |
CTBorder ctBorder = stylesTable.getBorderAt(borderId).getCTBorder(); |
329 |
assertEquals(STBorderStyle.DASH_DOT_DOT, ctBorder.getTop().getStyle()); |
330 |
} |
331 |
|
332 |
@Test |
333 |
public void testGetSetBorderMediumDashDot() { |
315 |
public void testGetSetBorderMediumDashDot() { |
334 |
cellStyle.setBorderTop(CellStyle.BORDER_MEDIUM_DASH_DOT); |
316 |
testGetSetBorderXMLBean(BorderStyle.MEDIUM_DASH_DOT, STBorderStyle.MEDIUM_DASH_DOT); |
335 |
assertEquals(CellStyle.BORDER_MEDIUM_DASH_DOT, cellStyle.getBorderTop()); |
317 |
} |
336 |
int borderId = (int)cellStyle.getCoreXf().getBorderId(); |
318 |
|
337 |
assertTrue(borderId > 0); |
319 |
@Test |
338 |
//check changes in the underlying xml bean |
320 |
public void testGetSetBorderDashDotDot() { |
339 |
CTBorder ctBorder = stylesTable.getBorderAt(borderId).getCTBorder(); |
321 |
testGetSetBorderXMLBean(BorderStyle.DASH_DOT_DOT, STBorderStyle.DASH_DOT_DOT); |
340 |
assertEquals(STBorderStyle.MEDIUM_DASH_DOT, ctBorder.getTop().getStyle()); |
322 |
} |
341 |
} |
323 |
|
342 |
|
324 |
@Test |
343 |
@Test |
|
|
344 |
public void testGetSetBorderMediumDashDotDot() { |
325 |
public void testGetSetBorderMediumDashDotDot() { |
345 |
cellStyle.setBorderTop(CellStyle.BORDER_MEDIUM_DASH_DOT_DOT); |
326 |
testGetSetBorderXMLBean(BorderStyle.MEDIUM_DASH_DOT_DOT, STBorderStyle.MEDIUM_DASH_DOT_DOT); |
346 |
assertEquals(CellStyle.BORDER_MEDIUM_DASH_DOT_DOT, cellStyle.getBorderTop()); |
327 |
} |
347 |
int borderId = (int)cellStyle.getCoreXf().getBorderId(); |
328 |
|
348 |
assertTrue(borderId > 0); |
329 |
@Test |
349 |
//check changes in the underlying xml bean |
|
|
350 |
CTBorder ctBorder = stylesTable.getBorderAt(borderId).getCTBorder(); |
351 |
assertEquals(STBorderStyle.MEDIUM_DASH_DOT_DOT, ctBorder.getTop().getStyle()); |
352 |
} |
353 |
|
354 |
@Test |
355 |
public void testGetSetBorderMediumDashed() { |
356 |
cellStyle.setBorderTop(CellStyle.BORDER_MEDIUM_DASHED); |
357 |
assertEquals(CellStyle.BORDER_MEDIUM_DASHED, cellStyle.getBorderTop()); |
358 |
int borderId = (int)cellStyle.getCoreXf().getBorderId(); |
359 |
assertTrue(borderId > 0); |
360 |
//check changes in the underlying xml bean |
361 |
CTBorder ctBorder = stylesTable.getBorderAt(borderId).getCTBorder(); |
362 |
assertEquals(STBorderStyle.MEDIUM_DASHED, ctBorder.getTop().getStyle()); |
363 |
} |
364 |
|
365 |
@Test |
366 |
public void testGetSetBorderSlantDashDot() { |
330 |
public void testGetSetBorderSlantDashDot() { |
367 |
cellStyle.setBorderTop(CellStyle.BORDER_SLANTED_DASH_DOT); |
331 |
testGetSetBorderXMLBean(BorderStyle.SLANTED_DASH_DOT, STBorderStyle.SLANT_DASH_DOT); |
368 |
assertEquals(CellStyle.BORDER_SLANTED_DASH_DOT, cellStyle.getBorderTop()); |
332 |
} |
369 |
int borderId = (int)cellStyle.getCoreXf().getBorderId(); |
333 |
|
370 |
assertTrue(borderId > 0); |
334 |
@Test |
371 |
//check changes in the underlying xml bean |
|
|
372 |
CTBorder ctBorder = stylesTable.getBorderAt(borderId).getCTBorder(); |
373 |
assertEquals(STBorderStyle.SLANT_DASH_DOT, ctBorder.getTop().getStyle()); |
374 |
} |
375 |
|
376 |
@Test |
377 |
public void testGetSetBorderDouble() { |
378 |
cellStyle.setBorderTop(CellStyle.BORDER_DOUBLE); |
379 |
assertEquals(CellStyle.BORDER_DOUBLE, cellStyle.getBorderTop()); |
380 |
int borderId = (int)cellStyle.getCoreXf().getBorderId(); |
381 |
assertTrue(borderId > 0); |
382 |
//check changes in the underlying xml bean |
383 |
CTBorder ctBorder = stylesTable.getBorderAt(borderId).getCTBorder(); |
384 |
assertEquals(STBorderStyle.DOUBLE, ctBorder.getTop().getStyle()); |
385 |
} |
386 |
|
387 |
@Test |
388 |
public void testGetSetBottomBorderColor() { |
335 |
public void testGetSetBottomBorderColor() { |
389 |
//defaults |
336 |
//defaults |
390 |
assertEquals(IndexedColors.BLACK.getIndex(), cellStyle.getBottomBorderColor()); |
337 |
assertEquals(IndexedColors.BLACK.getIndex(), cellStyle.getBottomBorderColor()); |
Lines 1104-1108
Link Here
|
1104 |
|
1051 |
|
1105 |
cellStyle.setRightBorderColor(null); |
1052 |
cellStyle.setRightBorderColor(null); |
1106 |
assertNull(cellStyle.getRightBorderXSSFColor()); |
1053 |
assertNull(cellStyle.getRightBorderXSSFColor()); |
|
|
1054 |
|
1055 |
workbook.close(); |
1107 |
} |
1056 |
} |
1108 |
} |
1057 |
} |