Package org.docx4j.openpackaging.parts.relationships.AlteredParts

Examples of org.docx4j.openpackaging.parts.relationships.AlteredParts.Alterations


    String inputfilepath = resourceDir + "paragraph-single.docx";
   
    WordprocessingMLPackage thisPackage = WordprocessingMLPackage.load(new java.io.File(inputfilepath));
    WordprocessingMLPackage otherPackage = WordprocessingMLPackage.load(new java.io.File(inputfilepath));
   
    Alterations alterations = AlteredParts.start(thisPackage, otherPackage);
   
    assertTrue( alterations.getPartsAdded().size()==0 );
//    assertTrue( alterations.getPartsModified().size()==0 ); // FIXME
    assertTrue( alterations.getPartsDeleted().size()==0 );
  }
View Full Code Here


    WordprocessingMLPackage thisPackage = WordprocessingMLPackage.load(
        new java.io.File(resourceDir + "paragraph-single.docx"));
    WordprocessingMLPackage otherPackage = WordprocessingMLPackage.load(
        new java.io.File(resourceDir + "paragraph-two.docx"));
   
    Alterations alterations = AlteredParts.start(thisPackage, otherPackage);

    alterations.debug();
       
    assertTrue( alterations.getPartsAdded().size()==0 );
    assertTrue( alterations.getPartsModified().size()==1 );
    assertTrue( alterations.getPartsDeleted().size()==0 );
   
  }
View Full Code Here

    WordprocessingMLPackage thisPackage = WordprocessingMLPackage.load(
        new java.io.File(resourceDir + "hyperlink.docx"));
    WordprocessingMLPackage otherPackage = WordprocessingMLPackage.load(
        new java.io.File(resourceDir + "paragraph-single.docx"));
   
    Alterations alterations = AlteredParts.start(thisPackage, otherPackage);

    alterations.debug();
       
    assertTrue( alterations.getPartsAdded().size()==0 );
    assertTrue( alterations.getPartsModified().size()==3 );
    assertTrue( alterations.getPartsDeleted().size()==0 );
   
  }
View Full Code Here

    WordprocessingMLPackage thisPackage = WordprocessingMLPackage.load(
        new java.io.File(resourceDir + "image-png1.docx"));
    WordprocessingMLPackage otherPackage = WordprocessingMLPackage.load(
        new java.io.File(resourceDir + "image-png1-scaled.docx"));
   
    Alterations alterations = AlteredParts.start(thisPackage, otherPackage);

    alterations.debug();
       
    assertTrue( alterations.getPartsAdded().size()==0 );
    assertTrue( alterations.getPartsModified().size()==1 );
    assertTrue( alterations.getPartsDeleted().size()==0 );
   
  }
View Full Code Here

    WordprocessingMLPackage thisPackage = WordprocessingMLPackage.load(
        new java.io.File(resourceDir + "image-png1.docx"));
    WordprocessingMLPackage otherPackage = WordprocessingMLPackage.load(
        new java.io.File(resourceDir + "image-png2.docx"));
   
    Alterations alterations = AlteredParts.start(thisPackage, otherPackage);

    alterations.debug();
       
    assertTrue( alterations.getPartsAdded().size()==0 );
    assertTrue( alterations.getPartsModified().size()==2 );
    assertTrue( alterations.getPartsDeleted().size()==0 );
   
  }
View Full Code Here

    WordprocessingMLPackage thisPackage = WordprocessingMLPackage.load(
        new java.io.File(resourceDir + "images-jpg then png2.docx"));
    WordprocessingMLPackage otherPackage = WordprocessingMLPackage.load(
        new java.io.File(resourceDir + "image-png2.docx"));
   
    Alterations alterations = AlteredParts.start(thisPackage, otherPackage);

    alterations.debug();
       
    assertTrue( alterations.getPartsAdded().size()==2 );
    assertTrue( alterations.getPartsModified().size()==2 );
    assertTrue( alterations.getPartsDeleted().size()==1 );
   
  }
View Full Code Here

    WordprocessingMLPackage thisPackage = WordprocessingMLPackage.load(
        new java.io.File(resourceDir + "images-jpg then png2.docx"));
    WordprocessingMLPackage otherPackage = WordprocessingMLPackage.load(
        new java.io.File(resourceDir + "images-png2 then jpg.docx"));
   
    Alterations alterations = AlteredParts.start(thisPackage, otherPackage);

    alterations.debug();
       
    assertTrue( alterations.getPartsAdded().size()==2 );
    assertTrue( alterations.getPartsModified().size()==2 );
    assertTrue( alterations.getPartsDeleted().size()==2 );
   
  }
View Full Code Here

    WordprocessingMLPackage thisPackage = WordprocessingMLPackage.load(
        new java.io.File(resourceDir + "header-simple.docx"));
    WordprocessingMLPackage otherPackage = WordprocessingMLPackage.load(
        new java.io.File(resourceDir + "paragraph-single.docx"));
   
    Alterations alterations = AlteredParts.start(thisPackage, otherPackage);

    alterations.debug();
       
    assertTrue( alterations.getPartsAdded().size()==8 );
    assertTrue( alterations.getPartsModified().size()==3 );
    assertTrue( alterations.getPartsDeleted().size()==0 );
   
  }
View Full Code Here

    WordprocessingMLPackage thisPackage = WordprocessingMLPackage.load(
        new java.io.File(resourceDir + "header-section2.docx"));
    WordprocessingMLPackage otherPackage = WordprocessingMLPackage.load(
        new java.io.File(resourceDir + "header-simple.docx"));
   
    Alterations alterations = AlteredParts.start(thisPackage, otherPackage);

    alterations.debug();
       
    assertTrue( alterations.getPartsAdded().size()==0 ); // one of the existing header parts is re-purposed
    assertTrue( alterations.getPartsModified().size()==4 );
    assertTrue( alterations.getPartsDeleted().size()==4 );
   
  }
View Full Code Here

    WordprocessingMLPackage thisPackage = WordprocessingMLPackage.load(
        new java.io.File(resourceDir + "header-simple-plus-image.docx"));
    WordprocessingMLPackage otherPackage = WordprocessingMLPackage.load(
        new java.io.File(resourceDir + "header-simple.docx"));
   
    Alterations alterations = AlteredParts.start(thisPackage, otherPackage);

    alterations.debug();
       
    assertTrue( alterations.getPartsAdded().size()==1 );
//    assertTrue( alterations.getPartsModified().size()==2 ); // FIXME
    assertTrue( alterations.getPartsDeleted().size()==0 );
   
  }
View Full Code Here

TOP

Related Classes of org.docx4j.openpackaging.parts.relationships.AlteredParts.Alterations

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.