Return-Path: Delivered-To: apmail-ant-notifications-archive@minotaur.apache.org Received: (qmail 29208 invoked from network); 9 Aug 2010 19:42:46 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 9 Aug 2010 19:42:46 -0000 Received: (qmail 55972 invoked by uid 500); 9 Aug 2010 19:42:45 -0000 Delivered-To: apmail-ant-notifications-archive@ant.apache.org Received: (qmail 55932 invoked by uid 500); 9 Aug 2010 19:42:45 -0000 Mailing-List: contact notifications-help@ant.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ant.apache.org Delivered-To: mailing list notifications@ant.apache.org Received: (qmail 55925 invoked by uid 99); 9 Aug 2010 19:42:45 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 09 Aug 2010 19:42:45 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 09 Aug 2010 19:42:42 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 1D36D23889EA; Mon, 9 Aug 2010 19:41:25 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r983793 - /ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorWriterTest.java Date: Mon, 09 Aug 2010 19:41:25 -0000 To: notifications@ant.apache.org From: maartenc@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20100809194125.1D36D23889EA@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: maartenc Date: Mon Aug 9 19:41:24 2010 New Revision: 983793 URL: http://svn.apache.org/viewvc?rev=983793&view=rev Log: Use dedicated options class to pass configuration options to PomModuleDescriptorWriter. Modified: ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorWriterTest.java Modified: ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorWriterTest.java URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorWriterTest.java?rev=983793&r1=983792&r2=983793&view=diff ============================================================================== --- ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorWriterTest.java (original) +++ ant/ivy/core/trunk/test/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorWriterTest.java Mon Aug 9 19:41:24 2010 @@ -44,7 +44,7 @@ public class PomModuleDescriptorWriterTe public void testSimple() throws Exception { ModuleDescriptor md = PomModuleDescriptorParser.getInstance().parseDescriptor( new IvySettings(), getClass().getResource("test-simple.pom"), false); - PomModuleDescriptorWriter.write(md, null, LICENSE, PomModuleDescriptorWriter.DEFAULT_MAPPING, _dest); + PomModuleDescriptorWriter.write(md, _dest, getWriterOptions()); assertTrue(_dest.exists()); String wrote = FileUtil.readEntirely(new BufferedReader(new FileReader(_dest))).replaceAll( @@ -57,7 +57,7 @@ public class PomModuleDescriptorWriterTe public void testSimpleDependencies() throws Exception { ModuleDescriptor md = PomModuleDescriptorParser.getInstance().parseDescriptor( new IvySettings(), getClass().getResource("test-dependencies.pom"), false); - PomModuleDescriptorWriter.write(md, null, LICENSE, PomModuleDescriptorWriter.DEFAULT_MAPPING, _dest); + PomModuleDescriptorWriter.write(md, _dest, getWriterOptions()); assertTrue(_dest.exists()); String wrote = FileUtil.readEntirely(new BufferedReader(new FileReader(_dest))).replaceAll( @@ -70,7 +70,7 @@ public class PomModuleDescriptorWriterTe public void testDependenciesWithScope() throws Exception { ModuleDescriptor md = PomModuleDescriptorParser.getInstance().parseDescriptor( new IvySettings(), getClass().getResource("test-dependencies-with-scope.pom"), false); - PomModuleDescriptorWriter.write(md, null, LICENSE, PomModuleDescriptorWriter.DEFAULT_MAPPING, _dest); + PomModuleDescriptorWriter.write(md, _dest, getWriterOptions()); assertTrue(_dest.exists()); String wrote = FileUtil.readEntirely(new BufferedReader(new FileReader(_dest))).replaceAll( @@ -83,7 +83,7 @@ public class PomModuleDescriptorWriterTe public void testOptional() throws Exception { ModuleDescriptor md = PomModuleDescriptorParser.getInstance().parseDescriptor( new IvySettings(), getClass().getResource("test-optional.pom"), false); - PomModuleDescriptorWriter.write(md, null, LICENSE, PomModuleDescriptorWriter.DEFAULT_MAPPING, _dest); + PomModuleDescriptorWriter.write(md, _dest, getWriterOptions()); assertTrue(_dest.exists()); String wrote = FileUtil.readEntirely(new BufferedReader(new FileReader(_dest))).replaceAll( @@ -96,7 +96,7 @@ public class PomModuleDescriptorWriterTe public void testPackaging() throws Exception { ModuleDescriptor md = PomModuleDescriptorParser.getInstance().parseDescriptor( new IvySettings(), getClass().getResource("test-packaging.pom"), false); - PomModuleDescriptorWriter.write(md, null, LICENSE, PomModuleDescriptorWriter.DEFAULT_MAPPING, _dest); + PomModuleDescriptorWriter.write(md, _dest, getWriterOptions()); assertTrue(_dest.exists()); String wrote = FileUtil.readEntirely(new BufferedReader(new FileReader(_dest))).replaceAll( @@ -109,7 +109,7 @@ public class PomModuleDescriptorWriterTe public void testWriteCompileConfigurationOnly() throws Exception { ModuleDescriptor md = PomModuleDescriptorParser.getInstance().parseDescriptor( new IvySettings(), getClass().getResource("test-dependencies-with-scope.pom"), false); - PomModuleDescriptorWriter.write(md, new String[] {"compile"}, LICENSE, PomModuleDescriptorWriter.DEFAULT_MAPPING, _dest); + PomModuleDescriptorWriter.write(md, _dest, getWriterOptions().setConfs(new String[] {"compile"})); assertTrue(_dest.exists()); String wrote = FileUtil.readEntirely(new BufferedReader(new FileReader(_dest))).replaceAll( @@ -122,7 +122,7 @@ public class PomModuleDescriptorWriterTe public void testWriteRuntimeConfigurationOnly() throws Exception { ModuleDescriptor md = PomModuleDescriptorParser.getInstance().parseDescriptor( new IvySettings(), getClass().getResource("test-dependencies-with-scope.pom"), false); - PomModuleDescriptorWriter.write(md, new String[] {"runtime"}, LICENSE, PomModuleDescriptorWriter.DEFAULT_MAPPING, _dest); + PomModuleDescriptorWriter.write(md, _dest, getWriterOptions().setConfs(new String[] {"runtime"})); assertTrue(_dest.exists()); String wrote = FileUtil.readEntirely(new BufferedReader(new FileReader(_dest))).replaceAll( @@ -135,7 +135,7 @@ public class PomModuleDescriptorWriterTe public void testWriteAllConfiguration() throws Exception { ModuleDescriptor md = PomModuleDescriptorParser.getInstance().parseDescriptor( new IvySettings(), getClass().getResource("test-dependencies-with-scope.pom"), false); - PomModuleDescriptorWriter.write(md, new String[] {"*"}, LICENSE, PomModuleDescriptorWriter.DEFAULT_MAPPING, _dest); + PomModuleDescriptorWriter.write(md, _dest, getWriterOptions().setConfs(new String[] {"*"})); assertTrue(_dest.exists()); String wrote = FileUtil.readEntirely(new BufferedReader(new FileReader(_dest))).replaceAll( @@ -148,7 +148,7 @@ public class PomModuleDescriptorWriterTe public void testWriteAllExceptRuntimeConfiguration() throws Exception { ModuleDescriptor md = PomModuleDescriptorParser.getInstance().parseDescriptor( new IvySettings(), getClass().getResource("test-dependencies-with-scope.pom"), false); - PomModuleDescriptorWriter.write(md, new String[] {"*", "!runtime"}, LICENSE, PomModuleDescriptorWriter.DEFAULT_MAPPING, _dest); + PomModuleDescriptorWriter.write(md, _dest, getWriterOptions().setConfs(new String[] {"*", "!runtime"})); assertTrue(_dest.exists()); String wrote = FileUtil.readEntirely(new BufferedReader(new FileReader(_dest))).replaceAll( @@ -162,6 +162,10 @@ public class PomModuleDescriptorWriterTe return FileUtil.readEntirely(new BufferedReader(new InputStreamReader( PomModuleDescriptorWriterTest.class.getResource(resource).openStream()))); } + + private PomWriterOptions getWriterOptions() { + return (new PomWriterOptions()).setLicenseHeader(LICENSE); + } public void setUp() { // don't add ivy version to se static files for comparison