News Column

Researchers Submit Patent Application, "Unit Testing an Enterprise Javabeans (Ejb) Bean Class", for Approval

February 13, 2014



By a News Reporter-Staff News Editor at Computer Weekly News -- From Washington, D.C., VerticalNews journalists report that a patent application by the inventors Gu, Geng Xian (Shanghai, CN); Li, Hai Dong (Shanghai, CN), filed on July 19, 2012, was made available online on January 30, 2014.

The patent's assignee is International Business Machines Corporation.

News editors obtained the following quote from the background information supplied by the inventors: "Unit testing tests whether units of source code, usage procedures, operating procedures, and sets of computer program module(s) together with associated control data work correctly. Unit testing in object-oriented programming tests whether or not a class is fit for use. A known technique for unit testing an ENTERPRISE JAVABEANS.RTM. (EJB.RTM.) bean is performed on an EJB.RTM. container of a WEBSPHERE.RTM. Application Server by using features provided by EJB.RTM. architecture, such as annotation and runtime injection, and is referred to herein as an in-container testing mode. Each time source code is changed during testing, the aforementioned application server needs to reboot or redeploy. The in-container testing mode is provided in the Apache Cactus test framework for unit testing developed by the Apache Software Foundation. Alternatively, known unit testing of an EJB.RTM. bean uses a JUnit testing mode, whereby a unit test case cannot be reused in the in-container testing mode. The JUnit testing mode employs pure JUnit testing in a JUnit testing framework, which is a unit testing framework for the JAVA.RTM. programming language.

"An EJB.RTM. bean is a software component of the EJB.RTM. architecture, which is a server-side component architecture for modular construction of enterprise applications offered by Oracle Corporation located in Redwood Shores, Calif. WEBSPHERE.RTM. Application Server is an application server offered by International Business Machines Corporation located in Armonk, N.Y. ENTERPRISE JAVABEANS, EJB and JAVA are registered trademarks of Oracle Corporation. WEBSPHERE is a registered trademark of International Business Machines Corporation."

As a supplement to the background information on this patent application, VerticalNews correspondents also obtained the inventors' summary information for this patent application: "In a first embodiment, the present invention provides a method of unit testing an EJB.RTM. bean. The method comprises the steps of: a computer initiating a test case for a unit testing of the EJB bean with test data, the step of initiating the test case including a step of the computer receiving an indication that indicates a JUnit testing mode; based on the received indication indicating the JUnit testing mode and not indicating an in-container testing mode, the computer initiating the unit testing of the EJB.RTM. bean in the JUnit testing mode by injecting the EJB.RTM. bean by an injection functionality included in a test framework being executed by the computer; a test object of the injected EJB.RTM. bean operating business logic on business data by performing a step of inserting the business data into a database, updating the business data in the database, deleting the business data from the database, or selecting the business data to send to a client, an outcome of the step of operating the business logic being a set of resulting business data; the computer retrieving expected data corresponding to the test data and subsequently, the computer asserting the set of resulting business data against the retrieved expected data; and based on the step of asserting the set of resulting business data against the retrieved expected data, the computer determining the test case succeeds or fails.

"A system, program product and a process for supporting computing infrastructure where the process provides at least one support service are also described and claimed herein, where the system, program product and process for supporting computing infrastructure correspond to the aforementioned method.

"Embodiments of the present invention increase unit testing efficiency by integrating an in-container testing mode as an extension to a pure JUnit testing mode, thereby allowing the utilization of a unit test case from the beginning of a coding phase to the end of the testing phase of a project and allowing a unit test case in JUnit testing to be re-used in in-container testing. The extension of the JUnit testing mode may include the injection functionality of an EJB.RTM. container testing mode. Embodiments disclosed herein extend the TestCase class of JUnit and implements the functionality provided by ServletTestSuite in the Apache Cactus test framework. Embodiments of the present invention increase coding and testing efficiency by avoiding a need to redeploy the WEBSPHERE.RTM. Application Server in response to changes in the source code. Furthermore, embodiments disclosed herein provide automatic testing from the beginning of test data preparation to the end of test result assertion, thereby avoiding the manual preparation of test data into a database.

BRIEF DESCRIPTION OF THE DRAWINGS

"FIG. 1 is a system context diagram of a system for unit testing an EJB.RTM. bean class, in accordance with embodiments of the present invention.

"FIG. 2 is a flowchart of a process of unit testing an EJB.RTM. bean class in the system of FIG. 1, in accordance with embodiments of the present invention.

"FIG. 3 is a configuration file used by the test framework included in the system of FIG. 1, in accordance with embodiments of the present invention.

"FIG. 4 is a deployment descriptor that redirects a test client to the test framework included in the system of FIG. 1, in accordance with embodiments of the present invention.

"FIG. 5 is a class diagram for describing the core design of the test framework in the system of FIG. 1, in accordance with embodiments of the present invention.

"FIG. 6 is exemplary code for overwriting a runBare method in the class diagram of FIG. 5, in accordance with embodiments of the present invention.

"FIG. 7 is exemplary code for the doPreRun method called from the code in FIG. 6, in accordance with embodiments of the present invention.

"FIG. 8 is exemplary code for injecting a test object by an EJB.RTM. container from a method call in the code in FIG. 7, in accordance with embodiments of the present invention.

"FIG. 9 is exemplary code for injecting a test object by the framework supporting the EJB.RTM. container mode of unit testing from a method call in the code in FIG. 7, in accordance with embodiments of the present invention.

"FIG. 10 is exemplary code for the createTestSuite method in the class diagram of FIG. 5, in accordance with embodiments of the present invention.

"FIG. 11 is exemplary code for the suite method in the class diagram of FIG. 5, in accordance with embodiments of the present invention.

"FIG. 12 is a flowchart of a process for injecting an EJB.RTM. bean instance in a pure JUnit mode in the process of FIG. 2, in accordance with embodiments of the present invention.

"FIG. 13 is a block diagram of a computer system that is included in the system of FIG. 1 and that implements the process of FIG. 2, in accordance with embodiments of the present invention."

For additional information on this patent application, see: Gu, Geng Xian; Li, Hai Dong. Unit Testing an Enterprise Javabeans (Ejb) Bean Class. Filed July 19, 2012 and posted January 30, 2014. Patent URL: http://appft.uspto.gov/netacgi/nph-Parser?Sect1=PTO2&Sect2=HITOFF&u=%2Fnetahtml%2FPTO%2Fsearch-adv.html&r=159&p=4&f=G&l=50&d=PG01&S1=20140123.PD.&OS=PD/20140123&RS=PD/20140123

Keywords for this news article include: Software, International Business Machines Corporation.

Our reports deliver fact-based news of research and discoveries from around the world. Copyright 2014, NewsRx LLC


For more stories covering the world of technology, please see HispanicBusiness' Tech Channel



Source: Computer Weekly News


Story Tools