@@ -0,0 +1,1543 @@
+package org.lxtuong.test.docx4j;%0A%0Aimport static org.junit.Assert.*;%0A%0Aimport java.io.File;%0Aimport java.io.IOException;%0A%0Aimport org.apache.commons.io.FileUtils;%0Aimport org.docx4j.openpackaging.exceptions.Docx4JException;%0Aimport org.docx4j.openpackaging.exceptions.InvalidFormatException;%0Aimport org.docx4j.openpackaging.packages.WordprocessingMLPackage;%0Aimport org.junit.After;%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0A%0A/**%0A * %0A * @author Xuan Tuong LE%0A *%0A */%0Apublic class Docx4jBasicTest %7B%0A  private static final String DOCX4J = %22docx4j%22;%0A  private File docx4jTempDirectory;%0A  %0A  @Before%0A  public void setUp() %7B%0A    docx4jTempDirectory = new File(FileUtils.getTempDirectoryPath(), DOCX4J);%0A    assertTrue(docx4jTempDirectory.mkdirs());%0A  %7D%0A%0A  @After%0A  public void tearDown() %7B%0A    try %7B%0A      FileUtils.deleteDirectory(docx4jTempDirectory);%0A    %7D catch (IOException e) %7B%0A      e.printStackTrace();%0A      fail();%0A    %7D%0A  %7D %0A  %0A  @Test%0A  public void testCreateADocx() %7B%0A    WordprocessingMLPackage wordMLPackage = null;%0A    try %7B%0A      wordMLPackage = WordprocessingMLPackage.createPackage();%0A    %7D catch (InvalidFormatException e) %7B%0A      fail(e.getMessage());%0A    %7D%0A%0A    wordMLPackage.getMainDocumentPart().addStyledParagraphOfText(%22Title%22, %22docx4j%22);%0A%0A    wordMLPackage.getMainDocumentPart().addParagraphOfText(%22Test create a docx with docx4j%22);%0A%0A    try %7B%0A      File docx = new File(docx4jTempDirectory, %22testCreateADocx.docx%22);%0A      wordMLPackage.save(docx);%0A    %7D catch (Docx4JException e) %7B%0A      e.printStackTrace();%0A    %7D%0A%0A  %7D%0A%7D%0A

add a create docx test