code cleanups and integration work for defaulting to Java Event implementation

cleaned dependencies, removed Guava code

default to java event

also compile java event

use json-unit for json result assertions

remove Java 8 specific constructs to be able to compile on Java 7

use jar-dependencies

better jar file loading

copy jar into lib after build

add post-build copy and clean of gem jar and re-indented file

fix jar destination

include generated jar in gem

remove useless ArrayList constructions

add tests for KeyNode.join method

remove useless  shadow and disable unchecked warnings

update gradle dependency to 2.8

fix deprecated asserEquals usage

simplify convoluted list contruction

fix array fields nil values handling

moar nil value tests

simplify for loop
This commit is contained in:
Colin Surprenant 2016-01-14 17:31:14 -05:00
parent c4a051a3a7
commit 5a522a0037
20 changed files with 215 additions and 134 deletions

View file

@ -5,14 +5,7 @@ require "java"
module LogStash
end
# TODO: (colin) integrate jar loading with gradle and verify dev vs prod environment setups
# insert all jars in this directory into CLASSPATH
Dir.glob(File.join(File.expand_path("..", __FILE__), "*.jar")).each do |jar|
$CLASSPATH << jar unless $CLASSPATH.include?(jar)
end
# TODO: (colin) correctly handle dev env build/ dir and local jar
require "logstash-core-event-java_jars"
# local dev setup
classes_dir = File.expand_path("../../../build/classes/main", __FILE__)
@ -22,7 +15,13 @@ if File.directory?(classes_dir)
$CLASSPATH << classes_dir unless $CLASSPATH.include?(classes_dir)
else
# otherwise use included jar
raise("TODO build dir not found and no jar file")
begin
jar = Dir[File.dirname(__FILE__) + "/logstash-core-event-java*.jar"].first
raise("No logstash-core-event-java jar file found") unless jar
require jar
rescue Exception => e
raise("Error loading logstash-core-event-java jar file, cause: #{e.message}")
end
end
require "jruby_event_ext"

View file

@ -0,0 +1,5 @@
# this is a generated file, to avoid over-writing it just delete this comment
require 'jar_dependencies'
require_jar( 'org.codehaus.jackson', 'jackson-core-asl', '1.9.13' )
require_jar( 'org.codehaus.jackson', 'jackson-mapper-asl', '1.9.13' )