/**
* Test createPartName(String, y)
*/
public void testCreatePartNameRelativeString()
throws InvalidFormatException {
PackagePartName partNameToValid = PackagingURIHelper
.createPartName("/word/media/image1.gif");
OPCPackage pkg = OPCPackage.create("DELETEIFEXISTS.docx");
// Base part
PackagePartName nameBase = PackagingURIHelper
.createPartName("/word/document.xml");
PackagePart partBase = pkg.createPart(nameBase, ContentTypes.XML);
// Relative part name
PackagePartName relativeName = PackagingURIHelper.createPartName(
"media/image1.gif", partBase);
assertTrue("The part name must be equal to "
+ partNameToValid.getName(), partNameToValid
.equals(relativeName));
pkg.revert();