Posts

Showing posts with the label Java

AngularJS Tutorial: Introduction to End-to-End Testing of AngularJS Applications using Jasmine and Protractor

Introduction to software testing In the previous installment of this series we discussed how to create a simple Hello World application using AngularJS. In this tutorial you will start learning how to streamline the development process and would tools Angular offers to the developers. When project is under active development, new features are often added to it and some previously created features are modified. It is possible that some application functionality is broken in the process. To prevent this from happening, it is a good idea to check how all the functionality works after modifications but that could be difficult because one should remember all the cases for all the features added since the beginning. Also, it’s tedious to manually place your application into various conditions and see if it works, so one can rely on automation, that is one can record all the tests in a format that computers can understand and delegate the menial task of testing to a computer. Ch...

Getting started with Dropwizard: Connecting to external REST Web-services using Jersey Client

Here is a link to my Getting Started with Dropwizard course on Udemy. Only $10! Imagine a situation that you would like to create a currency conversion API using Dropwizard , but exchange rates are fickle and change on daily if not hourly basis. So, you need an external source of exchange rate data and luckily, Google search returns a list of such APIs. In this tutorial will connect to Open Exchange Rates which has a free option. To use the API one needs to obtain a free API key which is an alphanumeric string supplied as part of request string when accessing the API. Here is the description of how to obtain the key . From this moment it is supposed that you have obtained the key, otherwise you will be unable to follow the examples from this tutorial. Let’s play a little with the API before we start writing the actual code. First, one can obtain the list of supported currencies, this can be accomplished by navigating the following URL https://openexchangerates.org/a...

Start building JVM microservices with DropWizard

Here is a link to my Getting Started with Dropwizard course on Udemy. Only $10! A full-profile application server, such as Glassfish  are Wildfly , was conceived to integrate a lot of frameworks that could be used separately with a lightweight server such as Jetty otherwise. However, the benefit was that all parts were assembled for you and you didn’t need to iron out the wrinkles you might encounter gluing various frameworks together. Also, an application server saves a developer from writing code that not pertain to the business domain: the application server copes with multithreading, provides a persistence solution, simplifies receiving messages from JMS queues and so on. It should be noted, that one can use a web-profile application server, such as Tomcat along with Spring to solve the same problems. The difference is that Spring mostly does not abide by standards of enterprise Java. Using an application server solves a lot of developer’s problems, although when ...

Getting started with Dropwizard: Connecting to a Database using Hibernate

Here is a link to my Getting Started with Dropwizard course on Udemy. Only $10! In the previous installments of this series we discussed how to create a Dropwizard application using Maven archetype and how to use a YAML file to set configuration parameters for the application. In this tutorial we'll create a simple application that exposes an Employee Directory via REST API. For simplicity reasons our representations will not contain hyperlinks, that is we'll talk about Level 2 of Richardson Maturity Model . The sources for the tutorial can be found here . We'll begin with adding parameters of database connection including credentials, connection URI and database driver name to the application's configuration file. The snippet below shows how to configure the database connection. MySQL RDBMS was used for our example, but some other DBMS can be used. As we'll use Hibernate to talk to our database, switching databases is a snap, it...