Testing Oracle ATG Commerce with ATG Dust

 

Introduction

ATG Dust is a Java unit testing framework based on JUnit meant for use with Oracle ATG Commerce.

 

How ATG Dust works

In a non ATG application, when you create a unit test against a class, the test is often executing by instantiating the class directly, and calling methods inside it. Code written for Oracle ATG Commerce works a bit differently than a standalone class, or set of classes.

In Oracle ATG Commerce, your custom class is often called a component. ATG components are loaded by, and run inside of Nucleus. You can learn more about Nucleus in the ATG product manuals, but for the purposes of this article, think of Nucleus as a container that loads your class into the ATG application. When you want to access the class, you do so through Nucleus.

ATG Dust allows your JUnit test to access your class through Nucleus. If you attempt to write tests directly against your class, you will likely find yourself creating many mock objects, and having to play games to simulate everything Nucleus provides. By running the unit test through the Dust framework, you are actually starting an instance of Nucleus, and executing your test cases against a running instance of Oracle ATG Commerce.

Since you having a running instance of Nucleus, you can run tests against the real, live components your actual ATG application will use. Access to pipelines, repositories, real shopping carts – they are all live and running. There is no need to mock all the other components your code interacts with or depends on.

Using ATG Dust

The ATG Dust testing framework was updated and moved to the Oracle Technology Network in mid-2016.

Support for Oracle ATG Commerce 11.x was added, as well as new features to allow for faster test case development.

Example tests are included to help get you started on writing your own test cases.

The ATG Dust code, examples, and documentation can be found on the Oracle Commerce sample code section of the Oracle Technology Network:

http://www.oracle.com/technetwork/indexes/samplecode/commerce-samples-2766867.html

 

The samples provided demonstrate running tests with either Maven or Apache Ant.

Unit tests using the ATG Dust framework can be run locally, automatically with continuous integration tools like Hudson and Jenkins, and in Oracle Developer Cloud.

 

 

Add Your Comment