Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 8d5ff142 authored by Jérôme Euzenat's avatar Jérôme Euzenat
Browse files

- introduced unit tests

parent 8c540160
No related branches found
No related tags found
No related merge requests found
......@@ -2,7 +2,7 @@
<!-- $Id$ -->
<project name="align" default="compile" basedir=".">
<!-- tested -->
<target name="usage" depends="init">
<echo message="ant _target_ _options_"/>
......@@ -50,6 +50,9 @@
</fileset>
</path>
<taskdef name="testng" classpathref="classpath"
classname="org.testng.TestNGAntTask" />
</target>
<!-- tested -->
......@@ -68,7 +71,8 @@
<delete>
<fileset dir="classes" includes="**/*.class"/>
</delete>
<antcall target="compile"/>
<antcall target="cleanjar"/>
<antcall target="jar"/>
<ant dir="plugins/neon" target="compileall" />
</target>
......@@ -139,6 +143,15 @@
</jar>
</target>
<!-- tested -->
<target name="cleanjar" depends="init">
<echo message="Erasing..."/>
<delete file="lib/align.jar"/>
<delete file="lib/alignsvc.jar"/>
<delete file="lib/alignwn.jar"/>
<delete file="lib/procalign.jar"/>
</target>
<!-- tested -->
<target name="aserv" depends="init">
<echo message="Setting property..."/>
......@@ -155,33 +168,32 @@
</jar>
</target>
<!-- not tested -->
<!-- tested -->
<target name="test" depends="init">
<echo message="Testing..."/>
<!-- <javac srcdir="test/fr/fluxmedia/transmorpher/graph/rules"
debug="on" destdir="classes">
<classpath refid="classpath"/>
</javac> -->
<javac srcdir="test/fr/fluxmedia/" debug="on" destdir="classes">
<javac srcdir="test/src" destdir="test/classes" debug="on">
<classpath refid="classpath"/>
</javac>
<antcall target="jar"/>
<junit printsummary="yes" fork="yes" haltonfailure="no">
<batchtest todir="test/reports/xml/">
<fileset dir="classes/">
<include name="**/*Test.class"/>
<exclude name="**/Test.class"/>
</fileset>
<formatter type="xml"/>
</batchtest>
<classpath refid="classpath"/>
</junit>
<junitreport todir="test/reports">
<fileset dir="test/reports/xml/">
<include name="TEST-*.xml"/>
</fileset>
<report todir="test/reports/html/"/>
</junitreport>
<testng
sourcedir="test/src"
outputDir="test/html"
haltOnFailure="true" verbose="1">
<classpath>
<path refid="classpath"/>
<pathelement location="test/classes"/>
</classpath>
<!--xmlfileset dir="${test14.dir}" includes="testng.xml"/-->
<classfileset dir="test" includes="classes/**/*.class"/>
</testng>
</target>
<!-- tested -->
<target name="cleantest" depends="init">
<echo message="Cleaning tests..."/>
<delete>
<fileset dir="test/classes" includes="**/*.class"/>
<fileset dir="test/html" includes="**/*.html"/>
</delete>
</target>
<!-- tested -->
......@@ -234,6 +246,8 @@
<!--antcall target="commit"/-->
<antcall target="compileall"/>
<antcall target="jar"/>
<antcall target="test"/>
<antcall targer="cleantests"/>
<antcall target="javadoc"/>
<ant dir="plugins/neon" target="jar">
<property name="version" value="${version}"/>
......
File added
/*
* $Id$
*
* Copyright (C) INRIA Rhône-Alpes, 2008
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
//package test.com.acme.dona.dep;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertNotNull;
import static org.testng.Assert.assertNull;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Configuration;
import org.testng.annotations.Test;
//import org.testng.annotations.*;
import fr.inrialpes.exmo.align.impl.OWLAPIAlignment;
public class BasicAlignmentTest {
private OWLAPIAlignment alignment = null;
@BeforeClass(groups = { "fast" })
private void init(){
alignment = new OWLAPIAlignment();
}
@Test(groups = { "fast" })
public void aFastTest() {
assertNotNull( alignment, "Alignment was null" );
}
}
/*
* $Id$
*
* Copyright (C) INRIA Rhne-Alpes, 2008
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
//package test.com.acme.dona.dep;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertNotNull;
import static org.testng.Assert.assertNull;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Configuration;
import org.testng.annotations.Test;
//import org.testng.annotations.*;
import fr.inrialpes.exmo.align.impl.OWLAPIAlignment;
import fr.inrialpes.exmo.align.impl.URIAlignment;
import fr.inrialpes.exmo.align.onto.OntologyCache;
import fr.inrialpes.exmo.align.parser.AlignmentParser;
public class OWLAPIAlignmentTest {
private OWLAPIAlignment alignment = null;
@BeforeClass(groups = { "fast" })
private void init(){
alignment = new OWLAPIAlignment();
}
@Test(groups = { "fast" })
public void aFastTest() {
//System.out.println("Fast test");
assertNotNull( alignment, "Alignment was null" );
}
@Test(groups = { "full" })
public void loadingAndConvertingTest() throws Exception {
//System.out.println("Fast test");
assertNotNull( alignment, "Alignment was null" );
AlignmentParser aparser = new AlignmentParser( 0 );
assertNotNull( aparser, "AlignmentParser was null" );
URIAlignment result = (URIAlignment)aparser.parse( "file:examples/rdf/newsample.rdf" );
assertNotNull( result, "URIAlignment(result) was null" );
alignment = OWLAPIAlignment.toOWLAPIAlignment( result, (OntologyCache)null );
assertNotNull( alignment, "toOWLAPIAlignment(result) was null" );
assertEquals( alignment.getLevel(), "0" );
assertEquals( alignment.getType(), "**" );
assertEquals( alignment.nbCells(), 2 );
}
}
/*
* $Id$
*
* Copyright (C) INRIA Rhne-Alpes, 2008
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
//package test.com.acme.dona.dep;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertNotNull;
import static org.testng.Assert.assertNull;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Configuration;
import org.testng.annotations.Test;
//import org.testng.annotations.*;
import org.semanticweb.owl.align.AlignmentProcess;
import org.semanticweb.owl.align.Parameters;
import fr.inrialpes.exmo.align.impl.method.StringDistAlignment;
import fr.inrialpes.exmo.align.impl.BasicParameters;
import fr.inrialpes.exmo.align.impl.URIAlignment;
import fr.inrialpes.exmo.align.onto.OntologyCache;
import fr.inrialpes.exmo.align.parser.AlignmentParser;
public class READMETest {
private AlignmentProcess alignment = null;
@Test(groups = { "full", "routine" })
public void routineTest1() {
/*
$ java -jar lib/procalign.jar --help
*/
}
@Test(groups = { "full", "routine" })
public void routineTest2() {
alignment = new StringDistAlignment();
assertEquals( alignment.nbCells(), 0 );
assertNotNull( alignment, "ObjectAlignment should not be null" );
//alignment.init( , );
//alignment.align( (Alignment)null, );
assertEquals( alignment.nbCells(), 0 );
/*
$ java -jar lib/procalign.jar file://$CWD/examples/rdf/onto1.owl file://$CWD/examples/rdf/onto2.owl
*/
}
@Test(groups = { "full", "routine" })
public void routineTest3() {
/*
$ java -jar lib/procalign.jar file://$CWD/examples/rdf/onto1.owl file://$CWD/examples/rdf/onto2.owl -i fr.inrialpes.exmo.align.impl.method.StringDistAlignment -DstringFunction=levenshteinDistance -r fr.inrialpes.exmo.align.impl.renderer.OWLAxiomsRendererVisitor
*/
}
@Test(groups = { "full", "routine" })
public void routineTest4() {
/*
$ java -jar lib/procalign.jar file://$CWD/examples/rdf/onto1.owl file://$CWD/examples/rdf/onto2.owl -i fr.inrialpes.exmo.align.impl.method.StringDistAlignment -DstringFunction=levenshteinDistance -t 0.4 -o examples/rdf/sample.rdf
*/
}
@Test(groups = { "full", "routine" })
public void routineTest5() {
/*
$ java -cp lib/procalign.jar fr.inrialpes.exmo.align.util.ParserPrinter examples/rdf/newsample.rdf
*/
}
@Test(groups = { "full", "routine" })
public void routineTest6() {
/*
$ java -jar lib/procalign.jar file://$CWD/examples/rdf/onto1.owl file://$CWD/examples/rdf/onto2.owl -a examples/rdf/sample.rdf
*/
}
@Test(groups = { "full", "routine" })
public void routineTest7() {
/*
$ java -jar lib/Procalign.jar file://$CWD/examples/rdf/edu.umbc.ebiquity.publication.owl file://$CWD/examples/rdf/edu.mit.visus.bibtex.owl
*/
}
@Test(groups = { "full", "routine" })
public void routineTest8() {
/*
$ java -jar lib/Procalign.jar file://$CWD/examples/rdf/edu.umbc.ebiquity.publication.owl file://$CWD/examples/rdf/edu.mit.visus.bibtex.owl -i fr.inrialpes.exmo.align.impl.method.StringDistAlignment -DstringFunction=levenshteinDistance -o examples/rdf/bibref.rdf
*/
}
@Test(groups = { "full", "routine" })
public void routineTest9() {
/*
$ java -jar lib/Procalign.jar file://$CWD/examples/rdf/edu.umbc.ebiquity.publication.owl file://$CWD/examples/rdf/edu.mit.visus.bibtex.owl -i fr.inrialpes.exmo.align.impl.method.StringDistAlignment -DstringFunction=subStringDistance -t .4 -o examples/rdf/bibref2.rdf
*/
}
@Test(groups = { "full", "routine" })
public void routineEvalTest() {
/*
$ java -cp lib/procalign.jar fr.inrialpes.exmo.align.util.EvalAlign -i fr.inrialpes.exmo.align.impl.eval.PRecEvaluator file://$CWD/examples/rdf/bibref2.rdf file://$CWD/examples/rdf/bibref.rdf
*/
}
@Test(groups = { "full", "routine" })
public void routineMatrixTest() {
/*
$ java -jar lib/Procalign.jar file://$CWD/examples/rdf/edu.umbc.ebiquity.publication.owl file://$CWD/examples/rdf/edu.mit.visus.bibtex.owl -i fr.inrialpes.exmo.align.impl.method.StringDistAlignment -DstringFunction=levenshteinDistance -DprintMatrix=1 -o /dev/null > examples/rdf/matrix.tex
*/
}
@Test(groups = { "full", "routine" })
public void routineJWNLTest() {
/* For JWNL Readme
$ setenv WNDIR ../WordNet-2.0/dict
$ java -jar lib/alignwn.jar -Dwndict=$WNDIR file://$CWD/examples/rdf/edu.umbc.ebiquity.publication.owl file://$CWD/examples/rdf/edu.mit.visus.bibtex.owl -i fr.inrialpes.exmo.align.ling.JWNLAlignment -o examples/rdf/JWNL.rdf
*/
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment