I have started implementing the test framework using TestNG. Initial code
is available at carbon/core/integration/framework


On Wed, Dec 14, 2011 at 10:36 AM, Afkham Azeez <az...@wso2.com> wrote:

>
>
> On Wed, Dec 14, 2011 at 6:49 AM, Srinath Perera <srin...@wso2.com> wrote:
>
>> Hi Azeez,
>>
>> Are we doing this within the stabilization effort or after?
>>
>> I am +1 on overall, but bit concerned should we start this right now.
>>
>
> There can be no concern because the JUnit tests we have right now are
> difficult to run consistently. We have built somewhat of a framework by
> extending JUnit but JUnit is not very extensible because many of its key
> methods are static. I think we should start with this right now. For the
> moment, we can have the build systems running while the test migration
> effort continues.
>
>>
>> --Srinath
>>
>> On Tue, Dec 13, 2011 at 8:15 PM, Afkham Azeez <az...@wso2.com> wrote:
>> > Let me give you a concrete example of how this will make testing very
>> easy
>> > in our products.
>> >
>> > Before running any tests, we need to extract the binaries, copy
>> artifacts,
>> > then start the Carbon servers. Next we need the tests to run and finally
>> > shutdown the servers. This is very difficult to do with JUnit in a
>> > straightforward manner. This is the reason why different product teams
>> have
>> > incorporated various hacks to do this. With TestNG it is very simple.
>> >
>> > We will have a StartupUtil as follows;
>> >
>> > public class StartupUtil {
>> >
>> >     @BeforeGroups(value = {"appserver", "esb"})
>> >     public void startup(){
>> >           extractBinaries();
>> >           copyArtifacts();
>> >           startServers();
>> >      }
>> >
>> >     @AfterGroups(value = "appserver", "esb")
>> >     public void shutdown(){
>> >         stopServers();
>> >      }
>> > }
>> >
>> >
>> > Our test classes will look like the following.
>> >
>> >
>> > public class TestNGSimpleTest {
>> >     int testInt;
>> >
>> >     @BeforeSuite
>> >     public void beforeSuite(){
>> >         System.out.println("Before suite");
>> >     }
>> >
>> >     @AfterSuite
>> >     public void afterSuite(){
>> >         System.out.println("After suite");
>> >     }
>> >
>> >     @BeforeMethod
>> >     public void setUp() {
>> >         testInt = 0;
>> >         System.out.println("=========>" +
>> > System.getProperty("sec.verifier.dir"));
>> >     }
>> >
>> >     @AfterMethod
>> >     public void tearDown() {
>> >         testInt = 0;
>> >         System.out.println("=========>" +
>> > System.getProperty("sec.verifier.dir"));
>> >     }
>> >
>> >     @Test(groups = {"appserver"})
>> >     public void addTest() {
>> >         testInt++;
>> >         assert testInt == 1;
>> >         System.out.println("add test");
>> >     }
>> >
>> >     @Test(groups = {"appserver"})
>> >     public void subtractTest() {
>> >         testInt--;
>> >         assert testInt == -1;
>> >         System.out.println("subtract test");
>> >     }
>> > }
>> >
>> >
>> > Take note of the groups concepts & BeforeGroups/AfterGroups
>> annotations. We
>> > may need a week's worth of effort to migrate all our tests but it will
>> be
>> > well worth the effort.
>> >
>> > If there are no objections, I can start implementing this for
>> > carbon/core/integration.
>> >
>> >
>> >
>> > On Tue, Dec 13, 2011 at 7:56 PM, Afkham Azeez <az...@wso2.com> wrote:
>> >>
>> >> Folks,
>> >> I was playing around a bit with TestNG
>> >> (http://testng.org/doc/documentation-main.html#introduction) & it
>> seems to
>> >> be the way to go for the type of integration testing we are doing.
>> This may
>> >> involve major changes at the platform testing level but will be worth
>> the
>> >> investment.
>> >>
>> >> Here are some articles that compare TestNG with JUnit4. We are using
>> JUnit
>> >> 3.
>> >>
>> >> http://www.mkyong.com/unittest/junit-4-vs-testng-comparison/
>> >> http://nelz.net/2010/10/06/testng-vs-junit4/
>> >>
>> >> I had a chat with Krishantha & he too agrees that TestNG is more
>> suitable
>> >> for the type of test automation we do. Does anybody have any concerns
>> >> regarding this move?
>> >>
>> >> --
>> >> Afkham Azeez
>> >> Director of Architecture; WSO2, Inc.; http://wso2.com
>> >> Member; Apache Software Foundation; http://www.apache.org/
>> >>
>> >> email: az...@wso2.com cell: +94 77 3320919
>> >> blog: http://blog.afkham.org
>> >> twitter: http://twitter.com/afkham_azeez
>> >> linked-in: http://lk.linkedin.com/in/afkhamazeez
>> >>
>> >> Lean . Enterprise . Middleware
>> >>
>> >
>> >
>> >
>> > --
>> > Afkham Azeez
>> > Director of Architecture; WSO2, Inc.; http://wso2.com
>> > Member; Apache Software Foundation; http://www.apache.org/
>> >
>> > email: az...@wso2.com cell: +94 77 3320919
>> > blog: http://blog.afkham.org
>> > twitter: http://twitter.com/afkham_azeez
>> > linked-in: http://lk.linkedin.com/in/afkhamazeez
>> >
>> > Lean . Enterprise . Middleware
>> >
>> >
>> > _______________________________________________
>> > Architecture mailing list
>> > architect...@wso2.org
>> > https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
>> >
>>
>>
>>
>> --
>> ============================
>> Srinath Perera, Ph.D.
>>    http://www.cs.indiana.edu/~hperera/
>>    http://srinathsview.blogspot.com/
>> _______________________________________________
>> Architecture mailing list
>> architect...@wso2.org
>> https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
>>
>
>
>
> --
> *Afkham Azeez*
> Director of Architecture; WSO2, Inc.; http://wso2.com
> Member; Apache Software Foundation; http://www.apache.org/
> * <http://www.apache.org/>**
> email: **az...@wso2.com* <az...@wso2.com>* cell: +94 77 3320919
> blog: **http://blog.afkham.org* <http://blog.afkham.org>*
> twitter: **http://twitter.com/afkham_azeez*<http://twitter.com/afkham_azeez>
> *
> linked-in: **http://lk.linkedin.com/in/afkhamazeez*
> *
> *
> *Lean . Enterprise . Middleware*
>
>


-- 
*Afkham Azeez*
Director of Architecture; WSO2, Inc.; http://wso2.com
Member; Apache Software Foundation; http://www.apache.org/
* <http://www.apache.org/>**
email: **az...@wso2.com* <az...@wso2.com>* cell: +94 77 3320919
blog: **http://blog.afkham.org* <http://blog.afkham.org>*
twitter: **http://twitter.com/afkham_azeez*<http://twitter.com/afkham_azeez>
*
linked-in: **http://lk.linkedin.com/in/afkhamazeez*
*
*
*Lean . Enterprise . Middleware*
_______________________________________________
Carbon-dev mailing list
Carbon-dev@wso2.org
http://mail.wso2.org/cgi-bin/mailman/listinfo/carbon-dev

Reply via email to