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 [...]
Entries Tagged 'Testing' ↓
Using RenamingDelegatingContext to mock ContentResolver in Android
October 10th, 2011 by Tomas Nilsson — Android, Testing
Simple Parsing of Complex JSON and XML Documents in Java
October 9th, 2011 by Johan Haleby — Java, Testing, Tips & Tricks
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 [...]
Infinitest
September 21st, 2011 by Anders Eriksson — Java, Testing, Tips & Tricks
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: automated testing, Java, junit
Multipart Form Data File Uploading Made Simple with REST Assured
September 15th, 2011 by Johan Haleby — Java, Testing, Tips & Tricks
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: automated testing, http, rest
CAST 2011 – Testing competition with Happy Purples
August 22nd, 2011 by Sigurdur Birgisson — Testing
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: CAST, conference, exploratory testing
Collective note taking – More value from your test notes?
June 16th, 2011 by Sigurdur Birgisson — Testing, Tips & Tricks
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: note taking, team, testing
Is your REST assured?
June 4th, 2011 by Johan Haleby — Java, Testing, Tips & Tricks
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: automated testing, Java, rest, test
Auto-incrementing Build Numbers in Xcode
May 31st, 2011 by Fredrik Olsson — Cocoa, Testing, Tips & Tricks
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: iphone, objective-c, scripting, tools, tutorial
Chaos Monkey is your friend
May 24th, 2011 by Peter von Lochow — Testing, Tips & Tricks
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 [...]
PowerMock for Integration Testing
May 19th, 2011 by Johan Haleby — Java, Testing
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: automated testing, junit, powermock, testng
Sync-Async Pair Pattern – Easy concurrency on iOS
April 28th, 2011 by Fredrik Olsson — Architecture, Cocoa, Testing, Tips & Tricks
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: automated testing, concurrency, design patterns, iphone, objective-c, programming
How to debug a short hang
April 14th, 2011 by Björn Carlsson — Testing, Tips & Tricks
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: .Net, performance, windows
Facebook Test Java API update
March 25th, 2011 by Tobias Södergren — Java, Testing
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: Facebook, framework, unit testing
Cucumber tests on iPhone/iPad
February 11th, 2011 by Davor Crnomat — Testing, Tips & Tricks, Uncategorized
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: automated testing, bdd, Cucumber, iphone, mobile, ruby
Java API for testing Facebook application integration
February 3rd, 2011 by Tobias Södergren — Java, Testing
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: Facebook, frameworks, open source, testing
