Index: lucene/tools/build.xml
===================================================================
--- lucene/tools/build.xml	(revision 1523006)
+++ lucene/tools/build.xml	(working copy)
@@ -28,6 +28,19 @@
 
   <path id="classpath">
   </path>
+  
+  <path id="test.classpath">
+    <pathelement location="${build.dir}/classes/java"/>
+    <pathelement location="${build.dir}/classes/test"/>
+    <pathelement location="${common.dir}/build/test-framework/classes/java"/>
+    <path refid="junit-path"/>
+    <fileset dir="${common.dir}/test-framework/lib">
+      <include name="*.jar"/>
+      <exclude name="junit*.jar" />
+    </fileset>
+  </path>
+  
+  <path id="junit.classpath" refid="test.classpath"/>
 
   <!--  
       Specialize compile-core to not depend on clover, to exclude a 
Index: lucene/tools/src/test/org/apache/lucene/validation/TestLicenseCheckTask.java
===================================================================
--- lucene/tools/src/test/org/apache/lucene/validation/TestLicenseCheckTask.java	(revision 0)
+++ lucene/tools/src/test/org/apache/lucene/validation/TestLicenseCheckTask.java	(revision 0)
@@ -0,0 +1,98 @@
+package org.apache.lucene.validation;
+
+import java.io.File;
+
+import junit.framework.TestCase;
+
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.Project;
+import org.apache.tools.ant.types.FileSet;
+import org.apache.tools.ant.types.Mapper;
+import org.apache.tools.ant.util.FileNameMapper;
+import org.apache.tools.ant.util.IdentityMapper;
+import org.junit.Test;
+
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ */
+
+public class TestLicenseCheckTask extends TestCase {
+
+  private static final String RESOURCES_DIR;  
+  static {
+    if (new File("../../../../tools/src/resources").exists()) {
+      RESOURCES_DIR = "../../../../tools/src/resources";
+    } else {
+      RESOURCES_DIR = "lucene/tools/src/resources";
+    }
+  }
+  
+  private Project p = new Project();
+  
+  @Test
+  public void testLicenseCheckTask() {
+
+    
+    testShouldFail("licenses1");
+    testShouldPass("licenses2");
+  }
+
+  private void testShouldFail(String licenseDir) {
+    LicenseCheckTask lct = getLct();
+    lct.setLicenseDirectory(new File(RESOURCES_DIR, licenseDir));
+    FileSet fileSet = getFileSet(lct);
+    fileSet.setDir(new File(RESOURCES_DIR, licenseDir));
+    try {
+      lct.execute();
+      fail("This should fail, there is only a test.jar");
+    } catch (BuildException e) {
+      
+    }
+  }
+  
+  private FileSet getFileSet(LicenseCheckTask lct) {
+    FileSet fileSet = new FileSet();
+    fileSet.setProject(p);
+    fileSet.setCaseSensitive(false);
+    fileSet.setIncludes("**/*.jar");
+    fileSet.setExcludes("");
+    lct.add(fileSet);
+    return fileSet;
+  }
+
+  private void testShouldPass(String licenseDir) {
+    LicenseCheckTask lct = getLct();
+    lct.setLicenseDirectory(new File(RESOURCES_DIR, licenseDir));
+    FileSet fileSet = getFileSet(lct);
+    fileSet.setDir(new File(RESOURCES_DIR, licenseDir));
+    lct.execute();
+  }
+  
+  public LicenseCheckTask getLct() {
+    LicenseCheckTask lct = new LicenseCheckTask();
+ 
+    p.setName("LicenseChecker");
+
+    Mapper mapper = new Mapper(p);
+
+    mapper.add(new IdentityMapper() );
+    lct.addConfiguredLicenseMapper(mapper);
+
+    lct.setVerbose(true);
+    return lct;
+  }
+}
Index: lucene/tools/src/resources/licenses2/test.jar-LICENSE-ASL.txt
===================================================================
Index: lucene/tools/src/resources/licenses2/test.jar-NOTICE.txt
===================================================================
Index: lucene/tools/src/resources/licenses2/test.jar.sha1
===================================================================
--- lucene/tools/src/resources/licenses2/test.jar.sha1	(revision 0)
+++ lucene/tools/src/resources/licenses2/test.jar.sha1	(revision 0)
@@ -0,0 +1 @@
+da39a3ee5e6b4b0d3255bfef95601890afd80709
\ No newline at end of file
Index: build.xml
===================================================================
--- build.xml	(revision 1523006)
+++ build.xml	(working copy)
@@ -205,7 +205,7 @@
     </copy>
     
     <pathconvert property="eclipse.fileset.sourcefolders" pathsep="|" dirsep="/">
-      <dirset dir="${basedir}/lucene" includes="**/src/java, **/src/resources, **/src/test, **/src/test-files, **/src/examples" excludes="tools/**, build/**, backwards/**" />
+      <dirset dir="${basedir}/lucene" includes="**/src/java, **/src/resources, **/src/test, **/src/test-files, **/src/examples" excludes="build/**, backwards/**" />
       <dirset dir="${basedir}/solr" includes="**/src/java, **/src/resources, **/src/test, **/src/test-files, **/src/examples" excludes="build/**" />
       <map from="${basedir}/" to=""/>
     </pathconvert>
