Re: [JGIT PATCH v3 23/23] Added the test class AddCommandIterationTest.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> diff --git a/org.spearce.jgit.test/tst/org/spearce/jgit/treewalk/rules/AddCommandIterationTest.java b/org.spearce.jgit.test/tst/org/spearce/jgit/treewalk/rules/AddCommandIterationTest.java
> +	@Override
> +	protected void setUp() throws Exception {
> +		final File projectDirectory = File.createTempFile("test", "");
> +		projectDirectory.delete();
> +		projectDirectory.mkdir();
> +		projectDirectory.deleteOnExit();
> +		this.workTree = Repository.createWorkTree(projectDirectory);
> +		this.factory = new AddRulesFactory();
> +	}

I've had some problems with this pattern, especially on Windows. We need
some support class, like the RepositoryTestCase to handle the not so nice
parts of getting tests to run, rerun and cleam up after themselves. Eclipse
sometims adds an extra twist becuase File may be lefte open between test
runs, which is the reason RepositoryTestCase uses a new directories every time.

Does this work at all? delete() requires directories to be empty in order to delete.

-- robin
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux