aboutsummaryrefslogtreecommitdiffstats
path: root/archiva-reports-standard
diff options
context:
space:
mode:
authorBrett Porter <brett@apache.org>2006-09-06 02:08:31 +0000
committerBrett Porter <brett@apache.org>2006-09-06 02:08:31 +0000
commit6ba2e4dc2d27c8a4dc55ec4729be8bf50fb19b38 (patch)
tree329a7d54b9c2c479abba6bcf5836e353c9d83cc2 /archiva-reports-standard
parent201211ad994da14fbda851bd17a427e96a921bf2 (diff)
downloadarchiva-6ba2e4dc2d27c8a4dc55ec4729be8bf50fb19b38.tar.gz
archiva-6ba2e4dc2d27c8a4dc55ec4729be8bf50fb19b38.zip
[MRM-161] extract an interface for results
git-svn-id: https://svn.apache.org/repos/asf/maven/archiva/trunk@440570 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-reports-standard')
-rw-r--r--archiva-reports-standard/src/main/java/org/apache/maven/archiva/reporting/RepositoryMetadataResult.java3
-rw-r--r--archiva-reports-standard/src/main/java/org/apache/maven/archiva/reporting/Result.java32
-rw-r--r--archiva-reports-standard/src/test/java/org/apache/maven/archiva/reporting/BadMetadataReportProcessorTest.java14
3 files changed, 41 insertions, 8 deletions
diff --git a/archiva-reports-standard/src/main/java/org/apache/maven/archiva/reporting/RepositoryMetadataResult.java b/archiva-reports-standard/src/main/java/org/apache/maven/archiva/reporting/RepositoryMetadataResult.java
index 1c84623a9..a3c13d844 100644
--- a/archiva-reports-standard/src/main/java/org/apache/maven/archiva/reporting/RepositoryMetadataResult.java
+++ b/archiva-reports-standard/src/main/java/org/apache/maven/archiva/reporting/RepositoryMetadataResult.java
@@ -22,9 +22,10 @@ import org.apache.maven.artifact.repository.metadata.RepositoryMetadata;
* A result of the report for a given artifact being processed.
*
* @author <a href="mailto:brett@apache.org">Brett Porter</a>
- * @version $Id$
+ * @version $Id:RepositoryMetadataResult.java 437105 2006-08-26 17:22:22 +1000 (Sat, 26 Aug 2006) brett $
*/
public class RepositoryMetadataResult
+ implements Result
{
private final RepositoryMetadata metadata;
diff --git a/archiva-reports-standard/src/main/java/org/apache/maven/archiva/reporting/Result.java b/archiva-reports-standard/src/main/java/org/apache/maven/archiva/reporting/Result.java
new file mode 100644
index 000000000..544113409
--- /dev/null
+++ b/archiva-reports-standard/src/main/java/org/apache/maven/archiva/reporting/Result.java
@@ -0,0 +1,32 @@
+package org.apache.maven.archiva.reporting;
+
+/*
+ * Copyright 2005-2006 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.
+ */
+
+/**
+ * A result record during the reporting.
+ *
+ * @author <a href="mailto:brett@apache.org">Brett Porter</a>
+ */
+public interface Result
+{
+ /**
+ * The reason given for the result.
+ *
+ * @return the message
+ */
+ String getReason();
+}
diff --git a/archiva-reports-standard/src/test/java/org/apache/maven/archiva/reporting/BadMetadataReportProcessorTest.java b/archiva-reports-standard/src/test/java/org/apache/maven/archiva/reporting/BadMetadataReportProcessorTest.java
index 30a60b1b3..79636c6f1 100644
--- a/archiva-reports-standard/src/test/java/org/apache/maven/archiva/reporting/BadMetadataReportProcessorTest.java
+++ b/archiva-reports-standard/src/test/java/org/apache/maven/archiva/reporting/BadMetadataReportProcessorTest.java
@@ -192,7 +192,7 @@ public class BadMetadataReportProcessorTest
Iterator failures = reporter.getRepositoryMetadataFailureIterator();
assertTrue( "check there is a failure", failures.hasNext() );
- RepositoryMetadataResult result = (RepositoryMetadataResult) failures.next();
+ Result result = (Result) failures.next();
// TODO: should be more robust
assertEquals( "check reason", "Metadata plugin missing-plugin not found in the repository",
result.getReason() );
@@ -209,7 +209,7 @@ public class BadMetadataReportProcessorTest
Iterator failures = reporter.getRepositoryMetadataFailureIterator();
assertTrue( "check there is a failure", failures.hasNext() );
- RepositoryMetadataResult result = (RepositoryMetadataResult) failures.next();
+ Result result = (Result) failures.next();
// TODO: should be more robust
assertEquals( "check reason",
"Plugin snapshot-artifact is present in the repository but " + "missing in the metadata.",
@@ -230,11 +230,11 @@ public class BadMetadataReportProcessorTest
Iterator failures = reporter.getRepositoryMetadataFailureIterator();
assertTrue( "check there is a failure", failures.hasNext() );
- RepositoryMetadataResult result = (RepositoryMetadataResult) failures.next();
+ Result result = (Result) failures.next();
// TODO: should be more robust
assertEquals( "check reason", "Missing or empty artifactId in group metadata.", result.getReason() );
assertTrue( "check there is a 2nd failure", failures.hasNext() );
- result = (RepositoryMetadataResult) failures.next();
+ result = (Result) failures.next();
// TODO: should be more robust
assertEquals( "check reason", "Missing or empty artifactId in group metadata.", result.getReason() );
assertFalse( "check no more failures", failures.hasNext() );
@@ -251,11 +251,11 @@ public class BadMetadataReportProcessorTest
Iterator failures = reporter.getRepositoryMetadataFailureIterator();
assertTrue( "check there is a failure", failures.hasNext() );
- RepositoryMetadataResult result = (RepositoryMetadataResult) failures.next();
+ Result result = (Result) failures.next();
// TODO: should be more robust
assertEquals( "check reason", "Missing or empty plugin prefix for artifactId artifactId.", result.getReason() );
assertTrue( "check there is a 2nd failure", failures.hasNext() );
- result = (RepositoryMetadataResult) failures.next();
+ result = (Result) failures.next();
// TODO: should be more robust
assertEquals( "check reason", "Missing or empty plugin prefix for artifactId snapshot-artifact.",
result.getReason() );
@@ -273,7 +273,7 @@ public class BadMetadataReportProcessorTest
Iterator failures = reporter.getRepositoryMetadataFailureIterator();
assertTrue( "check there is a failure", failures.hasNext() );
- RepositoryMetadataResult result = (RepositoryMetadataResult) failures.next();
+ Result result = (Result) failures.next();
// TODO: should be more robust
assertEquals( "check reason", "Duplicate plugin prefix found: default.", result.getReason() );
assertFalse( "check no more failures", failures.hasNext() );