Entries Tagged 'Testing' ↓

Using RenamingDelegatingContext to mock ContentResolver in Android

Tomas Nilsson

Mocking Context Testing in Android can be complex, especially when your component is not isolated from the Android framework. One example of this is when your component is performing file system tasks using Context. E.g, the Activity class has the following methods (inherited from Context): openOrCreateDatabase(); deleteDatabase(); getDatabasePath(); openFileInput(); openFileOutput(); getFileStreamPath(); deleteFile(); getCacheDir(); When calling [...]

Tags: ,

Simple Parsing of Complex JSON and XML Documents in Java

Johan Haleby

In this blog I’m going to demonstrate how to parse and validate more complex JSON and XML documents in Java using the REST Assured framework and the XmlPath and JsonPath components available in this framework. Since REST Assured is implemented in Groovy it can be really beneficial to take advantage of Groovy’s collection API. Let’s [...]

Tags: , ,

Infinitest

Anders Eriksson

The Infinitest Eclipse plug-in looks for unit tests and have them run as soon as changes are detected. Just as modern IDEs have provided automatic compilation for ages this can now also be provided for unit testing. The test outcome shows up as a green or red bar in the bottom of the Eclipse application [...]

Tags: , ,

Multipart Form Data File Uploading Made Simple with REST Assured

Johan Haleby

From a client perspective it has always seemed to me that uploading a large file or stream to a server using multi-part form data encoding in Java is overly complex. To address this I implemented support for it in REST Assured 1.3. Example Let’s say you have a simple HTML page that performs file-uploading from [...]

Tags: , ,

CAST 2011 – Testing competition with Happy Purples

Sigurdur Birgisson

First of all, Ill have to report a bug in James’ blog post. We only got $23 for the worst bug report award.=) Then I would like to thank for the fun competition James set up, it was really a learning experience and in retrospect I would maybe have put even more effort in the [...]

Tags: , ,

Collective note taking – More value from your test notes?

Sigurdur Birgisson

For quite some time now I have struggled with making note taking a natural part of my personal progress while testing. And well, I can say that it has really made impact on many other aspects of my work in other situations as well. I am actually quite proud to say that it has made [...]

Tags: , ,

Is your REST assured?

Johan Haleby

A couple of months ago I introduced a new open source Java framework for simple automated testing of REST/HTTP services called REST Assured. A lot of things have happended to the framework since then and it’s now better than ever. In this blog I’m going to summarize some of the most important new features that [...]

Tags: , , ,

Auto-incrementing Build Numbers in Xcode

Fredrik Olsson

Users and testers will find bugs you are sure you have already fixed. Sometimes they use the wrong version, sometimes your fix is not as good as you thought. Either way a tiny unique version number visible in the app can save you hours of work. Incrementing the version number of your project for every [...]

Tags: , , , ,

Chaos Monkey is your friend

Peter von Lochow

The chaos monkey, a mythical creature. I had actually never heard of it until I read Jeff Atwood’s post (which is excellent and you should read it). Then I realized that I’ve worked with and fought against chaos monkeys my entire career. Tough love sometimes, but the monkey always pushed the software to become more [...]

Tags: ,

PowerMock for Integration Testing

Johan Haleby

A while ago I blogged about how to use the PowerMock Rule to bootstrap PowerMock without using a JUnit runner. A problem that you’ll likely run into sooner or later when using this approach in an integration test is the need to ignore certain classes or packages from being loaded by the PowerMock classloader using [...]

Tags: , , ,

Sync-Async Pair Pattern – Easy concurrency on iOS

Fredrik Olsson

Apple provides many tools for implementing concurrency in your application. NSOperationQueue, GCD, or simply using performSelectorInBackground:withObject: that is available on each and every object, are just some examples. The tools are there, yet implementing good concurrency is hard. The solution I have found is not yet another tool, or framework, but a simple pattern. I [...]

Tags: , , , , ,

How to debug a short hang

Björn Carlsson

What can I do? When Bob the tester comes, and tells me that the client application sometimes hangs for about 30 seconds, when Bob is doing nothing. This client, and a hand full of other clients are connected to a system of connected servers. The problem could be a busy server or some internal client [...]

Tags: , ,

Facebook Test Java API update

Tobias Södergren

As Feroz and Aleadam commented on my previous post, it is now possible to copy test users from one application to another in the Facebook Graph API. This functionality is now implemented in facebook-test-java-api version 1.1.4. Code example This method copies a test user to another FacebookTestUserStore instance: FacebookTestUserStore facebookStore = new HttpClientFacebookTestUserStore(“<appId>”, “<appSecret>”)); FacebookTestUserStore [...]

Tags: , ,

Cucumber tests on iPhone/iPad

Davor Crnomat

I am sure everybody has heard about Cucumber ( https://github.com/aslakhellesoy/cucumber) – a tool for Behaviour Driver Development where you describe software behavior in natural language that your customer can understand. Through step definitions these behavior descriptions are executed as automated tests. Cucumber serves as documentation, automated tests and development aid. My friend and colleague Christian [...]

Tags: , , , , ,

Java API for testing Facebook application integration

Tobias Södergren

Since november 2010 you may create test user accounts on Facebook for your application, so that you may test your application without creating dummy accounts and possibly break the Facebook EULA. The test users may be managed using the Facebook Graph API. The application I was working on, which integrated with Facebook, needed automated integration [...]

Tags: , , ,