testing

Flex Unit testing of library and mxml using FlexUnit

Hi, I have some software classes(library) to run commands on any mxml file. These classes(library) are wrapped in a SWC file. This SWC file is referenced by any sample mxml application (by adding as SWC file). My problem is that I want to test these software classes(library) against my sample mxml file using FlexUnit. That is, I should ...

How to create TestContext for Spring Test?

Newcomer to Spring here, so pardon me if this is a stupid question. I have a relatively small Java library that implements a few dozen beans (no database or GUI). I have created a Spring Bean configuration file that other Java projects use to inject my beans into their stuff. I am now for the first time trying to use Spring Test to inj...

Running .net 4 tests on remote files

Can anyone explain this one to me, as Ive got a not ideal solution Have a project in VS 2008 with MS unit tests in Import the project to VS 2010 Store files in My documents folder which is redirected to a server over the LAN Try to run tests, but no tests are found, and it comes up with a message no test are run as tests are disabled W...

MBUnit - Calling the same method multiple times in a sequence?

Hi Is there a way in MBUnit to have the same test called multiple times with different parameters in a sequence, as such: Method1() Method2(param A) Method3() Method2(ParamB) Method4() Method2(ParamC) etc? I've tried using the Order parameter but sadly I was too hopeful in that the Ordering would be considered class-wide rather than t...

Rails 3: How to handle sessions in test scope?

Hi, coming from rails 2.3.5 I am used to do something like that: class MyControllerTest < ActionController::TestCase test 'should get index if logged in' do session = method_to_create_a_valid_session # in test_helper.rb get :index, {}, {:id => session.id} assert_response :success # redirect would happen if not lo...

Rspec - Rails - How to follow a redirect

Does anyone know how to make rspec follow a redirect (in a controller spec)? (e.g test/unit has follow_redirect!) I have tried "follow_redirect!" and "follow_redirect" but only get undefined method `follow_redirect!' for #<Spec::Rails::Example::ControllerExampleGroup::Subclass_1:0xb6df5294> For example: When I create an account the p...

Testing stored procedures

Hi , How to test procedures with record type parameters.I have a procedure which takes test_ap ,basic and user_name as inputs.where test_ap is of record/row type,basic record array type and user_name charater varying. I need to test the procedure in pgadmin. test_client(test_ap test_base, basic test_base_detail[], user_name character ...

Spring Test / JUnit problem - unable to load application context

I am using Spring for the first time and must be doing something wrong. I have a project with several Bean implementations and now I am trying to create a test class with Spring Test and JUnit. I am trying to use Spring Test to inject a customized bean into the test class. Here is my test-applicationContext.xml: <?xml version="1.0" e...

How to compare the output of serializeArray using qunit

I am using qunit and jquery. Latest version of both. In my code when I submit the form I have the event as e. I call e.serializeArray() Here is my test. equals(args.data, [ { "name": "user_name", "value": "john" } ], 'input data'); And this is the error message from qunit. expected: [ { "name": "user_name", "value": "david" } ] ...

Python: Time a code segment for testing performance (with timeit)

Hi, I've a python script which works just as it should but I need to write the time for the execution. I've gooled that I should use timeit but I can't seem to get it to work. My Python script looks like this: import sys import getopt import timeit import random import os import re import ibm_db import time from string import maketran...

What are the best places on the web to present my application for critique and suggestions?

I pretty much suppose that if I issue a question here on StackOverflow, saying "hey, colleagues, go this link to my website, download my CoolProggie and write a line on what you think?" it is going to be considered a sort of advertisement, downvoted and closed. Can you suggest any correct places for this, where I am going to find enough ...

JUnit parallel to Rails Fixtures?

My team has a set of POJO's that we build up to pass into our code and test various functions. For example we have an Address class which contains address information. It doesn't make sense to constantly rebuild this class every time we have to whack an address onto an object to test something. I am thinking that something like Rails'...

Grails Testing hickups

I have two testing questions. Both are probably easily answered. The first is that I wrote this unit test in Grails: void testCount() { mockDomain(UserAccount) new UserAccount(firstName: "Ken").save() new UserAccount(firstName: "Bob").save() new UserAccount(firstName: "Dave").save() assertEquals(3, UserAccount.coun...

Capture form fields and repopulate the form with them

I am currently testing a large web form and would like to be able to easily populate the form with several different lots of test data without having to type them each time. Is there a generic way to capture form inputs on a web page and have them repopulated on a different page load? I thought a tool like greasemonkey might be able to...

JRuby-friendly method for parallel-testing Rails app

I am looking for a system to parallelise a large suite of tests in a Ruby on Rails app (using rspec, cucumber) that works using JRuby. Cucumber is actually not too bad, but the full rSpec suite currently takes nearly 20 minutes to run. The systems I can find (hydra, parallel-test) look like they use forking, which isn't the ideal soluti...

Putting BigDecimal data into HSQLDB test database using DbUnit

Hi everyone, I'm using Hibernate JPA in my backend. I am writing a unit test using JUnit and DBUnit to insert a set of data into an in-memory HSQL database. My dataset contains: <order_line order_line_id="1" quantity="2" discount_price="0.3"/> Which maps to an OrderLine Java object where the discount_price column is defined as: @Co...

What is the best way to test using grails using IDEA?

I am seriously having a very non-pleasant time testing using Grails. I will describe my experience, and I'd like to know if there's a better way. The first problem I have with testing is that Grails doesn't give immediate feedback to the developer when .save() fails inside of an integration test. So let's say you have a domain class wi...

SUDS Exceptions

Hello, I am sending commands over suds. I have errors occuring in the command line but I do not know which exceptions to place in as I am not sure which ones to use for SUDS. try: result = self.client.service.GetStreamUri(self.stream, self.token) print result assert True except suds.WebFault, e: ...

Reflection in unit tests for checking code coverage

Here's the scenario. I have VO (Value Objects) or DTO objects that are just containers for data. When I take those and split them apart for saving into a DB that (for lots of reasons) doesn't map to the VO's elegantly, I want to test to see if each field is successfully being created in the database and successfully read back in to reb...

Testing with Unittest Python

Hello, I am runninig test's with Python Unittest. I am running tests but I want to do negative testing and I would like to test if a function throw's an exception, it passes but if no exception is thrown the test fail's. The script I have is: try: result = self.client.service.GetStreamUri(self.stream, self.token) se...