You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by ke...@apache.org on 2006/05/01 00:01:05 UTC

svn commit: r398452 - in /maven/components/trunk/maven-core-it/it0105: ./ src/ src/main/ src/main/resources/ src/test/ src/test/java/ src/test/java/org/ src/test/java/org/apache/ src/test/java/org/apache/maven/ src/test/java/org/apache/maven/it0105/

Author: kenney
Date: Sun Apr 30 15:01:04 2006
New Revision: 398452

URL: http://svn.apache.org/viewcvs?rev=398452&view=rev
Log:
Added testcase for MRESOURCES-18. This should really go into
the resources-plugin itself using the new framework, but 
committing anyway for future reference and regression testing.

Added:
    maven/components/trunk/maven-core-it/it0105/
    maven/components/trunk/maven-core-it/it0105/cli-options.txt   (with props)
    maven/components/trunk/maven-core-it/it0105/expected-results.txt   (with props)
    maven/components/trunk/maven-core-it/it0105/filter.properties   (with props)
    maven/components/trunk/maven-core-it/it0105/goals.txt   (with props)
    maven/components/trunk/maven-core-it/it0105/pom.xml   (with props)
    maven/components/trunk/maven-core-it/it0105/src/
    maven/components/trunk/maven-core-it/it0105/src/main/
    maven/components/trunk/maven-core-it/it0105/src/main/resources/
    maven/components/trunk/maven-core-it/it0105/src/main/resources/test.properties   (with props)
    maven/components/trunk/maven-core-it/it0105/src/test/
    maven/components/trunk/maven-core-it/it0105/src/test/java/
    maven/components/trunk/maven-core-it/it0105/src/test/java/org/
    maven/components/trunk/maven-core-it/it0105/src/test/java/org/apache/
    maven/components/trunk/maven-core-it/it0105/src/test/java/org/apache/maven/
    maven/components/trunk/maven-core-it/it0105/src/test/java/org/apache/maven/it0105/
    maven/components/trunk/maven-core-it/it0105/src/test/java/org/apache/maven/it0105/FilterTest.java   (with props)

Added: maven/components/trunk/maven-core-it/it0105/cli-options.txt
URL: http://svn.apache.org/viewcvs/maven/components/trunk/maven-core-it/it0105/cli-options.txt?rev=398452&view=auto
==============================================================================
--- maven/components/trunk/maven-core-it/it0105/cli-options.txt (added)
+++ maven/components/trunk/maven-core-it/it0105/cli-options.txt Sun Apr 30 15:01:04 2006
@@ -0,0 +1 @@
+-Dparam=PARAM

Propchange: maven/components/trunk/maven-core-it/it0105/cli-options.txt
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/components/trunk/maven-core-it/it0105/cli-options.txt
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/components/trunk/maven-core-it/it0105/expected-results.txt
URL: http://svn.apache.org/viewcvs/maven/components/trunk/maven-core-it/it0105/expected-results.txt?rev=398452&view=auto
==============================================================================
--- maven/components/trunk/maven-core-it/it0105/expected-results.txt (added)
+++ maven/components/trunk/maven-core-it/it0105/expected-results.txt Sun Apr 30 15:01:04 2006
@@ -0,0 +1 @@
+target/classes/test.properties

Propchange: maven/components/trunk/maven-core-it/it0105/expected-results.txt
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/components/trunk/maven-core-it/it0105/expected-results.txt
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/components/trunk/maven-core-it/it0105/filter.properties
URL: http://svn.apache.org/viewcvs/maven/components/trunk/maven-core-it/it0105/filter.properties?rev=398452&view=auto
==============================================================================
    (empty)

Propchange: maven/components/trunk/maven-core-it/it0105/filter.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/components/trunk/maven-core-it/it0105/filter.properties
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/components/trunk/maven-core-it/it0105/goals.txt
URL: http://svn.apache.org/viewcvs/maven/components/trunk/maven-core-it/it0105/goals.txt?rev=398452&view=auto
==============================================================================
--- maven/components/trunk/maven-core-it/it0105/goals.txt (added)
+++ maven/components/trunk/maven-core-it/it0105/goals.txt Sun Apr 30 15:01:04 2006
@@ -0,0 +1 @@
+test

Propchange: maven/components/trunk/maven-core-it/it0105/goals.txt
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/components/trunk/maven-core-it/it0105/goals.txt
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/components/trunk/maven-core-it/it0105/pom.xml
URL: http://svn.apache.org/viewcvs/maven/components/trunk/maven-core-it/it0105/pom.xml?rev=398452&view=auto
==============================================================================
--- maven/components/trunk/maven-core-it/it0105/pom.xml (added)
+++ maven/components/trunk/maven-core-it/it0105/pom.xml Sun Apr 30 15:01:04 2006
@@ -0,0 +1,34 @@
+<project xmlns="http://maven.apache.org/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>testing</groupId>
+  <artifactId>maven-core-it-it0105</artifactId>
+  <version>1.0</version>
+  <dependencies>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>3.8.1</version>
+      <type>jar</type>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+  
+  <build>
+		<!-- Enabling this will fix the problem for
+			maven-resources-plugin 2.2-20060403.015736-1 and earlier.
+		<filters>
+			<filter>filter.properties</filter>
+		</filters>
+		-->
+		<resources>
+		<resource>
+			<directory>src/main/resources</directory>
+			<filtering>true</filtering>
+		</resource>
+		</resources>
+  </build>
+ 
+	<properties>
+  	<my.property>foo</my.property>
+	</properties>
+</project>

Propchange: maven/components/trunk/maven-core-it/it0105/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/components/trunk/maven-core-it/it0105/pom.xml
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/components/trunk/maven-core-it/it0105/src/main/resources/test.properties
URL: http://svn.apache.org/viewcvs/maven/components/trunk/maven-core-it/it0105/src/main/resources/test.properties?rev=398452&view=auto
==============================================================================
--- maven/components/trunk/maven-core-it/it0105/src/main/resources/test.properties (added)
+++ maven/components/trunk/maven-core-it/it0105/src/main/resources/test.properties Sun Apr 30 15:01:04 2006
@@ -0,0 +1,3 @@
+systemProperty=${user.home}
+param=${param}
+pom.property=${my.property}

Propchange: maven/components/trunk/maven-core-it/it0105/src/main/resources/test.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/components/trunk/maven-core-it/it0105/src/main/resources/test.properties
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/components/trunk/maven-core-it/it0105/src/test/java/org/apache/maven/it0105/FilterTest.java
URL: http://svn.apache.org/viewcvs/maven/components/trunk/maven-core-it/it0105/src/test/java/org/apache/maven/it0105/FilterTest.java?rev=398452&view=auto
==============================================================================
--- maven/components/trunk/maven-core-it/it0105/src/test/java/org/apache/maven/it0105/FilterTest.java (added)
+++ maven/components/trunk/maven-core-it/it0105/src/test/java/org/apache/maven/it0105/FilterTest.java Sun Apr 30 15:01:04 2006
@@ -0,0 +1,49 @@
+package org.apache.maven.it0105;
+
+import junit.framework.TestCase;
+
+import java.util.Properties;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+
+public class FilterTest
+    extends TestCase
+{
+    private String basedir;
+
+    private Properties properties;
+
+    protected void setUp()
+        throws Exception
+    {
+        basedir = System.getProperty( "basedir" );
+
+        properties = new Properties();
+
+        File testPropertiesFile = new File( basedir, "target/classes/test.properties" );
+
+        assertTrue( testPropertiesFile.exists() );
+
+        properties.load( new FileInputStream( testPropertiesFile ) );
+    }
+    
+    public void testSystemPropertyInterpolation()
+        throws IOException
+    {
+        assertEquals( "System property", System.getProperty( "user.home" ), properties.getProperty( "systemProperty" ) );
+    }    
+
+    public void testParameterInterpolation()
+        throws IOException
+    {
+        assertEquals( "Parameter", System.getProperty( "parameter" ), properties.getProperty( "parameter" ) );
+    }    
+
+    public void testPomPropertyInterpolation()
+        throws IOException
+    {
+        assertEquals( "Pom Property", "foo", properties.getProperty( "pom.property" ) );
+    }    
+
+}

Propchange: maven/components/trunk/maven-core-it/it0105/src/test/java/org/apache/maven/it0105/FilterTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/components/trunk/maven-core-it/it0105/src/test/java/org/apache/maven/it0105/FilterTest.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"



Re: svn commit: r398452 - in /maven/components/trunk/maven-core-it/it0105: ./ src/ src/main/ src/main/resources/ src/test/ src/test/java/ src/test/java/org/ src/test/java/org/apache/ src/test/java/org

Posted by Kenney Westerhof <ke...@apache.org>.
On Mon, 1 May 2006, Brett Porter wrote:

> kenney@apache.org wrote:
> > Author: kenney
> > Date: Sun Apr 30 15:01:04 2006
> > New Revision: 398452
> >
> > URL: http://svn.apache.org/viewcvs?rev=398452&view=rev
> > Log:
> > Added testcase for MRESOURCES-18. This should really go into
> > the resources-plugin itself using the new framework, but
> > committing anyway for future reference and regression testing.
> >
>
> Given that, maybe its better to roll it back out and attach it to the
> jira instead?

Maybe so. But I have to learn the new way of doing things anyway, so I
wanted to moved this myself.

-- Kenney


>
> - Brett
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>

--
Kenney Westerhof
http://www.neonics.com
GPG public key: http://www.gods.nl/~forge/kenneyw.key

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: svn commit: r398452 - in /maven/components/trunk/maven-core-it/it0105: ./ src/ src/main/ src/main/resources/ src/test/ src/test/java/ src/test/java/org/ src/test/java/org/apache/ src/test/java/org

Posted by Kenney Westerhof <ke...@apache.org>.
On Mon, 1 May 2006, Brett Porter wrote:

> ok, see now that the issue was closed.
>
> I'm not sure how you see the "old style" tests as cleaner. What makes
> the new ones less clean in your opinion? The IT's are certainly not unit
> tests (the plugin framework tests are only just barely units
> themselves), and significantly slower to run.

True, unless we use the maven-it-plugin. Haven't really gotten around to
applying that to plugins.

The fact that they're cleaner is that you now only have small project
with a minimal pom that describes exactly what you need to reproduce the
problem. You can directly run maven on it to see what goes wrong.

I find that the plumbing required for the new testcases duplicates too
much maven core code (from the first glances) - most code is for setting
up a trivial project, and you have to read the sources carefully to
extract how this would map onto a real pom. It's hard to immediately see
what is tested exactly.

Given that, I first thought this problem had something to do with general
resource and filter handling and so needed an integration test. As it
turns out, this case could be tested using just a unit test on the Mojo
itself since it only applies to POM fields that don't get any special
processing from Maven.

So I'll convert it, and have a closer look. Maybe then I can demonstrate
my concerns better, or get convinced :)

-- Kenney

>
> - Brett
>
> Brett Porter wrote:
> > kenney@apache.org wrote:
> >> Author: kenney
> >> Date: Sun Apr 30 15:01:04 2006
> >> New Revision: 398452
> >>
> >> URL: http://svn.apache.org/viewcvs?rev=398452&view=rev
> >> Log:
> >> Added testcase for MRESOURCES-18. This should really go into
> >> the resources-plugin itself using the new framework, but committing
> >> anyway for future reference and regression testing.
> >>
> >
> > Given that, maybe its better to roll it back out and attach it to the
> > jira instead?
> >
> > - Brett
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> > For additional commands, e-mail: dev-help@maven.apache.org
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>

--
Kenney Westerhof
http://www.neonics.com
GPG public key: http://www.gods.nl/~forge/kenneyw.key

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: svn commit: r398452 - in /maven/components/trunk/maven-core-it/it0105: ./ src/ src/main/ src/main/resources/ src/test/ src/test/java/ src/test/java/org/ src/test/java/org/apache/ src/test/java/org/apache/maven/ src/test/java/org/apache/maven/it0105/

Posted by Brett Porter <br...@apache.org>.
ok, see now that the issue was closed.

I'm not sure how you see the "old style" tests as cleaner. What makes 
the new ones less clean in your opinion? The IT's are certainly not unit 
tests (the plugin framework tests are only just barely units 
themselves), and significantly slower to run.

- Brett

Brett Porter wrote:
> kenney@apache.org wrote:
>> Author: kenney
>> Date: Sun Apr 30 15:01:04 2006
>> New Revision: 398452
>>
>> URL: http://svn.apache.org/viewcvs?rev=398452&view=rev
>> Log:
>> Added testcase for MRESOURCES-18. This should really go into
>> the resources-plugin itself using the new framework, but committing 
>> anyway for future reference and regression testing.
>>
> 
> Given that, maybe its better to roll it back out and attach it to the 
> jira instead?
> 
> - Brett
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: svn commit: r398452 - in /maven/components/trunk/maven-core-it/it0105: ./ src/ src/main/ src/main/resources/ src/test/ src/test/java/ src/test/java/org/ src/test/java/org/apache/ src/test/java/org/apache/maven/ src/test/java/org/apache/maven/it0105/

Posted by Brett Porter <br...@apache.org>.
kenney@apache.org wrote:
> Author: kenney
> Date: Sun Apr 30 15:01:04 2006
> New Revision: 398452
> 
> URL: http://svn.apache.org/viewcvs?rev=398452&view=rev
> Log:
> Added testcase for MRESOURCES-18. This should really go into
> the resources-plugin itself using the new framework, but 
> committing anyway for future reference and regression testing.
> 

Given that, maybe its better to roll it back out and attach it to the 
jira instead?

- Brett

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org