From 402a8f55342c4565431c2a2e7287a70592f3fe33 Mon Sep 17 00:00:00 2001 From: Fabian Mastenbroek Date: Thu, 6 Oct 2022 12:51:27 +0200 Subject: style: Eliminate use of wildcard imports This change updates the repository to remove the use of wildcard imports everywhere. Wildcard imports are not allowed by default by Ktlint as well as Google's Java style guide. --- .../src/test/kotlin/org/opendc/trace/calcite/CalciteTest.kt | 9 +++++++-- .../kotlin/org/opendc/trace/calcite/TraceSchemaFactoryTest.kt | 6 ++++-- 2 files changed, 11 insertions(+), 4 deletions(-) (limited to 'opendc-trace/opendc-trace-calcite/src/test') diff --git a/opendc-trace/opendc-trace-calcite/src/test/kotlin/org/opendc/trace/calcite/CalciteTest.kt b/opendc-trace/opendc-trace-calcite/src/test/kotlin/org/opendc/trace/calcite/CalciteTest.kt index d8729034..77346e74 100644 --- a/opendc-trace/opendc-trace-calcite/src/test/kotlin/org/opendc/trace/calcite/CalciteTest.kt +++ b/opendc-trace/opendc-trace-calcite/src/test/kotlin/org/opendc/trace/calcite/CalciteTest.kt @@ -25,7 +25,11 @@ package org.opendc.trace.calcite import io.mockk.every import io.mockk.mockk import org.apache.calcite.jdbc.CalciteConnection -import org.junit.jupiter.api.Assertions.* +import org.junit.jupiter.api.Assertions.assertAll +import org.junit.jupiter.api.Assertions.assertArrayEquals +import org.junit.jupiter.api.Assertions.assertEquals +import org.junit.jupiter.api.Assertions.assertFalse +import org.junit.jupiter.api.Assertions.assertTrue import org.junit.jupiter.api.Test import org.opendc.trace.TableColumn import org.opendc.trace.TableColumnType @@ -40,7 +44,8 @@ import java.sql.Statement import java.sql.Timestamp import java.time.Duration import java.time.Instant -import java.util.* +import java.util.Properties +import java.util.UUID /** * Smoke test for Apache Calcite integration. diff --git a/opendc-trace/opendc-trace-calcite/src/test/kotlin/org/opendc/trace/calcite/TraceSchemaFactoryTest.kt b/opendc-trace/opendc-trace-calcite/src/test/kotlin/org/opendc/trace/calcite/TraceSchemaFactoryTest.kt index 0a552e74..eb4bc769 100644 --- a/opendc-trace/opendc-trace-calcite/src/test/kotlin/org/opendc/trace/calcite/TraceSchemaFactoryTest.kt +++ b/opendc-trace/opendc-trace-calcite/src/test/kotlin/org/opendc/trace/calcite/TraceSchemaFactoryTest.kt @@ -22,12 +22,14 @@ package org.opendc.trace.calcite -import org.junit.jupiter.api.Assertions.* +import org.junit.jupiter.api.Assertions.assertAll +import org.junit.jupiter.api.Assertions.assertEquals +import org.junit.jupiter.api.Assertions.assertTrue import org.junit.jupiter.api.Test import org.junit.jupiter.api.assertThrows import java.sql.DriverManager import java.sql.Timestamp -import java.util.* +import java.util.Properties /** * Test suite for [TraceSchemaFactory]. -- cgit v1.2.3 From 47357afd16f928260db34d4dd3e686fb9ee7c5ff Mon Sep 17 00:00:00 2001 From: Fabian Mastenbroek Date: Thu, 6 Oct 2022 13:13:10 +0200 Subject: build: Switch to Spotless for formatting This change updates the build configuration to use Spotless for code formating of both Kotlin and Java. --- .../src/test/kotlin/org/opendc/trace/calcite/CalciteTest.kt | 8 ++++---- .../kotlin/org/opendc/trace/calcite/TraceSchemaFactoryTest.kt | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'opendc-trace/opendc-trace-calcite/src/test') diff --git a/opendc-trace/opendc-trace-calcite/src/test/kotlin/org/opendc/trace/calcite/CalciteTest.kt b/opendc-trace/opendc-trace-calcite/src/test/kotlin/org/opendc/trace/calcite/CalciteTest.kt index 77346e74..64bb31c9 100644 --- a/opendc-trace/opendc-trace-calcite/src/test/kotlin/org/opendc/trace/calcite/CalciteTest.kt +++ b/opendc-trace/opendc-trace-calcite/src/test/kotlin/org/opendc/trace/calcite/CalciteTest.kt @@ -86,7 +86,7 @@ class CalciteTest { { assertEquals(300000, rs.getLong("duration")) }, { assertEquals(0.0, rs.getDouble("cpu_usage")) }, { assertTrue(rs.next()) }, - { assertEquals("1019", rs.getString("id")) }, + { assertEquals("1019", rs.getString("id")) } ) } } @@ -98,7 +98,7 @@ class CalciteTest { { assertTrue(rs.next()) }, { assertArrayEquals(arrayOf("1019", "1023", "1052"), rs.getArray("members").array as Array<*>) }, { assertEquals(0.0, rs.getDouble("target")) }, - { assertEquals(0.8830158730158756, rs.getDouble("score")) }, + { assertEquals(0.8830158730158756, rs.getDouble("score")) } ) } } @@ -109,7 +109,7 @@ class CalciteTest { assertAll( { assertTrue(rs.next()) }, { assertEquals(249.59993808, rs.getDouble("max_cpu_usage")) }, - { assertEquals(5.387240309118493, rs.getDouble("avg_cpu_usage")) }, + { assertEquals(5.387240309118493, rs.getDouble("avg_cpu_usage")) } ) } } @@ -214,7 +214,7 @@ class CalciteTest { runQuery(trace, "SELECT id FROM trace.resources") { rs -> assertAll( { assertTrue(rs.next()) }, - { assertArrayEquals(byteArrayOf(0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2), rs.getBytes("id")) }, + { assertArrayEquals(byteArrayOf(0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2), rs.getBytes("id")) } ) } } diff --git a/opendc-trace/opendc-trace-calcite/src/test/kotlin/org/opendc/trace/calcite/TraceSchemaFactoryTest.kt b/opendc-trace/opendc-trace-calcite/src/test/kotlin/org/opendc/trace/calcite/TraceSchemaFactoryTest.kt index eb4bc769..735cedce 100644 --- a/opendc-trace/opendc-trace-calcite/src/test/kotlin/org/opendc/trace/calcite/TraceSchemaFactoryTest.kt +++ b/opendc-trace/opendc-trace-calcite/src/test/kotlin/org/opendc/trace/calcite/TraceSchemaFactoryTest.kt @@ -48,7 +48,7 @@ class TraceSchemaFactoryTest { { assertEquals("1019", rs.getString("id")) }, { assertEquals(1, rs.getInt("cpu_count")) }, { assertEquals(Timestamp.valueOf("2013-08-12 13:40:46.0"), rs.getTimestamp("start_time")) }, - { assertEquals(181352.0, rs.getDouble("mem_capacity")) }, + { assertEquals(181352.0, rs.getDouble("mem_capacity")) } ) } finally { rs.close() -- cgit v1.2.3