Change structure of CFMerge branch 'servlets' of https://source.jalview.org/git/prote...
authorNatasha Sherstneva <n.shertneva@gmail.com>
Thu, 21 Nov 2013 09:35:40 +0000 (09:35 +0000)
committerNatasha Sherstneva <n.shertneva@gmail.com>
Thu, 21 Nov 2013 09:35:40 +0000 (09:35 +0000)
12 files changed:
.classpath
.gitignore
build.xml
datadb/compbio/cassandra/CassandraWriter.java
datadb/compbio/cassandra/FastaReader.java [deleted file]
datadb/compbio/cassandra/FastaSequence.java [deleted file]
datadb/compbio/cassandra/JpredParserHTTP.java
datadb/compbio/cassandra/JpredParserLocalFile.java
engine/compbio/engine/JpredJob.java
lib/servlet-api.jar [new file with mode: 0644]
testsrc/lib/testng-5.10-jdk15.jar [deleted file]
testsrc/lib/testng-6.8.jar [new file with mode: 0644]

index e01f61b..38a76ef 100644 (file)
@@ -4,7 +4,6 @@
        <classpathentry kind="src" path="engine"/>
        <classpathentry kind="src" path="server"/>
        <classpathentry excluding="testdata/" kind="src" path="testsrc"/>
-       <classpathentry kind="lib" path="testsrc/lib/testng-5.10-jdk15.jar"/>
        <classpathentry kind="lib" path="WEB-INF/lib/log4j-1.2.16.jar"/>
        <classpathentry kind="lib" path="WEB-INF/lib/cassandra-driver-core-2.0.0-beta3-SNAPSHOT.jar" sourcepath="WEB-INF/lib/cassandra-driver-core-2.0.0-beta3-SNAPSHOT-sources.jar"/>
        <classpathentry kind="lib" path="WEB-INF/lib/lz4-1.2.0.jar"/>
        <classpathentry kind="lib" path="WEB-INF/lib/displaytag-1.2.jar"/>
        <classpathentry kind="lib" path="WEB-INF/lib/jabaws-core-2.1.0.jar" sourcepath="WEB-INF/lib/jabaws-core-src-2.1.0.jar"/>
        <classpathentry kind="lib" path="WEB-INF/lib/jstl-1.2.jar"/>
+       <classpathentry kind="lib" path="WEB-INF/lib/jcommon-1.0.20.jar"/>
+       <classpathentry kind="lib" path="WEB-INF/lib/jfreechart-1.0.16.jar"/>
+       <classpathentry kind="lib" path="testsrc/lib/testng-6.8.jar"/>
        <classpathentry kind="con" path="org.eclipse.jst.server.core.container/org.eclipse.jst.server.tomcat.runtimeTarget/Apache Tomcat v7.0">
                <attributes>
                        <attribute name="owner.project.facets" value="jst.web"/>
                </attributes>
        </classpathentry>
        <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jdk1.7.0_45"/>
-       <classpathentry kind="lib" path="/home/natasha/workspace/proteocache/jfreechart-1.0.16/lib/jfreechart-1.0.16.jar"/>
-       <classpathentry kind="lib" path="/home/natasha/workspace/proteocache/jfreechart-1.0.16/lib/jcommon-1.0.20.jar"/>
        <classpathentry kind="output" path="WEB-INF/classes"/>
 </classpath>
index 01f344e..26664ec 100644 (file)
@@ -2,5 +2,5 @@
 /testsrc/testdata/*.written
 /testsrc/testdata/alirna.ps
 /WEB-INF/classes/
-
+/distribution/
 
index 50bdbac..e913296 100644 (file)
--- a/build.xml
+++ b/build.xml
@@ -1,94 +1,52 @@
 <?xml version="1.0" encoding="UTF-8"?>
 
-<project default="proteocache" name="Build ProteoCache - Results repository for the Dundee Resource" basedir=".">
-
-       <property name="LD_LIBRARY_PATH" value="/gridware/sge/lib/lx24-amd64"/>
-
-       <!-- Distributive file names-->
-       <property name="distdir" value="distro"/>
-       <mkdir dir="${distdir}" />
+<project default="proteocache" name="Build ProteoCache - Caching framework for the Dundee Resource" basedir=".">
 
        <!-- projects details -->
+       <property name="proteocache_version" value="0.1.0"/>
        <property name="project.url" value="http://www.compbio.dundee.ac.uk/proteocache"/>
        <property name="product" value="ProteoCache"/>
        <property name="author" value="Alexander Sherstnev"/>
-
-       <!-- dependencies on other compbio projects  -->
-       <property name="compbio-annotation" value="compbio-annotations-1.0.jar"/>
-       <property name="compbio-util" value="compbio-util-1.4.jar"/>
-       <property name="compbio-ga" value="compbio-ga-1.0.jar"/>
-
+       <!-- Distributive file names-->
+       <property name="distdir" value="distribution"/>
+       <mkdir dir="${distdir}" />
        <!-- products -->
-       <property name="proteocache_version" value="2.1.0"/>
-       <property name="datamodel" value="${distdir}/datamodel-${proteocache_version}.jar"/>
-       <property name="datamodel-src" value="${distdir}/datamodel-src-${proteocache_version}.jar"/>
-       <property name="min-proteocache-client" value="${distdir}/min-proteocache-client-${proteocache_version}.jar"/>
-       <property name="min-proteocache-client-nolog" value="${distdir}/min-proteocache-client-nolog-${proteocache_version}.jar"/>
-       <property name="proteocache-client-src" value="${distdir}/proteocache-client-src-${proteocache_version}.jar"/>
-       <property name="aacon-ws-client" value="${distdir}/aacon-ws-client.jar"/>
-       <property name="full-proteocache-client" value="${distdir}/full-proteocache-client-${proteocache_version}.jar"/>
+       <property name="proteocache-war" value="${distdir}/proteocache-${proteocache_version}.war"/>
+       <property name="proteocache-jar" value="${distdir}/proteocache-${proteocache_version}.jar"/>
        <property name="proteocache-source-jar" value="${distdir}/proteocache-src-${proteocache_version}.jar"/>
-       <property name="full-proteocache-client-pack" value="${distdir}/full-proteocache-client-${proteocache_version}-pack.zip"/>
-       <property name="proteocache" value="${distdir}/proteocache.war"/>
-       <!-- TODO 
-       <property name="proteocache-dundee" value="${distdir}/proteocache-dundee.war"/>
-       -->
-       <property name="proteocache-no-binaries" value="${distdir}/proteocache-no-binaries.war"/>
-       <property name="binaries" value="${distdir}/binaries.zip"/>
-       <property name="proteocache-devel-web" value="${distdir}/proteocache-devel-website.zip"/>
-
-       <!--Whole project archive -->
        <property name="proteocache-project" value="${distdir}/proteocache-project.zip"/>
-
        <!-- java -->
-       <property name="test.src" location="${basedir}/testsrc" />
        <property name="classes" location="${basedir}/WEB-INF/classes" />
-       <property name="lib.path" location="${basedir}/lib" />
+       <property name="ext.lib.path" location="${basedir}/lib" />
        <property name="web.lib.path" location="${basedir}/WEB-INF/lib" />
-       <property name="test.lib.path" location="${basedir}/testsrc/lib" />
-       <property name="activity.log" location="${basedir}/activity.log" />
 
-       <!-- add libraries -->
+       <!-- add external and internal libraries -->
        <path id="project.classpath">
-               <fileset dir="${lib.path}">
-                       <include name="*.jar" />
-               </fileset>
                <fileset dir="${web.lib.path}">
                        <include name="*.jar" />
                </fileset>
-       </path>
-
-       <!-- add test classes -->
-       <path id="test.classpath">
-               <fileset dir="${test.lib.path}">
+               <fileset dir="${ext.lib.path}">
                        <include name="*.jar" />
                </fileset>
-               <pathelement location="${classes}" />
        </path>
 
-       <fileset dir="${basedir}/WEB-INF/classes/" id="fullclient">
-               <!-- Datamodel -->
-               <include name="compbio/data/**"/>
-               <include name="compbio/metadata/**"/>
-               <!-- Engine -->
+       <fileset dir="${basedir}/WEB-INF/classes/" id="allcodes">
+               <include name="compbio/datadb/**"/>
                <include name="compbio/engine/**"/>
-               <!-- Casscode -->
-               <include name="compbio/casscode/**"/>
-               <!-- Logging configuration -->
+               <include name="compbio/server/**"/>
        </fileset>
 
+<!-- ###################################################################################################################################### -->
+<!-- Main targets -->
+
        <!-- Clean temp directories -->
        <target name="clean">
                <delete dir="${classes}" />
-               <delete dir="${basedir}/logs" />
-               <delete file="${distdir}/binaries.zip" />
-               <delete file="${basedir}/activity.log" />
-               <delete file="${basedir}/derby.log" />
                <mkdir dir="${classes}" />
                <copy file="${basedir}/log/log4j.properties" tofile="${classes}/log4j.properties" />
        </target>
 
-       <!-- Clean up temp directories and dist directory (all jar, zip, and war files deleted) -->
+       <!-- Clean up temporary directories and dist directory (all jar, zip, and war files deleted) -->
        <target name="full-clean" depends="clean">
                <delete>
                        <fileset dir="${distdir}">
                </delete>
        </target>
 
-       <target name="clearStatDB" description="Remove all records from statistics database">
-               <echo>Cleaning Statistics database</echo>
-               <java classname="compbio.stat.collector.StatDB" fork="true" failonerror="true" classpath="${classes}">
-                       <jvmarg value="-Dlog4j.configuration=file:log/log4j.properties.statdb" />
-                       <classpath refid="project.classpath" />
-               </java>
-       </target>
-
        <!--
-       The compilation order is 
-       1. datamodel 
-       2. engine
-       3. casscode
-       4. testscr
-       5. webservices
-       Packages of the lower order could not have dependencies on the packages on the next layer. 
-       So, casscode (layer 3) depends on the enginesand the datamodel but engine does not depend on 
-       anything in casscode or any other layers above. Testsrc is not allowed to test webservices. 
+       Compile with optimisation. testsrc is not compiled
+       Packages of the lower order should not have dependencies on the packages 
+       on the next layer. So datadb (layer 3) depends on the engine classes but 
+       engine does not depend on anything in datadb
        -->
-       <target name="compile_with_debug" depends="clean" description="Perform a multiple step compilation to ensure layered structure is preserved. Debug enabled.">
+       <target name="compile" depends="clean" description="Multiple step compilation to ensure layered structure is preserved. Debug disabled, optimisation enabled.">
                <!-- copy files to class path-->
                <copy file="${basedir}/log/log4j.properties" tofile="${classes}/log4j.properties" />
-               <!-- Complile the datamodel first -->
-               <javac srcdir="${basedir}/datamodel" destdir="${classes}" target="1.6"
-                               source="1.6" debug="on" encoding="UTF-8" verbose="false" nowarn="true" >
-                       <compilerarg value="-Xlint:unchecked"/>
-                       <classpath refid="project.classpath" />
-               </javac>
-               <!-- Complile the engines -->
-               <javac srcdir="${basedir}/engine" destdir="${classes}" target="1.6"
-                               source="1.6" debug="on" encoding="UTF-8" verbose="false" nowarn="true" >
-                       <compilerarg value="-Xlint:unchecked"/>
-                       <classpath refid="project.classpath" />
-               </javac>
-               <!-- Complile the casscode -->
-               <javac srcdir="${basedir}/casscode" destdir="${classes}" target="1.6"
-                               source="1.6" debug="on" encoding="UTF-8" verbose="false" nowarn="true" >
-                       <compilerarg value="-Xlint:unchecked"/>
-                       <classpath refid="project.classpath" />
-               </javac>
-               <!-- Complile the webservices -->
-               <javac srcdir="${basedir}/webservices" destdir="${classes}" target="1.6"
-                               source="1.6" debug="on" encoding="UTF-8" verbose="false" nowarn="true" >
-                       <compilerarg value="-Xlint:unchecked"/>
-                       <classpath refid="project.classpath" />
-               </javac>
-               <!-- Complile the tests -->
-               <javac srcdir="${basedir}/testsrc" destdir="${classes}" target="1.6"
-                               source="1.6" debug="on" encoding="UTF-8" verbose="false" nowarn="true" >
-                       <compilerarg value="-Xlint:unchecked"/>
-                       <classpath refid="project.classpath" />
-                       <classpath refid="test.classpath" />
-               </javac>
-       </target>
-
-       <!--
-       Compile with optimisation. Do not compile testsrc
-       The compilation order is 
-       1. datamodel 
-       2. engine
-       3. casscode
-       4. webservices
-       Packages of the lower order could not have dependencies on the packages on the next layer. 
-       So casscode (layer 3) depends on the engine and the datamodel but engine does not depend 
-       on anything in casscode or any other layers above.
-       -->
-       <target name="compile" depends="clean" description="Perform a multiple step compilation to ensure layered structure is preserved. Debug disabled, optimisation enabled. Tests are not compiled.">
-               <!-- copy files to class path-->
-               <copy file="${basedir}/log/log4j.properties" tofile="${classes}/log4j.properties" />
-               <!-- Complile the datamodel -->
-               <javac srcdir="${basedir}/datamodel" destdir="${classes}" target="1.6" source="1.6" debug="off" optimize="on" encoding="UTF-8" verbose="false" nowarn="true">
+               <!-- Complile engine -->
+               <javac srcdir="${basedir}/engine" destdir="${classes}" target="1.7" source="1.7" debug="off" optimize="on" encoding="UTF-8" verbose="false" nowarn="true">
                        <compilerarg value="-Xlint:-unchecked" />
                        <classpath refid="project.classpath" />
                </javac>
-               <!-- Complile the engine -->
-               <javac srcdir="${basedir}/engine" destdir="${classes}" target="1.6" source="1.6" debug="off" optimize="on" encoding="UTF-8" verbose="false" nowarn="true">
-                       <compilerarg value="-Xlint:-all" />
+               <!-- Complile database code -->
+               <javac srcdir="${basedir}/datadb" destdir="${classes}" target="1.7" source="1.7" debug="off" optimize="on" encoding="UTF-8" verbose="false" nowarn="true">
+                       <compilerarg value="-Xlint:all" />
                        <compilerarg value="-Xlint:-unchecked" />
                        <classpath refid="project.classpath" />
                </javac>
-               <!-- Complile the casscode -->
-               <javac srcdir="${basedir}/casscode" destdir="${classes}" target="1.6" source="1.6" debug="off" optimize="on" encoding="UTF-8" verbose="false" nowarn="true">
+               <!-- Complile the server -->
+               <javac srcdir="${basedir}/server" destdir="${classes}" target="1.7" source="1.7" debug="off" optimize="on" encoding="UTF-8" verbose="false" nowarn="true">
                        <compilerarg value="-Xlint:-unchecked" />
                        <classpath refid="project.classpath" />
                </javac>
-               <!-- Complile the webservices -->
-               <javac srcdir="${basedir}/webservices" destdir="${classes}" target="1.6" source="1.6" debug="off" optimize="on" encoding="UTF-8" verbose="false" nowarn="true">
-                       <compilerarg value="-Xlint:-unchecked" />
-                       <classpath refid="project.classpath" />
-               </javac>
-       </target>
-
-       <target name="datamodel-jar" depends="compile" description="Pack data model classes">
-               <echo>Jar file: Minimal WS client jar</echo>
-               <delete file="${basedir}/${datamodel}">
-               </delete>
-               <jar jarfile="${basedir}/${datamodel}">
-                       <zipgroupfileset excludes="META-INF/*.SF" dir="${web.lib.path}" >
-                               <include name="${compbio-util}"/>
-                               <include name="${compbio-annotation}"/>
-                       </zipgroupfileset>
-                       <fileset dir="${basedir}/WEB-INF/classes/">
-                               <include name="compbio/data/sequence/*.class"/>
-                               <include name="compbio/metadata/*.class"/>
-                       </fileset>
-                       <manifest>
-                               <attribute name="Built-By" value="${author}" />
-                               <attribute name="Class-Path" value="." />
-                               <attribute name="Implementation-Title" value="Datamodel for ${product} " />
-                               <attribute name="Implementation-Vendor" value="${author}" />
-                               <attribute name="Implementation-URL" value="${project.url}" />
-                       </manifest>
-               </jar>
-       </target>
-
-       <target name="minimal-proteocache-client-jar" depends="compile, datamodel-jar" description="Pack metadata, data model, WS interfaces, a simple ws client class">
-               <echo>Jar file: Minimal WS client jar</echo>
-               <delete file="${basedir}/${min-proteocache-client}"></delete>
-               <jar jarfile="${basedir}/${min-proteocache-client}">
-                       <zipgroupfileset excludes="META-INF/*.SF" dir="" includes="${datamodel}" />
-                       <fileset dir="${basedir}/WEB-INF/classes/">
-                               <!-- This will include JAXWS artifacts. Alternatively they can be generated on the fly. -->
-                               <include name="compbio/data/msa/**"/>
-                               <include name="compbio/ws/client/**"/>
-                       </fileset>
-                       <zipgroupfileset excludes="META-INF/*" dir="" includes="WEB-INF/lib/log4j-1.2.15.jar" />
-                       <manifest>
-                               <attribute name="Built-By" value="${author}" />
-                               <attribute name="Main-Class" value="compbio.ws.client.Jws2Client" />
-                               <attribute name="Class-Path" value="." />
-                               <attribute name="Implementation-Title" value="Minimal ${product} Client" />
-                               <attribute name="Implementation-Vendor" value="${author}" />
-                               <attribute name="Implementation-URL" value="${project.url}" />
-                       </manifest>
-               </jar>
-               <delete file="${basedir}/${min-proteocache-client-nolog}"></delete>
-               <jar jarfile="${basedir}/${min-proteocache-client-nolog}">
-                       <zipgroupfileset excludes="META-INF/*.SF" dir="" includes="${datamodel}" />
-                       <fileset dir="${basedir}/WEB-INF/classes/">
-                               <!-- This will include JAXWS artifacts. Alternatively they can be generated on the fly. -->
-                               <include name="compbio/data/msa/**"/>
-                               <include name="compbio/ws/client/**"/>
-                       </fileset>
-                       <manifest>
-                               <attribute name="Built-By" value="${author}" />
-                               <attribute name="Main-Class" value="compbio.ws.client.Jws2Client" />
-                               <attribute name="Class-Path" value="." />
-                               <attribute name="Implementation-Title" value="Minimal ${product} Client" />
-                               <attribute name="Implementation-Vendor" value="${author}" />
-                               <attribute name="Implementation-URL" value="${project.url}" />
-                       </manifest>
-               </jar>
        </target>
 
-       <target name="full-proteocache-client-jar" depends="compile" description="Pack datamodel, engine and casscode">
-               <echo>Jar file: Full ProteoCache client jar</echo>
-               <delete file="${full-proteocache-client}">
+       <target name="source-jar" description="Pack java sources">
+               <delete file="${proteocache-source-jar}">
                </delete>
-               <jar jarfile="${full-proteocache-client}">
-                       <zipgroupfileset excludes="META-INF/*.SF" dir="${web.lib.path}" >
-                               <include name="${compbio-util}"/>
-                               <include name="${compbio-annotation}"/>
-                               <include name="drmaa.jar"/>
-                       </zipgroupfileset>
-                       <fileset refid="fullclient"/>
-                       <manifest>
-                               <attribute name="Built-By" value="${author}" />
-                               <attribute name="Class-Path" value="." />
-                               <attribute name="Implementation-Title" value="Full ${product} Client" />
-                               <attribute name="Implementation-Vendor" value="${author}" />
-                               <attribute name="Implementation-URL" value="${project.url}" />
-                       </manifest>
-               </jar>
-       </target>
-
-       <target name="full-proteocache-client" depends="full-proteocache-client-jar" description="Pack sources and configuration files">
-               <echo>Packing binaries, and configuration files</echo>
-               <zip destfile="${full-proteocache-client-pack}" >
-                       <zipgroupfileset file="${binaries}" />
-                       <zipfileset dir="conf" prefix="conf" >
-                               <exclude name="**/temp/**"/>
-                       </zipfileset>
-                       <fileset file="${full-proteocache-client}" />
-               </zip>
-       </target>
-
-
-       <target name="source-jar" depends="datamodel-source-jar" description="Pack java sources">
-               <delete file="${basedir}/${proteocache-source-jar}">
-               </delete>
-               <jar jarfile="${basedir}/${proteocache-source-jar}">
-                       <zipgroupfileset  excludes="META-INF/*.MF" file="${datamodel-src}"/>
-                       <fileset dir="${basedir}/casscode">
+               <jar jarfile="${proteocache-source-jar}">
+                       <fileset dir="${basedir}/datadb">
                                <include name="**"/>
                        </fileset>
                        <fileset dir="${basedir}/engine">
                                <include name="**"/>
                        </fileset>
-                       <fileset dir="${basedir}/webservices/">
+                       <fileset dir="${basedir}/server/">
                                <include name="**"/>
                        </fileset>
                        <manifest>
                </jar>
        </target>
 
-       <target name="datamodel-source-jar" depends="compile" description="Pack java sources">
-               <delete file="${datamodel-src}">
-               </delete>
-               <jar jarfile="${datamodel-src}">
-                       <fileset dir="${basedir}/datamodel">
-                               <include name="**"/>
-                       </fileset>
-                       <zipgroupfileset excludes="META-INF/*.MF" dir="${lib.path}/src">
-                               <include name="**"/>
-                       </zipgroupfileset>
-                       <manifest>
-                               <attribute name="Built-By" value="${author}" />
-                               <attribute name="Implementation-Title" value="${product} Datamodel Source Code Archive" />
-                               <attribute name="Implementation-Vendor" value="${author}" />
-                               <attribute name="Implementation-URL" value="${project.url}" />
-                       </manifest>
-               </jar>
-       </target>
-
-       <target name="full-proteocache-jar" depends="compile" description="Pack datamodel, engine, casscode, configuration, binaries and webservices">
-               <echo>Jar file: Full WS client jar</echo>
-               <delete file="${full-proteocache-client}">
-               </delete>
-               <jar jarfile="${full-proteocache-client}">
-                       <zipgroupfileset excludes="META-INF/*.SF" dir="${web.lib.path}" >
-                               <include name="log4j-1.2.15.jar"/>
-                               <include name="${compbio-util}"/>
-                               <include name="${compbio-annotation}"/>
-                               <include name="drmaa.jar"/>
-                       </zipgroupfileset>
-                       <fileset refid="fullclient">
-                       </fileset>
-                       <fileset dir="${basedir}/WEB-INF/classes/">
-                               <!-- Statistics web application -->
-                               <include name="compbio/stat/**"/>
-                               <!-- Web services-->
-                               <include name="compbio/ws/**"/>
-                       </fileset>
-                       <!-- Set WSTester as main to help user to test their deployments -->
+       <target name="build-proteocache-jar" depends="compile" description="Pack all compiled codes, configuration, ...">
+               <echo>Build full jar</echo>
+               <delete file="${proteocache-jar}"></delete>
+               <jar jarfile="${proteocache-jar}">
+<!--                   <zipgroupfileset excludes="META-INF/*.SF" dir="${web.lib.path}" ></zipgroupfileset>-->
+                       <fileset refid="allcodes"></fileset>
+                       <fileset dir="${basedir}/WEB-INF/classes/"></fileset>
+                       <!-- Set compbio.server.MainTester as main to help user to test their deployments -->
                        <manifest>
                                <attribute name="Built-By" value="${author}" />
                                <attribute name="Class-Path" value="." />
-                               <attribute name="Main-Class" value="compbio.ws.client.WSTester" />
+                               <attribute name="Main-Class" value="compbio.server.MainTester" />
                                <attribute name="Implementation-Title" value="${product}" />
                                <attribute name="Implementation-Vendor" value="${author}" />
                                <attribute name="Implementation-URL" value="${project.url}" />
                </jar>
        </target>
 
-       <target name="proteocache-no-binaries" depends="full-proteocache-jar, clearStatDB" description="Prepare proteocache war file without native binaries">
-               <echo>Preparing a war file without binaries</echo>
-               <delete file="${proteocache-no-binaries}">
-               </delete>
-               <zip destfile="${proteocache-no-binaries}" whenempty="create">
+       <target name="proteocache-server" depends="build-proteocache-jar" description="Prepare ProteoCache war file">
+               <echo>Prepare ProteoCache war file</echo>
+               <delete file="${proteocache-war}"></delete>
+               <zip destfile="${proteocache-war}" whenempty="create">
                        <zipfileset dir="${basedir}/WEB-INF" prefix="WEB-INF">
                                <exclude name="classes"/>
-                               <!-- These are included into JABA client so exclude the jars -->
-                               <exclude name="lib/drmaa.jar"/>
-                               <exclude name="lib/log4j-1.2.15.jar"/>
-                               <exclude name="lib/${compbio-annotation}"/>
-                               <exclude name="lib/${compbio-util}"/>
-                               
                                <include name="web.xml"/>
-                               <include name="sun-jaxws.xml"/>
                                <include name="lib/*"/>
                        </zipfileset>
-                       <zipfileset dir="${basedir}/ExecutionStatistic" prefix="ExecutionStatistic" />
-                       <zipfileset dir="${basedir}/statpages" prefix="statpages" />
-                       <zipfileset dir="${basedir}/jobsout" prefix="jobsout" excludes="**/*"/>
-                       <zipfileset dir="conf" prefix="conf" >
-                               <exclude name="**/temp/**"/>
-                       </zipfileset>
-                       <!-- Add proteocache web site apart from the binary archive -->
-                       <zipfileset dir="${basedir}/website" excludes="archive/**, devel*.html, tests/**, template.html"/>
-                       <zipfileset dir="." includes="${full-proteocache-client}" fullpath="WEB-INF/lib/proteocache-client.jar"/>
+                       <zipfileset dir="." includes="${proteocache-jar}" fullpath="WEB-INF/lib/proteocache.jar"/>
+                       <zipfileset dir="conf" prefix="conf" />
+                       <!-- Add ProteoCache static web site pages apart from the binary archive -->
+                       <zipfileset dir="${basedir}/website" excludes="tests/**, template.html"/>
                        <!-- Put a copy of log4j configuration file where it can be used  -->
                        <zipfileset dir="log" includes="log4j.properties" prefix="WEB-INF/classes"/>
                </zip>
        </target>
 
-       <target name="build-devel-website" description="Pack developement related pages, tests, javadoc" >
-               <echo>Packing data for internal web site</echo>
-               <delete file="${proteocache-devel-web}">
-               </delete>
-               <zip destfile="${proteocache-devel-web}" whenempty="create">
-                       <!-- Add proteocache web site apart from the binary archive -->
-                       <zipfileset dir="${basedir}/website" excludes="template.html, download.html, index.html, manual.html, howto.html, archive/**, prog_docs/**"/>
-               </zip>
-       </target>
-
-       <target name="proteocache-complete" depends="proteocache-no-binaries" description="Prepare proteocache war file without runtime dependency - JAXWS jars">
-               <echo>Preparing a complete war file</echo>
-               <delete file="${proteocache}">
-               </delete>
-               <copy tofile="${proteocache}" file="${proteocache-no-binaries}"/>
-               <zip destfile="${proteocache}" update="true" >
-                       <zipgroupfileset file="${binaries}" />
-               </zip>
-       </target>
-
-       <target name="build-all" depends="full-proteocache-client, minimal-proteocache-client-jar, proteocache-no-binaries, proteocache-complete, datamodel-jar, datamodel-source-jar, source-jar" description="Build-all the distributives"/>
+       <target name="all" depends="proteocache-server, source-jar" description="Build all files"/>
 
        <!-- This task does not really depends on compile, but it is better to make sure that the code is sound -->
-       <target name="archive-project" description="Pack everything in the project for those who do not have access to SVN" depends="compile">
+       <target name="archive" description="Pack everything in the project for those who do not have access to SVN" depends="full-clean">
                <delete file="${proteocache-project}">
                </delete>
                <zip destfile="${proteocache-project}" whenempty="create" >
-                       <fileset dir="." excludes="${distdir}/**, jobsout/**, test-output/**, **.svn, dundee-conf/**, TODO.txt, IDEAS.txt, ${activity.log}, **/*.zip, **/*.war"/>
-                       <!-- Add jobsout directory but no content -->
-                       <zipfileset dir="${basedir}/jobsout" prefix="jobsout" excludes="*/**"/>
+                       <fileset dir="." excludes="${distdir}/**, **.git, **/*.zip, **/*.war"/>
                </zip>
        </target>
 
+<!-- ###################################################################################################################################### -->
 <!-- Test targets -->
+
+       <property name="LD_LIBRARY_PATH" value="/gridware/sge/lib/lx24-amd64"/>
+
+       <!-- add test library -->
+       <path id="test.classpath">
+               <fileset dir="${basedir}/testsrc/lib">
+                       <include name="*.jar" />
+               </fileset>
+               <pathelement location="${classes}" />
+       </path>
+       <!--
+       Packages of the lower order should not have dependencies on the packages 
+       on the next layer. So datadb (layer 3) depends on the engine classes but 
+       engine does not depend on anything in datadb
+       -->
+       <target name="compile_with_debug" depends="clean" description="Perform a multiple step compilation to ensure layered structure is preserved. Debug enabled.">
+               <!-- copy files to class path-->
+               <copy file="${basedir}/log/log4j.properties" tofile="${classes}/log4j.properties" />
+               <!-- Complile the engine classes -->
+               <javac srcdir="${basedir}/engine" destdir="${classes}" target="1.7" source="1.7" debug="on" encoding="UTF-8" verbose="false" nowarn="true" >
+                       <compilerarg value="-Xlint:unchecked"/>
+                       <classpath refid="project.classpath" />
+               </javac>
+               <!-- Complile the database classes -->
+               <javac srcdir="${basedir}/datadb" destdir="${classes}" target="1.7" source="1.7" debug="on" encoding="UTF-8" verbose="false" nowarn="true" >
+                       <compilerarg value="-Xlint:unchecked"/>
+                       <classpath refid="project.classpath" />
+               </javac>
+               <!-- Complile the server classes -->
+               <javac srcdir="${basedir}/server" destdir="${classes}" target="1.7" source="1.7" debug="on" encoding="UTF-8" verbose="false" nowarn="true" >
+                       <compilerarg value="-Xlint:unchecked"/>
+                       <classpath refid="project.classpath" />
+               </javac>
+               <!-- Complile the tests -->
+               <javac srcdir="${basedir}/testsrc" destdir="${classes}" target="1.7" source="1.7" debug="on" encoding="UTF-8" verbose="false" nowarn="true" >
+                       <compilerarg value="-Xlint:unchecked"/>
+                       <classpath refid="project.classpath" />
+                       <classpath refid="test.classpath" />
+               </javac>
+       </target>
+
+
        <taskdef name="testNG" classname="org.testng.TestNGAntTask">
                <classpath refid="test.classpath">
                </classpath>
                </testNG>
        </target>
 
-       <target name="Test_engines" depends="compile_with_debug">
-               <delete file="${activity.log}"/>
-               <testNG groups="engine" haltonfailure="true" verbose="3" enableassert="true" >
-                       <jvmarg value="-server" />
-                       <jvmarg value="-enableassertions" />
-                       <jvmarg value="-Xms1024m" />
-                       <jvmarg value="-Xmx1024m" />
-                       <classfileset dir="${classes}" includes="**/*.class" />
-                       <env key="LD_LIBRARY_PATH" value="${LD_LIBRARY_PATH}"/>
-                       <classpath refid="test.classpath" />
-                       <classpath refid="project.classpath" />
-                       <sysproperty key="TestingDataPath" value="${data.src}"/>
-               </testNG>
-       </target>
-
        <target name="All_cluster_independent_windows_only_tests" depends="compile_with_debug">
                <delete file="${activity.log}" failonerror="false"/>
                <testNG excludedgroups="cluster, non_windows" haltonfailure="true" verbose="3" enableassert="true"  >
index 99f0161..640079f 100644 (file)
@@ -11,6 +11,7 @@ import com.datastax.driver.core.Row;
 import com.datastax.driver.core.Session;
 import com.datastax.driver.core.ResultSet;
 
+import compbio.data.sequence.FastaSequence;
 import compbio.engine.JpredJob;
 import compbio.engine.ProteoCachePropertyHelperManager;
 import compbio.util.PropertyHelper;
diff --git a/datadb/compbio/cassandra/FastaReader.java b/datadb/compbio/cassandra/FastaReader.java
deleted file mode 100644 (file)
index 4783b14..0000000
+++ /dev/null
@@ -1,173 +0,0 @@
-package compbio.cassandra;
-
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.InputStream;
-import java.util.Iterator;
-import java.util.Scanner;
-
-//import compbio.util.Util;
-
-/**
- * Reads files with FASTA formatted sequences. All the information in the FASTA
- * header is preserved including trailing white spaces. All the white spaces are
- * removed from the sequence.
- * 
- * Examples of the correct input:
- * 
- * <pre>
- * 
- * >zedpshvyzg
- * GCQDKNNIAELNEIMGTTRSPSDWQHMKGASPRAEIGLTGKKDSWWRHCCSKEFNKTPPPIHPDMKRWGWMWNRENFEKFLIDNFLNPPCPRLMLTKGTWWRHEDLCHEIFWSTLRWLCLGNQSFSAMIWGHLCECHRMIWWESNEHMFWLKFRRALKKMNSNGPCMGPDNREWMITNRMGKEFCGPAFAGDCQSCWRKCHKTNKICFNEKKGTPTKIDHEQKDIMDILKDIDNHRNWKQCQLWLLTSKSTDQESTTMLTWSTWRDFFIIIKQPFDHKCRGALDANGDFQIAAELKWPAPMIILRQNQKTMHDKSCHHFFTNRCPLMHTTRANDKQCSWHTRKQFICQQDFTTWQHRPDTHRILPSWCMSTRRKNHIKNTPALAFSTCEMGDLPNGWAPGTIILQRQFTQAIKLPQETTGWPRCDPKFDHWNMSKWLRQLLGRDDEMIPPQCD
- * 
- * >xovkactesa
- * CPLSKWWNRRAFLSHTANHWMILMTWEGPHDGESKMRIAMMKWSPCKPTMSHFRCGLDAWAEPIRQIACESTFRM
- * FCTTPRPIHKLTEMWGHMNGWTGAFCRQLECEWMMPPRHPHPCTSTFNNNKKRLIGQIPNEGKQLFINFQKPQHG
- * FSESDIWIWKDNPTAWHEGLTIAGIGDGQHCWNWMPMPWSGAPTSNALIEFWTWLGMIGTRCKTQGMWWDAMNHH
- * DQFELSANAHIAAHHMEKKMILKPDDRNLGDDTWMPPGKIWMRMFAKNTNACWPEGCRDDNEEDDCGTHNLHRMC
- * 
- * >ntazzewyvv
- * CGCKIF D D NMKDNNRHG TDIKKHGFMH IRHPE KRDDC FDNHCIMPKHRRWGLWD
- * EASINM      AQQWRSLPPSRIMKLNG       HGCDCMHSHMEAD   DTKQSGIKGTFWNG  HDAQWLCRWG      
- * EFITEA      WWGRWGAITFFHAH  ENKNEIQECSDQNLKE        SRTTCEIID   TCHLFTRHLDGW 
- *   RCEKCQANATHMTW ACTKSCAEQW  FCAKELMMN    
- *   W        KQMGWRCKIFRKLFRDNCWID  FELPWWPICFCCKGLSTKSHSAHDGDQCRRW    WPDCARDWLGPGIRGEF   
- *   FCTHICQQLQRNFWCGCFRWNIEKRMFEIFDDNMAAHWKKCMHFKFLIRIHRHGPITMKMTWCRSGCCFGKTRRLPDSSFISAFLDPKHHRDGSGMMMWSSEMRSCAIPDPQQAWNQGKWIGQIKDWNICFAWPIRENQQCWATPHEMPSGFHFILEKWDALAHPHMHIRQKKCWAWAFLSLMSSTHSDMATFQWAIPGHNIWSNWDNIICGWPRI
- * 
- *    > 12 d t y wi            k       jbke    
- *   KLSHHDCD
- *    N
- *     H
- *     HSKCTEPHCGNSHQMLHRDP
- *     CCDQCQSWEAENWCASMRKAILF
- * 
- * </pre>
- * 
- * @author Peter Troshin
- * @version 1.0 April 2011
- * 
- */
-public class FastaReader implements Iterator<FastaSequence> {
-
-       private final Scanner input;
-       /**
-        * Delimiter for the scanner
-        */
-       private final String DELIM = ">";
-
-       /**
-        * Header data can contain non-ASCII symbols and read in UTF8
-        * 
-        * @param inputFile
-        *            the file containing the list of FASTA formatted sequences to
-        *            read from
-        * @throws FileNotFoundException
-        *             if the input file is not found
-        * @throws IllegalStateException
-        *             if the close method was called on this instance
-        * 
-        */
-       public FastaReader(final String inputFile) throws FileNotFoundException {
-               input = new Scanner(new File(inputFile), "UTF8");
-               input.useDelimiter(DELIM);
-               Runtime.getRuntime().addShutdownHook(new Thread() {
-
-                       @Override
-                       public void run() {
-                               if (input != null) {
-                                       input.close();
-                               }
-                       }
-               });
-       }
-
-       /**
-        * This class will not close the incoming stream! So the client should do
-        * so.
-        * 
-        * @param inputStream
-        * @throws FileNotFoundException
-        */
-       public FastaReader(final InputStream inputStream)
-                       throws FileNotFoundException {
-               input = new Scanner(inputStream);
-               input.useDelimiter(DELIM);
-       }
-
-       /**
-        * {@inheritDoc}
-        * 
-        * @throws IllegalStateException
-        *             if the close method was called on this instance
-        */
-       @Override
-       public boolean hasNext() {
-               return input.hasNext();
-       }
-
-       /**
-        * Reads the next FastaSequence from the input
-        * 
-        * @throws AssertionError
-        *             if the header or the sequence is missing
-        * @throws IllegalStateException
-        *             if the close method was called on this instance
-        * @throws MismatchException
-        *             - if there were no more FastaSequence's.
-        */
-       @Override
-       public FastaSequence next() {
-               String fastaHeader = input.next();
-               while (fastaHeader.indexOf("\n") < 0 && input.hasNext()) {
-                       fastaHeader = fastaHeader.concat(">");
-                       fastaHeader = fastaHeader.concat(input.next());
-               }
-               return FastaReader.toFastaSequence(fastaHeader);
-       }
-
-       /**
-        * Not implemented
-        */
-       @Override
-       public void remove() {
-               throw new UnsupportedOperationException();
-       }
-
-       /**
-        * Call this method to close the connection to the input file if you want to
-        * free up the resources. The connection will be closed on the JVM shutdown
-        * if this method was not called explicitly. No further reading on this
-        * instance of the FastaReader will be possible after calling this method.
-        */
-       public void close() {
-               input.close();
-       }
-
-       private static FastaSequence toFastaSequence(final String singleFastaEntry) {
-
-               // assert !Util.isEmpty(singleFastaEntry) :
-               // "Empty String where FASTA sequence is expected!";
-
-               int nlineidx = singleFastaEntry.indexOf("\n");
-               if (nlineidx < 0) {
-                       throw new AssertionError(
-                                       "The FASTA sequence must contain the header information"
-                                                       + " separated by the new line from the sequence. Given sequence does not appear to "
-                                                       + "contain the header! Given data:\n "
-                                                       + singleFastaEntry);
-               }
-               String header = singleFastaEntry.substring(0, nlineidx);
-
-               // Get rid of the new line chars (should cover common cases)
-               header = header.replaceAll("\r", "");
-
-               String sequence = singleFastaEntry.substring(nlineidx);
-
-               /*
-                * if (Util.isEmpty(sequence)) { throw new AssertionError(
-                * "Empty sequences are not allowed! Please make sure the " +
-                * " data is in the FASTA format! Given data:\n " + singleFastaEntry); }
-                */
-               return new FastaSequence(header, sequence);
-       }
-}
diff --git a/datadb/compbio/cassandra/FastaSequence.java b/datadb/compbio/cassandra/FastaSequence.java
deleted file mode 100644 (file)
index 61f49c7..0000000
+++ /dev/null
@@ -1,179 +0,0 @@
-package compbio.cassandra;
-
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-
-//import compbio.util.SysPrefs;
-//import compbio.util.annotation.Immutable;
-
-/**
- * A FASTA formatted sequence. Please note that this class does not make any
- * assumptions as to what sequence it stores e.g. it could be nucleotide,
- * protein or even gapped alignment sequence! The only guarantee it makes is
- * that the sequence does not contain white space characters e.g. spaces, new
- * lines etc
- * 
- * @author pvtroshin
- * 
- * @version 1.0 September 2009
- */
-
-@XmlAccessorType(XmlAccessType.FIELD)
-//@Immutable
-public class FastaSequence {
-
-       /**
-        * Sequence id
-        */
-       private String id;
-
-       // TODO what about gapped sequence here! should be indicated
-       /**
-        * Returns the string representation of sequence
-        */
-       private String sequence;
-
-       FastaSequence() {
-               // Default constructor for JaxB
-       }
-
-       /**
-        * Upon construction the any whitespace characters are removed from the
-        * sequence
-        * 
-        * @param id
-        * @param sequence
-        */
-       public FastaSequence(String id, String sequence) {
-               this.id = id;
-               this.sequence = sequence;
-       }
-
-       /**
-        * Gets the value of id
-        * 
-        * @return the value of id
-        */
-       public String getId() {
-               return this.id;
-       }
-
-       /**
-        * Gets the value of sequence
-        * 
-        * @return the value of sequence
-        */
-       public String getSequence() {
-               return this.sequence;
-       }
-
-       public static int countMatchesInSequence(final String theString,
-                       final String theRegExp) {
-               final Pattern p = Pattern.compile(theRegExp);
-               final Matcher m = p.matcher(theString);
-               int cnt = 0;
-               while (m.find()) {
-                       cnt++;
-               }
-               return cnt;
-       }
-
-       public String getFormattedFasta() {
-               return getFormatedSequence(80);
-       }
-
-       /**
-        * 
-        * @return one line name, next line sequence, no matter what the sequence
-        *         length is
-        */
-/*     public String getOnelineFasta() {
-               String fasta = ">" + getId() + SysPrefs.newlinechar;
-               fasta += getSequence() + SysPrefs.newlinechar;
-               return fasta;
-       }
-
-       /**
-        * Format sequence per width letter in one string. Without spaces.
-        * 
-        * @return multiple line formated sequence, one line width letters length
-        * 
-        */
-       public String getFormatedSequence(final int width) {
-               if (sequence == null) {
-                       return "";
-               }
-
-               assert width >= 0 : "Wrong width parameter ";
-
-               final StringBuilder sb = new StringBuilder(sequence);
-               // int tail = nrOfWindows % WIN_SIZE;
-               // final int turns = (nrOfWindows - tail) / WIN_SIZE;
-
-               int tailLen = sequence.length() % width;
-               // add up inserted new line chars
-               int nchunks = (sequence.length() - tailLen) / width;
-               int nlineCharcounter = 0;
-               int insPos = 0;
-               for (int i = 1; i <= nchunks; i++) {
-                       insPos = width * i + nlineCharcounter;
-                       // to prevent inserting new line in the very end of a sequence then
-                       // it would have failed.
-                       if (sb.length() <= insPos) {
-                               break;
-                       }
-                       sb.insert(insPos, "\n");
-                       nlineCharcounter++;
-               }
-               // sb.insert(insPos + tailLen, "\n");
-               return sb.toString();
-       }
-
-       /**
-        * 
-        * @return sequence length
-        */
-       public int getLength() {
-               return this.sequence.length();
-       }
-
-       /**
-        * Same as oneLineFasta
-        */
-//     @Override
-//     public String toString() {
-//             return this.getOnelineFasta();
-       // }
-
-       @Override
-       public int hashCode() {
-               final int prime = 17;
-               int result = 1;
-               result = prime * result + ((id == null) ? 0 : id.hashCode());
-               result = prime * result
-                               + ((sequence == null) ? 0 : sequence.hashCode());
-               return result;
-       }
-
-       @Override
-       public boolean equals(Object obj) {
-               if (obj == null) {
-                       return false;
-               }
-               if (!(obj instanceof FastaSequence)) {
-                       return false;
-               }
-               FastaSequence fs = (FastaSequence) obj;
-               if (!fs.getId().equals(this.getId())) {
-                       return false;
-               }
-               if (!fs.getSequence().equalsIgnoreCase(this.getSequence())) {
-                       return false;
-               }
-               return true;
-       }
-
-}
index bb2993b..129d8d1 100644 (file)
@@ -15,6 +15,8 @@ import java.util.Date;
 import java.util.List;
 
 import compbio.cassandra.JpredParser;
+import compbio.data.sequence.FastaReader;
+import compbio.data.sequence.FastaSequence;
 import compbio.engine.JpredJob;
 
 public class JpredParserHTTP implements JpredParser {
index d4a22e6..f48178c 100644 (file)
@@ -15,6 +15,9 @@ import java.util.Calendar;
 import java.util.Date;
 import java.util.List;
 
+import compbio.data.sequence.FastaReader;
+import compbio.data.sequence.FastaSequence;
+
 public class JpredParserLocalFile implements JpredParser {
        private CassandraWriter cw = new CassandraWriter();
        private String dirprefix;
index a606746..db4a7fe 100644 (file)
@@ -3,7 +3,7 @@ package compbio.engine;
 import java.util.ArrayList;
 import java.util.List;
 
-import compbio.cassandra.FastaSequence;
+import compbio.data.sequence.FastaSequence;
 
 public class JpredJob extends Job {
        private String protein;
diff --git a/lib/servlet-api.jar b/lib/servlet-api.jar
new file mode 100644 (file)
index 0000000..c6273b9
Binary files /dev/null and b/lib/servlet-api.jar differ
diff --git a/testsrc/lib/testng-5.10-jdk15.jar b/testsrc/lib/testng-5.10-jdk15.jar
deleted file mode 100644 (file)
index 67463a7..0000000
Binary files a/testsrc/lib/testng-5.10-jdk15.jar and /dev/null differ
diff --git a/testsrc/lib/testng-6.8.jar b/testsrc/lib/testng-6.8.jar
new file mode 100644 (file)
index 0000000..dd6c8bb
Binary files /dev/null and b/testsrc/lib/testng-6.8.jar differ