stub

Client stub for web service generation: what library to use?

What is the preferred way to generate the client stub from a WSDL file? I tried an Axis2 plugin, it does the job. Can WTP for eclipse generate the client stub as well? What is a better solution? Can you explain why you recommend such or such a way? p.s. Does Apache CXF have Eclipse plugins for visual generation of client stub? ...

Unit testing - How to set up test data when stubbing database data

Hi, In our unit testing, I've got a stub object that is creating a set of data in memory to be used during unit testing so that the live database is not used. I have unit tests that check the number of rows returned from this set using the query under test and the values supplied to the query in the test. My first issue is that because...

Using ViewStub with Tabs in Android Layout

I have read http://developer.android.com/resources/articles/layout-tricks-stubs.html which explains how to use a viewstub as a lazy include for layouts. This works fine on a simple list view i have, but when I try to use it in my actual Tabbed layout, it disappears as soon as the tab gets any real content. I have set all tabs, and tab ...

Unit testing - testing in isolation

I've got a set up with a number of layers: Website Application / Service Domain (contains entities) Persistence (contains repositories) I'm testing the persistence layer in isolation OK using data created in memory from a stub object. Now, Im thinking about testing my Website layer. I know I should be testing it in isolation which...

make RMI Stub with netBeans

I see some where in the web that we can make Stub dynamically with Netbeans and it`s a good feature of it. I search a lot but all hits are from Old version (4 or 5) and others told a complete reference is in Netbeans website but the links is removed and i couldn`t find it in the site. Broken Link : rmi.netbeans.org Please if there is ...

Should I test if a stubbed method was called?

I'm just starting out with BDD/TDD using MSpec (with AutoMocking by James Broome) and RhinoMocks. Here's an excerpt from my practice project: namespace Tests.VideoStore.Controllers { public abstract class context_for_movie_controller : Specification<MovieController> { private static IList<Movie> movies; prote...

How can I stub out a call to super in a imported Java class in JRuby for testing

I am testing Java classes with RSpec and JRuby. How can I stub out a call to super in an imported Java class in my RSpec test? For example: I have 2 Java classes: public class A{ public String foo() { return "bar"; } } public class B extends A public String foo() { // B code return super.foo(); } } I am just t...

Python library for creating stubs/fake objects

I am looking for python stubbing library. Something that could be used to create fake classes/methods in my unit tests.. Is there a simple way to achieve it in python.. Thanks PS: I am not looking for mocking library where you would record and replay expectation. Difference between mock and stubs ...

Build a Visual Studio Project without access to referenced dlls

I have a project which has a set of binary dependencies (assembly dlls for which I do no have the source code). At runtime those dependencies are required pre-installed on the machine and at compile time they are required in the source tree, e,g in a lib folder. As I'm also making source code available for this program I would like to e...

PHPUnit - multiple stubs of same class

I'm building unit tests for class Foo, and I'm fairly new to unit testing. A key component of my class is an instance of BarCollection which contains a number of Bar objects. One method in Foo iterates through the collection and calls a couple methods on each Bar object in the collection. I want to use stub objects to generate a serie...

RhinoMocks Stub return real instance

I'm trying to use RhinoMocks to stub out a third party component. The third party component looks like the following. public class connection { public connection(string host,int port) {} public void Submit(message msg) {} } public class message { public message(string recipient) {} { When I attempt to use a s...

Stub PHP native methods

In my unit test, i'm looking to stub the behaviour of php's inbuilt file_get_contents() method. Is there a way to stub native methods in PHP (such as file_get_contents() or print_r()) and the likes? ...

How can I get the mapi system stub dll to pass extended mapi calls to my dll?

For various reasons (questioning the reasons is not helpful to me), I'd like to implement my own extended mapi dll for windows xp. I have a skeleton dll now, just a few entrypoints exist for testing, but the system mapi stub (c:\windows\system32\mapi32.dll, I've checked that it's identical to mapistub.dll) will not pass through calls t...

RSpec: Can't convert Image to String when using Nested Resource.

I'm having trouble with and RSpec view test. I'm using nested resources and the model with a belongs_to association. Here's what I have so far: describe "/images/edit.html.erb" do include ImagesHelper before(:each) do @image_pool = stub_model(ImagePool, :new_record => false, :base_path => '/') ...

Version control - stubs and mocks

For the sake of this question, I don't care about the difference between stubs, mocks, dummies, fakes, etc. Let's say I'm working on a project with one other person. I'm working on component A and he is working on component B. They work together, so I stub out B for testing, and he stubs out A. We're working in a DVCS, let's say Git, be...

how to generate unique title like wordpress?

hye im maya, i need to generate unique title like wordpress. if title hello-world is exist,the next title will be hello-world-2 thanks ...

Unknown Exception on trying to initialize the web service stub created by Axis C++

Hi, I am trying out the sample calculator program given in the folder of axis c++. I am mainly interested in the client side. So I used the wsdl to create the stubs and my main is pretty much the same as given in the sample. However on executing the call Calculator ws (endpoint) I get an unknown exception "First-chance exception at 0...

How to keep your unit tests simple and isolated and still guarantee DDD invariants ?

DDD recommends that the domain objects should be in a valid state at any time. Aggregate roots are responsible for guaranteeing the invariants and Factories for assembling objects with all the required parts so that they are initialized in a valid state. However this seems to complicate the task of creating simple, isolated unit tests a...

Is there a way to undo Mocha stubbing of any_instance in Test::Unit

Much like this question, I too am using Ryan Bates's nifty_scaffold. It has the desirable aspect of using Mocha's any_instance method to force an "invalid" state in model objects buried behind the controller. Unlike the question I linked to, I'm not using RSpec, but Test::Unit. That means that the two RSpec-centric solutions there won't...

Stub web calls in Scala

I'm currently writing a wrapper of the Spotify Metadata API to learn Scala. Everything's fine and dandy but I'd like to unit test the code. To properly do this I'll need to stub the Spotify API and get consistent return values (stuff like popularity of tracks changes very frequently). Does anybody know how to stub web calls in Scala, th...