From: <jen...@us...> - 2009-04-15 20:08:50
|
Revision: 1704 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1704&view=rev Author: jenslehmann Date: 2009-04-15 20:08:39 +0000 (Wed, 15 Apr 2009) Log Message: ----------- unit test changes Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/test/junit/ExampleTests.java Modified: trunk/src/dl-learner/org/dllearner/test/junit/ExampleTests.java =================================================================== --- trunk/src/dl-learner/org/dllearner/test/junit/ExampleTests.java 2009-04-15 13:33:41 UTC (rev 1703) +++ trunk/src/dl-learner/org/dllearner/test/junit/ExampleTests.java 2009-04-15 20:08:39 UTC (rev 1704) @@ -36,6 +36,7 @@ import org.apache.log4j.Level; import org.apache.log4j.Logger; import org.apache.log4j.SimpleLayout; +import org.dllearner.algorithms.gp.GP; import org.dllearner.cli.QuickStart; import org.dllearner.cli.Start; import org.dllearner.core.ComponentInitException; @@ -68,6 +69,9 @@ // it runs the examples in alphabetical order boolean randomize = true; + // GPs can be excluded temporarily (because those tests are very time-consuming) + boolean testGP = false; + // we use a logger, which outputs few messages (warnings, errors) SimpleLayout layout = new SimpleLayout(); ConsoleAppender consoleAppender = new ConsoleAppender(layout); @@ -124,15 +128,23 @@ //also working fine ignore.add("./examples/sparql/SilentBobWorking2.conf"); // Out of Memory Error // ignore.add("./examples/sparql/difference/DBPediaSKOS_kohl_vs_angela.conf"); // Pellet: literal cannot be cast to individual // ignore.add("./examples/family-benchmark/Aunt.conf"); // did not terminate so far (waited 45 minutes) => disallowing ALL helps (TODO find out details) - ignore.add("examples/krk/KRK_ZERO_against_1to5_fastInstance.conf"); // stack overflow - ignore.add("examples/krk/KRK_ONE_ZERO_fastInstance.conf"); // stack overflow +// ignore.add("examples/krk/KRK_ZERO_against_1to5_fastInstance.conf"); // stack overflow +// ignore.add("examples/krk/KRK_ONE_ZERO_fastInstance.conf"); // stack overflow ignore.add("examples/krk/"); // too many stack overflows + ignore.add("examples/sparql/Aristotle_local.conf"); // null pointer int failedCounter = 0; int counter = 1; int total = examples.size(); for(String conf : examples) { - if(ignore.contains(conf)) { + boolean ignored = false; + for(String ignoredConfExpression : ignore) { + if(conf.contains(ignoredConfExpression)) { + ignored = true; + break; + } + } + if(ignored) { System.out.println("Skipping " + conf + " (is on ignore list)."); } else { System.out.println("Testing " + conf + " (example " + counter + " of " + total + ", time: " + sdf.format(new Date()) + ")."); @@ -141,11 +153,13 @@ try { // start example Start start = new Start(new File(conf)); - start.start(false); - // test is successful if a concept was learned - assert (start.getLearningAlgorithm().getCurrentlyBestDescription() != null); - start.getReasonerComponent().releaseKB(); - success = true; + if(testGP || !(start.getLearningAlgorithm() instanceof GP)) { + start.start(false); + // test is successful if a concept was learned + assert (start.getLearningAlgorithm().getCurrentlyBestDescription() != null); + start.getReasonerComponent().releaseKB(); + success = true; + } } catch (Exception e) { // unit test not succesful (exceptions are caught explicitly to find assert ( false ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |