testing

Tests for JUnit. How ?

How is the JUnit Framework tested ? How are the tests for their framework code created, considering that JUnit as a testing framework itself. What technology are they using ? Their own testing framework ? A smaller more basic version of it ? Another framework ? Can any knower please provide some details ? ...

In Sinatra - does anyone use test fixtures? how is your test suite set up?

I'm coming from a Ruby/Rails world. I'm getting testing set up on a Sinatra project (with Rack::Test). I usually use Fixtures in testing. Is there an equivalent for Sinatra? How do people set up their Sinatra test suites (outside of the basic helloworld example that is the only example I can find for Sinatra tests). Thanks! ...

Is it bad practice or a bad idea to have a "generic" provisioning profile?

Fot testing iPhone apps, is it a bad idea to have a development code signing provision that will run any app with com.mydomain.* ? Why? EDIT: See italicized edit above. ...

How do I test an image alt value using capybara?

I'm trying to define a step to test the value of alt text of an image using capybara and the css selectors. I wrote one for input values based on the readme examples: Then /^I should see a value of "([^\"])" within the "([^\"])" input$/ do |input_value, input_id| element_value = locate("input##{input_id}").value element_value.s...

How to write automated integrated tests when using JTA?

I want to write integration tests for the application I'm working on. It uses JTA (multiple resources) and runs inside an application server. What is the best way for writing an automated test for such a scenario? Using an standalone transaction manager like atomikos or somehow leveraging the app server api/tools for transaction handling...

Final Integration Testing for Q.A.

A medium sized rails app that our company has been working on is getting close to the end of development and we are going to start doing Q.A. testing on it. We've have been writing unit, functional and integration tests all along and our test coverage is about 99% (even though that really doesn't mean anything). We feel like we have a ...

Test a database conection without codeigniter throwing a fit, can it be done?

I'm just about finished my first release of automailer, a program I've been working on for a while now. I've just got to finish writing the installer. Its job is to rewrite the codigniter configs from templates. I've got the read/write stuff working, but I'd like to be able to test the server credentials given by the user without codingi...

Unit testing a controller method?

I have a controller method like such: def search = { def query = params.query ... render results as JSON } How do I unit test this? Specifically, how do I call search to set params.query, and how do I test the results of the method render? Is there a way to mock the render method, perhaps? ...

Static variables in Java for a test oObject creator

Hey, I have something like the following TestObjectCreator{ private static Person person; private static Company company; static { person = new Person() person.setName("Joe"); company = new Company(); company.setName("Apple"); } public Person createTestPerson(){ return person; } public Person createTe...

Win32 script environment for testing http redirects?

The past few days I've been working with setting up an Apache server on Windows. The server is supposed to host several .htaccess files, each redirecting (or, in some cases, proxying) to different hosts. I want to create tests for these redirectons, and the solution I'm currently considering is a CGI script running on the same server, ...

Multiple Condition Coverage Testing

Hi Folks, When using the White Box method of testing called Multiple Condition Coverage, do we take all conditional statements or just the ones with multiple conditions? Now maybe the clues in the name but I'm not sure. So if I have the following method void someMethod() { if(a && b && (c || (d && e)) ) //Conditional A ...

The ultimate browser testing machine...

Hi All, What would be the ultimate web application browser compatibility test machine be? The testing environment would be (XP: IE6,FF3.6), (XP: IE7,Chrome), (XP: IE8,Safari), (MacOsX: Safari, FF3.6, Chrome), (Ubuntu: FF3.6, Chrome) Of course I want it all in one machine, my initial thought was Using a MacOsX as a host machine and use ...

Disadvantage of White Box Testing?

Hi Folks, Can you think of any disadvantages of White Box testing - other that the tester needs to know and understand the code (which may have a cost)? Thanks, ...

How can i mock or test my deferred evaluation/execution functionality?

I have what could be seen as a bizarre hybrid of IQueryable<T> and IList<T> collections of domain objects passed up my application stack. I'm trying to maintain as much of the 'late querying' or 'lazy loading' as possible. I do this in two ways: By using a LinqToSql data layer and passing IQueryable<T>s through by repositories and to m...

ASP.NET MVC vs. Jquery/AJAX (Where to draw the dividing line?)

I am learning MVC and I understand the basics now. It is very good for CRUD pages and has built in HTTP methods to post/get edits/updates. That is nice. This is all very testable by just creating a new controller and testing it. But I was thinking about other web page scenerios when using MVC. What about a page that has 2 listboxes that...

Best practice for naming unit and integration test methods?

The title says it all. I've recently inherited an application that is written by different people at different times and looking for guidance on how to standardize. ...

How to set RAILS_ENV variable when running Rails tests?

In both my environment.rb and test_helper.rb files I have: ENV["RAILS_ENV"] = "development" I have one functional test written, however when I run it, the script tries to connect to my database using the "test" configuration settings which are in the database.ymal file & won't connect the the database. How can I run my tests using th...

Can Rails unit tests be run on a different environment than test?

Hi, We have a large multi-developer project under Rails in which we are using tests for both models and controllers. Right now the developers have to switch the DB parameters for the 'test' environment to match their local dev environments before running tests. I am wondering if there is a way to run those tests on any environment other...

How to: generate UnhandledException?

I use this code to catch the WinForm application UnhandledException. [STAThread] static void Main(string[] args) { // Add the event handler for handling UI thread exceptions to the event. Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(Application_ThreadException); // Set the unhandled ...

How do I write a spec to verify the rendering of partials?

I'm using rr (the mocking framework) and rspec with ruby-on-rails. Also, I'm using the collection short hand for partial rendering. My question: How do I correctly fill out the the following view spec? describe 'my_view' do before(:each) do assigns[:models] = Array.new(10, stub(Model)) end it "should render the 'listing' part...