update to JUnit 4.11

- fix build.xml -> parserTest error on Windows due to javac encoding
pull/1/head
reger 11 years ago
parent 3b77e41f1a
commit e94efd4d7c

@ -439,7 +439,7 @@
<target name="compileTest" depends="compile" description="run unittests"> <target name="compileTest" depends="compile" description="run unittests">
<javac srcdir="${test}" destdir="${test}" <javac srcdir="${test}" destdir="${test}"
debug="true" debuglevel="lines,vars,source" debug="true" debuglevel="lines,vars,source"
source="${javacSource}" target="${javacTarget}"> source="${javacSource}" target="${javacTarget}" encoding="UTF-8">
<classpath> <classpath>
<pathelement location="${build}"/> <pathelement location="${build}"/>
<pathelement location="${htroot}"/> <pathelement location="${htroot}"/>

Binary file not shown.

Binary file not shown.

Binary file not shown.

@ -291,7 +291,7 @@
<dependency> <dependency>
<groupId>junit</groupId> <groupId>junit</groupId>
<artifactId>junit</artifactId> <artifactId>junit</artifactId>
<version>4.7</version> <version>4.11</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>

@ -1,8 +1,5 @@
package net.yacy.document; package net.yacy.document;
import static org.junit.Assert.assertThat;
import static org.junit.matchers.JUnitMatchers.containsString;
import java.io.File; import java.io.File;
import java.io.FileInputStream; import java.io.FileInputStream;
import java.io.FileNotFoundException; import java.io.FileNotFoundException;
@ -16,7 +13,8 @@ import net.yacy.document.parser.docParser;
import net.yacy.document.parser.odtParser; import net.yacy.document.parser.odtParser;
import net.yacy.document.parser.ooxmlParser; import net.yacy.document.parser.ooxmlParser;
import net.yacy.document.parser.pdfParser; import net.yacy.document.parser.pdfParser;
import static org.hamcrest.CoreMatchers.containsString;
import static org.junit.Assert.assertThat;
import org.junit.Test; import org.junit.Test;
@ -88,7 +86,7 @@ public class ParserTest {
} catch (final InterruptedException ex) {} } catch (final InterruptedException ex) {}
} }
} }
@Test public void testpdfParsers() throws FileNotFoundException, Parser.Failure, MalformedURLException, UnsupportedEncodingException, IOException { @Test public void testpdfParsers() throws FileNotFoundException, Parser.Failure, MalformedURLException, UnsupportedEncodingException, IOException {
final String[][] testFiles = new String[][] { final String[][] testFiles = new String[][] {
// meaning: filename in test/parsertest, mimetype, title, creator, description, // meaning: filename in test/parsertest, mimetype, title, creator, description,
@ -110,7 +108,7 @@ public class ParserTest {
int c; int c;
while( (c = content.read()) != -1 ) while( (c = content.read()) != -1 )
str.append((char)c); str.append((char)c);
System.out.println("Parsed " + filename + ": " + str); System.out.println("Parsed " + filename + ": " + str);
assertThat(str.toString(), containsString("In München steht ein Hofbräuhaus, dort gibt es Bier in Maßkrügen")); assertThat(str.toString(), containsString("In München steht ein Hofbräuhaus, dort gibt es Bier in Maßkrügen"));
assertThat(doc.dc_title(), containsString(testFile[2])); assertThat(doc.dc_title(), containsString(testFile[2]));

@ -6,8 +6,6 @@ import java.io.FileNotFoundException;
import java.net.MalformedURLException; import java.net.MalformedURLException;
import java.nio.charset.Charset; import java.nio.charset.Charset;
import java.util.List; import java.util.List;
import static junit.framework.Assert.assertEquals;
import static junit.framework.Assert.assertTrue;
import junit.framework.TestCase; import junit.framework.TestCase;
import net.yacy.cora.document.id.AnchorURL; import net.yacy.cora.document.id.AnchorURL;
import net.yacy.document.Document; import net.yacy.document.Document;

Loading…
Cancel
Save