http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/3ecb1291/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/java/ui/view/__classPrefix__ContextualView.java ---------------------------------------------------------------------- diff --git a/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/java/ui/view/__classPrefix__ContextualView.java b/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/java/ui/view/__classPrefix__ContextualView.java deleted file mode 100644 index b7066a0..0000000 --- a/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/java/ui/view/__classPrefix__ContextualView.java +++ /dev/null @@ -1,91 +0,0 @@ -#set( $symbol_pound = '#' ) -#set( $symbol_dollar = '$' ) -#set( $symbol_escape = '\' ) -package ${package}.ui.view; - -import java.awt.Frame; - -import javax.swing.Action; -import javax.swing.JComponent; -import javax.swing.JLabel; -import javax.swing.JPanel; - -import com.fasterxml.jackson.databind.JsonNode; - -import uk.org.taverna.commons.services.ServiceRegistry; - -import net.sf.taverna.t2.servicedescriptions.ServiceDescriptionRegistry; -import net.sf.taverna.t2.workbench.activityicons.ActivityIconManager; -import net.sf.taverna.t2.workbench.edits.EditManager; -import net.sf.taverna.t2.workbench.file.FileManager; -import net.sf.taverna.t2.workbench.ui.actions.activity.ActivityContextualView; - -import uk.org.taverna.scufl2.api.activity.Activity; - -import ${package}.ui.config.${classPrefix}ConfigureAction; - -@SuppressWarnings("serial") -public class ${classPrefix}ContextualView extends ActivityContextualView { - - private final EditManager editManager; - private final FileManager fileManager; - private final ActivityIconManager activityIconManager; - private final ServiceDescriptionRegistry serviceDescriptionRegistry; - private final ServiceRegistry serviceRegistry; - - private JLabel description = new JLabel("ads"); - - public ${classPrefix}ContextualView(Activity activity, EditManager editManager, - FileManager fileManager, ActivityIconManager activityIconManager, - ServiceDescriptionRegistry serviceDescriptionRegistry, ServiceRegistry serviceRegistry) { - super(activity); - this.editManager = editManager; - this.fileManager = fileManager; - this.activityIconManager = activityIconManager; - this.serviceDescriptionRegistry = serviceDescriptionRegistry; - this.serviceRegistry = serviceRegistry; - initView(); - } - - @Override - public JComponent getMainFrame() { - JPanel jPanel = new JPanel(); - jPanel.add(description); - refreshView(); - return jPanel; - } - - @Override - public String getViewTitle() { - JsonNode configuration = getConfigBean().getJson(); - return "${classPrefix} service " + configuration.get("exampleString").asText(); - } - - /** - * Typically called when the activity configuration has changed. - */ - @Override - public void refreshView() { - JsonNode configuration = getConfigBean().getJson(); - description.setText("${classPrefix} service " + configuration.get("exampleUri").asText() - + " - " + configuration.get("exampleString").asText()); - // TODO: Might also show extra service information looked - // up dynamically from endpoint/registry - } - - /** - * View position hint - */ - @Override - public int getPreferredPosition() { - // We want to be on top - return 100; - } - - @Override - public Action getConfigureAction(final Frame owner) { - return new ${classPrefix}ConfigureAction(getActivity(), editManager, fileManager, - activityIconManager, serviceDescriptionRegistry, serviceRegistry); - } - -}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/3ecb1291/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/resources/META-INF/spring/context-osgi.xml ---------------------------------------------------------------------- diff --git a/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/resources/META-INF/spring/context-osgi.xml b/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/resources/META-INF/spring/context-osgi.xml deleted file mode 100644 index 32ad4f1..0000000 --- a/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/resources/META-INF/spring/context-osgi.xml +++ /dev/null @@ -1,26 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<beans:beans xmlns="http://www.springframework.org/schema/osgi" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:beans="http://www.springframework.org/schema/beans" - xsi:schemaLocation="http://www.springframework.org/schema/beans - http://www.springframework.org/schema/beans/spring-beans.xsd - http://www.springframework.org/schema/osgi - http://www.springframework.org/schema/osgi/spring-osgi.xsd"> - - <service ref="${classPrefix}ServiceIcon" interface="net.sf.taverna.t2.workbench.activityicons.ActivityIconSPI" /> - - <service ref="${classPrefix}ServiceProvider" interface="net.sf.taverna.t2.servicedescriptions.ServiceDescriptionProvider" /> - - <service ref="${classPrefix}ConfigureMenuAction" auto-export="interfaces" /> - - <service ref="${classPrefix}ActivityContextViewFactory" interface="net.sf.taverna.t2.workbench.ui.views.contextualviews.activity.ContextualViewFactory" /> - - <reference id="editManager" interface="net.sf.taverna.t2.workbench.edits.EditManager" /> - <reference id="fileManager" interface="net.sf.taverna.t2.workbench.file.FileManager" /> - <reference id="menuManager" interface="net.sf.taverna.t2.ui.menu.MenuManager" /> - <reference id="selectionManager" interface="net.sf.taverna.t2.workbench.selection.SelectionManager" /> - <reference id="activityIconManager" interface="net.sf.taverna.t2.workbench.activityicons.ActivityIconManager" /> - <reference id="colourManager" interface="net.sf.taverna.t2.workbench.configuration.colour.ColourManager" /> - <reference id="serviceDescriptionRegistry" interface="net.sf.taverna.t2.servicedescriptions.ServiceDescriptionRegistry" /> - <reference id="serviceRegistry" interface="uk.org.taverna.commons.services.ServiceRegistry" /> - -</beans:beans> http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/3ecb1291/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/resources/META-INF/spring/context.xml ---------------------------------------------------------------------- diff --git a/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/resources/META-INF/spring/context.xml b/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/resources/META-INF/spring/context.xml deleted file mode 100644 index cfc5a00..0000000 --- a/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/resources/META-INF/spring/context.xml +++ /dev/null @@ -1,31 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<beans xmlns="http://www.springframework.org/schema/beans" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://www.springframework.org/schema/beans - http://www.springframework.org/schema/beans/spring-beans.xsd"> - - <bean id="${classPrefix}ServiceIcon" - class="${package}.ui.serviceprovider.${classPrefix}ServiceIcon" /> - - <bean id="${classPrefix}ServiceProvider" - class="${package}.ui.serviceprovider.${classPrefix}ServiceProvider" /> - - <bean id="${classPrefix}ConfigureMenuAction" - class="${package}.ui.menu.${classPrefix}ConfigureMenuAction"> - <property name="editManager" ref="editManager" /> - <property name="fileManager" ref="fileManager" /> - <property name="activityIconManager" ref="activityIconManager" /> - <property name="serviceDescriptionRegistry" ref="serviceDescriptionRegistry" /> - <property name="serviceRegistry" ref="serviceRegistry" /> - </bean> - - <bean id="${classPrefix}ActivityContextViewFactory" - class="${package}.ui.view.${classPrefix}ActivityContextViewFactory"> - <property name="editManager" ref="editManager" /> - <property name="fileManager" ref="fileManager" /> - <property name="activityIconManager" ref="activityIconManager" /> - <property name="serviceDescriptionRegistry" ref="serviceDescriptionRegistry" /> - <property name="serviceRegistry" ref="serviceRegistry" /> - </bean> - -</beans> http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/3ecb1291/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/resources/exampleIcon.png ---------------------------------------------------------------------- diff --git a/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/resources/exampleIcon.png b/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/resources/exampleIcon.png deleted file mode 100644 index 3ef7be4..0000000 Binary files a/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity-ui/src/main/resources/exampleIcon.png and /dev/null differ http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/3ecb1291/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity/pom.xml ---------------------------------------------------------------------- diff --git a/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity/pom.xml b/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity/pom.xml deleted file mode 100644 index 755b218..0000000 --- a/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity/pom.xml +++ /dev/null @@ -1,51 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> - <modelVersion>4.0.0</modelVersion> - <parent> - <groupId>${groupId}</groupId> - <artifactId>${rootArtifactId}</artifactId> - <version>${version}</version> - </parent> - <artifactId>${artifactId}</artifactId> - <packaging>bundle</packaging> - <name>${classPrefix} Taverna activity</name> - - <dependencies> - <dependency> - <groupId>net.sf.taverna.t2.core</groupId> - <artifactId>workflowmodel-api</artifactId> - <version>${t2.core.version}</version> - </dependency> - <dependency> - <groupId>net.sf.taverna.t2.core</groupId> - <artifactId>reference-api</artifactId> - <version>${t2.core.version}</version> - </dependency> - - <dependency> - <groupId>com.fasterxml.jackson.core</groupId> - <artifactId>jackson-databind</artifactId> - <version>2.3.0</version> - </dependency> - - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <version>4.4</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>net.sf.taverna.t2.core</groupId> - <artifactId>workflowmodel-impl</artifactId> - <version>${t2.core.version}</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>net.sf.taverna.t2.activities</groupId> - <artifactId>activity-test-utils</artifactId> - <version>${t2.activities.version}</version> - <scope>test</scope> - </dependency> - </dependencies> -</project> http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/3ecb1291/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity/src/main/java/__classPrefix__Activity.java ---------------------------------------------------------------------- diff --git a/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity/src/main/java/__classPrefix__Activity.java b/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity/src/main/java/__classPrefix__Activity.java deleted file mode 100644 index 6696cfe..0000000 --- a/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity/src/main/java/__classPrefix__Activity.java +++ /dev/null @@ -1,135 +0,0 @@ -#set( $symbol_pound = '#' ) -#set( $symbol_dollar = '$' ) -#set( $symbol_escape = '\' ) -package ${package}; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import com.fasterxml.jackson.databind.JsonNode; - -import net.sf.taverna.t2.invocation.InvocationContext; -import net.sf.taverna.t2.reference.ReferenceService; -import net.sf.taverna.t2.reference.T2Reference; -import net.sf.taverna.t2.workflowmodel.processor.activity.AbstractAsynchronousActivity; -import net.sf.taverna.t2.workflowmodel.processor.activity.ActivityConfigurationException; -import net.sf.taverna.t2.workflowmodel.processor.activity.AsynchronousActivity; -import net.sf.taverna.t2.workflowmodel.processor.activity.AsynchronousActivityCallback; - -/** - * ${classPrefix} <code>Activity<code>. - */ -public class ${classPrefix}Activity extends AbstractAsynchronousActivity<JsonNode> - implements AsynchronousActivity<JsonNode> { - - public static final String ACTIVITY_TYPE = "http://example.com/2013/activity/${rootArtifactId}"; - - /* - * Best practice: Keep port names as constants to avoid misspelling. This - * would not apply if port names are looked up dynamically from the service - * operation, like done for WSDL services. - */ - public static final String IN_FIRST_INPUT = "firstInput"; - public static final String IN_EXTRA_DATA = "extraData"; - public static final String OUT_MORE_OUTPUTS = "moreOutputs"; - public static final String OUT_SIMPLE_OUTPUT = "simpleOutput"; - public static final String OUT_REPORT = "report"; - - private JsonNode configuration; - - @Override - public void configure(JsonNode configuration) throws ActivityConfigurationException { - - // Any pre-config sanity checks - if (configuration.get("exampleString").asText().equals("invalidExample")) { - throw new ActivityConfigurationException( - "Example string can't be 'invalidExample'"); - } - // Store for getConfiguration(), but you could also make - // getConfiguration() return a new bean from other sources - this.configuration = configuration; - - // OPTIONAL: - // Do any server-side lookups and configuration, like resolving WSDLs - - // myClient = new MyClient(configuration.get("exampleUri").asText()); - // this.service = myClient.getService(configuration.get("exampleString").asText()); - - } - - @Override - public JsonNode getConfiguration() { - return configuration; - } - - @SuppressWarnings("unchecked") - @Override - public void executeAsynch(final Map<String, T2Reference> inputs, - final AsynchronousActivityCallback callback) { - // Don't execute service directly now, request to be run ask to be run - // from thread pool and return asynchronously - callback.requestRun(new Runnable() { - - public void run() { - InvocationContext context = callback - .getContext(); - ReferenceService referenceService = context - .getReferenceService(); - // Resolve inputs - String firstInput = (String) referenceService.renderIdentifier(inputs.get(IN_FIRST_INPUT), - String.class, context); - - // Support our configuration-dependendent input - boolean optionalPorts = configuration.get("exampleString").asText().equals("specialCase"); - - List<byte[]> special = null; - // We'll also allow IN_EXTRA_DATA to be optionally not provided - if (optionalPorts && inputs.containsKey(IN_EXTRA_DATA)) { - // Resolve as a list of byte[] - special = (List<byte[]>) referenceService.renderIdentifier( - inputs.get(IN_EXTRA_DATA), byte[].class, context); - } - - - // TODO: Do the actual service invocation -// try { -// results = this.service.invoke(firstInput, special) -// } catch (ServiceException ex) { -// callback.fail("Could not invoke ${classPrefix} service " + configBean.getExampleUri(), -// ex); -// // Make sure we don't call callback.receiveResult later -// return; -// } - - // Register outputs - Map<String, T2Reference> outputs = new HashMap<>(); - String simpleValue = "simple"; - T2Reference simpleRef = referenceService.register(simpleValue, 0, true, context); - outputs.put(OUT_SIMPLE_OUTPUT, simpleRef); - - // For list outputs, only need to register the top level list - List<String> moreValues = new ArrayList<>(); - moreValues.add("Value 1"); - moreValues.add("Value 2"); - T2Reference moreRef = referenceService.register(moreValues, 1, true, context); - outputs.put(OUT_MORE_OUTPUTS, moreRef); - - if (optionalPorts) { - // Populate our optional output port - // NOTE: Need to return output values for all defined output ports - String report = "Everything OK"; - outputs.put(OUT_REPORT, referenceService.register(report, - 0, true, context)); - } - - // return map of output data, with empty index array as this is - // the only and final result (this index parameter is used if - // pipelining output) - callback.receiveResult(outputs, new int[0]); - } - }); - } - -} http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/3ecb1291/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity/src/main/java/__classPrefix__ActivityFactory.java ---------------------------------------------------------------------- diff --git a/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity/src/main/java/__classPrefix__ActivityFactory.java b/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity/src/main/java/__classPrefix__ActivityFactory.java deleted file mode 100644 index 0fcb08b..0000000 --- a/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity/src/main/java/__classPrefix__ActivityFactory.java +++ /dev/null @@ -1,97 +0,0 @@ -#set( $symbol_pound = '#' ) -#set( $symbol_dollar = '$' ) -#set( $symbol_escape = '\' ) -package ${package}; - -import static ${package}.${classPrefix}Activity.*; - -import java.io.IOException; -import java.net.URI; -import java.util.HashSet; -import java.util.Set; - -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; - -import net.sf.taverna.t2.workflowmodel.Edits; -import net.sf.taverna.t2.workflowmodel.processor.activity.ActivityFactory; -import net.sf.taverna.t2.workflowmodel.processor.activity.ActivityInputPort; -import net.sf.taverna.t2.workflowmodel.processor.activity.ActivityOutputPort; - -/** - * ${classPrefix} <code>ActivityFactory<code>. - */ -public class ${classPrefix}ActivityFactory implements ActivityFactory { - - private Edits edits; - - @Override - public ${classPrefix}Activity createActivity() { - return new ${classPrefix}Activity(); - } - - @Override - public URI getActivityType() { - return URI.create(${classPrefix}Activity.ACTIVITY_TYPE); - } - - @Override - public JsonNode getActivityConfigurationSchema() { - ObjectMapper objectMapper = new ObjectMapper(); - try { - return objectMapper.readTree(getClass().getResource("/schema.json")); - } catch (IOException e) { - return objectMapper.createObjectNode(); - } - } - - @Override - public Set<ActivityInputPort> getInputPorts(JsonNode configuration) { - Set<ActivityInputPort> inputPorts = new HashSet<>(); - - // FIXME: Replace with your input port definitions - - // Hard coded input port, expecting a single String - inputPorts.add(edits.createActivityInputPort(IN_FIRST_INPUT, 0, true, null, String.class)); - - // Optional ports depending on configuration - if (configuration.get("exampleString").asText().equals("specialCase")) { - // depth 1, ie. list of binary byte[] arrays - inputPorts.add(edits.createActivityInputPort(IN_EXTRA_DATA, 1, true, null, byte[].class)); - } - - return inputPorts; - } - - @Override - public Set<ActivityOutputPort> getOutputPorts(JsonNode configuration) { - Set<ActivityOutputPort> outputPorts = new HashSet<>(); - - // FIXME: Replace with your output port definitions - - // Optional ports depending on configuration - if (configuration.get("exampleString").asText().equals("specialCase")) { - outputPorts.add(edits.createActivityOutputPort(OUT_REPORT, 0, 0)); - } - - // Single value output port (depth 0) - outputPorts.add(edits.createActivityOutputPort(OUT_SIMPLE_OUTPUT, 0, 0)); - // Output port with list of values (depth 1) - outputPorts.add(edits.createActivityOutputPort(OUT_MORE_OUTPUTS, 1, 1)); - - return outputPorts; - } - - /** - * Sets the edits property. - * <p> - * This method is used by Spring. The property name must match the property specified - * in the Spring context file. - * - * @param edits the <code>Edits</code> used to create input/output ports - */ - public void setEdits(Edits edits) { - this.edits = edits; - } - -} http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/3ecb1291/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity/src/main/java/__classPrefix__ActivityHealthChecker.java ---------------------------------------------------------------------- diff --git a/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity/src/main/java/__classPrefix__ActivityHealthChecker.java b/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity/src/main/java/__classPrefix__ActivityHealthChecker.java deleted file mode 100644 index f5568fc..0000000 --- a/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity/src/main/java/__classPrefix__ActivityHealthChecker.java +++ /dev/null @@ -1,66 +0,0 @@ -#set( $symbol_pound = '#' ) -#set( $symbol_dollar = '$' ) -#set( $symbol_escape = '\' ) -package ${package}; - -import java.net.URI; -import java.util.ArrayList; -import java.util.List; - -import com.fasterxml.jackson.databind.JsonNode; - -import net.sf.taverna.t2.visit.VisitReport; -import net.sf.taverna.t2.visit.VisitReport.Status; -import net.sf.taverna.t2.workflowmodel.health.HealthCheck; -import net.sf.taverna.t2.workflowmodel.health.HealthChecker; - -/** - * ${classPrefix} <code>HealthChecker</code>. - */ -public class ${classPrefix}ActivityHealthChecker implements - HealthChecker<${classPrefix}Activity> { - - public boolean canVisit(Object o) { - // Return True if we can visit the object. We could do - // deeper (but not time consuming) checks here, for instance - // if the health checker only deals with ${classPrefix}Activity where - // a certain configuration option is enabled. - return o instanceof ${classPrefix}Activity; - } - - public boolean isTimeConsuming() { - // Return true if the health checker does a network lookup - // or similar time consuming checks, in which case - // it would only be performed when using File->Validate workflow - // or File->Run. - return false; - } - - public VisitReport visit(${classPrefix}Activity activity, List<Object> ancestry) { - JsonNode config = activity.getConfiguration(); - - // We'll build a list of subreports - List<VisitReport> subReports = new ArrayList<>(); - - if (!URI.create(config.get("exampleUri").asText()).isAbsolute()) { - // Report Severe problems we know won't work - VisitReport report = new VisitReport(HealthCheck.getInstance(), - activity, "Example URI must be absolute", HealthCheck.INVALID_URL, - Status.SEVERE); - subReports.add(report); - } - - if (config.get("exampleString").asText().equals("")) { - // Warning on possible problems - subReports.add(new VisitReport(HealthCheck.getInstance(), activity, - "Example string empty", HealthCheck.NO_CONFIGURATION, - Status.WARNING)); - } - - // The default explanation here will be used if the subreports list is - // empty - return new VisitReport(HealthCheck.getInstance(), activity, - "${classPrefix} service OK", HealthCheck.NO_PROBLEM, subReports); - } - -} http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/3ecb1291/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity/src/main/resources/META-INF/spring/context-osgi.xml ---------------------------------------------------------------------- diff --git a/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity/src/main/resources/META-INF/spring/context-osgi.xml b/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity/src/main/resources/META-INF/spring/context-osgi.xml deleted file mode 100644 index e8d6e12..0000000 --- a/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity/src/main/resources/META-INF/spring/context-osgi.xml +++ /dev/null @@ -1,17 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<beans:beans xmlns="http://www.springframework.org/schema/osgi" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:beans="http://www.springframework.org/schema/beans" - xsi:schemaLocation="http://www.springframework.org/schema/beans - http://www.springframework.org/schema/beans/spring-beans.xsd - http://www.springframework.org/schema/osgi - http://www.springframework.org/schema/osgi/spring-osgi.xsd"> - - <!-- Services to be registered with the OSGi service register --> - <service ref="${classPrefix}ActivityHealthChecker" interface="net.sf.taverna.t2.workflowmodel.health.HealthChecker" /> - - <service ref="${classPrefix}ActivityFactory" interface="net.sf.taverna.t2.workflowmodel.processor.activity.ActivityFactory" /> - - <!-- References to services required from the OSGi service register --> - <reference id="edits" interface="net.sf.taverna.t2.workflowmodel.Edits" /> - -</beans:beans> http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/3ecb1291/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity/src/main/resources/META-INF/spring/context.xml ---------------------------------------------------------------------- diff --git a/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity/src/main/resources/META-INF/spring/context.xml b/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity/src/main/resources/META-INF/spring/context.xml deleted file mode 100644 index 49f5428..0000000 --- a/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity/src/main/resources/META-INF/spring/context.xml +++ /dev/null @@ -1,12 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://www.springframework.org/schema/beans - http://www.springframework.org/schema/beans/spring-beans.xsd"> - - <bean id="${classPrefix}ActivityHealthChecker" class="${package}.${classPrefix}ActivityHealthChecker" /> - - <bean id="${classPrefix}ActivityFactory" class="${package}.${classPrefix}ActivityFactory"> - <property name="edits" ref="edits" /> - </bean> - -</beans> http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/3ecb1291/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity/src/main/resources/schema.json ---------------------------------------------------------------------- diff --git a/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity/src/main/resources/schema.json b/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity/src/main/resources/schema.json deleted file mode 100644 index 2916b11..0000000 --- a/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity/src/main/resources/schema.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-03/schema#", - "id": "http://example.com/2013/activity/${rootArtifactId}.schema.json", - "title": "${classPrefix} activity configuration", - "type": "object", - "properties": { - "@context": { - "description": "JSON-LD context for interpreting the configuration as RDF", - "required": true, - "enum": ["http://example.com/2013/activity/${rootArtifactId}.context.json"] - }, - "exampleString": { - "title": "Example String", - "description": "An example string property", - "type": "string", - "required": true - }, - "exampleUri": { - "title": "Example URI", - "description": "An example uri property", - "type": "string", - "required": true - } - } -} http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/3ecb1291/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity/src/test/java/__classPrefix__ActivityFactoryTest.java ---------------------------------------------------------------------- diff --git a/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity/src/test/java/__classPrefix__ActivityFactoryTest.java b/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity/src/test/java/__classPrefix__ActivityFactoryTest.java deleted file mode 100644 index 4de382e..0000000 --- a/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity/src/test/java/__classPrefix__ActivityFactoryTest.java +++ /dev/null @@ -1,103 +0,0 @@ -#set( $symbol_pound = '#' ) -#set( $symbol_dollar = '$' ) -#set( $symbol_escape = '\' ) -package ${package}; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNotSame; -import static org.junit.Assert.assertTrue; - -import java.net.URI; -import java.util.HashSet; -import java.util.Set; - -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.node.JsonNodeFactory; -import com.fasterxml.jackson.databind.node.ObjectNode; - -import net.sf.taverna.t2.workflowmodel.impl.EditsImpl; -import net.sf.taverna.t2.workflowmodel.processor.activity.ActivityInputPort; -import net.sf.taverna.t2.workflowmodel.processor.activity.ActivityOutputPort; - -import org.junit.Before; -import org.junit.Test; - -public class ${classPrefix}ActivityFactoryTest { - - private ObjectNode configuration; - - private ${classPrefix}ActivityFactory activityFactory; - - @Before - public void setUp() throws Exception { - configuration = JsonNodeFactory.instance.objectNode(); - configuration.put("exampleString", "something"); - configuration.put("exampleUri", "http://localhost:8080/myEndPoint"); - - activityFactory = new ${classPrefix}ActivityFactory(); - activityFactory.setEdits(new EditsImpl()); - } - - @Test - public void testCreateActivity() { - ${classPrefix}Activity activity = activityFactory.createActivity(); - assertNotNull(activity); - assertNotSame(activity, activityFactory.createActivity()); - } - - @Test - public void testGetActivityURI() { - assertEquals(URI.create(${classPrefix}Activity.ACTIVITY_TYPE), activityFactory.getActivityType()); - } - - @Test - public void testGetActivityConfigurationSchema() { - JsonNode configurationSchema = activityFactory.getActivityConfigurationSchema(); - assertNotNull(configurationSchema); - assertTrue(configurationSchema.has("properties")); - JsonNode propertiesNode = configurationSchema.get("properties"); - assertTrue(propertiesNode.has("exampleString")); - assertTrue(propertiesNode.has("exampleUri")); - } - - @Test - public void testGetInputPorts() { - Set<String> expectedInputs = new HashSet<String>(); - expectedInputs.add("firstInput"); - - Set<ActivityInputPort> inputPorts = activityFactory.getInputPorts(configuration); - assertEquals("Unexpected inputs", expectedInputs.size(), inputPorts.size()); - for (ActivityInputPort inputPort : inputPorts) { - assertTrue("Wrong input : " + inputPort.getName(), expectedInputs - .remove(inputPort.getName())); - } - - ObjectNode specialConfiguration = JsonNodeFactory.instance.objectNode(); - specialConfiguration.put("exampleString", "specialCase"); - specialConfiguration.put("exampleUri", "http://localhost:8080/myEndPoint"); - - assertEquals("Unexpected inputs", 2, activityFactory.getInputPorts(specialConfiguration).size()); - } - - @Test - public void testGetOutputPorts() { - Set<String> expectedOutputs = new HashSet<String>(); - expectedOutputs.add("simpleOutput"); - expectedOutputs.add("moreOutputs"); - - Set<ActivityOutputPort> outputPorts = activityFactory.getOutputPorts(configuration); - assertEquals("Unexpected outputs", expectedOutputs.size(), outputPorts.size()); - for (ActivityOutputPort outputPort : outputPorts) { - assertTrue("Wrong output : " + outputPort.getName(), - expectedOutputs.remove(outputPort.getName())); - } - - ObjectNode specialConfiguration = JsonNodeFactory.instance.objectNode(); - specialConfiguration.put("exampleString", "specialCase"); - specialConfiguration.put("exampleUri", "http://localhost:8080/myEndPoint"); - - assertEquals("Unexpected outputs", 3, activityFactory.getOutputPorts(specialConfiguration).size()); - } - -} http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/3ecb1291/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity/src/test/java/__classPrefix__ActivityTest.java ---------------------------------------------------------------------- diff --git a/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity/src/test/java/__classPrefix__ActivityTest.java b/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity/src/test/java/__classPrefix__ActivityTest.java deleted file mode 100644 index e992290..0000000 --- a/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-activity/src/test/java/__classPrefix__ActivityTest.java +++ /dev/null @@ -1,76 +0,0 @@ -#set( $symbol_pound = '#' ) -#set( $symbol_dollar = '$' ) -#set( $symbol_escape = '\' ) -package ${package}; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; - -import java.net.URI; -import java.util.Arrays; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import java.util.Set; - -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.node.JsonNodeFactory; -import com.fasterxml.jackson.databind.node.ObjectNode; - -import net.sf.taverna.t2.activities.testutils.ActivityInvoker; -import net.sf.taverna.t2.workflowmodel.processor.activity.ActivityConfigurationException; -import net.sf.taverna.t2.workflowmodel.processor.activity.ActivityInputPort; -import net.sf.taverna.t2.workflowmodel.processor.activity.ActivityOutputPort; - -import org.junit.Before; -import org.junit.Test; - -public class ${classPrefix}ActivityTest { - - private ObjectNode configuration; - - private ${classPrefix}Activity activity = new ${classPrefix}Activity(); - - @Before - public void makeConfiguration() throws Exception { - configuration = JsonNodeFactory.instance.objectNode(); - configuration.put("exampleString", "something"); - configuration.put("exampleUri", "http://localhost:8080/myEndPoint"); - } - - @Test - public void configureActivity() throws Exception { - activity.configure(configuration); - assertTrue(configuration.equals(activity.getConfiguration())); - } - - @Test(expected = ActivityConfigurationException.class) - public void invalidConfiguration() throws ActivityConfigurationException { - ObjectNode invalidBean = JsonNodeFactory.instance.objectNode(); - invalidBean.put("exampleString", "invalidExample"); - // Should throw ActivityConfigurationException - activity.configure(invalidBean); - } - - @Test - public void executeAsynch() throws Exception { - activity.configure(configuration); - - Map<String, Object> inputs = new HashMap<String, Object>(); - inputs.put("firstInput", "hello"); - - Map<String, Class<?>> expectedOutputTypes = new HashMap<String, Class<?>>(); - expectedOutputTypes.put("simpleOutput", String.class); - expectedOutputTypes.put("moreOutputs", String.class); - - Map<String, Object> outputs = ActivityInvoker.invokeAsyncActivity( - activity, inputs, expectedOutputTypes); - - assertEquals("Unexpected outputs", 2, outputs.size()); - assertEquals("simple", outputs.get("simpleOutput")); - assertEquals(Arrays.asList("Value 1", "Value 2"), outputs - .get("moreOutputs")); - - } - -} http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/3ecb1291/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-plugin/pom.xml ---------------------------------------------------------------------- diff --git a/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-plugin/pom.xml b/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-plugin/pom.xml deleted file mode 100644 index 72c44ed..0000000 --- a/taverna-activity-archetype/src/main/resources/archetype-resources/__rootArtifactId__-plugin/pom.xml +++ /dev/null @@ -1,26 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> - <modelVersion>4.0.0</modelVersion> - <parent> - <groupId>${groupId}</groupId> - <artifactId>${rootArtifactId}</artifactId> - <version>${version}</version> - </parent> - <artifactId>${artifactId}</artifactId> - <packaging>taverna-plugin</packaging> - <name>${classPrefix} Taverna plugin</name> - <description>Description of Example Taverna plugin</description> - <dependencies> - <dependency> - <groupId>${project.groupId}</groupId> - <artifactId>${rootArtifactId}-activity</artifactId> - <version>${version}</version> - </dependency> - <dependency> - <groupId>${project.groupId}</groupId> - <artifactId>${rootArtifactId}-activity-ui</artifactId> - <version>${version}</version> - </dependency> - </dependencies> -</project> http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/3ecb1291/taverna-activity-archetype/src/main/resources/archetype-resources/pom.xml ---------------------------------------------------------------------- diff --git a/taverna-activity-archetype/src/main/resources/archetype-resources/pom.xml b/taverna-activity-archetype/src/main/resources/archetype-resources/pom.xml deleted file mode 100644 index 57b4aa9..0000000 --- a/taverna-activity-archetype/src/main/resources/archetype-resources/pom.xml +++ /dev/null @@ -1,192 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> - <modelVersion>4.0.0</modelVersion> - - <groupId>${groupId}</groupId> - <artifactId>${artifactId}</artifactId> - <version>${version}</version> - <packaging>pom</packaging> - <name>${classPrefix} Taverna project</name> - - <properties> - <t2.core.version>2.0.1-SNAPSHOT</t2.core.version> - <t2.activities.version>2.0.1-SNAPSHOT</t2.activities.version> - <t2.ui.api.version>2.0-SNAPSHOT</t2.ui.api.version> - </properties> - - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-compiler-plugin</artifactId> - <version>2.3.2</version> - <configuration> - <source>1.7</source> - <target>1.7</target> - </configuration> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-source-plugin</artifactId> - <version>2.1.2</version> - <executions> - <execution> - <goals> - <goal>jar</goal> - <goal>test-jar</goal> - </goals> - </execution> - </executions> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-jar-plugin</artifactId> - <version>2.3.1</version> - <executions> - <execution> - <goals> - <goal>test-jar</goal> - </goals> - </execution> - </executions> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-surefire-plugin</artifactId> - <version>2.7.1</version> - <configuration> - <skip>false</skip> - <systemProperties> - <property> - <name>java.awt.headless</name> - <value>true</value> - </property> - </systemProperties> - </configuration> - </plugin> - <plugin> - <groupId>org.apache.felix</groupId> - <artifactId>maven-bundle-plugin</artifactId> - </plugin> - <plugin> - <groupId>net.sf.taverna.t2.maven.plugins</groupId> - <artifactId>taverna-maven-plugin</artifactId> - <version>0.3.1-SNAPSHOT</version> - <extensions>true</extensions> - </plugin> - </plugins> - <pluginManagement> - <plugins> - <plugin> - <groupId>org.apache.felix</groupId> - <artifactId>maven-bundle-plugin</artifactId> - <version>2.3.7</version> - <extensions>true</extensions> - </plugin> - <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.--> - <plugin> - <groupId>org.eclipse.m2e</groupId> - <artifactId>lifecycle-mapping</artifactId> - <version>1.0.0</version> - <configuration> - <lifecycleMappingMetadata> - <pluginExecutions> - <pluginExecution> - <pluginExecutionFilter> - <groupId> - net.sf.taverna.t2.maven.plugins - </groupId> - <artifactId> - taverna-maven-plugin - </artifactId> - <versionRange> - [0.3.1-SNAPSHOT,) - </versionRange> - <goals> - <goal>plugin-generate</goal> - </goals> - </pluginExecutionFilter> - <action> - <ignore></ignore> - </action> - </pluginExecution> - </pluginExecutions> - </lifecycleMappingMetadata> - </configuration> - </plugin> - </plugins> - </pluginManagement> - </build> - - <dependencies> - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <version>4.4</version> - <scope>test</scope> - </dependency> - </dependencies> - - <repositories> - <repository> - <!-- The myGrid repository for Taverna dependencies --> - <releases /> - <snapshots> - <enabled>false</enabled> - </snapshots> - <id>mygrid-repository</id> - <name>myGrid Repository</name> - <url>http://www.mygrid.org.uk/maven/repository</url> - </repository> - <repository> - <!-- The myGrid snapshot repository for Taverna dependencies --> - <releases> - <enabled>false</enabled> - </releases> - <snapshots /> - <id>mygrid-snapshot-repository</id> - <name>myGrid Snapshot Repository</name> - <url>http://www.mygrid.org.uk/maven/snapshot-repository</url> - </repository> - <repository> - <!-- The repository that your jars are deployed to --> - <id>my-repository</id> - <name>My Repository</name> - <url>http://www.example.com/maven/repository</url> - </repository> - <repository> - <!-- The repository that your snapshot jars are deployed to --> - <releases> - <enabled>false</enabled> - </releases> - <snapshots /> - <id>my-snapshot-repository</id> - <name>My snapshot Repository</name> - <url>file:///tmp/test-plugins/</url> - </repository> - </repositories> - - <pluginRepositories> - <pluginRepository> - <id>mygrid-repository</id> - <name>myGrid Repository</name> - <url>http://www.mygrid.org.uk/maven/repository</url> - </pluginRepository> - </pluginRepositories> - - <!-- The location of your plugin site --> - <distributionManagement> - <repository> - <id>my-plugin-site</id> - <name>My Plugin Site</name> - <url>scpexe://example.com/www/taverna/plugins/</url> - </repository> - <snapshotRepository> - <id>my-test-plugin-site</id> - <name>My Test Plugin Site</name> - <url>file:///tmp/test-plugins/</url> - </snapshotRepository> - </distributionManagement> - -</project> http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/3ecb1291/taverna-activity-test-utils/pom.xml ---------------------------------------------------------------------- diff --git a/taverna-activity-test-utils/pom.xml b/taverna-activity-test-utils/pom.xml deleted file mode 100644 index 7d55112..0000000 --- a/taverna-activity-test-utils/pom.xml +++ /dev/null @@ -1,33 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> - <modelVersion>4.0.0</modelVersion> - <parent> - <groupId>org.apache.taverna.engine</groupId> - <artifactId>taverna-engine</artifactId> - <version>3.1.0-incubating-SNAPSHOT</version> - </parent> - <artifactId>taverna-activity-test-utils</artifactId> - <name>Apache Taverna Activity test utils</name> - <dependencies> - <dependency> - <groupId>${project.parent.groupId}</groupId> - <artifactId>taverna-workflowmodel-impl</artifactId> - <version>${project.parent.version}</version> - </dependency> - <dependency> - <groupId>${project.parent.groupId}</groupId> - <artifactId>taverna-reference-api</artifactId> - <version>${project.parent.version}</version> - </dependency> - <dependency> - <groupId>${project.parent.groupId}</groupId> - <artifactId>taverna-reference-impl</artifactId> - <version>${project.parent.version}</version> - </dependency> - <dependency> - <groupId>${project.parent.groupId}</groupId> - <artifactId>taverna-reference-types</artifactId> - <version>${project.parent.version}</version> - </dependency> - </dependencies> -</project> http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/3ecb1291/taverna-activity-test-utils/src/main/java/net/sf/taverna/t2/activities/testutils/ActivityInvoker.java ---------------------------------------------------------------------- diff --git a/taverna-activity-test-utils/src/main/java/net/sf/taverna/t2/activities/testutils/ActivityInvoker.java b/taverna-activity-test-utils/src/main/java/net/sf/taverna/t2/activities/testutils/ActivityInvoker.java deleted file mode 100644 index 934e31a..0000000 --- a/taverna-activity-test-utils/src/main/java/net/sf/taverna/t2/activities/testutils/ActivityInvoker.java +++ /dev/null @@ -1,250 +0,0 @@ -/******************************************************************************* - * Copyright (C) 2007 The University of Manchester - * - * Modifications to the initial code base are copyright of their - * respective authors, or their employers as appropriate. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - ******************************************************************************/ -package net.sf.taverna.t2.activities.testutils; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.ServiceLoader; - -import net.sf.taverna.t2.reference.ExternalReferenceBuilderSPI; -import net.sf.taverna.t2.reference.ExternalReferenceSPI; -import net.sf.taverna.t2.reference.ExternalReferenceTranslatorSPI; -import net.sf.taverna.t2.reference.ReferenceService; -import net.sf.taverna.t2.reference.StreamToValueConverterSPI; -import net.sf.taverna.t2.reference.T2Reference; -import net.sf.taverna.t2.reference.ValueToReferenceConverterSPI; -import net.sf.taverna.t2.reference.impl.ErrorDocumentServiceImpl; -import net.sf.taverna.t2.reference.impl.InMemoryErrorDocumentDao; -import net.sf.taverna.t2.reference.impl.InMemoryListDao; -import net.sf.taverna.t2.reference.impl.InMemoryReferenceSetDao; -import net.sf.taverna.t2.reference.impl.ListServiceImpl; -import net.sf.taverna.t2.reference.impl.ReferenceServiceImpl; -import net.sf.taverna.t2.reference.impl.ReferenceSetAugmentorImpl; -import net.sf.taverna.t2.reference.impl.ReferenceSetServiceImpl; -import net.sf.taverna.t2.reference.impl.SimpleT2ReferenceGenerator; -import net.sf.taverna.t2.workflowmodel.processor.activity.AbstractAsynchronousActivity; -import net.sf.taverna.t2.workflowmodel.processor.activity.AsynchronousActivity; - -/** - * Helper class to facilitate in executing Activities in isolation. - * - * @author Stuart Owen - * @author Alex Nenadic - * @author Stian Soiland-Reyes - * @author David Withers - */ -public class ActivityInvoker { - - /** - * Timeout in seconds - */ - public static long TIMEOUT = 30; - - - /** - * Invokes an {@link AsynchronousActivity} with a given set of input Objects - * and returns a Map<String,Object> of requested output values. - * - * @param activity - * the activity to be tested - * @param inputs - * a Map<String,Object> of input Objects - * @param requestedOutputs - * a List<String> of outputs to be examined - * - * @return a Map<String,Object> of the outputs requested by requestedOutput - * or <code>null</code> if a failure occurs - * @throws InterruptedException - * @throws Throwable - */ -/* public static Map<String, Object> invokeAsyncActivity( - AbstractAsynchronousActivity<?> activity, - Map<String, Object> inputs, Map<String, Class<?>> requestedOutputs) - throws Exception { - Map<String, Object> results = new HashMap<String, Object>(); - - ApplicationContext context = new RavenAwareClassPathXmlApplicationContext( - "inMemoryActivityTestsContext.xml"); - ReferenceService referenceService = (ReferenceService) context.getBean("t2reference.service.referenceService"); - - DummyCallback callback = new DummyCallback(referenceService); - Map<String, T2Reference> inputEntities = new HashMap<String, T2Reference>(); - for (String inputName : inputs.keySet()) { - Object val = inputs.get(inputName); - if (val instanceof List) { - inputEntities.put(inputName, referenceService.register(val, 1, true, callback.getContext())); - } else { - inputEntities.put(inputName, referenceService.register(val, 0, true, callback.getContext())); - } - } - - activity.executeAsynch(inputEntities, callback); - callback.thread.join(); - - if (callback.failed) { - results = null; - } else { - for (Map.Entry<String, Class<?>> output : requestedOutputs.entrySet()) { - T2Reference id = callback.data.get(output.getKey()); - if (id != null) { - Object result; - result = referenceService.renderIdentifier(id, output.getValue(), callback.getContext()); - results.put(output.getKey(), result); - } - } - } - return results; - } - */ - - // Changed this method to render the T2Reference to an object only if the type of the object in - // requestedOutputs is not an instance of ExternalReferenceSPI. Otherwise, the calling test method - // should get activity ReferenceSet and render the object itself. This was needed for API consumer activity - // testing - see ApiConsumerActivityTest. - // Also added support for multi-dimensional lists. - public static Map<String, Object> invokeAsyncActivity( - AbstractAsynchronousActivity<?> activity, - Map<String, Object> inputs, Map<String, Class<?>> requestedOutputs) throws InterruptedException - { - - Map<String, Object> results = new HashMap<String, Object>(); - - ReferenceService referenceService = createReferenceService(); - - DummyCallback callback = new DummyCallback(referenceService); - Map<String, T2Reference> inputEntities = new HashMap<String, T2Reference>(); - for (String inputName : inputs.keySet()) { - Object val = inputs.get(inputName); - int depth = getDepth(val); - inputEntities.put(inputName, referenceService.register(val, depth, true, callback.getContext())); - } - - activity.executeAsynch(inputEntities, callback); - callback.thread.join(TIMEOUT*1000); - - - if (callback.failed) { - throw callback.failures.get(0); - } else { - for (Map.Entry<String, Class<?>> output : requestedOutputs.entrySet()) { - T2Reference id = callback.data.get(output.getKey()); - if (ExternalReferenceSPI.class.isAssignableFrom(output.getValue())){ - // Do not render the object - just resolve the T2Reference - Object result; - result = referenceService.resolveIdentifier(id, null, callback.getContext()); - results.put(output.getKey(), result); - } - else{ - // Try to render the object behind the reference - Object result; - result = referenceService.renderIdentifier(id, output.getValue(), callback.getContext()); - results.put(output.getKey(), result); - } - } - } - return results; - } - - private static ReferenceService createReferenceService() { - SimpleT2ReferenceGenerator referenceGenerator = new SimpleT2ReferenceGenerator(); - ReferenceSetAugmentorImpl referenceSetAugmentor = new ReferenceSetAugmentorImpl(); - referenceSetAugmentor.setBuilders((List<ExternalReferenceBuilderSPI<?>>) getBuilders()); - referenceSetAugmentor.setTranslators(getTranslators()); - - ReferenceSetServiceImpl referenceSetService = new ReferenceSetServiceImpl(); - referenceSetService.setT2ReferenceGenerator(referenceGenerator); - referenceSetService.setReferenceSetDao(new InMemoryReferenceSetDao()); - referenceSetService.setReferenceSetAugmentor(referenceSetAugmentor); - - ListServiceImpl listService = new ListServiceImpl(); - listService.setT2ReferenceGenerator(referenceGenerator); - listService.setListDao(new InMemoryListDao()); - - ErrorDocumentServiceImpl errorDocumentService = new ErrorDocumentServiceImpl(); - errorDocumentService.setT2ReferenceGenerator(referenceGenerator); - errorDocumentService.setErrorDao(new InMemoryErrorDocumentDao()); - - ReferenceServiceImpl referenceService = new ReferenceServiceImpl(); - referenceService.setReferenceSetService(referenceSetService); - referenceService.setListService(listService); - referenceService.setErrorDocumentService(errorDocumentService); - referenceService.setConverters(getConverters()); - referenceService.setValueBuilders(getValueBuilders()); - - return referenceService; - } - - private static <T> List<T> getImplementations(Class<T> api) { - List<T> implementations = new ArrayList<T>(); - ServiceLoader<T> serviceLoader = ServiceLoader.load(api); - for (T implementation : serviceLoader) { - implementations.add(implementation); - } - return implementations; - } - - private static List<StreamToValueConverterSPI> getValueBuilders() { - return getImplementations(StreamToValueConverterSPI.class); - } - - private static List<ValueToReferenceConverterSPI> getConverters() { - return getImplementations(ValueToReferenceConverterSPI.class); - } - - private static List<ExternalReferenceTranslatorSPI<?, ?>> getTranslators() { - List<ExternalReferenceTranslatorSPI<?, ?>> implementations = new ArrayList<ExternalReferenceTranslatorSPI<?, ?>>(); - ServiceLoader<ExternalReferenceTranslatorSPI> serviceLoader = ServiceLoader.load(ExternalReferenceTranslatorSPI.class); - for (ExternalReferenceTranslatorSPI implementation : serviceLoader) { - implementations.add(implementation); - } - return implementations; - } - - private static List<ExternalReferenceBuilderSPI<?>> getBuilders() { - List<ExternalReferenceBuilderSPI<?>> implementations = new ArrayList<ExternalReferenceBuilderSPI<?>>(); - ServiceLoader<ExternalReferenceBuilderSPI> serviceLoader = ServiceLoader.load(ExternalReferenceBuilderSPI.class); - for (ExternalReferenceBuilderSPI implementation : serviceLoader) { - implementations.add(implementation); - } - return implementations; - } - - /** - * If an object is activity list - returns its depth, 0 otherwise (for single objects). - * @param obj - * @return - */ - private static int getDepth(Object obj){ - - if (obj instanceof List) { - // Assumes all sub-lists are of the same depth, - // so just uses the first sub-list to calculate it. - Object[] sublists = ((List<?>)obj).toArray(); - int depth = 1; - depth = getDepth(sublists[0]) + 1; - return depth; - } else { - return 0; - } - } -} http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/3ecb1291/taverna-activity-test-utils/src/main/java/net/sf/taverna/t2/activities/testutils/DummyCallback.java ---------------------------------------------------------------------- diff --git a/taverna-activity-test-utils/src/main/java/net/sf/taverna/t2/activities/testutils/DummyCallback.java b/taverna-activity-test-utils/src/main/java/net/sf/taverna/t2/activities/testutils/DummyCallback.java deleted file mode 100644 index 016caef..0000000 --- a/taverna-activity-test-utils/src/main/java/net/sf/taverna/t2/activities/testutils/DummyCallback.java +++ /dev/null @@ -1,106 +0,0 @@ -/******************************************************************************* - * Copyright (C) 2007 The University of Manchester - * - * Modifications to the initial code base are copyright of their - * respective authors, or their employers as appropriate. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - ******************************************************************************/ -package net.sf.taverna.t2.activities.testutils; - -import java.util.ArrayList; -import java.util.List; -import java.util.Map; - -import net.sf.taverna.t2.invocation.InvocationContext; -import net.sf.taverna.t2.invocation.impl.InvocationContextImpl; -import net.sf.taverna.t2.reference.ReferenceService; -import net.sf.taverna.t2.reference.T2Reference; -import net.sf.taverna.t2.workflowmodel.processor.activity.AsynchronousActivityCallback; -import net.sf.taverna.t2.workflowmodel.processor.dispatch.events.DispatchErrorType; - -import org.apache.log4j.Logger; - -/** - * A DummyCallback to aid with testing Activities. - * - * @author Stuart Owen - * @author David Withers - * @author Stian Soiland-Reyes - * - */ -public class DummyCallback implements AsynchronousActivityCallback { - - private static Logger logger = Logger - .getLogger(DummyCallback.class); - - public ReferenceService referenceService; - public InvocationContext invocationContext; - public Map<String, T2Reference> data; - public Thread thread; - - public boolean failed = false; - - public List<RuntimeException> failures = new ArrayList<RuntimeException>(); - - public DummyCallback(ReferenceService referenceService) { - this.referenceService = referenceService; - this.invocationContext = new InvocationContextImpl(referenceService, null); - } - - public void fail(String message, Throwable t) { - fail(message, t, null); - } - - public void fail(String message) { - fail(message, null, null); - } - - public void fail(String message, Throwable t, DispatchErrorType arg2) { - failed = true; - failures.add(new RuntimeException(arg2+message, t)); - logger.error("", t); - } - - /*public SecurityAgentManager getLocalSecurityManager() { - // TODO Auto-generated method stub - return null; - }*/ - - public void receiveCompletion(int[] completionIndex) { - // TODO Auto-generated method stub - - } - - public void receiveResult(Map<String, T2Reference> data, - int[] index) { - this.data = data; - } - - public void requestRun(Runnable runMe) { - thread = new Thread(runMe); - thread.start(); - } - - public InvocationContext getContext() { - return invocationContext; - } - - public String getParentProcessIdentifier() { - // TODO Auto-generated method stub - return ""; - } - -} http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/3ecb1291/taverna-activity-test-utils/src/main/java/net/sf/taverna/t2/activities/testutils/LocationConstants.java ---------------------------------------------------------------------- diff --git a/taverna-activity-test-utils/src/main/java/net/sf/taverna/t2/activities/testutils/LocationConstants.java b/taverna-activity-test-utils/src/main/java/net/sf/taverna/t2/activities/testutils/LocationConstants.java deleted file mode 100644 index c2c214d..0000000 --- a/taverna-activity-test-utils/src/main/java/net/sf/taverna/t2/activities/testutils/LocationConstants.java +++ /dev/null @@ -1,31 +0,0 @@ -/******************************************************************************* - * Copyright (C) 2007 The University of Manchester - * - * Modifications to the initial code base are copyright of their - * respective authors, or their employers as appropriate. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - ******************************************************************************/ -package net.sf.taverna.t2.activities.testutils; - -/** - * A definition of constants for base locations of external resources used for testing. - * - * @author Stuart Owen - * - */ -public interface LocationConstants { - public static final String WSDL_TEST_BASE="http://www.mygrid.org.uk/taverna-tests/testwsdls/"; -} http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/3ecb1291/taverna-activity-test-utils/src/main/resources/context-parts/componentservices.xml ---------------------------------------------------------------------- diff --git a/taverna-activity-test-utils/src/main/resources/context-parts/componentservices.xml b/taverna-activity-test-utils/src/main/resources/context-parts/componentservices.xml deleted file mode 100644 index 36ac3e3..0000000 --- a/taverna-activity-test-utils/src/main/resources/context-parts/componentservices.xml +++ /dev/null @@ -1,101 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<!-- ReferenceSet, ErrorDocument and List services, requires raven.repository --> -<beans xmlns="http://www.springframework.org/schema/beans" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:raven="http://taverna.sf.net/schema/artifact-support" - xsi:schemaLocation="http://www.springframework.org/schema/beans - http://www.springframework.org/schema/beans/spring-beans-2.5.xsd - http://taverna.sf.net/schema/artifact-support - http://taverna.sf.net/schema/artifact-support/artifact-support.xsd"> - - <!-- t2 reference generator --> - <bean id="t2reference.referenceGenerator" - raven:artifact="net.sf.taverna.t2.core:reference-impl:2.0.1-SNAPSHOT" - raven:repository="raven.repository" - class="net.sf.taverna.t2.reference.impl.SimpleT2ReferenceGenerator"> - <property name="namespace" value="testNamespace" /> - </bean> - - <!-- reference set service --> - <bean id="t2reference.service.referenceSetService" - raven:artifact="net.sf.taverna.t2.core:reference-impl:2.0.1-SNAPSHOT" - raven:repository="raven.repository" - class="net.sf.taverna.t2.reference.impl.ReferenceSetServiceImpl"> - <property name="referenceSetDao"> - <ref bean="t2reference.dao.referenceSetDao" /> - </property> - <property name="t2ReferenceGenerator"> - <ref bean="t2reference.referenceGenerator" /> - </property> - <property name="referenceSetAugmentor"> - <ref bean="t2reference.augmentor" /> - </property> - </bean> - - <bean id="t2reference.augmentor" - class="net.sf.taverna.t2.reference.impl.ReferenceSetAugmentorImpl" - raven:artifact="net.sf.taverna.t2.core:reference-impl:2.0.1-SNAPSHOT" - raven:repository="raven.repository"> - <property name="builderRegistry"> - <bean - class="net.sf.taverna.platform.spring.InstanceRegistryFactoryBean"> - <property name="spiRegistry"> - <bean - class="net.sf.taverna.platform.spring.SpiRegistryFactoryBean"> - <property name="repository"> - <ref bean="raven.repository" /> - </property> - <property name="spiClassName" - value="net.sf.taverna.t2.reference.ExternalReferenceBuilderSPI" /> - </bean> - </property> - </bean> - </property> - <property name="translatorRegistry"> - <bean - class="net.sf.taverna.platform.spring.InstanceRegistryFactoryBean"> - <property name="spiRegistry"> - <bean - class="net.sf.taverna.platform.spring.SpiRegistryFactoryBean"> - <property name="repository"> - <ref bean="raven.repository" /> - </property> - <property name="spiClassName" - value="net.sf.taverna.t2.reference.ExternalReferenceTranslatorSPI" /> - </bean> - </property> - </bean> - </property> - </bean> - - <!-- error document service --> - <bean id="t2reference.service.errorDocumentService" - raven:artifact="net.sf.taverna.t2.core:reference-impl:2.0.1-SNAPSHOT" - raven:repository="raven.repository" - class="net.sf.taverna.t2.reference.impl.ErrorDocumentServiceImpl"> - <property name="errorDao"> - <ref bean="t2reference.dao.errorDocumentDao" /> - </property> - <property name="t2ReferenceGenerator"> - <ref bean="t2reference.referenceGenerator" /> - </property> - </bean> - - <!-- list service --> - <bean id="t2reference.service.listService" - raven:artifact="net.sf.taverna.t2.core:reference-impl:2.0.1-SNAPSHOT" - raven:repository="raven.repository" - class="net.sf.taverna.t2.reference.impl.ListServiceImpl"> - <property name="listDao"> - <ref bean="t2reference.dao.listDao" /> - </property> - <property name="t2ReferenceGenerator"> - <ref bean="t2reference.referenceGenerator" /> - </property> - </bean> - - - - -</beans> http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/3ecb1291/taverna-activity-test-utils/src/main/resources/context-parts/dao_hibernate.xml ---------------------------------------------------------------------- diff --git a/taverna-activity-test-utils/src/main/resources/context-parts/dao_hibernate.xml b/taverna-activity-test-utils/src/main/resources/context-parts/dao_hibernate.xml deleted file mode 100644 index 563eb96..0000000 --- a/taverna-activity-test-utils/src/main/resources/context-parts/dao_hibernate.xml +++ /dev/null @@ -1,102 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<!-- Dao implementations based on Spring's hibernate templates --> -<beans xmlns="http://www.springframework.org/schema/beans" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:raven="http://taverna.sf.net/schema/artifact-support" - xsi:schemaLocation="http://www.springframework.org/schema/beans - http://www.springframework.org/schema/beans/spring-beans-2.5.xsd - http://taverna.sf.net/schema/artifact-support - http://taverna.sf.net/schema/artifact-support/artifact-support.xsd"> - - <!-- An SPI-enabled hibernate session factory --> - <bean id="t2reference.orm.h3.sessionFactory" - class="net.sf.taverna.platform.spring.orm.hibernate3.SpiRegistryAwareLocalSessionFactoryBean"> - <property name="dataSource"> - <ref bean="t2reference.jdbc.datasource" /> - </property> - <property name="hibernateProperties"> - <ref bean="t2reference.orm.h3.properties" /> - </property> - <property name="lobHandler"> - <bean - class="org.springframework.jdbc.support.lob.DefaultLobHandler" /> - </property> - <!-- Need to map the abstract superclass for the SPI first, SPI classes --> - <!-- are subclasses of this and hibernate can be picky about the order --> - <property name="mappingResources"> - <list> - <value> - net/sf/taverna/t2/reference/AbstractExternalReference.hbm.xml - </value> - </list> - </property> - <!-- SPI enabled session, uses the linked SPI registry or registries --> - <!-- to gather Class definitions and uses the slightly patched hibernate --> - <!-- to ensure that raven is used to fetch these back when required --> - <property name="spiRegistries"> - <list> - <!-- SPI used by the raven-aware hibernate session factory bean --> - <!-- This *must* go before the external reference SPI bean or --> - <!-- those beans won't find the mapping for their superclasses --> - <bean - class="net.sf.taverna.platform.spring.SpiRegistryFactoryBean"> - <property name="repository"> - <ref bean="raven.repository" /> - </property> - <property name="spiClassName" - value="net.sf.taverna.t2.reference.h3.HibernateMappedEntity" /> - </bean> - <!-- SPI used by the raven-aware hibernate session factory bean --> - <bean - class="net.sf.taverna.platform.spring.SpiRegistryFactoryBean"> - <property name="repository"> - <ref bean="raven.repository" /> - </property> - <property name="spiClassName" - value="net.sf.taverna.t2.reference.ExternalReferenceSPI" /> - </bean> - </list> - </property> - <property name="preloadRegistries"> - <list> - <bean - class="net.sf.taverna.platform.spring.SpiRegistryFactoryBean"> - <property name="repository"> - <ref bean="raven.repository" /> - </property> - <property name="spiClassName" - value="net.sf.taverna.t2.reference.h3.HibernateComponentClass" /> - </bean> - </list> - </property> - </bean> - - <bean id="t2reference.dao.referenceSetDao" - raven:artifact="net.sf.taverna.t2.core:reference-impl:2.0.1-SNAPSHOT" - raven:repository="raven.repository" - class="net.sf.taverna.t2.reference.impl.HibernateReferenceSetDao"> - <property name="sessionFactory"> - <ref local="t2reference.orm.h3.sessionFactory" /> - </property> - </bean> - - <bean id="t2reference.dao.errorDocumentDao" - raven:artifact="net.sf.taverna.t2.core:reference-impl:2.0.1-SNAPSHOT" - raven:repository="raven.repository" - class="net.sf.taverna.t2.reference.impl.HibernateErrorDocumentDao"> - <property name="sessionFactory"> - <ref local="t2reference.orm.h3.sessionFactory" /> - </property> - </bean> - - <bean id="t2reference.dao.listDao" - raven:artifact="net.sf.taverna.t2.core:reference-impl:2.0.1-SNAPSHOT" - raven:repository="raven.repository" - class="net.sf.taverna.t2.reference.impl.HibernateListDao"> - <property name="sessionFactory"> - <ref local="t2reference.orm.h3.sessionFactory" /> - </property> - </bean> - -</beans> http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/3ecb1291/taverna-activity-test-utils/src/main/resources/context-parts/dao_hibernate_transactional.xml ---------------------------------------------------------------------- diff --git a/taverna-activity-test-utils/src/main/resources/context-parts/dao_hibernate_transactional.xml b/taverna-activity-test-utils/src/main/resources/context-parts/dao_hibernate_transactional.xml deleted file mode 100644 index 4823cf8..0000000 --- a/taverna-activity-test-utils/src/main/resources/context-parts/dao_hibernate_transactional.xml +++ /dev/null @@ -1,120 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<!-- Dao implementations backed by full hibernate transaction manager support --> -<beans xmlns="http://www.springframework.org/schema/beans" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:raven="http://taverna.sf.net/schema/artifact-support" - xmlns:aop="http://www.springframework.org/schema/aop" - xmlns:tx="http://www.springframework.org/schema/tx" - xsi:schemaLocation="http://www.springframework.org/schema/beans - http://www.springframework.org/schema/beans/spring-beans-2.5.xsd - http://www.springframework.org/schema/context - http://www.springframework.org/schema/context/spring-context-2.5.xsd - http://www.springframework.org/schema/tx - http://www.springframework.org/schema/tx/spring-tx-2.5.xsd - http://taverna.sf.net/schema/artifact-support - http://taverna.sf.net/schema/artifact-support/artifact-support.xsd - http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd"> - - <!-- Enable declarative transactions through annotations --> - <tx:annotation-driven - transaction-manager="t2reference.orm.h3.txManager" /> - - <!-- Transaction manager --> - <bean id="t2reference.orm.h3.txManager" - class="org.springframework.orm.hibernate3.HibernateTransactionManager"> - <property name="sessionFactory" - ref="t2reference.orm.h3.sessionFactory" /> - </bean> - - <!-- An SPI-enabled hibernate session factory --> - <bean id="t2reference.orm.h3.sessionFactory" - class="net.sf.taverna.platform.spring.orm.hibernate3.SpiRegistryAwareLocalSessionFactoryBean"> - <property name="dataSource"> - <ref bean="t2reference.jdbc.datasource" /> - </property> - <property name="hibernateProperties"> - <ref bean="t2reference.orm.h3.properties" /> - </property> - <property name="lobHandler"> - <bean - class="org.springframework.jdbc.support.lob.DefaultLobHandler" /> - </property> - <!-- Need to map the abstract superclass for the SPI first, SPI classes --> - <!-- are subclasses of this and hibernate can be picky about the order --> - <property name="mappingResources"> - <list> - <value> - net/sf/taverna/t2/reference/AbstractExternalReference.hbm.xml - </value> - </list> - </property> - <!-- SPI enabled session, uses the linked SPI registry or registries --> - <!-- to gather Class definitions and uses the slightly patched hibernate --> - <!-- to ensure that raven is used to fetch these back when required --> - <property name="spiRegistries"> - <list> - <!-- SPI used by the raven-aware hibernate session factory bean --> - <!-- This *must* go before the external reference SPI bean or --> - <!-- those beans won't find the mapping for their superclasses --> - <bean - class="net.sf.taverna.platform.spring.SpiRegistryFactoryBean"> - <property name="repository"> - <ref bean="raven.repository" /> - </property> - <property name="spiClassName" - value="net.sf.taverna.t2.reference.h3.HibernateMappedEntity" /> - </bean> - <!-- SPI used by the raven-aware hibernate session factory bean --> - <bean - class="net.sf.taverna.platform.spring.SpiRegistryFactoryBean"> - <property name="repository"> - <ref bean="raven.repository" /> - </property> - <property name="spiClassName" - value="net.sf.taverna.t2.reference.ExternalReferenceSPI" /> - </bean> - </list> - </property> - <property name="preloadRegistries"> - <list> - <bean - class="net.sf.taverna.platform.spring.SpiRegistryFactoryBean"> - <property name="repository"> - <ref bean="raven.repository" /> - </property> - <property name="spiClassName" - value="net.sf.taverna.t2.reference.h3.HibernateComponentClass" /> - </bean> - </list> - </property> - </bean> - - <bean id="t2reference.dao.referenceSetDao" - raven:artifact="net.sf.taverna.t2.core:reference-impl:2.0.1-SNAPSHOT" - raven:repository="raven.repository" - class="net.sf.taverna.t2.reference.impl.TransactionalHibernateReferenceSetDao"> - <property name="sessionFactory"> - <ref local="t2reference.orm.h3.sessionFactory" /> - </property> - </bean> - - <bean id="t2reference.dao.errorDocumentDao" - raven:artifact="net.sf.taverna.t2.core:reference-impl:2.0.1-SNAPSHOT" - raven:repository="raven.repository" - class="net.sf.taverna.t2.reference.impl.TransactionalHibernateErrorDocumentDao"> - <property name="sessionFactory"> - <ref local="t2reference.orm.h3.sessionFactory" /> - </property> - </bean> - - <bean id="t2reference.dao.listDao" - raven:artifact="net.sf.taverna.t2.core:reference-impl:2.0.1-SNAPSHOT" - raven:repository="raven.repository" - class="net.sf.taverna.t2.reference.impl.TransactionalHibernateListDao"> - <property name="sessionFactory"> - <ref local="t2reference.orm.h3.sessionFactory" /> - </property> - </bean> - -</beans> http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/3ecb1291/taverna-activity-test-utils/src/main/resources/context-parts/dao_inmemory.xml ---------------------------------------------------------------------- diff --git a/taverna-activity-test-utils/src/main/resources/context-parts/dao_inmemory.xml b/taverna-activity-test-utils/src/main/resources/context-parts/dao_inmemory.xml deleted file mode 100644 index bb1a790..0000000 --- a/taverna-activity-test-utils/src/main/resources/context-parts/dao_inmemory.xml +++ /dev/null @@ -1,30 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<!-- In-memory Dao implementations --> -<beans xmlns="http://www.springframework.org/schema/beans" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:raven="http://taverna.sf.net/schema/artifact-support" - xsi:schemaLocation="http://www.springframework.org/schema/beans - http://www.springframework.org/schema/beans/spring-beans-2.5.xsd - http://taverna.sf.net/schema/artifact-support - http://taverna.sf.net/schema/artifact-support/artifact-support.xsd"> - - <bean id="t2reference.dao.referenceSetDao" - raven:artifact="net.sf.taverna.t2.core:reference-impl:2.0.1-SNAPSHOT" - raven:repository="raven.repository" - class="net.sf.taverna.t2.reference.impl.InMemoryReferenceSetDao"> - </bean> - - <bean id="t2reference.dao.errorDocumentDao" - raven:artifact="net.sf.taverna.t2.core:reference-impl:2.0.1-SNAPSHOT" - raven:repository="raven.repository" - class="net.sf.taverna.t2.reference.impl.InMemoryErrorDocumentDao"> - </bean> - - <bean id="t2reference.dao.listDao" - raven:artifact="net.sf.taverna.t2.core:reference-impl:2.0.1-SNAPSHOT" - raven:repository="raven.repository" - class="net.sf.taverna.t2.reference.impl.InMemoryListDao"> - </bean> - -</beans> http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/3ecb1291/taverna-activity-test-utils/src/main/resources/context-parts/hibernateprops_derby.xml ---------------------------------------------------------------------- diff --git a/taverna-activity-test-utils/src/main/resources/context-parts/hibernateprops_derby.xml b/taverna-activity-test-utils/src/main/resources/context-parts/hibernateprops_derby.xml deleted file mode 100644 index 39e812c..0000000 --- a/taverna-activity-test-utils/src/main/resources/context-parts/hibernateprops_derby.xml +++ /dev/null @@ -1,63 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - - -<!-- Full SPI driven test context for the ReferenceService --> -<beans xmlns="http://www.springframework.org/schema/beans" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:raven="http://taverna.sf.net/schema/artifact-support" - xsi:schemaLocation="http://www.springframework.org/schema/beans - http://www.springframework.org/schema/beans/spring-beans-2.5.xsd - http://taverna.sf.net/schema/artifact-support - http://taverna.sf.net/schema/artifact-support/artifact-support.xsd"> - - <!-- Apache Derby rooted at a temporary directory --> - <bean id="t2reference.jdbc.temporaryjdbc" - class="net.sf.taverna.platform.spring.jdbc.TemporaryJDBC"> - </bean> - <bean id="t2reference.jdbc.url" class="java.lang.String" - factory-bean="t2reference.jdbc.temporaryjdbc" - factory-method="getTemporaryDerbyJDBC" /> - <bean id="t2reference.jdbc.datasource" - class="net.sf.taverna.platform.spring.jdbc.InterpolatingDriverManagerDataSource"> - <property name="driverClassName"> - <value>org.apache.derby.jdbc.EmbeddedDriver</value> - </property> - <property name="url"> - <ref bean="t2reference.jdbc.url" /> - </property> - <property name="repository"> - <ref bean="raven.repository" /> - </property> - <property name="driverArtifact"> - <value>org.apache.derby:derby:10.4.1.3</value> - </property> - </bean> - - <!-- Configure hibernate to build schema from scratch, dropping existing --> - <bean id="t2reference.orm.h3.properties" - class="org.springframework.beans.factory.config.PropertiesFactoryBean"> - <property name="properties"> - <props> - <prop key="hibernate.hbm2ddl.auto">create</prop> - <prop key="hibernate.dialect"> - org.hibernate.dialect.DerbyDialect - </prop> - <prop key="hibernate.query.substitutions"> - true 'T', false 'F' - </prop> - <prop key="hibernate.show_sql">false</prop> - <prop key="hibernate.c3p0.minPoolSize">5</prop> - <prop key="hibernate.c3p0.maxPoolSize">20</prop> - <prop key="hibernate.c3p0.timeout">600</prop> - <prop key="hibernate.c3p0.max_statement">50</prop> - <prop key="hibernate.c3p0.testConnectionOnCheckout"> - false - </prop> - <prop key="hibernate.cache.use_second_level_cache"> - false - </prop> - </props> - </property> - </bean> - -</beans> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/3ecb1291/taverna-activity-test-utils/src/main/resources/context-parts/raven_local.xml ---------------------------------------------------------------------- diff --git a/taverna-activity-test-utils/src/main/resources/context-parts/raven_local.xml b/taverna-activity-test-utils/src/main/resources/context-parts/raven_local.xml deleted file mode 100644 index 94238a0..0000000 --- a/taverna-activity-test-utils/src/main/resources/context-parts/raven_local.xml +++ /dev/null @@ -1,48 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<!-- Exports raven.repository --> -<beans xmlns="http://www.springframework.org/schema/beans" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:raven="http://taverna.sf.net/schema/artifact-support" - xsi:schemaLocation="http://www.springframework.org/schema/beans - http://www.springframework.org/schema/beans/spring-beans-2.5.xsd - http://taverna.sf.net/schema/artifact-support - http://taverna.sf.net/schema/artifact-support/artifact-support.xsd"> - - <repository id="raven.repository" - xmlns="http://taverna.sf.net/schema/artifact-support" - base="${user.home}/.m2/repository/"> - <repositories /> - <system> - <!-- T2Reference API --> - <sys - artifact="net.sf.taverna.t2.core:reference-api:0.8" /> - - <!-- T2Platform --> - <sys artifact="net.sf.taverna.t2:platform:0.1" /> - <sys artifact="commons-logging:commons-logging:1.1.1" /> - - <!-- Raven --> - <sys artifact="uk.org.mygrid.taverna.raven:raven:1.8" /> - - <!-- Spring + Essential External Modules --> - <sys artifact="org.springframework:spring-orm:2.5.4" /> - <sys artifact="org.springframework:spring-beans:2.5.4" /> - <sys artifact="org.springframework:spring-core:2.5.4" /> - <sys artifact="org.springframework:spring-context:2.5.4" /> - <sys artifact="org.springframework:spring-tx:2.5.4" /> - <sys artifact="org.springframework:spring-jdbc:2.5.4" /> - <sys artifact="aopalliance:aopalliance:1.0" /> - <sys artifact="geronimo-spec:geronimo-spec-jta:1.0-M1" /> - - <!-- Hibernate + Dependencies (minimal) --> - <sys artifact="org.hibernate:hibernate:3.2.5.ga.raven" /> - <sys artifact="dom4j:dom4j:1.6.1" /> - <sys artifact="cglib:cglib:2.1_3" /> - <sys artifact="asm:asm:1.5.3" /> - <sys - artifact="commons-collections:commons-collections:2.1.1" /> - </system> - </repository> - -</beans> http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/3ecb1291/taverna-activity-test-utils/src/main/resources/context-parts/referenceservice.xml ---------------------------------------------------------------------- diff --git a/taverna-activity-test-utils/src/main/resources/context-parts/referenceservice.xml b/taverna-activity-test-utils/src/main/resources/context-parts/referenceservice.xml deleted file mode 100644 index 3a37d1b..0000000 --- a/taverna-activity-test-utils/src/main/resources/context-parts/referenceservice.xml +++ /dev/null @@ -1,58 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<!-- Context providing a full ReferenceService backed by in-memory Dao implementations --> -<beans xmlns="http://www.springframework.org/schema/beans" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:raven="http://taverna.sf.net/schema/artifact-support" - xsi:schemaLocation="http://www.springframework.org/schema/beans - http://www.springframework.org/schema/beans/spring-beans-2.5.xsd - http://taverna.sf.net/schema/artifact-support - http://taverna.sf.net/schema/artifact-support/artifact-support.xsd"> - - <!-- Reference service bean --> - <bean id="t2reference.service.referenceService" - raven:artifact="net.sf.taverna.t2.core:reference-impl:2.0.1-SNAPSHOT" - raven:repository="raven.repository" - class="net.sf.taverna.t2.reference.impl.ReferenceServiceImpl"> - <property name="referenceSetService"> - <ref bean="t2reference.service.referenceSetService" /> - </property> - <property name="listService"> - <ref bean="t2reference.service.listService" /> - </property> - <property name="errorDocumentService"> - <ref bean="t2reference.service.errorDocumentService" /> - </property> - <property name="converterRegistry"> - <bean id="converterRegistry" - class="net.sf.taverna.platform.spring.InstanceRegistryFactoryBean"> - <property name="spiRegistry"> - <bean - class="net.sf.taverna.platform.spring.SpiRegistryFactoryBean"> - <property name="repository"> - <ref bean="raven.repository" /> - </property> - <property name="spiClassName" - value="net.sf.taverna.t2.reference.ValueToReferenceConverterSPI" /> - </bean> - </property> - </bean> - </property> - <property name="valueBuilderRegistry"> - <bean - class="net.sf.taverna.platform.spring.InstanceRegistryFactoryBean"> - <property name="spiRegistry"> - <bean - class="net.sf.taverna.platform.spring.SpiRegistryFactoryBean"> - <property name="repository"> - <ref bean="raven.repository" /> - </property> - <property name="spiClassName" - value="net.sf.taverna.t2.reference.StreamToValueConverterSPI" /> - </bean> - </property> - </bean> - </property> - </bean> - -</beans>
