You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@taverna.apache.org by st...@apache.org on 2015/06/25 15:09:03 UTC

[1/5] incubator-taverna-language git commit: airline version added

Repository: incubator-taverna-language
Updated Branches:
  refs/heads/master 2f8966a0f -> ed4d4c7ef


airline version added

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/da4bbca7
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-language/tree/da4bbca7
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-language/diff/da4bbca7

Branch: refs/heads/master
Commit: da4bbca7781b4cae4bb8a80e957acf2f5f7a07ee
Parents: 2f8966a
Author: Menaka Madushanka <me...@gmail.com>
Authored: Wed Jun 24 18:42:52 2015 +0530
Committer: Menaka Madushanka <me...@gmail.com>
Committed: Wed Jun 24 18:42:52 2015 +0530

----------------------------------------------------------------------
 taverna-language-commandline/pom.xml | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-taverna-language/blob/da4bbca7/taverna-language-commandline/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-language-commandline/pom.xml b/taverna-language-commandline/pom.xml
index 0616f66..ed21443 100644
--- a/taverna-language-commandline/pom.xml
+++ b/taverna-language-commandline/pom.xml
@@ -96,6 +96,7 @@
         <dependency>
 	    	<groupId>io.airlift</groupId>
 	    	<artifactId>airline</artifactId>
+	    	<version>0.7</version>
 		</dependency>
 	
         


[4/5] incubator-taverna-language git commit: airline version from super-pom

Posted by st...@apache.org.
airline version from super-pom


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/979b35c0
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-language/tree/979b35c0
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-language/diff/979b35c0

Branch: refs/heads/master
Commit: 979b35c0f7dc2b9d1e7f387e0f0dca922ce81f38
Parents: 2f8966a
Author: Stian Soiland-Reyes <st...@apache.org>
Authored: Thu Jun 25 14:05:41 2015 +0100
Committer: Stian Soiland-Reyes <st...@apache.org>
Committed: Thu Jun 25 14:05:41 2015 +0100

----------------------------------------------------------------------
 pom.xml                              | 2 +-
 taverna-language-commandline/pom.xml | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-taverna-language/blob/979b35c0/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index c417868..50b74d8 100644
--- a/pom.xml
+++ b/pom.xml
@@ -20,7 +20,7 @@
 	<parent>
 		<groupId>org.apache.taverna</groupId>
 		<artifactId>taverna-parent</artifactId>
-		<version>1-incubating-SNAPSHOT</version>
+		<version>2-incubating-SNAPSHOT</version>
 	</parent>
 	<groupId>org.apache.taverna.language</groupId>
 	<artifactId>taverna-language</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-taverna-language/blob/979b35c0/taverna-language-commandline/pom.xml
----------------------------------------------------------------------
diff --git a/taverna-language-commandline/pom.xml b/taverna-language-commandline/pom.xml
index 0616f66..10d1072 100644
--- a/taverna-language-commandline/pom.xml
+++ b/taverna-language-commandline/pom.xml
@@ -20,7 +20,7 @@
     <parent>
       	<groupId>org.apache.taverna.language</groupId>
       	<artifactId>taverna-language</artifactId>
-      	<version>0.15.0-incubating-SNAPSHOT</version>
+      	<version>0.15.1-incubating-SNAPSHOT</version>
     </parent>
     <artifactId>taverna-language-commandline</artifactId>
     <name>Apache Taverna Language Commandline</name>
@@ -96,6 +96,7 @@
         <dependency>
 	    	<groupId>io.airlift</groupId>
 	    	<artifactId>airline</artifactId>
+        <version>${io.airlift.airline.version}</version>
 		</dependency>
 	
         


[2/5] incubator-taverna-language git commit: Validation added

Posted by st...@apache.org.
Validation added

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/90551c0b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-language/tree/90551c0b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-language/diff/90551c0b

Branch: refs/heads/master
Commit: 90551c0b6e179bd247cf4b2c84869095da205b46
Parents: da4bbca
Author: Menaka Madushanka <me...@gmail.com>
Authored: Wed Jun 24 19:19:14 2015 +0530
Committer: Menaka Madushanka <me...@gmail.com>
Committed: Wed Jun 24 19:19:14 2015 +0530

----------------------------------------------------------------------
 .../tavlang/tools/validate/Validate.java        | 110 +++++++++++++++++--
 1 file changed, 100 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-taverna-language/blob/90551c0b/taverna-language-commandline/src/main/java/org/apache/taverna/tavlang/tools/validate/Validate.java
----------------------------------------------------------------------
diff --git a/taverna-language-commandline/src/main/java/org/apache/taverna/tavlang/tools/validate/Validate.java b/taverna-language-commandline/src/main/java/org/apache/taverna/tavlang/tools/validate/Validate.java
index 572679f..5cb0c47 100644
--- a/taverna-language-commandline/src/main/java/org/apache/taverna/tavlang/tools/validate/Validate.java
+++ b/taverna-language-commandline/src/main/java/org/apache/taverna/tavlang/tools/validate/Validate.java
@@ -19,20 +19,110 @@ package org.apache.taverna.tavlang.tools.validate;
  * under the License.
  */
 
-import org.apache.taverna.scufl2.api.container.WorkflowBundle;
-import org.apache.taverna.scufl2.validation.ValidationReport;
-import org.apache.taverna.scufl2.validation.Validator;
-import org.apache.taverna.scufl2.validation.structural.StructuralValidationListener;
-import org.apache.taverna.scufl2.validation.structural.StructuralValidator;
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.List;
 
+import org.apache.taverna.scufl2.api.container.WorkflowBundle;
+import org.apache.taverna.scufl2.api.io.ReaderException;
+import org.apache.taverna.scufl2.api.io.WorkflowBundleIO;
+import org.apache.taverna.scufl2.validation.correctness.CorrectnessValidationListener;
+import org.apache.taverna.scufl2.validation.correctness.CorrectnessValidator;
+import org.apache.taverna.scufl2.validation.correctness.ReportCorrectnessValidationListener;
 
+/*
+ * Takes .wfbundle/ .t2flow as the input
+ * */
 public class Validate {
 
-	public Validate(WorkflowBundle wfb){
+	private String logfile;
+	private String finalrep = "";
+
+	public Validate(List<String> files, String file) {
+		this.logfile = file;
+		for (String f : files) {
+			File wfile = new File(f);
+			read(wfile);
+		}
+	}
+
+	public void read(File file) {
+		WorkflowBundleIO io = new WorkflowBundleIO();
+		try {
+			this.finalrep += validate(io.readBundle(file, null), file.getName());
+			if (this.logfile != null) {
+				saveToLog(finalrep);
+			}
+		} catch (ReaderException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+
+		} catch (IOException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+
+		}
+	}
+
+	public String validate(WorkflowBundle wfb, String file) {
 		System.out.println("Validation started...");
-		StructuralValidator v = new StructuralValidator();
-		StructuralValidationListener l = v.validate(wfb);
-		ValidationReport r;
+		StringBuilder report2 = new StringBuilder();
+		CorrectnessValidationListener r = new ReportCorrectnessValidationListener();
+		CorrectnessValidator v = new CorrectnessValidator();
+		r = v.validate(wfb);
+		String report = r.toString().replace(
+				"ReportCorrectnessValidationListener [", "");
+
+		String[] sections = report.split(", ");
+		HashMap<String, String> map = new HashMap<>();
+
+		System.out.println("Validation completed.......");
+
+		if (!r.detectedProblems()){
+			report2.append("The workflow " + file + " has no errors. \n\n");
+		}
+			
+		
+//		System.out.println("The validation report for " + file);
+		report2.append("The validation report for " + file + "......\n");
+		report2.append("-------------------------------------------------------------------------------- \n");
+		for (int i = 0; i < sections.length; i++) {
+			String line = "-->"+sections[i].split("=")[0].replace("()", "").replace(
+					"get", "")
+					+ ":- ";
+			report2.append(line);
+			String line2 =  sections[i].split("=")[1].replace("[", "").replace("]","");
+			if(line2.equals("")) report2.append("null \n\n");
+			else report2.append("\t").append(line2).append("\n");
+			
+		
+		}
+		report2.append("--------------------------------------------------------------------------------- \n\n");
+		
+		if(r.detectedProblems())
+			System.out.println(report2.toString());
+		
+		return report2.toString();
+
 	}
-	
+
+	public void saveToLog(String s) {
+		File logFile = new File(this.logfile);
+		FileWriter logwriter;
+		try {
+			logwriter = new FileWriter(logFile);
+			BufferedWriter blw = new BufferedWriter(logwriter);
+			blw.write(s);
+			blw.close();
+			logwriter.close();
+		} catch (IOException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}
+
+	}
+
 }


[5/5] incubator-taverna-language git commit: Merge remote-tracking branch 'menaka/validate'

Posted by st...@apache.org.
Merge remote-tracking branch 'menaka/validate'

>From Menaka Madushanka

This closes #7.

Conflicts:
	taverna-language-commandline/pom.xml


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/ed4d4c7e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-language/tree/ed4d4c7e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-language/diff/ed4d4c7e

Branch: refs/heads/master
Commit: ed4d4c7ef70ed923f447d01e3fffaa2e76ccfaa4
Parents: 979b35c 1c0e93f
Author: Stian Soiland-Reyes <st...@apache.org>
Authored: Thu Jun 25 14:07:45 2015 +0100
Committer: Stian Soiland-Reyes <st...@apache.org>
Committed: Thu Jun 25 14:08:18 2015 +0100

----------------------------------------------------------------------
 .../apache/taverna/tavlang/CommandLineTool.java |  17 +--
 .../tavlang/tools/validate/Validate.java        | 110 +++++++++++++++++--
 2 files changed, 110 insertions(+), 17 deletions(-)
----------------------------------------------------------------------



[3/5] incubator-taverna-language git commit: validation added

Posted by st...@apache.org.
validation added

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/1c0e93fe
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-language/tree/1c0e93fe
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-language/diff/1c0e93fe

Branch: refs/heads/master
Commit: 1c0e93fe139b80b892c388949751b7724d18f9db
Parents: 90551c0
Author: Menaka Madushanka <me...@gmail.com>
Authored: Wed Jun 24 19:23:44 2015 +0530
Committer: Menaka Madushanka <me...@gmail.com>
Committed: Wed Jun 24 19:23:44 2015 +0530

----------------------------------------------------------------------
 .../apache/taverna/tavlang/CommandLineTool.java    | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-taverna-language/blob/1c0e93fe/taverna-language-commandline/src/main/java/org/apache/taverna/tavlang/CommandLineTool.java
----------------------------------------------------------------------
diff --git a/taverna-language-commandline/src/main/java/org/apache/taverna/tavlang/CommandLineTool.java b/taverna-language-commandline/src/main/java/org/apache/taverna/tavlang/CommandLineTool.java
index 39db384..eb56801 100644
--- a/taverna-language-commandline/src/main/java/org/apache/taverna/tavlang/CommandLineTool.java
+++ b/taverna-language-commandline/src/main/java/org/apache/taverna/tavlang/CommandLineTool.java
@@ -42,6 +42,7 @@ import org.apache.taverna.tavlang.tools.convert.Scufl2Convert;
 import org.apache.taverna.tavlang.tools.convert.ToRobundle;
 import org.apache.taverna.tavlang.tools.inspect.ProcessorNames;
 import org.apache.taverna.tavlang.tools.inspect.ServiceTypes;
+import org.apache.taverna.tavlang.tools.validate.Validate;
 
 import com.google.common.base.Joiner;
 import com.google.common.collect.Lists;
@@ -257,20 +258,22 @@ public class CommandLineTool {
 	//Command for validation
 	@Command(name = "validate", description = "validate the given workflow")
 	public static class CommandValidate extends TvnLangTool{
-
-		@Inject
-		Optional optional = new Optional();
+		@Option(name = { "-l", "--log" }, description = "Specify the file name where results should be stored ([some dir]/log.txt)")
+		public String file;
 		
-		@Arguments(usage="<option> <input files> <output dir>", description="Validate the given workflow file/s")
+//		@Inject
+//		Optional optional = new Optional();
+
+//		@Arguments(usage = "<option> <input files> <output dir>", description = "Validate the given workflow file/s")
+		@Arguments(usage = "input files", description = "Validate the given workflow file/s")
 		public List<String> toValidate = Lists.newArrayList();
-		
+
 		@Override
 		public void execute() {
 			// TODO Auto-generated method stub
 			
+				Validate validate = new Validate(toValidate, file);
 		}
-		
 	}
 	
-	
 }