javacodegeeks.com

Revising the Eclipse IP Policy: Third Party Content

The Eclipse Foundation is in the process of making a major update to our Intellectual Property Policy. A big part of this update is a change in the way that we will manage third party content. In the context of the Eclipse IP Policy, “third party content” is content that is leveraged by the Eclipse open source project, but not otherwise produced or managed by an Eclipse open source project. A library produced by, say, an Apache open source project, is considered to be third party content. Today, the IP Policy requires that all third...

javacodegeeks.com

OutOfMemoryError related JVM arguments

JVM has provided helpful arguments to deal with OutOfMemoryError. In this article, we would like to highlight those JVM arguments. It might come handy for you when you are troubleshooting OutOfMemoryError. Those JVM arguments are:-XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath-XX:OnOutOfMemoryError-XX:+ExitOnOutOfMemoryError-XX:+CrashOnOutOfMemoryErrorLet’s discuss these JVM arguments in detail in this article.(1). XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPathHeap dump is basically a snapshot of memory. It contains details about objects...

javacodegeeks.com

Spring @RequestParam Annotation

Introduction:Spring @RequestParam annotation can be used to extract the query parameters in a handler method. In this quick tutorial, we’ll learn its usage.@RequestParam Annotation:Let’s first expose an API which returns a list of users with a given first name and age:@RestController public class UserController {     ...     @GetMapping("/users")     public List<User> getUsers(@RequestParam String firstName, @RequestParam int age)...

javacodegeeks.com

JUnit 5 and Selenium - Using Selenium built-in `PageFactory` to implement Page Object Pattern

Selenium is a set of tools and libraries supporting browser automation and it is mainly used for web applications testing. One of the Selenium’s components is a Selenium WebDriver that provides client library, the JSON wire protocol (protocol to communicate with the browser drivers) and browser drivers. One of the main advantages of Selenium WebDriver is that it supported by all major programming languages and it can run on all major operating systems.In this part of the JUnit 5 with Selenium WebDriver – Tutorial I will go though the...

javacodegeeks.com

Efficient enterprise testing — conclusion (6/6)

This last part of the series will cover additional end-to-end tests, testing in production, and a conclusion of the parts.Further end-to-end tests & testing in productionBesides system tests that only verify a single application-under-test and mock external concerns, our pipeline must also include full end-to-end test that verify the system as a whole. The good news is that if we’re crafting our tests in a maintainable way, with reusable components, we can recycle the test scenarios to be fired against other test or staging...

javacodegeeks.com

JEP 355 Text Blocks in JDK 13

JDK 13 went GA on September 17th, 2019 and the prominent new features are listed here. One of the new features is “text blocks”. This allows writing multiline strings easily without the need for concatenation while splitting into different lines.Lets quickly look at the different ways of creating multiline strings: String aBlock = """ SELECT id, first_name, last_name, dob FROM person WHERE id = ? """; String aIndentedBlock = """ SELECT id, first_name, last_name, dob FROM person WHERE id = ? """; String anotherBlock =...

javacodegeeks.com

Spring @Primary Annotation

Introduction:Spring @Primary annotation is used to give a higher preference to the marked bean when multiple beans of the same type exist.Spring, by default, auto-wires by type. And so, when Spring attempts to autowire and there are multiple beans of the same type, we’ll get a NoUniqueBeanDefinitionException:Caused by: org.springframework.beans.factory.NoUniqueBeanDefinitionException   : No qualifying bean of type [com.programmergirl.Person]   is defined: expected single matching bean but found 2: student, teacher ... To...

javacodegeeks.com

Spring MVC Binding w/o Setters

You can bind form parameters to a domain model object even if the domain model object does not have setters. Just add a @ControllerAdvice class with an @InitBinder method that configures your application to field binding via the initDirectFieldAccess() method package boottests.controllers; import org.springframework.web.bind.WebDataBinder; import org.springframework.web.bind.annotation.*; @ControllerAdvice class BindingControllerAdvice { @InitBinder void initBinder(WebDataBinder binder) { binder.initDirectFieldAccess(); ...