testing

how to tell in code if we are running from a testmethod .net test

Is there a way to know when code is being called from running a test method? bool MyMethod() { if ( /* are we running a test? */ ) { return true; // otherwise this will fail from the automated build script } else { // run the proper code } } and please spare me the "this is a really bad idea" c...

Can axis2-1.5.1 alone can be used to write and test java web services without Tomcat?

(3/15/2010) Hi I am trying to test web services using axis2-1.5.1 (latest version) alone without Tomcat. Is it possible? If so, can someone point me how to do that? Appreciate your time and help. ...

How test guice injections?

I gave to Google Guice the responsability of wiring my objects. But, How can I test if the bindings are working well. For example, suppose we have a class A which has a dependence B. How can I test than B is injected correctly. class A { private B b; public A() {} @Inject public void setB(B b) { this.b = b ...

How do you test a Rails controller method exposed as a helper_method?

They don't seem to be accessible from ActionView::TestCase ...

Is PetraVM Jinx Beta 1 good?

PetraVM recently came out with a Beta release of their Jinx product. Has anyone checked it out yet? Any feedback? By good, I mean: 1) easy to use 2) intuitive 3) useful 4) doesn't take a lot of code to integrate ... those kinds of things. Thanks guys! ...

Retrieving specific fixtures in Rails

I have a YML file containing fixtures for a Rails model (Comment) which looks like this (pardon the formatting): comment_a: id: 1 text: 'foo' visible: false comment_b: id: 2 text: 'bar' visible: true comment_c: id: 3 text: 'baz' visible: true I know that I can select an individual Comment fixtur...

Looking for some good GUI testing frameworks/gui automation test tools for Windows Forms .NET

Hello, I am looking for a good GUI testing framework/automation testing tool for windows forms based apps. Can you recommend any ? ...

In Rails, how to speed up machinist tests?

I'm replacing test fixtures with Machinist. But using Machinist to set up test data is very slow, because whenever a test method is run some new data are made by Machinist and saved to database. Is there any way to cache the data in memory so that using Machinist isn't so slow? Thanks, Bryan ...

Record id with cucumber and pickle [Rails]

I am using Cucumber, Webrat, and Pickle in conjunction. When I write a scenario, I can do something like this: Given a product exists with title: "Bread" When I go to the edit page for that product And I fill in "Title" with "Milk" And I press "Save changes" Then I should see "Successfully edited product." And I should be on that car's ...

When should I stub out a type by manually creating a "stub" version, rather than using a mocking framework

Are there any circumstances where it is favourable to manually create a stub type, as opposed to using a mocking framework (such as Rhino Mocks) at the point of test. We take both these approaches in our projects. My gut feel when I look at the long list of stub versions of objects is that it will add maintenance overhead, and moves the...

actionscript - testing actionscript via command line

Hello, I would like to know if is there any easy way to test actionscript by using some kind of application like ruby's irb or javasctip spidermonkey where you can just open up your terminal and type the code straight away. This would be a good time saver when speaking of actionscript, since to test some syntaxes, classes, etc. you woul...

Unit Testing Hibernate's Optimistic Locking (within Spring)

I'd like to write a unit test to verify that optimistic locking is properly set up (using Spring and Hibernate). I'd like to have the test class extend Spring's AbstractTransactionalJUnit4SpringContextTests. What I want to end up with is a method like this: @Test (expected = StaleObjectStateException.class) public void testOptimist...

Configure lua prosody for localhost only

I want to use prosody or maybe another xmpp server to test my xmpp bot. I want it to only accept connection from the address/localhost(don't want to configure firewall to block access). I would like to know the easiest way to accomplish this. ...

How to do integration testing?

There is so much written about unit testing but I have hardly found any books/blogs about integration testing? Could you please suggest me something to read on this topic? What tests to write when doing integration testing? what makes a good integration test? etc etc Thanks ...

A simple factory_girl question

I have two factories (post_factory.rb, comment_factory.rb) in separate files. I'd like to create a bit complex factory, which will create a post with associated comments for me. I created a third file, called complex_factory.rb, and wrote the following code: Factory.define :post_with_comments, :parent => :post do |post| post.after_cre...

Should you unit test the return value of Hardcode Properties?

Should we be testing values that we already know the answer to? If a value is important enough to be a dedicated hard code value then should should it be important enough of to change a test at the same time as the value? or is this just overkill?! ...

What's your release process for your commercial application?

If you are developing a commercial desktop application, what's your release process? Sample process: Develop it: Patch bugs, add features, etc. Feature Freeze (do not fix, add anything unless it's absolutely required) Test it If everything is OK release it, if it's not fix it, test it, release it I think the most crucial question is...

How to test web layout using javascript testing frameworks

Has any one tried testing the actual layout of the web application in different browsers? I can only think of getting the actual dimensions of all the elements and then matching it with expected values. I think it is crude way to do it. Is there a better way to actually test the layout? Thanks Bharani ...

NUnit GUI Runner and Apartment State

how do you set the apartment state in the NUnit GUI runner? I'm trying to run a single NUnit test with WatiN and I'm getting the message. MyNamespace.LoginTests.CanLogin: System.Threading.ThreadStateException : The CurrentThread needs to have it's ApartmentState set to ApartmentState.STA to be able to automate Internet Explorer. ...

How to test lib files in Rails?

I understand the benefit of putting classes, modules, etc. in the lib folder in Rails, but I haven't been able to find a clean way of testing these files. For the most part, it seems like unit tests would be the logical approach. I guess my question is: What is the "rails way" for testing lib files? ...