RE: Creating a FreeStyleProject outside JUnit?

2013-01-18 Thread jserup
My first approach was to simply: public class JenkinsApiTest { public void test() { ItemGroup itemGroup = new MyItemGroup(); FreeStyleProject p = new FreeStyleProject(itemGroup, "n0"); p.getConfigFile().asString(); } this results in the AbstractProject constructor being called:

RE: Creating a FreeStyleProject outside JUnit?

2013-01-16 Thread Dean Yu
nsci-users@googlegroups.com [jenkinsci-users@googlegroups.com] on behalf of jserup [johs.se...@gmail.com] Sent: Wednesday, January 16, 2013 3:43 AM To: jenkinsci-users@googlegroups.com Subject: Re: Creating a FreeStyleProject outside JUnit? Ok makes sense but is possible to create eg. a FreeSt

Re: Creating a FreeStyleProject outside JUnit?

2013-01-16 Thread jserup
Ok makes sense but is possible to create eg. a FreeStyleProject /outside/ a Junit TestRunner. Seems a bit strange that this can only be done through a TestRunner. -- View this message in context: http://jenkins.361315.n4.nabble.com/Creating-a-FreeStyleProject-outside-JUnit-tp4651594p4651665.htm

Re: Creating a FreeStyleProject outside JUnit?

2013-01-15 Thread Dean Yu
IIRC, you need to use a Junit TestRunner to run the test, so that Junit's test lifecycle is followed. -- Dean On 1/15/13 11:22 AM, "jserup" wrote: >I am creating a FreeStyleProject using this test class: > >import org.jvnet.hudson.test.HudsonTestCase; >import org.apache.commons.io.FileUtils;