模拟对象

  • 网络mocks;Mock object
模拟对象模拟对象
  1. 按照单元测试的术语,这称为模拟对象(mockobject),更多信息参见参考资料中的链接。

    In unit testing language , this is called a mock object ( see Resources for more information ) .

  2. 该数组被立刻传递给RMock的intercept()方法来帮助实例化模拟对象。

    That array is summarily fed into RMock 's intercept () method to help instantiate the mock object .

  3. 用UML模拟对象模型

    A Method of Simulating Object Model by Using UML

  4. 本文来自于RationalEdge:为创建使用模拟对象的单元测试,使用相对简单的技术产生更多的无缺陷代码。

    From The Rational Edge : Produce more bug-free code with relatively easy techniques for creating unit tests with mock objects .

  5. MockObject是用于解决对真实对象依赖的模拟对象。

    Mock Object is used to simulate the target object to cut the dependency of the real object .

  6. 我为此项目创建了两个模拟对象,分别模拟GPS设备和UI。

    I create two mock objects for this project to simulate the GPS device and the UI , respectively .

  7. 这对于在公共的setUp()方法中或在实际测试方法内定义的模拟对象来说是正确的。

    This is true for mock objects defined in a common setUp () method or within the actual test method .

  8. 模拟对象到Collaborator类型的类强制转换十分有必要,因为intercept()方法将返回类型Object。

    The class cast of the mock object into type Collaborator is necessary because the intercept () method returns type Object .

  9. 更关键的是,您可以轻松地注入模拟对象来替代真正的Speaker实现,并且无需影响其他的代码基就可以进行测试。

    More to the point , you could easily inject a mock object instead of a real Speaker implementation , and you could do a test without affecting the rest of your code base .

  10. 提供给jMockCGLIB的mock()方法的附加String参数被用作创建的模拟对象的标识符。

    The extra String parameter supplied to jMock CGLIB 's mock () method is used as an identifier for the mock object created .

  11. 文中给出了一种用UML来模拟对象模型的有效方法,通过可视化建模,使软件设计工具发挥更大的效用,更好地提高模型的重用性。

    The paper gives an effectual method about using UML to describe object model . Design tools of the software will bring into more avail and reuse of model will gain more improving by visual modeling .

  12. KentBeck将模拟对象描述为测试对象,该对象可以使用常量进行响应,从而实现开销大或复杂的资源的模仿版本。

    Kent Beck describes a mock object as a testing object , one that implements a fake version of an expensive or complicated resource by answering constants .

  13. 下一行是对模拟对象的通知,用于确保当它遇到executeJob()方法时,它应当返回字符串failure。

    The next line is a notification to the mock object to ensure that when it encounters the executeJob () method , it should return the string failure .

  14. 构建基于ClassB类的模拟对象并向其提供期望。

    A mock object based on a ClassB class is constructed and provided an expectation .

  15. 使用jMock,您可以从已创建的模拟对象(其中期望已经被设定)中提取代理实现。

    With jMock , you can extract proxy implementations from created mock objects , on which expectations have already been set .

  16. 采用与SARS病毒相似的副流感病毒作为模拟对象,进行了吸附及灭活该病毒的催化材料研究,并考察了催化材料对哺乳动物细胞的毒性。

    The parainfluenza virus ( PIV ), which is very similar to SARS coronavirus ( SARS CoV ), was used in the adsorption and inactivation experiments , and the cytotoxic effects of the catalytic materials to mammalian cells were also investigated .

  17. 模拟对象现已准备好在ServiceClass类中作为实际对象使用。

    The mock object is now ready for use in the ServiceClass class as a real object .

  18. 方法的签名类似于jMockCGLIBmock()方法的签名,因为这两种方法将接纳惟一模拟对象标识符作为参数。

    The signature of the method is similar to that of the jMock CGLIB mock () method because both methods take on unique mock object identifiers as arguments .

  19. 使用jMock(当然,还有RMock)时,在单一测试用例内每个模拟对象设置都要求有惟一标识符。

    When using jMock ( and , indeed , RMock ), unique identifiers are required per mock object setup within a single test case .

  20. 失败原因是jMock无法通过没有无参数构造函数的类定义创建可行的模拟对象。

    The reason for the failure is that jMock cannot create a viable mock object from a class definition in which there is no no-arguments constructor .

  21. 目的是在测试本身内启用属于RMock的那些模拟对象的较容易的配置并且更重要的是在最初设置期间启用这些配置。

    The goal is to enable an easier configuration of those mock objects belonging to RMock within the tests themselves and more importantly during their initial setup .

  22. 经验证明,如果测试类扩展的整个TestCase对象属于RMock,则通过两个框架构造和使用模拟对象将更容易。

    Experience shows that it 's easier to construct and use mock objects from both frameworks if the overall TestCase object from which the test class extends belongs to RMock .

  23. 本论文在研究现有的数控雕刻机与数控铣床的基础上,以FANUC这一典型的数控系统为模拟对象,提出了基于PC的数控模拟台的总体方案,并进行了试制。

    Based on studying the existing numerical control carving machine and numerical control tools , the target of imitating the typical numerical control system FANUC have been made . We have put forward the overall scheme based on PC numerical control simulation platform , and have trial-produced .

  24. 再次重新运行ServiceClassTest以达到最终的肯定结果:在模拟对象实例化期间提供的参数造成了所有差别。

    Rerun the ServiceClassTest once again to achieve the final positive result : The parameters you supplied during mock object instantiation made all the difference .

  25. 使用Maven来管理项目生命周期;使用模板技术实现代码生成,减少基础代码的编写;使用模拟对象及其他测试工具实现测试框架,提供对单元测试、集成测试和功能测试的支持。

    Use Maven to manage project life cycle ; use code generation to reduce the basic coding ; use of mock objects and other testing tools to achieve the test framework that provides unit testing , integration testing and functional testing support . 5 .

  26. 您现在必须找到一种方法把参数提供给模拟对象实例化过程以达到同样的效果,这就是使用RMock的原因。

    You 're now forced to find a way of providing arguments to the mock object instantiation process to achieve the same effect , which is precisely why you use RMock .

  27. 本例中的优点是使用jMock,因为在需要返回自我模拟对象的情况下,可以获得设置其他模拟对象所需的信息。

    The advantage in this case is with jMock because you can get what you need to set up other mock objects in case they need to return objects that are themselves mocks .

  28. 通过敦煌盆地自然地理和区域水文地质及盆地地下水均衡分析,将250m左右深度处稳定流线以上的含水层作为数值模拟对象,概化为非均质各向同性平面二维流混合层;

    By analyzing the physical geography , regional hydrology and geology information , and groundwater equilibrium of DunHuang Basin , this paper simulates the aquiferous layer which has the thickness of 250 m , and consider it as two dimension mixed layer which is heterosphere and isotropy .

  29. 图2:从接口创建一个模拟对象类

    Figure 2 : Creating a mock object class from an interface

  30. 一开始,模拟对象看上去令人生畏。

    At first , mock objects can seem quite daunting .