Note that there are some explanatory texts on larger screens.

plurals
  1. POJUnit in Ant build script attempting and failing to delete .svn directory
    primarykey
    data
    text
    <p>I'm following an example from Pragmatic Project Automation. I'm running on Windows 7 and pulling the project from a local Subversion repo. When I run <code>ant</code> in the project's base directory, I get the following error <code>[junit] couldn't delete .svn</code>. Here's the full output of the command:</p> <pre><code>Buildfile: S:\CruiseControl\builds\dms\checkout\dms\build.xml prepare: [mkdir] Created dir: S:\CruiseControl\builds\dms\checkout\dms\build\prod [mkdir] Created dir: S:\CruiseControl\builds\dms\checkout\dms\build\test compile: [javac] Compiling 5 source files to S:\CruiseControl\builds\dms\checkout\dms\build\prod compile-tests: [javac] Compiling 7 source files to S:\CruiseControl\builds\dms\checkout\dms\build\test test: [junit] Testsuite: com.pragprog.dms.DocumentTest [junit] Tests run: 2, Failures: 0, Errors: 0, Time elapsed: 0.065 sec [junit] [junit] Testsuite: com.pragprog.dms.SearchTest [junit] Tests run: 2, Failures: 0, Errors: 2, Time elapsed: 0.015 sec [junit] [junit] Testcase: testTitleSearch(com.pragprog.dms.SearchTest): Caused an ERROR [junit] couldn't delete .svn [junit] java.io.IOException: couldn't delete .svn [junit] at org.apache.lucene.store.FSDirectory.create(FSDirectory.java:166) [junit] at org.apache.lucene.store.FSDirectory.&lt;init&gt;(FSDirectory.java:151) [junit] at org.apache.lucene.store.FSDirectory.getDirectory(FSDirectory.java:132) [junit] at org.apache.lucene.index.IndexWriter.&lt;init&gt;(IndexWriter.java:160) [junit] at com.pragprog.dms.Indexer.index(Unknown Source) [junit] at com.pragprog.dms.SearchTest.setUp(Unknown Source) [junit] [junit] [junit] Testcase: testContentSearch(com.pragprog.dms.SearchTest): Caused an ERROR [junit] couldn't delete .svn [junit] java.io.IOException: couldn't delete .svn [junit] at org.apache.lucene.store.FSDirectory.create(FSDirectory.java:166) [junit] at org.apache.lucene.store.FSDirectory.&lt;init&gt;(FSDirectory.java:151) [junit] at org.apache.lucene.store.FSDirectory.getDirectory(FSDirectory.java:132) [junit] at org.apache.lucene.index.IndexWriter.&lt;init&gt;(IndexWriter.java:160) [junit] at com.pragprog.dms.Indexer.index(Unknown Source) [junit] at com.pragprog.dms.SearchTest.setUp(Unknown Source) [junit] [junit] BUILD FAILED S:\CruiseControl\builds\dms\checkout\dms\build.xml:33: Test com.pragprog.dms.SearchTest failed Total time: 0 seconds </code></pre> <p>and the build.xml file:</p> <pre><code>&lt;project name="dms" default="compile" basedir="."&gt; &lt;property name="build.dir" location="build" /&gt; &lt;property name="build.prod.dir" location="${build.dir}/prod" /&gt; &lt;property name="build.test.dir" location="${build.dir}/test" /&gt; &lt;property name="doc.dir" location="doc" /&gt; &lt;property name="index.dir" location="index" /&gt; &lt;property name="src.dir" location="src" /&gt; &lt;property name="test.dir" location="test" /&gt; &lt;property name="vendor.lib.dir" location="vendor/lib" /&gt; &lt;path id="project.classpath"&gt; &lt;pathelement location="${build.prod.dir}" /&gt; &lt;pathelement location="${build.test.dir}" /&gt; &lt;fileset dir="${vendor.lib.dir}"&gt; &lt;include name="*.jar" /&gt; &lt;/fileset&gt; &lt;/path&gt; &lt;target name="prepare"&gt; &lt;mkdir dir="${build.prod.dir}" /&gt; &lt;mkdir dir="${build.test.dir}" /&gt; &lt;/target&gt; &lt;target name="compile" depends="prepare"&gt; &lt;javac srcdir="${src.dir}" destdir="${build.prod.dir}" includeantruntime="false"&gt; &lt;classpath refid="project.classpath" /&gt; &lt;/javac&gt; &lt;/target&gt; &lt;target name="compile-tests" depends="compile"&gt; &lt;javac srcdir="${test.dir}" destdir="${build.test.dir}" includeantruntime="false"&gt; &lt;classpath refid="project.classpath" /&gt; &lt;compilerarg value="-Xlint:unchecked" /&gt; &lt;/javac&gt; &lt;/target&gt; &lt;target name="test" depends="compile-tests"&gt; &lt;junit haltonfailure="true"&gt; &lt;classpath refid="project.classpath" /&gt; &lt;formatter type="brief" usefile="false" /&gt; &lt;batchtest&gt; &lt;fileset dir="${build.test.dir}" includes="**/*Test.class" /&gt; &lt;/batchtest&gt; &lt;sysproperty key="doc.dir" value="${doc.dir}" /&gt; &lt;sysproperty key="index.dir" value="${index.dir}" /&gt; &lt;/junit&gt; &lt;/target&gt; &lt;target name="clean"&gt; &lt;delete dir="${build.dir}" /&gt; &lt;/target&gt; &lt;/project&gt; </code></pre> <p>Why is JUnit attempting to delete a .svn directory? Which one is it even trying to delete? Why is it failing to do so?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload