Validation report complete

Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-language/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-taverna-language/commit/76e10395
Tree: 
http://git-wip-us.apache.org/repos/asf/incubator-taverna-language/tree/76e10395
Diff: 
http://git-wip-us.apache.org/repos/asf/incubator-taverna-language/diff/76e10395

Branch: refs/heads/master
Commit: 76e10395b217163ebda5f1540001610855001a12
Parents: 06bef78
Author: Menaka Madushanka <[email protected]>
Authored: Sat Jul 25 00:37:04 2015 +0530
Committer: Menaka Madushanka <[email protected]>
Committed: Sat Jul 25 00:37:04 2015 +0530

----------------------------------------------------------------------
 .../robundle/validator/ValidationReport.java    | 77 ++++++++++++++++++--
 1 file changed, 71 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-taverna-language/blob/76e10395/taverna-robundle/src/main/java/org/apache/taverna/robundle/validator/ValidationReport.java
----------------------------------------------------------------------
diff --git 
a/taverna-robundle/src/main/java/org/apache/taverna/robundle/validator/ValidationReport.java
 
b/taverna-robundle/src/main/java/org/apache/taverna/robundle/validator/ValidationReport.java
index 04f6539..a8b03ac 100644
--- 
a/taverna-robundle/src/main/java/org/apache/taverna/robundle/validator/ValidationReport.java
+++ 
b/taverna-robundle/src/main/java/org/apache/taverna/robundle/validator/ValidationReport.java
@@ -1,37 +1,102 @@
 package org.apache.taverna.robundle.validator;
 
+/*
+ * 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.util.ArrayList;
 
+
+/*
+ * Class for the validation report
+ * There are basically 3 types of errors. 
+ *     1. Errors :- If listed aggregate/s are not found in the bundle
+ *     2. Warnings :- If there are any external url is listed under aggregates.
+ *     3. Info level warning :- If there are resources which are not included 
in the manifest
+ * 
+ * Output format
+ *     To get the output, the get methods must be called.
+ *     If there are no specific errors/ warnings then, "The bundle has no 
warnings/ errors" will be returned
+ *     If there are errors or warnings, 
+ *             Aggregates not found errors: List of aggregates which are not 
found
+ *             Info level warning : list of files/ resources
+ *             Warnings: list of urls
+ * */
 public class ValidationReport {
        
+       //For aggregate not found errors
        private ArrayList<String> errorList;
        
+       //For info level warnings
        private ArrayList<String> infoWarnings;
        
+       //For warnings
        private ArrayList<String> warnings;
        
        public ValidationReport(){
                
        }
 
-       public ArrayList<String> getErrorList() {
-               return errorList;
+       public String getErrorList() {
+               String errors = "";
+               if(this.errorList.size()!=0){
+                       for(String e : this.errorList){
+                               errors += e + "\n";
+                       }
+               }else{
+                       return "The ro bundle has no errors";
+               }
+               
+               return "Aggregate not found errors: " +"\n"+ errors;
        }
 
        public void setErrorList(ArrayList<String> errorList) {
                this.errorList = errorList;
        }
 
-       public ArrayList<String> getInfoWarnings() {
-               return infoWarnings;
+       public String getInfoWarnings() {
+               String warning = "";
+               if(this.warnings.size()!=0){
+                       for(String w : this.warnings){
+                               warning += w + "\n";
+                       }
+               }else{
+                       return "The bundle has no warnings";
+               }
+               return "Warnings" + "\n" + warning;
        }
 
        public void setInfoWarnings(ArrayList<String> infoWarnings) {
                this.infoWarnings = infoWarnings;
        }
 
-       public ArrayList<String> getWarnings() {
-               return warnings;
+       public String getWarnings() {
+               String infoWarning = "";
+               
+               if(this.infoWarnings.size()!=0){
+                       for(String iw : this.infoWarnings){
+                               infoWarning += iw + "\n";
+                       }
+               }else{
+                       return "The Bundle has no Info level warnings";
+               }
+               return "Info-Level warnings: " +"\n"+infoWarning;
+               
        }
 
        public void setWarnings(ArrayList<String> warnings) {

Reply via email to