Skip to Main Content

Java APIs

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Noob question in JUnit.

843810Jun 18 2010 — edited Jun 18 2010
Hello all.
Starts to use JUnit in NetBeans 5.5. But can`t understand how it works.
Have such simple code:
/**
     * Test of isCloseTime method, of class stInterface.TestSettings.
     */
    public void testIsCloseTime() {
        System.out.println("isCloseTime");
        
        boolean expResult = true;
        boolean result = true;
        assertEquals(expResult, result);
        
        // TODO review the generated test code and remove the default call to fail.
        fail(expResult + " is not equal " + result);
    }
The push Alt+F6 for test starting and get:
true is not equal true
junit.framework.assertionFailedError

Please, expalain me, what I have done wrong?

Comments

Processing
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Jul 16 2010
Added on Jun 18 2010
1 comment
224 views