GridGain™ 4.3.1e
Enterprise "Big Data" Edition

org.gridgain.grid.test
Annotation Type GridifyTest


@Documented
@Retention(value=RUNTIME)
@Target(value={TYPE,METHOD})
public @interface GridifyTest

Annotation for grid-enabling JUnit3 and Junit4 tests.

JUnit3

To enable JUnit3 tests using GridifyTest annotation, simply attach this annotation to "static suite()" method for a test suite you would like to grid-enable.
 public class GridifyJunit3ExampleTestSuite {
     // Standard JUnit3 suite method. Note we attach @GridifyTest
     // annotation to it, so it will be grid-enabled.
     @GridifyTest
     public static TestSuite suite() {
         TestSuite suite = new TestSuite("Example Test Suite");

         // Nested test suite to run tests A and B sequentially.
         TestSuite nested = new TestSuite("Example Nested Sequential Suite");

         nested.addTestSuite(TestA.class);
         nested.addTestSuite(TestB.class);

         // Add tests A and B.
         suite.addTest(nested);

         // Add other tests.
         suite.addTestSuite(TestC.class);
         suite.addTestSuite(TestD.class);

         return suite;
     }
 }
 

JUnit4

To enable JUnit4 tests using GridifyTest annotation, you need to attach this annotation to the same class that has Suite annotation (only Suite runners can be grid-enabled in JUnit4).
  @RunWith(Suite.class)
  @SuiteClasses({
      GridJunit4ExampleNestedSuite.class, // Nested suite that will execute tests A and B added to it sequentially.
      TestC.class, // Test C will run in parallel with other tests.
      TestD.class // TestD will run in parallel with other tests.
  })
  @GridifyTest // Run this suite on the grid.
  public class GridifyJunit4ExampleSuite {
      // No-op.
  }
 
 @RunWith(Suite.class)
 @SuiteClasses({
     TestA.class,
     TestB.class
 })
 public class GridJunit4ExampleNestedSuite {
     // No-op.
 }
 

Jboss AOP Configuration

The following configuration needs to be applied to enable JBoss byte code weaving. Note that GridGain is not shipped with JBoss and necessary libraries will have to be downloaded separately (they come standard if you have JBoss installed already):

AspectJ AOP Configuration

The following configuration needs to be applied to enable AspectJ byte code weaving.

 

Optional Element Summary
 String configPath
          Optional configuration path.
 boolean disabled
          Indicates whether grid is disabled or not.
 Class<? extends GridTestRouter> routerClass
          Optional router class.
 long timeout
          Distributed test suite timeout in milliseconds, default is 0 which means that tests will never expire.
 

configPath

public abstract String configPath
Optional configuration path. Default is "config/junit/junit-spring.xml".

Default:
"config/junit/junit-spring.xml"

routerClass

public abstract Class<? extends GridTestRouter> routerClass
Optional router class. Default is GridTestRouterAdapter class.

Default:
org.gridgain.grid.test.GridTestRouterAdapter.class

disabled

public abstract boolean disabled
Indicates whether grid is disabled or not.

Default:
false

timeout

public abstract long timeout
Distributed test suite timeout in milliseconds, default is 0 which means that tests will never expire.

Default:
0L

GridGain™ 4.3.1e
Enterprise "Big Data" Edition

GridGain - In-Memory Big Data
Enterprise "Big Data" Edition, ver. 4.3.1e.10112012
2012 Copyright © GridGain Systems
Follow us:   Follow GridGain on Github Join GridGain User Group Follow GridGain on Twitter Follow GridGain on Vimeo