integration-testing

Adding classpath to jetty running in maven integration-test

I'm trying to set up integration tests for a Maven project that produces a war file. (As seen here http://docs.codehaus.org/display/JETTY/Maven+Jetty+Plugin/.) However I the war file requires a bunch of .properties files on the classpath, that I don't want to bundle in the war. Is there a way (preferably through plugin configuration) t...

Running integration tests with Cobertura Maven plugin

I am having trouble getting the Cobertura plugin to run integration tests in Maven. The closest answer to this question I have found is http://jira.codehaus.org/browse/MCOBERTURA-86. However, the issue remains an open bug. I tried the configuration suggested by Stevo on 03/Apr/09, it didn't work. My POM <reporting> <plugins> ...

Integration testing private classes and methods

For unit testing you shouldn't test private methods, yes, but for integration tests (using a unit testing framework like MSTest or NUnit) I would very much like to run the internal API calls against a test url, to make sure the current code works when the third party API vendor changes their backend. Given the complexity of the system (...

simpleJdbcTemplate. - insert and retrieve ID

I'm putting the data into database with simpleJdbcTemplate. simpleJdbcTemplate.update("insert into TABLE values(default)"); I dont want to put any data because i dont need it for my unit test purpose. How can i get the id from the inserted row? I can retriev the current sequence value but if somebody else will do a insert then i will...

How to control a tomcat container during the runtime with maven?

I have a Maven project which executes integration tests for another web-application. This application is deployed and started within a tomcat container. The configuration for this is done in the “cargo-maven2-plugin”: <plugin> <groupId>org.codehaus.cargo</groupId> <artifactId>cargo-maven2-plugin</artifactId> <configuration> ...

iPhone: determine distribution type programatically for testing.

At runtime in an iphone app, is there a way to distinguish the distribution type programatically between ad hoc and app store? Whenever I do an ad hoc distribution I want to target internal test servers for web service end points, then for the app store distribution target the production servers. Thanks. Jim ...

How to organize integration tests?

When writing unit tests, I usually have one test class per production class, so my hierarchy will look something like that: src/main -package1 -classA -classB -package2 -classC src/test -package1 -classATests -classBTests -package2 -classCTests However when doing integration tests the organization becom...

how to to unit test a maven2 mojo plugin that validates files.

I have created a maven2 Mojo that inspects certain file types for instances of certain strings. It is designed to be used in the test phase to report whether these files are vaild or not. When it finds these undesired strings it outputs build failure alerts and fails the maven build using MojoFailureException. I would like to do some i...

Should I use Selenium for a Booking Engine?

We'll be developing a booking engine, a 4-5 step checkout process for reserving rooms with a hotel where there's a lot of complexity involved. Something similar to this. Has anyone used Selenium for something like this? What kind of tests would I be able to do? Could I set something like Selenium to go through the entire process of step...

Dependency injection in Grails integration tests

I'm testing a service of my application thats depends of another services in runtime. When testing, the dependency inject seems doesn't works. Does dependency injection works in Grails artefacts when running integration tests? ...

How to run Spring Roo generated tests against a different database to Tomcat?

I have a collection of integration tests that have been generated by Spring Roo for my domain objects (and DAO ITDs). They appear to be fixed to use the "production" applicationContext.xml, which reads the database.properties and connects to the MySQL database schema I have set up for experimenting with the project: privileged aspect A...

Is there a more robust way to integration test my persistance layer app.config?

I have my application broken into the following projects/assemblies Approot/UI AppDomain/business logic/layer Domain.Tests Persistance/db layer Persistance.Tests I'm integration testing the connection string stored in the Persistance assembly using MSTest. currently I am using LocalTestRun.config for the solution to tell it to in...

Can you Profile Ms test integration tests?

I have never done any profiling, and have come across the first place that I really want to do it. Is it possible to profile my MS integration tests? What tools do I need? is there something built-in to VS 2008 professional? ...

What class should I inherit to create a database integration test in case of Spring?

I want to create a unit test for integration testing. What class should I inherit to be able to commit/rollback transactions? AbstractTransactionalSpringContextTests is deprecated. It's recommended to use AbstractJUnit38SpringContextTests instead, but I cannot find how to control transactions there. ...

TDD: "Test Only" Methods

Looking for some practical advice here and any experiences people have had in a similar situation. We use a BDD/TDD sytle methodology for building our software (quite a large/complex application) The end result is.. behavioral specifications (Given/When/Then style) derived from business requirements, unit tests that reflect these and co...

Rollback of nested transactions while unit testing stored procedures

I am trying to write some integration tests for some SQL server stored procedures and functions. I'd like to have a database that has a known set of test data in it, and then wrap each test in a transaction, rolling it back when complete so that tests are effectively independent. The stored procedures/functions do anything from fairly ...

How can I stub a before_filter in a super class in Rails?

I'm using RR for mocking and stubbing in RSpec, and I've run across a situation where I'd like to stub a method from a super class of a controller that sets some instance variables. I can work out how to stub the method call and if I debug I can see that my stubbed block is called, but I cannot get the instance variables in the block to ...

PHP Paypal integration test account

Hi there I am going to work on a project that involves Paypal function. My question what kind of account do I need to do the test? Do I need merchant account? And if you also have a good reference site please share it here. Thanks ...

Integration testing - seeking your knowledge, advice and links!

Hey guys, I'm after some advice and pointers on integration testing for a web app. Our project has been running for a number of years and it's reasonably complex. We're pretty well covered with unit tests but we're missing a decent set of integration tests. We don't have documented use cases or even a reasonable set of test cases beyo...

How to get instance_of to work with ActiveRecord objects in RoR?

Today I ran into an issue using RoR to stub calls to AR objects. I thought that I'd be able to do something along the lines of : stub.instance_of(BankAccount).save_to_other_spot { true } However when I tried this method it didn't seem to stub the method at all and it would end up running the original method I was trying to stub. I con...