testing

How to test materialized view in java

Is there any way to write automated tests for materialied views using Hibernate framework? I don't know how to make it work. My first approach was to use DBMS_MVIEW.REFRESH stored procedure. But, it is not what I need - all test data is commited after refreshing the view. Is there any different way to test the view? ...

How do you override :set_initial_state from AASM when testing with Factory Girl factories?

Update Answered below. In case the linked site disappears, you can use mocha to stub the initial state and prevent overwriting as in ... require 'mocha' class OrderTest < ActiveSupport::TestCase def setup Order.any_instance.stubs(:set_initial_state) @order = Factory(:order, :state => "other_state") end ... end Origina...

Numerical regression testing

I'm working on a scientific computing code (written in C++), and in addition to performing unit tests for the smaller components, I'd like to do regression testing on some of the numerical output by comparing to a "known-good" answer from previous revisions. There are a few features I'd like: Allow comparing numbers to a specified tole...

How can I see what actually happens when a Test::Unit test runs?

In a Rails application I have a Test::Unit functional test that's failing, but the output on the console isn't telling me much. How can I view the request, the response, the flash, the session, the variables set, and so on? Is there something like... rake test specific_test_file --verbose ...

How-to test action filters in ASP.NET MVC?

Need some pointers for this. Found this and this, but I'm still kind a confused. I just want to mock ActionExecutedContext, pass it, let filter to work a bit and check result. Any help? Source of filter you can find here (it's changed a bit, but that's not a point at the moment). So - i want unit test, that RememberUrl filter is ...

Testing Composite WPF applications

How do I go about testing Composite WPF applications? I was looking at the Composite Application Library and the Stock Trader reference implementation for examples, but I don't understand how their tests are organized. I have several modules that are compiled to DLLs and referenced by my main shell. What do I need to do to test the ind...

what are the Business cases for storage/backup industry?

Hi Can anybody explain the what are the business cases for storage regarding testing environment. Please provide any guidence regarding this. Thanks, ...

Rails cucumber problem

Seems like cuke doesn't show the full error message (at least when problem occurs in template) which makes it really hard to locate the problem. Here is what it outputs on some error: ... And I am on checkout page # features/step_definitions/webrat_steps.rb:6 You have a nil object when you ...

Visual Studio's testing tools compared to third-party tools

How do Visual Studio's testing tools compare to third-party frameworks like NUnit? Are there any significant differences? ...

When to rewrite a code base from scratch

I think back to Joel Spolsky's article about never rewriting code from scratch. To sum up his argument: The code doesn't get rusty, and while it may not look pretty after many maintenance releases, if it works, it works. The end user doens't care how pretty the code is. You can read the article here: Things You Should Never Do I've ...

Applying DATABASE_OPTIONS when testing Django project (or make it to use InnoDB for MySQL)

As the title says, I want to apply DATABASE_OPTIONS settings when I run my tests via ./manage.py test. In django/db/backends/creation.py, it does not consider this option at all in both create_test_db() and _create_test_db(). This breaks a test with a view that uses transaction.rollback function with InnoDB. It seems that test databases...

C/C++ testing framework (like JUnit for java)

Been hitting my head on the wall before as I don't make any test classes while using c/c++ (but instead have a lot of print methods). What is the most used method to perform testing in the c/c++ code? Java's JUnit has only left me with good memories while debugging things. I know that using asserts in code with a defined debug header ...

How do you make testing not boring?

Just as the title said. What ways do you use to test your own code so that it wouldn't be a boring task? Do you use any tool? For my projects, I use a spreadsheet to list all the possible routines i.e. from the basic CRUD and also all the weird routines. i make about 10 routines. I get about 2-3 bugs and sometimes major ones by doing th...

How can I use a data file in a VS 2008 unit test?

I have the files checked in to svn. The key is that I don't want to hardcode the paths to the files. How can I use relative paths and be able to find the data files consistantly? ...

How to load my test data in C#?

Hi, I am struggling to find an easy way to load my test data in C#. In Java, I load a resource using the following code: ... public static InputStream loadResource(String resource) throws LoadException { InputStream is = TestUtils.class.getResourceAsStream(resource); if (is == null) { throw new LoadException("Error l...

Mocking non-virtual methods in C#

I'm trying to test some classes I've made using mocks, but I've seen all free mocking frameworks in c# aren't able to mock non-virtual methods (if it is not in an interface). But, there's TypeMock who can do this, so it is possible. Can anyone show how to do it? I may even try to contribute to an open source framework if I can get this...

Is IE8 backwards compatible?

Hopefully some has some knowledge of this. I'm fast realising that IE8 certainly can't be ignored anymore. I had previously put it down to either a) just a buggy piece of software, or b) still to small a piece of the market share. Now, however, I'm seeing more and more requirement to make sure sites work on it. My question is can I ...

Running PHP Zend Test in Eclipse

Is it possible to run PHP Zend test cases (those that extend Zend_Test_PHPUnit_ControllerTestCase, etc.) through Eclipse PDT? I would like to be able to run them in a similar fashion as you run JUnit tests in Eclipse, by right-clicking the test file and selecting "Run as a JUnit test case." I'd love to see the green or red bar instead...

How to test the final distribution build before submitting it for review to the iPhone app store?

I have developed an iPhone App and I want to test this final distribution build before submitting it to the App Store for review. Is there any safe way to make this app to run on a device? ...

Oracle to SQL Server Migration verification

Hi, We are in process of completing the migration of Oracle to SQL Server 2005 (schema, data and programming objects). We have about 1220 stored procedures to be tested. What would be the best way to test them? Is there any automation possible here? We are thinking of writing a small window tool which would take the stored procedure na...