Revision: 6619 Author: sco...@google.com Date: Tue Nov 3 13:04:24 2009 Log: Add support for checkstyle of tests; checkstyle user/tests; fix existing errors.
Review by: rice (desk) http://code.google.com/p/google-web-toolkit/source/detail?r=6619 Modified: /trunk/common.ant.xml /trunk/user/build.xml /trunk/user/test/com/google/gwt/uibinder/test/client/UiBinderTest.java /trunk/user/test/com/google/gwt/user/client/rpc/TestSetValidator.java ======================================= --- /trunk/common.ant.xml Mon Oct 19 10:28:15 2009 +++ /trunk/common.ant.xml Tue Nov 3 13:04:24 2009 @@ -308,11 +308,26 @@ <taskdef resource="checkstyletask.properties" classpath="${gwt.tools.antlib}/checkstyle-all-4.2.jar;${gwt.build.lib}/gwt-customchecks.jar" /> <mkdir dir="@{outputdirectory}"/> <checkstyle config="${gwt.root}/eclipse/settings/code-style/gwt-checkstyle.xml" maxErrors="0" failOnViolation="false" failureProperty="gwt.checkstyle.failed"> - <formatter type="xml" toFile="@{outputdirectory}/checkstyle_log.xml"/> + <formatter type="xml" toFile="@{outputdirectory}/checkstyle_log.xml"/> <property key="checkstyle.header.file" file="${gwt.root}/eclipse/settings/code-style/google.header" /> <sourcepath /> </checkstyle> - <fail message="Checkstyle errors exist, and are reported in checkstyle_log.xml located at @{outputdirectory}" if="gwt.checkstyle.failed" /> + <fail message="Checkstyle errors exist, and are reported at @{outputdirectory}/checkstyle_log.xml" if="gwt.checkstyle.failed" /> + </sequential> + </macrodef> + + <macrodef name="gwt.checkstyle.tests"> + <attribute name="outputdirectory" default="${project.build}"/> + <element name="sourcepath" implicit="yes" optional="true" /> + <sequential> + <taskdef resource="checkstyletask.properties" classpath="${gwt.tools.antlib}/checkstyle-all-4.2.jar;${gwt.build.lib}/gwt-customchecks.jar" /> + <mkdir dir="@{outputdirectory}"/> + <checkstyle config="${gwt.root}/eclipse/settings/code-style/gwt-checkstyle-tests.xml" maxErrors="0" failOnViolation="false" failureProperty="gwt.checkstyle-tests.failed"> + <formatter type="xml" toFile="@{outputdirectory}/checkstyle_tests_log.xml"/> + <property key="checkstyle.header.file" file="${gwt.root}/eclipse/settings/code-style/google.header" /> + <sourcepath /> + </checkstyle> + <fail message="Checkstyle errors exist in tests, and are reported at @{outputdirectory}/checkstyle_tests_log.xml" if="gwt.checkstyle-tests.failed" /> </sequential> </macrodef> ======================================= --- /trunk/user/build.xml Mon Nov 2 08:50:07 2009 +++ /trunk/user/build.xml Tue Nov 3 13:04:24 2009 @@ -142,6 +142,12 @@ <fileset dir="super/com/google/gwt/emul" /> <fileset dir="super/com/google/gwt/junit/translatable" /> </gwt.checkstyle> + <gwt.checkstyle.tests> + <fileset dir="test"> + <filename name="com/google/**" /> + <filename name="test/**" /> + </fileset> + </gwt.checkstyle.tests> </target> <target name="test.remoteweb" depends="test.web.remote"> ======================================= --- /trunk/user/test/com/google/gwt/uibinder/test/client/UiBinderTest.java Mon Nov 2 20:08:34 2009 +++ /trunk/user/test/com/google/gwt/uibinder/test/client/UiBinderTest.java Tue Nov 3 13:04:24 2009 @@ -243,7 +243,7 @@ } interface Bundle extends ClientBundle { - @Source( {"WidgetBasedUi.css", "Menu.css"}) + @Source(value = {"WidgetBasedUi.css", "Menu.css"}) @NotStrict WidgetBasedUi.Style style(); } ======================================= --- /trunk/user/test/com/google/gwt/user/client/rpc/TestSetValidator.java Tue Nov 3 08:52:16 2009 +++ /trunk/user/test/com/google/gwt/user/client/rpc/TestSetValidator.java Tue Nov 3 13:04:24 2009 @@ -15,11 +15,6 @@ */ package com.google.gwt.user.client.rpc; -import static junit.framework.Assert.assertEquals; -import static junit.framework.Assert.assertFalse; -import static junit.framework.Assert.assertNotNull; -import static junit.framework.Assert.assertSame; - import com.google.gwt.user.client.rpc.TestSetFactory.MarkerTypeTreeMap; import com.google.gwt.user.client.rpc.TestSetFactory.MarkerTypeTreeSet; import com.google.gwt.user.client.rpc.TestSetFactory.SerializableDoublyLinkedNode; @@ -27,6 +22,11 @@ import com.google.gwt.user.client.rpc.TestSetFactory.SerializablePrivateNoArg; import com.google.gwt.user.client.rpc.TestSetFactory.SerializableWithTwoArrays; +import static junit.framework.Assert.assertEquals; +import static junit.framework.Assert.assertFalse; +import static junit.framework.Assert.assertNotNull; +import static junit.framework.Assert.assertSame; + import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; --~--~---------~--~----~------------~-------~--~----~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~----------~----~----~----~------~----~------~--~---