I have an Ant script with a junit target where I want it to start up the VM with a different working directory than the basedir. How would I do this?
Here's ... |
My Ant build includes a junit task that runs some tests. In order for the tests to work, the value of the property that specifies the current working directory (user.dir) must ... |
I'm writing a test for a piece of code that has an IOException catch in it that I'm trying to cover. The try/catch looks something like this:
try {
...
|
I'm writing some jUnit tests that depend on data files. Where should those data files go? And how would I (in the jUnit tests) get the location of that directory?
In ... |
I need to set up a filter file for my findbugs ant script that scans only the src/* files and not the test/* files.
What is the syntax for checking all classes ... |
Hi
I have a question which is described below:
What problems would arise for testing a Java class which counts number of words in a file?
The function's signature is below:
public int wordCount(String ...
|
Can somebody suggest an easy way to get a reference to a file as a String/InputStream/File/etc type object in a junit test class? Obviously I could paste the file (xml ... |
|
Hi i want to make a unit test suite on same object with same variable but different values
But if the object get the same name (created by this.setName("testlaunch"); (who must have ... |
I'm building a card game which is only relevant because of the examples given below.
I consider myself a fairly experienced C++ programmer, with considerable TDD experience in that language; most recently ... |
I want to implement JUnit on a small project I'm working on because I want to learn a little bit about it.
The tutorials that I read all make reference to methods ... |
In our application, we expect user input within a Thread as follows :
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
I want to pass that part in my unit test so that I can ... |
I have a ant file that runs JUnits tests. These tests rely on a relative path to certain configuration files. I've tried to set the working directory for the batch test, ... |
I want to print the results of my junit tests to a txt file.
this is my code
try {
//Creates html header
String breaks = "<html><center><p><h2>"+"Test Started ...
|
I want to be able to mock the File object in java using Mockery. I seems like we may not be able to create an interface for the File in java. ... |
I've added the JUnit jar to my classpath, and it can find and run tests alright using the command window, but when I try and compile a test I know works, ... |
I have a class that manages the archive of some files that we do some incoming processing on. When trying to test the archiving process I made use of the TemporaryFolder ... |
I use junit automatically installed by maven. When I run the maven test my tests work fine. But when I call the Eclipse JUnit test it doesn't use the current version ... |
I'm want to test two services:
- service which builds file name
- service which writes some data into file provided by 1st service
In first i'm building some complex file structure (just for example {user}/{date}/{time}/{generatedId}.bin)
In ... |
I'm following an example from Pragmatic Project Automation. I'm running on Windows 7 and pulling the project from a local Subversion repo. When I run ant in the project's base directory, ... |
We have several JUnit tests that rely on creating new files and reading them. However there are issues with the files not being created properly. But this fault comes and goes. ... |
I have a piece of code in Java that zips the contents of a directory into a zip file.
The signature of the method is as follows:
/**
* Zips the contents of ...
|
I am using JUnit to do some automated tests on my application, the tests are in a folder called tests in my JUnit classes package.
As of now, I access the files ... |
I'm working a program which is parsing some files and than process these files. The parser is well tested, but I have to test the processing part too.
The problem is ... |
My division uses continuous integration but our product and process don't lend well to the model that bugs should be fixed immediately (long runtimes, shared resources, old VCS tools, etc). CI ... |
I am trying to write an android build file that compiles, creates a jar executes it and also runs a bunch of test files. This is what I have so far, ... |
I'm trying to input from a file that got stuff that was serilized. I outputed an array of objects called playerbean that have three attributes like uname,pword and level. it seems to write out, but I"m not sure about reading it in. I tested with a Junit test, but I'm not sure if it is really passing or if the exception ... |
|
timthesheepshagga, Thanx for the reply. The call to the bean isn't a remote procedure call, is it? The test case is running in the same JVM as the server... it (the test case) gets an instance of the bean via it's remote interface, and everything after that is "normal" method invocation isn't it? Or am I completely at sea? Anyway, it ... |
I'm not very clear if fixtures is what I need to use and if so how to even use it in my case. I have a simple XMLUnit testcase that compares a set of xml files using DetailedDiff and getAllDifferences(). This works just fine for a comparison of a single set of XML files, how should this be done for n ... |
I have a singleton class called InstantLogger that internally uses a PrintWriter to write to file. It is very basic, has startLogger(String filename), log(String msg), and stopLogger(). startLogger just creates file, log write to file, and stopLogger closes file. When I use this class outside of the JUnit test suite it works fine. As soon as I use it in a ... |