Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ before_script:
- mvn --version
script:
- echo "Running unit and controller tests for NON-hierarchical attributes"
- mvn clean verify -s acs-ci-config/mvn_settings.xml -Ppostgres -B
- mvn clean verify -s acs-ci-config/mvn_settings.xml -Ppublic -B
- echo "Running unit and controller tests for hierarchical attributes"
- mvn verify deploy -s acs-ci-config/mvn_settings.xml -Ppredix -Dartifactory.password=${ARTIFACTORY_PASSWORD} -B
- mvn verify deploy -s acs-ci-config/mvn_settings.xml -Ppredix-titan -Dartifactory.password=${ARTIFACTORY_PASSWORD} -B
# - mvn verify deploy -s acs-ci-config/mvn_settings.xml -Pwith.jacoco -Dartifactory.password=${ARTIFACTORY_PASSWORD} -B
# - tar zcvf acs-model-jacoco.tar.gz model/target/site/jacoco
# - tar zcvf acs-commons-jacoco.tar.gz commons/target/site/jacoco
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<organization>
<name>GE Global Research</name>
<name>GE Digital</name>
</organization>

<!-- Project information necessary to deploy to Maven Central (see: http://central.sonatype.org/pages/requirements.html) -->
Expand Down
251 changes: 78 additions & 173 deletions service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -480,22 +480,16 @@
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>${maven.compiler.source}</source>
<target>${maven.compiler.target}</target>
</configuration>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<environmentVariables>
<SPRING_PROFILES_ACTIVE>h2,public,simple-cache,titan</SPRING_PROFILES_ACTIVE>
</environmentVariables>
<!-- us32088: Place test reports outside of target directory so reports are not removed by 'mvn clean'
and retained by Jenkins for each profile -->
<reportsDirectory>${basedir}/surefire-reports</reportsDirectory>
<reportsDirectory>${basedir}/surefire-reports-titan</reportsDirectory>
<suiteXmlFiles>
<suiteXmlFile>src/test/resources/unit-tests.xml</suiteXmlFile>
</suiteXmlFiles>
Expand All @@ -506,18 +500,13 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<configuration>
<environmentVariables>
<SPRING_PROFILES_ACTIVE>h2,public,simple-cache,titan</SPRING_PROFILES_ACTIVE>
</environmentVariables>
<!-- us32088: Place test reports outside of target directory so reports are not removed by 'mvn clean'
and retained by Jenkins for each profile -->
<reportsDirectory>${basedir}/surefire-reports/controller-tests</reportsDirectory>
<summaryFile>${basedir}/surefire-reports/controller-tests/failsafe-summary.xml</summaryFile>
<systemProperties>
<ZAC_URL>${ZAC_URL}</ZAC_URL>
<ACS_SERVICE_ID>predix-acs</ACS_SERVICE_ID>
<ACS_DEFAULT_ISSUER_ID>http://acs.localhost:${UAA_LOCAL_PORT}/uaa</ACS_DEFAULT_ISSUER_ID>
<ZAC_UAA_URL>${ZAC_UAA_URL}</ZAC_UAA_URL>
<ZAC_CLIENT_ID>fake-client</ZAC_CLIENT_ID>
<ZAC_CLIENT_SECRET>fake-client</ZAC_CLIENT_SECRET>
</systemProperties>
<reportsDirectory>${basedir}/surefire-reports-titan/controller-tests</reportsDirectory>
<summaryFile>${basedir}/surefire-reports-titan/controller-tests/failsafe-summary.xml</summaryFile>
<excludes>
<exclude>**/NonHierarchical*IT.java</exclude>
</excludes>
Expand Down Expand Up @@ -584,6 +573,8 @@
</activation>
<build>
<plugins>
<!-- TODO: Once we isolate predix related files (including audit) into predix branch, -->
<!-- compiler plugin configuration that explicitly excludes audit files could be removed -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
Expand All @@ -598,126 +589,21 @@
</testExcludes>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>predix</id>
<dependencies>
<dependency>
<groupId>com.ge.predix.audit</groupId>
<artifactId>audit-sdk</artifactId>
<version>${audit-sdk.version}</version>
<exclusions>
<exclusion>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
</exclusion>
<exclusion>
<groupId>io.netty</groupId>
<artifactId>netty-tcnative-boringssl-static</artifactId>
</exclusion>
<exclusion>
<groupId>io.grpc</groupId>
<artifactId>grpc-stub</artifactId>
</exclusion>
<exclusion>
<groupId>io.grpc</groupId>
<artifactId>grpc-protobuf</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-stub</artifactId>
<version>1.0.1</version>
</dependency>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-protobuf</artifactId>
<version>1.0.1</version>
</dependency>
</dependencies>
</profile>
<profile>
<id>postgres</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.openjpa</groupId>
<artifactId>openjpa-maven-plugin</artifactId>
<version>${openjpa.version}</version>
<configuration>
<includes>**/dao/*.class</includes>
<addDefaultConstructor>true</addDefaultConstructor>
<enforcePropertyRestrictions>true</enforcePropertyRestrictions>
</configuration>
<executions>
<execution>
<id>enhancer</id>
<phase>process-classes</phase>
<goals>
<goal>enhance</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.apache.openjpa</groupId>
<artifactId>openjpa</artifactId>
<!-- set the version to be the same as the
level in your runtime -->
<version>${openjpa.version}</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<mainClass>${start-class}</mainClass>
</configuration>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>${maven.compiler.source}</source>
<target>${maven.compiler.target}</target>
<excludes>
<exclude>com/ge/predix/acs/audit/*</exclude>
</excludes>
<testExcludes>
<testExclude>com/ge/predix/acs/audit/*</testExclude>
</testExcludes>
</configuration>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<environmentVariables>
<SPRING_PROFILES_ACTIVE>h2,public,simple-cache</SPRING_PROFILES_ACTIVE>
<reportsDirectory>${project.build.directory}/surefire-reports-postgres</reportsDirectory>
</environmentVariables>
<!-- us32088: Place test reports outside of target directory so reports are not removed by 'mvn clean'
and retained by Jenkins for each profile -->
<reportsDirectory>${basedir}/surefire-reports-postgres</reportsDirectory>
<reportsDirectory>${basedir}/surefire-reports</reportsDirectory>
<suiteXmlFiles>
<suiteXmlFile>src/test/resources/unit-tests.xml</suiteXmlFile>
</suiteXmlFiles>
</configuration>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
Expand All @@ -727,18 +613,10 @@
</environmentVariables>
<!-- us32088: Place test reports outside of target directory so reports are not removed by 'mvn clean'
and retained by Jenkins for each profile -->
<reportsDirectory>${basedir}/surefire-reports-postgres/controller-tests</reportsDirectory>
<summaryFile>${basedir}/surefire-reports-postgres/controller-tests/failsafe-summary.xml</summaryFile>
<systemProperties>
<ZAC_URL>${ZAC_URL}</ZAC_URL>
<ACS_SERVICE_ID>predix-acs</ACS_SERVICE_ID>
<ACS_DEFAULT_ISSUER_ID>http://acs.localhost:${UAA_LOCAL_PORT}/uaa</ACS_DEFAULT_ISSUER_ID>
<ZAC_UAA_URL>${ZAC_UAA_URL}</ZAC_UAA_URL>
<ZAC_CLIENT_ID>fake-client</ZAC_CLIENT_ID>
<ZAC_CLIENT_SECRET>fake-client</ZAC_CLIENT_SECRET>
</systemProperties>
<reportsDirectory>${basedir}/surefire-reports/controller-tests</reportsDirectory>
<summaryFile>${basedir}/surefire-reports/controller-tests/failsafe-summary.xml</summaryFile>
<excludes>
<!-- Exclude graph database specific test for postgres profile -->
<!-- Exclude graph database specific test for public profile -->
<exclude>**/PolicyEvalWithGraphDbControllerIT.java</exclude>
<exclude>**/Hierarchical*IT.java</exclude>
</excludes>
Expand All @@ -759,43 +637,70 @@
</executions>
</plugin>
</plugins>
<pluginManagement>
<plugins>
<!--This plugin's configuration is used to store
Eclipse m2e settings only. It has no influence on the Maven build itself. -->
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>
org.apache.openjpa
</groupId>
<artifactId>
openjpa-maven-plugin
</artifactId>
<versionRange>
[2.3.0,)
</versionRange>
<goals>
<goal>enhance</goal>
</goals>
</pluginExecutionFilter>
<action>
<ignore/>
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
</profile>

<profile>
<id>public-titan</id>
<build>
<plugins>
<!-- TODO: Once we isolate predix related files (including audit) into predix branch, -->
<!-- compiler plugin configuration that explicitly excludes audit files could be removed -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>${maven.compiler.source}</source>
<target>${maven.compiler.target}</target>
<excludes>
<exclude>com/ge/predix/acs/audit/*</exclude>
</excludes>
<testExcludes>
<testExclude>com/ge/predix/acs/audit/*</testExclude>
</testExcludes>
</configuration>
</plugin>
</plugins>
</build>
</profile>

<profile>
<id>predix-titan</id>
<dependencies>
<dependency>
<groupId>com.ge.predix.audit</groupId>
<artifactId>audit-sdk</artifactId>
<version>${audit-sdk.version}</version>
<exclusions>
<exclusion>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
</exclusion>
<exclusion>
<groupId>io.netty</groupId>
<artifactId>netty-tcnative-boringssl-static</artifactId>
</exclusion>
<exclusion>
<groupId>io.grpc</groupId>
<artifactId>grpc-stub</artifactId>
</exclusion>
<exclusion>
<groupId>io.grpc</groupId>
<artifactId>grpc-protobuf</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-stub</artifactId>
<version>1.0.1</version>
</dependency>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-protobuf</artifactId>
<version>1.0.1</version>
</dependency>
</dependencies>
</profile>
</profiles>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,11 @@

public class ConfigureEnvironment {
static {
setPropertyIfNotExist("UAA_LOCAL_PORT", "8080");
setPropertyIfNotExist("ACS_DEFAULT_ISSUER_ID",
"http://acs.localhost:" + System.getenv("UAA_LOCAL_PORT") + "/uaa");
setPropertyIfNotExist("ACS_SERVICE_ID", "predix-acs");
setPropertyIfNotExist("ACS_UAA_URL", "http://localhost:" + System.getenv("UAA_LOCAL_PORT") + "/uaa");
setPropertyIfNotExist("ZAC_UAA_URL", "http://localhost:" + System.getenv("UAA_LOCAL_PORT") + "/uaa");
setPropertyIfNotExist("ZAC_URL", "http://localhost:" + System.getenv("ZAC_LOCAL_PORT"));
setPropertyIfNotExist("ZAC_CLIENT_ID", "fake-client");
setPropertyIfNotExist("ZAC_CLIENT_SECRET", "fake-client");
}

private static void setPropertyIfNotExist(final String name, final String value) {
Expand Down