Questions tagged [stubs]

A stub is a small piece of code that takes the place of another component during testing.

A stub is a small piece of code that takes the place of another component during testing. The benefit of using a stub is that it returns consistent results, making the test easier to write. And you can run tests even if the other components are not working yet.

89 questions
0
votes
1 answer

PHPUnit Stub does not return needed value

I have the following unit test but I don't get back the needed values. Maybe I don't understand how this works correctly. class TestClass { public function getData() { $id = 1123; return $id; } } class Test_ClassTesting…
Tudor Ravoiu
  • 2,130
  • 8
  • 35
  • 56
0
votes
0 answers

C# mock-stub generation automation

I would like to replace my drivers layer from my C# application with simple stubs or mocks. Based on search i have done on web there are several tools supporting this feature e.g.(Microsoft Fakes, NSubstitute...). My question is if that tools are…
zeus2
  • 309
  • 2
  • 11
0
votes
1 answer

Using Microsoft Fakes and VB.net for Stubbing Property Get Method on a Stubbed Class

I have been using strictly Microsoft Fakes for Unit Testing. (therefore, I do not want nUnit or other examples.) I am able to create a Stub for a class which I previously thought would not be possible under the condition that classes need to…
a-1
  • 696
  • 5
  • 10
0
votes
1 answer

How to implement client code for the getting jar which is generated by wsdl2Java by CXF?

I am new to Webservice. I got xxxService.wsdl file from my client. I have generated jar using the following command with apache CXF: wsdl2java.bat -V -d com\xxxx\service\sso -clientjar xxxwsservice.jar xxxTokenWebService.wsdl. Now i got the jar.…
0
votes
1 answer

How to avoid duplicate definitions between stub and real code

I am trying to write unit tests for some legacy code written in C. The problem I encounter is that I regularly have to redefine structs used in the real code, in order to use them in the stub code. For example, let's say this is the header file with…
Chilon
  • 31
  • 4
0
votes
1 answer

JAX-WS - Port type object having differnt WSDL URL

I have a .Net Webservice and I used JAX-WS to generate the stubs for it (downloaded the WSDL and XSD locally). Now I packaged the stubs in one jar (stubs.jar) and the WSDL as well as XSD in other jar (wsdl.jar). I use the stubs like: URL url =…
kaps
  • 81
  • 2
  • 9
0
votes
1 answer

Rails testing - Stubs and mocks

I am working on a rails project, in which model queries a service and gets the data from the service. Now, when I want to write tests for models and controllers I need to imitate the service.I am fairly new to rails testing. I am confused as to what…
user1484793
  • 359
  • 3
  • 16
0
votes
1 answer

WSDL dont generate stub code for android (devicemgmt.wsdl)

What steps will reproduce the problem? Have eclipse adt, java jdk and maven installed 1.Have the pom.xml 2.Have the onvif.xsd 3.Have the devicemgmt.wsdl 4.Declare de ambiente variables for java JDK(JAVA_HOME), Maven(M2_HOME) and For…
0
votes
1 answer

Stubs access to the protected variables

I need to test this class: public abstract class GaBase { protected GoogleAnalyticsInfo GAInfo; protected abstract void PopulateGAInfo(); public string GetGoogleAnalyticsTag() { //Return any info related to GAInfo } …
Kapoue
  • 847
  • 2
  • 11
  • 15
0
votes
2 answers

Axis2 stubs generation issue

I generated Java stubs from WSDL using apache axis2, Apache tomcat 6 server instance for a SOAP web service. The generated stubs contains lots of errors(100) some of them were duplicate methods and there was some unusual error which said…
ishanaba
  • 65
  • 8
0
votes
1 answer

Different stubs generated by ColdFusion on two different servers

We have a dev server and a live server, both running ColdFusion 9. The ColdFusion versions are the same, the Java versions are the same, the JVM versions are the same. I am trying to connect to an external web service with coldfusion and on dev it…
0
votes
2 answers

Switching between .Net Webservice and Java Webservice by changing URL

Here is the situation. I have received a WSDL (and included XSD) from someone that is generated by an Apache/Tomcat server (Java). The company i do a project for, prefers .NET so i used wsdl.exe to generate a partial class and created the…
ZorbaSan
  • 3
  • 2
-1
votes
1 answer

reading object from session using Shims/stub in unit test C#

I have an mvc application .I need to write unit test cases for that application. In controllers of this application i m reading an object from session objectclass Obj = (objectclass)Session["Object"]; I need to fake this reading of object using…
Ramveer Singh
  • 39
  • 1
  • 5
-1
votes
1 answer

How can i get all bound RMI Stubs with their url?

is it possible to get all bound Stubs (hope this is right) and their url? Is that possible? To improve my Question i give you a Code sample like: (Binding) Registry registry = LocateRegistry.createRegistry(1099); …
Artur Rem
  • 209
  • 1
  • 4
  • 18
1 2 3 4 5
6