Hi,
I have Java project built with Maven2. There is used JUnit framework for testing ( and Selenium but it is irrelevant ). I would like to add screenshot ( I have it ) into result of tests. Here, on SO, I found similar question which solves it but with Ant. I would like to know if there is any option how to manage it with Maven2 instea...
I have (jUnit) unit tests.
My project manager would like a human-friendly list of test cases and scenarios (think: a spreadsheet or report for general distribution to a less technical audience).
What is an effective way to bridge this gap?
...
Is there a tool for Java which, given a set of JUnit tests, and a class to test, will tell you which lines of the class are tested by the tests? ie. required to be present for the tests to run successfully. I don't mean "code coverage", which only tells you whether a line is executed, but something stronger than that: Is the line requi...
I'm using the Hello World with Ant tutorial from the Ant manual to learn about Ant.
The last part of the tutorial involves adding JUnit tests to the project.
I've got everything working as described in the tutorial and am now going on to make some minor changes.
One of the changes I would like to make is to run the tests during a typi...
I'm using Spring 3.0.4 and JUnit 4.5. My test classes currently uses Spring's annotation test support with the following syntax:
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration (locations = { "classpath:configTest.xml" })
@TransactionConfiguration (transactionManager = "txManager", defaultRollback = true)
@Transactional
pu...
Hi folks,
I'm using Cobertura 1.9.3 with NetBeans 6.8, Ant 1.7.1 and JDK 1.6.0_21 running with -WAR, and EJB, JUnit 4 tests.
When I change the line "pathelement location="${build.classes.dir}" /" to "pathelement location="${build.test.classes.dir}" /", there is some coverage (albeit in the wrong classes, it shouldn't be in the testclas...
I want to execute test methods which are annotated by @Test in spec order.
For example:
public class MyTest{
@Test public void test1(){}
@Test public void test2(){}
}
I want to ensure to run test1() before test2() each time I run MyTest, but I couldn't find annotation like @Test(order=xx).
I think it's quite important featur...
I have been using this exact Build.xml file. I had problems in the beginning using the junit task with it, but I figured out those problems a couple months ago.
Recently I got the all to common error message when I ran my build file with the test task.
test:
[junit] Testsuite: com.mmz.mvc.test.AgentDAOTest
[junit] Tests run: 1, Failure...
Hi,
I would like to mock a view implementation of the MVC design pattern. I have implemented the MVP(another MVC variation), and would like to test if the certain methods in the view get called correctly by the controller when a state change happens on the model. The following shows the sequence of method calls on the model, controller ...
I have multiple test cases even and if the logic is different, the output must be equal on all of them. So I was thinking in how to generalize them and place the Assert method only once.
Is there any way better to do it than this one:
static public class Tests() {
private static String expected = null;
private String actual = ...
We're using a few libraries that include an xml parser library through maven. We think we've excluded most of those as we are using a newer version.
Is there some sort of JUnit library to check an ear/war for the presence of that jar and fail the test if its there? Or do we just need to write some code to unzip the archive and loop ov...
I know this question is not a hard one.
I want to implements 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 method that have a particular output.
In my case my output are files, how can I do this? any simple example?
any aproach that could help me ...
Hello! I have a client server application and for testing purposes I need to start the client in a test method by calling
Client.main();
That creates some new thread. Now I need to wait until that thread is completed before performing assertions in my test. How do I know when this happens? Alternatively, how do I know, which thread wa...
I'm testing a method that logs warnings when something went wrong and returns null.
something like:
private static final Logger log = Logger.getLogger(Clazz.class.getName());
....
if (file == null || !file.exists()) {
// if File not found
log.warn("File not found: "+file.toString());
} else if (!file.canWrite()) {
// if file is ...
I'm using NetBeans and GlassFish 3.0.1 to create an EJB3 application. I have written a few Unit Tests, which get run via JUnit and make use of the embedded GlassFish. Whenever I run these tests on my development machine (so from within NetBeans), it's all good.
Now I would like to let Hudson do those tests. At the moment it is failing w...
Hello,
I am trying to run some unit tests for my grails app, via "grails test-app -unit". This works as expected.
However, when the tests are done, junitreport takes way too long to generate the HTML results, eg:
[junitreport] Transform time: 33294ms
33 seconds (on top of the rest of the time) is ridiculous when I want to rapidly mak...
The build.xml we have today have many targets to compile and run unit tests. The build.xml refers to many property files with relative to itself. All this works fine when build and test is done on same machine.
It is pretty simple to do build get all jars and any test input files to a build_home(another machine). How to run junit on...
I'm trying to write some Junit tests to test old classes in our app. The code is trying to load a ResourceBundle (for translations) but fails. I guess the problem is classpath related but I can't figure it out.
The code is laid out in /src and my tests are in /test. The ResourceBundles are loaded given a base name relative to /src, say,...
This package has a class - HowToUseGeocell.java - with test cases defined.
I have imported this entire project into a larger Java web project (Spring 3) in Eclipse controlled by a Maven task (gae:run).
But I don't know how to run these test cases from inside the larger project.
Could someone point me in the right direction please? Tha...
Hi,
I am unable to include the new jMock release as Maven dependency. Here is what I tried including:
<dependency>
<groupId>org.jmock</groupId>
<artifactId>jmock</artifactId>
<version>2.6.0</version>
</dependency>
I have tried various combinations with the version and artifactId but it doesn't help.
Thanks,
Julia.
...