Posted In: Testing

TestNG eclipse plugin

   

Read More

by , on August 21st, 2017

Posted In: Hamcrest, Junit, Testing

How to create own custom Hamcrest matcher using TypeSafeMatcher

Usecase – Create own custom Hamcrest matcher using TypeSafeMatcher Hamcrest 1.3 Classes used from Hamcrest org.hamcrest.Description org.hamcrest.TypeSafeMatcher Custom substring matcher Custom sublist matcher Custom matcher test

Read More

by , on August 21st, 2017

Posted In: Hamcrest, Junit, Testing

How to unit test String output – JUnit + Hamcrest

Usecase – You need to unit test String output. Hamcrest library may be useful to achieve that. Hamcrest 1.3 Classes used from Hamcrest org.hamcrest.CoreMatchers.allOf org.hamcrest.CoreMatchers.anyOf Using ErrorCollector so that execution continues even if assert statement fails.

Read More

by , on August 18th, 2017

Posted In: Hamcrest, Junit, Testing

How to unit test list is empty – JUnit + Hamcrest

Usecase – You need to unit test if list is empty. Hamcrest library may be useful to achieve that Hamcrest 1.3 Classes used from Hamcrest org.hamcrest.collection.IsCollectionWithSize org.hamcrest.number.OrderingComparison Using ErrorCollector so that execution continues even if assert statement fails.

Read More

by , on August 18th, 2017

Posted In: Hamcrest, Junit, Testing

How to unit test XML – JUnit + Hamcrest

Usecase – You need to unit test XML output and write multiple scenarios to test the data. Hamcrest library may be useful to achieve that Hamcrest XPATH Matchers Hamcrest 1.3 Classes used from Hamcrest import org.hamcrest.xml.HasXPath Using ErrorCollector so that execution continues even if assert statement fails.

Read More

by , on August 17th, 2017

Posted In: Hamcrest, Junit, Testing

Hamcrest – containsInAnyOrder syntax

Sample using Hamcrest shows following way to use the code So I expected even following should be possible. This code does not work as is. Hamcrest 1.3 Classes used from Hamcrest import org.hamcrest.collection.IsIterableContainingInAnyOrder; Using ErrorCollector so that execution continues even if assert statement fails. Output

Read More

by , on August 17th, 2017

Posted In: Hamcrest, Junit, Testing

How to unit test a date – JUnit + Hamcrest

Usecase – You need to unit test Date output and write multiple scenarios to test the data. Hamcrest library may be useful to achieve that Hamcrest Date Matchers Hamcrest 1.3 Classes used from Hamcrest import org.hamcrest.number.OrderingComparison; Using ErrorCollector so that execution continues even if assert statement fails. Output

Read More

Tags: ,

by , on August 13th, 2017

Posted In: Hamcrest, Junit, Testing

How to unit test a Map – JUnit + Hamcrest

Usecase – You need to unit test Map output and write multiple scenarios to test the data. Hamcrest library may be useful to achieve that Hamcrest 1.3 Classes used from Hamcrest org.hamcrest.collection.IsIn; org.hamcrest.collection.IsMapContaining; Using ErrorCollector so that execution continues even if assert statement fails. Output

Read More

Tags:

by , on August 12th, 2017

Posted In: Hamcrest, Junit, Testing

How to unit test a Integer array – JUnit + Hamcrest

Usecase – You need to unit test Integer array output and write multiple scenarios to test the data. Hamcrest library may be useful to achieve that Hamcrest 1.3 Classes used from Hamcrest org.hamcrest.collection.IsArray; org.hamcrest.collection.IsArrayContaining; org.junit.rules.ErrorCollector; Using ErrorCollector so that execution continues even if assert statement fails. Output

Read More

Tags:

by , on August 12th, 2017

Posted In: Hamcrest, Junit, Testing

How to unit test a string array – JUnit + Hamcrest

Usecase – You need to unit test string array output and write multiple scenarios to test the data. Hamcrest library may be useful to achieve that Hamcrest 1.3 Classes used from Hamcrest org.hamcrest.collection.IsArray; org.hamcrest.collection.IsArrayContaining; org.junit.rules.ErrorCollector; Using ErrorCollector so that execution continues even if assert statement fails. Output

Read More

Tags:

by , on August 12th, 2017

  • Categories