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/02/17 12:29:28 UTC

[24/50] [abbrv] incubator-taverna-server git commit: Merge branch '2.5-branch' into taverna-3

http://git-wip-us.apache.org/repos/asf/incubator-taverna-server/blob/ad1aa3b5/server-webapp/src/test/java/org/taverna/server/master/WorkflowSerializationTest.java
----------------------------------------------------------------------
diff --cc server-webapp/src/test/java/org/taverna/server/master/WorkflowSerializationTest.java
index 117f637,4d49d17..0450317
--- a/server-webapp/src/test/java/org/taverna/server/master/WorkflowSerializationTest.java
+++ b/server-webapp/src/test/java/org/taverna/server/master/WorkflowSerializationTest.java
@@@ -29,22 -27,20 +29,23 @@@ public class WorkflowSerializationTest 
  				.newDocumentBuilder();
  		Document doc = db.getDOMImplementation().createDocument(null, null,
  				null);
 -		w.content[0] = doc.createElement("foo");
 -		w.content[0].setTextContent("bar");
 -		w.content[0].setAttribute("xyz", "abc");
 +		Element workflow = doc.createElementNS(T2FLOW_NS, T2FLOW_ROOTNAME);
 +		Element foo = doc.createElementNS("urn:foo:bar", "pqr:foo");
 +		foo.setTextContent("bar");
 +		foo.setAttribute("xyz", "abc");
 +		workflow.appendChild(foo);
 +		Workflow w = new Workflow(workflow);
  
  		ByteArrayOutputStream baos = new ByteArrayOutputStream();
- 		ObjectOutputStream oos = new ObjectOutputStream(baos);
- 		oos.writeObject(w);
- 		oos.close();
+ 		try (ObjectOutputStream oos = new ObjectOutputStream(baos)) {
+ 			oos.writeObject(w);
+ 		}
  
- 		ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
- 		ObjectInputStream ois = new ObjectInputStream(bais);
- 		Object o = ois.readObject();
- 		ois.close();
+ 		Object o;
+ 		try (ObjectInputStream ois = new ObjectInputStream(
+ 				new ByteArrayInputStream(baos.toByteArray()))) {
+ 			o = ois.readObject();
+ 		}
  
  		Assert.assertNotNull(o);
  		Assert.assertEquals(w.getClass(), o.getClass());

http://git-wip-us.apache.org/repos/asf/incubator-taverna-server/blob/ad1aa3b5/server-worker/pom.xml
----------------------------------------------------------------------
diff --cc server-worker/pom.xml
index df01a00,42270ff..70239a2
--- a/server-worker/pom.xml
+++ b/server-worker/pom.xml
@@@ -44,25 -40,7 +41,24 @@@
  		<dependency>
  			<groupId>commons-io</groupId>
  			<artifactId>commons-io</artifactId>
- 			<version>2.1</version>
  		</dependency>
 +		<dependency>
 +			<groupId>uk.org.taverna.scufl2</groupId>
 +			<artifactId>scufl2-api</artifactId>
 +			<version>${scufl2.version}</version>
 +		</dependency>
 +		<dependency>
 +			<groupId>uk.org.taverna.scufl2</groupId>
 +			<artifactId>scufl2-t2flow</artifactId>
 +			<version>${scufl2.version}</version>
 +			<scope>runtime</scope>
 +		</dependency>
 +		<dependency>
 +			<groupId>uk.org.taverna.scufl2</groupId>
 +			<artifactId>scufl2-rdfxml</artifactId>
 +			<version>${scufl2.version}</version>
 +			<scope>runtime</scope>
 +		</dependency>
  	</dependencies>
  
  	<build>

http://git-wip-us.apache.org/repos/asf/incubator-taverna-server/blob/ad1aa3b5/server-worker/src/main/java/org/taverna/server/localworker/api/Worker.java
----------------------------------------------------------------------
diff --cc server-worker/src/main/java/org/taverna/server/localworker/api/Worker.java
index 0000000,7b9f012..c513ed8
mode 000000,100644..100644
--- a/server-worker/src/main/java/org/taverna/server/localworker/api/Worker.java
+++ b/server-worker/src/main/java/org/taverna/server/localworker/api/Worker.java
@@@ -1,0 -1,135 +1,135 @@@
+ /*
+  * Copyright (C) 2010-2012 The University of Manchester
+  * 
+  * See the file "LICENSE" for license terms.
+  */
+ package org.taverna.server.localworker.api;
+ 
+ import java.io.File;
+ import java.util.List;
+ import java.util.Map;
+ 
+ import org.taverna.server.localworker.impl.LocalWorker;
+ import org.taverna.server.localworker.remote.ImplementationException;
+ import org.taverna.server.localworker.remote.RemoteListener;
+ import org.taverna.server.localworker.remote.RemoteStatus;
+ import org.taverna.server.localworker.server.UsageRecordReceiver;
+ 
+ /**
+  * The interface between the connectivity layer and the thunk to the
+  * subprocesses.
+  * 
+  * @author Donal Fellows
+  */
+ public interface Worker {
+ 	/**
+ 	 * Fire up the workflow. This causes a transition into the operating state.
+ 	 * 
+ 	 * @param local
+ 	 *            The reference to the factory class for this worker.
+ 	 * @param executeWorkflowCommand
+ 	 *            The command to run to execute the workflow.
+ 	 * @param workflow
+ 	 *            The workflow document to execute.
+ 	 * @param workingDir
+ 	 *            What directory to use as the working directory.
+ 	 * @param inputBaclavaFile
+ 	 *            The baclava file to use for inputs, or <tt>null</tt> to use
+ 	 *            the other <b>input*</b> arguments' values.
+ 	 * @param inputRealFiles
+ 	 *            A mapping of input names to files that supply them. Note that
+ 	 *            we assume that nothing mapped here will be mapped in
+ 	 *            <b>inputValues</b>.
+ 	 * @param inputValues
+ 	 *            A mapping of input names to values to supply to them. Note
+ 	 *            that we assume that nothing mapped here will be mapped in
+ 	 *            <b>inputFiles</b>.
+ 	 * @param inputDelimiters
+ 	 *            A mapping of input names to characters used to split them into
+ 	 *            lists.
+ 	 * @param outputBaclavaFile
+ 	 *            What baclava file to write the output from the workflow into,
+ 	 *            or <tt>null</tt> to have it written into the <tt>out</tt>
+ 	 *            subdirectory.
+ 	 * @param contextDirectory
+ 	 *            The directory containing the keystore and truststore. <i>Must
+ 	 *            not be <tt>null</tt>.</i>
+ 	 * @param keystorePassword
+ 	 *            The password to the keystore and truststore. <i>Must not be
+ 	 *            <tt>null</tt>.</i>
+ 	 * @param generateProvenance
+ 	 *            Whether to generate a run bundle containing provenance data.
+ 	 * @param environment
+ 	 *            Any environment variables that need to be added to the
+ 	 *            invokation.
+ 	 * @param masterToken
+ 	 *            The internal name of the workflow run.
+ 	 * @param runtimeSettings
+ 	 *            List of configuration details for the forked runtime.
+ 	 * @return Whether a successful start happened.
+ 	 * @throws Exception
+ 	 *             If any of quite a large number of things goes wrong.
+ 	 */
+ 	boolean initWorker(LocalWorker local, String executeWorkflowCommand,
 -			String workflow, File workingDir, File inputBaclavaFile,
++			byte[] workflow, File workingDir, File inputBaclavaFile,
+ 			Map<String, File> inputRealFiles, Map<String, String> inputValues,
+ 			Map<String, String> inputDelimiters, File outputBaclavaFile,
+ 			File contextDirectory, char[] keystorePassword,
+ 			boolean generateProvenance, Map<String, String> environment,
+ 			String masterToken, List<String> runtimeSettings) throws Exception;
+ 
+ 	/**
+ 	 * Kills off the subprocess if it exists and is alive.
+ 	 * 
+ 	 * @throws Exception
+ 	 *             if anything goes badly wrong when the worker is being killed
+ 	 *             off.
+ 	 */
+ 	void killWorker() throws Exception;
+ 
+ 	/**
+ 	 * Move the worker out of the stopped state and back to operating.
+ 	 * 
+ 	 * @throws Exception
+ 	 *             if it fails (which it always does; operation currently
+ 	 *             unsupported).
+ 	 */
+ 	void startWorker() throws Exception;
+ 
+ 	/**
+ 	 * Move the worker into the stopped state from the operating state.
+ 	 * 
+ 	 * @throws Exception
+ 	 *             if it fails (which it always does; operation currently
+ 	 *             unsupported).
+ 	 */
+ 	void stopWorker() throws Exception;
+ 
+ 	/**
+ 	 * @return The status of the workflow run. Note that this can be an
+ 	 *         expensive operation.
+ 	 */
+ 	RemoteStatus getWorkerStatus();
+ 
+ 	/**
+ 	 * @return The listener that is registered by default, in addition to all
+ 	 *         those that are explicitly registered by the user.
+ 	 */
+ 	RemoteListener getDefaultListener();
+ 
+ 	/**
+ 	 * @param receiver
+ 	 *            The destination where any final usage records are to be
+ 	 *            written in order to log them back to the server.
+ 	 */
+ 	void setURReceiver(UsageRecordReceiver receiver);
+ 
+ 	/**
+ 	 * Arrange for the deletion of any resources created during worker process
+ 	 * construction. Guaranteed to be the last thing done before finalization.
+ 	 * 
+ 	 * @throws ImplementationException
+ 	 *             If anything goes wrong.
+ 	 */
+ 	void deleteLocalResources() throws ImplementationException;
+ }

http://git-wip-us.apache.org/repos/asf/incubator-taverna-server/blob/ad1aa3b5/server-worker/src/main/java/org/taverna/server/localworker/impl/LocalWorker.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-taverna-server/blob/ad1aa3b5/server-worker/src/main/java/org/taverna/server/localworker/impl/TavernaRunManager.java
----------------------------------------------------------------------
diff --cc server-worker/src/main/java/org/taverna/server/localworker/impl/TavernaRunManager.java
index 19e1150,a4c9a7e..03ee69d
--- a/server-worker/src/main/java/org/taverna/server/localworker/impl/TavernaRunManager.java
+++ b/server-worker/src/main/java/org/taverna/server/localworker/impl/TavernaRunManager.java
@@@ -12,9 -12,15 +12,15 @@@ import static java.lang.System.out
  import static java.lang.System.setProperty;
  import static java.lang.System.setSecurityManager;
  import static java.rmi.registry.LocateRegistry.getRegistry;
+ import static org.taverna.server.localworker.api.Constants.DEATH_DELAY;
+ import static org.taverna.server.localworker.api.Constants.LOCALHOST;
+ import static org.taverna.server.localworker.api.Constants.RMI_HOST_PROP;
+ import static org.taverna.server.localworker.api.Constants.SECURITY_POLICY_FILE;
+ import static org.taverna.server.localworker.api.Constants.SEC_POLICY_PROP;
+ import static org.taverna.server.localworker.api.Constants.UNSECURE_PROP;
  
 -import java.io.StringReader;
 -import java.io.StringWriter;
 +import java.io.ByteArrayInputStream;
 +import java.net.URI;
  import java.rmi.RMISecurityManager;
  import java.rmi.RemoteException;
  import java.rmi.registry.Registry;
@@@ -25,15 -31,24 +31,17 @@@ import java.util.List
  import java.util.Map;
  import java.util.UUID;
  
- import org.taverna.server.localworker.remote.ImplementationException;
 -import javax.xml.parsers.DocumentBuilderFactory;
 -import javax.xml.transform.TransformerFactory;
 -import javax.xml.transform.dom.DOMSource;
 -import javax.xml.transform.stream.StreamResult;
 -import javax.xml.ws.Holder;
 -
+ import org.taverna.server.localworker.api.RunAccounting;
+ import org.taverna.server.localworker.api.Worker;
+ import org.taverna.server.localworker.api.WorkerFactory;
  import org.taverna.server.localworker.remote.RemoteRunFactory;
  import org.taverna.server.localworker.remote.RemoteSingleRun;
  import org.taverna.server.localworker.server.UsageRecordReceiver;
+ import org.w3c.dom.Document;
+ import org.w3c.dom.Element;
 -import org.w3c.dom.Node;
 -import org.w3c.dom.NodeList;
 -import org.xml.sax.InputSource;
 +
 +import uk.org.taverna.scufl2.api.io.WorkflowBundleIO;
  
- import edu.umd.cs.findbugs.annotations.SuppressWarnings;
- 
  /**
   * The registered factory for runs, this class is responsible for constructing
   * runs that are suitable for particular users. It is also the entry point for
@@@ -42,20 -57,34 +50,33 @@@
   * @author Donal Fellows
   * @see LocalWorker
   */
- @SuppressWarnings({ "SE_BAD_FIELD", "SE_NO_SERIALVERSIONID" })
 -@java.lang.SuppressWarnings("serial")
++@SuppressWarnings("serial")
  public class TavernaRunManager extends UnicastRemoteObject implements
  		RemoteRunFactory, RunAccounting, WorkerFactory {
 -	DocumentBuilderFactory dbf;
 -	TransformerFactory tf;
  	String command;
- 	Map<String, String> seedEnvironment = new HashMap<String, String>();
- 	List<String> javaInitParams = new ArrayList<String>();
++	Map<String, String> seedEnvironment = new HashMap<>();
++	List<String> javaInitParams = new ArrayList<>();
 +	private WorkflowBundleIO io;
 +	private int activeRuns = 0;
  	// Hacks!
  	public static String interactionHost;
  	public static String interactionPort;
  	public static String interactionWebdavPath;
  	public static String interactionFeedPath;
 -	Map<String, String> seedEnvironment = new HashMap<>();
 -	List<String> javaInitParams = new ArrayList<>();
 -	private int activeRuns = 0;
  
+ 	/**
+ 	 * How to get the actual workflow document from the XML document that it is
+ 	 * contained in.
+ 	 * 
+ 	 * @param containerDocument
+ 	 *            The document sent from the web interface.
+ 	 * @return The element describing the workflow, as expected by the Taverna
+ 	 *         command line executor.
+ 	 */
+ 	protected Element unwrapWorkflow(Document containerDocument) {
+ 		return (Element) containerDocument.getDocumentElement().getFirstChild();
+ 	}
+ 
  	private static final String usage = "java -jar server.worker.jar workflowExecScript ?-Ekey=val...? ?-Jconfig? UUID";
  
  	/**
@@@ -149,35 -227,14 +182,15 @@@
  		if (!getProperty(UNSECURE_PROP, "no").equals("yes")) {
  			setProperty(SEC_POLICY_PROP, LocalWorker.class.getClassLoader()
  					.getResource(SECURITY_POLICY_FILE).toExternalForm());
- 			setProperty(RMI_HOST_PROP, "127.0.0.1");
+ 			setProperty(RMI_HOST_PROP, LOCALHOST);
  		}
  		setSecurityManager(new RMISecurityManager());
- 		String command = args[0];
  		factoryName = args[args.length - 1];
- 		registry = getRegistry();
- 		TavernaRunManager man = new TavernaRunManager(command);
- 		for (int i = 1; i < args.length - 1; i++) {
- 			if (args[i].startsWith("-E")) {
- 				String arg = args[i].substring(2);
- 				int idx = arg.indexOf('=');
- 				if (idx > 0) {
- 					man.addEnvironmentDefinition(arg.substring(0, idx),
- 							arg.substring(idx + 1));
- 					continue;
- 				}
- 			} else if (args[i].startsWith("-D")) {
- 				if (args[i].indexOf('=') > 0) {
- 					man.addJavaParameter(args[i]);
- 					continue;
- 				}
- 			} else if (args[i].startsWith("-J")) {
- 				man.addJavaParameter(args[i].substring(2));
- 				continue;
- 			}
- 			throw new IllegalArgumentException("argument \"" + args[i]
- 					+ "\" must start with -D, -E or -J; "
- 					+ "-D and -E must contain a \"=\"");
- 		}
+ 		TavernaRunManager man = new TavernaRunManager(args[0]);
+ 		for (int i = 1; i < args.length - 1; i++)
+ 			man.addArgument(args[i]);
+ 		registry = getRegistry(LOCALHOST);
++
  		registry.bind(factoryName, man);
  		getRuntime().addShutdownHook(new Thread() {
  			@Override

http://git-wip-us.apache.org/repos/asf/incubator-taverna-server/blob/ad1aa3b5/server-worker/src/main/java/org/taverna/server/localworker/impl/WorkerCore.java
----------------------------------------------------------------------
diff --cc server-worker/src/main/java/org/taverna/server/localworker/impl/WorkerCore.java
index 0e88b47,9c96859..7a24cd5
--- a/server-worker/src/main/java/org/taverna/server/localworker/impl/WorkerCore.java
+++ b/server-worker/src/main/java/org/taverna/server/localworker/impl/WorkerCore.java
@@@ -27,12 -39,14 +39,15 @@@ import static org.taverna.server.localw
  import static org.taverna.server.localworker.remote.RemoteStatus.Finished;
  import static org.taverna.server.localworker.remote.RemoteStatus.Initialized;
  import static org.taverna.server.localworker.remote.RemoteStatus.Operating;
+ import static org.taverna.server.localworker.remote.RemoteStatus.Stopped;
  
+ import java.io.BufferedReader;
  import java.io.File;
  import java.io.FileNotFoundException;
 +import java.io.FileOutputStream;
  import java.io.IOException;
  import java.io.InputStream;
+ import java.io.InputStreamReader;
  import java.io.OutputStream;
  import java.io.OutputStreamWriter;
  import java.io.PrintWriter;
@@@ -233,52 -198,37 +199,40 @@@ public class WorkerCore extends Unicast
  	 *             If any of quite a large number of things goes wrong.
  	 */
  	@Override
- 	public boolean initWorker(final String executeWorkflowCommand,
- 			final byte[] workflow, final File workingDir,
- 			final File inputBaclava, final Map<String, File> inputFiles,
- 			final Map<String, String> inputValues, final File outputBaclava,
- 			final File securityDir, final char[] password,
- 			final Map<String, String> environment, final String token,
- 			final List<String> runtime) throws IOException {
- 		final Holder<IOException> h = new Holder<IOException>();
- 		Thread t = new Thread(new Runnable() {
- 			@Override
- 			public void run() {
- 				try {
- 					ProcessBuilder pb = createProcessBuilder(
- 							executeWorkflowCommand, workflow, workingDir,
- 							inputBaclava, inputFiles, inputValues,
- 							outputBaclava, securityDir, password, environment,
- 							token, runtime);
- 
- 					// Start the subprocess
- 					out.println("starting " + pb.command() + " in directory "
- 							+ workingDir);
- 					subprocess = pb.start();
- 					if (subprocess == null)
- 						throw new IOException(
- 								"unknown failure creating process");
- 					start = new Date();
- 					accounting.runStarted();
- 
- 					// Capture its stdout and stderr
- 					new AsyncCopy(subprocess.getInputStream(), stdout);
- 					new AsyncCopy(subprocess.getErrorStream(), stderr);
- 					if (password != null)
- 						new AsyncPrint(subprocess.getOutputStream(), password);
- 				} catch (IOException e) {
- 					h.value = e;
- 				}
- 			}
- 		});
- 		t.start();
 -	public boolean initWorker(@Nonnull final LocalWorker local,
++	public boolean initWorker(
++			@Nonnull final LocalWorker local,
+ 			@Nonnull final String executeWorkflowCommand,
 -			@Nonnull final String workflow, @Nonnull final File workingDir,
++			@Nonnull final byte[] workflow,
++			@Nonnull final File workingDir,
+ 			@Nullable final File inputBaclava,
+ 			@Nonnull final Map<String, File> inputFiles,
 -			@Nonnull final Map<String, String> inputValues,
++			@Nonnull final Map<String, String> inputValues, 
+ 			@Nonnull final Map<String, String> inputDelimiters,
+ 			@Nullable final File outputBaclava,
 -			@Nonnull final File securityDir, @Nullable final char[] password,
++			@Nonnull final File securityDir,
++			@Nullable final char[] password,
+ 			final boolean generateProvenance,
+ 			@Nonnull final Map<String, String> environment,
 -			@Nonnull final String token, @Nonnull final List<String> runtime)
 -			throws IOException {
++			@Nullable final String token,
++			@Nonnull final List<String> runtime) throws IOException {
  		try {
- 			t.join(START_WAIT_TIME);
- 		} catch (InterruptedException e) {
- 			// Won't happen
+ 			new TimingOutTask() {
+ 				@Override
+ 				public void doIt() throws IOException {
+ 					startExecutorSubprocess(
+ 							createProcessBuilder(local, executeWorkflowCommand,
+ 									workflow, workingDir, inputBaclava,
+ 									inputFiles, inputValues, inputDelimiters,
+ 									outputBaclava, securityDir, password,
+ 									generateProvenance, environment, token,
+ 									runtime), password);
+ 				}
+ 			}.doOrTimeOut(START_WAIT_TIME);
+ 		} catch (IOException e) {
+ 			throw e;
+ 		} catch (Exception e) {
+ 			throw new IOException(e);
  		}
- 		if (h.value != null)
- 			throw h.value;
  		return subprocess != null;
  	}
  
@@@ -317,14 -287,20 +291,20 @@@
  	 * @throws FileNotFoundException
  	 *             If we can't write the workflow out (unlikely)
  	 */
- 	ProcessBuilder createProcessBuilder(String executeWorkflowCommand,
- 			byte[] workflow, File workingDir, File inputBaclava,
- 			Map<String, File> inputFiles, Map<String, String> inputValues,
- 			File outputBaclava, File securityDir, char[] password,
- 			Map<String, String> environment, String token, List<String> runtime)
- 			throws IOException, UnsupportedEncodingException,
- 			FileNotFoundException {
+ 	@Nonnull
+ 	ProcessBuilder createProcessBuilder(@Nonnull LocalWorker local,
 -			@Nonnull String executeWorkflowCommand, @Nonnull String workflow,
++			@Nonnull String executeWorkflowCommand, @Nonnull byte[] workflow,
+ 			@Nonnull File workingDir, @Nullable File inputBaclava,
+ 			@Nonnull Map<String, File> inputFiles,
+ 			@Nonnull Map<String, String> inputValues,
+ 			@Nonnull Map<String, String> inputDelimiters,
+ 			@Nullable File outputBaclava, @Nonnull File securityDir,
+ 			@Nonnull char[] password, boolean generateProvenance,
+ 			@Nonnull Map<String, String> environment, @Nonnull String token,
+ 			@Nonnull List<String> runtime) throws IOException,
+ 			UnsupportedEncodingException, FileNotFoundException {
  		ProcessBuilder pb = new ProcessBuilder();
+ 		pb.command().add(TIME);
  		/*
  		 * WARNING! HERE THERE BE DRAGONS! BE CAREFUL HERE!
  		 * 
@@@ -416,13 -405,11 +409,10 @@@
  		}
  
  		// Add an argument holding the workflow
- 		File tmp = createTempFile("taverna", ".t2flow");
- 		OutputStream os = new FileOutputStream(tmp);
- 		try {
 -		workflowFile = createTempFile(".wf_", ".t2flow", workingDir);
 -		write(workflowFile, workflow, "UTF-8");
 -		if (!workflowFile.exists())
 -			throw new IOException("failed to instantiate workflow file at "
 -					+ workflowFile);
++		File tmp = createTempFile(".wf_", ".scufl2", workingDir);
++		try (OutputStream os = new FileOutputStream(tmp)) {
 +			os.write(workflow);
- 		} finally {
- 			os.close();
 +		}
  		pb.command().add(workflowFile.getAbsolutePath());
  
  		// Indicate what working directory to use
@@@ -439,14 -428,17 +431,17 @@@
  		env.put("PATH", new File(System.getProperty("java.home"), "bin")
  				+ pathSeparator + env.get("PATH"));
  		// Patch the environment to deal with TAVSERV-189
 -		env.put("RAVEN_APPHOME", workingDir.getCanonicalPath());
 +		env.put("TAVERNA_APPHOME", workingDir.getCanonicalPath());
  		// Patch the environment to deal with TAVSERV-224
  		env.put("TAVERNA_RUN_ID", token);
- 		if (interactionHost != null) {
- 			env.put("INTERACTION_HOST", interactionHost);
- 			env.put("INTERACTION_PORT", interactionPort);
- 			env.put("INTERACTION_WEBDAV", interactionWebdavPath);
- 			env.put("INTERACTION_FEED", interactionFeedPath);
+ 		if (interactionHost != null || local.interactionFeedURL != null
+ 				|| local.webdavURL != null) {
+ 			env.put("INTERACTION_HOST", makeInterHost(local.interactionFeedURL));
+ 			env.put("INTERACTION_PORT", makeInterPort(local.interactionFeedURL));
+ 			env.put("INTERACTION_FEED", makeInterPath(local.interactionFeedURL));
+ 			env.put("INTERACTION_WEBDAV",
+ 					local.webdavURL != null ? local.webdavURL.getPath()
+ 							: interactionWebdavPath);
  		}
  		return pb;
  	}

http://git-wip-us.apache.org/repos/asf/incubator-taverna-server/blob/ad1aa3b5/server-worker/src/test/java/org/taverna/server/localworker/impl/LocalWorkerTest.java
----------------------------------------------------------------------
diff --cc server-worker/src/test/java/org/taverna/server/localworker/impl/LocalWorkerTest.java
index 591eb08,ef92cc5..7bcd92e
--- a/server-worker/src/test/java/org/taverna/server/localworker/impl/LocalWorkerTest.java
+++ b/server-worker/src/test/java/org/taverna/server/localworker/impl/LocalWorkerTest.java
@@@ -90,15 -89,16 +89,16 @@@ public class LocalWorkerTest 
  		}
  
  		@Override
- 		public boolean initWorker(String executeWorkflowCommand,
- 				byte[] workflow, File workingDir, File inputBaclava,
+ 		public boolean initWorker(LocalWorker local,
 -				String executeWorkflowCommand, String workflow,
++				String executeWorkflowCommand, byte[] workflow,
+ 				File workingDir, File inputBaclava,
  				Map<String, File> inputFiles, Map<String, String> inputValues,
- 				File outputBaclava, File cmdir, char[] cmpass,
- 				Map<String, String> env, String id, List<String> conf)
- 				throws Exception {
+ 				Map<String, String> delimiters, File outputBaclava, File cmdir,
+ 				char[] cmpass, boolean doprov, Map<String, String> env,
+ 				String id, List<String> conf) throws Exception {
  			events.add("init[");
  			events.add(executeWorkflowCommand);
 -			events.add(workflow);
 +			events.add(new String(workflow, "UTF-8"));
  			int dirLen = workingDir.getName().length();
  			events.add(Integer.toString(dirLen));
  			events.add(inputBaclava == null ? "<null>" : inputBaclava
@@@ -153,9 -154,9 +154,9 @@@
  
  	@Before
  	public void setUp() throws Exception {
 -		lw = new LocalWorker("XWC", "WF", null, randomUUID(),
 +		lw = new LocalWorker("XWC", "WF".getBytes("UTF-8"), null, randomUUID(),
  				new HashMap<String, String>(), new ArrayList<String>(), factory);
- 		events = new ArrayList<String>();
+ 		events = new ArrayList<>();
  		returnThisStatus = RemoteStatus.Operating;
  	}
  
@@@ -547,4 -548,4 +548,4 @@@
  						"{bar=<null>, foo=foofile}",
  						"{bar=barvalue, foo=null}", "boo", "]", "kill"), events);
  	}
--}
++}