DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

The Latest Testing, Tools, and Frameworks Topics

article thumbnail
Sharing Test Classes Between Multiple Modules in a Multi-module Maven Project
Using Maven to effectively test software when test classes are not already packaged by Maven.
April 28, 2016
by Dave Turner
· 56,309 Views · 6 Likes
article thumbnail
Testing Java EE (or Why Integration Tests Are Overrated)
Testing that goes beyond just unit testing and integration testing. Why we should be doing full system testing.
April 27, 2016
by Sebastian Daschner
· 26,087 Views · 7 Likes
article thumbnail
Mocking Method with Wildcard Generic Return Type
[Ivan Zerin provides a primer on mocking methods that contain generic return types.] There are several cases where construction when().thenReturn is not suitable during Unit tests. One of then generic return type. I have faced such issue, let's take a look. There is a method in interface declaration: public interface FooInterface { public Iterable getList(); ... } Implementation looks like this: public class Foo implements FooInterface { public List getList() { ... } ... } At first mocking of such method should not be something unusual: public class UnitTest { @Mock private FooInterface mockFoo; @Test public void someUnitTest() { ... List testList = generateTestList(); when(mockFoo.getList()) .thenReturn(testList); } } But this code won't compile with error: Cannot resolve method 'thenReturn(List). Seems to be some mistake, cause returned type are correct from the interface point of view. This error happening cause compiler can not gurantee that returned type of method getList() will be List. Actually return type of method getList() in this case is Iterable and this means "Return some Iterable object with any objects that extends SomeClass". Let's rename this type as 'X'. So when(mockFoo.getList()) will create object OngoingStubbing> and it has method thenReturn(Iterable). Compiler can not tell what type X before runtime and cannot perform safe cast from List to Iterable (we perfrom actuall call of method thenReturn(List)). Sounds a little tricky but let's assume that SomeClass is standard Java class Number. Then classes Integer and Double are both fulfill the criteria of List. Let's say that as return type of mock we will use List, in this case, compiler should be ready that actual work with code during runtime will be performed with List too, but it is clearly that cast from Double to Integer will be incorrect (try to cast double value 12.6 to int). You could argue that in the case of mockito compiler won't need to bother about the casting of returned type because call of original method would not produce anything, but it is known by mockito. From compiler point of view, it is only Java code, that should be checked for safety and correctness before compiling. Ok, so how we should deal with such cases in mockito? Use doReturn() method: doReturn(testList).when(mockFoo).getList(); Such expression is not type safe, so it were designed for exceprional cases, so use it only when you cannot use standart when().thenReturn(), which is the type-safe, elegant and more readable syntax.
April 27, 2016
by Ivan Zerin
· 44,461 Views · 4 Likes
article thumbnail
Logback Configuration: Using Groovy
Logback is one of the most popular logging frameworks for Java, but did you know you could configure it using Groovy? This guide walks you through the whole process.
April 27, 2016
by John Thompson
· 26,408 Views · 7 Likes
article thumbnail
How to Verify Equality Without Equals Method
When testing it is often quite complicated to compare object with complex fields. By using the Unitils library in Java, this all becomes quite simple and elegant.
April 27, 2016
by Lubos Krnac
· 16,610 Views · 5 Likes
article thumbnail
How to Authenticate on Android Using Social Logins
In this article we will go through four popular social login providers and learn how to implement them on Android. Read on!
April 21, 2016
by Sebastián Peyrott
· 21,794 Views · 5 Likes
article thumbnail
JavaScript MVVM — You’re (Probably) Doing it Wrong
If you are using one of the many frameworks that say they are using JavaScript MVVM, you might not be using it the way it should be used. In this article, Dave Bush defines MVVM, analyzes its advantages, and provides some MVVM best practices to follow.
April 21, 2016
by Dave Bush
· 22,921 Views · 10 Likes
article thumbnail
Building Blocks for Highly Available Systems on AWS
An upcoming article from DZone's Guide to Building and Deploying Applications on the Cloud, coming out next week!
April 21, 2016
by Andreas Wittig
· 8,359 Views · 5 Likes
article thumbnail
Logback Configuration: Using XML
Logback is a logging library from the creator of JUnit. In this series continuation, Spring guru John Thompson shows how to configure it using XML.
April 20, 2016
by John Thompson
· 92,371 Views · 16 Likes
article thumbnail
Testing Spark Code
An introduction to testing your Apache Spark code with Scala.
April 20, 2016
by Tim Spann DZone Core CORE
· 31,982 Views · 7 Likes
article thumbnail
Using Stubs for the AWS SDK for Ruby
Code that makes use of external dependencies can be difficult to test. If you are using AWS, then you have no doubt run into issues in testing your code. This article takes you through how to get around this little hurdle by using AWS Stubs if you are using Ruby.
April 18, 2016
by Jeff Dugas
· 6,425 Views · 2 Likes
article thumbnail
An Introduction to Logback: a Logging Framework From the Creator of Log4J
Monitoring, diagnosing, and troubleshooting are key activities in any enterprise application lifecycle, and logging is the core part of these activities. Meet Logback, a logging framework from the creator of Log4J.
April 14, 2016
by John Thompson
· 14,801 Views · 8 Likes
article thumbnail
Detecting Java Race Conditions With Tests, Part 1: Lost Updates
See how detecting Java race conditions is actually rather easy. In Part I of this two-part article, you will see how to detect lost updates, the first type of Java race conditions.
April 9, 2016
by Thomas Krieger
· 20,392 Views · 4 Likes
article thumbnail
Why No One Talks About Agile Testing!
For some reason, web dev teams always find themselves slipping into the old way of testing. Why?
April 8, 2016
by Thomas Peham
· 8,665 Views · 2 Likes
article thumbnail
Control RGB LEDs Using Android and Arduino
This is an interesting topic because two ecosystems are mixed together and integrated. By picking a color from an app running on your Android smartphone, we will make an Arduino switch on a RGB LED of that same color.
April 7, 2016
by Francesco Azzola
· 13,745 Views · 7 Likes
article thumbnail
A 5-Minute Guide to Performing Web Form Test Automation
How to use the free TestingWhiz tool to test the forms on your web site.
April 2, 2016
by Pratik Satasiya
· 37,947 Views · 7 Likes
article thumbnail
Comparing Two Objects Using Assert.AreEqual()
In order to change the way two objects are compared in an assert we only need change the behavior of one of them — the expect value.
March 30, 2016
by Dror Helper
· 111,671 Views · 2 Likes
article thumbnail
Software Testing [comic]
If only environmental variables were truly global over the whole Earth...
March 25, 2016
by Daniel Stori DZone Core CORE
· 19,787 Views · 31 Likes
article thumbnail
How to Perform Database Regression Testing?
Just as developers are human and prone to errors, a database containing mission critical information and lines of code on which applications are built is also vulnerable to errors and requires regular maintenance and updates from time to time. Regression testing can help you to make sure that code alterations don't affect the integrity of your database.
March 17, 2016
by Pratik Satasiya
· 15,074 Views · 11 Likes
article thumbnail
How to @Inject Property File Properties With CDI
Learn how to @inject Property files for your Java app with CDI in this neat tutorial, with annotations, producers, and more!
March 15, 2016
by Ivo Woltring
· 45,375 Views · 15 Likes
  • Previous
  • ...
  • 226
  • 227
  • 228
  • 229
  • 230
  • 231
  • 232
  • 233
  • 234
  • 235
  • ...
  • Next
  • RSS
  • X
  • Facebook

ABOUT US

  • About DZone
  • Support and feedback
  • Community research

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 215
  • Nashville, TN 37211
  • [email protected]

Let's be friends:

  • RSS
  • X
  • Facebook
×