package org.dstricks;


import static org.junit.Assert.*;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;

import org.junit.Test;


public class TesseractTest {

	@Test
	public void digitsTest() throws Exception {
		String expected = "0123456789";
		String actual = Tesseract.process("src/test/resources/digits.jpg").trim();
		assertEquals("digits.jpg was not read properly",  expected, actual);
	}
	
	@Test
	public void asciiSentenceTest() throws Exception {
		String expected = "Happy New Year 2003!";
		String actual = Tesseract.process("src/test/resources/asciiSentence.png").trim();
		assertEquals("digits.jpg was not read properly",  expected, actual);
	}
	
	@Test
	public void digitsInputStreamTest() throws IOException, InterruptedException {
		String expected = "0123456789";
		FileInputStream fis = new FileInputStream(new File("src/test/resources/digits.jpg"));
		String actual = Tesseract.process(fis).trim();
		assertEquals("digits.jpg was not read properly",  expected, actual);
	}
	
	@Test
	public void noTextImageTest() throws IOException, InterruptedException {
		String expected = "";
		String actual = Tesseract.process("src/test/resources/testJPEG.jpg").trim();
		
		assertEquals("testJPEG.jpg was not read properly",  expected, actual);
	}

}

@@ -661,38 +661,310 @@
 %09%09assertEquals(%22
-digits
+asciiSentence.png was not read properly%22,  expected, actual);%0A%09%7D%0A%09%0A%09@Test%0A%09public void noTextImageTest() throws IOException, InterruptedException %7B%0A%09%09String expected = %22%22;%0A%09%09String actual = Tesseract.process(%22src/test/resources/testJPEG.jpg%22).trim();%0A%09%09%0A%09%09assertEquals(%22testJPEG
 .jpg was not rea
@@ -1351,35 +1351,47 @@
 public void 
-noTextImage
+digitsInputStreamNoText
 Test() throw
@@ -1458,75 +1458,135 @@
 ;%0A%09%09
-String actual = Tesseract.process(%22src/test/resources/testJPEG.jpg%22
+FileInputStream fis = new FileInputStream(new File(%22src/test/resources/testJPEG.jpg%22));%0A%09%09String actual = Tesseract.process(fis
 ).tr
@@ -1583,35 +1583,32 @@
 ss(fis).trim();%0A
-%09%09%0A
 %09%09assertEquals(%22

Update tests