embulk 0.8.39-java → 0.10.24-java
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/Gemfile +1 -1
- data/LICENSE +202 -0
- data/embulk.gemspec +34 -33
- data/lib/embulk.rb +5 -61
- data/lib/embulk/buffer.rb +1 -2
- data/lib/embulk/guess/charset.rb +2 -11
- data/lib/embulk/java/bootstrap.rb +0 -1
- data/lib/embulk/java_plugin.rb +9 -1
- data/lib/embulk/page_builder.rb +2 -2
- data/lib/embulk/plugin.rb +2 -2
- data/lib/embulk/schema.rb +3 -4
- data/lib/embulk/version.rb +3 -22
- metadata +22 -757
- data/.gitignore +0 -15
- data/.ruby-version +0 -1
- data/.travis.yml +0 -28
- data/COPYING +0 -14
- data/Gemfile.lock +0 -30
- data/README.md +0 -229
- data/Rakefile +0 -26
- data/appveyor.yml +0 -28
- data/bin/embulk +0 -139
- data/build.gradle +0 -419
- data/embulk-cli/build.gradle +0 -9
- data/embulk-cli/src/main/bat/selfrun.bat +0 -107
- data/embulk-cli/src/main/java/org/embulk/cli/EmbulkArguments.java +0 -54
- data/embulk-cli/src/main/java/org/embulk/cli/EmbulkCommandLine.java +0 -227
- data/embulk-cli/src/main/java/org/embulk/cli/EmbulkCommandLineException.java +0 -25
- data/embulk-cli/src/main/java/org/embulk/cli/EmbulkExample.java +0 -86
- data/embulk-cli/src/main/java/org/embulk/cli/EmbulkMigrate.java +0 -480
- data/embulk-cli/src/main/java/org/embulk/cli/EmbulkNew.java +0 -419
- data/embulk-cli/src/main/java/org/embulk/cli/EmbulkRun.java +0 -786
- data/embulk-cli/src/main/java/org/embulk/cli/EmbulkSelfUpdate.java +0 -235
- data/embulk-cli/src/main/java/org/embulk/cli/EmbulkSubcommand.java +0 -47
- data/embulk-cli/src/main/java/org/embulk/cli/Main.java +0 -31
- data/embulk-cli/src/main/java/org/embulk/cli/parse/AbstractHelpLineDefinition.java +0 -15
- data/embulk-cli/src/main/java/org/embulk/cli/parse/CliHelpFormatterWithHelpMessages.java +0 -141
- data/embulk-cli/src/main/java/org/embulk/cli/parse/CliOptionsWithHelpMessages.java +0 -45
- data/embulk-cli/src/main/java/org/embulk/cli/parse/EmbulkCommandLineHelpRequired.java +0 -10
- data/embulk-cli/src/main/java/org/embulk/cli/parse/EmbulkCommandLineParseException.java +0 -25
- data/embulk-cli/src/main/java/org/embulk/cli/parse/EmbulkCommandLineParser.java +0 -187
- data/embulk-cli/src/main/java/org/embulk/cli/parse/HelpMessageAsCliOption.java +0 -36
- data/embulk-cli/src/main/java/org/embulk/cli/parse/HelpMessageLineDefinition.java +0 -20
- data/embulk-cli/src/main/java/org/embulk/cli/parse/OptionBehavior.java +0 -39
- data/embulk-cli/src/main/java/org/embulk/cli/parse/OptionDefinition.java +0 -120
- data/embulk-cli/src/main/sh/selfrun.sh +0 -60
- data/embulk-cli/src/test/java/org/embulk/cli/DummyMain.java +0 -23
- data/embulk-cli/src/test/java/org/embulk/cli/SelfrunTest.java +0 -296
- data/embulk-core/build.gradle +0 -83
- data/embulk-core/src/main/java/org/embulk/EmbulkEmbed.java +0 -321
- data/embulk-core/src/main/java/org/embulk/EmbulkRunner.java +0 -531
- data/embulk-core/src/main/java/org/embulk/EmbulkService.java +0 -78
- data/embulk-core/src/main/java/org/embulk/EmbulkSetup.java +0 -49
- data/embulk-core/src/main/java/org/embulk/EmbulkVersion.java +0 -109
- data/embulk-core/src/main/java/org/embulk/command/PreviewPrinter.java +0 -87
- data/embulk-core/src/main/java/org/embulk/command/TablePreviewPrinter.java +0 -107
- data/embulk-core/src/main/java/org/embulk/command/VerticalPreviewPrinter.java +0 -47
- data/embulk-core/src/main/java/org/embulk/config/CommitReport.java +0 -36
- data/embulk-core/src/main/java/org/embulk/config/Config.java +0 -15
- data/embulk-core/src/main/java/org/embulk/config/ConfigDefault.java +0 -15
- data/embulk-core/src/main/java/org/embulk/config/ConfigDiff.java +0 -32
- data/embulk-core/src/main/java/org/embulk/config/ConfigException.java +0 -26
- data/embulk-core/src/main/java/org/embulk/config/ConfigInject.java +0 -14
- data/embulk-core/src/main/java/org/embulk/config/ConfigLoader.java +0 -149
- data/embulk-core/src/main/java/org/embulk/config/ConfigSource.java +0 -34
- data/embulk-core/src/main/java/org/embulk/config/DataSource.java +0 -41
- data/embulk-core/src/main/java/org/embulk/config/DataSourceImpl.java +0 -243
- data/embulk-core/src/main/java/org/embulk/config/DataSourceSerDe.java +0 -84
- data/embulk-core/src/main/java/org/embulk/config/GenericTypeReference.java +0 -20
- data/embulk-core/src/main/java/org/embulk/config/ModelManager.java +0 -123
- data/embulk-core/src/main/java/org/embulk/config/Task.java +0 -10
- data/embulk-core/src/main/java/org/embulk/config/TaskInvocationHandler.java +0 -180
- data/embulk-core/src/main/java/org/embulk/config/TaskReport.java +0 -32
- data/embulk-core/src/main/java/org/embulk/config/TaskSerDe.java +0 -349
- data/embulk-core/src/main/java/org/embulk/config/TaskSource.java +0 -34
- data/embulk-core/src/main/java/org/embulk/config/TaskValidationException.java +0 -38
- data/embulk-core/src/main/java/org/embulk/config/TaskValidator.java +0 -24
- data/embulk-core/src/main/java/org/embulk/config/UserDataException.java +0 -4
- data/embulk-core/src/main/java/org/embulk/config/UserDataExceptions.java +0 -17
- data/embulk-core/src/main/java/org/embulk/config/YamlTagResolver.java +0 -53
- data/embulk-core/src/main/java/org/embulk/exec/BufferFileInputPlugin.java +0 -88
- data/embulk-core/src/main/java/org/embulk/exec/BulkLoader.java +0 -754
- data/embulk-core/src/main/java/org/embulk/exec/ConfigurableGuessInputPlugin.java +0 -9
- data/embulk-core/src/main/java/org/embulk/exec/ExecModule.java +0 -53
- data/embulk-core/src/main/java/org/embulk/exec/ExecutionInterruptedException.java +0 -10
- data/embulk-core/src/main/java/org/embulk/exec/ExecutionResult.java +0 -33
- data/embulk-core/src/main/java/org/embulk/exec/ExtensionServiceLoaderModule.java +0 -43
- data/embulk-core/src/main/java/org/embulk/exec/ForGuess.java +0 -16
- data/embulk-core/src/main/java/org/embulk/exec/ForSystemConfig.java +0 -16
- data/embulk-core/src/main/java/org/embulk/exec/GuessExecutor.java +0 -309
- data/embulk-core/src/main/java/org/embulk/exec/LocalExecutorPlugin.java +0 -563
- data/embulk-core/src/main/java/org/embulk/exec/LoggerProvider.java +0 -68
- data/embulk-core/src/main/java/org/embulk/exec/NoSampleException.java +0 -10
- data/embulk-core/src/main/java/org/embulk/exec/PartialExecutionException.java +0 -26
- data/embulk-core/src/main/java/org/embulk/exec/PooledBufferAllocator.java +0 -77
- data/embulk-core/src/main/java/org/embulk/exec/PreviewExecutor.java +0 -222
- data/embulk-core/src/main/java/org/embulk/exec/PreviewResult.java +0 -27
- data/embulk-core/src/main/java/org/embulk/exec/PreviewedNoticeError.java +0 -17
- data/embulk-core/src/main/java/org/embulk/exec/ResumeState.java +0 -100
- data/embulk-core/src/main/java/org/embulk/exec/SamplingParserPlugin.java +0 -215
- data/embulk-core/src/main/java/org/embulk/exec/SetCurrentThreadName.java +0 -22
- data/embulk-core/src/main/java/org/embulk/exec/SkipTransactionException.java +0 -23
- data/embulk-core/src/main/java/org/embulk/exec/SystemConfigModule.java +0 -24
- data/embulk-core/src/main/java/org/embulk/exec/TempFileAllocator.java +0 -35
- data/embulk-core/src/main/java/org/embulk/exec/TransactionStage.java +0 -27
- data/embulk-core/src/main/java/org/embulk/jruby/JRubyPluginSource.java +0 -76
- data/embulk-core/src/main/java/org/embulk/jruby/JRubyScriptingModule.java +0 -395
- data/embulk-core/src/main/java/org/embulk/plugin/BuiltinPluginSourceModule.java +0 -17
- data/embulk-core/src/main/java/org/embulk/plugin/DefaultPluginType.java +0 -50
- data/embulk-core/src/main/java/org/embulk/plugin/InjectedPluginSource.java +0 -100
- data/embulk-core/src/main/java/org/embulk/plugin/MavenPluginType.java +0 -112
- data/embulk-core/src/main/java/org/embulk/plugin/PluginClassLoader.java +0 -993
- data/embulk-core/src/main/java/org/embulk/plugin/PluginClassLoaderFactory.java +0 -16
- data/embulk-core/src/main/java/org/embulk/plugin/PluginClassLoaderModule.java +0 -102
- data/embulk-core/src/main/java/org/embulk/plugin/PluginManager.java +0 -78
- data/embulk-core/src/main/java/org/embulk/plugin/PluginSource.java +0 -49
- data/embulk-core/src/main/java/org/embulk/plugin/PluginSourceNotMatchException.java +0 -25
- data/embulk-core/src/main/java/org/embulk/plugin/PluginType.java +0 -122
- data/embulk-core/src/main/java/org/embulk/plugin/compat/InputPluginWrapper.java +0 -102
- data/embulk-core/src/main/java/org/embulk/plugin/compat/PluginWrappers.java +0 -30
- data/embulk-core/src/main/java/org/embulk/plugin/compat/TransactionalFileInputWrapper.java +0 -96
- data/embulk-core/src/main/java/org/embulk/plugin/compat/TransactionalFileOutputWrapper.java +0 -102
- data/embulk-core/src/main/java/org/embulk/plugin/compat/TransactionalPageOutputWrapper.java +0 -95
- data/embulk-core/src/main/java/org/embulk/plugin/jar/InvalidJarPluginException.java +0 -14
- data/embulk-core/src/main/java/org/embulk/plugin/jar/JarPluginLoader.java +0 -232
- data/embulk-core/src/main/java/org/embulk/plugin/maven/MavenArtifactFinder.java +0 -134
- data/embulk-core/src/main/java/org/embulk/plugin/maven/MavenArtifactNotFoundException.java +0 -20
- data/embulk-core/src/main/java/org/embulk/plugin/maven/MavenPluginSource.java +0 -187
- data/embulk-core/src/main/java/org/embulk/plugin/maven/MavenPluginSourceModule.java +0 -22
- data/embulk-core/src/main/java/org/embulk/plugin/maven/MavenRepositoryNotFoundException.java +0 -31
- data/embulk-core/src/main/java/org/embulk/spi/AbortTransactionResource.java +0 -36
- data/embulk-core/src/main/java/org/embulk/spi/Buffer.java +0 -148
- data/embulk-core/src/main/java/org/embulk/spi/BufferAllocator.java +0 -8
- data/embulk-core/src/main/java/org/embulk/spi/CloseResource.java +0 -42
- data/embulk-core/src/main/java/org/embulk/spi/Column.java +0 -95
- data/embulk-core/src/main/java/org/embulk/spi/ColumnConfig.java +0 -112
- data/embulk-core/src/main/java/org/embulk/spi/ColumnVisitor.java +0 -16
- data/embulk-core/src/main/java/org/embulk/spi/DataException.java +0 -23
- data/embulk-core/src/main/java/org/embulk/spi/DecoderPlugin.java +0 -16
- data/embulk-core/src/main/java/org/embulk/spi/EncoderPlugin.java +0 -16
- data/embulk-core/src/main/java/org/embulk/spi/Exec.java +0 -113
- data/embulk-core/src/main/java/org/embulk/spi/ExecAction.java +0 -6
- data/embulk-core/src/main/java/org/embulk/spi/ExecSession.java +0 -220
- data/embulk-core/src/main/java/org/embulk/spi/ExecutorPlugin.java +0 -19
- data/embulk-core/src/main/java/org/embulk/spi/Extension.java +0 -44
- data/embulk-core/src/main/java/org/embulk/spi/FileInput.java +0 -11
- data/embulk-core/src/main/java/org/embulk/spi/FileInputPlugin.java +0 -30
- data/embulk-core/src/main/java/org/embulk/spi/FileInputRunner.java +0 -169
- data/embulk-core/src/main/java/org/embulk/spi/FileOutput.java +0 -13
- data/embulk-core/src/main/java/org/embulk/spi/FileOutputPlugin.java +0 -28
- data/embulk-core/src/main/java/org/embulk/spi/FileOutputRunner.java +0 -199
- data/embulk-core/src/main/java/org/embulk/spi/FilterPlugin.java +0 -18
- data/embulk-core/src/main/java/org/embulk/spi/FormatterPlugin.java +0 -18
- data/embulk-core/src/main/java/org/embulk/spi/GuessPlugin.java +0 -9
- data/embulk-core/src/main/java/org/embulk/spi/InputPlugin.java +0 -33
- data/embulk-core/src/main/java/org/embulk/spi/OutputPlugin.java +0 -29
- data/embulk-core/src/main/java/org/embulk/spi/Page.java +0 -86
- data/embulk-core/src/main/java/org/embulk/spi/PageBuilder.java +0 -696
- data/embulk-core/src/main/java/org/embulk/spi/PageFormat.java +0 -47
- data/embulk-core/src/main/java/org/embulk/spi/PageOutput.java +0 -11
- data/embulk-core/src/main/java/org/embulk/spi/PageReader.java +0 -248
- data/embulk-core/src/main/java/org/embulk/spi/ParserPlugin.java +0 -17
- data/embulk-core/src/main/java/org/embulk/spi/ProcessState.java +0 -10
- data/embulk-core/src/main/java/org/embulk/spi/ProcessTask.java +0 -117
- data/embulk-core/src/main/java/org/embulk/spi/Schema.java +0 -139
- data/embulk-core/src/main/java/org/embulk/spi/SchemaConfig.java +0 -93
- data/embulk-core/src/main/java/org/embulk/spi/SchemaConfigException.java +0 -22
- data/embulk-core/src/main/java/org/embulk/spi/TaskState.java +0 -81
- data/embulk-core/src/main/java/org/embulk/spi/TempFileException.java +0 -19
- data/embulk-core/src/main/java/org/embulk/spi/TempFileSpace.java +0 -88
- data/embulk-core/src/main/java/org/embulk/spi/Transactional.java +0 -10
- data/embulk-core/src/main/java/org/embulk/spi/TransactionalFileInput.java +0 -17
- data/embulk-core/src/main/java/org/embulk/spi/TransactionalFileOutput.java +0 -19
- data/embulk-core/src/main/java/org/embulk/spi/TransactionalPageOutput.java +0 -17
- data/embulk-core/src/main/java/org/embulk/spi/json/JsonParseException.java +0 -17
- data/embulk-core/src/main/java/org/embulk/spi/json/JsonParser.java +0 -233
- data/embulk-core/src/main/java/org/embulk/spi/json/RubyValueApi.java +0 -100
- data/embulk-core/src/main/java/org/embulk/spi/time/DateTimeZoneSerDe.java +0 -55
- data/embulk-core/src/main/java/org/embulk/spi/time/Timestamp.java +0 -180
- data/embulk-core/src/main/java/org/embulk/spi/time/TimestampFormat.java +0 -158
- data/embulk-core/src/main/java/org/embulk/spi/time/TimestampFormatter.java +0 -125
- data/embulk-core/src/main/java/org/embulk/spi/time/TimestampParseException.java +0 -12
- data/embulk-core/src/main/java/org/embulk/spi/time/TimestampParser.java +0 -310
- data/embulk-core/src/main/java/org/embulk/spi/time/TimestampSerDe.java +0 -49
- data/embulk-core/src/main/java/org/embulk/spi/type/AbstractType.java +0 -58
- data/embulk-core/src/main/java/org/embulk/spi/type/BooleanType.java +0 -12
- data/embulk-core/src/main/java/org/embulk/spi/type/DoubleType.java +0 -12
- data/embulk-core/src/main/java/org/embulk/spi/type/JsonType.java +0 -14
- data/embulk-core/src/main/java/org/embulk/spi/type/LongType.java +0 -12
- data/embulk-core/src/main/java/org/embulk/spi/type/StringType.java +0 -12
- data/embulk-core/src/main/java/org/embulk/spi/type/TimestampType.java +0 -41
- data/embulk-core/src/main/java/org/embulk/spi/type/Type.java +0 -15
- data/embulk-core/src/main/java/org/embulk/spi/type/TypeDeserializer.java +0 -45
- data/embulk-core/src/main/java/org/embulk/spi/type/Types.java +0 -16
- data/embulk-core/src/main/java/org/embulk/spi/unit/ByteSize.java +0 -156
- data/embulk-core/src/main/java/org/embulk/spi/unit/LocalFile.java +0 -106
- data/embulk-core/src/main/java/org/embulk/spi/unit/LocalFileSerDe.java +0 -113
- data/embulk-core/src/main/java/org/embulk/spi/unit/ToString.java +0 -54
- data/embulk-core/src/main/java/org/embulk/spi/unit/ToStringMap.java +0 -34
- data/embulk-core/src/main/java/org/embulk/spi/util/CharsetSerDe.java +0 -55
- data/embulk-core/src/main/java/org/embulk/spi/util/Decoders.java +0 -81
- data/embulk-core/src/main/java/org/embulk/spi/util/DynamicColumnNotFoundException.java +0 -10
- data/embulk-core/src/main/java/org/embulk/spi/util/DynamicColumnSetter.java +0 -21
- data/embulk-core/src/main/java/org/embulk/spi/util/DynamicColumnSetterFactory.java +0 -134
- data/embulk-core/src/main/java/org/embulk/spi/util/DynamicPageBuilder.java +0 -200
- data/embulk-core/src/main/java/org/embulk/spi/util/Encoders.java +0 -81
- data/embulk-core/src/main/java/org/embulk/spi/util/Executors.java +0 -93
- data/embulk-core/src/main/java/org/embulk/spi/util/FileInputInputStream.java +0 -111
- data/embulk-core/src/main/java/org/embulk/spi/util/FileOutputOutputStream.java +0 -119
- data/embulk-core/src/main/java/org/embulk/spi/util/Filters.java +0 -100
- data/embulk-core/src/main/java/org/embulk/spi/util/InputStreamFileInput.java +0 -189
- data/embulk-core/src/main/java/org/embulk/spi/util/InputStreamTransactionalFileInput.java +0 -25
- data/embulk-core/src/main/java/org/embulk/spi/util/Inputs.java +0 -65
- data/embulk-core/src/main/java/org/embulk/spi/util/LineDecoder.java +0 -157
- data/embulk-core/src/main/java/org/embulk/spi/util/LineEncoder.java +0 -123
- data/embulk-core/src/main/java/org/embulk/spi/util/ListFileInput.java +0 -52
- data/embulk-core/src/main/java/org/embulk/spi/util/Newline.java +0 -38
- data/embulk-core/src/main/java/org/embulk/spi/util/OutputStreamFileOutput.java +0 -88
- data/embulk-core/src/main/java/org/embulk/spi/util/PagePrinter.java +0 -126
- data/embulk-core/src/main/java/org/embulk/spi/util/Pages.java +0 -149
- data/embulk-core/src/main/java/org/embulk/spi/util/ResumableInputStream.java +0 -168
- data/embulk-core/src/main/java/org/embulk/spi/util/RetryExecutor.java +0 -130
- data/embulk-core/src/main/java/org/embulk/spi/util/Timestamps.java +0 -53
- data/embulk-core/src/main/java/org/embulk/spi/util/dynamic/AbstractDynamicColumnSetter.java +0 -94
- data/embulk-core/src/main/java/org/embulk/spi/util/dynamic/BooleanColumnSetter.java +0 -71
- data/embulk-core/src/main/java/org/embulk/spi/util/dynamic/DefaultValueSetter.java +0 -20
- data/embulk-core/src/main/java/org/embulk/spi/util/dynamic/DoubleColumnSetter.java +0 -68
- data/embulk-core/src/main/java/org/embulk/spi/util/dynamic/JsonColumnSetter.java +0 -64
- data/embulk-core/src/main/java/org/embulk/spi/util/dynamic/LongColumnSetter.java +0 -78
- data/embulk-core/src/main/java/org/embulk/spi/util/dynamic/NullDefaultValueSetter.java +0 -39
- data/embulk-core/src/main/java/org/embulk/spi/util/dynamic/SkipColumnSetter.java +0 -68
- data/embulk-core/src/main/java/org/embulk/spi/util/dynamic/StringColumnSetter.java +0 -63
- data/embulk-core/src/main/java/org/embulk/spi/util/dynamic/TimestampColumnSetter.java +0 -72
- data/embulk-core/src/main/resources/embulk/logback-color.xml +0 -72
- data/embulk-core/src/main/resources/embulk/logback-console.xml +0 -14
- data/embulk-core/src/main/resources/embulk/logback-file.xml +0 -23
- data/embulk-core/src/main/resources/embulk/parent_first_packages.properties +0 -73
- data/embulk-core/src/main/resources/embulk/parent_first_resources.properties +0 -29
- data/embulk-core/src/test/java/org/embulk/EmbulkTestRuntime.java +0 -122
- data/embulk-core/src/test/java/org/embulk/GuiceBinder.java +0 -72
- data/embulk-core/src/test/java/org/embulk/RandomManager.java +0 -53
- data/embulk-core/src/test/java/org/embulk/TestPluginSourceModule.java +0 -23
- data/embulk-core/src/test/java/org/embulk/TestUtilityModule.java +0 -17
- data/embulk-core/src/test/java/org/embulk/config/TestConfigLoader.java +0 -66
- data/embulk-core/src/test/java/org/embulk/config/TestConfigSource.java +0 -114
- data/embulk-core/src/test/java/org/embulk/config/TestTaskSource.java +0 -70
- data/embulk-core/src/test/java/org/embulk/plugin/MockPluginSource.java +0 -58
- data/embulk-core/src/test/java/org/embulk/plugin/TestPluginType.java +0 -83
- data/embulk-core/src/test/java/org/embulk/plugin/TestPluginTypeSerDe.java +0 -67
- data/embulk-core/src/test/java/org/embulk/plugin/jar/ExampleJarSpiV0.java +0 -9
- data/embulk-core/src/test/java/org/embulk/plugin/jar/JarBuilder.java +0 -101
- data/embulk-core/src/test/java/org/embulk/plugin/jar/TestJarPluginLoader.java +0 -60
- data/embulk-core/src/test/java/org/embulk/plugin/maven/TestMavenArtifactFinder.java +0 -41
- data/embulk-core/src/test/java/org/embulk/spi/MockFileOutput.java +0 -63
- data/embulk-core/src/test/java/org/embulk/spi/MockFormatterPlugin.java +0 -108
- data/embulk-core/src/test/java/org/embulk/spi/MockParserPlugin.java +0 -80
- data/embulk-core/src/test/java/org/embulk/spi/PageTestUtils.java +0 -59
- data/embulk-core/src/test/java/org/embulk/spi/TestBuffer.java +0 -24
- data/embulk-core/src/test/java/org/embulk/spi/TestFileInputInputStream.java +0 -89
- data/embulk-core/src/test/java/org/embulk/spi/TestFileInputRunner.java +0 -199
- data/embulk-core/src/test/java/org/embulk/spi/TestFileOutputRunner.java +0 -221
- data/embulk-core/src/test/java/org/embulk/spi/TestInputStreamFileInput.java +0 -188
- data/embulk-core/src/test/java/org/embulk/spi/TestPageBuilderReader.java +0 -411
- data/embulk-core/src/test/java/org/embulk/spi/json/TestJsonParser.java +0 -102
- data/embulk-core/src/test/java/org/embulk/spi/time/TestTimestamp.java +0 -116
- data/embulk-core/src/test/java/org/embulk/spi/time/TestTimestampFormatterParser.java +0 -75
- data/embulk-core/src/test/java/org/embulk/spi/time/TestTimestampFormatterParserDeprecated.java +0 -67
- data/embulk-core/src/test/java/org/embulk/spi/time/TestTimestampParser.java +0 -247
- data/embulk-core/src/test/java/org/embulk/spi/type/TestTypeSerDe.java +0 -45
- data/embulk-core/src/test/java/org/embulk/spi/unit/TestByteSize.java +0 -79
- data/embulk-core/src/test/java/org/embulk/spi/util/TestLineDecoder.java +0 -237
- data/embulk-core/src/test/java/org/embulk/spi/util/TestLineEncoder.java +0 -123
- data/embulk-core/src/test/resources/m2.test/.gitignore +0 -1
- data/embulk-core/src/test/resources/m2.test/org/embulk/example/embulk-example-maven-artifact/0.1.2/embulk-example-maven-artifact-0.1.2.jar +0 -0
- data/embulk-core/src/test/resources/m2.test/org/embulk/example/embulk-example-maven-artifact/0.1.2/embulk-example-maven-artifact-0.1.2.jar.sha1 +0 -1
- data/embulk-core/src/test/resources/m2.test/org/embulk/example/embulk-example-maven-artifact/0.1.2/embulk-example-maven-artifact-0.1.2.pom +0 -9
- data/embulk-core/src/test/resources/m2.test/org/embulk/example/embulk-example-maven-artifact/0.1.2/embulk-example-maven-artifact-0.1.2.pom.sha1 +0 -1
- data/embulk-docs/Makefile +0 -178
- data/embulk-docs/build.gradle +0 -41
- data/embulk-docs/make.bat +0 -243
- data/embulk-docs/push-gh-pages.sh +0 -49
- data/embulk-docs/src/_static/embulk-architecture.png +0 -0
- data/embulk-docs/src/_static/embulk-logo-v2/embulk-logo-v2-oneline-tr.png +0 -0
- data/embulk-docs/src/_static/embulk-logo-v2/embulk-logo-v2-oneline-wt.png +0 -0
- data/embulk-docs/src/_static/embulk-logo-v2/embulk-logo-v2-oneline.ai +0 -396
- data/embulk-docs/src/_static/embulk-logo-v2/embulk-logo-v2-sq-tr-small.png +0 -0
- data/embulk-docs/src/_static/embulk-logo-v2/embulk-logo-v2-sq-tr.png +0 -0
- data/embulk-docs/src/_static/embulk-logo-v2/embulk-logo-v2-sq-wt.png +0 -0
- data/embulk-docs/src/_static/embulk-logo-v2/embulk-logo-v2-sq.ai +0 -417
- data/embulk-docs/src/_static/embulk-logo-v2/embulk-logo-v2-sq.svg +0 -1
- data/embulk-docs/src/_static/embulk-logo-v2/embulk-logo-v2-symbol-tr.png +0 -0
- data/embulk-docs/src/_static/embulk-logo-v2/embulk-logo-v2-symbol-wt.png +0 -0
- data/embulk-docs/src/_static/embulk-logo-v2/embulk-logo-v2-symbol.ai +1 -394
- data/embulk-docs/src/_static/embulk-logo.svg +0 -133
- data/embulk-docs/src/built-in.rst +0 -1017
- data/embulk-docs/src/conf.py +0 -260
- data/embulk-docs/src/customization.rst +0 -184
- data/embulk-docs/src/developers/index.rst +0 -45
- data/embulk-docs/src/index.rst +0 -102
- data/embulk-docs/src/logo.rst +0 -27
- data/embulk-docs/src/recipe.rst +0 -8
- data/embulk-docs/src/recipe/scheduled-csv-load-to-elasticsearch-kibana5.rst +0 -163
- data/embulk-docs/src/release.rst +0 -109
- data/embulk-docs/src/release/release-0.1.0.rst +0 -8
- data/embulk-docs/src/release/release-0.2.0.rst +0 -16
- data/embulk-docs/src/release/release-0.2.1.rst +0 -19
- data/embulk-docs/src/release/release-0.3.0.rst +0 -34
- data/embulk-docs/src/release/release-0.3.1.rst +0 -11
- data/embulk-docs/src/release/release-0.3.2.rst +0 -15
- data/embulk-docs/src/release/release-0.4.0.rst +0 -74
- data/embulk-docs/src/release/release-0.4.1.rst +0 -18
- data/embulk-docs/src/release/release-0.4.10.rst +0 -17
- data/embulk-docs/src/release/release-0.4.2.rst +0 -18
- data/embulk-docs/src/release/release-0.4.3.rst +0 -34
- data/embulk-docs/src/release/release-0.4.4.rst +0 -39
- data/embulk-docs/src/release/release-0.4.5.rst +0 -24
- data/embulk-docs/src/release/release-0.4.6.rst +0 -30
- data/embulk-docs/src/release/release-0.4.7.rst +0 -16
- data/embulk-docs/src/release/release-0.4.8.rst +0 -15
- data/embulk-docs/src/release/release-0.4.9.rst +0 -23
- data/embulk-docs/src/release/release-0.5.0.rst +0 -89
- data/embulk-docs/src/release/release-0.5.1.rst +0 -13
- data/embulk-docs/src/release/release-0.5.2.rst +0 -30
- data/embulk-docs/src/release/release-0.5.3.rst +0 -22
- data/embulk-docs/src/release/release-0.5.4.rst +0 -24
- data/embulk-docs/src/release/release-0.5.5.rst +0 -18
- data/embulk-docs/src/release/release-0.6.0.rst +0 -34
- data/embulk-docs/src/release/release-0.6.1.rst +0 -11
- data/embulk-docs/src/release/release-0.6.10.rst +0 -15
- data/embulk-docs/src/release/release-0.6.11.rst +0 -19
- data/embulk-docs/src/release/release-0.6.12.rst +0 -31
- data/embulk-docs/src/release/release-0.6.13.rst +0 -23
- data/embulk-docs/src/release/release-0.6.14.rst +0 -47
- data/embulk-docs/src/release/release-0.6.15.rst +0 -26
- data/embulk-docs/src/release/release-0.6.16.rst +0 -26
- data/embulk-docs/src/release/release-0.6.17.rst +0 -39
- data/embulk-docs/src/release/release-0.6.18.rst +0 -14
- data/embulk-docs/src/release/release-0.6.19.rst +0 -18
- data/embulk-docs/src/release/release-0.6.2.rst +0 -17
- data/embulk-docs/src/release/release-0.6.20.rst +0 -19
- data/embulk-docs/src/release/release-0.6.21.rst +0 -20
- data/embulk-docs/src/release/release-0.6.22.rst +0 -26
- data/embulk-docs/src/release/release-0.6.23.rst +0 -17
- data/embulk-docs/src/release/release-0.6.24.rst +0 -13
- data/embulk-docs/src/release/release-0.6.25.rst +0 -12
- data/embulk-docs/src/release/release-0.6.26.rst +0 -17
- data/embulk-docs/src/release/release-0.6.27.rst +0 -11
- data/embulk-docs/src/release/release-0.6.3.rst +0 -23
- data/embulk-docs/src/release/release-0.6.4.rst +0 -13
- data/embulk-docs/src/release/release-0.6.5.rst +0 -17
- data/embulk-docs/src/release/release-0.6.6.rst +0 -17
- data/embulk-docs/src/release/release-0.6.7.rst +0 -17
- data/embulk-docs/src/release/release-0.6.8.rst +0 -24
- data/embulk-docs/src/release/release-0.6.9.rst +0 -24
- data/embulk-docs/src/release/release-0.7.0.rst +0 -96
- data/embulk-docs/src/release/release-0.7.1.rst +0 -22
- data/embulk-docs/src/release/release-0.7.10.rst +0 -13
- data/embulk-docs/src/release/release-0.7.11.rst +0 -12
- data/embulk-docs/src/release/release-0.7.2.rst +0 -25
- data/embulk-docs/src/release/release-0.7.3.rst +0 -21
- data/embulk-docs/src/release/release-0.7.4.rst +0 -14
- data/embulk-docs/src/release/release-0.7.5.rst +0 -22
- data/embulk-docs/src/release/release-0.7.6.rst +0 -18
- data/embulk-docs/src/release/release-0.7.7.rst +0 -13
- data/embulk-docs/src/release/release-0.7.8.rst +0 -14
- data/embulk-docs/src/release/release-0.7.9.rst +0 -14
- data/embulk-docs/src/release/release-0.8.0.rst +0 -74
- data/embulk-docs/src/release/release-0.8.1.rst +0 -18
- data/embulk-docs/src/release/release-0.8.10.rst +0 -35
- data/embulk-docs/src/release/release-0.8.11.rst +0 -12
- data/embulk-docs/src/release/release-0.8.12.rst +0 -12
- data/embulk-docs/src/release/release-0.8.13.rst +0 -12
- data/embulk-docs/src/release/release-0.8.14.rst +0 -31
- data/embulk-docs/src/release/release-0.8.15.rst +0 -17
- data/embulk-docs/src/release/release-0.8.16.rst +0 -43
- data/embulk-docs/src/release/release-0.8.17.rst +0 -11
- data/embulk-docs/src/release/release-0.8.18.rst +0 -27
- data/embulk-docs/src/release/release-0.8.19.rst +0 -43
- data/embulk-docs/src/release/release-0.8.2.rst +0 -19
- data/embulk-docs/src/release/release-0.8.20.rst +0 -11
- data/embulk-docs/src/release/release-0.8.21.rst +0 -17
- data/embulk-docs/src/release/release-0.8.22.rst +0 -15
- data/embulk-docs/src/release/release-0.8.23.rst +0 -14
- data/embulk-docs/src/release/release-0.8.24.rst +0 -15
- data/embulk-docs/src/release/release-0.8.25.rst +0 -14
- data/embulk-docs/src/release/release-0.8.26.rst +0 -16
- data/embulk-docs/src/release/release-0.8.27.rst +0 -15
- data/embulk-docs/src/release/release-0.8.28.rst +0 -14
- data/embulk-docs/src/release/release-0.8.29.rst +0 -14
- data/embulk-docs/src/release/release-0.8.3.rst +0 -15
- data/embulk-docs/src/release/release-0.8.30.rst +0 -14
- data/embulk-docs/src/release/release-0.8.31.rst +0 -12
- data/embulk-docs/src/release/release-0.8.32.rst +0 -14
- data/embulk-docs/src/release/release-0.8.33.rst +0 -13
- data/embulk-docs/src/release/release-0.8.34.rst +0 -12
- data/embulk-docs/src/release/release-0.8.35.rst +0 -12
- data/embulk-docs/src/release/release-0.8.36.rst +0 -32
- data/embulk-docs/src/release/release-0.8.37.rst +0 -20
- data/embulk-docs/src/release/release-0.8.38.rst +0 -12
- data/embulk-docs/src/release/release-0.8.39.rst +0 -12
- data/embulk-docs/src/release/release-0.8.4.rst +0 -18
- data/embulk-docs/src/release/release-0.8.5.rst +0 -11
- data/embulk-docs/src/release/release-0.8.6.rst +0 -14
- data/embulk-docs/src/release/release-0.8.7.rst +0 -18
- data/embulk-docs/src/release/release-0.8.8.rst +0 -18
- data/embulk-docs/src/release/release-0.8.9.rst +0 -14
- data/embulk-jruby-strptime/build.gradle +0 -3
- data/embulk-jruby-strptime/src/main/java/org/embulk/spi/time/RubyDateParser.java +0 -121
- data/embulk-jruby-strptime/src/main/java/org/embulk/spi/time/StrptimeFormat.java +0 -53
- data/embulk-jruby-strptime/src/main/java/org/embulk/spi/time/StrptimeParser.java +0 -884
- data/embulk-jruby-strptime/src/main/java/org/embulk/spi/time/StrptimeToken.java +0 -111
- data/embulk-jruby-strptime/src/main/java/org/embulk/spi/time/TimeZoneConverter.java +0 -466
- data/embulk-jruby-strptime/src/main/java/org/embulk/spi/time/lexer/StrptimeLexer.flex +0 -62
- data/embulk-jruby-strptime/src/main/java/org/embulk/spi/time/lexer/StrptimeLexer.java +0 -577
- data/embulk-standards/build.gradle +0 -7
- data/embulk-standards/src/main/java/org/embulk/standards/Bzip2FileDecoderPlugin.java +0 -55
- data/embulk-standards/src/main/java/org/embulk/standards/Bzip2FileEncoderPlugin.java +0 -67
- data/embulk-standards/src/main/java/org/embulk/standards/ConfigInputPlugin.java +0 -170
- data/embulk-standards/src/main/java/org/embulk/standards/CsvFormatterPlugin.java +0 -295
- data/embulk-standards/src/main/java/org/embulk/standards/CsvParserPlugin.java +0 -416
- data/embulk-standards/src/main/java/org/embulk/standards/CsvTokenizer.java +0 -545
- data/embulk-standards/src/main/java/org/embulk/standards/GzipFileDecoderPlugin.java +0 -55
- data/embulk-standards/src/main/java/org/embulk/standards/GzipFileEncoderPlugin.java +0 -71
- data/embulk-standards/src/main/java/org/embulk/standards/JsonParserPlugin.java +0 -235
- data/embulk-standards/src/main/java/org/embulk/standards/LocalFileInputPlugin.java +0 -232
- data/embulk-standards/src/main/java/org/embulk/standards/LocalFileOutputPlugin.java +0 -148
- data/embulk-standards/src/main/java/org/embulk/standards/NullOutputPlugin.java +0 -59
- data/embulk-standards/src/main/java/org/embulk/standards/RemoveColumnsFilterPlugin.java +0 -268
- data/embulk-standards/src/main/java/org/embulk/standards/RenameFilterPlugin.java +0 -479
- data/embulk-standards/src/main/java/org/embulk/standards/StandardPluginExtension.java +0 -16
- data/embulk-standards/src/main/java/org/embulk/standards/StandardPluginModule.java +0 -60
- data/embulk-standards/src/main/java/org/embulk/standards/StdoutOutputPlugin.java +0 -91
- data/embulk-standards/src/main/resources/META-INF/services/org.embulk.spi.Extension +0 -1
- data/embulk-standards/src/test/java/org/embulk/standards/TestCsvFormatterPlugin.java +0 -312
- data/embulk-standards/src/test/java/org/embulk/standards/TestCsvParserPlugin.java +0 -75
- data/embulk-standards/src/test/java/org/embulk/standards/TestCsvTokenizer.java +0 -457
- data/embulk-standards/src/test/java/org/embulk/standards/TestJsonParserPlugin.java +0 -351
- data/embulk-standards/src/test/java/org/embulk/standards/TestRemoveColumnsFilterPlugin.java +0 -121
- data/embulk-standards/src/test/java/org/embulk/standards/TestRenameFilterPlugin.java +0 -1020
- data/embulk-standards/src/test/java/org/embulk/standards/guess/TestCsvAllStringsGuessPlugin.java +0 -38
- data/embulk-standards/src/test/java/org/embulk/standards/guess/TestCsvGuessPlugin.java +0 -248
- data/embulk-standards/src/test/java/org/embulk/standards/preview/TestFilePreview.java +0 -73
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_1_int_single_column_row.csv +0 -1
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_1_int_single_column_row_and_header.csv +0 -2
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_1_int_single_column_row_and_header_guessed.yml +0 -12
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_1_int_single_column_row_and_header_seed.yml +0 -1
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_1_int_single_column_row_guessed.yml +0 -12
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_1_int_single_column_row_seed.yml +0 -1
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_1_rows.csv +0 -1
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_1_rows_and_header.csv +0 -2
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_1_rows_and_header_guessed.yml +0 -16
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_1_rows_and_header_seed.yml +0 -1
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_1_rows_and_header_with_trim_needed.csv +0 -2
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_1_rows_and_header_with_trim_needed_guessed.yml +0 -16
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_1_rows_and_header_with_trim_needed_seed.yml +0 -1
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_1_rows_guessed.yml +0 -16
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_1_rows_seed.yml +0 -1
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_1_rows_with_trim_needed.csv +0 -1
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_1_rows_with_trim_needed_guessed.yml +0 -16
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_1_rows_with_trim_needed_seed.yml +0 -1
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_1_string_single_column_row.csv +0 -1
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_1_string_single_column_row_and_header.csv +0 -2
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_1_string_single_column_row_and_header_guessed.yml +0 -12
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_1_string_single_column_row_and_header_seed.yml +0 -1
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_1_string_single_column_row_guessed.yml +0 -12
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_1_string_single_column_row_seed.yml +0 -1
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_2_int_single_column_rows.csv +0 -2
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_2_int_single_column_rows_guessed.yml +0 -12
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_2_int_single_column_rows_seed.yml +0 -1
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_2_rows.csv +0 -2
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_2_rows_and_header.csv +0 -3
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_2_rows_and_header_guessed.yml +0 -16
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_2_rows_and_header_seed.yml +0 -1
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_2_rows_guessed.yml +0 -16
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_2_rows_seed.yml +0 -1
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_2_string_single_column_rows.csv +0 -2
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_2_string_single_column_rows_guessed.yml +0 -12
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_2_string_single_column_rows_seed.yml +0 -1
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_backslash_escape.csv +0 -5
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_backslash_escape_guessed.yml +0 -17
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_backslash_escape_seed.yml +0 -1
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_double_single_column.csv +0 -12
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_double_single_column_guessed.yml +0 -12
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_double_single_column_seed.yml +0 -1
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_int_single_column.csv +0 -4
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_int_single_column_guessed.yml +0 -12
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_int_single_column_seed.yml +0 -1
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_int_single_column_with_header.csv +0 -5
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_int_single_column_with_header_guessed.yml +0 -12
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_int_single_column_with_header_seed.yml +0 -1
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_semicolon_delimiter.csv +0 -5
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_semicolon_delimiter_guessed.yml +0 -17
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_semicolon_delimiter_seed.yml +0 -1
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_simple.csv +0 -5
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_simple_guessed.yml +0 -17
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_simple_seed.yml +0 -1
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_single_quote.csv +0 -5
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_single_quote_guessed.yml +0 -17
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_single_quote_seed.yml +0 -1
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_skip_suggest_if_empty_sample_records.csv +0 -5
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_skip_suggest_if_empty_sample_records_guessed.yml +0 -2
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_skip_suggest_if_empty_sample_records_seed.yml +0 -1
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_string_single_column.csv +0 -4
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_string_single_column_guessed.yml +0 -12
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_string_single_column_seed.yml +0 -1
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_string_single_column_with_header.csv +0 -5
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_string_single_column_with_header_guessed.yml +0 -12
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_string_single_column_with_header_seed.yml +0 -1
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_tab_delimiter.csv +0 -4
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_tab_delimiter_guessed.yml +0 -16
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv/test/test_tab_delimiter_seed.yml +0 -1
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv_all_strings/test/test_simple.csv +0 -5
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv_all_strings/test/test_simple_guessed.yml +0 -17
- data/embulk-standards/src/test/resources/org/embulk/standards/guess/csv_all_strings/test/test_simple_seed.yml +0 -1
- data/embulk-standards/src/test/resources/org/embulk/standards/preview/file/test/test_sample_buffer_bytes.csv +0 -5
- data/embulk-standards/src/test/resources/org/embulk/standards/preview/file/test/test_sample_buffer_bytes_exec.yml +0 -1
- data/embulk-standards/src/test/resources/org/embulk/standards/preview/file/test/test_sample_buffer_bytes_load.yml +0 -19
- data/embulk-standards/src/test/resources/org/embulk/standards/preview/file/test/test_sample_buffer_bytes_previewed.csv +0 -1
- data/embulk-standards/src/test/resources/org/embulk/standards/preview/file/test/test_simple.csv +0 -5
- data/embulk-standards/src/test/resources/org/embulk/standards/preview/file/test/test_simple_load.yml +0 -19
- data/embulk-standards/src/test/resources/org/embulk/standards/preview/file/test/test_simple_previewed.csv +0 -4
- data/embulk-standards/src/test/resources/org/embulk/standards/remove_columns/test/test_keep.csv +0 -5
- data/embulk-standards/src/test/resources/org/embulk/standards/remove_columns/test/test_keep_expected.csv +0 -4
- data/embulk-standards/src/test/resources/org/embulk/standards/remove_columns/test/test_keep_filter.yml +0 -2
- data/embulk-standards/src/test/resources/org/embulk/standards/remove_columns/test/test_keep_in.yml +0 -18
- data/embulk-standards/src/test/resources/org/embulk/standards/remove_columns/test/test_keep_with_duplicated_column_names.csv +0 -5
- data/embulk-standards/src/test/resources/org/embulk/standards/remove_columns/test/test_keep_with_duplicated_column_names.yml +0 -2
- data/embulk-standards/src/test/resources/org/embulk/standards/remove_columns/test/test_keep_with_duplicated_column_names_expected.csv +0 -4
- data/embulk-standards/src/test/resources/org/embulk/standards/remove_columns/test/test_keep_with_duplicated_column_names_in.yml +0 -17
- data/embulk-standards/src/test/resources/org/embulk/standards/remove_columns/test/test_keep_with_unmatched_filter.yml +0 -3
- data/embulk-standards/src/test/resources/org/embulk/standards/remove_columns/test/test_keep_without_unmatched_filter.yml +0 -2
- data/embulk-standards/src/test/resources/org/embulk/standards/remove_columns/test/test_remove.csv +0 -5
- data/embulk-standards/src/test/resources/org/embulk/standards/remove_columns/test/test_remove_expected.csv +0 -4
- data/embulk-standards/src/test/resources/org/embulk/standards/remove_columns/test/test_remove_filter.yml +0 -2
- data/embulk-standards/src/test/resources/org/embulk/standards/remove_columns/test/test_remove_in.yml +0 -18
- data/embulk-standards/src/test/resources/org/embulk/standards/remove_columns/test/test_remove_with_unmatched_filter.yml +0 -3
- data/embulk-standards/src/test/resources/org/embulk/standards/remove_columns/test/test_remove_without_unmatched_filter.yml +0 -2
- data/embulk-test/build.gradle +0 -6
- data/embulk-test/src/main/java/org/embulk/test/EmbulkTests.java +0 -75
- data/embulk-test/src/main/java/org/embulk/test/PreviewResultInputPlugin.java +0 -65
- data/embulk-test/src/main/java/org/embulk/test/TestingBulkLoader.java +0 -129
- data/embulk-test/src/main/java/org/embulk/test/TestingEmbulk.java +0 -710
- data/gradle/wrapper/gradle-wrapper.jar +0 -0
- data/gradle/wrapper/gradle-wrapper.properties +0 -5
- data/gradlew +0 -172
- data/gradlew.bat +0 -84
- data/lib/embulk/data/bundle/.bundle/config +0 -3
- data/lib/embulk/data/bundle/.ruby-version +0 -1
- data/lib/embulk/data/bundle/Gemfile +0 -31
- data/lib/embulk/data/bundle/embulk/filter/example.rb +0 -42
- data/lib/embulk/data/bundle/embulk/input/example.rb +0 -54
- data/lib/embulk/data/bundle/embulk/output/example.rb +0 -58
- data/lib/embulk/data/new/LICENSE.txt +0 -21
- data/lib/embulk/data/new/README.md.vm +0 -106
- data/lib/embulk/data/new/gitignore.vm +0 -17
- data/lib/embulk/data/new/java/build.gradle.vm +0 -96
- data/lib/embulk/data/new/java/config/checkstyle/checkstyle.xml +0 -128
- data/lib/embulk/data/new/java/config/checkstyle/default.xml +0 -108
- data/lib/embulk/data/new/java/decoder.java.vm +0 -86
- data/lib/embulk/data/new/java/encoder.java.vm +0 -88
- data/lib/embulk/data/new/java/file_input.java.vm +0 -145
- data/lib/embulk/data/new/java/file_output.java.vm +0 -95
- data/lib/embulk/data/new/java/filter.java.vm +0 -57
- data/lib/embulk/data/new/java/formatter.java.vm +0 -55
- data/lib/embulk/data/new/java/gradle/wrapper/gradle-wrapper.jar +0 -0
- data/lib/embulk/data/new/java/gradle/wrapper/gradle-wrapper.properties +0 -5
- data/lib/embulk/data/new/java/gradlew +0 -172
- data/lib/embulk/data/new/java/gradlew.bat +0 -84
- data/lib/embulk/data/new/java/input.java.vm +0 -89
- data/lib/embulk/data/new/java/output.java.vm +0 -79
- data/lib/embulk/data/new/java/parser.java.vm +0 -61
- data/lib/embulk/data/new/java/plugin_loader.rb.vm +0 -3
- data/lib/embulk/data/new/java/test.java.vm +0 -5
- data/lib/embulk/data/new/ruby/.ruby-version +0 -1
- data/lib/embulk/data/new/ruby/Gemfile +0 -2
- data/lib/embulk/data/new/ruby/Rakefile +0 -3
- data/lib/embulk/data/new/ruby/decoder_guess.rb.vm +0 -25
- data/lib/embulk/data/new/ruby/filter.rb.vm +0 -50
- data/lib/embulk/data/new/ruby/formatter.rb.vm +0 -49
- data/lib/embulk/data/new/ruby/gemspec.vm +0 -20
- data/lib/embulk/data/new/ruby/input.rb.vm +0 -59
- data/lib/embulk/data/new/ruby/output.rb.vm +0 -61
- data/lib/embulk/data/new/ruby/parser.rb.vm +0 -44
- data/lib/embulk/data/new/ruby/parser_guess.rb.vm +0 -65
- data/lib/embulk/data/package_data.rb +0 -59
- data/lib/embulk/runner.rb +0 -53
- data/settings.gradle +0 -8
- data/test/helper.rb +0 -23
- data/test/monkey_strptime/mri/date/test_date_strptime.rb +0 -515
- data/test/monkey_strptime/run-test.rb +0 -29
- data/test/vanilla/guess/test_csv_all_strings.rb +0 -43
- data/test/vanilla/guess/test_csv_guess.rb +0 -170
- data/test/vanilla/guess/test_schema_guess.rb +0 -47
- data/test/vanilla/guess/test_time_format_guess.rb +0 -135
- data/test/vanilla/run-test.rb +0 -14
- data/test/vanilla/time/test_timestamp_parser.rb +0 -117
@@ -1,1020 +0,0 @@
|
|
1
|
-
package org.embulk.standards;
|
2
|
-
|
3
|
-
import com.google.common.collect.ImmutableList;
|
4
|
-
import com.google.common.collect.ImmutableMap;
|
5
|
-
import com.google.common.collect.Iterables;
|
6
|
-
import org.embulk.EmbulkTestRuntime;
|
7
|
-
import org.embulk.config.ConfigException;
|
8
|
-
import org.embulk.config.ConfigSource;
|
9
|
-
import org.embulk.config.TaskSource;
|
10
|
-
import org.embulk.config.TaskValidationException;
|
11
|
-
import org.embulk.spi.Column;
|
12
|
-
import org.embulk.spi.FilterPlugin;
|
13
|
-
import org.embulk.spi.Exec;
|
14
|
-
import org.embulk.spi.Schema;
|
15
|
-
import org.embulk.spi.SchemaConfigException;
|
16
|
-
import org.embulk.standards.RenameFilterPlugin.PluginTask;
|
17
|
-
|
18
|
-
import org.junit.Before;
|
19
|
-
import org.junit.Rule;
|
20
|
-
import org.junit.Test;
|
21
|
-
import org.junit.rules.ExpectedException;
|
22
|
-
|
23
|
-
import java.util.ArrayList;
|
24
|
-
import java.util.Arrays;
|
25
|
-
import java.util.HashMap;
|
26
|
-
import java.util.regex.PatternSyntaxException;
|
27
|
-
|
28
|
-
import static org.embulk.spi.type.Types.STRING;
|
29
|
-
import static org.embulk.spi.type.Types.TIMESTAMP;
|
30
|
-
import static org.junit.Assert.assertEquals;
|
31
|
-
import static org.junit.Assert.assertTrue;
|
32
|
-
import static org.junit.Assert.fail;
|
33
|
-
|
34
|
-
/**
|
35
|
-
* Testing |RenameFilterPlugin|.
|
36
|
-
*
|
37
|
-
* NOTE: DO NOT CHANGE THE EXISTING TESTS.
|
38
|
-
*
|
39
|
-
* As written in the comment of |RenameFilterPlugin|, the existing behaviors
|
40
|
-
* should not change so that users are not confused.
|
41
|
-
*/
|
42
|
-
public class TestRenameFilterPlugin
|
43
|
-
{
|
44
|
-
@Rule
|
45
|
-
public EmbulkTestRuntime runtime = new EmbulkTestRuntime();
|
46
|
-
|
47
|
-
@Rule
|
48
|
-
public ExpectedException exception = ExpectedException.none();
|
49
|
-
|
50
|
-
private final Schema SCHEMA = Schema.builder()
|
51
|
-
.add("_c0", STRING)
|
52
|
-
.add("_c1", TIMESTAMP)
|
53
|
-
.build();
|
54
|
-
|
55
|
-
private final String DEFAULT = "__use_default__";
|
56
|
-
|
57
|
-
private RenameFilterPlugin filter;
|
58
|
-
|
59
|
-
@Before
|
60
|
-
public void createFilter()
|
61
|
-
{
|
62
|
-
filter = new RenameFilterPlugin();
|
63
|
-
}
|
64
|
-
|
65
|
-
@Test
|
66
|
-
public void checkDefaultValues()
|
67
|
-
{
|
68
|
-
PluginTask task = Exec.newConfigSource().loadConfig(PluginTask.class);
|
69
|
-
assertTrue(task.getRenameMap().isEmpty());
|
70
|
-
}
|
71
|
-
|
72
|
-
@Test
|
73
|
-
public void throwSchemaConfigExceptionIfColumnNotFound()
|
74
|
-
{
|
75
|
-
ConfigSource pluginConfig = Exec.newConfigSource()
|
76
|
-
.set("columns", ImmutableMap.of("not_found", "any_name"));
|
77
|
-
|
78
|
-
try {
|
79
|
-
filter.transaction(pluginConfig, SCHEMA, new FilterPlugin.Control() {
|
80
|
-
public void run(TaskSource task, Schema schema) { }
|
81
|
-
});
|
82
|
-
fail();
|
83
|
-
} catch (Throwable t) {
|
84
|
-
assertTrue(t instanceof SchemaConfigException);
|
85
|
-
}
|
86
|
-
}
|
87
|
-
|
88
|
-
@Test
|
89
|
-
public void checkRenaming()
|
90
|
-
{
|
91
|
-
ConfigSource pluginConfig = Exec.newConfigSource()
|
92
|
-
.set("columns", ImmutableMap.of("_c0", "_c0_new"));
|
93
|
-
|
94
|
-
filter.transaction(pluginConfig, SCHEMA, new FilterPlugin.Control() {
|
95
|
-
@Override
|
96
|
-
public void run(TaskSource task, Schema newSchema)
|
97
|
-
{
|
98
|
-
// _c0 -> _c0_new
|
99
|
-
Column old0 = SCHEMA.getColumn(0);
|
100
|
-
Column new0 = newSchema.getColumn(0);
|
101
|
-
assertEquals("_c0_new", new0.getName());
|
102
|
-
assertEquals(old0.getType(), new0.getType());
|
103
|
-
|
104
|
-
// _c1 is not changed
|
105
|
-
Column old1 = SCHEMA.getColumn(1);
|
106
|
-
Column new1 = newSchema.getColumn(1);
|
107
|
-
assertEquals("_c1", new1.getName());
|
108
|
-
assertEquals(old1.getType(), new1.getType());
|
109
|
-
}
|
110
|
-
});
|
111
|
-
}
|
112
|
-
|
113
|
-
@Test
|
114
|
-
public void checkConfigExceptionIfUnknownStringTypeOfRenamingOperator()
|
115
|
-
{
|
116
|
-
// A simple string shouldn't come as a renaming rule.
|
117
|
-
ConfigSource pluginConfig = Exec.newConfigSource()
|
118
|
-
.set("rules", ImmutableList.of("string_rule"));
|
119
|
-
|
120
|
-
try {
|
121
|
-
filter.transaction(pluginConfig, SCHEMA, new FilterPlugin.Control() {
|
122
|
-
public void run(TaskSource task, Schema schema) { }
|
123
|
-
});
|
124
|
-
fail();
|
125
|
-
} catch (Throwable t) {
|
126
|
-
assertTrue(t instanceof ConfigException);
|
127
|
-
}
|
128
|
-
}
|
129
|
-
|
130
|
-
@Test
|
131
|
-
public void checkConfigExceptionIfUnknownListTypeOfRenamingOperator()
|
132
|
-
{
|
133
|
-
// A list [] shouldn't come as a renaming rule.
|
134
|
-
ConfigSource pluginConfig = Exec.newConfigSource()
|
135
|
-
.set("rules", ImmutableList.of(ImmutableList.of("listed_operator1", "listed_operator2")));
|
136
|
-
|
137
|
-
try {
|
138
|
-
filter.transaction(pluginConfig, SCHEMA, new FilterPlugin.Control() {
|
139
|
-
public void run(TaskSource task, Schema schema) { }
|
140
|
-
});
|
141
|
-
fail();
|
142
|
-
} catch (Throwable t) {
|
143
|
-
assertTrue(t instanceof ConfigException);
|
144
|
-
}
|
145
|
-
}
|
146
|
-
|
147
|
-
@Test
|
148
|
-
public void checkConfigExceptionIfUnknownRenamingOperatorName()
|
149
|
-
{
|
150
|
-
ConfigSource pluginConfig = Exec.newConfigSource()
|
151
|
-
.set("rules", ImmutableList.of(ImmutableMap.of("rule", "some_unknown_renaming_operator")));
|
152
|
-
|
153
|
-
try {
|
154
|
-
filter.transaction(pluginConfig, SCHEMA, new FilterPlugin.Control() {
|
155
|
-
public void run(TaskSource task, Schema schema) { }
|
156
|
-
});
|
157
|
-
fail();
|
158
|
-
} catch (Throwable t) {
|
159
|
-
assertTrue(t instanceof ConfigException);
|
160
|
-
}
|
161
|
-
}
|
162
|
-
|
163
|
-
@Test
|
164
|
-
public void checkRuleLowerToUpperRule()
|
165
|
-
{
|
166
|
-
final String original[] = { "_C0", "_C1", "_c2" };
|
167
|
-
final String expected[] = { "_C0", "_C1", "_C2" };
|
168
|
-
ConfigSource config = Exec.newConfigSource().set("rules",
|
169
|
-
ImmutableList.of(ImmutableMap.of("rule", "lower_to_upper")));
|
170
|
-
renameAndCheckSchema(config, original, expected);
|
171
|
-
}
|
172
|
-
|
173
|
-
@Test
|
174
|
-
public void checkTruncateRule()
|
175
|
-
{
|
176
|
-
final String original[] = { "foo", "bar", "gj", "foobar", "foobarbaz" };
|
177
|
-
final String expected[] = { "foo", "bar", "gj", "foo", "foo" };
|
178
|
-
ConfigSource config = Exec.newConfigSource().set("rules",
|
179
|
-
ImmutableList.of(ImmutableMap.of("rule", "truncate", "max_length", "3")));
|
180
|
-
renameAndCheckSchema(config, original, expected);
|
181
|
-
}
|
182
|
-
|
183
|
-
@Test
|
184
|
-
public void checkTruncateRuleDefault()
|
185
|
-
{
|
186
|
-
final String original[] = {
|
187
|
-
"123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" };
|
188
|
-
final String expected[] = {
|
189
|
-
"12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678" };
|
190
|
-
ConfigSource config = Exec.newConfigSource().set("rules",
|
191
|
-
ImmutableList.of(ImmutableMap.of("rule", "truncate")));
|
192
|
-
renameAndCheckSchema(config, original, expected);
|
193
|
-
}
|
194
|
-
|
195
|
-
@Test
|
196
|
-
public void checkTruncateRuleNegative()
|
197
|
-
{
|
198
|
-
final String original[] = { "foo" };
|
199
|
-
ConfigSource config = Exec.newConfigSource().set("rules",
|
200
|
-
ImmutableList.of(ImmutableMap.of("rule", "truncate", "max_length", -1)));
|
201
|
-
exception.expect(TaskValidationException.class);
|
202
|
-
// TODO(dmikurube): Except "Caused by": exception.expectCause(instanceOf(JsonMappingException.class));
|
203
|
-
// Needs to import org.hamcrest.Matchers... in addition to org.junit...
|
204
|
-
renameAndCheckSchema(config, original, original);
|
205
|
-
}
|
206
|
-
|
207
|
-
@Test
|
208
|
-
public void checkRuleUpperToLowerRule()
|
209
|
-
{
|
210
|
-
final String original[] = { "_C0", "_C1", "_c2" };
|
211
|
-
final String expected[] = { "_c0", "_c1", "_c2" };
|
212
|
-
ConfigSource config = Exec.newConfigSource().set("rules",
|
213
|
-
ImmutableList.of(ImmutableMap.of("rule", "upper_to_lower")));
|
214
|
-
renameAndCheckSchema(config, original, expected);
|
215
|
-
}
|
216
|
-
|
217
|
-
@Test
|
218
|
-
public void checkCharacterTypesRulePassAlphabet()
|
219
|
-
{
|
220
|
-
final String original[] = { "Internal$Foo0123--Bar" };
|
221
|
-
final String expected[] = { "Internal_Foo______Bar" };
|
222
|
-
final String pass_types[] = { "a-z", "A-Z" };
|
223
|
-
checkCharacterTypesRuleInternal(original, expected, pass_types, "");
|
224
|
-
}
|
225
|
-
|
226
|
-
@Test
|
227
|
-
public void checkCharacterTypesRulePassAlphanumeric()
|
228
|
-
{
|
229
|
-
final String original[] = { "Internal$Foo0123--Bar" };
|
230
|
-
final String expected[] = { "Internal_Foo0123__Bar" };
|
231
|
-
final String pass_types[] = { "a-z", "A-Z", "0-9" };
|
232
|
-
checkCharacterTypesRuleInternal(original, expected, pass_types, "");
|
233
|
-
}
|
234
|
-
|
235
|
-
@Test
|
236
|
-
public void checkCharacterTypesRulePassLowercase()
|
237
|
-
{
|
238
|
-
final String original[] = { "Internal$Foo0123--Bar" };
|
239
|
-
final String expected[] = { "_nternal__oo_______ar" };
|
240
|
-
final String pass_types[] = { "a-z" };
|
241
|
-
checkCharacterTypesRuleInternal(original, expected, pass_types, "");
|
242
|
-
}
|
243
|
-
|
244
|
-
@Test
|
245
|
-
public void checkCharacterTypesRulePassLowerwording()
|
246
|
-
{
|
247
|
-
final String original[] = { "Internal$Foo_0123--Bar" };
|
248
|
-
final String expected[] = { "-nternal--oo_0123---ar" };
|
249
|
-
final String pass_types[] = { "a-z", "0-9" };
|
250
|
-
checkCharacterTypesRuleInternal(original, expected, pass_types, "_", "-");
|
251
|
-
}
|
252
|
-
|
253
|
-
@Test
|
254
|
-
public void checkCharacterTypesRulePassNumeric()
|
255
|
-
{
|
256
|
-
final String original[] = { "Internal$Foo_0123--Bar" };
|
257
|
-
final String expected[] = { "_____________0123_____" };
|
258
|
-
final String pass_types[] = { "0-9" };
|
259
|
-
checkCharacterTypesRuleInternal(original, expected, pass_types, "");
|
260
|
-
}
|
261
|
-
|
262
|
-
@Test
|
263
|
-
public void checkCharacterTypesRulePassUppercase()
|
264
|
-
{
|
265
|
-
final String original[] = { "Internal$Foo_0123--Bar" };
|
266
|
-
final String expected[] = { "I________F_________B__" };
|
267
|
-
final String pass_types[] = { "A-Z" };
|
268
|
-
checkCharacterTypesRuleInternal(original, expected, pass_types, "");
|
269
|
-
}
|
270
|
-
|
271
|
-
@Test
|
272
|
-
public void checkCharacterTypesRulePassUpperwording()
|
273
|
-
{
|
274
|
-
final String original[] = { "Internal$Foo_0123--Bar" };
|
275
|
-
final String expected[] = { "I--------F--_0123--B--" };
|
276
|
-
final String pass_types[] = { "A-Z", "0-9" };
|
277
|
-
checkCharacterTypesRuleInternal(original, expected, pass_types, "_", "-");
|
278
|
-
}
|
279
|
-
|
280
|
-
@Test
|
281
|
-
public void checkCharacterTypesRulePassWording()
|
282
|
-
{
|
283
|
-
final String original[] = { "Internal$Foo_0123--Bar" };
|
284
|
-
final String expected[] = { "Internal-Foo_0123--Bar" };
|
285
|
-
final String pass_types[] = { "a-z", "A-Z", "0-9" };
|
286
|
-
checkCharacterTypesRuleInternal(original, expected, pass_types, "_", "-");
|
287
|
-
}
|
288
|
-
|
289
|
-
@Test
|
290
|
-
public void checkCharacterTypesRulePassCombination()
|
291
|
-
{
|
292
|
-
final String original[] = { "@Foobar0123_$" };
|
293
|
-
final String expected[] = { "__oobar0123__" };
|
294
|
-
final String pass_types[] = { "0-9", "a-z" };
|
295
|
-
checkCharacterTypesRuleInternal(original, expected, pass_types, "");
|
296
|
-
}
|
297
|
-
|
298
|
-
@Test
|
299
|
-
public void checkCharacterTypesRuleLongReplace()
|
300
|
-
{
|
301
|
-
final String original[] = { "fooBAR" };
|
302
|
-
final String pass_types[] = { "a-z" };
|
303
|
-
exception.expect(TaskValidationException.class);
|
304
|
-
// TODO(dmikurube): Except "Caused by": exception.expectCause(instanceOf(JsonMappingException.class));
|
305
|
-
// Needs to import org.hamcrest.Matchers... in addition to org.junit...
|
306
|
-
checkCharacterTypesRuleInternal(original, original, pass_types, "", "___");
|
307
|
-
}
|
308
|
-
|
309
|
-
@Test
|
310
|
-
public void checkCharacterTypesRuleEmptyReplace()
|
311
|
-
{
|
312
|
-
final String original[] = { "fooBAR" };
|
313
|
-
final String pass_types[] = { "a-z" };
|
314
|
-
exception.expect(TaskValidationException.class);
|
315
|
-
// TODO(dmikurube): Except "Caused by": exception.expectCause(instanceOf(JsonMappingException.class));
|
316
|
-
// Needs to import org.hamcrest.Matchers... in addition to org.junit...
|
317
|
-
checkCharacterTypesRuleInternal(original, original, pass_types, "", "");
|
318
|
-
}
|
319
|
-
|
320
|
-
// TODO(dmikurube): Test a nil/null replace.
|
321
|
-
// - rule: character_types
|
322
|
-
// delimiter:
|
323
|
-
|
324
|
-
@Test
|
325
|
-
public void checkCharacterTypesRuleUnknownType()
|
326
|
-
{
|
327
|
-
final String original[] = { "fooBAR" };
|
328
|
-
final String pass_types[] = { "some_unknown_keyword" };
|
329
|
-
exception.expect(ConfigException.class);
|
330
|
-
// TODO(dmikurube): Except "Caused by": exception.expectCause(instanceOf(JsonMappingException.class));
|
331
|
-
// Needs to import org.hamcrest.Matchers... in addition to org.junit...
|
332
|
-
checkCharacterTypesRuleInternal(original, original, pass_types, "");
|
333
|
-
}
|
334
|
-
|
335
|
-
@Test
|
336
|
-
public void checkCharacterTypesRuleForbiddenCharSequence()
|
337
|
-
{
|
338
|
-
final String original[] = { "fooBAR" };
|
339
|
-
final String pass_types[] = {};
|
340
|
-
exception.expect(ConfigException.class);
|
341
|
-
// TODO(dmikurube): Except "Caused by": exception.expectCause(instanceOf(JsonMappingException.class));
|
342
|
-
// Needs to import org.hamcrest.Matchers... in addition to org.junit...
|
343
|
-
checkCharacterTypesRuleInternal(original, original, pass_types, "\\E");
|
344
|
-
}
|
345
|
-
|
346
|
-
private void checkCharacterTypesRuleInternal(
|
347
|
-
final String original[],
|
348
|
-
final String expected[],
|
349
|
-
final String pass_types[],
|
350
|
-
final String pass_characters)
|
351
|
-
{
|
352
|
-
checkCharacterTypesRuleInternal(original, expected, pass_types, pass_characters, DEFAULT);
|
353
|
-
}
|
354
|
-
|
355
|
-
private void checkCharacterTypesRuleInternal(
|
356
|
-
final String original[],
|
357
|
-
final String expected[],
|
358
|
-
final String pass_types[],
|
359
|
-
final String pass_characters,
|
360
|
-
final String replace)
|
361
|
-
{
|
362
|
-
HashMap<String, Object> parameters = new HashMap<>();
|
363
|
-
parameters.put("rule", "character_types");
|
364
|
-
if (pass_types != null) {
|
365
|
-
parameters.put("pass_types", ImmutableList.copyOf(pass_types));
|
366
|
-
}
|
367
|
-
if (!pass_characters.equals(DEFAULT)) {
|
368
|
-
parameters.put("pass_characters", pass_characters);
|
369
|
-
}
|
370
|
-
if (!replace.equals(DEFAULT)) {
|
371
|
-
parameters.put("replace", replace);
|
372
|
-
}
|
373
|
-
ConfigSource config = Exec.newConfigSource().set("rules",
|
374
|
-
ImmutableList.of(ImmutableMap.copyOf(parameters)));
|
375
|
-
renameAndCheckSchema(config, original, expected);
|
376
|
-
}
|
377
|
-
|
378
|
-
@Test
|
379
|
-
public void checkRegexReplaceRule1()
|
380
|
-
{
|
381
|
-
final String original[] = { "foobarbaz" };
|
382
|
-
final String expected[] = { "hogebarbaz" };
|
383
|
-
checkRegexReplaceRuleInternal(original, expected, "foo", "hoge");
|
384
|
-
}
|
385
|
-
|
386
|
-
@Test
|
387
|
-
public void checkRegexReplaceRule2()
|
388
|
-
{
|
389
|
-
final String original[] = { "200_dollars" };
|
390
|
-
final String expected[] = { "USD200" };
|
391
|
-
checkRegexReplaceRuleInternal(original, expected, "([0-9]+)_dollars", "USD$1");
|
392
|
-
}
|
393
|
-
|
394
|
-
private void checkRegexReplaceRuleInternal(
|
395
|
-
final String original[],
|
396
|
-
final String expected[],
|
397
|
-
final String match,
|
398
|
-
final String replace)
|
399
|
-
{
|
400
|
-
HashMap<String, Object> parameters = new HashMap<>();
|
401
|
-
parameters.put("rule", "regex_replace");
|
402
|
-
parameters.put("match", match);
|
403
|
-
parameters.put("replace", replace);
|
404
|
-
ConfigSource config = Exec.newConfigSource().set("rules",
|
405
|
-
ImmutableList.of(ImmutableMap.copyOf(parameters)));
|
406
|
-
renameAndCheckSchema(config, original, expected);
|
407
|
-
}
|
408
|
-
|
409
|
-
@Test
|
410
|
-
public void checkFirstCharacterTypesRuleReplaceSingleHyphen()
|
411
|
-
{
|
412
|
-
final String original[] = { "foo", "012foo", "@bar", "BAZ", "&ban", "_jar", "*zip", "-zap" };
|
413
|
-
final String expected[] = { "_oo", "_12foo", "_bar", "_AZ", "_ban", "_jar", "_zip", "-zap" };
|
414
|
-
final String pass_types[] = {};
|
415
|
-
checkFirstCharacterTypesRuleReplaceInternal(original, expected, "_", pass_types, "-");
|
416
|
-
}
|
417
|
-
|
418
|
-
@Test
|
419
|
-
public void checkFirstCharacterTypesRuleReplaceMultipleSingles()
|
420
|
-
{
|
421
|
-
final String original[] = { "foo", "012foo", "@bar", "BAZ", "&ban", "_jar", "*zip", "-zap" };
|
422
|
-
final String expected[] = { "_oo", "_12foo", "@bar", "_AZ", "_ban", "_jar", "*zip", "-zap" };
|
423
|
-
final String pass_types[] = {};
|
424
|
-
checkFirstCharacterTypesRuleReplaceInternal(original, expected, "_", pass_types, "-@*");
|
425
|
-
}
|
426
|
-
|
427
|
-
@Test
|
428
|
-
public void checkFirstCharacterTypesRuleReplaceAlphabet()
|
429
|
-
{
|
430
|
-
final String original[] = { "foo", "012foo", "@bar", "BAZ", "&ban", "_jar", "*zip", "-zap" };
|
431
|
-
final String expected[] = { "foo", "_12foo", "_bar", "BAZ", "_ban", "_jar", "_zip", "_zap" };
|
432
|
-
final String pass_types[] = { "a-z", "A-Z" };
|
433
|
-
checkFirstCharacterTypesRuleReplaceInternal(original, expected, "_", pass_types);
|
434
|
-
}
|
435
|
-
|
436
|
-
@Test
|
437
|
-
public void checkFirstCharacterTypesRuleReplaceAlphanumeric()
|
438
|
-
{
|
439
|
-
final String original[] = { "foo", "012foo", "@bar", "BAZ", "&ban", "_jar", "*zip", "-zap" };
|
440
|
-
final String expected[] = { "foo", "012foo", "_bar", "BAZ", "_ban", "_jar", "_zip", "_zap" };
|
441
|
-
final String pass_types[] = { "a-z", "A-Z", "0-9" };
|
442
|
-
checkFirstCharacterTypesRuleReplaceInternal(original, expected, "_", pass_types);
|
443
|
-
}
|
444
|
-
|
445
|
-
@Test
|
446
|
-
public void checkFirstCharacterTypesRuleReplaceLowercase()
|
447
|
-
{
|
448
|
-
final String original[] = { "foo", "012foo", "@bar", "BAZ", "&ban", "_jar", "*zip", "-zap" };
|
449
|
-
final String expected[] = { "foo", "_12foo", "_bar", "_AZ", "_ban", "_jar", "_zip", "_zap" };
|
450
|
-
final String pass_types[] = { "a-z" };
|
451
|
-
checkFirstCharacterTypesRuleReplaceInternal(original, expected, "_", pass_types);
|
452
|
-
}
|
453
|
-
|
454
|
-
@Test
|
455
|
-
public void checkFirstCharacterTypesRuleReplaceLowerwording()
|
456
|
-
{
|
457
|
-
final String original[] = { "foo", "012foo", "@bar", "BAZ", "&ban", "_jar", "*zip", "-zap" };
|
458
|
-
final String expected[] = { "foo", "012foo", "-bar", "-AZ", "-ban", "_jar", "-zip", "-zap" };
|
459
|
-
final String pass_types[] = { "a-z", "0-9" };
|
460
|
-
checkFirstCharacterTypesRuleReplaceInternal(original, expected, "-", pass_types, "_");
|
461
|
-
}
|
462
|
-
|
463
|
-
@Test
|
464
|
-
public void checkFirstCharacterTypesRuleReplaceNumeric()
|
465
|
-
{
|
466
|
-
final String original[] = { "foo", "012foo", "@bar", "BAZ", "&ban", "_jar", "*zip", "-zap" };
|
467
|
-
final String expected[] = { "_oo", "012foo", "_bar", "_AZ", "_ban", "_jar", "_zip", "_zap" };
|
468
|
-
final String pass_types[] = { "0-9" };
|
469
|
-
checkFirstCharacterTypesRuleReplaceInternal(original, expected, "_", pass_types);
|
470
|
-
}
|
471
|
-
|
472
|
-
@Test
|
473
|
-
public void checkFirstCharacterTypesRuleReplaceUppercase()
|
474
|
-
{
|
475
|
-
final String original[] = { "foo", "012foo", "@bar", "BAZ", "&ban", "_jar", "*zip", "-zap" };
|
476
|
-
final String expected[] = { "_oo", "_12foo", "_bar", "BAZ", "_ban", "_jar", "_zip", "_zap" };
|
477
|
-
final String pass_types[] = { "A-Z" };
|
478
|
-
checkFirstCharacterTypesRuleReplaceInternal(original, expected, "_", pass_types);
|
479
|
-
}
|
480
|
-
|
481
|
-
@Test
|
482
|
-
public void checkFirstCharacterTypesRuleReplaceUpperwording()
|
483
|
-
{
|
484
|
-
final String original[] = { "foo", "012foo", "@bar", "BAZ", "&ban", "_jar", "*zip", "-zap" };
|
485
|
-
final String expected[] = { "-oo", "012foo", "-bar", "BAZ", "-ban", "_jar", "-zip", "-zap" };
|
486
|
-
final String pass_types[] = { "A-Z", "0-9" };
|
487
|
-
checkFirstCharacterTypesRuleReplaceInternal(original, expected, "-", pass_types, "_");
|
488
|
-
}
|
489
|
-
|
490
|
-
@Test
|
491
|
-
public void checkFirstCharacterTypesRuleReplaceWording()
|
492
|
-
{
|
493
|
-
final String original[] = { "foo", "012foo", "@bar", "BAZ", "&ban", "_jar", "*zip", "-zap" };
|
494
|
-
final String expected[] = { "foo", "012foo", "$bar", "BAZ", "$ban", "_jar", "$zip", "$zap" };
|
495
|
-
final String pass_types[] = { "a-z", "A-Z", "0-9" };
|
496
|
-
checkFirstCharacterTypesRuleReplaceInternal(original, expected, "$", pass_types, "_");
|
497
|
-
}
|
498
|
-
|
499
|
-
@Test
|
500
|
-
public void checkFirstCharacterTypesRuleReplaceUnknownFirst()
|
501
|
-
{
|
502
|
-
final String original[] = { "foo" };
|
503
|
-
final String pass_types[] = { "some_unknown_type" };
|
504
|
-
exception.expect(ConfigException.class);
|
505
|
-
// TODO(dmikurube): Except "Caused by": exception.expectCause(instanceOf(JsonMappingException.class));
|
506
|
-
// Needs to import org.hamcrest.Matchers... in addition to org.junit...
|
507
|
-
checkFirstCharacterTypesRuleReplaceInternal(original, original, "_", pass_types);
|
508
|
-
}
|
509
|
-
|
510
|
-
@Test
|
511
|
-
public void checkFirstCharacterTypesRuleReplaceForbiddenCharSequence()
|
512
|
-
{
|
513
|
-
final String original[] = { "foo" };
|
514
|
-
final String pass_types[] = {};
|
515
|
-
exception.expect(ConfigException.class);
|
516
|
-
// TODO(dmikurube): Except "Caused by": exception.expectCause(instanceOf(JsonMappingException.class));
|
517
|
-
// Needs to import org.hamcrest.Matchers... in addition to org.junit...
|
518
|
-
checkFirstCharacterTypesRuleReplaceInternal(original, original, "_", pass_types, "\\E");
|
519
|
-
}
|
520
|
-
|
521
|
-
@Test
|
522
|
-
public void checkFirstCharacterTypesRulePrefixSingleHyphen()
|
523
|
-
{
|
524
|
-
final String original[] = { "foo", "012foo", "@bar", "BAZ", "&ban", "_jar", "*zip", "-zap" };
|
525
|
-
final String expected[] = { "_foo", "_012foo", "_@bar", "_BAZ", "_&ban", "__jar", "_*zip", "-zap" };
|
526
|
-
final String pass_types[] = {};
|
527
|
-
checkFirstCharacterTypesRulePrefixInternal(original, expected, "_", pass_types, "-");
|
528
|
-
}
|
529
|
-
|
530
|
-
@Test
|
531
|
-
public void checkFirstCharacterTypesRulePrefixMultipleSingles()
|
532
|
-
{
|
533
|
-
final String original[] = { "foo", "012foo", "@bar", "BAZ", "&ban", "_jar", "*zip", "-zap" };
|
534
|
-
final String expected[] = { "_foo", "_012foo", "@bar", "_BAZ", "_&ban", "__jar", "*zip", "-zap" };
|
535
|
-
final String pass_types[] = {};
|
536
|
-
checkFirstCharacterTypesRulePrefixInternal(original, expected, "_", pass_types, "-@*");
|
537
|
-
}
|
538
|
-
|
539
|
-
@Test
|
540
|
-
public void checkFirstCharacterTypesRulePrefixAlphabet()
|
541
|
-
{
|
542
|
-
final String original[] = { "foo", "012foo", "@bar", "BAZ", "&ban", "_jar", "*zip", "-zap" };
|
543
|
-
final String expected[] = { "foo", "_012foo", "_@bar", "BAZ", "_&ban", "__jar", "_*zip", "_-zap" };
|
544
|
-
final String pass_types[] = { "a-z", "A-Z" };
|
545
|
-
checkFirstCharacterTypesRulePrefixInternal(original, expected, "_", pass_types);
|
546
|
-
}
|
547
|
-
|
548
|
-
@Test
|
549
|
-
public void checkFirstCharacterTypesRulePrefixAlphanumeric()
|
550
|
-
{
|
551
|
-
final String original[] = { "foo", "012foo", "@bar", "BAZ", "&ban", "_jar", "*zip", "-zap" };
|
552
|
-
final String expected[] = { "foo", "012foo", "_@bar", "BAZ", "_&ban", "__jar", "_*zip", "_-zap" };
|
553
|
-
final String pass_types[] = { "a-z", "A-Z", "0-9" };
|
554
|
-
checkFirstCharacterTypesRulePrefixInternal(original, expected, "_", pass_types);
|
555
|
-
}
|
556
|
-
|
557
|
-
@Test
|
558
|
-
public void checkFirstCharacterTypesRulePrefixLowercase()
|
559
|
-
{
|
560
|
-
final String original[] = { "foo", "012foo", "@bar", "BAZ", "&ban", "_jar", "*zip", "-zap" };
|
561
|
-
final String expected[] = { "foo", "_012foo", "_@bar", "_BAZ", "_&ban", "__jar", "_*zip", "_-zap" };
|
562
|
-
final String pass_types[] = { "a-z" };
|
563
|
-
checkFirstCharacterTypesRulePrefixInternal(original, expected, "_", pass_types);
|
564
|
-
}
|
565
|
-
|
566
|
-
@Test
|
567
|
-
public void checkFirstCharacterTypesRulePrefixLowerwording()
|
568
|
-
{
|
569
|
-
final String original[] = { "foo", "012foo", "@bar", "BAZ", "&ban", "_jar", "*zip", "-zap" };
|
570
|
-
final String expected[] = { "foo", "012foo", "-@bar", "-BAZ", "-&ban", "_jar", "-*zip", "--zap" };
|
571
|
-
final String pass_types[] = { "a-z", "0-9" };
|
572
|
-
checkFirstCharacterTypesRulePrefixInternal(original, expected, "-", pass_types, "_");
|
573
|
-
}
|
574
|
-
|
575
|
-
@Test
|
576
|
-
public void checkFirstCharacterTypesRulePrefixNumeric()
|
577
|
-
{
|
578
|
-
final String original[] = { "foo", "012foo", "@bar", "BAZ", "&ban", "_jar", "*zip", "-zap" };
|
579
|
-
final String expected[] = { "_foo", "012foo", "_@bar", "_BAZ", "_&ban", "__jar", "_*zip", "_-zap" };
|
580
|
-
final String pass_types[] = { "0-9" };
|
581
|
-
checkFirstCharacterTypesRulePrefixInternal(original, expected, "_", pass_types);
|
582
|
-
}
|
583
|
-
|
584
|
-
@Test
|
585
|
-
public void checkFirstCharacterTypesRulePrefixUppercase()
|
586
|
-
{
|
587
|
-
final String original[] = { "foo", "012foo", "@bar", "BAZ", "&ban", "_jar", "*zip", "-zap" };
|
588
|
-
final String expected[] = { "_foo", "_012foo", "_@bar", "BAZ", "_&ban", "__jar", "_*zip", "_-zap" };
|
589
|
-
final String pass_types[] = { "A-Z" };
|
590
|
-
checkFirstCharacterTypesRulePrefixInternal(original, expected, "_", pass_types);
|
591
|
-
}
|
592
|
-
|
593
|
-
@Test
|
594
|
-
public void checkFirstCharacterTypesRulePrefixUpperwording()
|
595
|
-
{
|
596
|
-
final String original[] = { "foo", "012foo", "@bar", "BAZ", "&ban", "_jar", "*zip", "-zap" };
|
597
|
-
final String expected[] = { "-foo", "012foo", "-@bar", "BAZ", "-&ban", "_jar", "-*zip", "--zap" };
|
598
|
-
final String pass_types[] = { "A-Z", "0-9" };
|
599
|
-
checkFirstCharacterTypesRulePrefixInternal(original, expected, "-", pass_types, "_");
|
600
|
-
}
|
601
|
-
|
602
|
-
@Test
|
603
|
-
public void checkFirstCharacterTypesRulePrefixWording()
|
604
|
-
{
|
605
|
-
final String original[] = { "foo", "012foo", "@bar", "BAZ", "&ban", "_jar", "*zip", "-zap" };
|
606
|
-
final String expected[] = { "foo", "012foo", "$@bar", "BAZ", "$&ban", "_jar", "$*zip", "$-zap" };
|
607
|
-
final String pass_types[] = { "a-z", "A-Z", "0-9" };
|
608
|
-
checkFirstCharacterTypesRulePrefixInternal(original, expected, "$", pass_types, "_");
|
609
|
-
}
|
610
|
-
|
611
|
-
@Test
|
612
|
-
public void checkFirstCharacterTypesRuleEmptyPrefix()
|
613
|
-
{
|
614
|
-
final String original[] = { "foo" };
|
615
|
-
final String pass_types[] = {};
|
616
|
-
exception.expect(ConfigException.class);
|
617
|
-
// TODO(dmikurube): Except "Caused by": exception.expectCause(instanceOf(JsonMappingException.class));
|
618
|
-
// Needs to import org.hamcrest.Matchers... in addition to org.junit...
|
619
|
-
checkFirstCharacterTypesRulePrefixInternal(original, original, "", pass_types);
|
620
|
-
}
|
621
|
-
|
622
|
-
@Test
|
623
|
-
public void checkFirstCharacterTypesRuleLongPrefix()
|
624
|
-
{
|
625
|
-
final String original[] = { "foo" };
|
626
|
-
final String pass_types[] = {};
|
627
|
-
exception.expect(ConfigException.class);
|
628
|
-
// TODO(dmikurube): Except "Caused by": exception.expectCause(instanceOf(JsonMappingException.class));
|
629
|
-
// Needs to import org.hamcrest.Matchers... in addition to org.junit...
|
630
|
-
checkFirstCharacterTypesRulePrefixInternal(original, original, "__", pass_types);
|
631
|
-
}
|
632
|
-
|
633
|
-
@Test
|
634
|
-
public void checkFirstCharacterTypesRuleEmptyReplace()
|
635
|
-
{
|
636
|
-
final String original[] = { "foo" };
|
637
|
-
final String pass_types[] = {};
|
638
|
-
exception.expect(ConfigException.class);
|
639
|
-
// TODO(dmikurube): Except "Caused by": exception.expectCause(instanceOf(JsonMappingException.class));
|
640
|
-
// Needs to import org.hamcrest.Matchers... in addition to org.junit...
|
641
|
-
checkFirstCharacterTypesRuleReplaceInternal(original, original, "", pass_types);
|
642
|
-
}
|
643
|
-
|
644
|
-
@Test
|
645
|
-
public void checkFirstCharacterTypesRuleLongReplace()
|
646
|
-
{
|
647
|
-
final String original[] = { "foo" };
|
648
|
-
final String pass_types[] = {};
|
649
|
-
exception.expect(ConfigException.class);
|
650
|
-
// TODO(dmikurube): Except "Caused by": exception.expectCause(instanceOf(JsonMappingException.class));
|
651
|
-
// Needs to import org.hamcrest.Matchers... in addition to org.junit...
|
652
|
-
checkFirstCharacterTypesRuleReplaceInternal(original, original, "__", pass_types);
|
653
|
-
}
|
654
|
-
|
655
|
-
@Test
|
656
|
-
public void checkFirstCharacterTypesRulePrefixUnknownFirst()
|
657
|
-
{
|
658
|
-
final String original[] = { "foo" };
|
659
|
-
final String pass_types[] = { "some_unknown_type" };
|
660
|
-
exception.expect(ConfigException.class);
|
661
|
-
// TODO(dmikurube): Except "Caused by": exception.expectCause(instanceOf(JsonMappingException.class));
|
662
|
-
// Needs to import org.hamcrest.Matchers... in addition to org.junit...
|
663
|
-
checkFirstCharacterTypesRulePrefixInternal(original, original, "_", pass_types);
|
664
|
-
}
|
665
|
-
|
666
|
-
@Test
|
667
|
-
public void checkFirstCharacterTypesRulePrefixForbiddenCharSequence()
|
668
|
-
{
|
669
|
-
final String original[] = { "foo" };
|
670
|
-
final String pass_types[] = {};
|
671
|
-
exception.expect(ConfigException.class);
|
672
|
-
// TODO(dmikurube): Except "Caused by": exception.expectCause(instanceOf(JsonMappingException.class));
|
673
|
-
// Needs to import org.hamcrest.Matchers... in addition to org.junit...
|
674
|
-
checkFirstCharacterTypesRulePrefixInternal(original, original, "\\E", pass_types);
|
675
|
-
}
|
676
|
-
|
677
|
-
@Test
|
678
|
-
public void checkFirstCharacterTypesRuleBothReplacePrefix()
|
679
|
-
{
|
680
|
-
HashMap<String, Object> parameters = new HashMap<>();
|
681
|
-
parameters.put("rule", "first_character_types");
|
682
|
-
parameters.put("replace", "_");
|
683
|
-
parameters.put("prefix", "_");
|
684
|
-
ConfigSource config = Exec.newConfigSource().set("rules",
|
685
|
-
ImmutableList.of(ImmutableMap.copyOf(parameters)));
|
686
|
-
exception.expect(ConfigException.class);
|
687
|
-
// TODO(dmikurube): Except "Caused by": exception.expectCause(instanceOf(JsonMappingException.class));
|
688
|
-
// Needs to import org.hamcrest.Matchers... in addition to org.junit...
|
689
|
-
renameAndCheckSchema(config, new String[0], new String[0]);
|
690
|
-
}
|
691
|
-
|
692
|
-
@Test
|
693
|
-
public void checkFirstCharacterTypesRuleNeitherReplacePrefix()
|
694
|
-
{
|
695
|
-
HashMap<String, Object> parameters = new HashMap<>();
|
696
|
-
parameters.put("rule", "first_character_types");
|
697
|
-
ConfigSource config = Exec.newConfigSource().set("rules",
|
698
|
-
ImmutableList.of(ImmutableMap.copyOf(parameters)));
|
699
|
-
exception.expect(ConfigException.class);
|
700
|
-
// TODO(dmikurube): Except "Caused by": exception.expectCause(instanceOf(JsonMappingException.class));
|
701
|
-
// Needs to import org.hamcrest.Matchers... in addition to org.junit...
|
702
|
-
renameAndCheckSchema(config, new String[0], new String[0]);
|
703
|
-
}
|
704
|
-
|
705
|
-
private void checkFirstCharacterTypesRuleReplaceInternal(
|
706
|
-
final String original[],
|
707
|
-
final String expected[],
|
708
|
-
final String replace,
|
709
|
-
final String pass_types[]) {
|
710
|
-
checkFirstCharacterTypesRuleReplaceInternal(original, expected, replace, pass_types, DEFAULT);
|
711
|
-
}
|
712
|
-
|
713
|
-
private void checkFirstCharacterTypesRuleReplaceInternal(
|
714
|
-
final String original[],
|
715
|
-
final String expected[],
|
716
|
-
final String replace,
|
717
|
-
final String pass_types[],
|
718
|
-
final String pass_characters)
|
719
|
-
{
|
720
|
-
HashMap<String, Object> parameters = new HashMap<>();
|
721
|
-
parameters.put("rule", "first_character_types");
|
722
|
-
if (pass_types.length > 0) {
|
723
|
-
parameters.put("pass_types", Arrays.asList(pass_types));
|
724
|
-
}
|
725
|
-
if (!pass_characters.equals(DEFAULT)) {
|
726
|
-
parameters.put("pass_characters", pass_characters);
|
727
|
-
}
|
728
|
-
if (!replace.equals(DEFAULT)) {
|
729
|
-
parameters.put("replace", replace);
|
730
|
-
}
|
731
|
-
ConfigSource config = Exec.newConfigSource().set("rules",
|
732
|
-
ImmutableList.of(ImmutableMap.copyOf(parameters)));
|
733
|
-
renameAndCheckSchema(config, original, expected);
|
734
|
-
}
|
735
|
-
|
736
|
-
private void checkFirstCharacterTypesRulePrefixInternal(
|
737
|
-
final String original[],
|
738
|
-
final String expected[],
|
739
|
-
final String prefix,
|
740
|
-
final String pass_types[]) {
|
741
|
-
checkFirstCharacterTypesRulePrefixInternal(original, expected, prefix, pass_types, DEFAULT);
|
742
|
-
}
|
743
|
-
|
744
|
-
private void checkFirstCharacterTypesRulePrefixInternal(
|
745
|
-
final String original[],
|
746
|
-
final String expected[],
|
747
|
-
final String prefix,
|
748
|
-
final String pass_types[],
|
749
|
-
final String pass_characters)
|
750
|
-
{
|
751
|
-
HashMap<String, Object> parameters = new HashMap<>();
|
752
|
-
parameters.put("rule", "first_character_types");
|
753
|
-
if (pass_types.length > 0) {
|
754
|
-
parameters.put("pass_types", Arrays.asList(pass_types));
|
755
|
-
}
|
756
|
-
if (!pass_characters.equals(DEFAULT)) {
|
757
|
-
parameters.put("pass_characters", pass_characters);
|
758
|
-
}
|
759
|
-
if (!prefix.equals(DEFAULT)) {
|
760
|
-
parameters.put("prefix", prefix);
|
761
|
-
}
|
762
|
-
ConfigSource config = Exec.newConfigSource().set("rules",
|
763
|
-
ImmutableList.of(ImmutableMap.copyOf(parameters)));
|
764
|
-
renameAndCheckSchema(config, original, expected);
|
765
|
-
}
|
766
|
-
|
767
|
-
public void checkUniqueNumberSuffixRuleEmptyDelimiter()
|
768
|
-
{
|
769
|
-
final String columnNames[] = { "c" };
|
770
|
-
try {
|
771
|
-
checkUniqueNumberSuffixRuleInternal(columnNames, columnNames, "");
|
772
|
-
} catch (Throwable t) {
|
773
|
-
assertTrue(t instanceof ConfigException);
|
774
|
-
}
|
775
|
-
}
|
776
|
-
|
777
|
-
@Test
|
778
|
-
public void checkUniqueNumberSuffixRuleLongDelimiter()
|
779
|
-
{
|
780
|
-
final String columnNames[] = { "c" };
|
781
|
-
try {
|
782
|
-
checkUniqueNumberSuffixRuleInternal(columnNames, columnNames, "__");
|
783
|
-
} catch (Throwable t) {
|
784
|
-
assertTrue(t instanceof ConfigException);
|
785
|
-
}
|
786
|
-
}
|
787
|
-
|
788
|
-
@Test
|
789
|
-
public void checkUniqueNumberSuffixRuleDigitDelimiter()
|
790
|
-
{
|
791
|
-
final String columnNames[] = { "c" };
|
792
|
-
try {
|
793
|
-
checkUniqueNumberSuffixRuleInternal(columnNames, columnNames, "2");
|
794
|
-
} catch (Throwable t) {
|
795
|
-
assertTrue(t instanceof ConfigException);
|
796
|
-
}
|
797
|
-
}
|
798
|
-
|
799
|
-
@Test
|
800
|
-
public void checkUniqueNumberSuffixRuleShortMaxLength()
|
801
|
-
{
|
802
|
-
final String columnNames[] = { "c" };
|
803
|
-
try {
|
804
|
-
checkUniqueNumberSuffixRuleInternal(columnNames, columnNames, DEFAULT, -1, 7);
|
805
|
-
} catch (Throwable t) {
|
806
|
-
assertTrue(t instanceof ConfigException);
|
807
|
-
}
|
808
|
-
}
|
809
|
-
|
810
|
-
// TODO(dmikurube): Test a nil/null delimiter in "unique".
|
811
|
-
// - rule: unique
|
812
|
-
// delimiter:
|
813
|
-
|
814
|
-
@Test
|
815
|
-
public void checkUniqueNumberSuffixRule0()
|
816
|
-
{
|
817
|
-
final String originalColumnNames[] = { "a", "b", "c", "d", "e" };
|
818
|
-
final String expectedColumnNames[] = { "a", "b", "c", "d", "e" };
|
819
|
-
checkUniqueNumberSuffixRuleInternal(originalColumnNames, expectedColumnNames);
|
820
|
-
}
|
821
|
-
|
822
|
-
@Test
|
823
|
-
public void checkUniqueNumberSuffixRule1()
|
824
|
-
{
|
825
|
-
final String originalColumnNames[] = { "c", "c", "c1", "c2", "c2" };
|
826
|
-
final String expectedColumnNames[] = { "c", "c_2", "c1", "c2", "c2_2" };
|
827
|
-
checkUniqueNumberSuffixRuleInternal(originalColumnNames, expectedColumnNames);
|
828
|
-
}
|
829
|
-
|
830
|
-
@Test
|
831
|
-
public void checkUniqueNumberSuffixRule2()
|
832
|
-
{
|
833
|
-
final String originalColumnNames[] = { "c", "c", "c_1", "c_3", "c" };
|
834
|
-
final String expectedColumnNames[] = { "c", "c_2", "c_1", "c_3", "c_4" };
|
835
|
-
checkUniqueNumberSuffixRuleInternal(originalColumnNames, expectedColumnNames);
|
836
|
-
}
|
837
|
-
|
838
|
-
@Test
|
839
|
-
public void checkUniqueNumberSuffixRule3()
|
840
|
-
{
|
841
|
-
final String originalColumnNames[] = {
|
842
|
-
"c", "c", "c", "c", "c", "c", "c", "c", "c", "c", "c_1", "c_1" };
|
843
|
-
final String expectedColumnNames[] = {
|
844
|
-
"c", "c_2", "c_3", "c_4", "c_5", "c_6", "c_7", "c_8", "c_9", "c_10", "c_1", "c_1_2" };
|
845
|
-
checkUniqueNumberSuffixRuleInternal(originalColumnNames, expectedColumnNames);
|
846
|
-
}
|
847
|
-
|
848
|
-
@Test
|
849
|
-
public void checkUniqueNumberSuffixRule4DifferentDelimiter()
|
850
|
-
{
|
851
|
-
final String originalColumnNames[] = { "c", "c", "c1", "c2", "c2" };
|
852
|
-
final String expectedColumnNames[] = { "c", "c-2", "c1", "c2", "c2-2" };
|
853
|
-
checkUniqueNumberSuffixRuleInternal(originalColumnNames, expectedColumnNames, "-");
|
854
|
-
}
|
855
|
-
|
856
|
-
@Test
|
857
|
-
public void checkUniqueNumberSuffixRule5Digits()
|
858
|
-
{
|
859
|
-
final String originalColumnNames[] = { "c", "c", "c1", "c2", "c2" };
|
860
|
-
final String expectedColumnNames[] = { "c", "c_0002", "c1", "c2", "c2_0002" };
|
861
|
-
checkUniqueNumberSuffixRuleInternal(originalColumnNames, expectedColumnNames, DEFAULT, 4, -1);
|
862
|
-
}
|
863
|
-
|
864
|
-
@Test
|
865
|
-
public void checkUniqueNumberSuffixRule6MaxLength1()
|
866
|
-
{
|
867
|
-
final String originalColumnNames[] = { "column", "column", "column_1", "column_2", "column_2" };
|
868
|
-
final String expectedColumnNames[] = { "column", "column_3", "column_1", "column_2", "column_4" };
|
869
|
-
checkUniqueNumberSuffixRuleInternal(originalColumnNames, expectedColumnNames, DEFAULT, -1, 8);
|
870
|
-
}
|
871
|
-
|
872
|
-
@Test
|
873
|
-
public void checkUniqueNumberSuffixRule7()
|
874
|
-
{
|
875
|
-
final String originalColumnNames[] = { "column", "column", "column_2", "column_3" };
|
876
|
-
final String expectedColumnNames[] = { "column", "column_4", "column_2", "column_3" };
|
877
|
-
checkUniqueNumberSuffixRuleInternal(originalColumnNames, expectedColumnNames, DEFAULT, -1, 8);
|
878
|
-
}
|
879
|
-
|
880
|
-
@Test
|
881
|
-
public void checkUniqueNumberSuffixRule8MaxLength2()
|
882
|
-
{
|
883
|
-
final String originalColumnNames[] = {
|
884
|
-
"column", "colum", "column", "colum", "column", "colum", "column", "colum", "column",
|
885
|
-
"colum", "column", "colum", "column", "colum", "column", "colum", "column", "colum",
|
886
|
-
"column", "colum", "column", "colum" };
|
887
|
-
final String expectedColumnNames[] = {
|
888
|
-
"column", "colum", "column_2", "colum_2", "column_3", "colum_3", "column_4", "colum_4", "column_5",
|
889
|
-
"colum_5", "column_6", "colum_6", "column_7", "colum_7", "column_8", "colum_8", "column_9", "colum_9",
|
890
|
-
"colum_10", "colum_11", "colum_12", "colum_13" };
|
891
|
-
checkUniqueNumberSuffixRuleInternal(originalColumnNames, expectedColumnNames, DEFAULT, -1, 8);
|
892
|
-
}
|
893
|
-
|
894
|
-
@Test
|
895
|
-
public void checkUniqueNumberSuffixRule9MaxLength3()
|
896
|
-
{
|
897
|
-
final String originalColumnNames[] = {
|
898
|
-
"column", "column", "column", "column", "column", "column", "column", "column", "column",
|
899
|
-
"colum", "colum", "colum", "colum", "colum", "colum", "colum", "colum",
|
900
|
-
"column", "colum", "column", "colum", "column" };
|
901
|
-
final String expectedColumnNames[] = {
|
902
|
-
"column", "column_2", "column_3", "column_4", "column_5", "column_6", "column_7", "column_8", "column_9",
|
903
|
-
"colum", "colum_2", "colum_3", "colum_4", "colum_5", "colum_6", "colum_7", "colum_8",
|
904
|
-
"colum_10", "colum_9", "colum_11", "colum_12", "colum_13" };
|
905
|
-
checkUniqueNumberSuffixRuleInternal(originalColumnNames, expectedColumnNames, DEFAULT, -1, 8);
|
906
|
-
}
|
907
|
-
|
908
|
-
@Test
|
909
|
-
public void checkUniqueNumberSuffixRule10EsteemOriginalNames()
|
910
|
-
{
|
911
|
-
final String originalColumnNames[] = { "c", "c", "c_2" };
|
912
|
-
final String expectedColumnNames[] = { "c", "c_3", "c_2" };
|
913
|
-
checkUniqueNumberSuffixRuleInternal(originalColumnNames, expectedColumnNames, DEFAULT, -1, -1);
|
914
|
-
}
|
915
|
-
|
916
|
-
@Test
|
917
|
-
public void checkUniqueNumberSuffixRuleNegativeLength()
|
918
|
-
{
|
919
|
-
final String originalColumnNames[] = { "column" };
|
920
|
-
exception.expect(ConfigException.class);
|
921
|
-
// TODO(dmikurube): Except "Caused by": exception.expectCause(instanceOf(JsonMappingException.class));
|
922
|
-
// Needs to import org.hamcrest.Matchers... in addition to org.junit...
|
923
|
-
checkUniqueNumberSuffixRuleInternal(originalColumnNames, originalColumnNames, DEFAULT, -1, -2);
|
924
|
-
}
|
925
|
-
|
926
|
-
private void checkUniqueNumberSuffixRuleInternal(
|
927
|
-
final String originalColumnNames[],
|
928
|
-
final String expectedColumnNames[]) {
|
929
|
-
checkUniqueNumberSuffixRuleInternal(originalColumnNames,
|
930
|
-
expectedColumnNames,
|
931
|
-
DEFAULT,
|
932
|
-
-1,
|
933
|
-
-1);
|
934
|
-
}
|
935
|
-
|
936
|
-
private void checkUniqueNumberSuffixRuleInternal(
|
937
|
-
final String originalColumnNames[],
|
938
|
-
final String expectedColumnNames[],
|
939
|
-
String delimiter) {
|
940
|
-
checkUniqueNumberSuffixRuleInternal(originalColumnNames,
|
941
|
-
expectedColumnNames,
|
942
|
-
delimiter,
|
943
|
-
-1,
|
944
|
-
-1);
|
945
|
-
}
|
946
|
-
|
947
|
-
private void checkUniqueNumberSuffixRuleInternal(
|
948
|
-
final String originalColumnNames[],
|
949
|
-
final String expectedColumnNames[],
|
950
|
-
String delimiter,
|
951
|
-
int digits,
|
952
|
-
int max_length)
|
953
|
-
{
|
954
|
-
Schema.Builder originalSchemaBuilder = Schema.builder();
|
955
|
-
for (String originalColumnName : originalColumnNames) {
|
956
|
-
originalSchemaBuilder.add(originalColumnName, STRING);
|
957
|
-
}
|
958
|
-
final Schema ORIGINAL_SCHEMA = originalSchemaBuilder.build();
|
959
|
-
|
960
|
-
HashMap<String, Object> parameters = new HashMap<>();
|
961
|
-
parameters.put("rule", "unique_number_suffix");
|
962
|
-
if (!delimiter.equals(DEFAULT)) {
|
963
|
-
parameters.put("delimiter", delimiter);
|
964
|
-
}
|
965
|
-
if (digits >= 0) {
|
966
|
-
parameters.put("digits", digits);
|
967
|
-
}
|
968
|
-
if (max_length != -1) {
|
969
|
-
parameters.put("max_length", max_length);
|
970
|
-
}
|
971
|
-
ConfigSource pluginConfig = Exec.newConfigSource().set("rules",
|
972
|
-
ImmutableList.of(ImmutableMap.copyOf(parameters)));
|
973
|
-
|
974
|
-
filter.transaction(pluginConfig, ORIGINAL_SCHEMA, new FilterPlugin.Control() {
|
975
|
-
@Override
|
976
|
-
public void run(TaskSource task, Schema newSchema)
|
977
|
-
{
|
978
|
-
ArrayList<String> resolvedColumnNamesList = new ArrayList<>(newSchema.size());
|
979
|
-
for (Column resolvedColumn : newSchema.getColumns()) {
|
980
|
-
resolvedColumnNamesList.add(resolvedColumn.getName());
|
981
|
-
}
|
982
|
-
String[] resolvedColumnNames = Iterables.toArray(resolvedColumnNamesList, String.class);
|
983
|
-
assertEquals(expectedColumnNames, resolvedColumnNames);
|
984
|
-
for (int i = 0; i < expectedColumnNames.length; ++i) {
|
985
|
-
Column original = ORIGINAL_SCHEMA.getColumn(i);
|
986
|
-
Column resolved = newSchema.getColumn(i);
|
987
|
-
assertEquals(original.getType(), resolved.getType());
|
988
|
-
}
|
989
|
-
}
|
990
|
-
});
|
991
|
-
}
|
992
|
-
|
993
|
-
private Schema makeSchema(final String columnNames[])
|
994
|
-
{
|
995
|
-
Schema.Builder builder = new Schema.Builder();
|
996
|
-
for (String columnName : columnNames) {
|
997
|
-
builder.add(columnName, STRING);
|
998
|
-
}
|
999
|
-
return builder.build();
|
1000
|
-
}
|
1001
|
-
|
1002
|
-
private void renameAndCheckSchema(ConfigSource config,
|
1003
|
-
final String original[],
|
1004
|
-
final String expected[])
|
1005
|
-
{
|
1006
|
-
final Schema originalSchema = makeSchema(original);
|
1007
|
-
filter.transaction(config, originalSchema, new FilterPlugin.Control() {
|
1008
|
-
@Override
|
1009
|
-
public void run(TaskSource task, Schema renamedSchema)
|
1010
|
-
{
|
1011
|
-
assertEquals(originalSchema.getColumnCount(), renamedSchema.getColumnCount());
|
1012
|
-
assertEquals(expected.length, renamedSchema.getColumnCount());
|
1013
|
-
for (int i = 0; i < renamedSchema.getColumnCount(); ++i) {
|
1014
|
-
assertEquals(originalSchema.getColumnType(i), renamedSchema.getColumnType(i));
|
1015
|
-
assertEquals(expected[i], renamedSchema.getColumnName(i));
|
1016
|
-
}
|
1017
|
-
}
|
1018
|
-
});
|
1019
|
-
}
|
1020
|
-
}
|