--- /dev/null
+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();
+}
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() );
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.",
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() );
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() );
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() );