When we talk about unit tests, we think about input values and return values to/from methods. Returned values are checked against expected values as a way to verify behavior of codes. But how would you test codes that do not return any values? Essentially, we resort to stubbing out void methods. That is easy in Mockito!
Inheritance in Object-oriented JavaScript
Inheritance in JavaScript is called prototypal inheritance. Objects inherit from objects. When we create an object from a class, [wp_ad_camp_5]
1 2 3 4 5 6 | function MyClass() { // The class }; var myObject = new MyClass(); |
it always inherits from
1 | MyClass.prototype |
In Java speak, this is like saying “any class inherits from Object class”.
1 2 3 | public class MyClass extends Object { ... } |
Capture Argument To Method in Mockito
This post shows how to capture arguments our codes passed to a mock’s method. To do this, a method must accept reference types. Then, we use Mockito.verify() method. Then, pass an instance of ArgumentCaptor to the mock’s method. Capture Argument
Using JDK 9 with Eclipse Luna
JDK 9 works with Eclipse Mars [wp_ad_camp_5] First and foremost, Eclipse Luna does not work with JDK 9 because of JEP 220: Modular Run-Time Images. There is Eclipse Mars for that. Updating eclipse.ini to use JDK 9 JEP 220 changed
Find out if an object is a mock or spy in Mockito
The need for it [wp_ad_camp_5] Finding out if an object is a mock or spy in Mockito may not (or never) be part of your usual automated unit tests but in some cases (advanced usage of JUnit/Mockito) you may need
Using Spring @Autowired with @Qualifier
This article demonstrates how to qualify beans of the same reference type in Spring. @Qualifier enables you to select and use a particular bean from a set of beans of the same type existing in the Spring container.
How to use Spring XmlBeanFactory
XmlBeanFactory is one of Spring’s containers that provide dependency injection. Note that it has been deprecated already. This means that you should not use this in new development projects.
Arithmetic in COBOL
This article demonstrates how to perform basic arithmetic in COBOL.
How to read file in COBOL
This article presents a simple COBOL program that reads a flat (text) file, parses the content, and displays them.
Dialog Window with Validation and Error Messages using JSF and Primefaces
Background [wp_ad_camp_5] This article shows an sample Dialog window in JSF. It also showcases some basic field validation and the display of error messages. Software Environment Windows 7 Professional SP1 Eclipse – Kepler Release Java 1.7 (1.7.0_67 – Windows x86)