Skip to content

Commit

Permalink
GEODE-2121 add DLockTest and other categories
Browse files Browse the repository at this point in the history
I need these test categories in order to run code-coverage analysis for
the components I usually work with. The categories should be added to
the appropriate unit tests.
  • Loading branch information
bschuchardt committed Nov 18, 2016
1 parent cbff37e commit 845139e
Show file tree
Hide file tree
Showing 219 changed files with 728 additions and 366 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import java.util.stream.Collectors;
import java.util.stream.Stream;

import org.apache.geode.test.junit.categories.RestAPITest;
import org.junit.Before;
import org.junit.Test;
import org.junit.experimental.categories.Category;
Expand All @@ -37,7 +38,7 @@
import org.apache.geode.test.junit.categories.IntegrationTest;
import org.apache.geode.util.test.TestUtil;

@Category(IntegrationTest.class)
@Category({IntegrationTest.class, RestAPITest.class})
public class BundledJarsJUnitTest {

private static final String VERSION_PATTERN = "[0-9-_.v]{3,}.*\\.jar$";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
import org.apache.geode.pdx.PdxWriter;
import org.apache.geode.pdx.ReflectionBasedAutoSerializer;
import org.apache.geode.test.junit.categories.IntegrationTest;
import org.apache.geode.test.junit.categories.RestAPITest;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
Expand Down Expand Up @@ -85,7 +86,7 @@
// @RunWith(SpringJUnit4ClassRunner.class)
// @ContextConfiguration
@SuppressWarnings("unused")
@Category(IntegrationTest.class)
@Category({IntegrationTest.class, RestAPITest.class})
public class RestInterfaceJUnitTest {

protected static int DEFAULT_HTTP_SERVICE_PORT = 8189;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import org.apache.geode.test.dunit.Assert;
import org.apache.geode.test.dunit.rules.ServerStarterRule;
import org.apache.geode.test.junit.categories.IntegrationTest;
import org.apache.geode.test.junit.categories.RestAPITest;
import org.apache.http.HttpResponse;
import org.json.JSONArray;
import org.junit.BeforeClass;
Expand All @@ -30,7 +31,7 @@

import java.util.Properties;

@Category(IntegrationTest.class)
@Category({IntegrationTest.class, RestAPITest.class})
public class RestServersJUnitTest {

private static int defaultPort = 7070;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import org.apache.geode.test.dunit.rules.ServerStarterRule;
import org.apache.geode.security.templates.SimpleSecurityManager;
import org.apache.geode.test.junit.categories.IntegrationTest;
import org.apache.geode.test.junit.categories.RestAPITest;
import org.apache.http.HttpResponse;
import org.json.JSONObject;
import org.junit.ClassRule;
Expand All @@ -35,8 +36,7 @@

import java.util.Properties;

@Category(IntegrationTest.class)

@Category({IntegrationTest.class, RestAPITest.class})
public class SwaggerVerificationTest {

private static int restPort = AvailablePortHelper.getRandomAvailableTCPPort();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
*/
package org.apache.geode.cache;

import org.apache.geode.test.junit.categories.ClientServerTest;
import org.junit.experimental.categories.Category;
import org.junit.Test;

Expand All @@ -36,7 +37,7 @@

import static org.apache.geode.distributed.ConfigurationProperties.LOCATORS;

@Category(DistributedTest.class)
@Category({DistributedTest.class, ClientServerTest.class})
public class ClientServerTimeSyncDUnitTest extends JUnit4CacheTestCase {

public ClientServerTimeSyncDUnitTest() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import java.io.IOException;
import java.util.Properties;

import org.apache.geode.test.junit.categories.ClientServerTest;
import org.junit.Test;
import org.junit.experimental.categories.Category;

Expand All @@ -39,7 +40,7 @@
/**
* This tests cases where we have both a connection pool and a bridge loader.
*/
@Category(DistributedTest.class)
@Category({DistributedTest.class, ClientServerTest.class})
public class ConnectionPoolAndLoaderDUnitTest extends JUnit4CacheTestCase {

private static int bridgeServerPort;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,15 @@
import org.apache.geode.cache30.ClientServerTestCase;
import org.apache.geode.test.dunit.Invoke;
import org.apache.geode.test.dunit.SerializableRunnable;
import org.apache.geode.test.junit.categories.ClientServerTest;
import org.apache.geode.test.junit.categories.DistributedTest;

import static org.junit.runners.MethodSorters.*;
import org.junit.FixMethodOrder;
import org.junit.experimental.categories.Category;

@FixMethodOrder(NAME_ASCENDING)
@Category(DistributedTest.class)
@Category({DistributedTest.class, ClientServerTest.class})
public class ConnectionPoolAutoDUnitTest extends ConnectionPoolDUnitTest {

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import java.util.Properties;
import java.util.Set;

import org.apache.geode.test.junit.categories.ClientServerTest;
import org.junit.FixMethodOrder;
import org.junit.Ignore;
import org.junit.Test;
Expand Down Expand Up @@ -81,7 +82,7 @@
*
* Test uses Groboutils TestRunnable objects to achieve multi threading behavior in the test.
*/
@Category(DistributedTest.class)
@Category({DistributedTest.class, ClientServerTest.class})
@FixMethodOrder(NAME_ASCENDING)
public class ConnectionPoolDUnitTest extends JUnit4CacheTestCase {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import org.apache.geode.cache.client.PoolManager;
import org.apache.geode.distributed.DistributedSystem;
import org.apache.geode.internal.cache.PoolFactoryImpl;
import org.apache.geode.test.junit.categories.ClientServerTest;
import org.apache.geode.test.junit.categories.IntegrationTest;
import org.junit.After;
import org.junit.Before;
Expand All @@ -31,7 +32,7 @@
import static org.apache.geode.distributed.ConfigurationProperties.*;
import static org.junit.Assert.*;

@Category(IntegrationTest.class)
@Category({IntegrationTest.class, ClientServerTest.class})
public class ConnectionPoolFactoryJUnitTest {

private Cache cache;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;

import org.apache.geode.test.junit.categories.MembershipTest;
import org.junit.Test;
import org.junit.experimental.categories.Category;

Expand All @@ -29,7 +30,7 @@
/**
* Tests MembershipAttributes and SubscriptionAttributes to make sure they are Serializable
*/
@Category(UnitTest.class)
@Category({UnitTest.class, MembershipTest.class})
public class MembershipAttributesAreSerializableTest {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import org.apache.geode.cache.client.PoolManager;
import org.apache.geode.distributed.DistributedSystem;
import org.apache.geode.internal.cache.PoolFactoryImpl;
import org.apache.geode.test.junit.categories.ClientServerTest;
import org.apache.geode.test.junit.categories.IntegrationTest;
import org.junit.After;
import org.junit.Before;
Expand All @@ -37,7 +38,7 @@
*
* @since GemFire 5.7
*/
@Category(IntegrationTest.class)
@Category({IntegrationTest.class, ClientServerTest.class})
public class PoolManagerJUnitTest {

private DistributedSystem ds;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import org.apache.geode.internal.cache.GemFireCacheImpl;
import org.apache.geode.internal.cache.tier.sockets.ClientProxyMembershipID;
import org.apache.geode.pdx.ReflectionBasedAutoSerializer;
import org.apache.geode.test.junit.categories.ClientServerTest;
import org.apache.geode.test.junit.categories.IntegrationTest;
import org.jgroups.util.UUID;
import org.junit.After;
Expand Down Expand Up @@ -60,7 +61,7 @@
* @since GemFire 6.5
*/
@FixMethodOrder(NAME_ASCENDING)
@Category(IntegrationTest.class)
@Category({IntegrationTest.class, ClientServerTest.class})
public class ClientCacheFactoryJUnitTest {

private ClientCache cc;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import org.apache.geode.distributed.DistributedSystem;
import org.apache.geode.distributed.internal.InternalDistributedSystem;
import org.apache.geode.internal.cache.LocalRegion;
import org.apache.geode.test.junit.categories.ClientServerTest;
import org.apache.geode.test.junit.categories.IntegrationTest;
import org.junit.After;
import org.junit.Rule;
Expand All @@ -43,7 +44,7 @@
*
* @since GemFire 6.5
*/
@Category(IntegrationTest.class)
@Category({IntegrationTest.class, ClientServerTest.class})
public class ClientRegionFactoryJUnitTest {

@Rule
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,15 @@
*/
package org.apache.geode.cache.client;

import static org.apache.geode.distributed.ConfigurationProperties.*;
import static org.junit.Assert.*;

import java.io.IOException;
import java.net.UnknownHostException;
import java.util.Stack;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;

import org.junit.Test;
import org.junit.experimental.categories.Category;
import static org.apache.geode.distributed.ConfigurationProperties.DURABLE_CLIENT_ID;
import static org.apache.geode.distributed.ConfigurationProperties.LOG_FILE;
import static org.apache.geode.distributed.ConfigurationProperties.LOG_LEVEL;
import static org.apache.geode.distributed.ConfigurationProperties.MCAST_PORT;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;

import org.apache.geode.cache.Cache;
import org.apache.geode.cache.CacheFactory;
Expand All @@ -43,15 +41,24 @@
import org.apache.geode.test.dunit.SerializableRunnable;
import org.apache.geode.test.dunit.VM;
import org.apache.geode.test.dunit.internal.JUnit4DistributedTestCase;
import org.apache.geode.test.junit.categories.ClientSubscriptionTest;
import org.apache.geode.test.junit.categories.DistributedTest;
import org.junit.Test;
import org.junit.experimental.categories.Category;

import java.io.IOException;
import java.net.UnknownHostException;
import java.util.Stack;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;

/**
* The ClientServerRegisterInterestsDUnitTest class is a test suite of test cases testing the
* interaction between a client and a server in a Register Interests scenario.
*
* @since GemFire 8.0
*/
@Category(DistributedTest.class)
@Category({DistributedTest.class, ClientSubscriptionTest.class})
public class ClientServerRegisterInterestsDUnitTest extends JUnit4DistributedTestCase {

protected static final long WAIT_TIME_MILLISECONDS = TimeUnit.SECONDS.toMillis(5);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
* Tests cases that are particular for the auto connection source - dynamically discovering servers,
* locators, handling locator disappearance, etc.
*/
@Category(DistributedTest.class)
@Category({DistributedTest.class, ClientServerTest.class})
public class AutoConnectionSourceDUnitTest extends LocatorTestBase {

protected static final Object BRIDGE_LISTENER = "BRIDGE_LISTENER";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import org.apache.geode.internal.net.SocketCreator;
import org.apache.geode.management.membership.ClientMembershipEvent;
import org.apache.geode.management.membership.ClientMembershipListener;
import org.apache.geode.test.junit.categories.ClientServerTest;
import org.apache.geode.test.junit.categories.IntegrationTest;
import org.junit.After;
import org.junit.Before;
Expand Down Expand Up @@ -68,7 +69,7 @@
*
*/
@SuppressWarnings("deprecation")
@Category(IntegrationTest.class)
@Category({IntegrationTest.class, ClientServerTest.class})
public class AutoConnectionSourceImplJUnitTest {

private Cache cache;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
import org.apache.geode.test.dunit.IgnoredException;
import org.apache.geode.test.dunit.VM;
import org.apache.geode.test.dunit.internal.JUnit4DistributedTestCase;
import org.apache.geode.test.junit.categories.ClientServerTest;
import org.apache.geode.test.junit.categories.DistributedTest;
import org.apache.geode.util.test.TestUtil;
import org.junit.Test;
Expand All @@ -47,7 +48,7 @@
* Tests cacheserver ssl support added. See https://svn.gemstone.com/trac/gemfire/ticket/48995 for
* details
*/
@Category(DistributedTest.class)
@Category({DistributedTest.class, ClientServerTest.class})
public class CacheServerSSLConnectionDUnitTest extends JUnit4DistributedTestCase {

private static final String TRUSTED_STORE = "trusted.keystore";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import org.apache.geode.distributed.internal.ServerLocation;
import org.apache.geode.internal.AvailablePort;
import org.apache.geode.internal.AvailablePortHelper;
import org.apache.geode.test.junit.categories.ClientServerTest;
import org.apache.geode.test.junit.categories.IntegrationTest;
import org.junit.After;
import org.junit.Before;
Expand All @@ -42,7 +43,7 @@
/**
*
*/
@Category(IntegrationTest.class)
@Category({IntegrationTest.class, ClientServerTest.class})
public class ConnectionPoolImplJUnitTest {

private static final String expectedRedundantErrorMsg =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
*/
package org.apache.geode.cache.client.internal;

import org.apache.geode.test.junit.categories.ClientServerTest;
import org.junit.experimental.categories.Category;
import org.junit.Test;

Expand Down Expand Up @@ -65,7 +66,7 @@
/**
*
*/
@Category(DistributedTest.class)
@Category({DistributedTest.class, ClientServerTest.class})
public class LocatorLoadBalancingDUnitTest extends LocatorTestBase {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import java.util.Set;
import java.util.concurrent.ScheduledExecutorService;

import org.apache.geode.test.junit.categories.ClientServerTest;
import org.junit.Before;
import org.junit.Test;
import org.junit.experimental.categories.Category;
Expand All @@ -46,7 +47,7 @@
import org.apache.geode.internal.logging.LocalLogWriter;
import org.apache.geode.test.junit.categories.UnitTest;

@Category(UnitTest.class)
@Category({UnitTest.class, ClientServerTest.class})
public class OpExecutorImplJUnitTest {

DummyManager manager;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import org.apache.geode.internal.logging.InternalLogWriter;
import org.apache.geode.internal.logging.LocalLogWriter;
import org.apache.geode.internal.util.StopWatch;
import org.apache.geode.test.junit.categories.ClientServerTest;
import org.apache.geode.test.junit.categories.IntegrationTest;
import org.junit.After;
import org.junit.Before;
Expand All @@ -50,7 +51,7 @@
/**
*
*/
@Category(IntegrationTest.class)
@Category({IntegrationTest.class, ClientServerTest.class})
public class QueueManagerJUnitTest {

private static final String expectedRedundantErrorMsg =
Expand Down
Loading

0 comments on commit 845139e

Please sign in to comment.