Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Test and Performance Tools Platform (TPTP) » Create a Deployment programmatically
Create a Deployment programmatically [message #117740] Fri, 09 November 2007 17:29 Go to next message
Eclipse UserFriend
Originally posted by: ddesseignet.axway.com

Hello,

I'am trying to create a Deployment programmatically in the
org.eclipse.hyades.automation.client.adapters.shell.Automati onClientAdapter
class. Indeed, I would like to run a test with the automation module but I
haven't created a deployment with Eclipse before. So I need to create it
programmatically before running my tests through a shell (in the
AutomationClientAdapter class). The problem is I can't recover the
Workspace (because I launch my Test through the command line) when I try
to do that:

IProject project =
ResourcesPlugin.getWorkspace().getRoot().getProject(projectN ame);
URI uri = URI.createPlatformResourceURI(absoluteDeployPath);
org.eclipse.emf.ecore.resource.Resource.Factory factory =
EMFUtil.getResourceFactory(ICommonConstants.DEPLOYMENT_FILE_ EXTENSION);
Resource resource = null;
TPFDeployment deployment = null;
resource = factory.createResource(uri);
deployment = Common_TestprofileFactory.eINSTANCE.createTPFDeployment();
resource.getContents().add(deployment);
deployment.setName("test");
deployment.setDescription("");

Do you have any idea to help me ?

Thanks.

Regards.

Damien
Re: Create a Deployment programmatically [message #118006 is a reply to message #117740] Mon, 12 November 2007 12:04 Go to previous message
Paul Slauenwhite is currently offline Paul SlauenwhiteFriend
Messages: 970
Registered: July 2009
Senior Member
Hi Damien,
Unless your artifact and/or location changes, you can manually create
one in the TPTP workbench.

Paul
"Damien" <ddesseignet@axway.com> wrote in message
news:06e4bd7d04fcbb2478ef87efdc8c56db$1@www.eclipse.org...
> Hello,
>
> I'am trying to create a Deployment programmatically in the
> org.eclipse.hyades.automation.client.adapters.shell.Automati onClientAdapter
> class. Indeed, I would like to run a test with the automation module but I
> haven't created a deployment with Eclipse before. So I need to create it
> programmatically before running my tests through a shell (in the
> AutomationClientAdapter class). The problem is I can't recover the
> Workspace (because I launch my Test through the command line) when I try
> to do that:
>
> IProject project =
> ResourcesPlugin.getWorkspace().getRoot().getProject(projectN ame);
> URI uri = URI.createPlatformResourceURI(absoluteDeployPath);
> org.eclipse.emf.ecore.resource.Resource.Factory factory =
> EMFUtil.getResourceFactory(ICommonConstants.DEPLOYMENT_FILE_ EXTENSION);
> Resource resource = null; TPFDeployment deployment = null; resource =
> factory.createResource(uri);
> deployment = Common_TestprofileFactory.eINSTANCE.createTPFDeployment();
> resource.getContents().add(deployment); deployment.setName("test");
> deployment.setDescription("");
>
> Do you have any idea to help me ?
>
> Thanks.
>
> Regards.
>
> Damien
>
Previous Topic:Substitution of Datapool contents with Deployment?
Next Topic:Problems when profiling a standalone tomcat
Goto Forum:
  


Current Time: Fri Dec 19 07:21:40 GMT 2014

Powered by FUDForum. Page generated in 0.10635 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software