THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
...
Code Block |
---|
public static Test suite() { Class[] classes = new Class[] {PartitionedRegionBucketCreationDistributionDUnitTest.class, InterruptsConserveSocketsFalseDUnitTest.class, PartitionedRegionRedundancyZoneDUnitTest.class, PartitionedRegionTestUtilsDUnitTest.class}; return new TestSuite(classes); } |
Code Block |
---|
A complete example: Note, it mixed dunit tests and junit tests.
package com.gemstone.gemfire.internal.cache.wan;
import com.gemstone.gemfire.internal.cache.DistributedRegionJUnitTest;
import com.gemstone.gemfire.internal.cache.PartitionedRegionRedundancyZoneDUnitTest;
import com.gemstone.gemfire.internal.cache.PartitionedRegionTestUtilsDUnitTest;
import com.gemstone.gemfire.internal.cache.wan.misc.ShutdownAllPersistentGatewaySenderDUnitTest;
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
@Category(UnitTest.class)
public class MyTestCase extends TestCase {
public static Test suite() {
Class[] classes = new Class[] {
CacheClientNotifierDUnitTest.class,
ShutdownAllPersistentGatewaySenderDUnitTest.class,
PartitionedRegionRedundancyZoneDUnitTest.class,
PartitionedRegionTestUtilsDUnitTest.class,
DistributedRegionJUnitTest.class
};
return new TestSuite(classes);
}
}
Or a new version:
@RunWith(Suite.class)
@Suite.SuiteClasses({ CacheClientNotifierDUnitTest.class, DistributedRegionJUnitTest.class })
//@Category(UnitTest.class)
public class MyTestCase2 extends TestCase {
}
|
Fixing suspect strings
Distributed tests check the log output from each test for "suspect strings" which include any warnings, errors, or exceptions. If your test is supposed to log one of these strings, you can add an expected exception to the beginning of your test method, or even in your setUp method if all test cases are expected to log this message. There is no need to remove the expected exception, it is automatically removed in tearDown().
...