Package com.adobe.epubcheck.util

Examples of com.adobe.epubcheck.util.ValidationReport


  }

  @Test
  public void testLoremLink30()
  {
    ValidationReport testReport = testOcfPackage("/30/expanded/valid/lorem-link/",
        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 testLoremFallbacks30()
  {
    ValidationReport testReport = testOcfPackage("/30/expanded/valid/lorem-object-fallbacks/",
        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 testLoremPoster30()
  {
    ValidationReport testReport = testOcfPackage("/30/expanded/valid/lorem-poster/",
        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 testLoremSVG30()
  {
    ValidationReport testReport = testOcfPackage("/30/expanded/valid/lorem-svg/",
        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 testLoremHyperlink30()
  {
    ValidationReport testReport = testOcfPackage("/30/expanded/valid/lorem-svg-hyperlink/",
        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

  }

  public void testValidateDocument(String fileName, String mimeType,
          List<MessageId> errors, List<MessageId> warnings, List<MessageId> fatalErrors, EPUBVersion version, boolean verbose, ExtraReportTest extraTest)
  {
    ValidationReport testReport = new ValidationReport(fileName, String.format(Messages.get("single_file"), mimeType, version));
    String basepath = null;
    if (version == EPUBVersion.VERSION_2)
    {
      basepath = "/20/single/";
    }
    else if (version == EPUBVersion.VERSION_3)
    {
      basepath = "/30/single/";
    }

    GenericResourceProvider resourceProvider = null;
    if (fileName.startsWith("http://") || fileName.startsWith("https://"))
    {
      resourceProvider = new URLResourceProvider(fileName);
    }
    else
    {
      URL fileURL = this.getClass().getResource(basepath + fileName);
      String filePath = fileURL != null ? fileURL.getPath() : basepath + fileName;
      resourceProvider = new FileResourceProvider(filePath);
    }

    OPSChecker opsChecker = new OPSChecker(basepath + fileName, mimeType,
        resourceProvider, testReport, version);

    opsChecker.validate();

    if (verbose)
    {
      outWriter.println(testReport);
    }

    assertEquals("The error results do not match", errors, testReport.getErrorIds());
    assertEquals("The warning results do not match", warnings, testReport.getWarningIds());
    assertEquals("The fatal error results do not match", fatalErrors, testReport.getFatalErrorIds());
    if (extraTest != null)
    {
      extraTest.test(testReport);
    }
  }
View Full Code Here

  }

  @Test
  public void testLoremWasteland30()
  {
    ValidationReport testReport = testOcfPackage("/30/expanded/valid/wasteland-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 testLoremMultipleRenditions20()
  {
    ValidationReport testReport = testOcfPackage("/20/expanded/valid/lorem-xrenditions-2ops/",
        EPUBVersion.VERSION_2);
    if (1 != testReport.getErrorCount()
        || 0 != testReport.getWarningCount())
    {
      outWriter.println(testReport);
    }
    List<MessageId> errors = new ArrayList<MessageId>();
    Collections.addAll(errors, MessageId.PKG_013);
    assertEquals(errors, testReport.getErrorIds());
    assertEquals(0, testReport.getWarningCount());

  }
View Full Code Here

  }

  @Test
  public void testLoremMultipleRenditionsSingleOPF20()
  {
    ValidationReport testReport = testOcfPackage("/20/expanded/valid/lorem-xrenditions-1ops/",
        EPUBVersion.VERSION_2);
    if (0 != testReport.getErrorCount()
        || 0 != testReport.getWarningCount())
    {
      outWriter.println(testReport);
    }
    assertEquals(0, testReport.getErrorCount());
    assertEquals(0, testReport.getWarningCount());

  }
View Full Code Here

  }

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

    assertTrue(testReport.hasInfoMessage("[EPUB renditions count] 2"));
  }
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.