Package com.adobe.epubcheck.util

Examples of com.adobe.epubcheck.util.ValidationReport


  private ValidationReport testOcfPackage(String fileName, EPUBVersion version)
  {
    OCFPackage ocf = new OCFMockPackage(fileName);

    ValidationReport testReport = new ValidationReport(fileName, String.format(
        "Package is being checked as ePub version %s", version == null ? "null" : version.toString()));

    OCFChecker checker = new OCFChecker(ocf, testReport, version);

    checker.runChecks();
View Full Code Here


   * provider is working.
   */
  @Test
  public void invalidPath()
  {
    ValidationReport testReport = testOcfPackage("/non-existent/", EPUBVersion.VERSION_2);
    assertEquals(1, testReport.getFatalErrorCount());
  }
View Full Code Here

  }

  @Test
  public void testLoremBasic20()
  {
    ValidationReport testReport = testOcfPackage("/20/expanded/valid/lorem/lorem-basic/",
        EPUBVersion.VERSION_2);
    if (0 != testReport.getErrorCount()
        || 0 != testReport.getWarningCount())
    {
      outWriter.println(testReport);
    }
    assertEquals(0, testReport.getErrorCount());
    assertEquals(0, testReport.getWarningCount());
    assertTrue(testReport.hasInfoMessage("[format version] 2.0"));
    assertTrue(testReport.hasInfoMessage("[unique identifier] urn:uuid:550e8400-e29b-41d4-a716-4466674412314"));
  }
View Full Code Here

  }

  @Test
  public void testLoremBasic30()
  {
    ValidationReport testReport = testOcfPackage("/30/expanded/valid/lorem-basic/",
        EPUBVersion.VERSION_3);
    if (0 != testReport.getErrorCount()
        || 0 != testReport.getWarningCount())
    {
      outWriter.println(testReport);
    }
    assertEquals(0, testReport.getErrorCount());
    assertEquals(0, testReport.getWarningCount());

    assertTrue(testReport.hasInfoMessage("[format version] 3.0"));
  }
View Full Code Here

  }

  @Test
  public void testLoremBasic30Against20()
  {
    ValidationReport testReport = testOcfPackage("/30/expanded/valid/lorem-basic/",
        EPUBVersion.VERSION_2);
    if (0 == testReport.getErrorCount()
        || 1 != testReport.getWarningCount())
    {
      outWriter.println(testReport);
    }
    assertTrue(testReport.getErrorCount() > 0);
    List<MessageId> warnings = new ArrayList<MessageId>();
    Collections.addAll(warnings, MessageId.PKG_001);
    assertEquals(warnings, testReport.getWarningIds());

    assertTrue(testReport.hasInfoMessage("[format version] 3.0"));
    assertTrue(testReport.hasInfoMessage("[unique identifier] urn:uuid:550e8400-e29b-41d4-a716-4466674412314"));
  }
View Full Code Here

  }

  @Test
  public void testLoremBasic20Against30()
  {
    ValidationReport testReport = testOcfPackage("/20/expanded/valid/lorem/lorem-basic/",
        EPUBVersion.VERSION_3);
    if (0 == testReport.getErrorCount()
        || 1 != testReport.getWarningCount())
    {
      outWriter.println(testReport);
    }
    assertTrue(testReport.getErrorCount() > 0);
    List<MessageId> warnings = new ArrayList<MessageId>();
    Collections.addAll(warnings, MessageId.PKG_001);
    assertEquals(warnings, testReport.getWarningIds());

    assertTrue(testReport.hasInfoMessage("[format version] 2.0"));
    assertTrue(testReport.hasInfoMessage("[unique identifier] urn:uuid:550e8400-e29b-41d4-a716-4466674412314"));
  }
View Full Code Here

  }

  @Test
  public void testLoremBasic30Switch()
  {
    ValidationReport testReport = testOcfPackage("/30/expanded/valid/lorem-basic-switch/",
        EPUBVersion.VERSION_3);
    if (0 != testReport.getErrorCount()
        || 0 != testReport.getWarningCount()
        )
    {
      outWriter.println(testReport);
    }
    assertEquals(0, testReport.getErrorCount());
    assertEquals(0, testReport.getWarningCount());

    assertTrue(testReport.hasInfoMessage("[format version] 3.0"));
  }
View Full Code Here

  }

  @Test
  public void testLoremAudio30()
  {
    ValidationReport testReport = testOcfPackage("/30/expanded/valid/lorem-audio/",
        EPUBVersion.VERSION_3);
    if (0 != testReport.getErrorCount()
        || 0 != testReport.getWarningCount()
        )
    {
      outWriter.println(testReport);
    }
    assertEquals(0, testReport.getErrorCount());
    assertEquals(0, testReport.getWarningCount());
    assertTrue(testReport.hasInfoMessage("[format version] 3.0"));
  }
View Full Code Here

  }

  @Test
  public void testLoremBindings30()
  {
    ValidationReport testReport = testOcfPackage("/30/expanded/valid/lorem-bindings/",
        EPUBVersion.VERSION_3);
    if (0 != testReport.getErrorCount()
        || 0 != testReport.getWarningCount()
        )
    {
      outWriter.println(testReport);
    }
    assertEquals(0, testReport.getErrorCount());
    assertEquals(0, testReport.getWarningCount());

    assertTrue(testReport.hasInfoMessage("[format version] 3.0"));
  }
View Full Code Here

  }

  @Test
  public void testLoremForeign30()
  {
    ValidationReport testReport = testOcfPackage("/30/expanded/valid/lorem-foreign/",
        EPUBVersion.VERSION_3);
    if (0 != testReport.getErrorCount()
        || 0 != testReport.getWarningCount()
        )
    {
      outWriter.println(testReport);
    }
    assertEquals(0, testReport.getErrorCount());
    assertEquals(0, testReport.getWarningCount());

    assertTrue(testReport.hasInfoMessage("[format version] 3.0"));
  }
View Full Code Here

TOP

Related Classes of com.adobe.epubcheck.util.ValidationReport

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.