Move TestContextEventType enumeration to the org.springframework.data.gemfire.tests.extensions.spring.test.context.event package.

This commit is contained in:
John Blum
2021-03-22 19:42:38 -07:00
parent dfd0d8e324
commit 59488b0a54
4 changed files with 19 additions and 19 deletions

View File

@@ -13,7 +13,7 @@
* or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
package org.springframework.data.gemfire.tests.mock.test.context.event;
package org.springframework.data.gemfire.tests.extensions.spring.test.context.event;
import org.springframework.lang.NonNull;
import org.springframework.lang.Nullable;
@@ -47,7 +47,6 @@ public enum TestContextEventType {
AFTER_TEST_METHOD(AfterTestMethodEvent.class),
AFTER_TEST_CLASS(AfterTestClassEvent.class);
public static @Nullable TestContextEventType from(@Nullable TestContextEvent event) {
for (TestContextEventType eventType : values()) {

View File

@@ -21,8 +21,9 @@ import java.util.Optional;
import java.util.Set;
import java.util.concurrent.atomic.AtomicReference;
import org.springframework.data.gemfire.tests.extensions.spring.test.context.event.TestContextEventType;
import org.springframework.data.gemfire.tests.mock.GemFireMockObjectsSupport;
import org.springframework.data.gemfire.tests.mock.test.context.event.TestContextEventType;
import org.springframework.lang.NonNull;
import org.springframework.lang.Nullable;
import org.springframework.test.context.TestContext;
import org.springframework.test.context.TestExecutionListener;
@@ -36,8 +37,8 @@ import org.springframework.test.context.event.TestContextEvent;
* {@link Object Mock Objects} will be destroyed when this event occurs.
*
* @author John Blum
* @see org.springframework.data.gemfire.tests.extensions.spring.test.context.event.TestContextEventType
* @see org.springframework.data.gemfire.tests.mock.GemFireMockObjectsSupport
* @see org.springframework.data.gemfire.tests.mock.test.context.event.TestContextEventType
* @see org.springframework.test.context.TestContext
* @see org.springframework.test.context.TestExecutionListener
* @see org.springframework.test.context.event.TestContextEvent
@@ -77,7 +78,7 @@ public class DestroyGemFireMockObjectsTestExecutionListener implements TestExecu
* @param eventType {@link TestContextEventType} to disable event handling for.
* @return a boolean value indicating whether event handling for the given {@link TestContextEventType}
* was successfully disabled.
* @see org.springframework.data.gemfire.tests.mock.test.context.event.TestContextEventType
* @see org.springframework.data.gemfire.tests.extensions.spring.test.context.event.TestContextEventType
* @see #enableDestroyOnEventType(TestContextEventType)
*/
public boolean disableDestroyOnEventType(@Nullable TestContextEventType eventType) {
@@ -93,7 +94,7 @@ public class DestroyGemFireMockObjectsTestExecutionListener implements TestExecu
* @param eventType {@link TestContextEventType} to enable event handling for.
* @return a boolean value indicating whether event handling for the given {@link TestContextEventType}
* was successfully enabled.
* @see org.springframework.data.gemfire.tests.mock.test.context.event.TestContextEventType
* @see org.springframework.data.gemfire.tests.extensions.spring.test.context.event.TestContextEventType
* @see #disableDestroyOnEventType(TestContextEventType)
*/
public boolean enableDestroyOnEventType(@Nullable TestContextEventType eventType) {
@@ -107,7 +108,7 @@ public class DestroyGemFireMockObjectsTestExecutionListener implements TestExecu
*
* @param eventType {{@link TestContextEventType} to evaluate.
* @return a boolean value indicating whether event handling for the given {@link TestContextEventType} is enabled.
* @see org.springframework.data.gemfire.tests.mock.test.context.event.TestContextEventType
* @see org.springframework.data.gemfire.tests.extensions.spring.test.context.event.TestContextEventType
*/
protected boolean isDestroyOnEventTypeEnabled(@Nullable TestContextEventType eventType) {
return this.destroyOnEventTypes.contains(eventType);
@@ -117,7 +118,7 @@ public class DestroyGemFireMockObjectsTestExecutionListener implements TestExecu
* @inheritDoc
*/
@Override
public void beforeTestClass(TestContext testContext) {
public void beforeTestClass(@NonNull TestContext testContext) {
if (isDestroyOnEventTypeEnabled(TestContextEventType.BEFORE_TEST_CLASS)) {
destroyGemFireMockObjects();
@@ -128,7 +129,7 @@ public class DestroyGemFireMockObjectsTestExecutionListener implements TestExecu
* @inheritDoc
*/
@Override
public void prepareTestInstance(TestContext testContext) {
public void prepareTestInstance(@NonNull TestContext testContext) {
if (isDestroyOnEventTypeEnabled(TestContextEventType.PREPARE_TEST_INSTANCE)) {
destroyGemFireMockObjects();
@@ -139,7 +140,7 @@ public class DestroyGemFireMockObjectsTestExecutionListener implements TestExecu
* @inheritDoc
*/
@Override
public void beforeTestMethod(TestContext testContext) {
public void beforeTestMethod(@NonNull TestContext testContext) {
if (isDestroyOnEventTypeEnabled(TestContextEventType.BEFORE_TEST_METHOD)) {
destroyGemFireMockObjects();
@@ -150,7 +151,7 @@ public class DestroyGemFireMockObjectsTestExecutionListener implements TestExecu
* @inheritDoc
*/
@Override
public void beforeTestExecution(TestContext testContext) {
public void beforeTestExecution(@NonNull TestContext testContext) {
if (isDestroyOnEventTypeEnabled(TestContextEventType.BEFORE_TEST_EXECUTION)) {
destroyGemFireMockObjects();
@@ -161,7 +162,7 @@ public class DestroyGemFireMockObjectsTestExecutionListener implements TestExecu
* @inheritDoc
*/
@Override
public void afterTestExecution(TestContext testContext) {
public void afterTestExecution(@NonNull TestContext testContext) {
if (isDestroyOnEventTypeEnabled(TestContextEventType.AFTER_TEST_EXECUTION)) {
destroyGemFireMockObjects();
@@ -172,7 +173,7 @@ public class DestroyGemFireMockObjectsTestExecutionListener implements TestExecu
* @inheritDoc
*/
@Override
public void afterTestMethod(TestContext testContext) {
public void afterTestMethod(@NonNull TestContext testContext) {
if (isDestroyOnEventTypeEnabled(TestContextEventType.AFTER_TEST_METHOD)) {
destroyGemFireMockObjects();
@@ -183,7 +184,7 @@ public class DestroyGemFireMockObjectsTestExecutionListener implements TestExecu
* @inheritDoc
*/
@Override
public void afterTestClass(TestContext testContext) {
public void afterTestClass(@NonNull TestContext testContext) {
if (isDestroyOnEventTypeEnabled(TestContextEventType.AFTER_TEST_CLASS)) {
destroyGemFireMockObjects();

View File

@@ -13,7 +13,7 @@
* or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
package org.springframework.data.gemfire.tests.mock.test.context.event;
package org.springframework.data.gemfire.tests.extensions.spring.test.context.event;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.mock;
@@ -38,11 +38,11 @@ import org.springframework.test.context.event.TestContextEvent;
* @author John Blum
* @see org.junit.Test
* @see org.mockito.Mockito
* @see org.springframework.data.gemfire.tests.mock.test.context.event.TestContextEventType
* @see org.springframework.data.gemfire.tests.extensions.spring.test.context.event.TestContextEventType
* @see org.springframework.test.context.event.TestContextEvent
* @since 0.0.16
*/
public class TestContextEventTypeUnitTest {
public class TestContextEventTypeUnitTests {
@Test
public void fromTestContextEventToEnum() {

View File

@@ -27,7 +27,7 @@ import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.junit.MockitoJUnitRunner;
import org.springframework.data.gemfire.tests.mock.test.context.event.TestContextEventType;
import org.springframework.data.gemfire.tests.extensions.spring.test.context.event.TestContextEventType;
import org.springframework.test.context.TestContext;
/**
@@ -37,8 +37,8 @@ import org.springframework.test.context.TestContext;
* @see org.junit.Test
* @see org.mockito.Mockito
* @see org.mockito.junit.MockitoJUnitRunner
* @see org.springframework.data.gemfire.tests.extensions.spring.test.context.event.TestContextEventType
* @see org.springframework.data.gemfire.tests.mock.test.context.DestroyGemFireMockObjectsTestExecutionListener
* @see org.springframework.data.gemfire.tests.mock.test.context.event.TestContextEventType
* @since 0.0.16
*/
@RunWith(MockitoJUnitRunner.class)