You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by ol...@apache.org on 2012/01/06 14:07:46 UTC
svn commit: r1228165 - in
/maven/plugins/trunk/maven-site-plugin/src/it/MSITE-627: ./ src/ src/main/
src/main/java/ src/main/java/org/ src/main/java/org/apache/
src/main/java/org/apache/maven/ src/main/java/org/apache/maven/plugins/
src/main/java/org/a...
Author: olamy
Date: Fri Jan 6 13:07:45 2012
New Revision: 1228165
URL: http://svn.apache.org/viewvc?rev=1228165&view=rev
Log:
[MSITE-627] upgrade to reporting-exec 1.0.2
add an it for MSHARED-219
Submitted by Gerhard Wipplinger.
Added:
maven/plugins/trunk/maven-site-plugin/src/it/MSITE-627/
maven/plugins/trunk/maven-site-plugin/src/it/MSITE-627/invoker.properties (with props)
maven/plugins/trunk/maven-site-plugin/src/it/MSITE-627/pom.xml (with props)
maven/plugins/trunk/maven-site-plugin/src/it/MSITE-627/src/
maven/plugins/trunk/maven-site-plugin/src/it/MSITE-627/src/main/
maven/plugins/trunk/maven-site-plugin/src/it/MSITE-627/src/main/java/
maven/plugins/trunk/maven-site-plugin/src/it/MSITE-627/src/main/java/org/
maven/plugins/trunk/maven-site-plugin/src/it/MSITE-627/src/main/java/org/apache/
maven/plugins/trunk/maven-site-plugin/src/it/MSITE-627/src/main/java/org/apache/maven/
maven/plugins/trunk/maven-site-plugin/src/it/MSITE-627/src/main/java/org/apache/maven/plugins/
maven/plugins/trunk/maven-site-plugin/src/it/MSITE-627/src/main/java/org/apache/maven/plugins/it/
maven/plugins/trunk/maven-site-plugin/src/it/MSITE-627/src/main/java/org/apache/maven/plugins/it/MyReport.java (with props)
maven/plugins/trunk/maven-site-plugin/src/it/MSITE-627/verify.bsh (with props)
Added: maven/plugins/trunk/maven-site-plugin/src/it/MSITE-627/invoker.properties
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-site-plugin/src/it/MSITE-627/invoker.properties?rev=1228165&view=auto
==============================================================================
--- maven/plugins/trunk/maven-site-plugin/src/it/MSITE-627/invoker.properties (added)
+++ maven/plugins/trunk/maven-site-plugin/src/it/MSITE-627/invoker.properties Fri Jan 6 13:07:45 2012
@@ -0,0 +1,4 @@
+invoker.goals.1 = clean
+invoker.goals.2 = install
+invoker.goals.3 = site
+invoker.maven.version = 3.0+
\ No newline at end of file
Propchange: maven/plugins/trunk/maven-site-plugin/src/it/MSITE-627/invoker.properties
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/trunk/maven-site-plugin/src/it/MSITE-627/invoker.properties
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: maven/plugins/trunk/maven-site-plugin/src/it/MSITE-627/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-site-plugin/src/it/MSITE-627/pom.xml?rev=1228165&view=auto
==============================================================================
--- maven/plugins/trunk/maven-site-plugin/src/it/MSITE-627/pom.xml (added)
+++ maven/plugins/trunk/maven-site-plugin/src/it/MSITE-627/pom.xml Fri Jan 6 13:07:45 2012
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+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.
+-->
+
+<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.site.its</groupId>
+ <artifactId>MSITE-627</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <packaging>maven-plugin</packaging>
+
+ <name>it-plugin-test Maven Mojo</name>
+ <url>http://maven.apache.org</url>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.maven.reporting</groupId>
+ <artifactId>maven-reporting-impl</artifactId>
+ <version>2.1</version>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-site-plugin</artifactId>
+ <version>@project.version@</version>
+ <configuration>
+ <reportPlugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins.site.its</groupId>
+ <artifactId>MSITE-627</artifactId>
+ <version>${project.version}</version>
+ </plugin>
+ </reportPlugins>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
+</project>
Propchange: maven/plugins/trunk/maven-site-plugin/src/it/MSITE-627/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/trunk/maven-site-plugin/src/it/MSITE-627/pom.xml
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: maven/plugins/trunk/maven-site-plugin/src/it/MSITE-627/src/main/java/org/apache/maven/plugins/it/MyReport.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-site-plugin/src/it/MSITE-627/src/main/java/org/apache/maven/plugins/it/MyReport.java?rev=1228165&view=auto
==============================================================================
--- maven/plugins/trunk/maven-site-plugin/src/it/MSITE-627/src/main/java/org/apache/maven/plugins/it/MyReport.java (added)
+++ maven/plugins/trunk/maven-site-plugin/src/it/MSITE-627/src/main/java/org/apache/maven/plugins/it/MyReport.java Fri Jan 6 13:07:45 2012
@@ -0,0 +1,74 @@
+package org.apache.maven.plugins.it;
+
+/*
+ * Copyright 2001-2005 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.doxia.sink.Sink;
+import org.apache.maven.doxia.sink.SinkAdapter;
+import org.apache.maven.doxia.siterenderer.Renderer;
+import org.apache.maven.project.MavenProject;
+import org.apache.maven.reporting.AbstractMavenReport;
+import org.apache.maven.reporting.MavenReportException;
+
+import java.util.Locale;
+
+/**
+ * Goal which creates a sink in a report.
+ *
+ * @goal test
+ * @phase site
+ */
+public class MyReport extends AbstractMavenReport {
+
+ public String getOutputName() {
+ return "MSITE-627";
+ }
+
+ public String getName(Locale locale) {
+ return "MSITE-627";
+ }
+
+ public String getDescription(Locale locale) {
+ return "Test Report for MSITE-672";
+ }
+
+ @Override
+ protected Renderer getSiteRenderer() {
+ return null;
+ }
+
+ @Override
+ protected String getOutputDirectory() {
+ return null;
+ }
+
+ @Override
+ protected MavenProject getProject() {
+ return null;
+ }
+
+ @Override
+ protected void executeReport(Locale locale) throws MavenReportException {
+ final Sink s = getSink();
+ final Sink sa = new SinkAdapter() {
+ @Override
+ public void text(String text) {
+ s.text(text.replace("OK", "passed"));
+ }
+ };
+ sa.text("Test OK");
+ }
+}
Propchange: maven/plugins/trunk/maven-site-plugin/src/it/MSITE-627/src/main/java/org/apache/maven/plugins/it/MyReport.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/trunk/maven-site-plugin/src/it/MSITE-627/src/main/java/org/apache/maven/plugins/it/MyReport.java
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: maven/plugins/trunk/maven-site-plugin/src/it/MSITE-627/verify.bsh
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-site-plugin/src/it/MSITE-627/verify.bsh?rev=1228165&view=auto
==============================================================================
--- maven/plugins/trunk/maven-site-plugin/src/it/MSITE-627/verify.bsh (added)
+++ maven/plugins/trunk/maven-site-plugin/src/it/MSITE-627/verify.bsh Fri Jan 6 13:07:45 2012
@@ -0,0 +1,57 @@
+
+/*
+ * 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.io.*;
+
+import org.codehaus.plexus.util.*;
+
+boolean result = true;
+
+try
+{
+ final File siteDirectory = new File( basedir, "target/site" );
+ if ( !siteDirectory.exists() || !siteDirectory.isDirectory() )
+ {
+ System.err.println( "site is missing or not a directory." );
+ result = false;
+ }
+
+ File report = new File( siteDirectory, "MSITE-627.html" );
+ if ( !report.exists() || report.isDirectory() )
+ {
+ System.err.println( "no report file or is a directory." );
+ result = false;
+ }
+
+ String content = FileUtils.fileRead( report, "UTF-8" );
+ int index = content.indexOf( "Test passed" );
+ if ( index < 0 )
+ {
+ System.err.println( "MSITE-627.html has incorrect contents!" );
+ result = false;
+ }
+}
+catch ( IOException e )
+{
+ e.printStackTrace();
+ result = false;
+}
+
+return result;
Propchange: maven/plugins/trunk/maven-site-plugin/src/it/MSITE-627/verify.bsh
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/trunk/maven-site-plugin/src/it/MSITE-627/verify.bsh
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision