This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 113144

Summary: regeneration not working on the first try
Product: javame Reporter: luky <luky>
Component: JUnitAssignee: luky <luky>
Status: VERIFIED DUPLICATE    
Severity: blocker    
Priority: P3    
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:

Description luky 2007-08-18 09:52:27 UTC
When you add a method to the class you want to test and try to regenerate junit chnages (new method) is not generated 
on the first attempt, you must try to regenerate twice to get the corect result

Steps:
1) Create junit test from a class
2) Add a method to the class
3) try to create test again (regenerate) - nothing happens
4) try to create test again (regenerate) - new method is added to the test
Comment 1 luky 2007-08-22 17:06:04 UTC
Fixed. Pretty big fix, should be tested properly. generation of startUp and tearDown should work as well
Comment 2 luky 2007-08-22 17:07:13 UTC
forgot to mark it as fixed
Comment 3 Lukas Hasik 2007-09-05 16:34:57 UTC
seems that it works but the generated code is strange

-the default is everywhere in switch and the generated test method...
<generated code>

    /*
     * /*Test of testLukasovaNovaMetoda method, of class DifferentReturnTypes.*/ */ public void testLukasovaNovaMetoda()
throws AssertionFailedException {
        System.out.println("LukasovaNovaMetoda");
        DifferentReturnTypes instance = new DifferentReturnTypes();
        instance.LukasovaNovaMetoda();
        fail("The test case is a prototype.");
    }


    public void test(int testNumber) throws Throwable {
        switch (testNumber) {
            default:
        testDoubleMethod();
                break;
            default:
        testShortMethod();
                break;
            default:
        testFloatMethod();
                break;
            default:
        testIntegerMethod();
                break;
            default:
        testBooleanMethod();
                break;
            default:
        testByteMethod();
                break;
            default:
        testLukasovaNovaMetoda();
                break;
            default:
        testVoidMethod();
                break;
            default:
        testIntMethod();
                break;
            default:
        testObjectMethod();
                break;
            default:
        testLongMethod();
                break;
            default:
        testStringMethod();
                break;
            default:
        testCharMethod();
                break;
            default:
        testIntArrayMethod();
                break;
            default:
        testAJesteNovejsiMetoda();
                break;
            default:
                break;
        }
    }    

</generated code>
Comment 4 luky 2007-09-05 16:38:53 UTC
Known behaviour, problem is in retouche. They have an P2 issue opened for that

*** This issue has been marked as a duplicate of 113313 ***
Comment 5 Ivan Sidorkin 2008-09-26 11:13:33 UTC
verified duplicate