Skip to content

Commit

Permalink
[BACKLOG-17473] Excluding some integration tests from running that ne…
Browse files Browse the repository at this point in the history
…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
Show file tree
Hide file tree
Showing 6 changed files with 176 additions and 108 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -97,6 +97,6 @@ __IntelliJ__
1. Submit a pull request, referencing the relevant [Jira case](http://jira.pentaho.com/secure/Dashboard.jspa) 1. Submit a pull request, referencing the relevant [Jira case](http://jira.pentaho.com/secure/Dashboard.jspa)
2. Attach a Git patch file to the relevant [Jira case](http://jira.pentaho.com/secure/Dashboard.jspa) 2. Attach a Git patch file to the relevant [Jira case](http://jira.pentaho.com/secure/Dashboard.jspa)


Use of the Pentaho checkstyle format (via `ant checkstyle` and reviewing the report) and developing working Use of the Pentaho checkstyle format (via `mvn site` and reviewing the report) and developing working
Unit Tests helps to ensure that pull requests for bugs and improvements are processed quickly. Unit Tests helps to ensure that pull requests for bugs and improvements are processed quickly.


5 changes: 5 additions & 0 deletions integration/README.md
@@ -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.
@@ -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() );
} }


} }
@@ -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
78 changes: 76 additions & 2 deletions plugins/pur/core/pom.xml
Expand Up @@ -41,7 +41,9 @@
<mockito-core.version>1.9.5</mockito-core.version> <mockito-core.version>1.9.5</mockito-core.version>
<hamcrest-core.version>1.3</hamcrest-core.version> <hamcrest-core.version>1.3</hamcrest-core.version>
<hamcrest-library.version>1.3</hamcrest-library.version> <hamcrest-library.version>1.3</hamcrest-library.version>
<spring-test.version>3.2.14.RELEASE</spring-test.version> <spring.framework.version>3.2.10.RELEASE</spring.framework.version>
<spring.security.version>4.1.3.RELEASE</spring.security.version>
<spring.webflow.version>2.4.4.RELEASE</spring.webflow.version>
<se-jcr.version>0.9</se-jcr.version> <se-jcr.version>0.9</se-jcr.version>
<jcr.version>2.0</jcr.version> <jcr.version>2.0</jcr.version>
<jackrabbit-core.version>2.10.0</jackrabbit-core.version> <jackrabbit-core.version>2.10.0</jackrabbit-core.version>
Expand Down Expand Up @@ -269,7 +271,67 @@
<dependency> <dependency>
<groupId>org.springframework</groupId> <groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId> <artifactId>spring-test</artifactId>
<version>${spring-test.version}</version> <version>${spring.framework.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
<version>${spring.framework.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>${spring.framework.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${spring.framework.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-expression</artifactId>
<version>${spring.framework.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-tx</artifactId>
<version>${spring.framework.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
<version>${spring.framework.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-orm</artifactId>
<version>${spring.framework.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.webflow</groupId>
<artifactId>spring-binding</artifactId>
<version>${spring.webflow.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-config</artifactId>
<version>${spring.security.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-core</artifactId>
<version>${spring.security.version}</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>
Expand Down Expand Up @@ -390,6 +452,18 @@
</dependency> </dependency>
</dependencies> </dependencies>
</plugin> </plugin>


<!--
TODO: a case exists to handle these integration tests
see: http://jira.pentaho.com/browse/BACKLOG-17551
-->
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins> </plugins>
</build> </build>
</project> </project>
11 changes: 0 additions & 11 deletions pom.xml
Expand Up @@ -301,16 +301,5 @@
<module>assemblies</module> <module>assemblies</module>
</modules> </modules>
</profile> </profile>
<profile>
<id>integration-tests</id>
<activation>
<property>
<name>runITs</name>
</property>
</activation>
<modules>
<module>integration</module>
</modules>
</profile>
</profiles> </profiles>
</project> </project>

1 comment on commit dceaaeb

@Daqindiguoking
Copy link

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!

Please sign in to comment.