mirror of https://github.com/apache/maven.git
clean up old tests
git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@163623 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
8e9ec9c892
commit
5a296f03c8
|
@ -1,70 +0,0 @@
|
||||||
package org.apache.maven.plugin;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Copyright 2001-2004 The Apache Software Foundation.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
|
|
||||||
*
|
|
||||||
* @version $Id$
|
|
||||||
*/
|
|
||||||
public class AbstractTestPlugin
|
|
||||||
{
|
|
||||||
protected boolean executed;
|
|
||||||
|
|
||||||
protected String name;
|
|
||||||
|
|
||||||
protected String artifactId;
|
|
||||||
|
|
||||||
protected String foo;
|
|
||||||
|
|
||||||
public boolean hasExecuted()
|
|
||||||
{
|
|
||||||
return executed;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getName()
|
|
||||||
{
|
|
||||||
return name;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getArtifactId()
|
|
||||||
{
|
|
||||||
return artifactId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getFoo()
|
|
||||||
{
|
|
||||||
return foo;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setName( String name )
|
|
||||||
{
|
|
||||||
this.name = name;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setArtifactId( String artifactId )
|
|
||||||
{
|
|
||||||
this.artifactId = artifactId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setFoo( String foo )
|
|
||||||
{
|
|
||||||
this.foo = foo;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,44 +0,0 @@
|
||||||
package org.apache.maven.plugin;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Copyright 2001-2005 The Apache Software Foundation.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import org.apache.maven.monitor.logging.Log;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author jdcasey
|
|
||||||
*/
|
|
||||||
public class GoalDecorationAndResolutionTestPlugin implements Plugin
|
|
||||||
{
|
|
||||||
|
|
||||||
private boolean executed = false;
|
|
||||||
|
|
||||||
private Log log;
|
|
||||||
|
|
||||||
public void execute(PluginExecutionRequest request) throws PluginExecutionException {
|
|
||||||
this.executed = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setLog( Log log )
|
|
||||||
{
|
|
||||||
this.log = log;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean executed() {
|
|
||||||
return executed;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,50 +0,0 @@
|
||||||
package org.apache.maven.plugin;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Copyright 2001-2004 The Apache Software Foundation.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import org.apache.maven.monitor.logging.Log;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
|
|
||||||
*
|
|
||||||
* @version $Id$
|
|
||||||
*/
|
|
||||||
public class IntegratedPlugin
|
|
||||||
extends AbstractTestPlugin
|
|
||||||
implements Plugin
|
|
||||||
{
|
|
||||||
private Log log;
|
|
||||||
|
|
||||||
public void execute( PluginExecutionRequest request )
|
|
||||||
throws PluginExecutionException
|
|
||||||
{
|
|
||||||
name = (String) request.getParameter( "name" );
|
|
||||||
|
|
||||||
artifactId = (String) request.getParameter( "artifactId" );
|
|
||||||
|
|
||||||
foo = (String) request.getParameter( "foo" );
|
|
||||||
|
|
||||||
executed = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setLog( Log log )
|
|
||||||
{
|
|
||||||
this.log = log;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,118 +0,0 @@
|
||||||
<plugin>
|
|
||||||
<id>resolveTest</id>
|
|
||||||
<mojos>
|
|
||||||
<!-- Test main with preGoal and postGoal -->
|
|
||||||
<mojo>
|
|
||||||
<id>resolveTest:t1-preGoal</id>
|
|
||||||
<implementation>org.apache.maven.plugin.GoalDecorationAndResolutionTestPlugin</implementation>
|
|
||||||
<instantiationStrategy>singleton</instantiationStrategy>
|
|
||||||
</mojo>
|
|
||||||
<mojo>
|
|
||||||
<id>resolveTest:t1-main</id>
|
|
||||||
<implementation>org.apache.maven.plugin.GoalDecorationAndResolutionTestPlugin</implementation>
|
|
||||||
<instantiationStrategy>singleton</instantiationStrategy>
|
|
||||||
</mojo>
|
|
||||||
<mojo>
|
|
||||||
<id>resolveTest:t1-postGoal</id>
|
|
||||||
<implementation>org.apache.maven.plugin.GoalDecorationAndResolutionTestPlugin</implementation>
|
|
||||||
<instantiationStrategy>singleton</instantiationStrategy>
|
|
||||||
</mojo>
|
|
||||||
<!-- End of test -->
|
|
||||||
|
|
||||||
<!-- Test main with prereq -->
|
|
||||||
<mojo>
|
|
||||||
<id>resolveTest:t2-prereq</id>
|
|
||||||
<implementation>org.apache.maven.plugin.GoalDecorationAndResolutionTestPlugin</implementation>
|
|
||||||
<instantiationStrategy>singleton</instantiationStrategy>
|
|
||||||
</mojo>
|
|
||||||
<mojo>
|
|
||||||
<id>resolveTest:t2-main</id>
|
|
||||||
<implementation>org.apache.maven.plugin.GoalDecorationAndResolutionTestPlugin</implementation>
|
|
||||||
<instantiationStrategy>singleton</instantiationStrategy>
|
|
||||||
<prereqs>
|
|
||||||
<prereq>resolveTest:t2-prereq</prereq>
|
|
||||||
</prereqs>
|
|
||||||
</mojo>
|
|
||||||
<!-- End of test -->
|
|
||||||
|
|
||||||
<!-- Test main with prereq, preGoal and postGoal -->
|
|
||||||
<mojo>
|
|
||||||
<id>resolveTest:t3-preGoal</id>
|
|
||||||
<implementation>org.apache.maven.plugin.GoalDecorationAndResolutionTestPlugin</implementation>
|
|
||||||
<instantiationStrategy>singleton</instantiationStrategy>
|
|
||||||
</mojo>
|
|
||||||
<mojo>
|
|
||||||
<id>resolveTest:t3-prereq</id>
|
|
||||||
<implementation>org.apache.maven.plugin.GoalDecorationAndResolutionTestPlugin</implementation>
|
|
||||||
<instantiationStrategy>singleton</instantiationStrategy>
|
|
||||||
</mojo>
|
|
||||||
<mojo>
|
|
||||||
<id>resolveTest:t3-main</id>
|
|
||||||
<implementation>org.apache.maven.plugin.GoalDecorationAndResolutionTestPlugin</implementation>
|
|
||||||
<instantiationStrategy>singleton</instantiationStrategy>
|
|
||||||
<prereqs>
|
|
||||||
<prereq>resolveTest:t3-prereq</prereq>
|
|
||||||
</prereqs>
|
|
||||||
</mojo>
|
|
||||||
<mojo>
|
|
||||||
<id>resolveTest:t3-postGoal</id>
|
|
||||||
<implementation>org.apache.maven.plugin.GoalDecorationAndResolutionTestPlugin</implementation>
|
|
||||||
<instantiationStrategy>singleton</instantiationStrategy>
|
|
||||||
</mojo>
|
|
||||||
<!-- End of test -->
|
|
||||||
|
|
||||||
<!-- Test main with prereq which has preGoal and postGoal -->
|
|
||||||
<mojo>
|
|
||||||
<id>resolveTest:t4-prereq-preGoal</id>
|
|
||||||
<implementation>org.apache.maven.plugin.GoalDecorationAndResolutionTestPlugin</implementation>
|
|
||||||
<instantiationStrategy>singleton</instantiationStrategy>
|
|
||||||
</mojo>
|
|
||||||
<mojo>
|
|
||||||
<id>resolveTest:t4-prereq</id>
|
|
||||||
<implementation>org.apache.maven.plugin.GoalDecorationAndResolutionTestPlugin</implementation>
|
|
||||||
<instantiationStrategy>singleton</instantiationStrategy>
|
|
||||||
</mojo>
|
|
||||||
<mojo>
|
|
||||||
<id>resolveTest:t4-main</id>
|
|
||||||
<implementation>org.apache.maven.plugin.GoalDecorationAndResolutionTestPlugin</implementation>
|
|
||||||
<instantiationStrategy>singleton</instantiationStrategy>
|
|
||||||
<prereqs>
|
|
||||||
<prereq>resolveTest:t4-prereq</prereq>
|
|
||||||
</prereqs>
|
|
||||||
</mojo>
|
|
||||||
<mojo>
|
|
||||||
<id>resolveTest:t4-prereq-postGoal</id>
|
|
||||||
<implementation>org.apache.maven.plugin.GoalDecorationAndResolutionTestPlugin</implementation>
|
|
||||||
<instantiationStrategy>singleton</instantiationStrategy>
|
|
||||||
</mojo>
|
|
||||||
<!-- End of test -->
|
|
||||||
|
|
||||||
|
|
||||||
<!-- Test main with prereq and preGoal which has the same prereq -->
|
|
||||||
<mojo>
|
|
||||||
<id>resolveTest:t5-prereq</id>
|
|
||||||
<implementation>org.apache.maven.plugin.GoalDecorationAndResolutionTestPlugin</implementation>
|
|
||||||
<instantiationStrategy>singleton</instantiationStrategy>
|
|
||||||
</mojo>
|
|
||||||
<mojo>
|
|
||||||
<id>resolveTest:t5-preGoal</id>
|
|
||||||
<implementation>org.apache.maven.plugin.GoalDecorationAndResolutionTestPlugin</implementation>
|
|
||||||
<instantiationStrategy>singleton</instantiationStrategy>
|
|
||||||
<prereqs>
|
|
||||||
<prereq>resolveTest:t5-prereq</prereq>
|
|
||||||
</prereqs>
|
|
||||||
</mojo>
|
|
||||||
<mojo>
|
|
||||||
<id>resolveTest:t5-main</id>
|
|
||||||
<implementation>org.apache.maven.plugin.GoalDecorationAndResolutionTestPlugin</implementation>
|
|
||||||
<instantiationStrategy>singleton</instantiationStrategy>
|
|
||||||
<prereqs>
|
|
||||||
<prereq>resolveTest:t5-prereq</prereq>
|
|
||||||
</prereqs>
|
|
||||||
</mojo>
|
|
||||||
<!-- End of test -->
|
|
||||||
|
|
||||||
|
|
||||||
</mojos>
|
|
||||||
<dependencies/>
|
|
||||||
</plugin>
|
|
|
@ -1,29 +0,0 @@
|
||||||
<plugin>
|
|
||||||
<mojos>
|
|
||||||
<mojo>
|
|
||||||
<id>integrated-plugin</id>
|
|
||||||
<implementation>org.apache.maven.plugin.IntegratedPlugin</implementation>
|
|
||||||
<instantiationStrategy>singleton</instantiationStrategy>
|
|
||||||
<mode>integrated</mode>
|
|
||||||
<goals>
|
|
||||||
<goal>
|
|
||||||
<name>integrated-execute</name>
|
|
||||||
<parameters>
|
|
||||||
<parameter>
|
|
||||||
<name>name</name>
|
|
||||||
<expression>#project.name</expression>
|
|
||||||
</parameter>
|
|
||||||
<parameter>
|
|
||||||
<name>artifactId</name>
|
|
||||||
<expression>#project.artifactId</expression>
|
|
||||||
</parameter>
|
|
||||||
<parameter>
|
|
||||||
<name>foo</name>
|
|
||||||
<expression>#foo</expression>
|
|
||||||
</parameter>
|
|
||||||
</parameters>
|
|
||||||
</goal>
|
|
||||||
</goals>
|
|
||||||
</mojo>
|
|
||||||
</mojos>
|
|
||||||
</plugin>
|
|
|
@ -1,77 +0,0 @@
|
||||||
package org.apache.maven.plugin;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Copyright 2001-2004 The Apache Software Foundation.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import org.apache.maven.monitor.logging.Log;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
|
|
||||||
*
|
|
||||||
* @version $Id$
|
|
||||||
*/
|
|
||||||
public class TestPlugin
|
|
||||||
implements Plugin
|
|
||||||
{
|
|
||||||
protected boolean executed;
|
|
||||||
|
|
||||||
protected String name;
|
|
||||||
|
|
||||||
protected String artifactId;
|
|
||||||
|
|
||||||
protected String foo;
|
|
||||||
|
|
||||||
private Log log;
|
|
||||||
|
|
||||||
public boolean hasExecuted()
|
|
||||||
{
|
|
||||||
return executed;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getName()
|
|
||||||
{
|
|
||||||
return name;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getArtifactId()
|
|
||||||
{
|
|
||||||
return artifactId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getFoo()
|
|
||||||
{
|
|
||||||
return foo;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void execute( PluginExecutionRequest request )
|
|
||||||
throws PluginExecutionException
|
|
||||||
{
|
|
||||||
name = (String) request.getParameter( "name" );
|
|
||||||
|
|
||||||
artifactId = (String) request.getParameter( "artifactId" );
|
|
||||||
|
|
||||||
foo = (String) request.getParameter( "foo" );
|
|
||||||
|
|
||||||
executed = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setLog( Log log )
|
|
||||||
{
|
|
||||||
this.log = log;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,56 +0,0 @@
|
||||||
package org.apache.maven.plugin;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Copyright 2001-2004 The Apache Software Foundation.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import junit.framework.TestCase;
|
|
||||||
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
|
|
||||||
* @version $Id$
|
|
||||||
*/
|
|
||||||
public class TestPluginTest
|
|
||||||
extends TestCase
|
|
||||||
{
|
|
||||||
public void testIntegratedPluginExecution()
|
|
||||||
throws Exception
|
|
||||||
{
|
|
||||||
TestPlugin plugin = new TestPlugin();
|
|
||||||
|
|
||||||
Map parameters = new HashMap();
|
|
||||||
|
|
||||||
parameters.put( "name", "Maven" );
|
|
||||||
|
|
||||||
parameters.put( "artifactId", "maven-core" );
|
|
||||||
|
|
||||||
parameters.put( "foo", "bar" );
|
|
||||||
|
|
||||||
PluginExecutionRequest request = new PluginExecutionRequest( parameters );
|
|
||||||
|
|
||||||
plugin.execute( request );
|
|
||||||
|
|
||||||
assertTrue( plugin.hasExecuted() );
|
|
||||||
|
|
||||||
assertEquals( "Maven", plugin.getName() );
|
|
||||||
|
|
||||||
assertEquals( "maven-core", plugin.getArtifactId() );
|
|
||||||
|
|
||||||
assertEquals( "bar", plugin.getFoo() );
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in New Issue