Actually I was more thinking along something like that
public class TestConfig extends OnDemand {
@Overrides
public void configure(Config conf) {
conf.datasource("DefaultDS")
.connectionUrl("jdbc:hsqldb:mem")
.driver(org.hsqldb.jdbcDriver.class)
.user("sa")
.minPoolSize(2)
.queue("hibernatesearch")
.persistent("DefaultDS");
}
@Test
@JBossEmbedded(config=TestConfig.class)
public void testMyApp() {
JBossEmbeddable container = JBossEmbeddable.start(); //read config
from the caller annotation
...
...
container.stop();
}
Putting XML files for tests is annoying, messy, hard, confusing and
reduce isolation / flexibility between tests.
On Apr 7, 2009, at 12:16, Carlo de Wolf wrote:
A datasource you would define somewhere in src/test/resources. Maybe
src/test/resources/deploy/test-ds.xml.
Then in @AfterClass you boot up the server (as per Andrew's code)
With maybe: @Profile("JCA") on the unit test class itself.
(More likely the fact that a dependency on jboss-jca-profile is
defined in pom.xml will bring it up by itself.)
Carlo
Andrew Lee Rubinger wrote:
> Sounds a bit like the prototype:
>
>
http://anonsvn.jboss.org/repos/jbossas/projects/embedded/trunk/testsuite/...
>
> ...which just proves the usage, and the API is to be discussed / in-
> progress this week. Likely I'll post some note here and let input
> flow into the Design of Embedded Forum.
>
> S,
> ALR
>
> Emmanuel Bernard wrote:
>> I don't have a problem with staged work but from hat I have seen
>> we add even more XML where there were plenty of it already.
>>
>> I really really really would like to get to a /default/ no XML /
>> no config mode where things are scanned in my unit test CP and
>> deployed. If config is needed (maybe datasource), a trivially
>> simple programmatic API could be used. We could almost do
>> something like
>>
>> @Test
>> @JBossEmbedded(config=TestConfig.class)
>> public void testMyApp() {
>> JBossEmbeddable container = JBossEmbeddable.start(); //read
>> config from the caller annotation
>> ...
>> ...
>> container.stop();
>> }
>>
>> But again, I wish there was a central point for all these
>> discussions.
>>
>> On Apr 7, 2009, at 11:29, Andrew Lee Rubinger wrote:
>>
>>> Emmanuel Bernard wrote:
>>>> But nowhere is there a discussion on what Embedded should do and
>>>> should look like from a user point of view.
>>>
>>> Because Embedded as previously defined has since been split into
>>> a series of independent features (as mentioned in posts to this
>>> Thread). The pure in-JVM nature was easily enough provided by:
>>>
>>> * Splitting jboss-bootstrap out of AS
>>> * Making some standalone usage for it
>>>
>>> This does not yet address Bill's hitlist:
>>>
>>> * Embedded Distribution as a unified JAR
>>> * Configuration Overrides
>>> * Minimal Profiles to start or on-demand
>>>
>>> But we need a good starting point to enable in-JVM testing for
>>> AS5, and a solid base upon which to build the next few features.
>>> IMO biting too much off at once very quickly puts us at a dead end.
>>>
>>> Regarding jboss-bootstrap:
>>>
>>> As I'd mentioned, the user API leaves room for improvement, and
>>> there are a series of ClassLoading assumptions that we're
>>> addressing:
>>>
>>>
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4223913#...
>>>
>>> So Bootstrap continues to be the foundation, and as Carlo
>>> mentioned, a new "Launcher" component becomes the user view for
>>> Embedded, Reloaded, and AS. From here we may support POJO Server
>>> start/stop/deploy/etc.
>>>
>>> With some working prototypes committed over the next couple days
>>> there will be some more to discuss from my end.
>>>
>>> S,
>>> ALR
>>>
>>> --
>>> Andrew Lee Rubinger
>>> Sr. Software Engineer
>>> JBoss, a division of Red Hat, Inc.
>>>
http://exitcondition.alrubinger.com
>>> _______________________________________________
>>> jboss-development mailing list
>>> jboss-development(a)lists.jboss.org
>>>
https://lists.jboss.org/mailman/listinfo/jboss-development
>>
>> _______________________________________________
>> jboss-development mailing list
>> jboss-development(a)lists.jboss.org
>>
https://lists.jboss.org/mailman/listinfo/jboss-development
>
_______________________________________________
jboss-development mailing list
jboss-development(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-development