Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BACKLOG-17473] Excluding some integration tests from running that ne…
…ed review before being part of the default build. Some test fixing.
- Loading branch information
Hilario Fernandes
committed
Jul 8, 2017
1 parent
1541bf1
commit dceaaeb
Showing
6 changed files
with
176 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,5 @@ | |||
# PDI Integration Tests | |||
|
|||
**WARNING:** The tests contained in this module need review and update. They were not being actively ran | |||
on the ant version of the project so the best course of action seemed to be moving them into their own | |||
module considering they required several parts of the project to execute. |
182 changes: 91 additions & 91 deletions
182
...ject/src/it/java/org/pentaho/di/trans/steps/denormaliser/DenormaliserMetaInjectionIT.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,91 +1,91 @@ | |||
/*! ****************************************************************************** | /*! ****************************************************************************** | ||
* | * | ||
* Pentaho Data Integration | * Pentaho Data Integration | ||
* | * | ||
* Copyright (C) 2002-2016 by Pentaho : http://www.pentaho.com | * Copyright (C) 2002-2017 by Pentaho : http://www.pentaho.com | ||
* | * | ||
******************************************************************************* | ******************************************************************************* | ||
* | * | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | * Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with | * you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | * the License. You may obtain a copy of the License at | ||
* | * | ||
* http://www.apache.org/licenses/LICENSE-2.0 | * http://www.apache.org/licenses/LICENSE-2.0 | ||
* | * | ||
* Unless required by applicable law or agreed to in writing, software | * Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | * distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | * See the License for the specific language governing permissions and | ||
* limitations under the License. | * limitations under the License. | ||
* | * | ||
******************************************************************************/ | ******************************************************************************/ | ||
|
|
||
package org.pentaho.di.trans.steps.denormaliser; | package org.pentaho.di.trans.steps.denormaliser; | ||
|
|
||
import static org.junit.Assert.assertEquals; | import static org.junit.Assert.assertEquals; | ||
|
|
||
import org.junit.Before; | import org.junit.Before; | ||
import org.junit.BeforeClass; | import org.junit.BeforeClass; | ||
import org.junit.Test; | import org.junit.Test; | ||
import org.pentaho.di.core.KettleEnvironment; | import org.pentaho.di.core.KettleEnvironment; | ||
import org.pentaho.di.core.plugins.Plugin; | import org.pentaho.di.core.plugins.Plugin; | ||
import org.pentaho.di.core.plugins.PluginInterface; | import org.pentaho.di.core.plugins.PluginInterface; | ||
import org.pentaho.di.core.plugins.PluginRegistry; | import org.pentaho.di.core.plugins.PluginRegistry; | ||
import org.pentaho.di.core.plugins.PluginTypeInterface; | import org.pentaho.di.core.plugins.PluginTypeInterface; | ||
import org.pentaho.di.core.plugins.StepPluginType; | import org.pentaho.di.core.plugins.StepPluginType; | ||
import org.pentaho.di.trans.Trans; | import org.pentaho.di.trans.Trans; | ||
import org.pentaho.di.trans.TransMeta; | import org.pentaho.di.trans.TransMeta; | ||
import org.pentaho.di.trans.step.StepMetaInterface; | import org.pentaho.di.trans.step.StepMetaInterface; | ||
import org.pentaho.di.trans.steps.metainject.MetaInject; | import org.pentaho.di.trans.steps.metainject.MetaInject; | ||
import org.pentaho.di.trans.steps.metainject.MetaInjectMeta; | import org.pentaho.di.trans.steps.metainject.MetaInjectMeta; | ||
|
|
||
import java.net.URL; | import java.net.URL; | ||
import java.util.ArrayList; | import java.util.ArrayList; | ||
import java.util.HashMap; | import java.util.HashMap; | ||
import java.util.List; | import java.util.List; | ||
import java.util.Map; | import java.util.Map; | ||
|
|
||
public class DenormaliserMetaInjectionIT { | public class DenormaliserMetaInjectionIT { | ||
|
|
||
private static final String EXPECTED_VALUE = " 1"; | private static final String EXPECTED_VALUE = "1"; | ||
|
|
||
private TransMeta transMeta; | private TransMeta transMeta; | ||
|
|
||
private Trans trans; | private Trans trans; | ||
|
|
||
@BeforeClass | @BeforeClass | ||
public static void initKettle() throws Exception { | public static void initKettle() throws Exception { | ||
KettleEnvironment.init( false ); | KettleEnvironment.init( false ); | ||
|
|
||
Map<Class<?>, String> classMap = new HashMap<>(); | Map<Class<?>, String> classMap = new HashMap<>(); | ||
classMap.put( StepMetaInterface.class, "org.pentaho.di.trans.steps.metainject.MetaInjectMeta" ); | classMap.put( StepMetaInterface.class, "org.pentaho.di.trans.steps.metainject.MetaInjectMeta" ); | ||
List<String> libraries = new ArrayList<>(); | List<String> libraries = new ArrayList<>(); | ||
|
|
||
PluginInterface plugin = | PluginInterface plugin = | ||
new Plugin( new String[] { "MetaInject" }, StepPluginType.class, StepMetaInterface.class, "Flow", | new Plugin( new String[] { "MetaInject" }, StepPluginType.class, StepMetaInterface.class, "Flow", | ||
"MetaInjectMeta", null, null, false, false, classMap, libraries, null, null ); | "MetaInjectMeta", null, null, false, false, classMap, libraries, null, null ); | ||
PluginRegistry.getInstance().registerPlugin( StepPluginType.class, plugin ); | PluginRegistry.getInstance().registerPlugin( StepPluginType.class, plugin ); | ||
} | } | ||
|
|
||
@Before | @Before | ||
public void setUp() throws Exception { | public void setUp() throws Exception { | ||
transMeta = new TransMeta( "src/it/resources/org/pentaho/di/trans/steps/denormaliser/pdi-11947.ktr" ); | transMeta = new TransMeta( "src/it/resources/org/pentaho/di/trans/steps/denormaliser/pdi-11947.ktr" ); | ||
transMeta.setTransformationType( TransMeta.TransformationType.Normal ); | transMeta.setTransformationType( TransMeta.TransformationType.Normal ); | ||
trans = new Trans( transMeta ); | trans = new Trans( transMeta ); | ||
} | } | ||
|
|
||
@Test | @Test | ||
public void testAddedFieldsAvalibleOutsideInjectedTransformation() throws Exception { | public void testAddedFieldsAvailableOutsideInjectedTransformation() throws Exception { | ||
runTransformation( trans ); | runTransformation( trans ); | ||
String actualValue = trans.getVariable( "X_FIELD_VALUE" ); | String actualValue = trans.getVariable( "X_FIELD_VALUE" ); | ||
assertEquals( EXPECTED_VALUE, actualValue ); | assertEquals( EXPECTED_VALUE, actualValue ); | ||
} | } | ||
|
|
||
private static void runTransformation( Trans trans ) throws Exception { | private static void runTransformation( Trans trans ) throws Exception { | ||
trans.prepareExecution( null ); | trans.prepareExecution( null ); | ||
trans.startThreads(); | trans.startThreads(); | ||
trans.waitUntilFinished(); | trans.waitUntilFinished(); | ||
assertEquals( 0, trans.getErrors() ); | assertEquals( 0, trans.getErrors() ); | ||
} | } | ||
|
|
||
} | } |
6 changes: 3 additions & 3 deletions
6
...c/it/resources/org/pentaho/di/trans/steps/normaliser/normaliser-13761-expected-output.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,4 +1,4 @@ | |||
question;col1;col2;col3 | question;col1;col2;col3 | ||
x; 1.0; 2.0; 3.0 | x;1.0;2.0;3.0 | ||
y; 4.0; 5.0; 6.0 | y;4.0;5.0;6.0 | ||
z; 7.0; 8.0; 9.0 | z;7.0;8.0;9.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dceaaeb
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a very nice programe!