SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 8 of 8
  1. #1
    Junior Member
    Join Date
    Feb 2010
    Posts
    4
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Implementing Junit Testing

    I would like to know how to go about the Junit implementation, execution and monitoring and the advantages. Detailed explanation if possible will be of help.

    The fact is we have a web based and a client server application being developed in Java technologies.

  2. #2
    Member
    Join Date
    Dec 2009
    Posts
    48
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Implementing Junit Testing

    The primary purpose of using JUnit is to accomplish code level/unit level testing.Are you trying to use it for something else like wrapping ui automation tests?Not that you can't do ,but I am trying to understand what type of testing you want to accomplish using JUnit.

  3. #3
    Junior Member
    Join Date
    Aug 2010
    Posts
    13
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Implementing Junit Testing

    you can use the eclipse which is deveplopment tool to load the junit package. and you can program by it.you can extend the junit class. for eg.
    this is tested java class:
    public class testEmailAvilable
    {
    public boolean checkEmailAdd(String emailAddr)
    { boolean isAvailable;
    Pattern pat=Pattern.compile(".*@(\\w+.)[a-z]{2,3}");
    Matcher mat=pat.matcher(emailAddr);
    isAvailable=mat.matches();
    return isAvailable;
    }
    public static void main(String args[])
    {
    boolean sign=new testEmailAvilable().checkEmailAdd("zq@163.com");
    System.out.print(sign);
    }
    }
    this is unit tesing class
    public class testEmailAvilableTest extends TestCase {
    @Before
    public void setUp() throws Exception {
    }
    @Test
    public void testCheckEmailAdd() {
    testRegex.testEmailAvilable testEmailAvilablecase=new testRegex.testEmailAvilable();
    assertEquals(false,testEmailAvilablecase.checkEmai lAdd("zq861010@163.com"));
    }
    public static void main(String args[])
    {
    junit.textui.TestRunner.run(testEmailAvilableTest. class);
    }
    }
    note:you must run it in eclipse

  4. #4
    Member
    Join Date
    Jun 2007
    Posts
    79
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Implementing Junit Testing

    I am using ABBOT with junit for GUI automation

  5. #5
    Junior Member
    Join Date
    Feb 2011
    Posts
    2
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Implementing Junit Testing

    this is stupidity

  6. #6
    Member
    Join Date
    Jan 2011
    Posts
    90
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Implementing Junit Testing

    If JUnit can be combined with Selenium, it would be possible to test the GUI.

  7. #7
    SQA Knight
    Join Date
    May 2006
    Location
    Playa Del Rey, California, United States
    Posts
    2,594
    Post Thanks / Like
    Mentioned
    17 Post(s)
    Tagged
    1 Thread(s)
    Total Downloaded
    0

    Re: Implementing Junit Testing

    If you're using eclipse, I would recommend start off by installing the Maven plugin, then add the JUnit and Mockito (a mock library) to your POM. That'll get your project setup for easy portability between workspaces.

    Like elaine mentioned, learn to use JUnit. I prefer the @Annotations over extending the TestCase class. It gives you the flexibility of extending other classes, such as Mockito. Then learn how to use Mockito's mocking functions, it makes JUnit tests so much easier to write.

    Ok.. so now onto the good stuff. Once you have your unit tests in place. You'll want to get them running in continuous integration so you can reap the benefits of good unit testing. Configure your automatic build system to compile and run the JUnit tests either on a nightly basis, or as people check in new code. It's amazing how integration becomes so much smoother when you get email notifications the moment code that breaks the unit tests are checked in so they can be fixed early.
    David Lai
    SDET / Consultant
    LinkedIn profile

  8. #8
    Junior Member
    Join Date
    Dec 2011
    Posts
    2
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Implementing Junit Testing

    Hi am using Parasoft SOA test with junit...Will it be easier for GUI testing...

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 7.89%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 09:56 PM.

Copyright BetaSoft Inc.