You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "Konstantin Boudnik (JIRA)" <ji...@apache.org> on 2009/07/22 22:09:14 UTC

[jira] Created: (AVRO-81) Switch Avro's tests back to JUnit from current TestNG framework

Switch Avro's tests back to JUnit from current TestNG framework
---------------------------------------------------------------

                 Key: AVRO-81
                 URL: https://issues.apache.org/jira/browse/AVRO-81
             Project: Avro
          Issue Type: Test
            Reporter: Konstantin Boudnik
            Assignee: Konstantin Boudnik


This issue has been opened in order to track possible future switch of testing framework for Avro. Currently it is based on TestNG, however because of a number of limitations this test framework is not likely to be used by any of Hadoop's subproject. Thus, Avro will have to be start using JUnit again. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (AVRO-81) Switch Avro's tests back to JUnit from current TestNG framework

Posted by "Thiruvalluvan M. G. (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AVRO-81?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Thiruvalluvan M. G. updated AVRO-81:
------------------------------------

    Attachment: AVRO-81.patch

This is the modified version of the patch by Konstantin. This fixes the problem reported by him. The trouble was testng can distinguish between arrays and scalars in assertEquals() and do the right thing. JUnit requires you to call assertArrayEquals() explicitly for arrays.

Now those tests pass. Still I see three errors in TestInvocationReporter, TestOutputInterceptor and TestSuiteInterceptor.

I've noticed the following (all of them subtle, not serious):

   - The classes from from both Junit4 and Junit3 are used. Junit3 package names start with "junit" and Junit4 package names with "org.junit". Though they seem to work together, it's better to stick to one version.
   - The order of arguments for assertEquals() is different from Testng and Junit. In junit, the first argument is the expected value and for testng it is the actual. Again, there is no harm if we use the wrong order because, after all, it checks for equality. But the error messages will be confusing.
   - The fields of parametrized test classes, it is possible to make the input fields final.

I've fixed these for tests in avro.io package. Other packages may have these.

I saw some opportunities, in Junit context, to refactor and reduce test code for avro.io package. I'll take that up once conversion to Junit is over.

> Switch Avro's tests back to JUnit from current TestNG framework
> ---------------------------------------------------------------
>
>                 Key: AVRO-81
>                 URL: https://issues.apache.org/jira/browse/AVRO-81
>             Project: Avro
>          Issue Type: Test
>            Reporter: Konstantin Boudnik
>            Assignee: Konstantin Boudnik
>         Attachments: AVRO-81.patch, AVRO-81.patch
>
>
> This issue has been opened in order to track possible future switch of testing framework for Avro. Currently it is based on TestNG, however because of a number of limitations this test framework is not likely to be used by any of Hadoop's subproject. Thus, Avro will have to be start using JUnit again. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (AVRO-81) Switch Avro's tests back to JUnit from current TestNG framework

Posted by "Konstantin Boudnik (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AVRO-81?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Konstantin Boudnik updated AVRO-81:
-----------------------------------

    Attachment: AVRO-81.patch
                AVRO-81.sh

Thanks for noticing this issue with array comparison - I really appreciate it: I've kinda stuck there.

- all JUnit3 references are removed
- all *Interceptors should be deleted (the script will take care about it)
- finals for the class members make a lot of sense.

Updated patch is attached: everything passes now.

> Switch Avro's tests back to JUnit from current TestNG framework
> ---------------------------------------------------------------
>
>                 Key: AVRO-81
>                 URL: https://issues.apache.org/jira/browse/AVRO-81
>             Project: Avro
>          Issue Type: Test
>            Reporter: Konstantin Boudnik
>            Assignee: Konstantin Boudnik
>         Attachments: AVRO-81.patch, AVRO-81.patch, AVRO-81.patch, AVRO-81.sh
>
>
> This issue has been opened in order to track possible future switch of testing framework for Avro. Currently it is based on TestNG, however because of a number of limitations this test framework is not likely to be used by any of Hadoop's subproject. Thus, Avro will have to be start using JUnit again. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (AVRO-81) Switch Avro's tests back to JUnit from current TestNG framework

Posted by "Doug Cutting (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AVRO-81?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Doug Cutting resolved AVRO-81.
------------------------------

       Resolution: Fixed
    Fix Version/s: 1.0.1

I just committed this.  Thanks, Konstantin!

> Switch Avro's tests back to JUnit from current TestNG framework
> ---------------------------------------------------------------
>
>                 Key: AVRO-81
>                 URL: https://issues.apache.org/jira/browse/AVRO-81
>             Project: Avro
>          Issue Type: Test
>            Reporter: Konstantin Boudnik
>            Assignee: Konstantin Boudnik
>             Fix For: 1.0.1
>
>         Attachments: AVRO-81.patch, AVRO-81.patch, AVRO-81.patch, AVRO-81.patch, AVRO-81.sh
>
>
> This issue has been opened in order to track possible future switch of testing framework for Avro. Currently it is based on TestNG, however because of a number of limitations this test framework is not likely to be used by any of Hadoop's subproject. Thus, Avro will have to be start using JUnit again. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (AVRO-81) Switch Avro's tests back to JUnit from current TestNG framework

Posted by "Konstantin Boudnik (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AVRO-81?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Konstantin Boudnik updated AVRO-81:
-----------------------------------

    Attachment: AVRO-81.patch

This patch takes care about reverse conversion of the tests to JUnit framework. 
However, the following problem has been found and I haven't find the explanation yet:
  - in TestValidatingIO 81 out of 960 are failing with messages like this
{noformat}
Testcase: testMain[8] took 0.004 sec
        FAILED
expected:<[B...@17cd7867> but was:<[B...@329bbe66>
junit.framework.AssertionFailedError: expected:<[B...@17cd7867> but was:<[B...@329bbe66>
        at org.apache.avro.io.TestValidatingIO.check(TestValidatingIO.java:377)
        at org.apache.avro.io.TestValidatingIO.check(TestValidatingIO.java:308)
        at org.apache.avro.io.TestValidatingIO.testOnce(TestValidatingIO.java:71)
        at org.apache.avro.io.TestValidatingIO.testMain(TestValidatingIO.java:61)
{noformat}

Also, an extra test class TestResolvingIO_resolving has been created to workaround the limitations of JUnit @Parameters solution, i.e. you can't have more than one data provider per test class.


> Switch Avro's tests back to JUnit from current TestNG framework
> ---------------------------------------------------------------
>
>                 Key: AVRO-81
>                 URL: https://issues.apache.org/jira/browse/AVRO-81
>             Project: Avro
>          Issue Type: Test
>            Reporter: Konstantin Boudnik
>            Assignee: Konstantin Boudnik
>         Attachments: AVRO-81.patch
>
>
> This issue has been opened in order to track possible future switch of testing framework for Avro. Currently it is based on TestNG, however because of a number of limitations this test framework is not likely to be used by any of Hadoop's subproject. Thus, Avro will have to be start using JUnit again. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (AVRO-81) Switch Avro's tests back to JUnit from current TestNG framework

Posted by "Konstantin Boudnik (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AVRO-81?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Konstantin Boudnik updated AVRO-81:
-----------------------------------

    Attachment:     (was: AVRO-81.patch)

> Switch Avro's tests back to JUnit from current TestNG framework
> ---------------------------------------------------------------
>
>                 Key: AVRO-81
>                 URL: https://issues.apache.org/jira/browse/AVRO-81
>             Project: Avro
>          Issue Type: Test
>            Reporter: Konstantin Boudnik
>            Assignee: Konstantin Boudnik
>         Attachments: AVRO-81.patch, AVRO-81.patch, AVRO-81.patch, AVRO-81.patch, AVRO-81.sh
>
>
> This issue has been opened in order to track possible future switch of testing framework for Avro. Currently it is based on TestNG, however because of a number of limitations this test framework is not likely to be used by any of Hadoop's subproject. Thus, Avro will have to be start using JUnit again. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (AVRO-81) Switch Avro's tests back to JUnit from current TestNG framework

Posted by "Konstantin Boudnik (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AVRO-81?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Konstantin Boudnik updated AVRO-81:
-----------------------------------

    Attachment: AVRO-81.patch

- White space issues are fixed - my IDE keeps removing white spaces in the empty lines (which seems to be a sane thing to do, but creates these unnecessary modifications)
- new macrodef has been introduced for junit task and all other test related targets are just setting needed arguments. This allow to eliminate a good chunk of duplicated code

> Switch Avro's tests back to JUnit from current TestNG framework
> ---------------------------------------------------------------
>
>                 Key: AVRO-81
>                 URL: https://issues.apache.org/jira/browse/AVRO-81
>             Project: Avro
>          Issue Type: Test
>            Reporter: Konstantin Boudnik
>            Assignee: Konstantin Boudnik
>         Attachments: AVRO-81.patch, AVRO-81.patch, AVRO-81.patch, AVRO-81.patch, AVRO-81.sh
>
>
> This issue has been opened in order to track possible future switch of testing framework for Avro. Currently it is based on TestNG, however because of a number of limitations this test framework is not likely to be used by any of Hadoop's subproject. Thus, Avro will have to be start using JUnit again. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (AVRO-81) Switch Avro's tests back to JUnit from current TestNG framework

Posted by "Konstantin Boudnik (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AVRO-81?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Konstantin Boudnik updated AVRO-81:
-----------------------------------

    Attachment: AVRO-81.patch

> Switch Avro's tests back to JUnit from current TestNG framework
> ---------------------------------------------------------------
>
>                 Key: AVRO-81
>                 URL: https://issues.apache.org/jira/browse/AVRO-81
>             Project: Avro
>          Issue Type: Test
>            Reporter: Konstantin Boudnik
>            Assignee: Konstantin Boudnik
>         Attachments: AVRO-81.patch, AVRO-81.patch, AVRO-81.patch, AVRO-81.patch, AVRO-81.sh
>
>
> This issue has been opened in order to track possible future switch of testing framework for Avro. Currently it is based on TestNG, however because of a number of limitations this test framework is not likely to be used by any of Hadoop's subproject. Thus, Avro will have to be start using JUnit again. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AVRO-81) Switch Avro's tests back to JUnit from current TestNG framework

Posted by "Doug Cutting (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AVRO-81?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12735760#action_12735760 ] 

Doug Cutting commented on AVRO-81:
----------------------------------

This is looking good.  A few problems remain:
 - Build.xml has not been completely updated: the interop tests still use TestNG.
 - The patch contains a number of whitespace-only changes.  Can you please remove these?
 - The patch comments out obsolete code in a few places.  It should simply remove obsolete code.  This is in build.xml and TestResolvingIO.


> Switch Avro's tests back to JUnit from current TestNG framework
> ---------------------------------------------------------------
>
>                 Key: AVRO-81
>                 URL: https://issues.apache.org/jira/browse/AVRO-81
>             Project: Avro
>          Issue Type: Test
>            Reporter: Konstantin Boudnik
>            Assignee: Konstantin Boudnik
>         Attachments: AVRO-81.patch, AVRO-81.patch, AVRO-81.patch, AVRO-81.sh
>
>
> This issue has been opened in order to track possible future switch of testing framework for Avro. Currently it is based on TestNG, however because of a number of limitations this test framework is not likely to be used by any of Hadoop's subproject. Thus, Avro will have to be start using JUnit again. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.