Full blown projects for testkit

(Willie) #1

Is there a way that i can copy in a base project into my testkit test? meaning, i am testing a simple compiler, so in addition to the task, i need the source folders and a few sample source files copied into the test. I know i can just manually create folders and copy files into the testproject folder but i was hoping there was some kind of constructor overload where i could do something like this

    final TemporaryFolder temporaryFolder = new TemporaryFolder("resources/mytest1")

and it copies the contents of mytest1 into the temporary folder and we call it finished.

(Benjamin Muschko) #2

The short answer is that there’s currently no support for your use case in TestKit. I personally like to set up up my test fixtures as part of the test code and not as predefined files that live in the project. It simply gives me more flexibility. It should be fairly straight-forward to write a JUnit rule for it though.

(Willie) #3

Yea, thats what I will end up doing i just figured i’d ask first

(Willie) #4

I also need to figure out a way to validate the result files before destroying the temp folder. I think that will be a bigger challenge.