Skip to content

Commit

Permalink
reformat, optimize imports
Browse files Browse the repository at this point in the history
Signed-off-by: Sergei Malafeev <sergeymalafeev@gmail.com>
  • Loading branch information
malafeev committed Jun 4, 2018
1 parent 214f5be commit d6b2944
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
9 changes: 6 additions & 3 deletions src/test/java/io/opentracing/contrib/jdbc/HibernateTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,8 @@ public void hibernate_with_parent_and_active_span_only() {

@Test
public void hibernate_with_ignored_statement() {
SessionFactory sessionFactory = createSessionFactory(false, Arrays.asList("insert into Employee (id) values (?)"));
SessionFactory sessionFactory = createSessionFactory(false,
Arrays.asList("insert into Employee (id) values (?)"));
Session session = sessionFactory.openSession();

Employee employee = new Employee();
Expand Down Expand Up @@ -264,14 +265,16 @@ private SessionFactory createSessionFactory(boolean traceWithActiveSpanOnly) {
return createSessionFactory(traceWithActiveSpanOnly, new ArrayList<String>());
}

private SessionFactory createSessionFactory(boolean traceWithActiveSpanOnly, List<String> ignored) {
private SessionFactory createSessionFactory(boolean traceWithActiveSpanOnly,
List<String> ignored) {
String ignoredForTrace = TestUtil.buildIgnoredString(ignored);
Configuration configuration = new Configuration();
configuration.addAnnotatedClass(Employee.class);
configuration.setProperty("hibernate.connection.driver_class",
"io.opentracing.contrib.jdbc.TracingDriver");
configuration.setProperty("hibernate.connection.url",
"jdbc:tracing:h2:mem:hibernate?" + ignoredForTrace + "traceWithActiveSpanOnly=" + traceWithActiveSpanOnly);
"jdbc:tracing:h2:mem:hibernate?" + ignoredForTrace + "traceWithActiveSpanOnly="
+ traceWithActiveSpanOnly);
configuration.setProperty("hibernate.connection.username", "sa");
configuration.setProperty("hibernate.connection.password", "");
configuration.setProperty("hibernate.dialect", "org.hibernate.dialect.H2Dialect");
Expand Down
9 changes: 3 additions & 6 deletions src/test/java/io/opentracing/contrib/jdbc/SpringTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,7 @@
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import org.apache.commons.dbcp2.BasicDataSource;
import org.junit.Before;
import org.junit.BeforeClass;
Expand Down Expand Up @@ -169,8 +166,8 @@ public void spring_with_parent_and_active_span_only() throws Exception {
@Test
public void spring_with_ignored_statement() throws Exception {
BasicDataSource dataSource = getDataSource(false, Arrays.asList(
"CREATE TABLE ignored (id INTEGER, TEST VARCHAR)",
"INSERT INTO ignored (id, \\\"TEST\\\") VALUES (1, 'value')"
"CREATE TABLE ignored (id INTEGER, TEST VARCHAR)",
"INSERT INTO ignored (id, \\\"TEST\\\") VALUES (1, 'value')"
));

JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource);
Expand All @@ -196,7 +193,7 @@ private BasicDataSource getDataSource(boolean traceWithActiveSpanOnly, List<Stri
dataSource.setDriverClassName("io.opentracing.contrib.jdbc.TracingDriver");
dataSource
.setUrl("jdbc:tracing:h2:mem:spring?" + ignoreForTracing +
"traceWithActiveSpanOnly=" + traceWithActiveSpanOnly);
"traceWithActiveSpanOnly=" + traceWithActiveSpanOnly);
dataSource.setUsername("sa");
dataSource.setPassword("");
return dataSource;
Expand Down

0 comments on commit d6b2944

Please sign in to comment.