|
From: <ian...@us...> - 2007-07-05 20:40:06
|
Revision: 214
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=214&view=rev
Author: iansmith
Date: 2007-07-05 13:40:07 -0700 (Thu, 05 Jul 2007)
Log Message:
-----------
Renamed spacesync package to (correct) name of templatesync.
Added support for generating test code coverage with ant from the command line. Should have no effect on anyone not using it.
Info on how to generate code coverage data can be found here:
http://ogoglio.wiki.sourceforge.net/CodeCoverageWithEmma
Modified Paths:
--------------
spaces/trunk/build.xml
spaces/trunk/src/com/ogoglio/client/ClientTests.java
spaces/trunk/src/com/ogoglio/templatesync/SyncTool.java
spaces/trunk/src/com/ogoglio/templatesync/SyncToolSpec.java
spaces/trunk/src/com/ogoglio/templatesync/SyncToolTest.java
Added Paths:
-----------
spaces/trunk/.settings/
spaces/trunk/.settings/org.eclipse.jdt.core.prefs
spaces/trunk/.settings/org.eclipse.jdt.ui.prefs
spaces/trunk/dev-lib/
spaces/trunk/dev-lib/emma/
spaces/trunk/dev-lib/emma/emma.jar
spaces/trunk/dev-lib/emma/emma_ant.jar
spaces/trunk/dev-lib/junit/
spaces/trunk/dev-lib/junit/ant-junit.jar
spaces/trunk/src/com/ogoglio/templatesync/
spaces/trunk/src/com/ogoglio/templatesync/TemplateSyncTestSuite.java
Removed Paths:
-------------
spaces/trunk/src/com/ogoglio/spacesync/
spaces/trunk/src/com/ogoglio/templatesync/SpaceSyncTestSuite.java
Added: spaces/trunk/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- spaces/trunk/.settings/org.eclipse.jdt.core.prefs (rev 0)
+++ spaces/trunk/.settings/org.eclipse.jdt.core.prefs 2007-07-05 20:40:07 UTC (rev 214)
@@ -0,0 +1,12 @@
+#Tue Jul 03 09:23:42 PDT 2007
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=disabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.4
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
+org.eclipse.jdt.core.compiler.source=1.3
Added: spaces/trunk/.settings/org.eclipse.jdt.ui.prefs
===================================================================
--- spaces/trunk/.settings/org.eclipse.jdt.ui.prefs (rev 0)
+++ spaces/trunk/.settings/org.eclipse.jdt.ui.prefs 2007-07-05 20:40:07 UTC (rev 214)
@@ -0,0 +1,3 @@
+#Tue Jul 03 09:23:41 PDT 2007
+eclipse.preferences.version=1
+internal.default.compliance=default
Modified: spaces/trunk/build.xml
===================================================================
--- spaces/trunk/build.xml 2007-07-03 22:05:56 UTC (rev 213)
+++ spaces/trunk/build.xml 2007-07-05 20:40:07 UTC (rev 214)
@@ -5,7 +5,27 @@
<property name="tomcatHome" value="../../tomcat/" />
<property name="webLibDir" value="./war/WEB-INF/lib/" />
<property name="warName" value="ogoglio.war" />
-
+
+ <!--code coverage with emma -->
+ <property name="emmaData" value="working/emma"/>
+ <property name="coverage.dir" value="${emmaData}/reports/emma" /> <!-- directory which emma coverage reports will be written to -->
+ <property name="instr.dir" value="${emmaData}/target/emmainstr" /> <!-- directory which emma instrumentation classes will be written to -->
+ <property name="emma.dir" value="dev-lib/emma" /> <!-- directory that contains emma.jar and emma_ant.jar -->
+ <property name="emma.source_classes" value="${dest}"/>
+ <!-- Set emma.lib to refer to the list of EMMA jar files -->
+ <path id="emma.lib" >
+ <fileset dir="${emma.dir}">
+ <include name="*.jar"/>
+ </fileset>
+ </path>
+
+ <!-- which classes to work on -->
+ <path id="emma.coverage.classes" >
+ <pathelement location="${dest}" />
+ </path>
+ <!-- Load <emma> and <emmajava> custom tasks so that they can be used in ANT -->
+ <taskdef resource="emma_ant.properties" classpathref="emma.lib" />
+
<path id="classpath">
<fileset dir="${webLibDir}">
<include name="**/*.jar" />
@@ -18,6 +38,94 @@
</fileset>
</path>
+ <!-- Enable Emma -->
+ <target name="emma" description="turns on EMMA's instrumentation/reporting" >
+
+ <property name="emma.enabled" value="true" />
+
+ <!-- EMMA instr class output directory (it is important to create this property only when EMMA is enabled) -->
+ <mkdir dir="${instr.dir}" />
+
+ <!-- this property, if overriden via -Demma.filter=<list of filter specs>
+ on ANT's command line, will set the coverage filter; by default,
+ all classes found in 'emma.coverage.classes' pathref will be instrumented:
+ -->
+ <property name="emma.filter" value="+com.ogoglio.*,-*Test*,-*Spec*" />
+ <property name="debug.on" value="true"/>
+ </target>
+
+ <target name="coverage" depends="cleanInstrumented,emma,test">
+ </target>
+
+ <target name="test" depends="compile">
+ <!-- ======================================================================= -->
+ <!-- EMMA INSTRUMENTATION -->
+ <!-- ======================================================================= -->
+ <!-- Instrument the classes, this takes the normal classes, and makes instrumented classes instead -->
+ <!-- Note that EMMA takes regular ANT path elements as instrumentation input, which is exceedingly convenient -->
+ <emma enabled="${emma.enabled}" >
+ <instr instrpath="${dest}"
+ destdir="${instr.dir}"
+ metadatafile="${coverage.dir}/metadata.emma"
+ merge="false" mode="copy" filter="${emma.filter}">
+ </instr>
+ </emma>
+ <junit fork="true" forkmode="once">
+ <classpath>
+ <pathelement location="${instr.dir}"/>
+ <fileset dir="${webLibDir}">
+ <include name="**/*.jar" />
+ </fileset>
+ <path refid="emma.lib" />
+ <pathelement location="${dest}"/>
+ </classpath>
+ <formatter type="brief" usefile="false" />
+ <test name="com.ogoglio.templatesync.TemplateSyncTestSuite" />
+ <test name="com.ogoglio.OgoglioTestSuite" />
+ <jvmarg value="-Demma.coverage.out.file=${coverage.dir}/coverage.emma" />
+ <jvmarg value="-Demma.coverage.out.merge=false" />
+ </junit>
+ <!-- if enabled, generate coverage report(s): -->
+ <emma enabled="${emma.enabled}" >
+ <report sourcepath="src"
+ sort="+block,+name,+method,+class"
+ metrics="method:100,block:100,line:100,class:100"
+ >
+ <!-- collect all EMMA data dumps (metadata and runtime)
+ [this can be done via nested <fileset> fileset elements
+ or <file> elements pointing to a single file]:
+ -->
+ <fileset dir="${coverage.dir}" >
+ <include name="*.emma" />
+ </fileset>
+
+ <!-- for every type of report desired, configure a nested
+ element; various report parameters
+ can be inherited from the parent <report>
+ and individually overridden for each report type:
+ -->
+ <txt outfile="${coverage.dir}/coverage.txt"
+ depth="package"
+ columns="class,method,block,line,name"
+ />
+ <xml outfile="${coverage.dir}/coverage.xml"
+ depth="package"
+ />
+ <html outfile="${coverage.dir}/coverage.html"
+ depth="method"
+ columns="name,class,method,block,line"
+ />
+ </report>
+ </emma>
+ </target>
+
+ <target name="cleanInstrumented">
+ <delete>
+ <fileset dir="${instr.dir}" includes="**/**"/>
+ <fileset dir="${coverage.dir}" includes="**/**"/>
+ </delete>
+ </target>
+
<target name="clean">
<delete>
<fileset dir="${dest}" includes="**/*" />
@@ -36,7 +144,7 @@
</target>
<target name="compile">
- <javac source="1.4" target="1.4" srcdir="${source}" destdir="${dest}">
+ <javac source="1.4" target="1.4" srcdir="${source}" destdir="${dest}" debug="${debug.on}">
<classpath refid="classpath" />
</javac>
<copy todir="${dest}/">
Added: spaces/trunk/dev-lib/emma/emma.jar
===================================================================
(Binary files differ)
Property changes on: spaces/trunk/dev-lib/emma/emma.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: spaces/trunk/dev-lib/emma/emma_ant.jar
===================================================================
(Binary files differ)
Property changes on: spaces/trunk/dev-lib/emma/emma_ant.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: spaces/trunk/dev-lib/junit/ant-junit.jar
===================================================================
(Binary files differ)
Property changes on: spaces/trunk/dev-lib/junit/ant-junit.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: spaces/trunk/src/com/ogoglio/client/ClientTests.java
===================================================================
--- spaces/trunk/src/com/ogoglio/client/ClientTests.java 2007-07-03 22:05:56 UTC (rev 213)
+++ spaces/trunk/src/com/ogoglio/client/ClientTests.java 2007-07-05 20:40:07 UTC (rev 214)
@@ -365,6 +365,7 @@
TestListener testListener = new TestListener();
space1.addListener(testListener, false);
+ assertNotNull(space1.getThing(1));
stream = space1.getThing(1).getGeometryStream(0);
assertNotNull(stream);
consume(stream);
Copied: spaces/trunk/src/com/ogoglio/templatesync (from rev 213, spaces/trunk/src/com/ogoglio/spacesync)
Deleted: spaces/trunk/src/com/ogoglio/templatesync/SpaceSyncTestSuite.java
===================================================================
--- spaces/trunk/src/com/ogoglio/spacesync/SpaceSyncTestSuite.java 2007-07-03 22:05:56 UTC (rev 213)
+++ spaces/trunk/src/com/ogoglio/templatesync/SpaceSyncTestSuite.java 2007-07-05 20:40:07 UTC (rev 214)
@@ -1,15 +0,0 @@
-package com.ogoglio.spacesync;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-public class SpaceSyncTestSuite {
- public static Test suite() {
- TestSuite suite = new TestSuite();
- //units
- suite.addTestSuite(SyncToolTest.class);
- //specs
- suite.addTestSuite(SyncToolSpec.class);
- return suite;
- }
-}
Modified: spaces/trunk/src/com/ogoglio/templatesync/SyncTool.java
===================================================================
--- spaces/trunk/src/com/ogoglio/spacesync/SyncTool.java 2007-07-03 22:05:56 UTC (rev 213)
+++ spaces/trunk/src/com/ogoglio/templatesync/SyncTool.java 2007-07-05 20:40:07 UTC (rev 214)
@@ -1,4 +1,4 @@
-package com.ogoglio.spacesync;
+package com.ogoglio.templatesync;
import java.io.File;
import java.io.IOException;
Modified: spaces/trunk/src/com/ogoglio/templatesync/SyncToolSpec.java
===================================================================
--- spaces/trunk/src/com/ogoglio/spacesync/SyncToolSpec.java 2007-07-03 22:05:56 UTC (rev 213)
+++ spaces/trunk/src/com/ogoglio/templatesync/SyncToolSpec.java 2007-07-05 20:40:07 UTC (rev 214)
@@ -1,4 +1,4 @@
-package com.ogoglio.spacesync;
+package com.ogoglio.templatesync;
import java.io.IOException;
import java.net.URI;
Modified: spaces/trunk/src/com/ogoglio/templatesync/SyncToolTest.java
===================================================================
--- spaces/trunk/src/com/ogoglio/spacesync/SyncToolTest.java 2007-07-03 22:05:56 UTC (rev 213)
+++ spaces/trunk/src/com/ogoglio/templatesync/SyncToolTest.java 2007-07-05 20:40:07 UTC (rev 214)
@@ -1,4 +1,4 @@
-package com.ogoglio.spacesync;
+package com.ogoglio.templatesync;
import java.io.File;
import java.io.IOException;
Added: spaces/trunk/src/com/ogoglio/templatesync/TemplateSyncTestSuite.java
===================================================================
--- spaces/trunk/src/com/ogoglio/templatesync/TemplateSyncTestSuite.java (rev 0)
+++ spaces/trunk/src/com/ogoglio/templatesync/TemplateSyncTestSuite.java 2007-07-05 20:40:07 UTC (rev 214)
@@ -0,0 +1,16 @@
+
+package com.ogoglio.templatesync;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+public class TemplateSyncTestSuite {
+ public static Test suite() {
+ TestSuite suite = new TestSuite();
+ //units
+ suite.addTestSuite(SyncToolTest.class);
+ //specs
+ suite.addTestSuite(SyncToolSpec.class);
+ return suite;
+ }
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|