From 34de8e4476cf5a3557d32111f53fd37f389aa2f1 Mon Sep 17 00:00:00 2001 From: Bryan Rosander Date: Tue, 6 Oct 2015 12:39:51 -0400 Subject: [PATCH] [TEST] - Separating out integration tests --- assemblies/features/pom.xml | 2 +- ....java => JobEntryPigScriptExecutorIT.java} | 4 +- .../hadoop/mapreduce/test/MRUtilIT.java} | 6 +- .../mapreduce/test/PentahoMapReduceIT.java} | 36 ++++++------ .../resources/wordcount-mapper.ktr | 0 .../resources/wordcount-reducer.ktr | 0 pom.xml | 58 ++++++++++++++----- 7 files changed, 69 insertions(+), 37 deletions(-) rename kettle-plugins/pig/src/it/java/org/pentaho/big/data/kettle/plugins/pig/{JobEntryPigScriptExecutorIntegrationTest.java => JobEntryPigScriptExecutorIT.java} (94%) rename legacy/src/{test/java/org/pentaho/hadoop/mapreduce/test/MRUtilIntegrationTest.java => it/java/org/pentaho/hadoop/mapreduce/test/MRUtilIT.java} (89%) rename legacy/src/{test/java/org/pentaho/hadoop/mapreduce/test/PentahoMapReduceIntegrationTest.java => it/java/org/pentaho/hadoop/mapreduce/test/PentahoMapReduceIT.java} (95%) rename legacy/src/{test => it}/resources/wordcount-mapper.ktr (100%) rename legacy/src/{test => it}/resources/wordcount-reducer.ktr (100%) diff --git a/assemblies/features/pom.xml b/assemblies/features/pom.xml index b2ce6c376e..ccd84e430c 100644 --- a/assemblies/features/pom.xml +++ b/assemblies/features/pom.xml @@ -54,7 +54,7 @@ org.codehaus.mojo build-helper-maven-plugin - ${dependency.build-helper-maven-plugin.revision} + ${plugin.org.codehaus.mojo.build-helper-maven-plugin.version} attach-artifacts diff --git a/kettle-plugins/pig/src/it/java/org/pentaho/big/data/kettle/plugins/pig/JobEntryPigScriptExecutorIntegrationTest.java b/kettle-plugins/pig/src/it/java/org/pentaho/big/data/kettle/plugins/pig/JobEntryPigScriptExecutorIT.java similarity index 94% rename from kettle-plugins/pig/src/it/java/org/pentaho/big/data/kettle/plugins/pig/JobEntryPigScriptExecutorIntegrationTest.java rename to kettle-plugins/pig/src/it/java/org/pentaho/big/data/kettle/plugins/pig/JobEntryPigScriptExecutorIT.java index 67669dc158..e4cc9a4a49 100644 --- a/kettle-plugins/pig/src/it/java/org/pentaho/big/data/kettle/plugins/pig/JobEntryPigScriptExecutorIntegrationTest.java +++ b/kettle-plugins/pig/src/it/java/org/pentaho/big/data/kettle/plugins/pig/JobEntryPigScriptExecutorIT.java @@ -40,7 +40,7 @@ import static org.junit.Assert.assertEquals; -public class JobEntryPigScriptExecutorIntegrationTest { +public class JobEntryPigScriptExecutorIT { StringBuffer m_reference; @@ -61,7 +61,7 @@ private StringBuffer readResource( Reader r ) throws IOException { public void setup() throws IOException { BufferedReader br = new BufferedReader( - new InputStreamReader( JobEntryPigScriptExecutorIntegrationTest.class.getClassLoader().getResourceAsStream( + new InputStreamReader( JobEntryPigScriptExecutorIT.class.getClassLoader().getResourceAsStream( "org/pentaho/di/job/entries/pig/JobEntryPigScriptExecutorTest.ref" ) ) ); m_reference = readResource( br ); diff --git a/legacy/src/test/java/org/pentaho/hadoop/mapreduce/test/MRUtilIntegrationTest.java b/legacy/src/it/java/org/pentaho/hadoop/mapreduce/test/MRUtilIT.java similarity index 89% rename from legacy/src/test/java/org/pentaho/hadoop/mapreduce/test/MRUtilIntegrationTest.java rename to legacy/src/it/java/org/pentaho/hadoop/mapreduce/test/MRUtilIT.java index 3694d54086..415d49fd29 100644 --- a/legacy/src/test/java/org/pentaho/hadoop/mapreduce/test/MRUtilIntegrationTest.java +++ b/legacy/src/it/java/org/pentaho/hadoop/mapreduce/test/MRUtilIT.java @@ -31,13 +31,13 @@ import org.pentaho.di.trans.TransMeta; import org.pentaho.hadoop.mapreduce.MRUtil; -public class MRUtilIntegrationTest { +public class MRUtilIT { @Test public void createTrans_normalEngine() throws Exception { KettleEnvironment.init(); final Configuration c = new Configuration(); - final TransMeta transMeta = new TransMeta( "./src/test/resources/wordcount-reducer.ktr" ); + final TransMeta transMeta = new TransMeta( "./src/it/resources/wordcount-reducer.ktr" ); final Trans trans = MRUtil.getTrans( c, transMeta.getXML(), false ); assertEquals( TransMeta.TransformationType.Normal, trans.getTransMeta().getTransformationType() ); } @@ -46,7 +46,7 @@ public void createTrans_normalEngine() throws Exception { public void createTrans_singleThreaded() throws Exception { KettleEnvironment.init(); final Configuration c = new Configuration(); - final TransMeta transMeta = new TransMeta( "./src/test/resources/wordcount-reducer.ktr" ); + final TransMeta transMeta = new TransMeta( "./src/it/resources/wordcount-reducer.ktr" ); final Trans trans = MRUtil.getTrans( c, transMeta.getXML(), true ); assertEquals( TransMeta.TransformationType.SingleThreaded, trans.getTransMeta().getTransformationType() ); } diff --git a/legacy/src/test/java/org/pentaho/hadoop/mapreduce/test/PentahoMapReduceIntegrationTest.java b/legacy/src/it/java/org/pentaho/hadoop/mapreduce/test/PentahoMapReduceIT.java similarity index 95% rename from legacy/src/test/java/org/pentaho/hadoop/mapreduce/test/PentahoMapReduceIntegrationTest.java rename to legacy/src/it/java/org/pentaho/hadoop/mapreduce/test/PentahoMapReduceIT.java index 50fe89b806..73d1697f32 100644 --- a/legacy/src/test/java/org/pentaho/hadoop/mapreduce/test/PentahoMapReduceIntegrationTest.java +++ b/legacy/src/it/java/org/pentaho/hadoop/mapreduce/test/PentahoMapReduceIT.java @@ -75,7 +75,7 @@ import static org.junit.Assert.*; @SuppressWarnings( { "nls", "unchecked", "deprecation", "rawtypes" } ) -public class PentahoMapReduceIntegrationTest { +public class PentahoMapReduceIT { private boolean debug = false; @@ -96,7 +96,7 @@ public void testMapperBadInjectorFields() throws IOException, KettleException { MockOutputCollector outputCollector = new MockOutputCollector(); MockReporter reporter = new MockReporter(); MockRecordReader reader = new MockRecordReader( Arrays.asList( "test" ) ); - mapper.configure( createJobConf( "./src/test/resources/bad-injector-fields.ktr", "./src/test/resources/wordcount-reducer.ktr" ) ); + mapper.configure( createJobConf( "./src/test/resources/bad-injector-fields.ktr", "./src/it/resources/wordcount-reducer.ktr" ) ); mapper.run( reader, outputCollector, reporter ); fail( "Should have thrown an exception" ); @@ -443,7 +443,7 @@ public void testMapRunnable_wordCount() throws IOException, KettleException { MockOutputCollector outputCollector = new MockOutputCollector(); MockReporter reporter = new MockReporter(); - mapRunnable.configure( createJobConf( "./src/test/resources/wordcount-mapper.ktr", "./src/test/resources/wordcount-reducer.ktr" ) ); + mapRunnable.configure( createJobConf( "./src/it/resources/wordcount-mapper.ktr", "./src/it/resources/wordcount-reducer.ktr" ) ); final int ROWS = 10000; @@ -502,7 +502,7 @@ public void countValues( String k, Object v, MockOutputCollector oc ) { MockOutputCollector inputCollector = outputCollector; outputCollector = new MockOutputCollector(); - reducer.configure( createJobConf( "./src/test/resources/wordcount-mapper.ktr", "./src/test/resources/wordcount-reducer.ktr" ) ); + reducer.configure( createJobConf( "./src/it/resources/wordcount-mapper.ktr", "./src/it/resources/wordcount-reducer.ktr" ) ); start = System.currentTimeMillis(); for ( Object key : inputCollector.getCollection().keySet() ) { @@ -618,8 +618,8 @@ public void testReducer_null_output_value() throws Exception { @Test public void testLogChannelLeaking_mapper() throws Exception { JobConf jobConf = - createJobConf( "./src/test/resources/wordcount-mapper.ktr", "./src/test/resources/wordcount-reducer.ktr", - "./src/test/resources/wordcount-reducer.ktr" ); + createJobConf( "./src/it/resources/wordcount-mapper.ktr", "./src/it/resources/wordcount-reducer.ktr", + "./src/it/resources/wordcount-reducer.ktr" ); PentahoMapRunnable mapper = new PentahoMapRunnable(); mapper.configure( jobConf ); MockReporter reporter = new MockReporter(); @@ -651,8 +651,8 @@ public void testLogChannelLeaking_mapper() throws Exception { @Test public void testLogChannelLeaking_combiner() throws Exception { JobConf jobConf = - createJobConf( "./src/test/resources/wordcount-mapper.ktr", "./src/test/resources/wordcount-reducer.ktr", - "./src/test/resources/wordcount-reducer.ktr" ); + createJobConf( "./src/it/resources/wordcount-mapper.ktr", "./src/it/resources/wordcount-reducer.ktr", + "./src/it/resources/wordcount-reducer.ktr" ); List input = Arrays.asList( new IntWritable( 1 ) ); GenericTransCombiner combiner = new GenericTransCombiner(); combiner.configure( jobConf ); @@ -685,8 +685,8 @@ public void testLogChannelLeaking_combiner() throws Exception { @Test public void testLogChannelLeaking_reducer() throws Exception { JobConf jobConf = - createJobConf( "./src/test/resources/wordcount-mapper.ktr", "./src/test/resources/wordcount-reducer.ktr", - "./src/test/resources/wordcount-reducer.ktr" ); + createJobConf( "./src/it/resources/wordcount-mapper.ktr", "./src/it/resources/wordcount-reducer.ktr", + "./src/it/resources/wordcount-reducer.ktr" ); List input = Arrays.asList( new IntWritable( 1 ) ); GenericTransReduce reducer = new GenericTransReduce(); reducer.configure( jobConf ); @@ -754,8 +754,8 @@ public void testMapReduce_InputOutput() throws Exception { @Test public void testCombinerOutputClasses() throws IOException, KettleException { JobConf jobConf = - createJobConf( "./src/test/resources/wordcount-mapper.ktr", "./src/test/resources/wordcount-reducer.ktr", - "./src/test/resources/wordcount-reducer.ktr" ); + createJobConf( "./src/it/resources/wordcount-mapper.ktr", "./src/it/resources/wordcount-reducer.ktr", + "./src/it/resources/wordcount-reducer.ktr" ); jobConf.setMapOutputKeyClass( Text.class ); jobConf.setMapOutputValueClass( IntWritable.class ); @@ -773,8 +773,8 @@ public void testCombinerOutputClasses() throws IOException, KettleException { @Test public void testReducerOutputClasses() throws IOException, KettleException { JobConf jobConf = - createJobConf( "./src/test/resources/wordcount-mapper.ktr", "./src/test/resources/wordcount-reducer.ktr", - "./src/test/resources/wordcount-reducer.ktr" ); + createJobConf( "./src/it/resources/wordcount-mapper.ktr", "./src/it/resources/wordcount-reducer.ktr", + "./src/it/resources/wordcount-reducer.ktr" ); jobConf.setMapOutputKeyClass( Text.class ); jobConf.setMapOutputValueClass( IntWritable.class ); @@ -792,8 +792,8 @@ public void testReducerOutputClasses() throws IOException, KettleException { @Test public void testTaskIdExtraction() throws Exception { JobConf conf = - createJobConf( "./src/test/resources/wordcount-mapper.ktr", "./src/test/resources/wordcount-reducer.ktr", - "./src/test/resources/wordcount-reducer.ktr" ); + createJobConf( "./src/it/resources/wordcount-mapper.ktr", "./src/it/resources/wordcount-reducer.ktr", + "./src/it/resources/wordcount-reducer.ktr" ); conf.set( "mapred.task.id", "job_201208090841_0133" ); PentahoMapRunnable mapRunnable = new PentahoMapRunnable(); @@ -809,8 +809,8 @@ public void testTaskIdExtraction() throws Exception { @Test public void testTaskIdExtraction_over_10000() throws Exception { JobConf conf = - createJobConf( "./src/test/resources/wordcount-mapper.ktr", "./src/test/resources/wordcount-reducer.ktr", - "./src/test/resources/wordcount-reducer.ktr" ); + createJobConf( "./src/it/resources/wordcount-mapper.ktr", "./src/it/resources/wordcount-reducer.ktr", + "./src/it/resources/wordcount-reducer.ktr" ); conf.set( "mapred.task.id", "job_201208090841_013302" ); PentahoMapRunnable mapRunnable = new PentahoMapRunnable(); diff --git a/legacy/src/test/resources/wordcount-mapper.ktr b/legacy/src/it/resources/wordcount-mapper.ktr similarity index 100% rename from legacy/src/test/resources/wordcount-mapper.ktr rename to legacy/src/it/resources/wordcount-mapper.ktr diff --git a/legacy/src/test/resources/wordcount-reducer.ktr b/legacy/src/it/resources/wordcount-reducer.ktr similarity index 100% rename from legacy/src/test/resources/wordcount-reducer.ktr rename to legacy/src/it/resources/wordcount-reducer.ktr diff --git a/pom.xml b/pom.xml index f70e1cdf03..7e1b8e3cdf 100644 --- a/pom.xml +++ b/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 org.pentaho @@ -37,7 +38,10 @@ 1.9.5 - 1.5 + 1.5 + + 2.17 + 6.1-SNAPSHOT 2.3.7 4.4 @@ -86,23 +90,16 @@ 4.3.1 - - - src/it/resources - - - src/test/resources - - + org.codehaus.mojo build-helper-maven-plugin - ${dependency.build-helper-maven-plugin.revision} + ${plugin.org.codehaus.mojo.build-helper-maven-plugin.version} add-test-source - process-resources + generate-test-sources add-test-source @@ -112,8 +109,43 @@ + + add-test-resource + generate-test-resources + + add-test-resource + + + + + src/it/resources + + + + + + + + + org.apache.maven.plugins + maven-failsafe-plugin + ${plugin.org.apache.maven.plugins.maven-failsafe-plugin.version} + + + integration-test + + integration-test + + + + verify + + verify + + + org.apache.felix maven-bundle-plugin