Starting testing
Project: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/commit/0433b1e0 Tree: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/tree/0433b1e0 Diff: http://git-wip-us.apache.org/repos/asf/commons-release-plugin/diff/0433b1e0 Branch: refs/heads/master Commit: 0433b1e0cb93f82f26561a3c98d9c5cd0a93919f Parents: a5557ab Author: Rob Tompkins <christopher.tompk...@capitalone.com> Authored: Fri Jan 5 16:02:36 2018 -0500 Committer: Rob Tompkins <christopher.tompk...@capitalone.com> Committed: Fri Jan 5 16:02:36 2018 -0500 ---------------------------------------------------------------------- pom.xml | 22 ++++++++++ .../mojos/CommonsSiteCompressionMojoTest.java | 44 ++++++++++++++++++++ .../release/plugin/mojos/package-info.java | 17 ++++++++ .../release/plugin/stubs/MavenProjectStub.java | 20 +++++++++ .../release/plugin/stubs/package-info.java | 17 ++++++++ .../mojos/compress-site/compress-site.xml | 34 +++++++++++++++ .../mojos/compress-site/example-site/index.html | 6 +++ 7 files changed, 160 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/0433b1e0/pom.xml ---------------------------------------------------------------------- diff --git a/pom.xml b/pom.xml index c79db7c..24e5da3 100644 --- a/pom.xml +++ b/pom.xml @@ -133,6 +133,28 @@ <version>1.15</version> </dependency> <dependency> + <groupId>org.codehaus.plexus</groupId> + <artifactId>plexus-utils</artifactId> + <version>3.0.24</version> + </dependency> + <dependency> + <groupId>org.jdom</groupId> + <artifactId>jdom</artifactId> + <version>1.1.3</version> + </dependency> + <dependency> + <groupId>org.mockito</groupId> + <artifactId>mockito-core</artifactId> + <version>1.9.5</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.apache.maven.plugin-testing</groupId> + <artifactId>maven-plugin-testing-harness</artifactId> + <version>3.3.0</version> + <scope>test</scope> + </dependency> + <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.12</version> http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/0433b1e0/src/test/java/org/apache/commons/release/plugin/mojos/CommonsSiteCompressionMojoTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/release/plugin/mojos/CommonsSiteCompressionMojoTest.java b/src/test/java/org/apache/commons/release/plugin/mojos/CommonsSiteCompressionMojoTest.java new file mode 100644 index 0000000..745a297 --- /dev/null +++ b/src/test/java/org/apache/commons/release/plugin/mojos/CommonsSiteCompressionMojoTest.java @@ -0,0 +1,44 @@ +/* + * 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. + */ +package org.apache.commons.release.plugin.mojos; + +import org.apache.maven.plugin.MojoExecutionException; +import org.apache.maven.plugin.MojoFailureException; +import org.apache.maven.plugin.testing.AbstractMojoTestCase; + +import java.io.File; + +/** + * Unit tests for {@link CommonsSiteCompressionMojo}. + * + * @author chtompki + * @since 1.0 + */ +public class CommonsSiteCompressionMojoTest extends AbstractMojoTestCase { + + protected CommonsSiteCompressionMojo mojo; + + protected void setUp() throws Exception { + super.setUp(); + File testFile = getTestFile("target/test-classes/mojos/compress-site/compress-site.xml"); + mojo = (CommonsSiteCompressionMojo) lookupMojo("compress-site", testFile); + } + + public void testCompressSite() throws MojoExecutionException, MojoFailureException { + mojo.execute(); + } +} http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/0433b1e0/src/test/java/org/apache/commons/release/plugin/mojos/package-info.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/release/plugin/mojos/package-info.java b/src/test/java/org/apache/commons/release/plugin/mojos/package-info.java new file mode 100644 index 0000000..32828f0 --- /dev/null +++ b/src/test/java/org/apache/commons/release/plugin/mojos/package-info.java @@ -0,0 +1,17 @@ +/* + * 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. + */ +package org.apache.commons.release.plugin.mojos; \ No newline at end of file http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/0433b1e0/src/test/java/org/apache/commons/release/plugin/stubs/MavenProjectStub.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/release/plugin/stubs/MavenProjectStub.java b/src/test/java/org/apache/commons/release/plugin/stubs/MavenProjectStub.java new file mode 100644 index 0000000..3a7e104 --- /dev/null +++ b/src/test/java/org/apache/commons/release/plugin/stubs/MavenProjectStub.java @@ -0,0 +1,20 @@ +/* + * 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. + */ +package org.apache.commons.release.plugin.stubs; + +public class MavenProjectStub { +} http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/0433b1e0/src/test/java/org/apache/commons/release/plugin/stubs/package-info.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/release/plugin/stubs/package-info.java b/src/test/java/org/apache/commons/release/plugin/stubs/package-info.java new file mode 100644 index 0000000..95d9137 --- /dev/null +++ b/src/test/java/org/apache/commons/release/plugin/stubs/package-info.java @@ -0,0 +1,17 @@ +/* + * 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. + */ +package org.apache.commons.release.plugin.stubs; \ No newline at end of file http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/0433b1e0/src/test/resources/mojos/compress-site/compress-site.xml ---------------------------------------------------------------------- diff --git a/src/test/resources/mojos/compress-site/compress-site.xml b/src/test/resources/mojos/compress-site/compress-site.xml new file mode 100644 index 0000000..8bdcf5b --- /dev/null +++ b/src/test/resources/mojos/compress-site/compress-site.xml @@ -0,0 +1,34 @@ +<?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> + <build> + <plugins> + <plugin> + <artifactId>commons-release-plugin</artifactId> + <configuration> + <siteDirectory>${basedir}/target/test-classes/mojos/compress-site/example-site</siteDirectory> + <goals>site-deploy</goals> + <useReleaseProfile>true</useReleaseProfile> + </configuration> + </plugin> + </plugins> + </build> +</project> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/commons-release-plugin/blob/0433b1e0/src/test/resources/mojos/compress-site/example-site/index.html ---------------------------------------------------------------------- diff --git a/src/test/resources/mojos/compress-site/example-site/index.html b/src/test/resources/mojos/compress-site/example-site/index.html new file mode 100644 index 0000000..515cdbe --- /dev/null +++ b/src/test/resources/mojos/compress-site/example-site/index.html @@ -0,0 +1,6 @@ +<html> +<header><title>Mock maven site</title></header> +<body> +mock body +</body> +</html> \ No newline at end of file