Results 1 to 7 of 7

Thread: Junit

  1. #1
    Azndaddy is offline Member
    Join Date
    Mar 2008
    Posts
    24
    Rep Power
    0

  2. #2
    CaptainMorgan's Avatar
    CaptainMorgan is offline Moderator
    Join Date
    Dec 2007
    Location
    NewEngland, US
    Posts
    835
    Rep Power
    8

    Default

    Well, what do you have so far?
    Vote for the new slogan to our beloved Java Forums! (closes on September 4, 2008)
    Want to voice your opinion on your IDE/Editor of choice? Vote now!
    Got a little Capt'n in you? (drink responsibly)

  3. #3
    Azndaddy is offline Member
    Join Date
    Mar 2008
    Posts
    24
    Rep Power
    0

    Default

    My Whole Assignment works fine, but need to create a Junit for it to test each classes.

    Here is two example classes that i have which are part of my assignment
    PHP Code:
    public class Close extends Commands
    {
        private int currentBufferIndex;
        
        public Close(Editor editor)
        {
            super("close", editor);    
        }
        
        public void execute()
        {
            editor.deleteCurrentBuffer();
        }
    }
    and another class is

    PHP Code:
    public class Quit extends Commands
    {
        public Quit(Editor editor)
        {
            super("quit", editor);    
        }
        
        public void execute()
        {
            System.out.println("Bye!");
            System.exit(0);
        }
    }
    how would i create a Junit for them?

    I have only done the following code
    import junit.framework.*;
    public class Junit
    {

    }


    Thanks heaps

  4. #4
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    19

  5. #5
    Azndaddy is offline Member
    Join Date
    Mar 2008
    Posts
    24
    Rep Power
    0

    Default

    thanks, i'll have a look into it

  6. #6
    ferranb is offline Member
    Join Date
    Jun 2008
    Posts
    22
    Rep Power
    0

    Default

    With eclipse and JUnit plugging for eclispe all will be easyer. It helps to code JUnit tests.

    Ferran

  7. #7
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    19

Similar Threads

  1. Testing JUnit PDE with Ant
    By keynan in forum Eclipse
    Replies: 0
    Last Post: 02-14-2008, 11:35 PM
  2. Using Junit In Eclipse
    By JavaForums in forum Eclipse
    Replies: 0
    Last Post: 05-06-2007, 03:41 PM
  3. TRying to use jUnit for Tesing
    By sandor in forum New To Java
    Replies: 3
    Last Post: 04-18-2007, 11:17 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •