Skip to content

Commit

Permalink
Added documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
kalaspuffar committed Nov 30, 2018
1 parent d9bb13b commit 43eb39b
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/test/java/org/w3/epubcheck/api/ApiConstructorsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@
*/
public class ApiConstructorsTest
{

/**
* Checking if the standard API constructor can take an epub and validate it.
*
* @throws Exception
*/
@Test
public void StandardConstructorTest() throws Exception
{
Expand All @@ -27,6 +33,12 @@ public void StandardConstructorTest() throws Exception
Assert.assertEquals("The file should have no errors.", 0, check.doValidate());
}

/**
* Checking if we can apply a PrintWriter to the constructor and get the expected output written
* to the supplied PrintWriter.
*
* @throws Exception
*/
@Test
public void PrintWriterConstructorTest() throws Exception
{
Expand All @@ -51,6 +63,12 @@ public void PrintWriterConstructorTest() throws Exception
}
}

/**
* Checking if we can stream a epub to the constructor and use a Report object to
* summarize the output.
*
* @throws Exception
*/
@Test
public void InputStreamConstructorTest() throws Exception
{
Expand All @@ -71,6 +89,7 @@ public void InputStreamConstructorTest() throws Exception
outputStream.close();
out.close();
epubStream.close();
Assert.assertEquals("Errors reported", 0, report.getErrorCount());
Assert.assertTrue("The resulting file doesn't exist.", actualResults.exists());
Assert.assertTrue("The expected file doesn't exist.", expectedResults.exists());
common.compareText(expectedResults, actualResults);
Expand Down

0 comments on commit 43eb39b

Please sign in to comment.