From b00eba673b6df26861f210259a2ebea068cb065a Mon Sep 17 00:00:00 2001 From: Arash M <> Date: Fri, 17 Dec 2021 14:31:15 -0800 Subject: [PATCH 1/3] [cli] Reformat cli build.gradle Remove redundant lines --- cli/build.gradle | 6 ------ 1 file changed, 6 deletions(-) diff --git a/cli/build.gradle b/cli/build.gradle index 96048c5cc5..7fa96f5f20 100644 --- a/cli/build.gradle +++ b/cli/build.gradle @@ -3,7 +3,6 @@ plugins { id 'application' } - application { mainClassName = "org.partiql.cli.Main" applicationName = 'partiql' // startup script name @@ -19,16 +18,11 @@ distributions { } } - - - - (tasks.findByName("distTar") as Tar).compression = Compression.GZIP // Allows the CLI to receive input from the keyboard when invoked using `./gradlew :cli:run` tasks['run'].standardInput = System.in - dependencies { implementation project(":lang") implementation 'net.sf.jopt-simple:jopt-simple:[5.0,6.0)' From 12a65c1f1a887bc13a484056dfd37f6e4a43de20 Mon Sep 17 00:00:00 2001 From: Arash M <> Date: Fri, 17 Dec 2021 14:33:58 -0800 Subject: [PATCH 2/3] Refresh .gitignore - Include macOs coverage - New idea files - Other misc. inclusions --- .gitignore | 70 +++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 56 insertions(+), 14 deletions(-) diff --git a/.gitignore b/.gitignore index 53080f4410..e68379eed4 100644 --- a/.gitignore +++ b/.gitignore @@ -8,8 +8,8 @@ build out/ -# Created by https://www.gitignore.io/api/vim,git,java,emacs,kotlin,eclipse,intellij+all -# Edit at https://www.gitignore.io/?templates=vim,git,java,emacs,kotlin,eclipse,intellij+all +# Created by https://www.toptal.com/developers/gitignore/api/vim,git,java,emacs,kotlin,eclipse,intellij+all,macos +# Edit at https://www.toptal.com/developers/gitignore?templates=vim,git,java,emacs,kotlin,eclipse,intellij+all,macos ### Eclipse ### .metadata @@ -24,6 +24,16 @@ local.properties .loadpath .recommenders +### Eclipse Patch ### +# Eclipse Core +.project + +# JDT-specific (Eclipse Java Development Tools) +.classpath + +# Annotation Processing +.apt_generated + # External tool builders .externalToolBuilders/ @@ -62,22 +72,19 @@ local.properties # Annotation Processing .apt_generated/ +.apt_generated_test/ # Scala IDE specific (Scala & Java development for Eclipse) .cache-main .scala_dependencies .worksheet -### Eclipse Patch ### -# Eclipse Core -.project - -# JDT-specific (Eclipse Java Development Tools) -.classpath - -# Annotation Processing -.apt_generated +# Uncomment this line if you wish to ignore the project description file. +# Typically, this file would be tracked if it contains build/dependency configurations: +#.project +### Eclipse Patch ### +# Spring Boot Tooling .sts4-cache/ ### Emacs ### @@ -147,7 +154,7 @@ flycheck_*.el *_REMOTE_*.txt ### Intellij+all ### -# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 # User-specific stuff @@ -157,6 +164,9 @@ flycheck_*.el .idea/**/dictionaries .idea/**/shelf +# AWS User-specific +.idea/**/aws.xml + # Generated files .idea/**/contentModel.xml @@ -177,6 +187,9 @@ flycheck_*.el # When using Gradle or Maven with auto-import, you should exclude module files, # since they will be recreated, and may cause churn. Uncomment if using # auto-import. +# .idea/artifacts +# .idea/compiler.xml +# .idea/jarRepositories.xml # .idea/modules.xml # .idea/*.iml # .idea/modules @@ -270,9 +283,39 @@ hs_err_pid* # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +### macOS ### +# General +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + ### Vim ### # Swap [._]*.s[a-v][a-z] +!*.svg # comment out if you don't need vector files [._]*.sw[a-p] [._]s[a-rt-v][a-z] [._]ss[a-gi-z] @@ -289,5 +332,4 @@ tags # Persistent undo [._]*.un~ -# End of https://www.gitignore.io/api/vim,git,java,emacs,kotlin,eclipse,intellij+all - +# End of https://www.toptal.com/developers/gitignore/api/vim,git,java,emacs,kotlin,eclipse,intellij+all,macos From 95414fdf55abbd458af9479c5faaa1977375c357 Mon Sep 17 00:00:00 2001 From: Arash M <> Date: Fri, 17 Dec 2021 15:22:33 -0800 Subject: [PATCH 3/3] [cli] Remove wildcard imports Replace the wildcard imports with explicit ones to make the code easier to read. --- cli/src/org/partiql/cli/Cli.kt | 30 ++++--- cli/src/org/partiql/cli/Repl.kt | 86 ++++++++++--------- cli/src/org/partiql/cli/Runnable.kt | 6 +- .../org/partiql/cli/functions/BaseFunction.kt | 6 +- cli/src/org/partiql/cli/functions/ReadFile.kt | 16 ++-- .../org/partiql/cli/functions/WriteFile.kt | 18 ++-- cli/src/org/partiql/cli/main.kt | 21 +++-- cli/src/org/partiql/cli/stopwatch.kt | 2 +- cli/src/org/partiql/cli/streams.kt | 4 +- cli/test/org/partiql/cli/CliTest.kt | 23 +++-- cli/test/org/partiql/cli/ReplTest.kt | 28 +++--- .../org/partiql/cli/functions/ReadFileTest.kt | 15 ++-- .../partiql/cli/functions/WriteFileTest.kt | 19 ++-- 13 files changed, 171 insertions(+), 103 deletions(-) diff --git a/cli/src/org/partiql/cli/Cli.kt b/cli/src/org/partiql/cli/Cli.kt index c05c43dacd..e268d08df7 100644 --- a/cli/src/org/partiql/cli/Cli.kt +++ b/cli/src/org/partiql/cli/Cli.kt @@ -14,13 +14,20 @@ package org.partiql.cli -import com.amazon.ion.* -import com.amazon.ion.system.* -import java.io.* -import org.partiql.cli.OutputFormat.* -import org.partiql.lang.* -import org.partiql.lang.eval.* +import com.amazon.ion.IonWriter +import com.amazon.ion.system.IonReaderBuilder +import com.amazon.ion.system.IonTextWriterBuilder +import org.partiql.lang.CompilerPipeline +import org.partiql.lang.eval.Bindings +import org.partiql.lang.eval.EvaluationSession +import org.partiql.lang.eval.ExprValue +import org.partiql.lang.eval.ExprValueFactory +import org.partiql.lang.eval.ExprValueType +import org.partiql.lang.eval.delegate import org.partiql.lang.util.ConfigurableExprValueFormatter +import java.io.InputStream +import java.io.OutputStream +import java.io.OutputStreamWriter /** * TODO builder, kdoc @@ -34,7 +41,8 @@ internal class Cli(private val valueFactory: ExprValueFactory, private val query: String) : PartiQLCommand { companion object { - val ionTextWriterBuilder: IonTextWriterBuilder = IonTextWriterBuilder.standard().withWriteTopLevelValuesOnNewLines(true) + val ionTextWriterBuilder: IonTextWriterBuilder = IonTextWriterBuilder.standard() + .withWriteTopLevelValuesOnNewLines(true) } override fun run() { @@ -49,13 +57,13 @@ internal class Cli(private val valueFactory: ExprValueFactory, val result = compilerPipeline.compile(query).eval(EvaluationSession.build { globals(bindings) }) when (format) { - ION_TEXT -> ionTextWriterBuilder.build(output).use { + OutputFormat.ION_TEXT -> ionTextWriterBuilder.build(output).use { printIon(it, result) output.write(System.lineSeparator().toByteArray(Charsets.UTF_8)) } - ION_BINARY -> valueFactory.ion.newBinaryWriter(output).use { printIon(it, result) } - PARTIQL -> OutputStreamWriter(output).use { it.write(result.toString()) } - PARTIQL_PRETTY -> OutputStreamWriter(output).use { + OutputFormat.ION_BINARY -> valueFactory.ion.newBinaryWriter(output).use { printIon(it, result) } + OutputFormat.PARTIQL -> OutputStreamWriter(output).use { it.write(result.toString()) } + OutputFormat.PARTIQL_PRETTY -> OutputStreamWriter(output).use { ConfigurableExprValueFormatter.pretty.formatTo(result, it) } } diff --git a/cli/src/org/partiql/cli/Repl.kt b/cli/src/org/partiql/cli/Repl.kt index 3517f5f3c2..de8d9d6c3b 100644 --- a/cli/src/org/partiql/cli/Repl.kt +++ b/cli/src/org/partiql/cli/Repl.kt @@ -14,16 +14,27 @@ package org.partiql.cli -import com.amazon.ion.system.* +import com.amazon.ion.system.IonTextWriterBuilder import com.amazon.ionelement.api.toIonValue -import org.partiql.cli.ReplState.* -import org.partiql.lang.* -import org.partiql.lang.eval.* -import org.partiql.lang.syntax.* -import org.partiql.lang.util.* -import java.io.* +import org.partiql.lang.CompilerPipeline +import org.partiql.lang.eval.BindingCase +import org.partiql.lang.eval.BindingName +import org.partiql.lang.eval.Bindings +import org.partiql.lang.eval.EvaluationSession +import org.partiql.lang.eval.ExprValue +import org.partiql.lang.eval.ExprValueFactory +import org.partiql.lang.eval.MapBindings +import org.partiql.lang.eval.StructOrdering +import org.partiql.lang.eval.delegate +import org.partiql.lang.syntax.Parser +import org.partiql.lang.util.ConfigurableExprValueFormatter +import org.partiql.lang.util.ExprValueFormatter +import java.io.InputStream +import java.io.OutputStream +import java.io.OutputStreamWriter +import java.io.PrintWriter import java.util.Properties -import java.util.concurrent.* +import java.util.concurrent.TimeUnit internal const val PROMPT_1 = "PartiQL> " internal const val PROMPT_2 = " | " @@ -61,9 +72,6 @@ private enum class ReplState { } private class GlobalBinding(private val valueFactory: ExprValueFactory) { - - - private val knownNames = mutableSetOf() var bindings = Bindings.empty() private set @@ -182,7 +190,7 @@ internal class Repl(private val valueFactory: ExprValueFactory, // Repl running state private val buffer = StringBuilder() private var globals = GlobalBinding(valueFactory).add(initialGlobal) - private var state = INIT + private var state = ReplState.INIT private var previousResult = valueFactory.nullValue private var line: String? = null @@ -244,10 +252,10 @@ internal class Repl(private val valueFactory: ExprValueFactory, } return if (line == null) { - FINAL + ReplState.FINAL } else { - READY + ReplState.READY } } @@ -274,58 +282,58 @@ internal class Repl(private val valueFactory: ExprValueFactory, } override fun run() { - while (state != FINAL) { + while (state != ReplState.FINAL) { state = when (state) { - INIT -> { + ReplState.INIT -> { printWelcomeMessage() printVersionNumber() - READY + ReplState.READY } - READY -> { + ReplState.READY -> { line = readLine() when { - line == null -> FINAL - arrayOf("!!", "").any { it == line } -> EXECUTE_PARTIQL - line!!.startsWith("!") -> READ_REPL_COMMAND - line!!.endsWith(";") -> LAST_PARTIQL_LINE - else -> READ_PARTIQL + line == null -> ReplState.FINAL + arrayOf("!!", "").any { it == line } -> ReplState.EXECUTE_PARTIQL + line!!.startsWith("!") -> ReplState.READ_REPL_COMMAND + line!!.endsWith(";") -> ReplState.LAST_PARTIQL_LINE + else -> ReplState.READ_PARTIQL } } - READ_PARTIQL -> { + ReplState.READ_PARTIQL -> { buffer.appendln(line) line = readLine() when { - line == null -> FINAL - line == "" -> EXECUTE_PARTIQL - line!!.endsWith(";") -> LAST_PARTIQL_LINE - line == "!!" -> PARSE_PARTIQL_WITH_FILTER - else -> READ_PARTIQL + line == null -> ReplState.FINAL + line == "" -> ReplState.EXECUTE_PARTIQL + line!!.endsWith(";") -> ReplState.LAST_PARTIQL_LINE + line == "!!" -> ReplState.PARSE_PARTIQL_WITH_FILTER + else -> ReplState.READ_PARTIQL } } - LAST_PARTIQL_LINE -> { + ReplState.LAST_PARTIQL_LINE -> { buffer.appendln(line) - EXECUTE_PARTIQL + ReplState.EXECUTE_PARTIQL } - READ_REPL_COMMAND -> { + ReplState.READ_REPL_COMMAND -> { buffer.appendln(line) line = readLine() when (line) { - null -> FINAL - "" -> EXECUTE_REPL_COMMAND - else -> READ_REPL_COMMAND + null -> ReplState.FINAL + "" -> ReplState.EXECUTE_REPL_COMMAND + else -> ReplState.READ_REPL_COMMAND } } - EXECUTE_PARTIQL -> executePartiQL() - PARSE_PARTIQL_WITH_FILTER -> parsePartiQLWithFilters() - EXECUTE_REPL_COMMAND -> executeReplCommand() + ReplState.EXECUTE_PARTIQL -> executePartiQL() + ReplState.PARSE_PARTIQL_WITH_FILTER -> parsePartiQLWithFilters() + ReplState.EXECUTE_REPL_COMMAND -> executeReplCommand() // shouldn't really happen - FINAL -> FINAL + ReplState.FINAL -> ReplState.FINAL } } } diff --git a/cli/src/org/partiql/cli/Runnable.kt b/cli/src/org/partiql/cli/Runnable.kt index f7e949e027..316db7267a 100644 --- a/cli/src/org/partiql/cli/Runnable.kt +++ b/cli/src/org/partiql/cli/Runnable.kt @@ -14,13 +14,13 @@ package org.partiql.cli -import com.amazon.ion.* -import org.partiql.lang.eval.* +import com.amazon.ion.IonWriter +import org.partiql.lang.eval.ExprValue +import org.partiql.lang.eval.rangeOver internal abstract class SqlCommand { abstract fun run() - protected fun writeResult(result: ExprValue, writer: IonWriter): Int { var itemCount = 0 result.rangeOver().forEach { diff --git a/cli/src/org/partiql/cli/functions/BaseFunction.kt b/cli/src/org/partiql/cli/functions/BaseFunction.kt index 94b6162bff..682ecbe2e5 100644 --- a/cli/src/org/partiql/cli/functions/BaseFunction.kt +++ b/cli/src/org/partiql/cli/functions/BaseFunction.kt @@ -14,8 +14,10 @@ package org.partiql.cli.functions -import com.amazon.ion.* -import org.partiql.lang.eval.* +import com.amazon.ion.IonStruct +import org.partiql.lang.eval.ExprFunction +import org.partiql.lang.eval.ExprValue +import org.partiql.lang.eval.ExprValueFactory internal abstract class BaseFunction(val valueFactory: ExprValueFactory) : ExprFunction { protected fun optionsStruct(requiredArity: Int, diff --git a/cli/src/org/partiql/cli/functions/ReadFile.kt b/cli/src/org/partiql/cli/functions/ReadFile.kt index 1feebc096d..7227d27626 100644 --- a/cli/src/org/partiql/cli/functions/ReadFile.kt +++ b/cli/src/org/partiql/cli/functions/ReadFile.kt @@ -14,12 +14,18 @@ package org.partiql.cli.functions -import com.amazon.ion.* -import org.partiql.lang.eval.* -import org.partiql.lang.eval.io.* +import com.amazon.ion.IonStruct +import org.partiql.lang.eval.Environment +import org.partiql.lang.eval.ExprValue +import org.partiql.lang.eval.ExprValueFactory +import org.partiql.lang.eval.io.DelimitedValues import org.partiql.lang.eval.io.DelimitedValues.ConversionMode -import org.partiql.lang.util.* -import java.io.* +import org.partiql.lang.eval.stringValue +import org.partiql.lang.util.booleanValue +import org.partiql.lang.util.stringValue +import java.io.FileInputStream +import java.io.InputStream +import java.io.InputStreamReader internal class ReadFile(valueFactory: ExprValueFactory) : BaseFunction(valueFactory) { override val name = "read_file" diff --git a/cli/src/org/partiql/cli/functions/WriteFile.kt b/cli/src/org/partiql/cli/functions/WriteFile.kt index 3753886816..053f10d382 100644 --- a/cli/src/org/partiql/cli/functions/WriteFile.kt +++ b/cli/src/org/partiql/cli/functions/WriteFile.kt @@ -14,12 +14,18 @@ package org.partiql.cli.functions -import com.amazon.ion.* -import com.amazon.ion.system.* -import org.partiql.lang.eval.* -import org.partiql.lang.eval.io.* -import org.partiql.lang.util.* -import java.io.* +import com.amazon.ion.IonStruct +import com.amazon.ion.system.IonTextWriterBuilder +import org.partiql.lang.eval.Environment +import org.partiql.lang.eval.ExprValue +import org.partiql.lang.eval.ExprValueFactory +import org.partiql.lang.eval.io.DelimitedValues +import org.partiql.lang.eval.stringValue +import org.partiql.lang.util.booleanValue +import org.partiql.lang.util.stringValue +import java.io.FileOutputStream +import java.io.OutputStream +import java.io.OutputStreamWriter internal class WriteFile(valueFactory: ExprValueFactory) : BaseFunction(valueFactory) { override val name = "write_file" diff --git a/cli/src/org/partiql/cli/main.kt b/cli/src/org/partiql/cli/main.kt index d7050181ef..b31f073489 100644 --- a/cli/src/org/partiql/cli/main.kt +++ b/cli/src/org/partiql/cli/main.kt @@ -16,14 +16,23 @@ package org.partiql.cli -import com.amazon.ion.system.* -import joptsimple.* +import com.amazon.ion.system.IonSystemBuilder +import joptsimple.OptionParser +import joptsimple.BuiltinHelpFormatter +import joptsimple.OptionDescriptor +import joptsimple.OptionException +import joptsimple.OptionSet import org.partiql.cli.functions.ReadFile import org.partiql.cli.functions.WriteFile -import org.partiql.lang.* -import org.partiql.lang.eval.* -import org.partiql.lang.syntax.* -import java.io.* +import org.partiql.lang.CompilerPipeline +import org.partiql.lang.eval.EvaluationSession +import org.partiql.lang.eval.ExprValueFactory +import org.partiql.lang.eval.Bindings +import org.partiql.lang.eval.ExprValue +import org.partiql.lang.syntax.SqlParser +import java.io.File +import java.io.FileInputStream +import java.io.FileOutputStream import kotlin.system.exitProcess // TODO how can a user pass the catalog here? diff --git a/cli/src/org/partiql/cli/stopwatch.kt b/cli/src/org/partiql/cli/stopwatch.kt index 26f601337e..b1f369b79f 100644 --- a/cli/src/org/partiql/cli/stopwatch.kt +++ b/cli/src/org/partiql/cli/stopwatch.kt @@ -14,7 +14,7 @@ package org.partiql.cli -import java.util.concurrent.* +import java.util.concurrent.TimeUnit fun timeIt(block: () -> T): Long { val start = System.nanoTime() diff --git a/cli/src/org/partiql/cli/streams.kt b/cli/src/org/partiql/cli/streams.kt index 7126d84c5d..1fc065b1e2 100644 --- a/cli/src/org/partiql/cli/streams.kt +++ b/cli/src/org/partiql/cli/streams.kt @@ -14,7 +14,9 @@ package org.partiql.cli -import java.io.* +import java.io.FilterOutputStream +import java.io.InputStream +import java.io.OutputStream /** * Output stream that flushes instead of closing, useful for decorating output streams that should not be closed but you diff --git a/cli/test/org/partiql/cli/CliTest.kt b/cli/test/org/partiql/cli/CliTest.kt index ca1ce92a91..cf14b00ad9 100644 --- a/cli/test/org/partiql/cli/CliTest.kt +++ b/cli/test/org/partiql/cli/CliTest.kt @@ -14,12 +14,21 @@ package org.partiql.cli -import com.amazon.ion.system.* -import org.partiql.lang.eval.* -import org.junit.* -import org.junit.Assert.* -import org.partiql.lang.* -import java.io.* +import com.amazon.ion.system.IonSystemBuilder +import junit.framework.Assert.assertEquals +import org.junit.After +import org.junit.Before +import org.junit.Test + +import org.partiql.lang.CompilerPipeline +import org.partiql.lang.eval.Bindings +import org.partiql.lang.eval.EvaluationException +import org.partiql.lang.eval.ExprValue +import org.partiql.lang.eval.ExprValueFactory +import java.io.ByteArrayOutputStream +import java.io.File +import java.io.FileOutputStream +import java.io.OutputStream import java.nio.file.Files class CliTest { @@ -40,7 +49,7 @@ class CliTest { } private fun makeCli(query: String, - input: String? = null, + input: String? = null, bindings: Bindings = Bindings.empty(), outputFormat: OutputFormat = OutputFormat.ION_TEXT, output: OutputStream = this.output) = diff --git a/cli/test/org/partiql/cli/ReplTest.kt b/cli/test/org/partiql/cli/ReplTest.kt index 8ca2f59aa5..a1be9c7fd0 100644 --- a/cli/test/org/partiql/cli/ReplTest.kt +++ b/cli/test/org/partiql/cli/ReplTest.kt @@ -14,15 +14,23 @@ package org.partiql.cli -import com.amazon.ion.system.* -import org.partiql.lang.eval.* -import org.partiql.lang.syntax.* -import org.junit.* -import org.junit.Assert.* -import org.partiql.lang.* -import java.io.* -import java.util.concurrent.* -import kotlin.concurrent.* +import com.amazon.ion.system.IonSystemBuilder +import org.junit.Assert +import org.junit.Ignore +import org.junit.Test +import org.partiql.lang.syntax.Parser +import org.partiql.lang.CompilerPipeline +import org.partiql.lang.eval.Bindings +import org.partiql.lang.eval.EvaluationSession +import org.partiql.lang.eval.ExprValue +import org.partiql.lang.eval.ExprValueFactory +import org.partiql.lang.syntax.SqlParser +import java.io.ByteArrayOutputStream +import java.io.OutputStream +import java.io.PipedInputStream +import java.io.PipedOutputStream +import java.util.concurrent.Phaser +import kotlin.concurrent.thread const val SLEEP_TIME = 5L @@ -134,7 +142,7 @@ private class ReplTester(bindings: Bindings = Bindings.empty()) { // make sure output was written outputPhaser.arriveAndAwaitAdvance() - assertEquals(expectedPromptText, actualReplPrompt.toString()) + Assert.assertEquals(expectedPromptText, actualReplPrompt.toString()) } private fun extractInputLines(expectedPromptText: String): List = diff --git a/cli/test/org/partiql/cli/functions/ReadFileTest.kt b/cli/test/org/partiql/cli/functions/ReadFileTest.kt index d8a421d8f4..43c044d390 100644 --- a/cli/test/org/partiql/cli/functions/ReadFileTest.kt +++ b/cli/test/org/partiql/cli/functions/ReadFileTest.kt @@ -14,11 +14,16 @@ package org.partiql.cli.functions -import com.amazon.ion.system.* -import org.partiql.lang.eval.* -import org.junit.* -import org.junit.Assert.* -import java.io.* +import com.amazon.ion.system.IonSystemBuilder +import junit.framework.Assert.assertEquals +import org.junit.AfterClass +import org.junit.BeforeClass +import org.junit.Test +import org.partiql.lang.eval.Bindings +import org.partiql.lang.eval.Environment +import org.partiql.lang.eval.EvaluationSession +import org.partiql.lang.eval.ExprValueFactory +import java.io.File class ReadFileTest { private val ion = IonSystemBuilder.standard().build() diff --git a/cli/test/org/partiql/cli/functions/WriteFileTest.kt b/cli/test/org/partiql/cli/functions/WriteFileTest.kt index 85bf04eb04..67a576cc5c 100644 --- a/cli/test/org/partiql/cli/functions/WriteFileTest.kt +++ b/cli/test/org/partiql/cli/functions/WriteFileTest.kt @@ -14,11 +14,16 @@ package org.partiql.cli.functions -import com.amazon.ion.system.* -import org.partiql.lang.eval.* -import org.junit.* -import org.junit.Assert.* -import java.io.* +import com.amazon.ion.system.IonSystemBuilder +import org.junit.After +import org.junit.Assert +import org.junit.Before +import org.junit.Test +import org.partiql.lang.eval.Bindings +import org.partiql.lang.eval.Environment +import org.partiql.lang.eval.EvaluationSession +import org.partiql.lang.eval.ExprValueFactory +import java.io.File class WriteFileTest { private val ion = IonSystemBuilder.standard().build() @@ -49,7 +54,7 @@ class WriteFileTest { val expected = "1 2" - assertEquals(ion.loader.load(expected), ion.loader.load(readFile("data.ion"))) + Assert.assertEquals(ion.loader.load(expected), ion.loader.load(readFile("data.ion"))) } @Test @@ -59,6 +64,6 @@ class WriteFileTest { val expected = "1 2" - assertEquals(ion.loader.load(expected), ion.loader.load(readFile("data1.ion"))) + Assert.assertEquals(ion.loader.load(expected), ion.loader.load(readFile("data1.ion"))) } }