archiva-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r440570 - in /maven/archiva/trunk/archiva-reports-standard/src: main/java/org/apache/maven/archiva/reporting/ test/java/org/apache/maven/archiva/reporting/
Date Wed, 06 Sep 2006 02:08:32 GMT
Author: brett
Date: Tue Sep  5 19:08:31 2006
New Revision: 440570

URL: http://svn.apache.org/viewvc?view=rev&rev=440570
Log:
[MRM-161] extract an interface for results

Added:
    maven/archiva/trunk/archiva-reports-standard/src/main/java/org/apache/maven/archiva/reporting/Result.java
  (with props)
Modified:
    maven/archiva/trunk/archiva-reports-standard/src/main/java/org/apache/maven/archiva/reporting/RepositoryMetadataResult.java
    maven/archiva/trunk/archiva-reports-standard/src/test/java/org/apache/maven/archiva/reporting/BadMetadataReportProcessorTest.java

Modified: maven/archiva/trunk/archiva-reports-standard/src/main/java/org/apache/maven/archiva/reporting/RepositoryMetadataResult.java
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-reports-standard/src/main/java/org/apache/maven/archiva/reporting/RepositoryMetadataResult.java?view=diff&rev=440570&r1=440569&r2=440570
==============================================================================
--- maven/archiva/trunk/archiva-reports-standard/src/main/java/org/apache/maven/archiva/reporting/RepositoryMetadataResult.java
(original)
+++ maven/archiva/trunk/archiva-reports-standard/src/main/java/org/apache/maven/archiva/reporting/RepositoryMetadataResult.java
Tue Sep  5 19:08:31 2006
@@ -22,9 +22,10 @@
  * 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;
 

Added: maven/archiva/trunk/archiva-reports-standard/src/main/java/org/apache/maven/archiva/reporting/Result.java
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-reports-standard/src/main/java/org/apache/maven/archiva/reporting/Result.java?view=auto&rev=440570
==============================================================================
--- maven/archiva/trunk/archiva-reports-standard/src/main/java/org/apache/maven/archiva/reporting/Result.java
(added)
+++ maven/archiva/trunk/archiva-reports-standard/src/main/java/org/apache/maven/archiva/reporting/Result.java
Tue Sep  5 19:08:31 2006
@@ -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();
+}

Propchange: maven/archiva/trunk/archiva-reports-standard/src/main/java/org/apache/maven/archiva/reporting/Result.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: maven/archiva/trunk/archiva-reports-standard/src/test/java/org/apache/maven/archiva/reporting/BadMetadataReportProcessorTest.java
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-reports-standard/src/test/java/org/apache/maven/archiva/reporting/BadMetadataReportProcessorTest.java?view=diff&rev=440570&r1=440569&r2=440570
==============================================================================
--- maven/archiva/trunk/archiva-reports-standard/src/test/java/org/apache/maven/archiva/reporting/BadMetadataReportProcessorTest.java
(original)
+++ maven/archiva/trunk/archiva-reports-standard/src/test/java/org/apache/maven/archiva/reporting/BadMetadataReportProcessorTest.java
Tue Sep  5 19:08:31 2006
@@ -192,7 +192,7 @@
 
         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 @@
 
         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 @@
 
         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 @@
 
         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 @@
 
         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() );



Mime
View raw message