Author: brett Date: Sun May 14 14:35:43 2006 New Revision: 406438 URL: http://svn.apache.org/viewcvs?rev=406438&view=rev Log: add missing test files
Added: maven/plugins/trunk/maven-war-plugin/src/test/java/org/apache/maven/plugin/war/stub/MavenProject4CopyConstructor.java (with props) maven/plugins/trunk/maven-war-plugin/src/test/java/org/apache/maven/plugin/war/stub/ModelStub.java (with props) maven/plugins/trunk/maven-war-plugin/src/test/java/org/apache/maven/plugin/war/stub/ProjectHelperStub.java (with props) maven/plugins/trunk/maven-war-plugin/src/test/java/org/apache/maven/plugin/war/stub/SimpleWarArtifact4CCStub.java (with props) Added: maven/plugins/trunk/maven-war-plugin/src/test/java/org/apache/maven/plugin/war/stub/MavenProject4CopyConstructor.java URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-war-plugin/src/test/java/org/apache/maven/plugin/war/stub/MavenProject4CopyConstructor.java?rev=406438&view=auto ============================================================================== --- maven/plugins/trunk/maven-war-plugin/src/test/java/org/apache/maven/plugin/war/stub/MavenProject4CopyConstructor.java (added) +++ maven/plugins/trunk/maven-war-plugin/src/test/java/org/apache/maven/plugin/war/stub/MavenProject4CopyConstructor.java Sun May 14 14:35:43 2006 @@ -0,0 +1,57 @@ +package org.apache.maven.plugin.war.stub; + +/* + * Copyright 2001-2006 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 java.io.File; +import java.util.HashSet; +import java.util.LinkedList; +import java.util.List; + +public class MavenProject4CopyConstructor + extends MavenProjectBasicStub +{ + protected ModelStub model; + + public MavenProject4CopyConstructor() + throws Exception + { + initializeParentFields(); + } + + public List getAttachedArtifacts() + { + return new LinkedList(); + } + + // to prevent the MavenProject copy constructor from blowing up + private void initializeParentFields() + { + // the pom should be located in the isolated dummy root + super.setFile( new File( getBasedir(), "pom.xml" ) ); + super.setDependencyArtifacts( new HashSet() ); + super.setArtifacts( new HashSet() ); + super.setPluginArtifacts( new HashSet() ); + super.setReportArtifacts( new HashSet() ); + super.setExtensionArtifacts( new HashSet() ); + super.setRemoteArtifactRepositories( new LinkedList() ); + super.setPluginArtifactRepositories( new LinkedList() ); + super.setCollectedProjects( new LinkedList() ); + super.setActiveProfiles( new LinkedList() ); + super.setOriginalModel( null ); + super.setExecutionProject( this ); + } +} Propchange: maven/plugins/trunk/maven-war-plugin/src/test/java/org/apache/maven/plugin/war/stub/MavenProject4CopyConstructor.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/plugins/trunk/maven-war-plugin/src/test/java/org/apache/maven/plugin/war/stub/MavenProject4CopyConstructor.java ------------------------------------------------------------------------------ svn:keywords = "Author Date Id Revision" Added: maven/plugins/trunk/maven-war-plugin/src/test/java/org/apache/maven/plugin/war/stub/ModelStub.java URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-war-plugin/src/test/java/org/apache/maven/plugin/war/stub/ModelStub.java?rev=406438&view=auto ============================================================================== --- maven/plugins/trunk/maven-war-plugin/src/test/java/org/apache/maven/plugin/war/stub/ModelStub.java (added) +++ maven/plugins/trunk/maven-war-plugin/src/test/java/org/apache/maven/plugin/war/stub/ModelStub.java Sun May 14 14:35:43 2006 @@ -0,0 +1,91 @@ +package org.apache.maven.plugin.war.stub; + +/* + * Copyright 2001-2006 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 java.util.LinkedList; +import java.util.List; +import java.util.Properties; + +import org.apache.maven.model.Model; +import org.apache.maven.model.Parent; + +/** + * Stub + */ +public class ModelStub + extends Model +{ + public ModelStub() + { + + } + + public String getVersion() + { + return "0.0-TEST"; + } + + public String getModelVersion() + { + return "0.0-TEST"; + } + + public String getName() + { + return "Test Model"; + } + + public String getGroupId() + { + return "org.apache.maven.test"; + } + + public String getPackaging() + { + return "jar"; + } + + public Parent getParent() + { + return new Parent(); + } + + public String getArtifactId() + { + return "maven-test-plugin"; + } + + public Properties getProperties() + { + return new Properties(); + } + + public List getPackages() + { + return new LinkedList(); + } + + public List getProfiles() + { + return new LinkedList(); + } + + public List getModules() + { + return new LinkedList(); + } +} Propchange: maven/plugins/trunk/maven-war-plugin/src/test/java/org/apache/maven/plugin/war/stub/ModelStub.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/plugins/trunk/maven-war-plugin/src/test/java/org/apache/maven/plugin/war/stub/ModelStub.java ------------------------------------------------------------------------------ svn:keywords = "Author Date Id Revision" Added: maven/plugins/trunk/maven-war-plugin/src/test/java/org/apache/maven/plugin/war/stub/ProjectHelperStub.java URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-war-plugin/src/test/java/org/apache/maven/plugin/war/stub/ProjectHelperStub.java?rev=406438&view=auto ============================================================================== --- maven/plugins/trunk/maven-war-plugin/src/test/java/org/apache/maven/plugin/war/stub/ProjectHelperStub.java (added) +++ maven/plugins/trunk/maven-war-plugin/src/test/java/org/apache/maven/plugin/war/stub/ProjectHelperStub.java Sun May 14 14:35:43 2006 @@ -0,0 +1,76 @@ +package org.apache.maven.plugin.war.stub; + +/* + * Copyright 2001-2006 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 java.io.File; +import java.util.List; + +import org.apache.maven.project.MavenProject; +import org.apache.maven.project.MavenProjectHelper; + +public class ProjectHelperStub + implements MavenProjectHelper +{ + File artifactFile; + + String artifactType; + + String artifactClassifier; + + public File getArtifactFile() + { + return artifactFile; + } + + public String getArtifactType() + { + return artifactType; + } + + public String getArtifactClassifier() + { + return artifactClassifier; + } + + public void attachArtifact( MavenProject project, File artifactFile, String artifactClassifier ) + { + + } + + public void attachArtifact( MavenProject project, String artifactType, File artifactFile ) + { + + } + + public void attachArtifact( MavenProject project, String _artifactType, String _artifactClassifier, + File _artifactFile ) + { + artifactType = _artifactType; + artifactClassifier = _artifactClassifier; + artifactFile = _artifactFile; + } + + public void addResource( MavenProject project, String resourceDirectory, List includes, List excludes ) + { + + } + + public void addTestResource( MavenProject project, String resourceDirectory, List includes, List excludes ) + { + + } +} Propchange: maven/plugins/trunk/maven-war-plugin/src/test/java/org/apache/maven/plugin/war/stub/ProjectHelperStub.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/plugins/trunk/maven-war-plugin/src/test/java/org/apache/maven/plugin/war/stub/ProjectHelperStub.java ------------------------------------------------------------------------------ svn:keywords = "Author Date Id Revision" Added: maven/plugins/trunk/maven-war-plugin/src/test/java/org/apache/maven/plugin/war/stub/SimpleWarArtifact4CCStub.java URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-war-plugin/src/test/java/org/apache/maven/plugin/war/stub/SimpleWarArtifact4CCStub.java?rev=406438&view=auto ============================================================================== --- maven/plugins/trunk/maven-war-plugin/src/test/java/org/apache/maven/plugin/war/stub/SimpleWarArtifact4CCStub.java (added) +++ maven/plugins/trunk/maven-war-plugin/src/test/java/org/apache/maven/plugin/war/stub/SimpleWarArtifact4CCStub.java Sun May 14 14:35:43 2006 @@ -0,0 +1,56 @@ +package org.apache.maven.plugin.war.stub; + +/* + * Copyright 2001-2006 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.artifact.handler.ArtifactHandler; +import org.apache.maven.artifact.handler.DefaultArtifactHandler; +import org.apache.maven.artifact.versioning.VersionRange; + +/** + * + * stub for copy constructor + * to preven the copy constructor frow blowing up + * + */ +public class SimpleWarArtifact4CCStub + extends SimpleWarArtifactStub +{ + public SimpleWarArtifact4CCStub( String basedir ) + { + super( basedir ); + } + + public VersionRange getVersionRange() + { + return VersionRange.createFromVersion( getVersion() ); + } + + public String getGroupId() + { + return "org.maven.plugin.test"; + } + + public String getClassifier() + { + return "testclassifier"; + } + + public ArtifactHandler getArtifactHandler() + { + return new DefaultArtifactHandler(); + } +} Propchange: maven/plugins/trunk/maven-war-plugin/src/test/java/org/apache/maven/plugin/war/stub/SimpleWarArtifact4CCStub.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/plugins/trunk/maven-war-plugin/src/test/java/org/apache/maven/plugin/war/stub/SimpleWarArtifact4CCStub.java ------------------------------------------------------------------------------ svn:keywords = "Author Date Id Revision"