testing

How can I run many test cases for a test method

I'm using JUnit.I have a test method to test a method and some test cases. I want to run all tes case in that test method, but I can't do that. When first test case fail, test method don't run second test case Here is my code public class ComputeServiceTest extends TestCase { //test add method public void testAdd() { ComputeServices ...

How can I invoke assertXXX manytimes using setUp() and tearDown()

I'm using JUnit. I want to invoke assertEquals() many times in a test method to test many diferent test cases but I don't want to have many test method. So I use setUp() and tearDown(). But when the first assertEquals() fail.The second assertEquals()doesn't work and setUp() method just have been invoked one time. Here is my code public...

Any good resource (non-people) management libraries?

As our automated test infrastructure grows, we have a need to automatically manage the test resources (servers, etc). Not manage updates to the systems but have an automatic (programmatic) way to reserve resources for use in the automated test runs and release resources when finished. I need to be able to to add items to the system, stor...

Telling if a .Net app is running as service or app?

How do you tell if a .Net application is running as a Desktop application or running as a service? We are trying to test our application with Fitnesse, which loads the app up as a service then makes calls into it.. but when a modal error box is pushed then it blows up.. I want to put a check to see if it is running in a service and if i...

How can you "parameterize" Clojure Contrib's test-is?

Both Junit and TestNG provide mechanisms for iterating over a collection of input parameters and running your tests against them. In Junit this is supported via the Parameterized annotation, while TestNG uses @DataProvider. How can you write data-driven tests using the test-is library? I tried using for list comprehension to iterate ove...

Testing with Thread.sleep

What are the recommended approaches to using Thread.sleep() to speed up tests. I am testing a network library with a retry functionality when connections are dropped or timeout errors occur, etc. The library however, uses a Thread.sleep() between the retries (so it won't connect thousands times while the server is restarting). The cal...

Is it ok to use interfaces solely for testing?

Suppose ConcreteService is the only non-testing implementation I'll need. Is it ok to extract an interface (or make its methods/properties virtual) solely for the purpose of being able to test objects dependent on it? Else I'll have to new up the dependency line, up until it branches (at which point I can inject mocks) every time I wan...

Selenium Issues

I have been using Selenium a lot lately (testing an ExtJs app) and while in many ways it is wonderful, there are three things that cause me a lot of grief: Inability to directly click on elements other than buttons. This has led me to write a bunch of Robot code to move the mouse around. That works but is a bit fragile, plus if you tou...

Public Active directory for testing.

I need to write some .NET code for listing user and groups. I am planing to use LINQ. I do not have access to the Active directory for testing. I do not have a server and can not set up my own Active directory. Are there any public Active directory that I could use for testing. The code is only reading data from the Active directory and ...

Functional testing of output files, when output is non-deterministic (or with low control)

A long time ago, I had to test a program generating a postscript file image. One quick way to figure out if the program was producing the correct, expected output was to do an md5 of the result to compare against the md5 of a "known good" output I checked beforehand. Unfortunately, Postscript contains the current time within the file. T...

What are the best practices for testing an application that uses an MSOffice environment?

I have an application that I am testing that writes to Microsoft Office, and Microsoft Excel. I test this application on all windows platforms (winxp -> win7 32 and 64) and I have found numerous cases where I find failures based on my user environment, the most recent of which is that I could not automate the saving of a word document o...

testing Java code generated during another test

I want to build a "toJavaCode()" on my model that would generated the required Java source code to generate that model (never mind the reasons or if it should or shouldn't be done, nor the compatibility issues that may occur). I'm at a loss at how to test this. I'm using maven, but generate-sources won't really work for me since my serv...

Testing JavaScript functions inside anonymous functions

Is it possible to test myInnerFunction below? var val = function() { var myInnerfunction = function(input) { return input + ' I ADDED THIS'; }; return myInnerfunction('test value'); }(); Because myInnerFunction is essentially a private member of the anonymously executed outer function, it doesn't seem like it is te...

How to test file manipulation

I hear that accessing to database is wrong in testing. But what about file manipulation? Things like, cp, mv, rm and touch methods in FileUtils. If I write a test and actually run the commands (moving files, renaming files, making directories and so on), I can test them. But I need to "undo" every command I ran before running a test ag...

Suppressing Swing Visibility

Hello, I've been given a bunch of messy code and a short time limit (no surprises there) to write some tests for it. I have written tests! They are good tests. Unfortunately, instantiating some of the project's components causes Swing GUI elements to be constructed and set visible too. I don't want this to happen for obvious reasons, s...

What is largest free datababase for SQL Server engine available for testing purposes?

What is largest free datababase for SQL Server engine available for testing purposes? ...

Where should I put my testing code in relation to the code it is testing?

The two obvious places I can think of would be some sort of "testing" folder right next to the code I'm working on. So something like: \project-code \my-feature \production-code \testing ***my tests*** \co-workers-feature \production-code \testing Or I could split out the testing co...

C# : Unit testing without using 3rd party framework?

Should unit testing be run in debug or release mode? I am using Visual Studio Standard Edition 2005 which does not come with any unit testing framework. Since I also do not want to make use of any other 3rd party unit testing framework, I used Debug.Assert to perform the actual test inside all unit test methods. However, Debug.Assert on...

Java: How to do testing for DAO and Services for a module?

First, I'm working as a Java programmer, and my first taks is to test the DAO and Services layers for a module from a project, but I didn't receive so many details about this thing. Any info for doing this? I know i need to use mock testing. P.S. This is my first job and I have 2 weeks as a worker :D, so I know very little about testin...

Any existing way to make sure beans defined in spring xml are stateless?

Working on a large size project, we started to use spring to manage our dependency injection. Since most dev are migrate from coding stateful class, we found some of stateless bean actually contain instance variables which themself are stateful. Correct me if I am wrong, it shouldn't be too tough to write a unit test to verify that all ...