nomuda / jackbox

BlackBoxRecorder port
http://follesoe.github.com/BlackBoxRecorder/
14 stars 6 forks source link

Easy way to record from an existing integration test #17

Open mkotsbak opened 14 years ago

mkotsbak commented 14 years ago

How to practically start an existing maven test target and capture the result to JSON file.

mkotsbak commented 14 years ago

Maybe a maven plugin needs to be written?

ebaxt commented 14 years ago

I was thinking the same thing, maybe something that binds to integration-test phase like the failsafe-plugin?

mkotsbak commented 14 years ago

The important thing is to get it run with something like:

javaagent:${user.home}/.m2/repository/org/aspectj/aspectjweaver/${aspectj.version}/aspectjweaver-${aspectj.version}.jar

and with the annotations in the classpath (easily fixed by dependency).

It should not run every time, just when you want to recorder it, so it should not bind to some usual phase, but more selected to run manually (like eclipse:eclipse).

mkotsbak commented 14 years ago

Well, that could be run like we do in the test of jackbox:

        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
                <argLine>-javaagent:${user.home}/.m2/repository/org/aspectj/aspectjweaver/${aspectj.version}/aspectjweaver-${aspectj.version}.jar</argLine>
            </configuration>
        </plugin>

just that we dont want to run it all the times. Is it possible to wrap it into another goal/phase?

And to be any useful, wee need to let jackbox save collected data to files, and thus some way to find where to put them (current directory until configuration system is in place?)

For the replay part, we want to run it each time against one data file, or run generated tests: http://github.com/oc/jackbox/issues#issue/12

mkotsbak commented 14 years ago

Just for testing, the easiest is maybe to launch one of the JUnit clients from the command line, adding the above argLine, the jackbox jar and the code under test to classpath.