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/07/15 14:20:50 UTC
[1/4] incubator-taverna-language git commit: added a test for the ro
history
Repository: incubator-taverna-language
Updated Branches:
refs/heads/master 8c23bdbd4 -> 520487348
added a test for the ro history
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/74d9f2fe
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-language/tree/74d9f2fe
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-language/diff/74d9f2fe
Branch: refs/heads/master
Commit: 74d9f2fecf9dbdb56f67416cf6d52f308760d6cd
Parents: 3cf8cf7
Author: Martin Scharm <ma...@binfalse.de>
Authored: Tue Jul 14 12:41:17 2015 +0100
Committer: Martin Scharm <ma...@binfalse.de>
Committed: Tue Jul 14 12:41:17 2015 +0100
----------------------------------------------------------------------
.../robundle/manifest/TestManifestJSON.java | 45 ++++++++++++++++++++
1 file changed, 45 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-taverna-language/blob/74d9f2fe/taverna-robundle/src/test/java/org/apache/taverna/robundle/manifest/TestManifestJSON.java
----------------------------------------------------------------------
diff --git a/taverna-robundle/src/test/java/org/apache/taverna/robundle/manifest/TestManifestJSON.java b/taverna-robundle/src/test/java/org/apache/taverna/robundle/manifest/TestManifestJSON.java
index efab8a9..ace81e0 100644
--- a/taverna-robundle/src/test/java/org/apache/taverna/robundle/manifest/TestManifestJSON.java
+++ b/taverna-robundle/src/test/java/org/apache/taverna/robundle/manifest/TestManifestJSON.java
@@ -24,7 +24,9 @@ import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+import java.io.IOException;
import java.net.URI;
import java.nio.file.Files;
import java.nio.file.Path;
@@ -45,6 +47,49 @@ import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
public class TestManifestJSON {
+
+ @Test
+ public void testHistory () throws IOException
+ {
+ Path tmpBundle = Files.createTempFile ("testbundle", "history");
+
+ // create history
+ try (Bundle bundle = Bundles.createBundle())
+ {
+ Manifest manifest = bundle.getManifest();
+ Path evolutionPath = bundle.getPath(".ro/evolution.ttl");
+ Files.createDirectories(evolutionPath.getParent());
+ Bundles.setStringValue(
+ evolutionPath,
+ "<manifest.json> < http://purl.org/pav/retrievedFrom> "
+ + "<http://wf4ever.github.io/ro/bundle/2013-05-21/example/.ro/manifest.json> .");
+ manifest.getHistory().add(evolutionPath);
+ assertTrue ("expected a history file", Files.exists (evolutionPath));
+ assertTrue ("expected a history", manifest.getHistory ().size () > 0);
+ Bundles.closeAndSaveBundle (bundle, tmpBundle);
+ }
+ catch (IOException e)
+ {
+ fail ("failed to create bundle for history test: " + e.getMessage ());
+ }
+
+ // check if history is still there
+ try (Bundle bundle = Bundles.openBundle (tmpBundle))
+ {
+ Manifest manifest = bundle.getManifest();
+ Path evolutionPath = bundle.getPath(".ro/evolution.ttl");
+ assertTrue ("expected a history file", Files.exists (evolutionPath));
+ assertTrue ("expected a history", manifest.getHistory ().size () > 0);
+ Bundles.closeBundle (bundle);
+ }
+ catch (IOException e)
+ {
+ fail ("failed to read bundle for history test: " + e.getMessage ());
+ }
+
+ Files.delete (tmpBundle);
+ }
+
@Test
public void createBundle() throws Exception {
// Create bundle as in Example 3 of the specification
[3/4] incubator-taverna-language git commit: Merge branch 'master' of
https://github.com/apache/incubator-taverna-language
Posted by st...@apache.org.
Merge branch 'master' of https://github.com/apache/incubator-taverna-language
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/6663d270
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-language/tree/6663d270
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-language/diff/6663d270
Branch: refs/heads/master
Commit: 6663d270390b710a5923d717cc33c41e75af4020
Parents: bcc31f8 a02f8b1
Author: Martin Scharm <ma...@binfalse.de>
Authored: Tue Jul 14 14:26:29 2015 +0100
Committer: Martin Scharm <ma...@binfalse.de>
Committed: Tue Jul 14 14:26:29 2015 +0100
----------------------------------------------------------------------
NOTICE | 2 +-
README.md | 62 +-
pom.xml | 6 +-
taverna-baclava-language/pom.xml | 2 +-
taverna-databundle/pom.xml | 2 +-
.../apache/taverna/tavlang/CommandLineTool.java | 11 +-
.../taverna/tavlang/test/Scufl2ConvertTest.java | 34 -
.../taverna/tavlang/test/TestConvert.java | 34 +
.../apache/taverna/tavlang/test/TestStats.java | 34 +
.../apache/taverna/tavlang/test/TestTools.java | 80 +
.../taverna/tavlang/test/TestValidate.java | 49 +
.../test/resources/workflows/t2flow/as.t2flow | 1674 ++++++++++++++++++
taverna-robundle/pom.xml | 2 +-
taverna-scufl2-annotation/pom.xml | 2 +-
taverna-scufl2-api/pom.xml | 2 +-
taverna-scufl2-examples/pom.xml | 2 +-
taverna-scufl2-integration-tests/pom.xml | 2 +-
taverna-scufl2-schemas/pom.xml | 2 +-
taverna-scufl2-scufl/pom.xml | 2 +-
taverna-scufl2-t2flow/pom.xml | 2 +-
taverna-scufl2-ucfpackage/pom.xml | 2 +-
taverna-scufl2-wfbundle/pom.xml | 2 +-
22 files changed, 1948 insertions(+), 62 deletions(-)
----------------------------------------------------------------------
[2/4] incubator-taverna-language git commit: ro bundles now recognize
their history
Posted by st...@apache.org.
ro bundles now recognize their history
the `RDFToManifest.readTo` method just didn't look for a potential history.
implemented the missing part and extended the test
fixes https://issues.apache.org/jira/browse/TAVERNA-842
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/bcc31f8c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-language/tree/bcc31f8c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-language/diff/bcc31f8c
Branch: refs/heads/master
Commit: bcc31f8cecf4699a71943e3887893f49b41675d2
Parents: 74d9f2f
Author: Martin Scharm <ma...@binfalse.de>
Authored: Tue Jul 14 14:25:07 2015 +0100
Committer: Martin Scharm <ma...@binfalse.de>
Committed: Tue Jul 14 14:25:07 2015 +0100
----------------------------------------------------------------------
.../robundle/manifest/RDFToManifest.java | 8 ++++++
.../robundle/manifest/TestManifestJSON.java | 27 ++++++++++++++------
2 files changed, 27 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-taverna-language/blob/bcc31f8c/taverna-robundle/src/main/java/org/apache/taverna/robundle/manifest/RDFToManifest.java
----------------------------------------------------------------------
diff --git a/taverna-robundle/src/main/java/org/apache/taverna/robundle/manifest/RDFToManifest.java b/taverna-robundle/src/main/java/org/apache/taverna/robundle/manifest/RDFToManifest.java
index 6328bb8..4413de9 100644
--- a/taverna-robundle/src/main/java/org/apache/taverna/robundle/manifest/RDFToManifest.java
+++ b/taverna-robundle/src/main/java/org/apache/taverna/robundle/manifest/RDFToManifest.java
@@ -40,6 +40,7 @@ import java.util.logging.Logger;
import org.apache.jena.riot.Lang;
import org.apache.jena.riot.RDFDataMgr;
import org.apache.jena.riot.RiotException;
+import org.apache.taverna.robundle.Bundles;
import com.hp.hpl.jena.ontology.DatatypeProperty;
import com.hp.hpl.jena.ontology.Individual;
@@ -424,6 +425,13 @@ public class RDFToManifest {
RDFNode created = ro.getPropertyValue(createdOn);
manifest.setCreatedOn(literalAsFileTime(created));
+
+
+ List<Path> history = new ArrayList<Path> ();
+ for (Individual histItem : listObjectProperties (ro, hasProvenance))
+ history.add (Bundles.uriToBundlePath (manifest.getBundle (), relativizeFromBase(histItem.getURI (), root)));
+ manifest.setHistory (history);
+
List<Agent> authors = getAgents(root, ro, authoredBy);
if (!authors.isEmpty())
http://git-wip-us.apache.org/repos/asf/incubator-taverna-language/blob/bcc31f8c/taverna-robundle/src/test/java/org/apache/taverna/robundle/manifest/TestManifestJSON.java
----------------------------------------------------------------------
diff --git a/taverna-robundle/src/test/java/org/apache/taverna/robundle/manifest/TestManifestJSON.java b/taverna-robundle/src/test/java/org/apache/taverna/robundle/manifest/TestManifestJSON.java
index ace81e0..f80baea 100644
--- a/taverna-robundle/src/test/java/org/apache/taverna/robundle/manifest/TestManifestJSON.java
+++ b/taverna-robundle/src/test/java/org/apache/taverna/robundle/manifest/TestManifestJSON.java
@@ -21,6 +21,7 @@ package org.apache.taverna.robundle.manifest;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
@@ -37,10 +38,6 @@ import java.util.TimeZone;
import org.apache.taverna.robundle.Bundle;
import org.apache.taverna.robundle.Bundles;
-import org.apache.taverna.robundle.manifest.Agent;
-import org.apache.taverna.robundle.manifest.Manifest;
-import org.apache.taverna.robundle.manifest.PathAnnotation;
-import org.apache.taverna.robundle.manifest.PathMetadata;
import org.junit.Test;
import com.fasterxml.jackson.databind.JsonNode;
@@ -56,8 +53,21 @@ public class TestManifestJSON {
// create history
try (Bundle bundle = Bundles.createBundle())
{
+ Bundles.closeAndSaveBundle (bundle, tmpBundle);
+ }
+ catch (IOException e)
+ {
+ fail ("failed to create bundle for history test: " + e.getMessage ());
+ }
+
+ // make sure it doesn't fail if there is no history
+ try (Bundle bundle = Bundles.openBundle (tmpBundle))
+ {
Manifest manifest = bundle.getManifest();
Path evolutionPath = bundle.getPath(".ro/evolution.ttl");
+ assertFalse ("did not expect a history file", Files.exists (evolutionPath));
+ assertEquals ("did not expect a history", 0, manifest.getHistory ().size ());
+
Files.createDirectories(evolutionPath.getParent());
Bundles.setStringValue(
evolutionPath,
@@ -66,20 +76,21 @@ public class TestManifestJSON {
manifest.getHistory().add(evolutionPath);
assertTrue ("expected a history file", Files.exists (evolutionPath));
assertTrue ("expected a history", manifest.getHistory ().size () > 0);
- Bundles.closeAndSaveBundle (bundle, tmpBundle);
+
+ Bundles.closeBundle (bundle);
}
catch (IOException e)
{
- fail ("failed to create bundle for history test: " + e.getMessage ());
+ fail ("failed to read bundle for history test: " + e.getMessage ());
}
// check if history is still there
- try (Bundle bundle = Bundles.openBundle (tmpBundle))
+ try (Bundle bundle = Bundles.openBundleReadOnly (tmpBundle))
{
Manifest manifest = bundle.getManifest();
Path evolutionPath = bundle.getPath(".ro/evolution.ttl");
assertTrue ("expected a history file", Files.exists (evolutionPath));
- assertTrue ("expected a history", manifest.getHistory ().size () > 0);
+ assertEquals ("expected exactly one history", 1, manifest.getHistory ().size ());
Bundles.closeBundle (bundle);
}
catch (IOException e)
[4/4] incubator-taverna-language git commit: RO bundle recognize
"history" from manifest
Posted by st...@apache.org.
RO bundle recognize "history" from manifest
Merge remote-tracking branch 'binfalse/master'
Contribution by Martin Schwarm
Fixes TAVERNA-842.
This closes #16.
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/52048734
Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-language/tree/52048734
Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-language/diff/52048734
Branch: refs/heads/master
Commit: 52048734853f4e2ef7a6013971409af4ba090f07
Parents: 8c23bdb 6663d27
Author: Stian Soiland-Reyes <st...@apache.org>
Authored: Wed Jul 15 13:18:45 2015 +0100
Committer: Stian Soiland-Reyes <st...@apache.org>
Committed: Wed Jul 15 13:18:45 2015 +0100
----------------------------------------------------------------------
.../robundle/manifest/RDFToManifest.java | 8 +++
.../robundle/manifest/TestManifestJSON.java | 64 ++++++++++++++++++--
2 files changed, 68 insertions(+), 4 deletions(-)
----------------------------------------------------------------------