Skip to main content

Posts

Cucumber setup using Gradle

This tutorial will help you configure Cucumber into a Java project using the Gradle build tool. Introduction Cucumber is a test automation tool that supports Behavior-Driven Development (BDD).  It is written in plain English text called "Gherkin." Cucumber enables you to write test cases that anyone can easily understand, regardless of their technical knowledge. Setup First, create a Gradle project using the gradle init command. > gradle init Complete the Gradle wizard to create a project. Now update the gradle.build file to add the Gradle Cucumber dependency. testImplementation 'io.cucumber:cucumber-java8:7.0.0' This will add Cucumber implementation to your project. Task Configuration Add the following configuration to gradle.build This will enable the Cucumber runtime to execute BDD test cases. configurations { cucumberRuntime { extendsFrom testImplementation } } Create a new custom task to execute Cucumber  task cucumber ()

Getting started with Micronaut using Gradle

Getting started In this tutorial, we will create a Micronaut application using Gradle. Github Link What you will need Java installed on your machine Gradle installed on your machine Text Editor Steps First create your project folder, we will make a folder called "micronaut-project" for this tutorial. The second step is to add the build.gradle  file inside the project folder. This will contain a script to build the Micronaut application. Now update the build.gradle file. 1. Add following plugin plugins { id( "com.github.johnrengelman.shadow" ) version "7.1.1" id( "io.micronaut.application" ) version "3.2.0" } This will help to build application executable jars.        2. Next, add dependencies. dependencies { annotationProcessor( "io.micronaut:micronaut-http-validation" ) implementation( "io.micronaut:micronaut-http-client" ) implementation( "io.micronaut:micronaut-jackson-databind" )

Abstract Factory design pattern analysis

What is the Abstract Factory design pattern?   The intent or definition of Abstract Factory is “ Provide an interface for creating families of related or dependent objects without specifying their concrete classes ” It's a bit of a complicated definition, so we'll need to break it down into meaningful chunks to understand it. 1.  " Provide an interface "  When we discuss the Abstract Factory, we are referring to interfaces rather than abstract classes. Essentially, this design pattern provides us with an interface, similar to those found in Java, C#, or Typescript (abstract class).   Why interface?  Whenever we talk about any design pattern, we focus on how we will use it rather than how we will implement it. Because a concrete class creates tight coupling, whereas an interface isolates it from the rest of the system, an interface is always the better choice. We can get different solutions at runtime without having to update our code.

AngularJs Tutorials : Bootstrap

Every application starts with bootstrap process which initialize application and wire it other with dependencies and configurations. AngularJs is not different from other application. It also starts application with bootstrap process. Following operation happens inside AngularJs bootstrap process. Load application module. Create dependency injector and load dependencies. Compile HTML and create scope for application. All these steps happens inside angular.js scripting file. therefore we need to include it first. we can include it inside HEAD tag or at end of BODY tag. Note: Adding angular.js file at end of body tag will allow browser to load of HTML elements without any delay and afterwards load angular.js and begin bootstrapping process. You can get angular.js source file from https://code.angularjs.org/ <script src= ”https://code.angularjs.org/1.3.0/angular.js” type= ”text/javascript” > AngularJs bootstrap process happens on docum

MongoDB Tutorials : Aggregation Framework

MongoDB Aggregation Framework groups set of documents together and performs certain operation on this grouped documents and returns results in the form of documents. MongoDB aggregation answer to those query which requires grouping of documents. Aggregation framework works on three type of model Aggregation pipeline Map Reduce Single Purpose Aggregation Operations Now let see how MongoDB Aggregation Framework works with simple example. Suppose you are MongoDB application developer in a respected company and you have been given a MongoDB database that holds information about human population which is distributed according to cities and their states. here is one sample document. { "city" : "ACMAR" , "loc" : [ - 86.51557 , 33.584132 ], "pop" : 6055 , "state" : "AL" , "_id" : "3500

Subscribe for latest tutorial updates

* indicates required