3:31 pm - Saturday January 21, 2017

Author Archives: Mathan Lal

JUNIT Test Suit

Test suite Test suite means bundle a few unit test cases and run it together. In Junit both @RunWith and @Suite annotation are used to run the suite test. Example: 1.)import org.junit.*; import static org.junit.Assert.*; import java.util.*; public...

Testing Parameterized method with JUNIT

PARAMETERIZED TEST Parameterized tests allow developer to run the same test over and over again different values. The expected parameter is used along with @Test annotation likeĀ @Test(expected)in action. There are five steps, a. Annotate test...

Testing final Method with JUNIT

testing final method BACK

Testing final variable with JUNIT

testing final variable BACK

Testing static Function with JUNIT

testing static function BACK

Testing void Function with JUNIT

testing void function BACK

Testing Exception with JUNIT

Testing Exception with Junit This tutorial will explain the how to check the expected exception throws in a function. The expected parameter is used along with @Test annotation likeĀ @Test(expected)in action. Example:Jex.java: import org.junit.Test; import...

Assert Example with JUNIT

JUnit Assertion All the assertion are in the Assert class. Public class Assert extends java.lang.Object. This class provides a set of assertion methods useful for writing tests. Assertion Methods are, 1. assertEqual(expected output,actual output), 2.assertTrue(boolean...

JUNIT example with @Test annotation

test anotation BACK

Getting started example with JUNIT

example BACK

List of annotation used in JUNIT 4

annotation list BACK

JUNIT Jar download

jar download BACK

Advantages of JUNIT ?

advantages BACK

What is JUNIT?

junit BACK

Junit Tutorial Programs

What is JUNIT? Advantages of JUNIT ? JUNIT Jar download List of annotation used in JUNIT 4 Getting started example with JUNIT JUNIT example with @Test annotation Assert Example with JUNIT Testing Exception with JUNIT Testing void Function with...

HashSet example program for boolean addAll(Collection c)

/** @Description : HashSet example program for boolean contains(Object o) @Author : candidjava.com */ import java.util.HashSet; public class hshst { public static void main(String[] args) { HashSet myset = new HashSet(); myset.add("Learning"); myset.add("Easy"); myset.add("Simply"); boolean...

HashSet example program for Iterator iterator()

/** *@author:candidjava.com *@description:HastSet example program for Iterator iterator() */ import java.util.HashSet; import java.util.Iterator; public class HastSetIterator { public static void main(String args[])...

HashSet example program for boolean isEmpty()

/** @Description : HashSet example program for boolean isEmpty() @Author : candidjava.com */ import java.util.HashSet; public class hshst { public static void main(String[] arg) { HashSet newset = new HashSet(); newset.add("Hai"); newset.add("idiot"); newset.add("Bye"); boolean...

HashSet example program for Object clone()

/** *@author:candidjava.com *@description:Hashset example program for Object Clone() */ import java.util.HashSet; public class HashSetClone { public static void main(String args[]) { HashSet newset = new HashSet(); //...

FileOutputStream example program for write(int b) () in java

/** *@author: candidjava *@description: FileOutputStream example program for write(int b)() in java **/ import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; public class FileOutputStreamDemo1...