You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by rf...@apache.org on 2012/09/04 19:46:44 UTC

svn commit: r1380754 - in /maven/plugins/trunk/maven-compiler-plugin/src/it/mcompiler-21_methodname-change: ./ invoker.properties pom.xml src/ src/main/ src/main/java/ src/main/java/BeanA.java src/main/java/BeanA2.java verify.groovy

Author: rfscholte
Date: Tue Sep  4 17:46:43 2012
New Revision: 1380754

URL: http://svn.apache.org/viewvc?rev=1380754&view=rev
Log:
One testcase for MCOMPILER-21: if a method changes, a depending class should fail with a compilation error.

Added:
    maven/plugins/trunk/maven-compiler-plugin/src/it/mcompiler-21_methodname-change/   (with props)
    maven/plugins/trunk/maven-compiler-plugin/src/it/mcompiler-21_methodname-change/invoker.properties
    maven/plugins/trunk/maven-compiler-plugin/src/it/mcompiler-21_methodname-change/pom.xml
    maven/plugins/trunk/maven-compiler-plugin/src/it/mcompiler-21_methodname-change/src/   (with props)
    maven/plugins/trunk/maven-compiler-plugin/src/it/mcompiler-21_methodname-change/src/main/   (with props)
    maven/plugins/trunk/maven-compiler-plugin/src/it/mcompiler-21_methodname-change/src/main/java/   (with props)
    maven/plugins/trunk/maven-compiler-plugin/src/it/mcompiler-21_methodname-change/src/main/java/BeanA.java
    maven/plugins/trunk/maven-compiler-plugin/src/it/mcompiler-21_methodname-change/src/main/java/BeanA2.java
    maven/plugins/trunk/maven-compiler-plugin/src/it/mcompiler-21_methodname-change/verify.groovy

Propchange: maven/plugins/trunk/maven-compiler-plugin/src/it/mcompiler-21_methodname-change/
------------------------------------------------------------------------------
    bugtraq:number = true

Added: maven/plugins/trunk/maven-compiler-plugin/src/it/mcompiler-21_methodname-change/invoker.properties
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-compiler-plugin/src/it/mcompiler-21_methodname-change/invoker.properties?rev=1380754&view=auto
==============================================================================
--- maven/plugins/trunk/maven-compiler-plugin/src/it/mcompiler-21_methodname-change/invoker.properties (added)
+++ maven/plugins/trunk/maven-compiler-plugin/src/it/mcompiler-21_methodname-change/invoker.properties Tue Sep  4 17:46:43 2012
@@ -0,0 +1,4 @@
+invoker.goals = clean compile
+invoker.goals.2 = org.codehaus.gmaven:gmaven-plugin:execute
+invoker.goals.3 = compile
+invoker.buildResult.3 = failure
\ No newline at end of file

Added: maven/plugins/trunk/maven-compiler-plugin/src/it/mcompiler-21_methodname-change/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-compiler-plugin/src/it/mcompiler-21_methodname-change/pom.xml?rev=1380754&view=auto
==============================================================================
--- maven/plugins/trunk/maven-compiler-plugin/src/it/mcompiler-21_methodname-change/pom.xml (added)
+++ maven/plugins/trunk/maven-compiler-plugin/src/it/mcompiler-21_methodname-change/pom.xml Tue Sep  4 17:46:43 2012
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+
+  <groupId>org.apache.maven.plugins.compiler.its</groupId>
+  <artifactId>mcompiler-21</artifactId>
+  <version>1.0-SNAPSHOT</version>
+
+  <build>
+    <pluginManagement>
+      <plugins>
+        <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-compiler-plugin</artifactId>
+          <version>@project.version@</version>
+        </plugin>      
+      </plugins>
+    </pluginManagement> 
+    <plugins>
+      <plugin>
+        <!-- Called as second invoker goal to simulate file adjustment -->
+        <groupId>org.codehaus.gmaven</groupId>
+        <artifactId>gmaven-plugin</artifactId>
+        <version>1.4</version>
+        <configuration>
+          <source>
+            def beanAFile = new File( project.basedir, 'src/main/java/BeanA.java' )
+            
+            processFileInplace( beanAFile ) { text -> 
+              text.replaceAll( /getI/, 'getI_doesntexistanymore')
+            }
+            
+            def processFileInplace(file, Closure processText) {
+              def text = file.text
+              file.write(processText(text))
+            }
+          </source>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+</project>
\ No newline at end of file

Propchange: maven/plugins/trunk/maven-compiler-plugin/src/it/mcompiler-21_methodname-change/src/
------------------------------------------------------------------------------
    bugtraq:number = true

Propchange: maven/plugins/trunk/maven-compiler-plugin/src/it/mcompiler-21_methodname-change/src/main/
------------------------------------------------------------------------------
    bugtraq:number = true

Propchange: maven/plugins/trunk/maven-compiler-plugin/src/it/mcompiler-21_methodname-change/src/main/java/
------------------------------------------------------------------------------
    bugtraq:number = true

Added: maven/plugins/trunk/maven-compiler-plugin/src/it/mcompiler-21_methodname-change/src/main/java/BeanA.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-compiler-plugin/src/it/mcompiler-21_methodname-change/src/main/java/BeanA.java?rev=1380754&view=auto
==============================================================================
--- maven/plugins/trunk/maven-compiler-plugin/src/it/mcompiler-21_methodname-change/src/main/java/BeanA.java (added)
+++ maven/plugins/trunk/maven-compiler-plugin/src/it/mcompiler-21_methodname-change/src/main/java/BeanA.java Tue Sep  4 17:46:43 2012
@@ -0,0 +1,15 @@
+/**
+ * dumb test bean
+ */
+public class BeanA {
+
+    private int i,y;
+
+    public int getI() {
+        return i;
+    }
+
+    public void setI(int i) {
+        this.i = i;
+    }
+}

Added: maven/plugins/trunk/maven-compiler-plugin/src/it/mcompiler-21_methodname-change/src/main/java/BeanA2.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-compiler-plugin/src/it/mcompiler-21_methodname-change/src/main/java/BeanA2.java?rev=1380754&view=auto
==============================================================================
--- maven/plugins/trunk/maven-compiler-plugin/src/it/mcompiler-21_methodname-change/src/main/java/BeanA2.java (added)
+++ maven/plugins/trunk/maven-compiler-plugin/src/it/mcompiler-21_methodname-change/src/main/java/BeanA2.java Tue Sep  4 17:46:43 2012
@@ -0,0 +1,16 @@
+/**
+ * dumb test bean
+ */
+public class BeanA2 {
+
+    private int i;
+    private BeanA beanA;
+
+    public int getI() {
+        return beanA.getI();
+    }
+
+    public void setI(int i) {
+        beanA.setI(i);
+    }
+}

Added: maven/plugins/trunk/maven-compiler-plugin/src/it/mcompiler-21_methodname-change/verify.groovy
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-compiler-plugin/src/it/mcompiler-21_methodname-change/verify.groovy?rev=1380754&view=auto
==============================================================================
--- maven/plugins/trunk/maven-compiler-plugin/src/it/mcompiler-21_methodname-change/verify.groovy (added)
+++ maven/plugins/trunk/maven-compiler-plugin/src/it/mcompiler-21_methodname-change/verify.groovy Tue Sep  4 17:46:43 2012
@@ -0,0 +1,24 @@
+
+/*
+ * 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.
+ */
+def logFile = new File( basedir, 'build.log' )
+assert logFile.exists()
+content = logFile.text
+
+assert content.contains( 'COMPILATION ERROR :' )