View | Details | Raw Unified | Return to bug 51134
Collapse All | Expand All

(-)TestXWPFNumbering.java (+18 lines)
Lines 38-41 Link Here
38
		assertEquals(abstrNumId, compareAbstractNum);
38
		assertEquals(abstrNumId, compareAbstractNum);
39
	}
39
	}
40
40
41
	public void testAddNumberingToDoc() throws IOException{
42
		BigInteger abstractNumId = BigInteger.valueOf(1);
43
		BigInteger numId = BigInteger.valueOf(1);
44
45
		XWPFDocument docOut = new XWPFDocument();
46
		XWPFNumbering numbering = docOut.createNumbering();
47
		numId = numbering.addNum(abstractNumId);
48
		
49
		XWPFDocument docIn = XWPFTestDataSamples.writeOutAndReadBack(docOut);
50
51
		numbering = docIn.getNumbering();
52
		assertTrue(numbering.numExist(numId));
53
		XWPFNum num = numbering.getNum(numId);
54
55
		BigInteger compareAbstractNum = num.getCTNum().getAbstractNumId().getVal();
56
		assertEquals(abstractNumId, compareAbstractNum);
57
	}
58
41
}
59
}
(-)TestXWPFStyles.java (+20 lines)
Lines 20-30 Link Here
20
import java.io.IOException;
20
import java.io.IOException;
21
import java.util.ArrayList;
21
import java.util.ArrayList;
22
import java.util.List;
22
import java.util.List;
23
import java.lang.String;
23
24
24
import junit.framework.TestCase;
25
import junit.framework.TestCase;
25
26
26
import org.apache.poi.xwpf.XWPFTestDataSamples;
27
import org.apache.poi.xwpf.XWPFTestDataSamples;
27
28
29
import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTStyle;
30
28
public class TestXWPFStyles extends TestCase {
31
public class TestXWPFStyles extends TestCase {
29
32
30
//	protected void setUp() throws Exception {
33
//	protected void setUp() throws Exception {
Lines 48-53 Link Here
48
		
51
		
49
	}
52
	}
50
53
54
	public void testAddStylesToDocument() throws IOException{
55
		XWPFDocument docOut = new XWPFDocument();
56
		XWPFStyles styles = docOut.createStyles();
57
58
		String strStyleName = "headline1";
59
		CTStyle ctStyle = CTStyle.Factory.newInstance();
60
61
		ctStyle.setStyleId(strStyleName);
62
		XWPFStyle s = new XWPFStyle(ctStyle);
63
		styles.addStyle(s);
64
65
    	XWPFDocument docIn = XWPFTestDataSamples.writeOutAndReadBack(docOut);
66
67
		styles = docIn.getStyles();
68
		assertTrue(styles.styleExist(strStyleName));
69
	}
70
51
//	protected void tearDown() throws Exception {
71
//	protected void tearDown() throws Exception {
52
//		super.tearDown();
72
//		super.tearDown();
53
//	}
73
//	}

Return to bug 51134