Permalink
Browse files

Publish unit tests for Closure Templates.

Tests can be run via "ant test".



git-svn-id: http://closure-templates.googlecode.com/svn/trunk@25 ba6e359a-b4f9-11de-880b-11b4e8d67c75
  • Loading branch information...
bolinfest
bolinfest committed Dec 14, 2011
1 parent 452c82c commit 17db4aef4f110025a94a15b91c99607b754b5b90
Showing 462 changed files with 35,544 additions and 1,441 deletions.
View
@@ -20,14 +20,16 @@ Author: Neil Sanchala
-->
<project name="Soy" basedir="." default="jar">
<property name="java.src.dir" value="${basedir}/java/src" />
<property name="java.tests.dir" value="${basedir}/java/tests" />
<property name="java.lib.dir" value="${basedir}/java/lib" />
<property name="build.dir" value="${basedir}/build" />
<property name="soy.jar.file" value="${build.dir}/soy.jar" />
<property name="build.classes.dir" value="${build.dir}/classes" />
<property name="build.testclasses.dir" value="${build.dir}/tests" />
<property name="build.genfiles.dir" value="${build.dir}/genfiles" />
<property name="includeDebugInfo" value="true" />
<property name="javadoc.lite.dir" value="${basedir}/javadoc-lite" />
<property name="javadoc.complete.dir" value="${basedir}/javadoc-complete" />
@@ -37,6 +39,12 @@ Author: Neil Sanchala
<property name="release.dir" value="${basedir}/release" />
<property name="release.stamp" value="unstable" />
<path id="classpath.path">
<fileset dir="${java.lib.dir}">
<include name="*.jar" />
</fileset>
</path>
<!-- Target to delete the generated files. -->
<target name="clean"
description="Deletes generated files.">
@@ -67,12 +75,11 @@ Author: Neil Sanchala
<!-- Java compilation. -->
<javac srcdir="${java.src.dir}:${build.genfiles.dir}"
destdir="${build.classes.dir}"
source="1.6" target="1.6">
<classpath>
<fileset dir="${java.lib.dir}">
<include name="*.jar" />
</fileset>
</classpath>
source="1.6"
target="1.6"
includeAntRuntime="true"
debug="${includeDebugInfo}">
<classpath refid="classpath.path" />
<compilerarg value="-Werror"/> <!-- warnings become errors -->
<compilerarg value="-Xlint:deprecation"/>
</javac>
@@ -125,8 +132,8 @@ Author: Neil Sanchala
excludes="LICENSE,NOTICE" />
<zipfileset src="${java.lib.dir}/guice-assistedinject-3.0.jar"
excludes="LICENSE,NOTICE" />
<zipfileset src="${java.lib.dir}/args4j-2.0.12.jar" />
<zipfileset src="${java.lib.dir}/icu4j-core.jar" />
<zipfileset src="${java.lib.dir}/args4j-2.0.17.jar" />
<zipfileset src="${java.lib.dir}/icu4j-4_8_1_1.jar" />
</jar>
</target>
@@ -551,8 +558,8 @@ Author: Neil Sanchala
java-simple-example,
parse-info-generation-example,
java-features-example,
msg-extraction-example" />
msg-extraction-example,
test-forkless" />
<!--
Builds a set of zip files containing releaseable bundles of code. These zip files may be uploaded
@@ -647,4 +654,65 @@ Author: Neil Sanchala
</zip>
</target>
<target name="compile-tests"
depends="compile"
description="Compiles the tests.">
<mkdir dir="${build.testclasses.dir}" />
<javac srcdir="${java.tests.dir}"
destdir="${build.testclasses.dir}"
source="1.6"
target="1.6"
includeAntRuntime="false"
debug="${includeDebugInfo}">
<classpath refid="classpath.path" />
<classpath>
<pathelement location="${build.classes.dir}" />
</classpath>
</javac>
</target>
<macrodef name="testing">
<attribute name="printsummary" default="off" />
<attribute name="fork" default="off" />
<attribute name="forkmode" default="perTest" />
<sequential>
<antcall target="compile-tests" />
<junit printsummary="@{printsummary}"
fork="@{fork}"
forkmode="@{forkmode}"
showoutput="true">
<classpath refid="classpath.path" />
<classpath>
<pathelement location="${build.classes.dir}" />
<pathelement location="${build.testclasses.dir}" />
<!--
Include the test directory on the classpath so that static resources loaded via
Resources.getResource() do not need to be copied to ${build.testclasses.dir}.
-->
<pathelement location="${java.tests.dir}" />
</classpath>
<formatter type="plain" usefile="false" />
<batchtest haltonfailure="true">
<fileset dir="${build.testclasses.dir}">
<include name="**/*Test.class" />
</fileset>
</batchtest>
</junit>
</sequential>
</macrodef>
<target name="test"
description="Runs all of the tests.">
<testing printsummary="on" fork="on" forkmode="once" />
</target>
<target name="test-forkless"
description="Runs all of the tests without forking the process.">
<testing />
</target>
</project>
View
BIN +23.7 KB (110%) buildtools/javacc/javacc.jar
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
View
BIN +0 Bytes (100%) java/lib/javax.inject.jar
Binary file not shown.
View
BIN +213 KB java/lib/junit.jar
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
@@ -33,7 +33,6 @@
* be called. This method creates a Guice injector containing only the {@code SoyModule},
* which serves to bind the default Soy plugins (e.g. basic functions).
*
* @author Kai Huang
*/
class GuiceInitializer {
@@ -38,7 +38,6 @@
/**
* Private utils for classes with a main() method.
*
* @author Kai Huang
*/
class MainClassUtils {
@@ -81,7 +81,6 @@
*
* <p> Note: Soy file (or resource) contents must be encoded in UTF-8.
*
* @author Kai Huang
*/
public final class SoyFileSet {
@@ -35,7 +35,6 @@
/**
* Guice module for Soy's programmatic interface.
*
* @author Kai Huang
*/
public class SoyModule extends AbstractModule {
@@ -39,7 +39,6 @@
* <p> The command-line arguments should contain command-line flags and the list of paths to the
* Soy files.
*
* @author Kai Huang
*/
public final class SoyMsgExtractor {
@@ -41,7 +41,6 @@
* <p> The command-line arguments should contain command-line flags and the list of paths to the
* Soy files.
*
* @author Kai Huang
*/
public final class SoyParseInfoGenerator {
@@ -42,7 +42,6 @@
*
* <p> Warning: The Java Src backend is experimental (repetitive, untested, undocumented).
*
* @author Kai Huang
*/
public class SoyToJavaSrcCompilerExperimental {
@@ -36,7 +36,6 @@
/**
* Executable for compiling a set of Soy files into corresponding JS source files.
*
* @author Kai Huang
*/
public final class SoyToJsSrcCompiler {
@@ -47,7 +47,6 @@
/**
* Public utilities for Soy users.
*
* @author Kai Huang
*/
public class SoyUtils {
@@ -68,7 +67,7 @@ private SoyUtils() {}
* @param output The object to append the generated text to.
* @throws SoySyntaxException If one of the values is not a valid Soy primitive type.
* @throws IOException If there is an error appending to the given {@code Appendable}.
* @see #generateCompileTimeGlobalsFile(Map, File)
* @see #generateCompileTimeGlobalsFile(Map, File)
*/
public static void generateCompileTimeGlobalsFile(
Map<String, ?> compileTimeGlobalsMap, Appendable output) throws IOException {
@@ -28,7 +28,6 @@
*
* <p> Important: Do not use outside of Soy code (treat as superpackage-private).
*
* @author Kai Huang
*/
public class BaseUtils {
@@ -22,7 +22,6 @@
*
* <p> Important: Do not use outside of Soy code (treat as superpackage-private).
*
* @author Kai Huang
*/
public final class FixedIdGenerator implements IdGenerator {
@@ -22,7 +22,6 @@
*
* <p> Important: Do not use outside of Soy code (treat as superpackage-private).
*
* @author Kai Huang
*/
public interface IdGenerator {
@@ -22,7 +22,6 @@
*
* <p> Important: Do not use outside of Soy code (treat as superpackage-private).
*
* @author Kai Huang
*/
public final class IncrementingIdGenerator implements IdGenerator {
@@ -26,7 +26,6 @@
*
* <p> The maximum indent length is 24.
*
* @author Kai Huang
*/
public class IndentedLinesBuilder implements CharSequence, Appendable {
@@ -23,7 +23,6 @@
/**
* Describes a line in a Soy input file.
*
* @author Mike Samuel
*/
@ParametersAreNonnullByDefault
public final class SourceLocation {
@@ -34,8 +34,6 @@
*
* <p> Important: Do not use outside of Soy code (treat as superpackage-private).
*
* @author Kai Huang
* @author Mike Samuel
*/
public interface SoyFileSupplier {
@@ -22,7 +22,6 @@
/**
* Exception for Soy syntax errors.
*
* @author Kai Huang
*/
@ParametersAreNullableByDefault
public class SoySyntaxException extends RuntimeException {
@@ -125,10 +124,10 @@ public SoySyntaxException setTemplateName(String templateName) {
}
}
/**
* @return The original error message from the Soy compiler without any
* metadata about the location where the error appears.
* metadata about the location where the error appears.
*/
public String getOriginalMessage() {
return super.getMessage();
@@ -29,8 +29,6 @@
*
* <p> Important: Do not use outside of Soy code (treat as superpackage-private).
*
* @author Kai Huang
* @author Mike Samuel
*/
public class StableSoyFileSupplier implements SoyFileSupplier {
@@ -33,7 +33,6 @@
*
* <p> Important: Do not use outside of Soy code (treat as superpackage-private).
*
* @author Mike Samuel
*/
public class VolatileSoyFileSupplier implements SoyFileSupplier {
@@ -22,7 +22,6 @@
*
* <p> Important: Do not use outside of Soy code (treat as superpackage-private).
*
* @author Kai Huang
*/
public abstract class AbstractNode implements Node {
@@ -31,7 +31,6 @@
* @param <R> The return type of this visitor.
*
* @see AbstractReturningNodeVisitor
* @author Kai Huang
*/
public abstract class AbstractNodeVisitor<N extends Node, R> implements NodeVisitor<N, R> {
@@ -24,7 +24,6 @@
*
* <p> Important: Do not use outside of Soy code (treat as superpackage-private).
*
* @author Kai Huang
*/
public abstract class AbstractParentNode<N extends Node>
extends AbstractNode implements ParentNode<N> {
@@ -33,7 +33,6 @@
* @param <R> The return type of this visitor.
*
* @see AbstractNodeVisitor
* @author Kai Huang
*/
public abstract class AbstractReturningNodeVisitor<N extends Node, R>
implements NodeVisitor<N, R> {
@@ -32,7 +32,6 @@
* SoyFileSetNode N is SoyFileNode, for SoyFileNode N is TemplateNode, etc; for a Soy expression
* parse tree, N is usually ExprNode.
*
* @author Kai Huang
*/
public final class MixinParentNode<N extends Node> {
@@ -26,7 +26,6 @@
*
* <p> Important: Do not use outside of Soy code (treat as superpackage-private).
*
* @author Kai Huang
*/
public interface Node {
@@ -25,8 +25,7 @@
*
* @param <N> A more specific subinterface of Node, or just Node if not applicable.
* @param <R> The return type of this visitor.
*
* @author Kai Huang
*
*/
public interface NodeVisitor<N extends Node, R> {
@@ -29,7 +29,6 @@
* SoyFileSetNode N is SoyFileNode, for SoyFileNode N is TemplateNode, etc; for a Soy expression
* parse tree, N is usually ExprNode.
*
* @author Kai Huang
*/
public interface ParentNode<N extends Node> extends Node {
@@ -64,7 +63,7 @@
* the other methods in this class that are intended for modifying children. Also, if you're
* iterating over the children list as you're modifying it, then you should first make a copy of
* the children list to iterate over, in order to avoid ConcurrentModificationException.
*
*
* @return The list of children.
*/
public List<N> getChildren();
@@ -24,7 +24,6 @@
/**
* Guice module for basic Soy print directives.
*
* @author Kai Huang
*/
public class BasicDirectivesModule extends AbstractModule {
Oops, something went wrong.

0 comments on commit 17db4ae

Please sign in to comment.