Skip to content
Snippets Groups Projects
Commit 257ed706 authored by tjc's avatar tjc
Browse files

test suite

git-svn-id: svn+ssh://svn.internal.sanger.ac.uk/repos/svn/pathsoft/artemis/trunk@9823 ee4ac58c-ac51-4696-9907-e4b3aa274f04
parent 134ebef1
No related branches found
No related tags found
No related merge requests found
<?xml version="1.0"?>
<!--
Ant build file for Artemis Test Suite
-->
<project default="test" basedir=".">
<target name="init">
<tstamp />
<property name="name" value="artemis test suite" />
<property name="version" value="live" />
<property name="build.compiler" value="modern" />
<property name="classpath" value="." />
<property name="src.tests.dir" value="." />
<property name="src.lib.dir" value="lib" />
<property name="build.dir" value="./ant-build" />
<!-- Subdirectories for tests source and classes -->
<property name="build.src.tests" value="${build.dir}/src/tests" />
<property name="build.dest.tests" value="${build.dir}/classes/tests" />
<!-- Compile classpath -->
<path id="compile.classpath">
<!-- Main classes from build -->
<pathelement path="${classpath}" />
<pathelement path="../ant-build/classes/main/" />
<pathelement path="${build.dest.tests}" />
<!-- Dependency classes -->
<fileset dir="${src.lib.dir}">
<include name="**/*.jar" />
</fileset>
</path>
</target>
<!-- Prepares the build directory -->
<target name="prepare" depends="init">
<mkdir dir="${build.dir}" />
</target>
<!-- Prepares the source code -->
<target name="prepare-core" depends="init,prepare">
<!-- Creates directories -->
<mkdir dir="${build.src.tests}" />
<mkdir dir="${build.dest.tests}" />
<!-- Copies src files -->
<copy todir="${build.src.tests}">
<fileset dir="${src.tests.dir}">
<exclude name="**/CVS/**" />
<exclude name="**/data/**" />
<exclude name="**/lib/**" />
</fileset>
</copy>
<!-- Copies jars -->
<copy todir="${build.dir}">
<fileset dir="${src.lib.dir}">
<include name="*.jar" />
</fileset>
</copy>
</target>
<!-- Compiles the source directory -->
<target name="compile" depends="init,prepare-core">
<javac
fork="true"
srcdir="${build.src.tests}"
destdir="${build.dest.tests}"
deprecation="false"
depend="no"
debug="true">
<classpath refid="compile.classpath"/>
</javac>
</target>
<target name="test" depends="compile">
<junit description="alltests" fork="yes">
<jvmarg value="-DEMBOSS_ROOT=/Users/tjc/EMBOSS/emboss/"/>
<batchtest todir="${build.dest.tests}">
<fileset dir="${build.src.tests}">
<include name="uk/ac/sanger/artemis/circular/digest/**Test.java"/>
</fileset>
</batchtest>
<formatter type="plain" usefile="false"/>
<classpath refid="compile.classpath"/>
</junit>
</target>
<!-- Cleans everything -->
<target name="clean" depends="init">
<delete dir="${build.dir}" />
</target>
</project>
########################################
# Program: restrict
# Rundate: Wed 18 Feb 2009 11:01:39
# Commandline: restrict
# [-sequence] /Users/tjc/foo.embl
# -auto
# -limit y
# -enzymes HincII,hinfI,ppiI,hindiii
# -outfile /private/tmp/circular_genome57650.txt
# Report_format: table
# Report_file: /private/tmp/circular_genome57650.txt
########################################
#=======================================
#
# Sequence: from: 1 to: 41243
# HitCount: 158
#
# Minimum cuts per enzyme: 1
# Maximum cuts per enzyme: 2000000000
# Minimum length of recognition site: 4
# Blunt ends allowed
# Sticky ends allowed
# DNA is linear
# Ambiguities allowed
#
#=======================================
Start End Strand Enzyme_name Restriction_site 5prime 3prime 5primerev 3primerev
81 86 + HindIII AAGCTT 81 85 . .
140 144 + HinfI GANTC 140 143 . .
40956 40960 + HinfI GANTC 40956 40959 . .
41036 41041 + HindII GTYRAC 41038 41038 . .
#---------------------------------------
#---------------------------------------
#---------------------------------------
# Total_sequences: 1
# Total_hitcount: 158
#---------------------------------------
File added
/*
* Copyright (C) 2009 Genome Research Limited
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* 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 General Public License for more details.
*
* You should have received a copy of the GNU 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 uk.ac.sanger.artemis.circular.digest;
import static org.junit.Assert.*;
import java.io.File;
import org.junit.Test;
public class CircularGenomeControllerTest
{
/**
* Test that EMBOSS_ROOT is set
*/
@Test
public void testEmbossRoot()
{
assertNotNull("EMBOSS_ROOT not set", System.getProperty("EMBOSS_ROOT"));
}
/**
* Test that restrict can be found
*/
@Test
public void testEmbossInstalled()
{
String restrictPath = System.getProperty("EMBOSS_ROOT") + "/bin/restrict";
File restrict = new File(restrictPath);
assertTrue("restrict not found at: " + restrictPath, restrict.exists());
}
}
\ No newline at end of file
/*
* Copyright (C) 2009 Genome Research Limited
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* 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 General Public License for more details.
*
* You should have received a copy of the GNU 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 uk.ac.sanger.artemis.circular.digest;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.BufferedReader;
import java.io.IOException;
import java.util.List;
import org.junit.Test;
import uk.ac.sanger.artemis.circular.digest.CutSite;
import uk.ac.sanger.artemis.circular.digest.EmbossTableParser;
public class EmbossTableParserTest
{
/**
* Test that restrict output is parsed
*/
@Test
public void testParser() throws IOException
{
final InputStream inputStream =
EmbossTableParserTest.class.getResourceAsStream("/data/foo.restrict");
InputStreamReader reader = new InputStreamReader(inputStream);
EmbossTableParser etp = new EmbossTableParser();
etp.parse(new BufferedReader(reader));
}
}
/*
* Copyright (C) 2009 Genome Research Limited
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* 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 General Public License for more details.
*
* You should have received a copy of the GNU 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 uk.ac.sanger.artemis.circular.digest;
import static org.junit.Assert.*;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.List;
import org.junit.Test;
import uk.ac.sanger.artemis.circular.digest.CutSite;
public class UtilsTest
{
/**
* Test that restrict output is parsed
*/
@Test
public void testFindCutSitesFromEmbossReport()
{
final InputStream inputStream =
UtilsTest.class.getResourceAsStream("/data/foo.restrict");
InputStreamReader reader = new InputStreamReader(inputStream);
ReportDetails report = Utils.findCutSitesFromEmbossReport(reader);
assertNotNull("ReportDetails null",report);
assertEquals("Sequence length",report.length, 41243);
List<CutSite> cutSites = report.cutSites;
CutSite firstCutSite = cutSites.get(0);
assertEquals("Number of cut sites", cutSites.size(), 4);
assertEquals("Enzyme name", firstCutSite.getEnzymeName(), "HindIII");
assertEquals("3prime", firstCutSite.getThreePrime(), 85);
assertEquals("5prime", firstCutSite.getFivePrime(), 81);
assertEquals("3prime-rev", firstCutSite.getThreePrimeRev(), 0);
assertEquals("5prime-rev", firstCutSite.getFivePrimeRev(), 0);
assertTrue("Cut site strand", firstCutSite.isForward());
}
}
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