package org.bitstrings.maven.plugins.portallocator;

import org.apache.maven.plugin.testing.MojoRule;
import org.apache.maven.plugin.testing.resources.TestResources;
import org.apache.maven.project.MavenProject;
import org.junit.Before;
import org.junit.Rule;

public class AbstractPortAllocatorTest
{
    @Rule
    public MojoRule rule = new MojoRule();

    @Rule
    public TestResources resources = new TestResources();

    public MavenProject createNewMavenProject()
        throws Exception
    {
        return rule.readMavenProject( resources.getBasedir( "base" ) );
    }

    @Before
    public void setUp()
        throws Exception
    {
        // yeah I know it's f*ckn ugly
//        ( (Set<?>) FieldUtils.readStaticField(
//                PortAllocatorMojo.class,
//                "ALLOCATED_PORTS",
//                true )
//        ).clear();

        //new ServerSocketMock();
        //new PortAllocatorServiceMock();
    }
}

@@ -209,33 +209,8 @@
 ct;%0A
-import org.junit.Before;%0A
 impo
@@ -553,372 +553,7 @@
    %7D
-%0A%0A    @Before%0A    public void setUp()%0A        throws Exception%0A    %7B%0A        // yeah I know it's f*ckn ugly%0A//        ( (Set%3C?%3E) FieldUtils.readStaticField(%0A//                PortAllocatorMojo.class,%0A//                %22ALLOCATED_PORTS%22,%0A//                true )%0A//        ).clear();%0A%0A        //new ServerSocketMock();%0A        //new PortAllocatorServiceMock();%0A    %7D
 %0A%7D%0A

remove @Before - resetting mojo static fields