Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Test and Performance Tools Platform (TPTP) » Datapool from standalone application
Datapool from standalone application [message #65603] Tue, 11 April 2006 15:41 Go to next message
Eclipse UserFriend
Originally posted by: mindism.yahoo.com

Hi,

What actions must be taken (registration of unzipping EMF resource
factories etc.) in order to be able use Datapools from standalone
application (not in execution agent).
For instance:

//Initialize the datapool factory
IDatapoolFactory dpFactory = new Common_DatapoolFactoryImpl();

// Load the shoppingCartDatapool datapool
URL testDataPoolURL = getClass().getResource("x.datapool");
IDatapool datapool = dpFactory.load(
new File(testDataPoolURL.toURI()),
false);

assertNotNull(datapool);
// Create an iterator to traverse the datapool
IDatapoolIterator dpIterator =
dpFactory.open(datapool," org.eclipse.hyades.datapool.iterator.DatapoolIteratorSequent ialPrivate ");

// Initialize the datapool to traverse the first equivalence class.
dpIterator.dpInitialize(datapool,0);


Thanks,

Mindaugas
Re: Datapool from standalone application [message #66960 is a reply to message #65603] Tue, 18 April 2006 15:39 Go to previous messageGo to next message
Paul Slauenwhite is currently offline Paul SlauenwhiteFriend
Messages: 975
Registered: July 2009
Senior Member
Hi Mindaugas,
You will find ht necessary code snippets for programmatically accessing
TPTP datapools in the TPTP documentation:

Help >> Help Contents >> Testing automatically and manually >> Testing
automatically and manually >> Tutorial: Accessing a datapool from a JUnit
test

Paul
"Mindaugas Malinauskas" <mindism@yahoo.com> wrote in message
news:e1gimp$ad1$1@utils.eclipse.org...
> Hi,
>
> What actions must be taken (registration of unzipping EMF resource
> factories etc.) in order to be able use Datapools from standalone
> application (not in execution agent).
> For instance:
>
> //Initialize the datapool factory
> IDatapoolFactory dpFactory = new Common_DatapoolFactoryImpl();
>
> // Load the shoppingCartDatapool datapool
> URL testDataPoolURL = getClass().getResource("x.datapool");
> IDatapool datapool = dpFactory.load(
> new File(testDataPoolURL.toURI()),
> false);
>
> assertNotNull(datapool);
> // Create an iterator to traverse the datapool
> IDatapoolIterator dpIterator =
>
dpFactory.open(datapool,"org.eclipse.hyades.datapool.iterator.DatapoolIterat
orSequentialPrivate");
>
> // Initialize the datapool to traverse the first equivalence class.
> dpIterator.dpInitialize(datapool,0);
>
>
> Thanks,
>
> Mindaugas
Re: Datapool from standalone application [message #98694 is a reply to message #65603] Tue, 15 May 2007 13:20 Go to previous message
Eclipse UserFriend
Originally posted by: stolp.verit.de

Hi,

since I suffered through this as well, just two quick additions which
might be of help to people who have the same problem:

1. With Eclipse 3.2 you will also need
org.eclipse.equinox.common_${Version}.jar on your classpath since this
contains the missing org.eclipse.core.runtime.IAdaptable class. As of
TPTP 4.3.1 this is not part of the documentation yet.

2. To successfully load the datapool resource you will have to add the
missing resource registration for the .datapool extension like in:
Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap( ).put(
ICommonConstants.DATAPOOL_FILE_EXTENSION,
new DatapoolFacadeResourceFactoryImpl());

As noted in the thread entitled "Datapool and" in this newsgroup the
exception leading to the above solution (Cannot create a resource for '"
+ uri + "'; a registered resource factory is needed" ) gets suppressed
in the Common_DatapoolFactoryImpl.loadForEdit(File, boolean) method
where it will show up as "Datapool could not be loaded from file ..."
DatapoolException.

Please note that this applies to a standalone invocation.

Hope this helps,

Torsten

Paul Slauenwhite wrote:
> Hi Mindaugas,
> You will find ht necessary code snippets for programmatically
accessing
> TPTP datapools in the TPTP documentation:
>
> Help >> Help Contents >> Testing automatically and manually >> Testing
> automatically and manually >> Tutorial: Accessing a datapool from a JUnit
> test
>
> Paul
> "Mindaugas Malinauskas" <mindism@yahoo.com> wrote in message
> news:e1gimp$ad1$1@utils.eclipse.org...
>> Hi,
>>
>> What actions must be taken (registration of unzipping EMF resource
>> factories etc.) in order to be able use Datapools from standalone
>> application (not in execution agent).
>> For instance:
>>
>> //Initialize the datapool factory
>> IDatapoolFactory dpFactory = new Common_DatapoolFactoryImpl();
>>
>> // Load the shoppingCartDatapool datapool
>> URL testDataPoolURL = getClass().getResource("x.datapool");
>> IDatapool datapool = dpFactory.load(
>> new File(testDataPoolURL.toURI()),
>> false);
>>
>> assertNotNull(datapool);
>> // Create an iterator to traverse the datapool
>> IDatapoolIterator dpIterator =
>>
>
dpFactory.open(datapool,"org.eclipse.hyades.datapool.iterator.DatapoolIterat
> orSequentialPrivate");
>> // Initialize the datapool to traverse the first equivalence class.
>> dpIterator.dpInitialize(datapool,0);
>>
>>
>> Thanks,
>>
>> Mindaugas
>
>
Previous Topic:how do I access data sent to an agent written in c++/java?
Next Topic:TpTp-agr
Goto Forum:
  


Current Time: Tue Apr 23 08:32:29 GMT 2024

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

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

Back to the top