questions about jintegration

0 views
Skip to first unread message

mens jamie

unread,
Oct 2, 2009, 9:20:32 AM10/2/09
to jEmbedded Discussion Group
Hi Adolfo:
In JIntegration,would you please explain the key difference
between @JIContainer and @SpringContext,I really don't know how to use
them.
================================================
@JIContainer(configurationFile = "classpath:META-INF/test-
registry.xml")
================================================
@SpringContext(configurationFile = "classpath:META-INF/application-
context.xml")
================================================

and another question is that,I wanna change the default value in
@DatabaseServiceConfiguration,so I have defined meta datasource
information defined in xml but it seems no result,code segment is
below:
============================================
<bean id="dataSource"
class="org.jsemantic.services.databaseservice.datasource.hsqldb.HsqldbDataSource">
<property name="database" value="jdbc:hsqldb:mem:test" />
<property name="user" value="sa" />
<property name="password" value="" />
</bean>
============================================

Jamie

adolfo

unread,
Oct 2, 2009, 10:36:47 AM10/2/09
to jEmbedded Discussion Group
Hi jamie, don't bother about this configuration. I've changed
everything and as you will see it's easier now as you don't need the
xml (it's not spring based, even though you can use it):


@RunWith(IntegrationTestClassRunner.class)

@PropertiesService(propertiesFile="META-INF/integration-db-
test.properties")
@Include(resources=EmbeddedDatabaseImpl.class)
public class AnnotatedDatabaseIntegrationTest
{
@Test
public void testInfrastructure()
{
assertNotNull(getJdbcService());
}

@Test
public void testSelect() throws Exception
{
assertEqualsUpdateResult("insert into test values(4, 'test4',
'test description 4')", 1);
assertResultNotNull("select * from test where id=4");
}

@Test
public void listTest() throws Exception
{
assertResultListNotNull("select * from test");
}

@Test
public void equalsTest() throws Exception
{
assertFieldEquals("select * from test where id=1", "name",
"test1");
}
}

I will release it this weekend.

Take care.


On 2 oct, 15:20, mens jamie <jamie.m...@gmail.com> wrote:
> Hi Adolfo:
>        In JIntegration,would you please explain the key difference
> between @JIContainer and @SpringContext,I really don't know how to use
> them.
> ================================================
> @JIContainer(configurationFile = "classpath:META-INF/test-
> registry.xml")
> ================================================
> @SpringContext(configurationFile = "classpath:META-INF/application-
> context.xml")
> ================================================
>
> and another question is that,I wanna change the default value in
> @DatabaseServiceConfiguration,so I have defined meta datasource
> information defined in xml but it seems no result,code segment is
> below:
> ============================================
> <bean id="dataSource"
> class="org.jsemantic.services.databaseservice.datasource.hsqldb.HsqldbDataS­ource">
Reply all
Reply to author
Forward
0 new messages