Revision: 6471
Author: [email protected]
Date: Mon Oct 26 16:09:24 2009
Log: Merging tr...@6462:6464 trunk.
- Adds basic test case for SOYC.

svn merge --ignore-ancestry -r6462:6464  
https://google-web-toolkit.googlecode.com/svn/trunk .


http://code.google.com/p/google-web-toolkit/source/detail?r=6471

Added:
  /releases/2.0/dev/core/test/com/google/gwt/dev/SoycTest.java
Modified:
  /releases/2.0/branch-info.txt
  /releases/2.0/dev/build.xml

=======================================
--- /dev/null
+++ /releases/2.0/dev/core/test/com/google/gwt/dev/SoycTest.java        Mon Oct 
26  
16:09:24 2009
@@ -0,0 +1,52 @@
+/*
+ * Copyright 2009 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may  
not
+ * use this file except in compliance with the License. You may obtain a  
copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,  
WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations  
under
+ * the License.
+ */
+package com.google.gwt.dev;
+
+import com.google.gwt.core.ext.UnableToCompleteException;
+import com.google.gwt.dev.Compiler.CompilerOptionsImpl;
+import com.google.gwt.dev.util.Util;
+import com.google.gwt.dev.util.log.PrintWriterTreeLogger;
+import com.google.gwt.util.tools.Utility;
+
+import junit.framework.TestCase;
+
+import java.io.File;
+import java.io.IOException;
+
+/**
+ * Test for {...@link Compiler} with option -soyc.
+ */
+public class SoycTest extends TestCase {
+
+  private final CompilerOptionsImpl options = new CompilerOptionsImpl();
+
+  public void testSoyc() throws UnableToCompleteException, IOException {
+    options.setSoycEnabled(true);
+    options.addModuleName("com.google.gwt.sample.hello.Hello");
+    options.setWarDir(Utility.makeTemporaryDirectory(null, "hellowar"));
+    PrintWriterTreeLogger logger = new PrintWriterTreeLogger();
+    new Compiler(options).run(logger);
+
+    // make sure the files have been produced
+    assertTrue(new File(options.getWarDir()  
+ "/hello/compile-report/index.html").exists());
+    assertTrue(new File(options.getWarDir()  
+ "/hello/compile-report/SoycDashboard-0-index.html").exists());
+    assertTrue(new File(options.getWarDir()  
+ "/hello/compile-report/total-0-overallBreakdown.html").exists());
+    assertTrue(new File(options.getWarDir()  
+ "/hello/compile-report/soycStyling.css").exists());
+
+    assertFalse(new File(options.getWarDir()  
+ "/hello/compile-report/index2.html").exists());
+    Util.recursiveDelete(options.getWarDir(), false);
+  }
+}
=======================================
--- /releases/2.0/branch-info.txt       Sat Oct 24 08:11:35 2009
+++ /releases/2.0/branch-info.txt       Mon Oct 26 16:09:24 2009
@@ -33,3 +33,7 @@
    Disables a couple of tests in HtmlUnit
      svn merge --ignore-ancestry -r6455:6459  
https://google-web-toolkit.googlecode.com/svn/trunk .

+tr...@6462:6464 was merged into this branch
+  Adds basic test case for SOYC.
+    svn merge --ignore-ancestry -r6462:6464  
https://google-web-toolkit.googlecode.com/svn/trunk .
+
=======================================
--- /releases/2.0/dev/build.xml Tue Oct 20 22:13:21 2009
+++ /releases/2.0/dev/build.xml Mon Oct 26 16:09:24 2009
@@ -6,7 +6,8 @@

    <property name="alldeps.jar" location="${project.build}/alldeps.jar" />
    <property name="gwt.junit.testcase.dev.core.includes"  
value="**/com/google/**/*Test.class" />
-  <property name="gwt.junit.testcase.dev.core.excludes" value="" />
+  <!-- BrowserManagerTest is brought in from user and is not instantiable.  
-->
+  <property name="gwt.junit.testcase.dev.core.excludes"  
value="**/BrowserManagerTest.class" />

    <target name="clean" description="Cleans this project's intermediate and  
output files">
      <delete dir="${project.build}" failonerror="false" />
@@ -16,7 +17,7 @@
      </delete>
    </target>

-  <target name="compile.tests" depends="build, compile.emma.if.enabled"  
description="Compiles the test code for this project">
+  <target name="compile.tests" depends="build, compile.emma.if.enabled,  
build.alldeps.jar" description="Compiles the test code for this project">
      <mkdir dir="${javac.junit.out}" />
      <gwt.javac srcdir="" destdir="${javac.junit.out}">
        <src path="core/src" />
@@ -27,6 +28,20 @@
          <pathelement location="${gwt.tools.lib}/junit/junit-3.8.1.jar" />
        </classpath>
      </gwt.javac>
+    <gwt.javac srcdir="${gwt.root}/user/src" destdir="${javac.junit.out}">
+      <classpath>
+        <pathelement location="${javac.out}" />
+        <pathelement  
location="${gwt.tools.lib}/tomcat/servlet-api-2.5.jar" />
+        <pathelement location="${gwt.tools.lib}/junit/junit-3.8.1.jar" />
+        <pathelement  
location="${gwt.tools.lib}/jfreechart/jfreechart-1.0.3.jar" />
+        <pathelement  
location="${gwt.tools.lib}/selenium/selenium-java-client-driver.jar" />
+        <pathelement location="${gwt.tools.lib}/w3c/sac/sac-1.3.jar" />
+        <pathelement location="${gwt.tools.lib}/w3c/flute/flute-1.3.jar" />
+        <pathelement  
location="${gwt.build.lib}/gwt-dev-${build.host.platform}.jar" />
+        <pathelement location="${alldeps.jar}" />
+      </classpath>
+    </gwt.javac>
+
    </target>

    <target name="build.alldeps.jar" description="Merges all dependency jars  
into a single jar">
@@ -153,7 +168,7 @@
      <touch file="${filter.sentinel}" />
    </target>

-  <target name="compiler.standalone" description="Validates that the  
standalone gwt-compiler project can build.">
+  <target name="compiler.standalone" depends="build.alldeps.jar"  
description="Validates that the standalone gwt-compiler project can build.">
      <mkdir dir="${javac.out}" />
      <gwt.javac srcdir="core/super"  
excludes="com/google/gwt/dev/jjs/intrinsic/"/>
      <gwt.javac srcdir="core/src">
@@ -238,6 +253,8 @@
          <!-- Pull in gwt-dev and gwt-user sources for .gwt.xml files -->
          <pathelement location="${gwt.root}/user/src/" />
          <pathelement location="${gwt.root}/user/super/" />
+        <!-- CompilerTest compiles the hello sample. -->
+        <pathelement location="${gwt.root}/samples/hello/src/" />
        </extraclasspaths>
      </gwt.junit>
    </target>

--~--~---------~--~----~------------~-------~--~----~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~----------~----~----~----~------~----~------~--~---

Reply via email to