• JMockit是一个有用的实用程序,这将帮助你进行测试,编写使用框架喜欢JUnit或TestNG的。 该工具依赖于Java5SE仪器的功能(java。郎。仪器包)、国内使用个体和小型图书馆的修改码在运行时间。

    目前有六个不同的部件/工具在JMockit工具包,其中可以单独使用,如下:

    JMockit核心-一个单一的类别与一个小组静态的方法,其中允许任意方法以及构造的任何其他类别取代模拟实现在运行时间。

    JMockit注释--提供了一对爪哇5语说明这一目的。 此外,限制数量的预期调用于每一个模拟可以提供。

    JMockit期望提供一个记录/回放模型,用于编写测试,这允许更加简明扼要的测试。

    JMockit休眠模拟-假的执行情况的休眠3个核心Api,这可以被安装的地方真正实施的一个简单的JVM初始化的参数。 当那些运行的测试与模拟有效,他们不会使用O/R映射的信息,也没有将他们访问的任何真正的数据库。 所有持久性行动,包括非常查询,将执行反对相当于一个存储器数据库。

    JMockit AOP支持应用程序的咨询意见的任何方法或构造。 通常的种类型的咨询支持:之前、之后及周围。

  • JMockit एक उपयोगी उपयोगिताओं का सेट है कि प्रदर्शन करने में मदद मिलेगी परीक्षण का उपयोग कर लिखा चौखटे की तरह JUnit या TestNG. उपकरण पर भरोसा करते हैं, जावा एसई 5 इंस्ट्रूमेंटेशन सुविधा (जावा.लैंग.साधन पैकेज), आंतरिक उपयोग के ASM पुस्तकालय को संशोधित करने के लिए बाईटकोड क्रम में.

    वहाँ रहे हैं वर्तमान में छह अलग-अलग घटकों/उपकरणों में JMockit टूलकिट, जो इस्तेमाल किया जा सकता है, व्यक्तिगत रूप से के रूप में इस प्रकार है:

    JMockit कोर - एक एकल वर्ग के साथ एक छोटे से सेट के स्थिर तरीकों की अनुमति है, जो मनमाने तरीकों और भवन निर्माताओं के किसी भी अन्य वर्ग के लिए के साथ प्रतिस्थापित किया जा नकली कार्यान्वयन के क्रम में है ।

    JMockit एनोटेशन प्रदान करता है की एक जोड़ी जावा 5 भाषा एनोटेशन के लिए कि उद्देश्य है । इसके अलावा, बाधाओं की संख्या पर उम्मीद invocations के लिए प्रत्येक नकली प्रदान किया जा सकता है ।

    JMockit उम्मीदों - एक रिकॉर्ड प्रदान करते हैं/फिर से खेलना मॉडल के लिए लेखन परीक्षण है, जो की अनुमति देता है के लिए और अधिक संक्षिप्त परीक्षण.

    JMockit हाइबरनेट अनुकरण - एक नकली के कार्यान्वयन हाइबरनेट 3 कोर एपीआई हो सकता है, जो जगह में स्थापित के वास्तविक क्रियान्वयन के साथ एक सरल जेवीएम आरंभीकरण तर्क है । जब उन परीक्षणों को चलाने के अनुकरण के प्रभाव में, वे का उपयोग नहीं होगा, हे/आर मानचित्रण के बारे में जानकारी, और न ही वे किसी भी उपयोग वास्तविक डेटाबेस. सभी हठ संचालन सहित, HQL प्रश्नों, क्रियान्वित किया जाएगा, के खिलाफ के बराबर एक स्मृति-डेटाबेस ।

    JMockit एओपी का समर्थन करता है - आवेदन करने के लिए सलाह के किसी भी विधि या निर्माता. सामान्य प्रकार की सलाह का समर्थन कर रहे हैं: इससे पहले, बाद, और चारों ओर है ।

  • JMockit is a useful set of utilities that will help you perform test written using frameworks like JUnit or TestNG. The tools rely on the Java 5 SE instrumentation feature (the java.lang.instrument package), internally using the ASM library to modify bytecode at runtime.

    There are currently six different components/tools in the JMockit toolkit, which can be used individually, as follows:

    JMockit Core - a single class with a small set of static methods, which allow arbitrary methods and constructors of any other class to be replaced with mock implementations at runtime.

    JMockit Annotations - provides a pair of Java 5 language annotations for that purpose. In addition, constraints on the number of expected invocations for each mock can be provided.

    JMockit Expectations - provide a record/replay model for writing tests, which allows for more succinct tests.

    JMockit Hibernate Emulation - a fake implementation of the Hibernate 3 Core APIs, which can be installed in place of the real implementation with a simple JVM initialization argument. When those tests run with the emulation in effect, they won't use the O/R mapping information, nor will they access any real database. All persistence operations, including HQL queries, will be executed against the equivalent of an in-memory database.

    JMockit AOP - supports the application of advice to any method or constructor. The usual types of advice are supported: before, after, and around.