http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/3ecb1291/taverna-observer/src/main/java/net/sf/taverna/t2/lang/observer/SwingAwareObserver.java ---------------------------------------------------------------------- diff --git a/taverna-observer/src/main/java/net/sf/taverna/t2/lang/observer/SwingAwareObserver.java b/taverna-observer/src/main/java/net/sf/taverna/t2/lang/observer/SwingAwareObserver.java deleted file mode 100644 index 39435d7..0000000 --- a/taverna-observer/src/main/java/net/sf/taverna/t2/lang/observer/SwingAwareObserver.java +++ /dev/null @@ -1,51 +0,0 @@ -/******************************************************************************* - * Copyright (C) 2012 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.lang.observer; - -import javax.swing.SwingUtilities; - -/** - * Implementation of an {@link Observer} that adds calls to notify to the AWT event dispatching - * thread. - * - * @author David Withers - */ -public abstract class SwingAwareObserver<Message> implements Observer<Message> { - - @Override - public void notify(final Observable<Message> sender, final Message message) throws Exception { - Runnable runnable = new Runnable() { - @Override - public void run() { - notifySwing(sender, message); - } - }; - if (SwingUtilities.isEventDispatchThread()) { - runnable.run(); - } else { - // T2-971 - SwingUtilities.invokeLater(runnable); - } - } - - public abstract void notifySwing(Observable<Message> sender, Message message); - -}
http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/3ecb1291/taverna-observer/src/main/java/net/sf/taverna/t2/lang/observer/package-info.java ---------------------------------------------------------------------- diff --git a/taverna-observer/src/main/java/net/sf/taverna/t2/lang/observer/package-info.java b/taverna-observer/src/main/java/net/sf/taverna/t2/lang/observer/package-info.java deleted file mode 100644 index e9d3ff2..0000000 --- a/taverna-observer/src/main/java/net/sf/taverna/t2/lang/observer/package-info.java +++ /dev/null @@ -1,73 +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 - ******************************************************************************/ -/** - * Implementation of the observer pattern. {@link Observer}s registers with an - * {@link Observable} using {@link Observable#addObserver(Observer)}, and will receive - * notifications as a call to {@link Observer#notify(Observable, Object)}. - * <p> - * Typical implementations of {@link Observable} will be delegating to a - * {@link MultiCaster} to do the boring observer registration and message - * dispatching. - * </p> - * <p> - * Example of Observable: - * <pre> - * public class MyObservable implements Observable<MyEvent> { - * public static class MyEvent { - * // .. - * } - * private MultiCaster<:MyEvent> multiCaster = new MultiCaster<:MyEvent>(this); - * - * public void doStuff() { - * multiCaster.notify(new MyEvent()); - * } - * - * public void addObserver(Observer<MyEvent> observer) { - * multiCaster.addObserver(observer); - * } - * - * public List<Observer<MyEvent>> getObservers() { - * return multiCaster.getObservers(); - * } - * - * public void removeObserver(Observer<MyEvent> observer) { - * multiCaster.removeObserver(observer); - * } - * } - * </pre> - * And an observer that is notified when MyObservable.doStuff() is called: - * <pre> - * public class MyObserver implements Observer<MyEvent> { - * public void notify(Observable<MyEvent> sender, MyEvent message) { - * System.out.println("Receieved " + message + " from " + sender); - * } - * } - * </pre> - * Example of usage: - * <pre> - * MyObservable observable = new MyObservable(); - * MyObserver observer = new MyObserver(); - * observable.addObserver(observer); - * observable.doStuff(); - * </pre> - */ -package net.sf.taverna.t2.lang.observer; - http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/3ecb1291/taverna-observer/src/test/java/net/sf/taverna/t2/lang/observer/ObserverTest.java ---------------------------------------------------------------------- diff --git a/taverna-observer/src/test/java/net/sf/taverna/t2/lang/observer/ObserverTest.java b/taverna-observer/src/test/java/net/sf/taverna/t2/lang/observer/ObserverTest.java deleted file mode 100644 index 661cbbc..0000000 --- a/taverna-observer/src/test/java/net/sf/taverna/t2/lang/observer/ObserverTest.java +++ /dev/null @@ -1,133 +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.lang.observer; - -import static org.junit.Assert.*; - -import java.util.List; - -import net.sf.taverna.t2.lang.observer.MultiCaster; -import net.sf.taverna.t2.lang.observer.Observable; -import net.sf.taverna.t2.lang.observer.Observer; - -import org.junit.Test; - -public class ObserverTest { - - @Test - public void registerObserver() throws Exception { - MyObservable observable = new MyObservable(); - MyObserver observer1 = new MyObserver(); - MyObserver observer2 = new MyObserver(); - - observable.triggerEvent(); // don't notify, but increase count - assertNull(observer1.lastMessage); - observable.addObserver(observer1); - assertNull(observer1.lastMessage); - assertNull(observer2.lastMessage); - assertNull(observer1.lastSender); - assertNull(observer2.lastSender); - observable.triggerEvent(); - assertEquals("This is message 1", observer1.lastMessage); - assertSame(observable, observer1.lastSender); - assertNull(observer2.lastSender); - - observable.addObserver(observer2); - assertNull(observer2.lastMessage); - observable.triggerEvent(); - assertEquals("This is message 2", observer1.lastMessage); - assertEquals("This is message 2", observer2.lastMessage); - assertSame(observable, observer1.lastSender); - assertSame(observable, observer2.lastSender); - - MyObservable otherObservable = new MyObservable(); - otherObservable.addObserver(observer2); - otherObservable.triggerEvent(); - // New instance, should start from 0 - assertEquals("This is message 0", observer2.lastMessage); - assertSame(otherObservable, observer2.lastSender); - - // observer1 unchanged - assertEquals("This is message 2", observer1.lastMessage); - assertSame(observable, observer1.lastSender); - - } - - @Test - public void concurrencyTest() { - MyObservable observable = new MyObservable(); - MyObserver dummyObserver = new MyObserver(); - SelvRemovingObserver selfRemoving = new SelvRemovingObserver(); - observable.addObserver(dummyObserver); - observable.addObserver(selfRemoving); - assertEquals(2, observable.getObservers().size()); - observable.triggerEvent(); - - - } - - public class MyObservable implements Observable<String> { - - private int counter = 0; - MultiCaster<String> multiCaster = new MultiCaster<String>(this); - - public void addObserver(Observer<String> observer) { - multiCaster.addObserver(observer); - } - - public void removeObserver(Observer<String> observer) { - multiCaster.removeObserver(observer); - } - - public void triggerEvent() { - multiCaster.notify("This is message " + counter++); - } - - public List<Observer<String>> getObservers() { - return multiCaster.getObservers(); - } - } - - public class MyObserver implements Observer<String> { - String lastMessage = null; - Observable<String> lastSender = null; - - public void notify(Observable<String> sender, String message) { - lastSender = sender; - lastMessage = message; - } - } - - public class SelvRemovingObserver implements Observer<String> { - - public int called=0; - - public void notify(Observable<String> sender, String message) { - called++; - if (called > 1) { - fail("Did not remove itself"); - } - sender.removeObserver(this); - } - - } - -} http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/3ecb1291/taverna-platform-integration-tests/pom.xml ---------------------------------------------------------------------- diff --git a/taverna-platform-integration-tests/pom.xml b/taverna-platform-integration-tests/pom.xml deleted file mode 100644 index 362fbdc..0000000 --- a/taverna-platform-integration-tests/pom.xml +++ /dev/null @@ -1,635 +0,0 @@ -<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/xsd/maven-4.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-integration-tests</artifactId> - <name>Apache Taverna Platform integration tests</name> - <properties> - <spring.dm.version>2.0.0.M1</spring.dm.version> - <spring.version>3.0.0.RC1</spring.version> - </properties> - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-surefire-plugin</artifactId> - <configuration> - <forkMode>pertest</forkMode> - </configuration> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-dependency-plugin</artifactId> - <executions> - <execution> - <id>copy</id> - <phase>generate-test-resources</phase> - <goals> - <goal>copy</goal> - </goals> - <configuration> - <artifactItems> - <!-- xerces and xalan are required for the tests but the test framework --> - <!-- fails to run if they are put on the test classpath by maven --> - <!-- This ensures they are pulled into the local repository --> - <artifactItem> - <groupId>org.apache.xalan</groupId> - <artifactId>com.springsource.org.apache.xalan</artifactId> - <version>2.7.1</version> - </artifactItem> - <artifactItem> - <groupId>org.apache.xerces</groupId> - <artifactId>com.springsource.org.apache.xerces</artifactId> - <version>2.9.1</version> - </artifactItem> - </artifactItems> - <outputDirectory>${project.build.directory}/tmp</outputDirectory> - <overWriteReleases>false</overWriteReleases> - <overWriteSnapshots>true</overWriteSnapshots> - </configuration> - </execution> - </executions> - </plugin> - </plugins> - </build> - <dependencies> - <!-- Spring OSGI testing framework --> - <dependency> - <groupId>org.springframework.osgi</groupId> - <artifactId>spring-osgi-test</artifactId> - <version>${spring.dm.version}</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.springframework.osgi</groupId> - <artifactId>spring-osgi-annotation</artifactId> - <version>${spring.dm.version}</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.springframework.osgi</groupId> - <artifactId>spring-osgi-core</artifactId> - <version>${spring.dm.version}</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.springframework.osgi</groupId> - <artifactId>spring-osgi-extender</artifactId> - <version>${spring.dm.version}</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.springframework</groupId> - <artifactId>org.springframework.aop</artifactId> - <version>${spring.version}</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.springframework</groupId> - <artifactId>org.springframework.asm</artifactId> - <version>${spring.version}</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.springframework</groupId> - <artifactId>org.springframework.beans</artifactId> - <version>${spring.version}</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.springframework</groupId> - <artifactId>org.springframework.context</artifactId> - <version>${spring.version}</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.springframework</groupId> - <artifactId>org.springframework.core</artifactId> - <version>${spring.version}</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.springframework</groupId> - <artifactId>org.springframework.jdbc</artifactId> - <version>${spring.version}</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.springframework</groupId> - <artifactId>org.springframework.orm</artifactId> - <version>${spring.version}</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.springframework</groupId> - <artifactId>org.springframework.transaction</artifactId> - <version>${spring.version}</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.apache.derby</groupId> - <artifactId>com.springsource.org.apache.derby</artifactId> - <version>10.5.1000001.764942</version> - </dependency> - <dependency> - <groupId>org.apache.derby</groupId> - <artifactId>com.springsource.org.apache.derby.client</artifactId> - <version>10.5.1000001.764942</version> - </dependency> - <dependency> - <groupId>org.apache.derby</groupId> - <artifactId>com.springsource.org.apache.derby.drda</artifactId> - <version>10.5.1000001.764942</version> - </dependency> - <dependency> - <groupId>org.aopalliance</groupId> - <artifactId>com.springsource.org.aopalliance</artifactId> - <version>1.0.0</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.aspectj</groupId> - <artifactId>com.springsource.org.aspectj.runtime</artifactId> - <version>1.6.0</version> - </dependency> - <dependency> - <groupId>org.aspectj</groupId> - <artifactId>com.springsource.org.aspectj.weaver</artifactId> - <version>1.6.0</version> - </dependency> - <dependency> - <groupId>org.objectweb.asm</groupId> - <artifactId>com.springsource.org.objectweb.asm</artifactId> - <version>2.2.3</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.slf4j</groupId> - <artifactId>com.springsource.slf4j.api</artifactId> - <version>1.5.6</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.slf4j</groupId> - <artifactId>com.springsource.slf4j.log4j</artifactId> - <version>1.5.6</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>log4j</groupId> - <artifactId>log4j</artifactId> - <version>1.2.16</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.slf4j</groupId> - <artifactId>com.springsource.slf4j.org.apache.commons.logging</artifactId> - <version>1.5.6</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <version>3.8.2</version> - <scope>test</scope> - </dependency> - - <!-- Equinox OSGI Framework --> - <dependency> - <groupId>org.eclipse.osgi</groupId> - <artifactId>org.eclipse.osgi</artifactId> - <version>3.6.0.v20100517</version> - <scope>test</scope> - </dependency> - - <!-- Felix OSGI Framework --> - <dependency> - <groupId>org.apache.felix</groupId> - <artifactId>org.apache.felix.main</artifactId> - <version>3.2.2</version> - <scope>test</scope> - </dependency> - - <!-- OSGI Enterprise Services --> - <dependency> - <groupId>org.apache.aries.jndi</groupId> - <artifactId>org.apache.aries.jndi</artifactId> - <version>0.3</version> - </dependency> - - <!-- Taverna OSGI Services --> - <!-- <dependency> <groupId>org.apache.taverna.osgi</groupId> <artifactId>xml-parser-service</artifactId> - <version>${taverna.osgi.version}</version> <exclusions> <exclusion> <groupId>org.apache.xerces</groupId> - <artifactId>com.springsource.org.apache.xerces</artifactId> </exclusion> - </exclusions> </dependency> --> - <dependency> - <groupId>org.apache.taverna.osgi</groupId> - <artifactId>xml-transformer-service</artifactId> - <version>${taverna.osgi.version}</version> - <exclusions> - <exclusion> - <groupId>org.apache.xalan</groupId> - <artifactId>com.springsource.org.apache.xalan</artifactId> - </exclusion> - </exclusions> - </dependency> - - <!-- Taverna --> - <dependency> - <groupId>${project.parent.groupId}</groupId> - <artifactId>taverna-workflowmodel-api</artifactId> - <version>${project.parent.version}</version> - </dependency> - <dependency> - <groupId>${project.parent.groupId}</groupId> - <artifactId>taverna-workflowmodel-core-extensions</artifactId> - <version>${project.parent.version}</version> - </dependency> - <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-types</artifactId> - <version>${project.parent.version}</version> - </dependency> - <dependency> - <groupId>${project.parent.groupId}</groupId> - <artifactId>reference-impl</artifactId> - <version>${project.parent.version}</version> - </dependency> - <dependency> - <groupId>${project.parent.groupId}</groupId> - <artifactId>taverna-observer</artifactId> - <version>${project.parent.version}</version> - </dependency> - <!-- is this needed here? (Why?) - <dependency> - <groupId>${project.parent.groupId}</groupId> - <artifactId>ui</artifactId> - <version>${project.parent.version}</version> - </dependency> - --> - <dependency> - <groupId>${project.parent.groupId}</groupId> - <artifactId>taverna-credential-manager</artifactId> - <version>${project.parent.version}</version> - </dependency> - <dependency> - <groupId>${project.parent.groupId}</groupId> - <artifactId>taverna-credential-manager-impl</artifactId> - <version>${project.parent.version}</version> - </dependency> - <dependency> - <groupId>org.apache.taverna.osgi</groupId> - <artifactId>taverna-configuration-api</artifactId> - <version>${taverna.osgi.version}</version> - </dependency> - <dependency> - <groupId>org.apache.taverna.osgi</groupId> - <artifactId>taverna-configuration-impl</artifactId> - <version>${taverna.osgi.version}</version> - </dependency> - <dependency> - <groupId>org.apache.taverna.osgi</groupId> - <artifactId>taverna-app-configuration-api</artifactId> - <version>${taverna.osgi.version}</version> - </dependency> - <dependency> - <groupId>org.apache.taverna.osgi</groupId> - <artifactId>taverna-app-configuration-impl</artifactId> - <version>${taverna.osgi.version}</version> - </dependency> - <dependency> - <groupId>${project.parent.groupId}</groupId> - <artifactId>taverna-database-configuration-api</artifactId> - <version>${project.parent.version}</version> - </dependency> - <dependency> - <groupId>${project.parent.groupId}</groupId> - <artifactId>taverna-database-configuration-impl</artifactId> - <version>${project.parent.version}</version> - </dependency> - - <!-- Taverna Platform --> - <dependency> - <groupId>${project.parent.groupId}</groupId> - <artifactId>taverna-capability-impl</artifactId> - <version>${project.parent.version}</version> - </dependency> - <dependency> - <groupId>${project.parent.groupId}</groupId> - <artifactId>taverna-execution-impl</artifactId> - <version>${project.parent.version}</version> - </dependency> - <dependency> - <groupId>${project.parent.groupId}</groupId> - <artifactId>taverna-run-impl</artifactId> - <version>${project.parent.version}</version> - </dependency> - <dependency> - <groupId>${project.parent.groupId}</groupId> - <artifactId>taverna-execution-local</artifactId> - <version>${project.parent.version}</version> - </dependency> - <dependency> - <groupId>${project.parent.groupId}</groupId> - <artifactId>taverna-report-api</artifactId> - <version>${project.parent.version}</version> - </dependency> - - <!-- Scufl2 --> - <dependency> - <groupId>org.apache.taverna.language</groupId> - <artifactId>taverna-scufl2-api</artifactId> - <version>${taverna.language.version}</version> - </dependency> - <dependency> - <groupId>org.apache.taverna.language</groupId> - <artifactId>taverna-scufl2-t2flow</artifactId> - <version>${taverna.language.version}</version> - </dependency> - <dependency> - <groupId>org.apache.taverna.language</groupId> - <artifactId>taverna-scufl2-rdfxml</artifactId> - <version>${taverna.language.version}</version> - </dependency> - <dependency> - <groupId>org.apache.taverna.language</groupId> - <artifactId>taverna-scufl2-ucfpackage</artifactId> - <version>${taverna.language.version}</version> - </dependency> - <dependency> - <groupId>org.apache.taverna.language</groupId> - <artifactId>taverna-scufl2-validation</artifactId> - <version>${taverna.language.version}</version> - </dependency> - <dependency> - <groupId>org.apache.taverna.language</groupId> - <artifactId>taverna-scufl2-validation-correctness</artifactId> - <version>${taverna.language.version}</version> - </dependency> - <dependency> - <groupId>org.apache.taverna.language</groupId> - <artifactId>taverna-scufl2-validation-structural</artifactId> - <version>${taverna.language.version}</version> - </dependency> - - <!-- Taverna CommandLine Tool --> - <dependency> - <groupId>org.apache.taverna.commandline</groupId> - <artifactId>taverna-commandline-common</artifactId> - <version>2.0-SNAPSHOT</version> - </dependency> - - <!-- Dependencies declared as provided by some poms - specified here to - ensure that they are in the local repository for the testing framework --> - <dependency> - <groupId>commons-dbcp</groupId> - <artifactId>commons-dbcp</artifactId> - <version>1.4</version> - </dependency> - <dependency> - <groupId>commons-pool</groupId> - <artifactId>commons-pool</artifactId> - <version>1.5.6</version> - </dependency> - <dependency> - <groupId>com.sun.xml</groupId> - <artifactId>com.springsource.com.sun.xml.bind</artifactId> - <version>2.2.0</version> - </dependency> - <dependency> - <groupId>com.thoughtworks.xstream</groupId> - <artifactId>com.springsource.com.thoughtworks.xstream</artifactId> - <version>1.2.2</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>javax.activation</groupId> - <artifactId>com.springsource.javax.activation</artifactId> - <version>1.1.1</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>javax.jms</groupId> - <artifactId>com.springsource.javax.jms</artifactId> - <version>1.1.0</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>javax.mail</groupId> - <artifactId>com.springsource.javax.mail</artifactId> - <version>1.4.0</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>javax.servlet</groupId> - <artifactId>com.springsource.javax.servlet</artifactId> - <version>2.5.0</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>javax.transaction</groupId> - <artifactId>com.springsource.javax.transaction</artifactId> - <version>1.1.0</version> - </dependency> - <dependency> - <groupId>javax.wsdl</groupId> - <artifactId>com.springsource.javax.wsdl</artifactId> - <version>1.6.1</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>javax.xml.soap</groupId> - <artifactId>com.springsource.javax.xml.soap</artifactId> - <version>1.3.0</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>javax.xml.rpc</groupId> - <artifactId>com.springsource.javax.xml.rpc</artifactId> - <version>1.1.0</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>javax.xml.stream</groupId> - <artifactId>com.springsource.javax.xml.stream</artifactId> - <version>1.0.1</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.apache.axis</groupId> - <artifactId>com.springsource.org.apache.axis</artifactId> - <version>1.4.0</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.apache.commons</groupId> - <artifactId>com.springsource.org.apache.commons.codec</artifactId> - <version>1.4.0</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.apache.commons</groupId> - <artifactId>com.springsource.org.apache.commons.csv</artifactId> - <version>1.0.0.BUILD-20080106</version> - </dependency> - <dependency> - <groupId>org.apache.commons</groupId> - <artifactId>com.springsource.org.apache.commons.discovery</artifactId> - <version>0.4.0</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.apache.commons</groupId> - <artifactId>com.springsource.org.apache.commons.httpclient</artifactId> - <version>3.1.0</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.apache.commons</groupId> - <artifactId>com.springsource.org.apache.commons.io</artifactId> - <version>1.4.0</version> - </dependency> - <dependency> - <groupId>org.apache.commons</groupId> - <artifactId>com.springsource.org.apache.commons.lang</artifactId> - <version>2.5.0</version> - </dependency> - <dependency> - <groupId>org.apache.commons</groupId> - <artifactId>com.springsource.org.apache.commons.logging</artifactId> - <version>1.1.1</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.apache.commons</groupId> - <artifactId>com.springsource.org.apache.commons.net</artifactId> - <version>1.4.1</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.apache.commons</groupId> - <artifactId>com.springsource.org.apache.commons.cli</artifactId> - <version>1.2.0</version> - </dependency> - <dependency> - <groupId>org.apache.httpcomponents</groupId> - <artifactId>com.springsource.org.apache.httpcomponents.httpclient</artifactId> - <version>4.1.1</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.apache.httpcore</groupId> - <artifactId>com.springsource.org.apache.httpcomponents.httpcore</artifactId> - <version>4.1</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.apache.ws.security</groupId> - <artifactId>wss4j</artifactId> - <version>1.5.12</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.apache.xml</groupId> - <artifactId>com.springsource.org.apache.xml.resolver</artifactId> - <version>1.2.0</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.apache.xmlbeans</groupId> - <artifactId>com.springsource.org.apache.xmlbeans</artifactId> - <version>2.4.0</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.apache.xmlcommons</groupId> - <artifactId>com.springsource.org.apache.xmlcommons</artifactId> - <version>1.3.4</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.apache.xalan</groupId> - <artifactId>com.springsource.org.apache.xml.serializer</artifactId> - <version>2.7.1</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.apache.xml</groupId> - <artifactId>com.springsource.org.apache.xml.security</artifactId> - <version>1.4.2</version> - <scope>test</scope> - <exclusions> - <exclusion> - <groupId>org.apache.xalan</groupId> - <artifactId>com.springsource.org.apache.xalan</artifactId> - </exclusion> - </exclusions> - </dependency> - <!-- <dependency> <groupId>org.apache.ws</groupId> <artifactId>com.springsource.org.apache.ws.security</artifactId> - <version>1.5.8</version> <scope>test</scope> <exclusions> <exclusion> <groupId>org.apache.xalan</groupId> - <artifactId>com.springsource.org.apache.xalan</artifactId> </exclusion> </exclusions> - </dependency> --> - <!-- - <dependency> - <groupId>org.beanshell</groupId> - <artifactId>com.springsource.bsh</artifactId> - <version>2.0.0.b4</version> - </dependency> - <dependency> - <groupId>org.biomart</groupId> - <artifactId>martservice</artifactId> - <version>2.0-SNAPSHOT</version> - </dependency> - --> - <dependency> - <groupId>org.dom4j</groupId> - <artifactId>com.springsource.org.dom4j</artifactId> - <version>1.6.1</version> - </dependency> - <dependency> - <groupId>org.jaxen</groupId> - <artifactId>com.springsource.org.jaxen</artifactId> - <version>1.1.1</version> - </dependency> - <dependency> - <groupId>org.jdom</groupId> - <artifactId>com.springsource.org.jdom</artifactId> - <version>1.1.0</version> - </dependency> - <!-- <dependency> <groupId>org.odftoolkit</groupId> <artifactId>odfdom-java.bundle</artifactId> - <version>0.7.0</version> <exclusions> <exclusion> <groupId>org.apache.xerces</groupId> - <artifactId>com.springsource.org.apache.xerces</artifactId> </exclusion> - </exclusions> </dependency> --> - <dependency> - <groupId>org.opensaml</groupId> - <artifactId>com.springsource.org.opensaml</artifactId> - <version>1.1.0</version> - <scope>test</scope> - <exclusions> - <exclusion> - <groupId>org.apache.xalan</groupId> - <artifactId>com.springsource.org.apache.xalan</artifactId> - </exclusion> - </exclusions> - </dependency> - <dependency> - <groupId>org.xmlpull</groupId> - <artifactId>com.springsource.org.xmlpull</artifactId> - <version>1.1.3.4-O</version> - </dependency> - </dependencies> -</project> http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/3ecb1291/taverna-platform-integration-tests/src/test/java/uk/org/taverna/platform/ActivityIT.java ---------------------------------------------------------------------- diff --git a/taverna-platform-integration-tests/src/test/java/uk/org/taverna/platform/ActivityIT.java b/taverna-platform-integration-tests/src/test/java/uk/org/taverna/platform/ActivityIT.java deleted file mode 100644 index bb82107..0000000 --- a/taverna-platform-integration-tests/src/test/java/uk/org/taverna/platform/ActivityIT.java +++ /dev/null @@ -1,72 +0,0 @@ -/******************************************************************************* - * Copyright (C) 2010 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 uk.org.taverna.platform; - -import java.net.URI; -import java.util.List; - -import net.sf.taverna.t2.workflowmodel.processor.activity.Activity; - -import org.osgi.framework.ServiceReference; - -import uk.org.taverna.platform.capability.activity.ActivityConfigurationException; -import uk.org.taverna.platform.capability.activity.ActivityNotFoundException; -import uk.org.taverna.platform.capability.activity.ActivityService; -import uk.org.taverna.scufl2.api.configurations.ConfigurationDefinition; - -public class ActivityIT extends PlatformIT { - - public void testGetActivityURIs() { - ServiceReference activityServiceReference = bundleContext.getServiceReference("uk.org.taverna.platform.activity.ActivityService"); - ActivityService activityService = (ActivityService) bundleContext.getService(activityServiceReference); - List<URI> activityURIs = activityService.getActivityURIs(); - System.out.println("================= Available Activities ==================="); - for (URI uri : activityURIs) { - System.out.println(uri); - } - System.out.println("=========================================================="); - System.out.println(""); - } - - public void testCreateActivity() throws ActivityNotFoundException, ActivityConfigurationException { - ServiceReference activityServiceReference = bundleContext.getServiceReference("uk.org.taverna.platform.activity.ActivityService"); - ActivityService activityService = (ActivityService) bundleContext.getService(activityServiceReference); - List<URI> activityURIs = activityService.getActivityURIs(); - for (URI uri : activityURIs) { - System.out.println("Creating activity " + uri); - Activity<?> activity = activityService.createActivity(uri, null); - } - } - - public void testGetActivityConfigurationDefinition() throws Exception { - ServiceReference activityServiceReference = bundleContext.getServiceReference("uk.org.taverna.platform.activity.ActivityService"); - ActivityService activityService = (ActivityService) bundleContext.getService(activityServiceReference); - - List<URI> activityURIs = activityService.getActivityURIs(); - System.out.println("============ Activity Configuration Definitions =========="); - for (URI uri : activityURIs) { - ConfigurationDefinition configurationDefinition = activityService.getActivityConfigurationDefinition(uri); - System.out.println(configurationDefinition); - } - System.out.println("=========================================================="); - } - -} http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/3ecb1291/taverna-platform-integration-tests/src/test/java/uk/org/taverna/platform/CommandLineToolIT.java ---------------------------------------------------------------------- diff --git a/taverna-platform-integration-tests/src/test/java/uk/org/taverna/platform/CommandLineToolIT.java b/taverna-platform-integration-tests/src/test/java/uk/org/taverna/platform/CommandLineToolIT.java deleted file mode 100644 index f2df658..0000000 --- a/taverna-platform-integration-tests/src/test/java/uk/org/taverna/platform/CommandLineToolIT.java +++ /dev/null @@ -1,91 +0,0 @@ -/******************************************************************************* - * Copyright (C) 2010 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 uk.org.taverna.platform; - -import net.sf.taverna.t2.commandline.CommandLineTool; - -import org.osgi.framework.ServiceReference; - -import uk.org.taverna.commandline.args.CommandLineArguments; -import uk.org.taverna.platform.run.api.RunService; -import uk.org.taverna.scufl2.api.io.WorkflowBundleIO; -import uk.org.taverna.scufl2.api.io.WorkflowBundleReader; - -public class CommandLineToolIT extends PlatformIT { - - private RunService runService; - private WorkflowBundleIO workflowBundleIO; - private WorkflowBundleReader workflowReader; - - protected void setup() throws Exception { - super.setup(); - if (runService == null) { - ServiceReference runServiceReference = bundleContext - .getServiceReference("uk.org.taverna.platform.run.api.RunService"); - runService = (RunService) bundleContext.getService(runServiceReference); - } - - if (workflowReader == null) { - ServiceReference workflowBundleReaderServiceReference = bundleContext - .getServiceReferences("uk.org.taverna.scufl2.api.io.WorkflowBundleReader", - "(mediaType=application/vnd.taverna.t2flow+xml)")[0]; - workflowBundleReader = (WorkflowBundleReader) bundleContext - .getService(workflowBundleReaderServiceReference); - } - - if (workflowBundleIO == null) { - ServiceReference workflowBundleIOServiceReference = bundleContext - .getServiceReference("uk.org.taverna.scufl2.api.io.WorkflowBundleIO"); - workflowBundleIO = (WorkflowBundleIO) bundleContext - .getService(workflowBundleIOServiceReference); - } - } - - public void testCommandLineTool() throws Exception { - - setup(); - - CommandLineTool cmdTool = new CommandLineTool(); - cmdTool.setRunService(runService); - cmdTool.setCredentialManager(credentialManager); - cmdTool.setWorkflowBundleIO(workflowBundleIO); - cmdTool.setCommandLineArgumentsService(new CommandLineArguments() { - public String[] getCommandLineArguments() { - return new String[] { "-outputdoc", "/tmp/taverna3/baclava-output1.xml", - "/Users/alex/Desktop/t2flows/simple-wf-no-inputs-one-output.t2flow" }; - } - - }); - cmdTool.run(); - - cmdTool.setCommandLineArgumentsService(new CommandLineArguments() { - public String[] getCommandLineArguments() { - return new String[] { "-inputvalue", "in", "Taverna 3 Platform rules", - "-outputdoc", "/tmp/taverna3/baclava-output2.xml", - "/Users/alex/Desktop/t2flows/simple-wf-one-input-one-output.t2flow" }; - } - - }); - cmdTool.run(); - - } - -} http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/3ecb1291/taverna-platform-integration-tests/src/test/java/uk/org/taverna/platform/ExecutionIT.java ---------------------------------------------------------------------- diff --git a/taverna-platform-integration-tests/src/test/java/uk/org/taverna/platform/ExecutionIT.java b/taverna-platform-integration-tests/src/test/java/uk/org/taverna/platform/ExecutionIT.java deleted file mode 100644 index 76a25b3..0000000 --- a/taverna-platform-integration-tests/src/test/java/uk/org/taverna/platform/ExecutionIT.java +++ /dev/null @@ -1,134 +0,0 @@ -/******************************************************************************* - * Copyright (C) 2010 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 uk.org.taverna.platform; - -import java.net.URI; -import java.util.Collections; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import org.osgi.framework.ServiceReference; - -import uk.org.taverna.platform.capability.activity.ActivityConfigurationException; -import uk.org.taverna.platform.capability.activity.ActivityNotFoundException; -import uk.org.taverna.platform.data.api.Data; -import uk.org.taverna.platform.capability.dispatch.DispatchLayerConfigurationException; -import uk.org.taverna.platform.capability.dispatch.DispatchLayerNotFoundException; -import uk.org.taverna.platform.execution.api.AbstractExecutionEnvironment; -import uk.org.taverna.platform.execution.api.AbstractExecutionService; -import uk.org.taverna.platform.execution.api.Execution; -import uk.org.taverna.platform.execution.api.ExecutionEnvironment; -import uk.org.taverna.platform.execution.api.ExecutionEnvironmentService; -import uk.org.taverna.platform.execution.api.InvalidWorkflowException; -import uk.org.taverna.scufl2.api.configurations.ConfigurationDefinition; -import uk.org.taverna.scufl2.api.container.WorkflowBundle; -import uk.org.taverna.scufl2.api.core.Workflow; -import uk.org.taverna.scufl2.api.profiles.Profile; - -public class ExecutionIT extends PlatformIT { - - private ExecutionEnvironmentService executionEnvironmentService; - - protected void setup() throws Exception { - super.setup(); - ServiceReference[] executionServiceReferences = bundleContext.getServiceReferences( - "uk.org.taverna.platform.execution.api.ExecutionEnvironmentService", null); - assertEquals(1, executionServiceReferences.length); - executionEnvironmentService = (ExecutionEnvironmentService) bundleContext - .getService(executionServiceReferences[0]); - - } - - public void testGetExecutionEnvironments() throws Exception { - setup(); - - Set<ExecutionEnvironment> executionEnvironments = executionEnvironmentService - .getExecutionEnvironments(); - int size = executionEnvironments.size(); - - bundleContext.registerService("uk.org.taverna.platform.execution.api.ExecutionService", - new AbstractExecutionService("test id", "test name", "test description") { - public Set<ExecutionEnvironment> getExecutionEnvivonments() { - return Collections - .<ExecutionEnvironment> singleton(new AbstractExecutionEnvironment( - "test id", "test name", "test description", this) { - public List<URI> getDispatchLayerURIs() { - return Collections.singletonList(URI - .create("http://ns.taverna.org.uk/2010/dispatchlayer/testDispatchLayer")); - } - - public List<URI> getActivityURIs() { - return Collections.singletonList(URI - .create("http://ns.taverna.org.uk/2010/activity/testActivity")); - } - - public boolean dispatchLayerExists(URI uri) { - return false; - } - - public boolean activityExists(URI uri) { - return false; - } - - public ConfigurationDefinition getActivityConfigurationDefinition( - URI uri) throws ActivityNotFoundException, - ActivityConfigurationException { - return null; - } - - public ConfigurationDefinition getDispatchLayerConfigurationDefinition( - URI uri) throws DispatchLayerNotFoundException, - DispatchLayerConfigurationException { - return null; - } - }); - } - - protected Execution createExecutionImpl(WorkflowBundle workflowBundle, - Workflow workflow, Profile profile, Map<String, Data> inputs) throws InvalidWorkflowException { - return null; - } - }, null); - - - executionEnvironments = executionEnvironmentService - .getExecutionEnvironments(); - assertEquals(size + 1, executionEnvironments.size()); - - for (ExecutionEnvironment executionEnvironment : executionEnvironments) { - System.out.println(executionEnvironment); - } - } - - public void testGetExecutionEnvironmentsProfile() throws Exception { - setup(); - - WorkflowBundle workflowBundle = loadWorkflow("/t2flow/beanshell.t2flow"); - - Set<ExecutionEnvironment> executionEnvironments = executionEnvironmentService - .getExecutionEnvironments(workflowBundle.getMainProfile()); - assertTrue(executionEnvironments.size() > 0); - - System.out.println(executionEnvironments.iterator().next()); - } - -} http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/3ecb1291/taverna-platform-integration-tests/src/test/java/uk/org/taverna/platform/LocalExecutionIT.java ---------------------------------------------------------------------- diff --git a/taverna-platform-integration-tests/src/test/java/uk/org/taverna/platform/LocalExecutionIT.java b/taverna-platform-integration-tests/src/test/java/uk/org/taverna/platform/LocalExecutionIT.java deleted file mode 100644 index 92068d5..0000000 --- a/taverna-platform-integration-tests/src/test/java/uk/org/taverna/platform/LocalExecutionIT.java +++ /dev/null @@ -1,120 +0,0 @@ -/******************************************************************************* - * Copyright (C) 2010 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 uk.org.taverna.platform; - -import java.util.Collections; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import org.osgi.framework.ServiceReference; - -import uk.org.taverna.platform.data.api.Data; -import uk.org.taverna.platform.data.api.DataService; -import uk.org.taverna.platform.execution.api.ExecutionEnvironment; -import uk.org.taverna.platform.execution.api.ExecutionService; -import uk.org.taverna.platform.report.State; -import uk.org.taverna.platform.report.WorkflowReport; -import uk.org.taverna.scufl2.api.container.WorkflowBundle; -import uk.org.taverna.scufl2.api.core.Workflow; -import uk.org.taverna.scufl2.api.profiles.Profile; - -public class LocalExecutionIT extends PlatformIT { - - private ExecutionService executionService; - private DataService dataService; - private Set<ExecutionEnvironment> executionEnvironments; - - protected void setup() throws Exception { - super.setup(); - if (executionService == null) { - ServiceReference[] executionServiceReferences = bundleContext.getServiceReferences( - "uk.org.taverna.platform.execution.api.ExecutionService", - "(org.springframework.osgi.bean.name=localExecution)"); - assertEquals(1, executionServiceReferences.length); - executionService = (ExecutionService) bundleContext - .getService(executionServiceReferences[0]); - executionEnvironments = executionService.getExecutionEnvivonments(); - assertEquals(1, executionEnvironments.size()); - } - if (dataService == null) { - ServiceReference dataServiceReference = bundleContext - .getServiceReference("uk.org.taverna.platform.data.DataService"); - dataService = (DataService) bundleContext.getService(dataServiceReference); - } - } - - public void testLocalExecution() throws Exception { - setup(); - - WorkflowBundle workflowBundle = loadWorkflow("/t2flow/in-out.t2flow"); - Workflow workflow = workflowBundle.getMainWorkflow(); - Profile profile = workflowBundle.getMainProfile(); - for (ExecutionEnvironment executionEnvironment : executionEnvironments) { - Map<String, Data> inputs = Collections.singletonMap("in", dataService.create("test-input")); - - String executionId = executionService.createExecution(executionEnvironment, - workflowBundle, workflow, profile, inputs); - WorkflowReport report = executionService.getWorkflowReport(executionId); - assertEquals(State.CREATED, report.getState()); - executionService.start(executionId); - - Map<String, Data> results = report.getOutputs(); - assertNotNull(results); - waitForResults(results, report, "out"); - - Object result = results.get("out").getValue(); - assertEquals("test-input", result); - assertEquals(State.COMPLETED, report.getState()); - System.out.println(report); - } - } - - public void testLocalExecution2() throws Exception { - setup(); - - WorkflowBundle workflowBundle = loadWorkflow("/t2flow/beanshell.t2flow"); - Workflow workflow = workflowBundle.getMainWorkflow(); - Profile profile = workflowBundle.getMainProfile(); - - for (ExecutionEnvironment executionEnvironment : executionEnvironments) { - Map<String, Data> inputs = Collections.singletonMap("in", dataService.create("test-input")); - - String executionId = executionService.createExecution(executionEnvironment, - workflowBundle, workflow, profile, inputs); - WorkflowReport report = executionService.getWorkflowReport(executionId); - System.out.println(report); - assertEquals(State.CREATED, report.getState()); - executionService.start(executionId); - System.out.println(report); - - Map<String, Data> results = report.getOutputs(); - waitForResults(results, report, "out"); - - List<Data> result = results.get("out").getElements(); - assertEquals(1000, result.size()); - assertEquals("test-input:0", result.get(0).getValue()); - assertEquals(State.COMPLETED, report.getState()); - System.out.println(report); - } - } - -} http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/3ecb1291/taverna-platform-integration-tests/src/test/java/uk/org/taverna/platform/OSGIFrameworkIT.java ---------------------------------------------------------------------- diff --git a/taverna-platform-integration-tests/src/test/java/uk/org/taverna/platform/OSGIFrameworkIT.java b/taverna-platform-integration-tests/src/test/java/uk/org/taverna/platform/OSGIFrameworkIT.java deleted file mode 100644 index 38f46c7..0000000 --- a/taverna-platform-integration-tests/src/test/java/uk/org/taverna/platform/OSGIFrameworkIT.java +++ /dev/null @@ -1,93 +0,0 @@ -/******************************************************************************* - * Copyright (C) 2010 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 uk.org.taverna.platform; - -import java.io.IOException; - -import org.osgi.framework.Bundle; -import org.springframework.core.io.Resource; -import org.springframework.osgi.util.OsgiStringUtils; - -public class OSGIFrameworkIT extends PlatformIT { - - public void testOsgiEnvironment() throws Exception { - Bundle[] bundles = bundleContext.getBundles(); - for (int i = 0; i < bundles.length; i++) { - System.out.println(OsgiStringUtils.nullSafeName(bundles[i])); - } - System.out.println(); - } - - protected String[] getTestFrameworkBundlesNames() { - String[] frameworkBundles = super.getTestFrameworkBundlesNames(); - System.out.println("Test Framework bundles:"); - for (String bundle : frameworkBundles) { - System.out.println(" " + bundle); - } - return frameworkBundles; - } - - protected String[] getTestBundlesNames() { - String[] frameworkBundles = super.getTestBundlesNames(); - System.out.println("Framework bundles:"); - for (String bundle : frameworkBundles) { - System.out.println(" " + bundle); - } - return frameworkBundles; - } - - public void testPrintConfig() throws IOException { - Resource[] bundles = getTestBundles(); - Resource[] testBundles = getTestFrameworkBundles(); - StringBuilder sb = new StringBuilder(); - StringBuilder sb2 = new StringBuilder(); - System.out.println("mkdir platform"); - System.out.println("mkdir platform/configuration"); - sb2.append("cp "); - sb.append("osgi.bundles="); - boolean printComma = false; - for (Resource resource : bundles) { - if (printComma) { - sb.append(", "); - sb2.append(" "); - } - sb.append(resource.getFilename() + "@start"); - sb2.append(resource.getFile()); - printComma = true; - } - for (Resource resource : testBundles) { - if (!resource.getFilename().contains("test")) { - if (printComma) { - sb.append(", "); - sb2.append(" "); - } - sb.append(resource.getFilename() + "@start"); - sb2.append(resource.getFile()); - printComma = true; - } - } - sb2.append(" platform"); - System.out.println("echo \"" + sb.toString() + "\" > platform/configuration/config.ini"); - System.out.println(sb2.toString()); - System.out.println("zip platform.zip platform/*"); - } - -} http://git-wip-us.apache.org/repos/asf/incubator-taverna-engine/blob/3ecb1291/taverna-platform-integration-tests/src/test/java/uk/org/taverna/platform/PlatformIT.java ---------------------------------------------------------------------- diff --git a/taverna-platform-integration-tests/src/test/java/uk/org/taverna/platform/PlatformIT.java b/taverna-platform-integration-tests/src/test/java/uk/org/taverna/platform/PlatformIT.java deleted file mode 100644 index 40b35e9..0000000 --- a/taverna-platform-integration-tests/src/test/java/uk/org/taverna/platform/PlatformIT.java +++ /dev/null @@ -1,378 +0,0 @@ -/******************************************************************************* - * Copyright (C) 2010 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 uk.org.taverna.platform; - -import java.io.File; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.net.URL; -import java.util.Map; -import java.util.Properties; - -import net.sf.taverna.t2.reference.ErrorDocument; -import net.sf.taverna.t2.reference.StackTraceElementBean; -import net.sf.taverna.t2.security.credentialmanager.CredentialManager; -import net.sf.taverna.t2.security.credentialmanager.MasterPasswordProvider; - -import org.eclipse.osgi.framework.internal.core.Constants; -import org.osgi.framework.ServiceReference; -import org.osgi.service.jndi.JNDIContextManager; -import org.springframework.osgi.test.AbstractConfigurableBundleCreatorTests; -import org.springframework.osgi.test.platform.OsgiPlatform; -import org.springframework.osgi.test.platform.Platforms; - -import uk.org.taverna.configuration.app.ApplicationConfiguration; -import uk.org.taverna.configuration.database.DatabaseConfiguration; -import uk.org.taverna.platform.data.api.Data; -import uk.org.taverna.platform.report.State; -import uk.org.taverna.platform.report.WorkflowReport; -import uk.org.taverna.scufl2.api.container.WorkflowBundle; -import uk.org.taverna.scufl2.api.io.WorkflowBundleReader; -import uk.org.taverna.scufl2.translator.t2flow.T2FlowReader; - -public class PlatformIT extends AbstractConfigurableBundleCreatorTests { - - protected WorkflowBundleReader workflowBundleReader; - protected CredentialManager credentialManager; - protected MasterPasswordProvider masterPasswordProvider; - protected DatabaseConfiguration databaseConfiguration; - protected JNDIContextManager jndiContextManager; - protected ApplicationConfiguration applicationConfiguration; - - protected String getPlatformName() { - // return Platforms.FELIX; - return Platforms.EQUINOX; - } - - @Override - protected OsgiPlatform createPlatform() { - OsgiPlatform platform = super.createPlatform(); - Properties config = platform.getConfigurationProperties(); - config.setProperty("org.osgi.framework.system.packages.extra", - "com.sun.org.apache.xml.internal.utils"); - return platform; - } - - @Override - protected String[] getTestBundlesNames() { - return new String[] { - "com.jcraft.jsch, com.springsource.com.jcraft.jsch, 0.1.41", - "com.sun.xml, com.springsource.com.sun.xml.bind, 2.2.0", - "com.sun.xml, com.springsource.com.sun.xml.fastinfoset, 1.2.2", - "com.thoughtworks.xstream, com.springsource.com.thoughtworks.xstream, 1.2.2", - "commons-dbcp, commons-dbcp, 1.4", - "commons-pool, commons-pool, 1.5.6", - "javax.activation, com.springsource.javax.activation, 1.1.1", - "javax.jms, com.springsource.javax.jms, 1.1.0", - "javax.mail, com.springsource.javax.mail, 1.4.0", - "javax.servlet, com.springsource.javax.servlet, 2.5.0", - "javax.transaction, com.springsource.javax.transaction, 1.1.0",// for derby client - "javax.wsdl, com.springsource.javax.wsdl, 1.6.1", - "javax.xml.bind, com.springsource.javax.xml.bind, 2.2.0", - "javax.xml.rpc, com.springsource.javax.xml.rpc, 1.1.0", - "javax.xml.soap, com.springsource.javax.xml.soap, 1.3.0", - "javax.xml.stream, com.springsource.javax.xml.stream, 1.0.1", - "org.antlr, com.springsource.antlr, 2.7.6", - "org.apache.aries, org.apache.aries.util, 0.3", - "org.apache.aries.proxy, org.apache.aries.proxy.api, 0.3", - "org.apache.aries.jndi, org.apache.aries.jndi, 0.3", - "org.apache.axis, com.springsource.org.apache.axis, 1.4.0", - "org.apache.commons, com.springsource.org.apache.commons.cli, 1.2.0", - "org.apache.commons, com.springsource.org.apache.commons.codec, 1.4.0", - "org.apache.commons, com.springsource.org.apache.commons.csv, 1.0.0.BUILD-20080106", - "org.apache.commons, com.springsource.org.apache.commons.collections, 3.2.0", - "org.apache.commons, com.springsource.org.apache.commons.discovery, 0.4.0", - "org.apache.commons, com.springsource.org.apache.commons.httpclient, 3.1.0", - "org.apache.commons, com.springsource.org.apache.commons.io, 1.4.0", - "org.apache.commons, com.springsource.org.apache.commons.lang, 2.5.0", - "org.apache.commons, com.springsource.org.apache.commons.logging, 1.1.1", - "org.apache.commons, com.springsource.org.apache.commons.net, 1.4.1", - // "org.apache.derby, derby, 10.5.3.0_1", - "org.apache.derby, com.springsource.org.apache.derby, 10.5.1000001.764942", - "org.apache.derby, com.springsource.org.apache.derby.client, 10.5.1000001.764942", - "org.apache.derby, com.springsource.org.apache.derby.drda, 10.5.1000001.764942", - "org.apache.httpcomponents, com.springsource.org.apache.httpcomponents.httpclient, 4.1.1", - "org.apache.httpcore, com.springsource.org.apache.httpcomponents.httpcore, 4.1", - "org.apache.log4j, com.springsource.org.apache.log4j, 1.2.16", - "org.apache.ws, com.springsource.org.apache.ws.security, 1.5.8", - // "org.apache.ws.security, wss4j, 1.5.12", - "org.apache.xml, com.springsource.org.apache.xml.resolver, 1.2.0", - "org.apache.xmlbeans, com.springsource.org.apache.xmlbeans, 2.4.0", - "org.apache.xmlcommons, com.springsource.org.apache.xmlcommons, 1.3.4", - "org.apache.xalan, com.springsource.org.apache.xalan, 2.7.1", - "org.apache.xalan, com.springsource.org.apache.xml.serializer, 2.7.1", - "org.apache.xerces, com.springsource.org.apache.xerces, 2.9.1", - "org.apache.xml, com.springsource.org.apache.xml.security, 1.4.2", - "org.aspectj, com.springsource.org.aspectj.runtime, 1.6.0", - "org.aspectj, com.springsource.org.aspectj.weaver, 1.6.0", - "org.beanshell, com.springsource.bsh, 2.0.0.b4", - "org.biomart, martservice, 2.0-SNAPSHOT", - "org.bouncycastle, bcprov-jdk16, 1.46", - "org.dom4j, com.springsource.org.dom4j, 1.6.1", - "org.hibernate, com.springsource.org.hibernate, 3.2.6.ga", - "org.jaxen, com.springsource.org.jaxen, 1.1.1", - "org.jboss.javassist, com.springsource.javassist, 3.3.0.ga", - "org.jdom, com.springsource.org.jdom, 1.1.0", - "org.jvnet.staxex, com.springsource.org.jvnet.staxex, 1.0.0", - "org.objectweb.asm, com.springsource.org.objectweb.asm, 1.5.3", - "org.objectweb.asm, com.springsource.org.objectweb.asm.attrs, 1.5.3", - "org.opensaml, com.springsource.org.opensaml, 1.1.0", - "org.springframework, org.springframework.jdbc, 3.0.0.RC1", - "org.springframework, org.springframework.orm, 3.0.0.RC1", - "org.springframework, org.springframework.transaction, 3.0.0.RC1", - // "org.springframework, org.springframework.beans, 3.0.5.RELEASE", - // "org.springframework, org.springframework.core, 3.0.5.RELEASE", - // "org.springframework, org.springframework.context, 3.0.5.RELEASE", - // "org.springframework, org.springframework.transaction, 3.0.5.RELEASE", - "org.xmlpull, com.springsource.org.xmlpull, 1.1.3.4-O", - "net.sf.taverna, wsdl-generic, 1.10-SNAPSHOT", - "net.sf.taverna.jedit, jedit-syntax, 2.2.4-SNAPSHOT", - "net.sf.taverna.t2.activities, apiconsumer-activity, 2.0-SNAPSHOT", - "net.sf.taverna.t2.activities, beanshell-activity, 2.0-SNAPSHOT", - "net.sf.taverna.t2.activities, biomart-activity, 2.0-SNAPSHOT", - // "net.sf.taverna.t2.activities, biomoby-activity, 2.0-SNAPSHOT", - "net.sf.taverna.t2.activities, dataflow-activity, 2.0-SNAPSHOT", - "net.sf.taverna.t2.activities, dependency-activity, 2.0-SNAPSHOT", - "net.sf.taverna.t2.activities, external-tool-activity, 2.0-SNAPSHOT", - "net.sf.taverna.t2.activities, localworker-activity, 2.0-SNAPSHOT", - "net.sf.taverna.t2.activities, rest-activity, 2.0-SNAPSHOT", - "net.sf.taverna.t2.activities, rshell-activity, 2.0-SNAPSHOT", - "net.sf.taverna.t2.activities, soaplab-activity, 2.0-SNAPSHOT", - "net.sf.taverna.t2.activities, spreadsheet-import-activity, 2.0-SNAPSHOT", - "net.sf.taverna.t2.activities, stringconstant-activity, 2.0-SNAPSHOT", - "net.sf.taverna.t2.activities, wsdl-activity, 2.0-SNAPSHOT", - "net.sf.taverna.t2.activities, xpath-activity, 2.0-SNAPSHOT", - "net.sf.taverna.t2.core, provenance-derby, 2.0-SNAPSHOT", - "net.sf.taverna.t2.core, provenance-mysql, 2.0-SNAPSHOT", - "net.sf.taverna.t2.core, provenanceconnector, 2.0-SNAPSHOT", - "net.sf.taverna.t2.core, reference-api, 2.0-SNAPSHOT", - "net.sf.taverna.t2.core, reference-core-extensions, 2.0-SNAPSHOT", - "net.sf.taverna.t2.core, reference-impl, 2.0-SNAPSHOT", - "net.sf.taverna.t2.core, workflowmodel-api, 2.0-SNAPSHOT", - "net.sf.taverna.t2.core, workflowmodel-core-extensions, 2.0-SNAPSHOT", - "net.sf.taverna.t2.core, workflowmodel-impl, 2.0-SNAPSHOT", - // "net.sf.taverna.t2.infrastructure, appconfig, 3.0-SNAPSHOT", - "net.sf.taverna.t2.lang, ui, 2.0-SNAPSHOT", - "net.sf.taverna.t2.lang, observer, 2.0-SNAPSHOT", - "net.sf.taverna.t2.security, credential-manager, 2.0-SNAPSHOT", - "net.sf.taverna.t2.security, credential-manager-impl, 2.0-SNAPSHOT", - "net.sourceforge.cglib, com.springsource.net.sf.cglib, 2.1.3", - "uk.org.taverna.configuration, taverna-app-configuration-api, 0.1.0-SNAPSHOT", - "uk.org.taverna.configuration, taverna-app-configuration-impl, 0.1.0-SNAPSHOT", - "uk.org.taverna.configuration, taverna-configuration-api, 0.1.0-SNAPSHOT", - "uk.org.taverna.configuration, taverna-configuration-impl, 0.1.0-SNAPSHOT", - "uk.org.taverna.configuration, taverna-database-configuration-api, 0.1.0-SNAPSHOT", - "uk.org.taverna.configuration, taverna-database-configuration-impl, 0.1.0-SNAPSHOT", - "uk.org.taverna.platform, report, 0.1.2-SNAPSHOT", - "uk.org.taverna.platform, data, 0.1.2-SNAPSHOT", - "uk.org.taverna.platform, execution-local, 0.1.2-SNAPSHOT", - "uk.org.taverna.platform, execution-remote, 0.1.2-SNAPSHOT", - "uk.org.taverna.platform, taverna-capability-api, 0.1.2-SNAPSHOT", - "uk.org.taverna.platform, taverna-capability-impl, 0.1.2-SNAPSHOT", - "uk.org.taverna.platform, taverna-execution-api, 0.1.2-SNAPSHOT", - "uk.org.taverna.platform, taverna-execution-impl, 0.1.2-SNAPSHOT", - "uk.org.taverna.platform, taverna-run-api, 0.1.2-SNAPSHOT", - "uk.org.taverna.platform, taverna-run-impl, 0.1.2-SNAPSHOT", - "uk.org.taverna.osgi.services, xml-parser-service, 0.0.1-SNAPSHOT", - "uk.org.taverna.osgi.services, xml-transformer-service, 0.0.1-SNAPSHOT", - // FIXME: Add the other scufl2 modules - "uk.org.taverna.scufl2, scufl2-api, 0.9.2", - "uk.org.taverna.scufl2, scufl2-rdfxml, 0.9.2", - "uk.org.taverna.scufl2, scufl2-ucfpackage, 0.9.2", - "uk.org.taverna.scufl2, scufl2-t2flow, 0.9.2", - "uk.org.taverna.scufl2, scufl2-validation, 0.9.2", - "uk.org.taverna.scufl2, scufl2-validation-correctness, 0.9.2", - "uk.org.taverna.scufl2, scufl2-validation-structural, 0.9.2", - "net.sf.taverna.t2, results, 2.0-SNAPSHOT", - "net.sf.taverna.t2, baclava, 0.1-SNAPSHOT", - // "net.sf.taverna.t2.taverna-commandline, taverna-commandline-common, 2.0-SNAPSHOT" - }; - } - - protected void setup() throws Exception { - - if (masterPasswordProvider == null) { - masterPasswordProvider = new MasterPasswordProvider() { - public String getMasterPassword(boolean firstTime) { - return "test"; - } - - public void setMasterPassword(String password) { - } - - public int getProviderPriority() { - return 0; - } - }; - bundleContext.registerService( - "net.sf.taverna.t2.security.credentialmanager.MasterPasswordProvider", - masterPasswordProvider, null); - } - - if (credentialManager == null) { - ServiceReference credentialManagerReference = bundleContext - .getServiceReference("net.sf.taverna.t2.security.credentialmanager.CredentialManager"); - credentialManager = (CredentialManager) bundleContext - .getService(credentialManagerReference); - } - - if (workflowBundleReader == null) { - ServiceReference[] workflowBundleReaderReferences = bundleContext.getServiceReferences( - "uk.org.taverna.scufl2.api.io.WorkflowBundleReader", null); - for (ServiceReference serviceReference : workflowBundleReaderReferences) { - workflowBundleReader = (WorkflowBundleReader) bundleContext - .getService(serviceReference); - if (workflowBundleReader.getMediaTypes().contains( - T2FlowReader.APPLICATION_VND_TAVERNA_T2FLOW_XML)) { - break; - } - } - } - - if (databaseConfiguration == null) { - ServiceReference databaseConfigurationReference = bundleContext - .getServiceReference("uk.org.taverna.configuration.database.DatabaseConfiguration"); - databaseConfiguration = (DatabaseConfiguration) bundleContext - .getService(databaseConfigurationReference); - ServiceReference jndiContextManagerReference = bundleContext - .getServiceReference("org.osgi.service.jndi.JNDIContextManager"); - jndiContextManager = (JNDIContextManager) bundleContext - .getService(jndiContextManagerReference); - ServiceReference applicationConfigurationReference = bundleContext - .getServiceReference("uk.org.taverna.configuration.app.ApplicationConfiguration"); - applicationConfiguration = (ApplicationConfiguration) bundleContext - .getService(applicationConfigurationReference); - } - - } - - public void testOsgiPlatformStarts() throws Exception { - System.out.println(Constants.FRAMEWORK_VENDOR + " = " - + bundleContext.getProperty(Constants.FRAMEWORK_VENDOR)); - System.out.println(Constants.FRAMEWORK_VERSION + " = " - + bundleContext.getProperty(Constants.FRAMEWORK_VERSION)); - System.out.println(Constants.FRAMEWORK_EXECUTIONENVIRONMENT + " = " - + bundleContext.getProperty(Constants.FRAMEWORK_EXECUTIONENVIRONMENT)); - System.out.println(Constants.OSGI_IMPL_VERSION_KEY + " = " - + bundleContext.getProperty(Constants.OSGI_IMPL_VERSION_KEY)); - } - - public WorkflowBundle loadWorkflow(String t2FlowFile) throws Exception { - URL wfResource = getClass().getResource(t2FlowFile); - assertNotNull(wfResource); - return workflowBundleReader.readBundle(wfResource.openStream(), - T2FlowReader.APPLICATION_VND_TAVERNA_T2FLOW_XML); - } - - public File loadFile(String fileName) throws IOException, FileNotFoundException { - File file = File.createTempFile("platform-test", null); - InputStream inputStream = getClass().getResource(fileName).openStream(); - OutputStream outputStream = new FileOutputStream(file); - byte[] buffer = new byte[64]; - int length = -1; - while ((length = inputStream.read(buffer)) >= 0) { - outputStream.write(buffer, 0, length); - } - outputStream.flush(); - outputStream.close(); - return file; - } - - public void printErrors(Data data) { - ErrorDocument error = (ErrorDocument) data.getValue(); - String message = error.getMessage(); - if (message != null) { - System.out.println(message); - } - String exceptionMessage = error.getExceptionMessage(); - if (exceptionMessage != null) { - System.out.println(exceptionMessage); - } - for (StackTraceElementBean stackTraceElementBean : error.getStackTraceStrings()) { - System.out.println(stackTraceElementBean.getClassName()); - System.out.println(stackTraceElementBean.getMethodName()); - System.out.println(stackTraceElementBean.getLineNumber()); - } -// Set<T2Reference> errorReferences = error.getErrorReferences(); -// for (T2Reference t2Reference : errorReferences) { -// printErrors(referenceService, t2Reference); -// } - } - - public boolean checkResult(Data result, String expectedResult) { - if (result.isError()) { - printErrors(result); - return false; - } else { - Object resultObject = result.getValue(); - String resultValue = null; - if (resultObject instanceof byte[]) { - resultValue = new String((byte[]) resultObject); - } else { - resultValue = (String) resultObject; - } - - if (resultValue.startsWith(expectedResult)) { - return true; - } else { - System.out.println("Expected: " + expectedResult + ", Actual: " + resultValue); - return false; - } - } - } - - public boolean waitForState(WorkflowReport report, State state) throws InterruptedException { - return waitForState(report, state, true); - } - - public boolean waitForState(WorkflowReport report, State state, boolean printReport) - throws InterruptedException { - int wait = 0; - while (!report.getState().equals(state) && wait++ < 30) { - if (printReport) - System.out.println(report); - Thread.sleep(500); - } - return report.getState().equals(state); - } - - public void waitForResults(Map<String, Data> results, WorkflowReport report, String... ports) - throws InterruptedException { - int wait = 0; - while (!resultsReady(results, ports) && wait++ < 20) { - System.out.println(report); - Thread.sleep(500); - } - } - - private boolean resultsReady(Map<String, Data> results, String... ports) { - for (String port : ports) { - if (!results.containsKey(port)) { - return false; - } - } - return true; - } - -}
