You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by Raymond Feng <en...@gmail.com> on 2007/03/07 23:24:46 UTC

[sca-java-integration-branch] Moving to maven-surefire-plugin 2.3 and JUnit 4.2

Hi,

With the release of maven-surefire-plugin 2.3, we can now run JUnit 4.x test cases under maven. I plan to update pom.xml(s) in the sca-java-integration branch to take advantage of this capability. I have run the full top-down build and everything looks good. 

Please let me know if you have any concerns.

Thanks,
Raymond

Re: [sca-java-integration-branch] Moving to maven-surefire-plugin 2.3 and JUnit 4.2

Posted by Jean-Sebastien Delfino <js...@apache.org>.
Jim Marino wrote:
>> +1 from me.
>>
>> A side comment, this will give us the ability to init a single 
>> runtime instance in a method annotated with a Junit @BeforeClass 
>> annotation and reuse it across multiple test methods. I think it will 
>> be interesting for integration tests in particular.
>>
>> Raymond, are you going to also adjust the SCATestCaseRunner utility 
>> class to support JUnit4 test cases? or I can help port that class if 
>> you prefer, let me know.
>>
>> --Jean-Sebastien
>>
>
> FYI this functionality using SCA annotations is already supported in 
> trunk if you care to use it in the integration branch.
>
> Jim
>

Can you point me to an example? Thanks.

-- 
Jean-Sebastien


---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org


Re: [sca-java-integration-branch] Moving to maven-surefire-plugin 2.3 and JUnit 4.2

Posted by Jim Marino <jm...@myromatours.com>.
> +1 from me.
>
> A side comment, this will give us the ability to init a single  
> runtime instance in a method annotated with a Junit @BeforeClass  
> annotation and reuse it across multiple test methods. I think it  
> will be interesting for integration tests in particular.
>
> Raymond, are you going to also adjust the SCATestCaseRunner utility  
> class to support JUnit4 test cases? or I can help port that class  
> if you prefer, let me know.
>
> -- 
> Jean-Sebastien
>

FYI this functionality using SCA annotations is already supported in  
trunk if you care to use it in the integration branch.

Jim

---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org


Re: [sca-java-integration-branch] Moving to maven-surefire-plugin 2.3 and JUnit 4.2

Posted by Jean-Sebastien Delfino <js...@apache.org>.
Jean-Sebastien Delfino wrote:
> Raymond Feng wrote:
>> Hi,
>>
>> OK. I understand it's used for isolation purposes now. I'm busy 
>> fixing a build break now, would you please add the support for @Test, 
>> @Before, @After, @BeforeClass and @AfterClass for JUnit 4.x using 
>> reflections :-)?
>>
>> Thanks,
>> Raymond
>>
>> ----- Original Message ----- From: "Jean-Sebastien Delfino" 
>> <js...@apache.org>
>> To: <tu...@ws.apache.org>
>> Sent: Thursday, March 08, 2007 11:44 AM
>> Subject: Re: [sca-java-integration-branch] Moving to 
>> maven-surefire-plugin 2.3 and JUnit 4.2
>>
>>
>>> [snip]
>>> Raymond Feng wrote:
>>>> 2) When I try to port the SCATestCaseRunner to support JUnit 4.x 
>>>> annotations, I found it fairly cumbersome to use java reflection to 
>>>> access org.junit.* classes and annotations. Can we add JUnit as a 
>>>> compile time dependency? If we don't like to have it in the core, 
>>>> maybe we should keep it in the "tuscany-test" module.
>>>>
>>>> Thanks,
>>>> Raymond
>>>>
>>>
>>> The runner is using reflection to allow the test case to be loaded 
>>> and executed in a completely isolated classloader, sharing only the 
>>> JRE with the classloader used to load the runner. Adding a compile 
>>> dependency to junit will not help here, but there may be a better 
>>> way to avoid reflection. Any thoughts?
>>>
>>> -- 
>>> Jean-Sebastien
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
>>> For additional commands, e-mail: tuscany-dev-help@ws.apache.org
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
>> For additional commands, e-mail: tuscany-dev-help@ws.apache.org
>>
>>
>
> OK I'll take care of it then.
>

I made the changes to support Junit4 and removed all dependencies on the 
old Junit3 based SCATestCase class and the tuscany-test module. Both 
Junit3 style (extending junit.framework.TestCase) and Junit4 style 
(using junit.org.* annotations) test cases are supported.

-- 
Jean-Sebastien


---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org


Re: [sca-java-integration-branch] Moving to maven-surefire-plugin 2.3 and JUnit 4.2

Posted by Jean-Sebastien Delfino <js...@apache.org>.
Raymond Feng wrote:
> Hi,
>
> OK. I understand it's used for isolation purposes now. I'm busy fixing 
> a build break now, would you please add the support for @Test, 
> @Before, @After, @BeforeClass and @AfterClass for JUnit 4.x using 
> reflections :-)?
>
> Thanks,
> Raymond
>
> ----- Original Message ----- From: "Jean-Sebastien Delfino" 
> <js...@apache.org>
> To: <tu...@ws.apache.org>
> Sent: Thursday, March 08, 2007 11:44 AM
> Subject: Re: [sca-java-integration-branch] Moving to 
> maven-surefire-plugin 2.3 and JUnit 4.2
>
>
>> [snip]
>> Raymond Feng wrote:
>>> 2) When I try to port the SCATestCaseRunner to support JUnit 4.x 
>>> annotations, I found it fairly cumbersome to use java reflection to 
>>> access org.junit.* classes and annotations. Can we add JUnit as a 
>>> compile time dependency? If we don't like to have it in the core, 
>>> maybe we should keep it in the "tuscany-test" module.
>>>
>>> Thanks,
>>> Raymond
>>>
>>
>> The runner is using reflection to allow the test case to be loaded 
>> and executed in a completely isolated classloader, sharing only the 
>> JRE with the classloader used to load the runner. Adding a compile 
>> dependency to junit will not help here, but there may be a better way 
>> to avoid reflection. Any thoughts?
>>
>> -- 
>> Jean-Sebastien
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
>> For additional commands, e-mail: tuscany-dev-help@ws.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: tuscany-dev-help@ws.apache.org
>
>

OK I'll take care of it then.

-- 
Jean-Sebastien


---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org


Re: [sca-java-integration-branch] Moving to maven-surefire-plugin 2.3 and JUnit 4.2

Posted by Raymond Feng <en...@gmail.com>.
Hi,

OK. I understand it's used for isolation purposes now. I'm busy fixing a 
build break now, would you please add the support for @Test, @Before, 
@After, @BeforeClass and @AfterClass for JUnit 4.x using reflections :-)?

Thanks,
Raymond

----- Original Message ----- 
From: "Jean-Sebastien Delfino" <js...@apache.org>
To: <tu...@ws.apache.org>
Sent: Thursday, March 08, 2007 11:44 AM
Subject: Re: [sca-java-integration-branch] Moving to maven-surefire-plugin 
2.3 and JUnit 4.2


> [snip]
> Raymond Feng wrote:
>> 2) When I try to port the SCATestCaseRunner to support JUnit 4.x 
>> annotations, I found it fairly cumbersome to use java reflection to 
>> access org.junit.* classes and annotations. Can we add JUnit as a compile 
>> time dependency? If we don't like to have it in the core, maybe we should 
>> keep it in the "tuscany-test" module.
>>
>> Thanks,
>> Raymond
>>
>
> The runner is using reflection to allow the test case to be loaded and 
> executed in a completely isolated classloader, sharing only the JRE with 
> the classloader used to load the runner. Adding a compile dependency to 
> junit will not help here, but there may be a better way to avoid 
> reflection. Any thoughts?
>
> -- 
> Jean-Sebastien
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: tuscany-dev-help@ws.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org


Re: [sca-java-integration-branch] Moving to maven-surefire-plugin 2.3 and JUnit 4.2

Posted by Jean-Sebastien Delfino <js...@apache.org>.
[snip]
Raymond Feng wrote:
> 2) When I try to port the SCATestCaseRunner to support JUnit 4.x 
> annotations, I found it fairly cumbersome to use java reflection to 
> access org.junit.* classes and annotations. Can we add JUnit as a 
> compile time dependency? If we don't like to have it in the core, 
> maybe we should keep it in the "tuscany-test" module.
>
> Thanks,
> Raymond
>

The runner is using reflection to allow the test case to be loaded and 
executed in a completely isolated classloader, sharing only the JRE with 
the classloader used to load the runner. Adding a compile dependency to 
junit will not help here, but there may be a better way to avoid 
reflection. Any thoughts?

-- 
Jean-Sebastien


---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org


Re: [sca-java-integration-branch] Moving to maven-surefire-plugin 2.3 and JUnit 4.2

Posted by Raymond Feng <en...@gmail.com>.
Hi,

I have checked in the changes.

To Sebastien's questions:

1) Yes, we can start to take advantage of @BeforeClass, @AfterClass 
annotations. But don't forget to fix the memory leaks :-).

2) When I try to port the SCATestCaseRunner to support JUnit 4.x 
annotations, I found it fairly cumbersome to use java reflection to access 
org.junit.* classes and annotations. Can we add JUnit as a compile time 
dependency? If we don't like to have it in the core, maybe we should keep it 
in the "tuscany-test" module.

Thanks,
Raymond

----- Original Message ----- 
From: "Jean-Sebastien Delfino" <js...@apache.org>
To: <tu...@ws.apache.org>
Sent: Wednesday, March 07, 2007 7:56 PM
Subject: Re: [sca-java-integration-branch] Moving to maven-surefire-plugin 
2.3 and JUnit 4.2


> Luciano Resende wrote:
>> +1, Thanks for volunteering !
>>
>> On 3/7/07, Raymond Feng <en...@gmail.com> wrote:
>>>
>>> Hi,
>>>
>>> With the release of maven-surefire-plugin 2.3, we can now run JUnit 
>>> 4.xtest cases under maven. I plan to update
>>> pom.xml(s) in the sca-java-integration branch to take advantage of this
>>> capability. I have run the full top-down build and everything looks 
>>> good.
>>>
>>> Please let me know if you have any concerns.
>>>
>>> Thanks,
>>> Raymond
>>
>>
>>
>>
>
> +1 from me.
>
> A side comment, this will give us the ability to init a single runtime 
> instance in a method annotated with a Junit @BeforeClass annotation and 
> reuse it across multiple test methods. I think it will be interesting for 
> integration tests in particular.
>
> Raymond, are you going to also adjust the SCATestCaseRunner utility class 
> to support JUnit4 test cases? or I can help port that class if you prefer, 
> let me know.
>
> -- 
> Jean-Sebastien
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: tuscany-dev-help@ws.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org


Re: [sca-java-integration-branch] Moving to maven-surefire-plugin 2.3 and JUnit 4.2

Posted by Jean-Sebastien Delfino <js...@apache.org>.
Luciano Resende wrote:
> +1, Thanks for volunteering !
>
> On 3/7/07, Raymond Feng <en...@gmail.com> wrote:
>>
>> Hi,
>>
>> With the release of maven-surefire-plugin 2.3, we can now run JUnit 
>> 4.xtest cases under maven. I plan to update
>> pom.xml(s) in the sca-java-integration branch to take advantage of this
>> capability. I have run the full top-down build and everything looks 
>> good.
>>
>> Please let me know if you have any concerns.
>>
>> Thanks,
>> Raymond
>
>
>
>

+1 from me.

A side comment, this will give us the ability to init a single runtime 
instance in a method annotated with a Junit @BeforeClass annotation and 
reuse it across multiple test methods. I think it will be interesting 
for integration tests in particular.

Raymond, are you going to also adjust the SCATestCaseRunner utility 
class to support JUnit4 test cases? or I can help port that class if you 
prefer, let me know.

-- 
Jean-Sebastien


---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org


Re: [sca-java-integration-branch] Moving to maven-surefire-plugin 2.3 and JUnit 4.2

Posted by Luciano Resende <lu...@gmail.com>.
+1, Thanks for volunteering !

On 3/7/07, Raymond Feng <en...@gmail.com> wrote:
>
> Hi,
>
> With the release of maven-surefire-plugin 2.3, we can now run JUnit 4.xtest cases under maven. I plan to update
> pom.xml(s) in the sca-java-integration branch to take advantage of this
> capability. I have run the full top-down build and everything looks good.
>
> Please let me know if you have any concerns.
>
> Thanks,
> Raymond




-- 
Luciano Resende
http://people.apache.org/~lresende