Do you want to know how to develop your skillset to become a Java Rockstar?

Subscribe to our newsletter to start Rocking right now!

To get you started we give you our best selling eBooks for FREE!

1. JPA Mini Book

2. JVM Troubleshooting Guide

3. JUnit Tutorial for Unit Testing

4. Java Annotations Tutorial

5. Java Interview Questions

and many more ....

 

Test Collection Implementations with Guava

java-logo

I’m currently adding a new feature to LibFX, for which I create some custom collections akin to those from the Java Collections Framework. I went looking for tests I could run against them and was delighted to find out that Google’s Guava contains just what I need: a massive test suite which verifies every nook and cranny of my implementation ...

Read More »

Working with Legacy Test Code

software-development-2-logo

Legacy Code and Smell by Tests Working with unit tests can help in many ways to improve the code-base. One of the aspects, which I mostly like, is that tests can point us to code smell in the production code. For example, if a test needs large setup or assert many outputs, it can point that the unit under test ...

Read More »

Take the IntelliJ Challenge!

jetbrains-intellijidea-logo

It’s always a great idea to try and master the tools with which you work. I’m on a mission to improve my IntelliJ skills and have been watching and reading tutorials on IntelliJ tips and tricks. One of the very best I’ve come across so far is this video by Hadi Hariri. As well as being very informative it is also ...

Read More »

First steps with NFC in Android

android-logo

This post describes how to use NFC in Android. The NFC technology stands for Near Field Communication and you can find the specification at NFC Forum. In this first post, we will analyse some basic aspects of NFC and we will describe how we can implement an app in Android that handles NFC tags. If you want to experiment NFC, ...

Read More »

Neo4j: TF/IDF (and variants) with cypher

neo4j-logo

A few weeks ago I wrote a blog post on running TF/IDF over HIMYM transcripts using scikit-learn to find the most important phrases by episode and afterwards I was curious how difficult it’d be to do in Neo4j. I started by translating one of wikipedia’s TF/IDF examples to cypher to see what the algorithm would look like:       ...

Read More »

Netflix Archaius properties in a Spring project

spring-interview-questions-answers

Archaius Basics Netflix Archaius is a library for managing configuration for an application. Consider a properties file “sample.properties” holding a property called “myprop”:               myprop=myprop_value_default This is how the file is loaded up using Archaius: ConfigurationManager .loadCascadedPropertiesFromResources("sample"); String myProp = DynamicPropertyFactory.getInstance().getStringProperty("myprop", "NOT FOUND").get(); assertThat(myProp, equalTo("myprop_value_default")); Archaius can load property appropriate to an environment, consider ...

Read More »

Docker Compose to Orchestrate Containers

docker-logo

Docker Orchestration using Fig showed how to defining and control a multi-container service using Fig. Since then, Fig has been renamed to Docker Compose, or Compose for short. First release of Compose was announced recently:             Announcing @docker compose https://t.co/jJNvzbYCyk by @aanand @bfirsh & community! — Docker (@docker) February 26, 2015 From github.com/docker/compose: Compose is a tool for ...

Read More »

Building Vert.x projects using Gradle

gradle-logo

We currently use Vert.x in several internal and external projects. Until the most recent project we where building our Vert.x modules using Maven. Gradle is our build tool of choice, but the default approach described at the Vert.x site caused several issues: The task of cloning, cleaning and configuring the template project is error-prone; The template project does not support recent Gradle versions >= 2.x; This ...

Read More »

Integration testing on REST urls with Spring Boot

spring-interview-questions-answers

We are building a Spring Boot application with a REST interface and at some point we wanted to test our REST interface, and if possible, integrate this testing with our regular unit tests. One way of doing this, would be to @Autowire our REST controllers and call our endpoints using that. However, this won’t give full converage, since it will ...

Read More »

单元测试Junit入门(PDF下载)

junit-logo

编者按:在Java Code Geeks,我们已经提供了大量JUnit的教程,例如JUnit入门示例,使用JUnit的断言和注释例子,JUnit的注释示例等。然而,我们倾向收集所有的JUnit特性在一个详细的指南以方便读者。我们希望你喜欢它!               目录 1.单元测试的介绍 1.1. 什么是单元测试? 1.2. 测试覆盖 1.3. 在Java中的单元测试 2. JUnit的介绍 2.1. 使用Eclipse JUnit的简单示例 2.2. JUnit的注释 2.3. JUnit断言 3. JUnit的使用Eclipse完整的例子 3.1. 初始步骤 3.2. 创建一个Java类进行测试 3.3. 创建和运行JUnit测试案例 3.4. 使用@Ignore注释 3.5. 创建测试套件 3.6. 创建参数化测试 3.7. 规则 3.8. 分类 4.在命令行运行JUnit测试 5.结论   1.单元测试的介绍 1.1. 什么是单元测试? 一个单位可以是一个函数,一个类,一个包,或者一个子系统。所以,术语单元测试是指测试这样小单位的代码,以确保它们正常工作。例如,我们可以测试在给定的输入或者某给定条件的情况下,输出是否是我们所希望看到的。这种做法可以帮助开发人员发现代码逻辑背后的故障,提高其代码的质量。另外,单元测试可以用来以确保代码在未来变化中可以正常实现逻辑。 1.2. 测试覆盖 一般情况下,开发社区对关于代码应测试的百分比(测试覆盖)有不同的看法。一些开发者认为代码应该有100%的测试覆盖率,而有些则认为有50%或更低的测试覆盖率也可以。在任何情况下,你应该写测试你的代码中复杂或关键部分。 1.3. 在Java单元测试 在Java中最流行的测试框架是JUnit。本指南主要集中于JUnit,下面的章节有更多测试框架的细节。在Java中另一种流行的测试框架是TestNG。 2. JUnit的介绍 ...

Read More »
Do you want to know how to develop your skillset and become a ...

Subscribe to our newsletter to start Rocking right now!

To get you started we give you our best selling eBooks for FREE!
Get ready to Rock!
To download the books, please verify your email address by following the instructions found on the email we just sent you.

THANK YOU!

Close