Return-Path: Delivered-To: apmail-maven-commits-archive@www.apache.org Received: (qmail 49560 invoked from network); 2 Jul 2007 16:07:25 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 2 Jul 2007 16:07:25 -0000 Received: (qmail 48606 invoked by uid 500); 2 Jul 2007 16:07:24 -0000 Delivered-To: apmail-maven-commits-archive@maven.apache.org Received: (qmail 48508 invoked by uid 500); 2 Jul 2007 16:07:24 -0000 Mailing-List: contact commits-help@maven.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@maven.apache.org Delivered-To: mailing list commits@maven.apache.org Received: (qmail 48483 invoked by uid 99); 2 Jul 2007 16:07:24 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Jul 2007 09:07:23 -0700 X-ASF-Spam-Status: No, hits=-99.5 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Jul 2007 09:07:16 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id C6A3D1A982D; Mon, 2 Jul 2007 09:06:31 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r552524 [9/9] - in /maven/plugins/trunk/maven-dependency-plugin: ./ src/changes/ src/it/copy-dependencies/ src/it/copy-dependencies2/ src/it/mdep-27/ src/it/mdep-50/ src/it/mdep-61/ src/it/mdep-66/ src/it/mdep-67/ src/main/java/org/apache/m... Date: Mon, 02 Jul 2007 16:06:24 -0000 To: commits@maven.apache.org From: markh@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20070702160631.C6A3D1A982D@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Modified: maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/utils/translators/TestClassifierTypeTranslator.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/utils/translators/TestClassifierTypeTranslator.java?view=diff&rev=552524&r1=552523&r2=552524 ============================================================================== --- maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/utils/translators/TestClassifierTypeTranslator.java (original) +++ maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/utils/translators/TestClassifierTypeTranslator.java Mon Jul 2 09:06:19 2007 @@ -1,202 +1,202 @@ -package org.apache.maven.plugin.dependency.utils.translators; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you 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.HashMap; -import java.util.HashSet; -import java.util.Iterator; -import java.util.Set; - -import org.apache.maven.artifact.Artifact; -import org.apache.maven.artifact.factory.ArtifactFactory; -import org.apache.maven.artifact.factory.DefaultArtifactFactory; -import org.apache.maven.artifact.handler.manager.ArtifactHandlerManager; -import org.apache.maven.artifact.handler.manager.DefaultArtifactHandlerManager; -import org.apache.maven.plugin.dependency.AbstractDependencyMojoTestCase; -import org.apache.maven.plugin.dependency.testUtils.DependencyArtifactStubFactory; -import org.apache.maven.plugin.logging.Log; -import org.apache.maven.plugin.testing.SilentLog; - -/** - * @author brianf - * - */ -public class TestClassifierTypeTranslator - extends AbstractDependencyMojoTestCase -{ - Set artifacts = new HashSet(); - - ArtifactFactory artifactFactory; - - Log log = new SilentLog(); - - protected void setUp() - throws Exception - { - super.setUp(); - - ArtifactHandlerManager manager = new DefaultArtifactHandlerManager(); - this.setVariableValueToObject( manager, "artifactHandlers", new HashMap() ); - - artifactFactory = new DefaultArtifactFactory(); - this.setVariableValueToObject( artifactFactory, "artifactHandlerManager", manager ); - - DependencyArtifactStubFactory factory = new DependencyArtifactStubFactory( null, false ); - artifacts = factory.getMixedArtifacts(); - } - - public void testNullClassifier() - { - doTestNullEmptyClassifier( null ); - } - - public void testEmptyClassifier() - { - doTestNullEmptyClassifier( "" ); - } - - public void doTestNullEmptyClassifier( String classifier ) - { - String type = "zip"; - - ArtifactTranslator at = new ClassifierTypeTranslator( classifier, type, artifactFactory ); - Set results = at.translate( artifacts, log ); - - Iterator iter = artifacts.iterator(); - - while ( iter.hasNext() ) - { - Artifact artifact = (Artifact) iter.next(); - Iterator resultIter = results.iterator(); - boolean found = false; - while ( !found && resultIter.hasNext() ) - { - Artifact translatedArtifact = (Artifact) resultIter.next(); - if ( artifact.getArtifactId() == translatedArtifact.getArtifactId() - && artifact.getGroupId() == translatedArtifact.getGroupId() - && artifact.getScope() == translatedArtifact.getScope() ) - { - // classifier is null, should be the same as the artifact - assertEquals( artifact.getClassifier(), translatedArtifact.getClassifier() ); - assertEquals( type, translatedArtifact.getType() ); - - found = true; - break; - } - } - assertTrue( found ); - } - } - - public void testNullType() - { - doTestNullEmptyType( null ); - } - - public void testEmptyType() - { - doTestNullEmptyType( "" ); - } - - public void doTestNullEmptyType( String type ) - { - String classifier = "jdk5"; - - ArtifactTranslator at = new ClassifierTypeTranslator( classifier, type, artifactFactory ); - Set results = at.translate( artifacts, log ); - - Iterator iter = artifacts.iterator(); - - while ( iter.hasNext() ) - { - Artifact artifact = (Artifact) iter.next(); - Iterator resultIter = results.iterator(); - boolean found = false; - while ( !found && resultIter.hasNext() ) - { - Artifact translatedArtifact = (Artifact) resultIter.next(); - if ( artifact.getArtifactId() == translatedArtifact.getArtifactId() - && artifact.getGroupId() == translatedArtifact.getGroupId() - && artifact.getScope() == translatedArtifact.getScope() ) - { - // classifier is null, should be the same as the artifact - assertEquals( classifier, translatedArtifact.getClassifier() ); - assertEquals( artifact.getType(), translatedArtifact.getType() ); - - found = true; - break; - } - } - assertTrue( found ); - } - } - - public void testClassifierAndType() - { - String classifier = "jdk14"; - String type = "sources"; - ArtifactTranslator at = new ClassifierTypeTranslator( classifier, type, artifactFactory ); - Set results = at.translate( artifacts, log ); - - Iterator iter = artifacts.iterator(); - - while ( iter.hasNext() ) - { - Artifact artifact = (Artifact) iter.next(); - Iterator resultIter = results.iterator(); - boolean found = false; - while ( !found && resultIter.hasNext() ) - { - Artifact translatedArtifact = (Artifact) resultIter.next(); - if ( artifact.getArtifactId() == translatedArtifact.getArtifactId() - && artifact.getGroupId() == translatedArtifact.getGroupId() - && artifact.getScope() == translatedArtifact.getScope() ) - { - assertEquals( translatedArtifact.getClassifier(), classifier ); - assertEquals( translatedArtifact.getType(), type ); - - found = true; - break; - } - } - assertTrue( found ); - } - } - - public void testGetterSetter() - { - String classifier = "class"; - String type = "type"; - ClassifierTypeTranslator at = new ClassifierTypeTranslator( classifier, type, artifactFactory ); - - assertEquals( classifier, at.getClassifier() ); - assertEquals( type, at.getType() ); - - at.setClassifier( type ); - at.setType( classifier ); - - assertEquals( type, at.getClassifier() ); - assertEquals( classifier, at.getType() ); - - } -} +package org.apache.maven.plugin.dependency.utils.translators; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.Set; + +import org.apache.maven.artifact.Artifact; +import org.apache.maven.artifact.factory.ArtifactFactory; +import org.apache.maven.artifact.factory.DefaultArtifactFactory; +import org.apache.maven.artifact.handler.manager.ArtifactHandlerManager; +import org.apache.maven.artifact.handler.manager.DefaultArtifactHandlerManager; +import org.apache.maven.plugin.dependency.AbstractDependencyMojoTestCase; +import org.apache.maven.plugin.dependency.testUtils.DependencyArtifactStubFactory; +import org.apache.maven.plugin.logging.Log; +import org.apache.maven.plugin.testing.SilentLog; + +/** + * @author brianf + * + */ +public class TestClassifierTypeTranslator + extends AbstractDependencyMojoTestCase +{ + Set artifacts = new HashSet(); + + ArtifactFactory artifactFactory; + + Log log = new SilentLog(); + + protected void setUp() + throws Exception + { + super.setUp(); + + ArtifactHandlerManager manager = new DefaultArtifactHandlerManager(); + this.setVariableValueToObject( manager, "artifactHandlers", new HashMap() ); + + artifactFactory = new DefaultArtifactFactory(); + this.setVariableValueToObject( artifactFactory, "artifactHandlerManager", manager ); + + DependencyArtifactStubFactory factory = new DependencyArtifactStubFactory( null, false ); + artifacts = factory.getMixedArtifacts(); + } + + public void testNullClassifier() + { + doTestNullEmptyClassifier( null ); + } + + public void testEmptyClassifier() + { + doTestNullEmptyClassifier( "" ); + } + + public void doTestNullEmptyClassifier( String classifier ) + { + String type = "zip"; + + ArtifactTranslator at = new ClassifierTypeTranslator( classifier, type, artifactFactory ); + Set results = at.translate( artifacts, log ); + + Iterator iter = artifacts.iterator(); + + while ( iter.hasNext() ) + { + Artifact artifact = (Artifact) iter.next(); + Iterator resultIter = results.iterator(); + boolean found = false; + while ( !found && resultIter.hasNext() ) + { + Artifact translatedArtifact = (Artifact) resultIter.next(); + if ( artifact.getArtifactId() == translatedArtifact.getArtifactId() + && artifact.getGroupId() == translatedArtifact.getGroupId() + && artifact.getScope() == translatedArtifact.getScope() ) + { + // classifier is null, should be the same as the artifact + assertEquals( artifact.getClassifier(), translatedArtifact.getClassifier() ); + assertEquals( type, translatedArtifact.getType() ); + + found = true; + break; + } + } + assertTrue( found ); + } + } + + public void testNullType() + { + doTestNullEmptyType( null ); + } + + public void testEmptyType() + { + doTestNullEmptyType( "" ); + } + + public void doTestNullEmptyType( String type ) + { + String classifier = "jdk5"; + + ArtifactTranslator at = new ClassifierTypeTranslator( classifier, type, artifactFactory ); + Set results = at.translate( artifacts, log ); + + Iterator iter = artifacts.iterator(); + + while ( iter.hasNext() ) + { + Artifact artifact = (Artifact) iter.next(); + Iterator resultIter = results.iterator(); + boolean found = false; + while ( !found && resultIter.hasNext() ) + { + Artifact translatedArtifact = (Artifact) resultIter.next(); + if ( artifact.getArtifactId() == translatedArtifact.getArtifactId() + && artifact.getGroupId() == translatedArtifact.getGroupId() + && artifact.getScope() == translatedArtifact.getScope() ) + { + // classifier is null, should be the same as the artifact + assertEquals( classifier, translatedArtifact.getClassifier() ); + assertEquals( artifact.getType(), translatedArtifact.getType() ); + + found = true; + break; + } + } + assertTrue( found ); + } + } + + public void testClassifierAndType() + { + String classifier = "jdk14"; + String type = "sources"; + ArtifactTranslator at = new ClassifierTypeTranslator( classifier, type, artifactFactory ); + Set results = at.translate( artifacts, log ); + + Iterator iter = artifacts.iterator(); + + while ( iter.hasNext() ) + { + Artifact artifact = (Artifact) iter.next(); + Iterator resultIter = results.iterator(); + boolean found = false; + while ( !found && resultIter.hasNext() ) + { + Artifact translatedArtifact = (Artifact) resultIter.next(); + if ( artifact.getArtifactId() == translatedArtifact.getArtifactId() + && artifact.getGroupId() == translatedArtifact.getGroupId() + && artifact.getScope() == translatedArtifact.getScope() ) + { + assertEquals( translatedArtifact.getClassifier(), classifier ); + assertEquals( translatedArtifact.getType(), type ); + + found = true; + break; + } + } + assertTrue( found ); + } + } + + public void testGetterSetter() + { + String classifier = "class"; + String type = "type"; + ClassifierTypeTranslator at = new ClassifierTypeTranslator( classifier, type, artifactFactory ); + + assertEquals( classifier, at.getClassifier() ); + assertEquals( type, at.getType() ); + + at.setClassifier( type ); + at.setType( classifier ); + + assertEquals( type, at.getClassifier() ); + assertEquals( classifier, at.getType() ); + + } +} Propchange: maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/utils/translators/TestClassifierTypeTranslator.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/utils/translators/TestClassifierTypeTranslator.java ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords Mon Jul 2 09:06:19 2007 @@ -1 +1 @@ -Author Date Id HeadURL Revision +Author Date Id Revision Modified: maven/plugins/trunk/maven-dependency-plugin/src/test/resources/unit/build-classpath-test/plugin-config.xml URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/test/resources/unit/build-classpath-test/plugin-config.xml?view=diff&rev=552524&r1=552523&r2=552524 ============================================================================== --- maven/plugins/trunk/maven-dependency-plugin/src/test/resources/unit/build-classpath-test/plugin-config.xml (original) +++ maven/plugins/trunk/maven-dependency-plugin/src/test/resources/unit/build-classpath-test/plugin-config.xml Mon Jul 2 09:06:19 2007 @@ -1,38 +1,38 @@ - - - - - - maven-dependency-plugin - - - - - - - - - org.apache.maven - maven-artifact - 2.0.4 - - + + + + + + maven-dependency-plugin + + + + + + + + + org.apache.maven + maven-artifact + 2.0.4 + + Propchange: maven/plugins/trunk/maven-dependency-plugin/src/test/resources/unit/build-classpath-test/plugin-config.xml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/plugins/trunk/maven-dependency-plugin/src/test/resources/unit/build-classpath-test/plugin-config.xml ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords Mon Jul 2 09:06:19 2007 @@ -1 +1 @@ -Author Date Id HeadURL Revision +Author Date Id Revision Modified: maven/plugins/trunk/maven-dependency-plugin/src/test/resources/unit/copy-dependencies-test/plugin-config.xml URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/test/resources/unit/copy-dependencies-test/plugin-config.xml?view=diff&rev=552524&r1=552523&r2=552524 ============================================================================== --- maven/plugins/trunk/maven-dependency-plugin/src/test/resources/unit/copy-dependencies-test/plugin-config.xml (original) +++ maven/plugins/trunk/maven-dependency-plugin/src/test/resources/unit/copy-dependencies-test/plugin-config.xml Mon Jul 2 09:06:19 2007 @@ -1,32 +1,32 @@ - - - - - - maven-dependency-plugin - - - true - - - - + + + + + + maven-dependency-plugin + + + true + + + + Propchange: maven/plugins/trunk/maven-dependency-plugin/src/test/resources/unit/copy-dependencies-test/plugin-config.xml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/plugins/trunk/maven-dependency-plugin/src/test/resources/unit/copy-dependencies-test/plugin-config.xml ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords Mon Jul 2 09:06:19 2007 @@ -1 +1 @@ -Author Date Id HeadURL Revision +Author Date Id Revision Modified: maven/plugins/trunk/maven-dependency-plugin/src/test/resources/unit/copy-test/plugin-config.xml URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/test/resources/unit/copy-test/plugin-config.xml?view=diff&rev=552524&r1=552523&r2=552524 ============================================================================== --- maven/plugins/trunk/maven-dependency-plugin/src/test/resources/unit/copy-test/plugin-config.xml (original) +++ maven/plugins/trunk/maven-dependency-plugin/src/test/resources/unit/copy-test/plugin-config.xml Mon Jul 2 09:06:19 2007 @@ -1,38 +1,38 @@ - - - - - - maven-dependency-plugin - - - - - - - - - org.apache.maven - maven-artifact - 2.0.4 - - + + + + + + maven-dependency-plugin + + + + + + + + + org.apache.maven + maven-artifact + 2.0.4 + + Propchange: maven/plugins/trunk/maven-dependency-plugin/src/test/resources/unit/copy-test/plugin-config.xml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/plugins/trunk/maven-dependency-plugin/src/test/resources/unit/copy-test/plugin-config.xml ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords Mon Jul 2 09:06:19 2007 @@ -1 +1 @@ -Author Date Id HeadURL Revision +Author Date Id Revision Modified: maven/plugins/trunk/maven-dependency-plugin/src/test/resources/unit/resolve-test/plugin-config.xml URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/test/resources/unit/resolve-test/plugin-config.xml?view=diff&rev=552524&r1=552523&r2=552524 ============================================================================== --- maven/plugins/trunk/maven-dependency-plugin/src/test/resources/unit/resolve-test/plugin-config.xml (original) +++ maven/plugins/trunk/maven-dependency-plugin/src/test/resources/unit/resolve-test/plugin-config.xml Mon Jul 2 09:06:19 2007 @@ -1,38 +1,38 @@ - - - - - - maven-dependency-plugin - - - - - - - - - org.apache.maven - maven-artifact - 2.0.4 - - + + + + + + maven-dependency-plugin + + + + + + + + + org.apache.maven + maven-artifact + 2.0.4 + + Propchange: maven/plugins/trunk/maven-dependency-plugin/src/test/resources/unit/resolve-test/plugin-config.xml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/plugins/trunk/maven-dependency-plugin/src/test/resources/unit/resolve-test/plugin-config.xml ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords Mon Jul 2 09:06:19 2007 @@ -1 +1 @@ -Author Date Id HeadURL Revision +Author Date Id Revision Modified: maven/plugins/trunk/maven-dependency-plugin/src/test/resources/unit/unpack-dependencies-test/plugin-config.xml URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/test/resources/unit/unpack-dependencies-test/plugin-config.xml?view=diff&rev=552524&r1=552523&r2=552524 ============================================================================== --- maven/plugins/trunk/maven-dependency-plugin/src/test/resources/unit/unpack-dependencies-test/plugin-config.xml (original) +++ maven/plugins/trunk/maven-dependency-plugin/src/test/resources/unit/unpack-dependencies-test/plugin-config.xml Mon Jul 2 09:06:19 2007 @@ -1,32 +1,32 @@ - - - - - - maven-dependency-plugin - - - true - - - - + + + + + + maven-dependency-plugin + + + true + + + + Propchange: maven/plugins/trunk/maven-dependency-plugin/src/test/resources/unit/unpack-dependencies-test/plugin-config.xml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/plugins/trunk/maven-dependency-plugin/src/test/resources/unit/unpack-dependencies-test/plugin-config.xml ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords Mon Jul 2 09:06:19 2007 @@ -1 +1 @@ -Author Date Id HeadURL Revision +Author Date Id Revision Modified: maven/plugins/trunk/maven-dependency-plugin/src/test/resources/unit/unpack-test/plugin-config.xml URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/test/resources/unit/unpack-test/plugin-config.xml?view=diff&rev=552524&r1=552523&r2=552524 ============================================================================== --- maven/plugins/trunk/maven-dependency-plugin/src/test/resources/unit/unpack-test/plugin-config.xml (original) +++ maven/plugins/trunk/maven-dependency-plugin/src/test/resources/unit/unpack-test/plugin-config.xml Mon Jul 2 09:06:19 2007 @@ -1,38 +1,38 @@ - - - - - - maven-dependency-plugin - - - - - - - - - org.apache.maven - maven-artifact - 2.0.4 - - + + + + + + maven-dependency-plugin + + + + + + + + + org.apache.maven + maven-artifact + 2.0.4 + + Propchange: maven/plugins/trunk/maven-dependency-plugin/src/test/resources/unit/unpack-test/plugin-config.xml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/plugins/trunk/maven-dependency-plugin/src/test/resources/unit/unpack-test/plugin-config.xml ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords Mon Jul 2 09:06:19 2007 @@ -1 +1 @@ -Author Date Id HeadURL Revision +Author Date Id Revision