summaryrefslogtreecommitdiffstats
path: root/branches/sca-java-1.x/itest
diff options
context:
space:
mode:
authorslaws <slaws@13f79535-47bb-0310-9956-ffa450edef68>2009-07-29 09:13:08 +0000
committerslaws <slaws@13f79535-47bb-0310-9956-ffa450edef68>2009-07-29 09:13:08 +0000
commit7ac2e7223edc3367e52fde8372ab57a653f48d7b (patch)
treed39864c9fc6c394d88d73bb924ce7d87fa8b624f /branches/sca-java-1.x/itest
parent23534329cd092399b9cdb16ab0425d19ef39bfc9 (diff)
TUSCANY-3174 - Fix test to use new workspace manager module
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@798818 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'branches/sca-java-1.x/itest')
-rw-r--r--branches/sca-java-1.x/itest/workspace-manager/pom.xml2
-rw-r--r--branches/sca-java-1.x/itest/workspace-manager/src/main/java/org/apache/tuscany/sca/launcher/TestLauncher.java23
2 files changed, 6 insertions, 19 deletions
diff --git a/branches/sca-java-1.x/itest/workspace-manager/pom.xml b/branches/sca-java-1.x/itest/workspace-manager/pom.xml
index 63c8aea340..500db282a8 100644
--- a/branches/sca-java-1.x/itest/workspace-manager/pom.xml
+++ b/branches/sca-java-1.x/itest/workspace-manager/pom.xml
@@ -31,7 +31,7 @@
<dependencies>
<dependency>
<groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-workspace-impl</artifactId>
+ <artifactId>tuscany-workspace-manager</artifactId>
<version>1.6-SNAPSHOT</version>
</dependency>
diff --git a/branches/sca-java-1.x/itest/workspace-manager/src/main/java/org/apache/tuscany/sca/launcher/TestLauncher.java b/branches/sca-java-1.x/itest/workspace-manager/src/main/java/org/apache/tuscany/sca/launcher/TestLauncher.java
index 91dc3a9520..3e4cd41924 100644
--- a/branches/sca-java-1.x/itest/workspace-manager/src/main/java/org/apache/tuscany/sca/launcher/TestLauncher.java
+++ b/branches/sca-java-1.x/itest/workspace-manager/src/main/java/org/apache/tuscany/sca/launcher/TestLauncher.java
@@ -38,15 +38,13 @@ import org.apache.tuscany.sca.monitor.Problem;
import org.apache.tuscany.sca.monitor.Problem.Severity;
import org.apache.tuscany.sca.workspace.Workspace;
import org.apache.tuscany.sca.workspace.manager.WorkspaceManager;
-import org.apache.tuscany.sca.workspace.manager.WorkspaceManagerFactory;
import org.osoa.sca.ServiceRuntimeException;
public class TestLauncher {
public final static void main(String[] args) {
- WorkspaceManagerFactory workspaceManagerFactory = WorkspaceManagerFactory.newInstance();
- WorkspaceManager workspaceManager = workspaceManagerFactory.createWorkspaceManager();
+ WorkspaceManager workspaceManager = WorkspaceManager.newInstance();
addExtensions(workspaceManager);
workspaceManager.start();
@@ -56,7 +54,7 @@ public class TestLauncher {
private static void addExtensions(WorkspaceManager workspaceManager) {
try {
- System.out.println("Adding extensions");
+ System.out.println("Add extensions");
ExtensionPointRegistry registry = workspaceManager.getRegistry();
// get monitor
@@ -93,24 +91,13 @@ public class TestLauncher {
private static void processContributions(WorkspaceManager workspaceManager){
try {
System.out.println("Process contribution");
- ExtensionPointRegistry registry = workspaceManager.getRegistry();
- ModelFactoryExtensionPoint modelFactories = registry.getExtensionPoint(ModelFactoryExtensionPoint.class);
- ContributionFactory contributionFactory = modelFactories.getFactory(ContributionFactory.class);
-
- Workspace workspace = workspaceManager.createWorkspace();
-
- Contribution contribution = contributionFactory.createContribution();
- contribution.setURI("contrib1");
- contribution.setLocation("./target/classes/contrib1");
- contribution.setUnresolved(true);
- contribution = workspaceManager.addContributionToWorkspace(workspace, contribution);
-
+ Workspace workspace = workspaceManager.createWorkspace();
+ Contribution contribution = workspaceManager.readContribution("contrib1", "./target/classes/contrib1");
+ workspaceManager.addContributionToWorkspace(workspace, contribution);
workspaceManager.resolveWorkspace(workspace);
// do whatever you need to do with workspace and its resolved contributions
-
- workspaceManager.removeContributionFromWorkspace(workspace, contribution);
} catch (Exception ex) {
ex.printStackTrace();