// Path: core/src/main/java/eu/drus/jpa/unit/spi/DecoratorExecutor.java
// public class DecoratorExecutor {
// 
//     private static final Comparator<TestDecorator> BEFORE_COMPARATOR = (a, b) -> a.getPriority() - b.getPriority();
//     private static final Comparator<TestDecorator> AFTER_COMPARATOR = (a, b) -> b.getPriority() - a.getPriority();
// 
//     public void processBeforeAll(final TestInvocation invocation) throws Exception {
//         final Iterator<TestClassDecorator> it = classDecoratorIterator(invocation.getContext(), BEFORE_COMPARATOR);
//         while (it.hasNext()) {
//             it.next().beforeAll(invocation);
//         }
//     }
// 
//     public void processAfterAll(final TestInvocation invocation) throws Exception {
//         final Iterator<TestClassDecorator> it = classDecoratorIterator(invocation.getContext(), AFTER_COMPARATOR);
//         while (it.hasNext()) {
//             it.next().afterAll(invocation);
//         }
//     }
// 
//     public void processBefore(final TestInvocation invocation) throws Exception {
//         final Iterator<TestMethodDecorator> it = methodDecoratorIterator(invocation.getContext(), BEFORE_COMPARATOR);
//         while (it.hasNext()) {
//             it.next().beforeTest(invocation);
//         }
//     }
// 
//     public void processAfter(final TestInvocation invocation) throws Exception {
//         final Iterator<TestMethodDecorator> it = methodDecoratorIterator(invocation.getContext(), AFTER_COMPARATOR);
//         while (it.hasNext()) {
//             it.next().afterTest(invocation);
//         }
//     }
// 
//     private Iterator<TestClassDecorator> classDecoratorIterator(final ExecutionContext ctx, final Comparator<TestDecorator> comparator) {
//         return getClassDecorators().stream().filter(d -> d.isConfigurationSupported(ctx)).sorted(comparator).iterator();
//     }
// 
//     private Iterator<TestMethodDecorator> methodDecoratorIterator(final ExecutionContext ctx, final Comparator<TestDecorator> comparator) {
//         return getMethodDecorators().stream().filter(d -> d.isConfigurationSupported(ctx)).sorted(comparator).iterator();
//     }
// }
// 
// Path: core/src/main/java/eu/drus/jpa/unit/spi/ExecutionContext.java
// public interface ExecutionContext {
// 
//     Field getPersistenceField();
// 
//     PersistenceUnitDescriptor getDescriptor();
// 
//     void storeData(String key, Object value);
// 
//     Object getData(String key);
// }
// 
// Path: core/src/main/java/eu/drus/jpa/unit/spi/TestInvocation.java
// public interface TestInvocation {
// 
//     Class<?> getTestClass();
// 
//     ExecutionContext getContext();
// 
//     Optional<Method> getTestMethod();
// 
//     Optional<Object> getTestInstance();
// 
//     Optional<Throwable> getException();
// 
//     FeatureResolver getFeatureResolver();
// }


import static org.hamcrest.CoreMatchers.equalTo;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.fail;
import static org.mockito.Matchers.anyObject;
import static org.mockito.Matchers.anyString;
import static org.mockito.Mockito.doAnswer;
import static org.mockito.Mockito.doThrow;
import static org.mockito.Mockito.inOrder;
import static org.mockito.Mockito.times;
import java.util.HashMap;
import java.util.Map;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.model.Statement;
import org.mockito.ArgumentCaptor;
import org.mockito.InOrder;
import org.mockito.Mock;
import org.mockito.invocation.InvocationOnMock;
import org.mockito.runners.MockitoJUnitRunner;
import eu.drus.jpa.unit.spi.DecoratorExecutor;
import eu.drus.jpa.unit.spi.ExecutionContext;
import eu.drus.jpa.unit.spi.TestInvocation;
package eu.drus.jpa.unit.rule;





@RunWith(MockitoJUnitRunner.class)
public class TestClassStatementTest {

    @Mock
// Path: core/src/main/java/eu/drus/jpa/unit/spi/DecoratorExecutor.java
// public class DecoratorExecutor {
// 
//     private static final Comparator<TestDecorator> BEFORE_COMPARATOR = (a, b) -> a.getPriority() - b.getPriority();
//     private static final Comparator<TestDecorator> AFTER_COMPARATOR = (a, b) -> b.getPriority() - a.getPriority();
// 
//     public void processBeforeAll(final TestInvocation invocation) throws Exception {
//         final Iterator<TestClassDecorator> it = classDecoratorIterator(invocation.getContext(), BEFORE_COMPARATOR);
//         while (it.hasNext()) {
//             it.next().beforeAll(invocation);
//         }
//     }
// 
//     public void processAfterAll(final TestInvocation invocation) throws Exception {
//         final Iterator<TestClassDecorator> it = classDecoratorIterator(invocation.getContext(), AFTER_COMPARATOR);
//         while (it.hasNext()) {
//             it.next().afterAll(invocation);
//         }
//     }
// 
//     public void processBefore(final TestInvocation invocation) throws Exception {
//         final Iterator<TestMethodDecorator> it = methodDecoratorIterator(invocation.getContext(), BEFORE_COMPARATOR);
//         while (it.hasNext()) {
//             it.next().beforeTest(invocation);
//         }
//     }
// 
//     public void processAfter(final TestInvocation invocation) throws Exception {
//         final Iterator<TestMethodDecorator> it = methodDecoratorIterator(invocation.getContext(), AFTER_COMPARATOR);
//         while (it.hasNext()) {
//             it.next().afterTest(invocation);
//         }
//     }
// 
//     private Iterator<TestClassDecorator> classDecoratorIterator(final ExecutionContext ctx, final Comparator<TestDecorator> comparator) {
//         return getClassDecorators().stream().filter(d -> d.isConfigurationSupported(ctx)).sorted(comparator).iterator();
//     }
// 
//     private Iterator<TestMethodDecorator> methodDecoratorIterator(final ExecutionContext ctx, final Comparator<TestDecorator> comparator) {
//         return getMethodDecorators().stream().filter(d -> d.isConfigurationSupported(ctx)).sorted(comparator).iterator();
//     }
// }
// 
// Path: core/src/main/java/eu/drus/jpa/unit/spi/ExecutionContext.java
// public interface ExecutionContext {
// 
//     Field getPersistenceField();
// 
//     PersistenceUnitDescriptor getDescriptor();
// 
//     void storeData(String key, Object value);
// 
//     Object getData(String key);
// }
// 
// Path: core/src/main/java/eu/drus/jpa/unit/spi/TestInvocation.java
// public interface TestInvocation {
// 
//     Class<?> getTestClass();
// 
//     ExecutionContext getContext();
// 
//     Optional<Method> getTestMethod();
// 
//     Optional<Object> getTestInstance();
// 
//     Optional<Throwable> getException();
// 
//     FeatureResolver getFeatureResolver();
// }


// Path: junit4-extension/src/test/java/eu/drus/jpa/unit/rule/TestClassStatementTest.java
import static org.hamcrest.CoreMatchers.equalTo;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.fail;
import static org.mockito.Matchers.anyObject;
import static org.mockito.Matchers.anyString;
import static org.mockito.Mockito.doAnswer;
import static org.mockito.Mockito.doThrow;
import static org.mockito.Mockito.inOrder;
import static org.mockito.Mockito.times;
import java.util.HashMap;
import java.util.Map;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.model.Statement;
import org.mockito.ArgumentCaptor;
import org.mockito.InOrder;
import org.mockito.Mock;
import org.mockito.invocation.InvocationOnMock;
import org.mockito.runners.MockitoJUnitRunner;
import eu.drus.jpa.unit.spi.DecoratorExecutor;
import eu.drus.jpa.unit.spi.ExecutionContext;
import eu.drus.jpa.unit.spi.TestInvocation;

package eu.drus.jpa.unit.rule;





@RunWith(MockitoJUnitRunner.class)
public class TestClassStatementTest {

    @Mock
    private ExecutionContext ctx;