testing

Testing custom ORM solution performance overhead - how to?

I have created a prototype of a custom ORM tool using aspect oriented programming (PostSHarp) and achieving persistence ignorance (before compile-time). Now I tried to find out how much overhead does it introduce compared to using pure DataReader and ADO.NET. I made a test case - insert, read, delete data (about 1000 records) in MS SQL S...

Integration test: create vs new in controller

edited: followed suggestions. See at end of question. I have a controller with two functions: def new if login_required @discussion = Discussion.new respond_to do |format| format.html # new.html.erb format.xml { render :xml => @discussion } end end en...

Best way to maintain and develop 3 similar sites

It would kind of be like S[OFU] except there will be more differences between the site. What are good ways to develop 3 site at once with a different look and different functionality? I believe with the look i may only change the CSS and some backend data for different categories. I also need some functionality and options to be specifi...

How to set locale default_url_options for functional tests (Rails)

In my application_controller, I have the following set to include the locale with all paths generated by url_for: def default_url_options(options={}) { :locale => I18n.locale } end My resource routes then have a :path_prefix = "/:locale" Works fine on the site. But when it comes to my functional tests, the :locale is not pas...

Testing multiple classes with PHPUnit

This might be a stupid question, but I can't seem to make it to work. I'm using PHPUnit to test. Currently I have two classes in a file called Tests.php: class XTest extends PHPUnit_Framework_TestCase {...} class YTest extends PHPUnit_Framework_TestCase {...} However, I'm unable to run both classes. I'm running the following command ...

ruby-on-rails: passing params through a route & link_to

I have a name route: map.up_vote 'up_vote', :controller => 'rep', :action => 'up_vote But up_vote requires two arguments to be passed in, postID and posterID and I can't seem to figure how to do that in a partial, but in an integration test I have no issues. Partial: link_to 'Up Vote', up_vote_path, {:postID => session[:user_post_i...

Difference between test -h and test -L

What is the difference between test -L filename and test -h filename in ksh shell. From the man page, both were used to identify a symbolic link, but I want to know the exact difference. Here is the description from the man page. -h file True if file exists and is a sym- bolic link. -L file...

testing django app with legacy database - how to avoid recreating db per test?

I'm building web-application using Django1.1 framework with imposed database schema and data (in fact - db already exists - Postgresql). I wrote models already, now I want to perform some unit-testing. The problem: test runner destroys and reconstructs (using information from models) database after every test method, but that's undesira...

java web UI testing tool, something that converts DOM to objects?

is there a java UI testing tool (web) that converts the DOM into a java object of sort? So I can do something like: browser.GoToPage("google").FindButton("search").click(); ...

Testers knowledge on database

As a tester, how much should one expect a tester to know about databases? Is it only writing queries in sql or do we need to know about stored procedures, triggers etc. ...

Data-Driven Tests with Data Relationships

If i have for example this two classes, where I have a One To Many Relationship and i want to perform a Visual Studio Data-Driven Unit test, how can I get the data from multiple sources using visual studio or how can i flatten the orders data in a column? What i mean is that if i can´t access multiple sources from a data-driven test, i w...

Django - testing of different visual blocks

I have some the page elements split into separate visual blocks. I am currently integrating the front end htmls from the designer, so it is important for me to test how they appear in the browser individually (each block). What is the simplest way I can implement this using django-testing? I know I can create a view with all the block...

How to throw exception in new rhino mocks 3.5

Hi Guys, I am using rhino mocks 3.5 and am trying to throw an exception in my expectation to test some functionality in my catch block. But for some reason it is not throwing the exception. _xyz.stub(x => x.function(string)).throw(new exception("test string")); So, I am stubbing out the call to the function to throw exception but it...

Selenium: Loop Through Each <option> in Drop Down List

I'm using Selenium to ease my testing burden and I have about 1,000 different drop down list combinations (spread across multiple pages and drop down lists) that need to be tested. Basically, what I would like to do is select each <option> inside of a <select>, click the Submit button, select an item (first, second, third, etc.) in the d...

Is there a programmatic way to convert PDFs to images using Adobe's PDF renderer?

We trying to set up automated regression testing our generated PDFs by converting our them to images and then using Python Imaging library to test the difference, pixel by pixel, between new and old versions. Right now, the only step that isn't automated is converting the PDFs to images. I know there are ways to convert PDFs to images ...

Rails rake test returns an error message

I am a rails newbie and receive the following message when I run rake test. This is a an application based on rails community engine. I tried creating a test application just to make sure that my gems etc. are fine and I am able to run rake test successfully in that application. It would be great if someone could shed a light on what i...

How to package Maven 2 generated-classes by Cobertura?

Hi there, i have a Maven 2 project setup which nicely packages a war file using a pom.xml now i want to introduce Cobertura to that. I can succesfully instrument the classes but when i want to package the instrumented classes and deploy them to my jboss server the wrong files are being packaged. My target tree looks like this: \target ...

How to check if my transactional methods really support transactions?

I'm using Spring 3.0, and I have a set of methods like this: @Transactional (value = "authTransactionManager") public void remove(User user) { ... } I use 2 different transaction managers and specify necessary manager (authTransactionManager in example above). I was curious what would happen if I specify nonexistent manager. I ...

How to mock/stub calls to message taglib in Grails controller

I've got a Grails controller which relies on the message taglib to resolve an i18n message: class TokenController { def passwordReset = { def token = DatedToken.findById(params.id); if (!isValidToken(token, params)) { flash.message = message(code: "forgotPassword.reset.invalidToken") redirect controller: 'forgotP...

What is correct xmlns url for AdMob in Android Layout XML

I am testing the AdMob for Android SDK. I can't set the admob:testing="true" because the admob attribute is unknown. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:admob="http://schemas.android.com/apk/res/org.ifies.android" android:layout_width="fill_parent" android:layout_height="fill_parent" ...