Package com.adobe.epubcheck.opf

Examples of com.adobe.epubcheck.opf.OPFData


    // Detect the version of the first root file
    // and compare with the asked version (if set)
    EPUBVersion detectedVersion = null;
    EPUBVersion validationVersion;
    OPFData opfData = ocf.getOpfData().get(opfPaths.get(0));
    if (opfData == null)
        return;// The error must have been reported during parsing
    detectedVersion = opfData.getVersion();
    report.info(null, FeatureEnum.FORMAT_VERSION, detectedVersion.toString());
    assert (detectedVersion != null);

    if (version != null && version != detectedVersion)
    {
View Full Code Here


  }

  public OPFData retrieveData(String fileName, List<MessageId> errors,
      List<MessageId> warnings, List<MessageId> fatalErrors, boolean verbose)
  {
    OPFData result = null;
    ValidationReport testReport = new ValidationReport(fileName,
        Messages.get("opv_version_test"));
    try
    {
      OPFPeeker peeker = new OPFPeeker(fileName, testReport, provider);
View Full Code Here

  }
 
  @Test
  public void testRetrieveType()
  {
    OPFData data = retrieveData("singleDCType.opf",expectedErrors,expectedWarnings);
    assertEquals(Sets.newHashSet("foo"), data.getTypes());
  }
View Full Code Here

  }
 
  @Test
  public void testRetrieveMultipleTypes()
  {
    OPFData data = retrieveData("multipleDCType.opf",expectedErrors,expectedWarnings);
    assertEquals(Sets.newHashSet("foo","bar"), data.getTypes());
  }
View Full Code Here

  }
 
  @Test
  public void testRetrieveOnlyTopLevelTypes()
  {
    OPFData data = retrieveData("collectionDCType.opf",expectedErrors,expectedWarnings);
    assertEquals(Sets.newHashSet("foo"), data.getTypes());
  }
View Full Code Here

  }
 
  @Test
  public void testRetrieveTypeWithWhiteSpace()
  {
    OPFData data = retrieveData("whitespaceInDCType.opf",expectedErrors,expectedWarnings);
    assertEquals(Sets.newHashSet("foo bar"), data.getTypes());
  }
View Full Code Here

  }
 
  @Test
  public void testRetrieveID()
  {
    OPFData data = retrieveData("uniqueId.opf",expectedErrors,expectedWarnings);
    assertEquals("foo", data.getUniqueIdentifier());
  }
View Full Code Here

  }
 
  @Test
  public void testEmptyID()
  {
    OPFData data = retrieveData("emptyId.opf",expectedErrors,expectedWarnings);
    assertEquals(null, data.getUniqueIdentifier());
  }
View Full Code Here

  }
 
  @Test
  public void tesMissingID()
  {
    OPFData data = retrieveData("missingId.opf",expectedErrors,expectedWarnings);
    assertEquals(null, data.getUniqueIdentifier());
  }
View Full Code Here

  }
 
  @Test
  public void testMultipleIDs()
  {
    OPFData data = retrieveData("multipleIds.opf",expectedErrors,expectedWarnings);
    assertEquals("foo", data.getUniqueIdentifier());
  }
View Full Code Here

TOP

Related Classes of com.adobe.epubcheck.opf.OPFData

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.