Home » Modeling » EMF » [CDO] Need help with the testing framework
| |
Re: [CDO] Need help with the testing framework [message #431427 is a reply to message #431420] |
Thu, 09 July 2009 09:00 |
Stefan Winkler Messages: 307 Registered: July 2009 Location: Germany |
Senior Member |
|
|
Kai,
I have to admit that I don't understand every single bit of the magic
behind the scenes, either ;)
That said, be sure to check out the project org.eclipse.eml.cdo.tests.db
There you'll find different AllTestsDBxxx classes which configure the
different databases (and also there the paths etc. are set).
Generally, the test framework has a list of all relevant test classes in
AllTests. This class is extended by the AllTestsDBxxx classes which set
up the context of repository and network configurations. The neat thing
about this is, that you can easily test different configurations (e.g.,
different databases) with one test run, just by configuring the
respective scenarios.
The line you mentioned -- CDOSession session = openModel1Session() -- is
a shortcut for setting up the whole CDO client stack, connect to the
server, open the session and register the model1 package (which is
contained in the .cdo.tests.model1 project).
I hope this helps a bit...
Cheers,
Stefan
Kai Schlamp schrieb:
> Ok, I found the location of the database. It's created in /temp and is
> not deleted after a test run.
> But I still wonder how for example to run the test with Derby or
> HSQLDB instead.
>
> Kai Schlamp wrote:
>> Hi.
>>
>> I just implemented the SQL query, but now also want to test it.
>> I took a look at HibernateQueryTest, but don't really understand
>> what's going on.
>> Especially the line CDOSession session = openModel1Session();
>> It seems to create the database and the session.
>> In HibernateQueryTest it creates a database by using Hibernate, but
>> in my case (in the plugin org.eclipse.emf.cdo.tests.db it seems to
>> create a H2 database. That is fine, but I would like to know where
>> that magic happens (and I am not able to find it myself). What if I
>> want to test it with Derby instead of H2? Where is the switch?
>> I also don't find the database on my harddrive, so it seems it is
>> automatically deleted after the test. Could you point me to the
>> location where that happens. Cause I want to turn the deletion off
>> for a moment.
>>
>> Regards,
>> Kai
|
|
|
Re: [CDO] Need help with the testing framework [message #431429 is a reply to message #431427] |
Thu, 09 July 2009 09:21 |
|
Guys,
That's all correct. I just wanted to add, that most test cases don't
need to pre-register model1 anymore. This should be good, too:
CDOSession session = openSession();
Registering packages in advance is usually only needed in UIs, where for
example an editor must present the list of available classes *before*
instances are created/attached.
Cheers
/Eike
----
http://thegordian.blogspot.com
http://twitter.com/eikestepper
Stefan Winkler schrieb:
> Kai,
>
> I have to admit that I don't understand every single bit of the magic
> behind the scenes, either ;)
>
> That said, be sure to check out the project org.eclipse.eml.cdo.tests.db
> There you'll find different AllTestsDBxxx classes which configure the
> different databases (and also there the paths etc. are set).
>
> Generally, the test framework has a list of all relevant test classes in
> AllTests. This class is extended by the AllTestsDBxxx classes which set
> up the context of repository and network configurations. The neat thing
> about this is, that you can easily test different configurations (e.g.,
> different databases) with one test run, just by configuring the
> respective scenarios.
>
>
> The line you mentioned -- CDOSession session = openModel1Session() -- is
> a shortcut for setting up the whole CDO client stack, connect to the
> server, open the session and register the model1 package (which is
> contained in the .cdo.tests.model1 project).
>
>
> I hope this helps a bit...
>
> Cheers,
> Stefan
>
>
>
> Kai Schlamp schrieb:
>
>> Ok, I found the location of the database. It's created in /temp and is
>> not deleted after a test run.
>> But I still wonder how for example to run the test with Derby or
>> HSQLDB instead.
>>
>> Kai Schlamp wrote:
>>
>>> Hi.
>>>
>>> I just implemented the SQL query, but now also want to test it.
>>> I took a look at HibernateQueryTest, but don't really understand
>>> what's going on.
>>> Especially the line CDOSession session = openModel1Session();
>>> It seems to create the database and the session.
>>> In HibernateQueryTest it creates a database by using Hibernate, but
>>> in my case (in the plugin org.eclipse.emf.cdo.tests.db it seems to
>>> create a H2 database. That is fine, but I would like to know where
>>> that magic happens (and I am not able to find it myself). What if I
>>> want to test it with Derby instead of H2? Where is the switch?
>>> I also don't find the database on my harddrive, so it seems it is
>>> automatically deleted after the test. Could you point me to the
>>> location where that happens. Cause I want to turn the deletion off
>>> for a moment.
>>>
>>> Regards,
>>> Kai
>>>
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
|
|
|
Goto Forum:
Current Time: Fri Apr 26 06:04:30 GMT 2024
Powered by FUDForum. Page generated in 0.02919 seconds
|