protected void setUp() throws Exception {
    // prepare plexus environment
    super.setUp();

    ajcMojo.project = project;
    String temp = new File(".").getAbsolutePath();
    basedir = temp.substring(0, temp.length() - 2) + "/src/test/projects/" + getProjectName() + "/";
    project.getBuild().setDirectory(basedir + "/target");
    project.getBuild().setOutputDirectory(basedir + "/target/classes");
    project.getBuild().setTestOutputDirectory(basedir + "/target/test-classes");
    project.getBuild().setSourceDirectory(basedir + "/src/main/java");
    project.getBuild().setTestSourceDirectory(basedir + "/src/test/java");
    project.addCompileSourceRoot(project.getBuild().getSourceDirectory());
    project.addTestCompileSourceRoot(project.getBuild().getTestSourceDirectory());
    ajcMojo.basedir = new File(basedir);

    setVariableValueToObject(
        ajcMojo, "outputDirectory", new File(project.getBuild().getOutputDirectory()));

    ArtifactHandler artifactHandler = new MockArtifactHandler();
    Artifact artifact = new MockArtifact("dill", "dall");
    artifact.setArtifactHandler(artifactHandler);
    project.setArtifact(artifact);
    project.setDependencyArtifacts(Collections.EMPTY_SET);
  }
  @Override
  protected void tearDown() throws Exception {
    super.tearDown();

    if (elasticsearchNode != null && !elasticsearchNode.isClosed()) {
      elasticsearchNode.stop();
    }
  }
 @AfterClass
 @Override
 public void tearDown() {
   try {
     super.tearDown();
   } catch (Exception e) {
     throw new IllegalStateException(e);
   }
 }
 /**
  * Clean up targetarea after a testcase is run. So we make shure, we don't get sideeffects between
  * testruns.
  */
 protected void tearDown() throws Exception {
   super.tearDown();
   try {
     FileUtils.deleteDirectory(project.getBuild().getDirectory());
   } catch (
       Exception
           ex) {; // Only a problem on windows. we really do not care.. if we cant delete the file
     // It is probably not there
   }
 }
  @Override
  public void setUp() throws Exception {
    super.setUp();
    URL pomPath = SpecificationDownloaderMojoTest.class.getResource("pom-downloader.xml");
    mojo = (SpecificationDownloaderMojo) lookupMojo("freeze", URIUtil.decoded(pomPath.getPath()));

    mojo.pluginDependencies = new ArrayList<Artifact>();
    mojo.pluginDependencies.add(
        new DependencyArtifact("commons-codec", dependency("commons-codec-1.3.jar")));
    mojo.pluginDependencies.add(new DependencyArtifact("xmlrpc", dependency("xmlrpc-2.0.1.jar")));
  }
Example #6
0
  protected void setUp() throws Exception {
    super.setUp();

    checkoutDir = getTestFile("target/checkout");
    FileUtils.forceDelete(checkoutDir);
    checkoutDir.mkdirs();

    projectDir = getTestFile("target/checkout/my/project");
    projectDir.mkdirs();

    goalDir = getTestFile("target/checkout/my/project/modules/1");
    goalDir.mkdirs();

    bootstrapMojo = new BootstrapMojo();
  }
  @Override
  protected void setUp() throws Exception {
    super.setUp();

    String dataPath = new File("target/test-harness/elasticsearch-data").getAbsolutePath();

    Map<ElasticsearchPort, Integer> esPorts = NetUtil.findOpenPortsForElasticsearch();
    int httpPort = esPorts.get(ElasticsearchPort.HTTP);
    int tcpPort = esPorts.get(ElasticsearchPort.TCP);

    elasticsearchNode = ElasticsearchNode.start(dataPath, httpPort, tcpPort);

    // Configure mojo with context
    File testPom = new File(getBasedir(), "src/test/resources/goals/stop/pom.xml");
    mojo = (StopElasticsearchNodeMojo) lookupMojo("stop", testPom);
    mojo.setPluginContext(new HashMap());
    mojo.getPluginContext().put("test", elasticsearchNode);
  }
Example #8
0
 /** @see org.codehaus.plexus.PlexusTestCase#tearDown() */
 @Override
 protected void tearDown() throws Exception {
   super.tearDown();
 }
Example #9
0
 /** @see org.apache.maven.plugin.testing.AbstractMojoTestCase#setUp() */
 @Override
 protected void setUp() throws Exception {
   // required for mojo lookups to work
   super.setUp();
 }
 protected void setUp() throws Exception {
   super.setUp();
   new File("./target/final.xml").delete();
 }
 /** @see junit.framework.TestCase#setUp() */
 @Override
 @Before
 protected void setUp() throws Exception {
   super.setUp();
 }
Example #12
0
  @Before
  protected void setUp() throws Exception {

    super.setUp();
    FileUtils.deleteDirectory(new File(getBasedir(), "target/site/windup"));
  }
 @Override
 @After
 public void tearDown() throws Exception {
   super.tearDown();
 }
 @Override
 @Before
 public void setUp() throws Exception {
   super.setUp();
 }