stub

using rmic in netbeans

I have written rmi server code in netbeans 6.5. how can i use rmic in netbeans 6.5 so that i can create server_stub class? ...

Teaching testing habits to other developers?

Developers have many different options out there to create fast and relatively maintainable unit test suites. But this takes a great deal of knowledge involved in decoupling modules of code, isolating the code under test within its test context, and using test doubles (stubs, fakes, mocks). What's more confusing is that within the conc...

When to Expect and When to Stub?

I use NMock2, and I've drafted the following NMock classes to represent some common mock framework concepts: Expect: this specifies what a mocked method should return and says that the call must occur or the test fails (when accompanied by a call to VerifyAllExpectationsHaveBeenMet()). Stub: this specifies what a mocked method should r...

How-to do unit-testing of methods involving file input output?

Hello, I'm using C++Test from Parasoft for unit testing C++ code. I came across the following problem. I have a function similar to the next one (pseudocode): bool LoadFileToMem(const std::string& rStrFileName) { if( openfile(rStrFileName) == successfull ) { if( get_file_size() == successfull ) { i...

"Duplicate file name" for same WSDL namespace when using web-service from different sub-domains

Preface We are providing customers with our service API. Each customer has own subdomain (e.g. sergii.ourwebsite.com) and own WSDL URL, it looks like http://sergii.ourwebsite.com/api/bsapi.cfc?wsdl Also, all the websites (including API, of course) using the same codebase. Problem Say, two applications on same CF-server. This can ...

Usage of Assert.Inconclusive

Hi, Im wondering how someone should use Assert.Inconclusive(). I'm using it if my Unit test would be about to fail for a reason other than what it is for. E.g. i have a method on a class that calculates the sum of an array of ints. On the same class there is also a method to calculate the average of the element. It is implemented by ca...

Autogeneration of tests and stubs with CUnit.

Does anybody know of a free/commercial tool that would automatically generate tests and stubs for C code to work with CUnit framework? ...

Creating BlackBerry method stubs using wscompile on WSDL from ColdFusion

I have been working on a BlackBerry application that consumes web services from ColdFusion 7. The Java ME SDK and the Java Wireless Toolkit both require that the generated WSDL be of the document/literal type. Fortunately, I have input on the web service development so I tried setting 'style="document"' in the cfcomponent tag. This gene...

Create an instance of an ASMX stub object from a real object

I have an ASMX web service that exposes several objects. I have a real instance of that object, and I would like to instantiate a stub object that is populated from it. Clearly there is such functionality already, because when the web service returns a value it is creating the stub and populating it. I just need to do the same thing man...

groovy mocks with abstract methods

I have a Java object called Parameter and I'm trying to mock it using groovy. Parameter is an abstract class with 1 abstract method. It also has a non-abstract method called getName(). I'm trying to mock it as follows in Groovy: def p1 = [name:{"p1Name"}] as Parameter But I get a runtime error because I don't implement the abstract m...

What's the best way to fill POCOs with dummy data?

I have a bunch of POCOs that all relate to each other in a big tree. For example, this is the top-level element: public class Incident : Entity<Incident> { public virtual string Name { get; set; } public virtual DateTime Date { get; set; } public virtual IEnumerable<Site> Sites { get; set; } public Incident() { ...

Where can I find ejb _*_Wrapper and __*_Remote_DynamicStub classes?

I've got a fairly boring stateful session bean called MyEJB, and I'm using Glassfish 2.1 and javaws. Everything works fine, except method calls which return a lot of data are taking an inordinately long time. Wireshark tells me the network communication is over pretty quickly, so the problem is on the client side...in the stub. Using a n...

Use reflection stub to initialize a delegate field lazily

The problem: a .Net 2.0 class with a few thousand delegate fields generated by a code generator varying signatures delegates may or may not return values no generics these delegates much be initialized quickly at runtime initializing a delegate is simple but expensive initializing the whole lot costs ~300ms right now - acceptable,...

Alter initial Visual Studio code behind stub code?

When I add a new form to an ASP.NET project (WebForms), and then "View Code" some basic stub code is added -- basic "using" statements, form_load event, etc. So the first thing I have to do is add some project usings, etc. Is there anyway to alter this canned code to what I want, vs. what it puts up by default? Would templates be the ...

Faking web requests in Rails test without Fakeweb

I'm using the Handsoap gem with Httpclient gem as the driver in a Rails app. How can I prevent network calls from Handsaop/Httpclient gems in test cases? FakeWeb doesn't support Httpclient. ...

How can I provide an API stub for an MEF component?

The Visual Studio 2010 SDK ships with many assemblies like Microsoft.VisualStudio.Text.Data and Microsoft.VisualStudio.Text.UI that are just stubs. To write an extension for Visual Studio, you reference these assemblies, but set "Copy Local" and "Exact Version" properties of the references to false. When your extension is loaded in Visua...

"Time out" when multithreading requests to a webservice with java and axis2

Hi, I'm working with a slow webservice (about 4 minutes each request) and I need to do about 100 requests in two hours, so I've decided to use multiple threads. The problem is that I can only have 2 threads, as the stub rejects all the other ones. Here I've found an explanation and possible solution: I had the same problem. It seems...

Rhino.Mocks - Stub one method of class and let other real methods use this stubbed one

I have TimeMachine class which provides me current date/time values. The class looks like this: public class TimeMachine { public virtual DateTime GetCurrentDateTime(){ return DateTime.Now; }; public virtual DateTime GetCurrentDate(){ return GetCurrentDateTime().Date; }; public virtual TimeSpan GetCurrentTime(){ return GetCurrentDate...

Does mocha run the code in a stub (Rails)?

Im new to tdd and stubbing. When I stub a method im assumng that any code within that method does not get executed? Im trying to fake the method raising an exception but the results of my test indicate that the code in that method is being executed rather than bypassed. can anyone help explain why? My stubbing is @logged_in_user.subs...

Axis wsdl2java not generating all interfaces in stub

I am trying to generate stub using wsdl2java.bat, my wsdl consists of two bindings. I see that wsdl2bat creates interface for operations in the first binding but does not generate anything for operations in the seconds binding. wsdl2java.bat -uri http://... -o client -d adb -s -u. For example the code should look like this try { /...