提交 d9a48823 编写于 作者: T terrymanu

for checkstyle

上级 dbe89f6e
...@@ -51,8 +51,7 @@ import static org.mockito.Mockito.when; ...@@ -51,8 +51,7 @@ import static org.mockito.Mockito.when;
public final class ExecuteEventListenerTest { public final class ExecuteEventListenerTest {
private static final MockTracer TRACER = new MockTracer(new ThreadLocalActiveSpanSource(), private static final MockTracer TRACER = new MockTracer(new ThreadLocalActiveSpanSource(), MockTracer.Propagator.TEXT_MAP);
MockTracer.Propagator.TEXT_MAP);
private final ExecutorEngine executorEngine = new ExecutorEngine(5); private final ExecutorEngine executorEngine = new ExecutorEngine(5);
...@@ -96,8 +95,9 @@ public final class ExecuteEventListenerTest { ...@@ -96,8 +95,9 @@ public final class ExecuteEventListenerTest {
when(stm2.getConnection()).thenReturn(mock(Connection.class)); when(stm2.getConnection()).thenReturn(mock(Connection.class));
statementUnitList.add(new StatementUnit(new SQLExecutionUnit("ds_0", new SQLUnit("insert into ...", Collections.singletonList(Collections.<Object>singletonList(1)))), stm2)); statementUnitList.add(new StatementUnit(new SQLExecutionUnit("ds_0", new SQLUnit("insert into ...", Collections.singletonList(Collections.<Object>singletonList(1)))), stm2));
executorEngine.execute(SQLType.DML, statementUnitList, new ExecuteCallback<Integer>() { executorEngine.execute(SQLType.DML, statementUnitList, new ExecuteCallback<Integer>() {
@Override @Override
public Integer execute(final BaseStatementUnit baseStatementUnit) throws Exception { public Integer execute(final BaseStatementUnit baseStatementUnit) {
return 0; return 0;
} }
}); });
......
...@@ -25,17 +25,17 @@ import io.opentracing.util.GlobalTracer; ...@@ -25,17 +25,17 @@ import io.opentracing.util.GlobalTracer;
import io.shardingsphere.core.exception.ShardingException; import io.shardingsphere.core.exception.ShardingException;
import io.shardingsphere.core.util.EventBusInstance; import io.shardingsphere.core.util.EventBusInstance;
import io.shardingsphere.opentracing.fixture.FooTracer; import io.shardingsphere.opentracing.fixture.FooTracer;
import static org.hamcrest.CoreMatchers.is;
import org.junit.After; import org.junit.After;
import org.junit.Before; import org.junit.Before;
import org.junit.Test; import org.junit.Test;
import java.lang.reflect.Field; import java.lang.reflect.Field;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.core.Is.isA; import static org.hamcrest.core.Is.isA;
import static org.junit.Assert.*; import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.mock; import static org.mockito.Mockito.mock;
public final class ShardingJDBCTracerTest { public final class ShardingJDBCTracerTest {
...@@ -73,14 +73,12 @@ public final class ShardingJDBCTracerTest { ...@@ -73,14 +73,12 @@ public final class ShardingJDBCTracerTest {
public void assertTracerClassError() { public void assertTracerClassError() {
System.setProperty("shardingjdbc.opentracing.tracer.class", "com.foo.FooTracer"); System.setProperty("shardingjdbc.opentracing.tracer.class", "com.foo.FooTracer");
ShardingJDBCTracer.get(); ShardingJDBCTracer.get();
} }
private static void clearGlobalTracer() throws NoSuchFieldException, IllegalAccessException { private static void clearGlobalTracer() throws NoSuchFieldException, IllegalAccessException {
Field tracerField = GlobalTracer.class.getDeclaredField("tracer"); Field tracerField = GlobalTracer.class.getDeclaredField("tracer");
tracerField.setAccessible(true); tracerField.setAccessible(true);
tracerField.set(GlobalTracer.class, NoopTracerFactory.create()); tracerField.set(GlobalTracer.class, NoopTracerFactory.create());
} }
private static void unregisterEventBus() throws NoSuchFieldException, IllegalAccessException { private static void unregisterEventBus() throws NoSuchFieldException, IllegalAccessException {
...@@ -88,5 +86,4 @@ public final class ShardingJDBCTracerTest { ...@@ -88,5 +86,4 @@ public final class ShardingJDBCTracerTest {
subscribersByTypeField.setAccessible(true); subscribersByTypeField.setAccessible(true);
subscribersByTypeField.set(EventBusInstance.getInstance(), HashMultimap.create()); subscribersByTypeField.set(EventBusInstance.getInstance(), HashMultimap.create());
} }
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册