Examples of doValidate()


Examples of com.adobe.epubcheck.api.EpubCheck.doValidate()

        }

        epub.createArchive();
        report.setEpubFileName(epub.getEpubFile().getAbsolutePath());
        EpubCheck check = new EpubCheck(epub.getEpubFile(), report);
        int validationResult = check.doValidate();
        if (validationResult == 0)
        {
          outWriter.println(Messages.get("no_errors__or_warnings"));
          result = 0;
        }
View Full Code Here

Examples of com.adobe.epubcheck.api.EpubCheck.doValidate()

  @Test
  public void EpubCheck1_Test() throws Exception
  {
    File epub = getTestEpub();
    EpubCheck check = new EpubCheck(epub);
    Assert.assertEquals("The file should have generated errors.", 2, 2 & check.doValidate());
  }

  @Test
  public void EpubCheck_PrintWriter_Test() throws Exception
  {
View Full Code Here

Examples of com.adobe.epubcheck.api.EpubCheck.doValidate()

    File actualResults = new File(outputPath + "/PrintWriter_Actual.txt");
    File expectedResults = new File(outputPath + "/PrintWriter_Expected.txt");
    FileOutputStream outputStream = new FileOutputStream(actualResults);
    PrintWriter out = new PrintWriter(outputStream);
    EpubCheck check = new EpubCheck(epub, out);
    Assert.assertEquals("The file should have generated errors.", 2, 2 & check.doValidate());
    out.flush();
    outputStream.close();
    out.close();
    Assert.assertTrue("The resulting file doesn't exist.", actualResults.exists());
    Assert.assertTrue("The expected file doesn't exist.", expectedResults.exists());
View Full Code Here

Examples of com.adobe.epubcheck.api.EpubCheck.doValidate()

    PrintWriter out = new PrintWriter(outputStream);

    FileInputStream epubStream = new FileInputStream(epub);
    Report report = new WriterReportImpl(out, "Testing 123");
    EpubCheck check = new EpubCheck(epubStream, report, epub.getPath());
    Assert.assertEquals("The file should have generated errors.", 2, 2 & check.doValidate());
    out.flush();
    outputStream.close();
    out.close();
    epubStream.close();
    Assert.assertTrue("The resulting file doesn't exist.", actualResults.exists());
View Full Code Here

Examples of com.adobe.epubcheck.api.EpubCheck.doValidate()

    inputPath += "/blank.epub";
    ValidationReport report = new ValidationReport(inputPath);
    report.initialize();
    File inputEpub = new File(inputPath);
    EpubCheck check = new EpubCheck(inputEpub, report);
    Assert.assertEquals("The file should have generated warnings.", 6, check.doValidate());
    report.generate();
    List<MessageId> fatals = new ArrayList<MessageId>();
    fatals.add(MessageId.PKG_008);
    List<MessageId> errors = new ArrayList<MessageId>();
    errors.add(MessageId.PKG_003);
View Full Code Here

Examples of com.adobe.epubcheck.api.EpubCheck.doValidate()

    inputPath += "/wrong_extension.zip";
    CheckingReport report = new CheckingReport(inputPath, outputPath);
    report.initialize();
    File inputEpub = new File(inputPath);
    EpubCheck check = new EpubCheck(inputEpub, report);
    org.junit.Assert.assertEquals("The file should have generated warnings.", 1, check.doValidate());
    report.generate();
    File actualOutput = new File(outputPath);
    Assert.assertTrue("Output file is missing.", actualOutput.exists());
    File expectedOutput = new File(expectedOutputPath);
    Assert.assertTrue("Expected output file is missing.", expectedOutput.exists());
View Full Code Here

Examples of com.adobe.epubcheck.api.EpubCheck.doValidate()

    inputPath += "/no_existence.epub";
    CheckingReport report = new CheckingReport(inputPath, outputPath);
    report.initialize();
    File inputEpub = new File(inputPath);
    EpubCheck check = new EpubCheck(inputEpub, report);
    org.junit.Assert.assertEquals("The file should have generated warnings.", 2, check.doValidate());
    report.generate();
    File actualOutput = new File(outputPath);
    Assert.assertTrue("Output file is missing.", actualOutput.exists());
    File expectedOutput = new File(expectedOutputPath);
    Assert.assertTrue("Expected output file is missing.", expectedOutput.exists());
View Full Code Here

Examples of org.jboss.ws.core.HTTPMessageImpl.doValidate()

         if (Source.class.isAssignableFrom(type))
         {
            Source source = (Source)obj;
            reqMsg = new HTTPMessageImpl(source);
            if(validateDispatch)
               reqMsg.doValidate();
         }
         else if (jaxbContext != null)
         {
            Marshaller marshaller = jaxbContext.createMarshaller();
            marshaller.setProperty(Marshaller.JAXB_FRAGMENT, true);
View Full Code Here

Examples of org.jboss.ws.core.HTTPMessageImpl.doValidate()

         if (Source.class.isAssignableFrom(type))
         {
            Source source = (Source)obj;
            reqMsg = new HTTPMessageImpl(source);
            if(validateDispatch)
               reqMsg.doValidate();
         }
         else if (jaxbContext != null)
         {
            Marshaller marshaller = jaxbContext.createMarshaller();
            marshaller.setProperty(Marshaller.JAXB_FRAGMENT, true);
View Full Code Here

Examples of org.jboss.ws.core.HTTPMessageImpl.doValidate()

/*  66 */       if (Source.class.isAssignableFrom(this.type))
/*     */       {
/*  68 */         Source source = (Source)obj;
/*  69 */         reqMsg = new HTTPMessageImpl(source);
/*  70 */         if (this.validateDispatch)
/*  71 */           reqMsg.doValidate();
/*     */       }
/*  73 */       else if (this.jaxbContext != null)
/*     */       {
/*  75 */         Marshaller marshaller = this.jaxbContext.createMarshaller();
/*  76 */         marshaller.setProperty("jaxb.fragment", Boolean.valueOf(true));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.