@@ -0,0 +1,1079 @@
+package hudson.model;%0A%0Aimport hudson.tasks.Shell;%0Aimport org.jvnet.hudson.test.HudsonTestCase;%0Aimport com.meterware.httpunit.WebResponse;%0A%0A/**%0A * @author Kohsuke Kawaguchi%0A */%0Apublic class AbstractProjectTest extends HudsonTestCase %7B%0A    public AbstractProjectTest(String name) %7B%0A        super(name);%0A    %7D%0A%0A    /**%0A     * Tests the workspace deletion.%0A     */%0A    public void testWipeWorkspace() throws Exception %7B%0A        FreeStyleProject project = createFreeStyleProject();%0A        project.getBuildersList().add(new Shell(%22echo hello%22));%0A%0A        project.scheduleBuild2(0).get();%0A%0A        assertTrue(%22Workspace should exist by now%22,%0A                project.getWorkspace().exists());%0A%0A        // emulate the user behavior%0A        WebResponse rsp = new WebConversation().getResponse(project);%0A        rsp = rsp.getLinkWith(%22Workspace%22).click();%0A        rsp = rsp.getLinkWith(%22Wipe Out Workspace%22).click();%0A        rsp = rsp.getFormWithID(%22confirmation%22).submit();%0A%0A        assertFalse(%22Workspace should be gone by now%22,%0A                project.getWorkspace().exists());%0A    %7D%0A%7D%0A

test case for the "wipe out the workspace" feature