forked from vmware-archive/admiral
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Addressing comments from code review.
* Removing tabs and whitespaces. * Adding a readme for generating the mock server keystore. * Refactoring AdmiralClient a bit. Change-Id: I6f7a6d75cdd0dbb1d9c434283d8c2b0e5ff4e61d Reviewed-on: https://bellevue-ci.eng.vmware.com:8080/42309 PG-Verified: jenkins <[email protected]> Bellevue-Verified: jenkins <[email protected]> Closures-Verified: jenkins <[email protected]> Upgrade-Verified: jenkins <[email protected]> CS-Verified: jenkins <[email protected]> Reviewed-by: Sergio Sanchez <[email protected]>
- Loading branch information
1 parent
0e9bc29
commit 1a1ee50
Showing
4 changed files
with
147 additions
and
167 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,125 +1,125 @@ | ||
<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/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<parent> | ||
<groupId>com.vmware.admiral</groupId> | ||
<artifactId>admiral</artifactId> | ||
<version>1.4.2-SNAPSHOT</version> | ||
</parent> | ||
<parent> | ||
<groupId>com.vmware.admiral</groupId> | ||
<artifactId>admiral</artifactId> | ||
<version>1.4.2-SNAPSHOT</version> | ||
</parent> | ||
|
||
<artifactId>admiral-usecase-tests</artifactId> | ||
<artifactId>admiral-usecase-tests</artifactId> | ||
|
||
<properties> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
<maven.compiler.source>1.8</maven.compiler.source> | ||
<maven.compiler.target>1.8</maven.compiler.target> | ||
<properties> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
<maven.compiler.source>1.8</maven.compiler.source> | ||
<maven.compiler.target>1.8</maven.compiler.target> | ||
|
||
<!-- Used for passing the admiral uber jar to the unit tests --> | ||
<admiral.uber.jar.local.path>${project.build.directory}/bin</admiral.uber.jar.local.path> | ||
<admiral.uber.jar.name>admiral-uber-jar-with-agent.jar</admiral.uber.jar.name> | ||
</properties> | ||
<!-- Used for passing the admiral uber jar to the unit tests --> | ||
<admiral.uber.jar.local.path>${project.build.directory}/bin</admiral.uber.jar.local.path> | ||
<admiral.uber.jar.name>admiral-uber-jar-with-agent.jar</admiral.uber.jar.name> | ||
</properties> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>org.eclipse.jetty</groupId> | ||
<artifactId>jetty-server</artifactId> | ||
<version>9.4.11.v20180605</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.google.code.gson</groupId> | ||
<artifactId>gson</artifactId> | ||
<version>2.8.5</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.apache.httpcomponents</groupId> | ||
<artifactId>fluent-hc</artifactId> | ||
<version>4.5.6</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.apache.commons</groupId> | ||
<artifactId>commons-exec</artifactId> | ||
<version>1.3</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.apache.commons</groupId> | ||
<artifactId>commons-lang3</artifactId> | ||
<version>3.7</version> | ||
</dependency> | ||
<dependencies> | ||
<dependency> | ||
<groupId>org.eclipse.jetty</groupId> | ||
<artifactId>jetty-server</artifactId> | ||
<version>9.4.11.v20180605</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.google.code.gson</groupId> | ||
<artifactId>gson</artifactId> | ||
<version>2.8.5</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.apache.httpcomponents</groupId> | ||
<artifactId>fluent-hc</artifactId> | ||
<version>4.5.6</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.apache.commons</groupId> | ||
<artifactId>commons-exec</artifactId> | ||
<version>1.3</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.apache.commons</groupId> | ||
<artifactId>commons-lang3</artifactId> | ||
<version>3.7</version> | ||
</dependency> | ||
|
||
<!-- Test --> | ||
<dependency> | ||
<groupId>junit</groupId> | ||
<artifactId>junit</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.hamcrest</groupId> | ||
<artifactId>java-hamcrest</artifactId> | ||
<version>2.0.0.0</version> | ||
<scope>test</scope> | ||
</dependency> | ||
<!-- Test --> | ||
<dependency> | ||
<groupId>junit</groupId> | ||
<artifactId>junit</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.hamcrest</groupId> | ||
<artifactId>java-hamcrest</artifactId> | ||
<version>2.0.0.0</version> | ||
<scope>test</scope> | ||
</dependency> | ||
|
||
<!-- Needed for running Admiral instances --> | ||
<dependency> | ||
<groupId>${project.groupId}</groupId> | ||
<artifactId>admiral-host</artifactId> | ||
<version>${project.version}</version> | ||
<classifier>uber-jar-with-agent</classifier> | ||
<scope>test</scope> | ||
</dependency> | ||
<!-- Needed for running Admiral instances --> | ||
<dependency> | ||
<groupId>${project.groupId}</groupId> | ||
<artifactId>admiral-host</artifactId> | ||
<version>${project.version}</version> | ||
<classifier>uber-jar-with-agent</classifier> | ||
<scope>test</scope> | ||
</dependency> | ||
|
||
</dependencies> | ||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
<build> | ||
<plugins> | ||
|
||
<!-- | ||
Copy the Admiral jar to a local directory. | ||
This in theory should also be possible with e.g. | ||
${maven.dependency.com.vmware.admiral.admiral-host.uber-jar-with-agent.jar.path}, | ||
but it seems the property is not resolved in the surefire plugin. | ||
--> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-dependency-plugin</artifactId> | ||
<version>3.1.1</version> | ||
<executions> | ||
<execution> | ||
<id>copy</id> | ||
<phase>generate-test-resources</phase> | ||
<goals> | ||
<goal>copy</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
<configuration> | ||
<artifactItems> | ||
<artifactItem> | ||
<groupId>${project.groupId}</groupId> | ||
<artifactId>admiral-host</artifactId> | ||
<classifier>uber-jar-with-agent</classifier> | ||
<overWrite>false</overWrite> | ||
<outputDirectory>${admiral.uber.jar.local.path}</outputDirectory> | ||
<destFileName>${admiral.uber.jar.name}</destFileName> | ||
</artifactItem> | ||
</artifactItems> | ||
</configuration> | ||
</plugin> | ||
<!-- | ||
Copy the Admiral jar to a local directory. | ||
This in theory should also be possible with e.g. | ||
${maven.dependency.com.vmware.admiral.admiral-host.uber-jar-with-agent.jar.path}, | ||
but it seems the property is not resolved in the surefire plugin. | ||
--> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-dependency-plugin</artifactId> | ||
<version>3.1.1</version> | ||
<executions> | ||
<execution> | ||
<id>copy</id> | ||
<phase>generate-test-resources</phase> | ||
<goals> | ||
<goal>copy</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
<configuration> | ||
<artifactItems> | ||
<artifactItem> | ||
<groupId>${project.groupId}</groupId> | ||
<artifactId>admiral-host</artifactId> | ||
<classifier>uber-jar-with-agent</classifier> | ||
<overWrite>true</overWrite> | ||
<outputDirectory>${admiral.uber.jar.local.path}</outputDirectory> | ||
<destFileName>${admiral.uber.jar.name}</destFileName> | ||
</artifactItem> | ||
</artifactItems> | ||
</configuration> | ||
</plugin> | ||
|
||
<!-- Pass the admiral jar to the unit tests --> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-surefire-plugin</artifactId> | ||
<configuration> | ||
<includes> | ||
<include>**/*Suite.java</include> | ||
</includes> | ||
<systemPropertyVariables> | ||
<admiral.jar.file.path>${admiral.uber.jar.local.path}/${admiral.uber.jar.name}</admiral.jar.file.path> | ||
</systemPropertyVariables> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
<!-- Pass the admiral jar to the unit tests --> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-surefire-plugin</artifactId> | ||
<configuration> | ||
<includes> | ||
<include>**/*Suite.java</include> | ||
</includes> | ||
<systemPropertyVariables> | ||
<admiral.jar.file.path>${admiral.uber.jar.local.path}/${admiral.uber.jar.name}</admiral.jar.file.path> | ||
</systemPropertyVariables> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
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 | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Generating SSL keys for the mock server | ||
|
||
Generate key pair. | ||
|
||
``` | ||
openssl genrsa -aes128 -out jetty.key | ||
``` | ||
|
||
Generate certificate from the keys. | ||
|
||
``` | ||
openssl req -new -x509 -newkey rsa:2048 -sha256 -key jetty.key -out jetty.crt | ||
``` | ||
|
||
Create a PKCS12 keystore with the private key and certificate. | ||
|
||
``` | ||
openssl pkcs12 -inkey jetty.key -in jetty.crt -export -out jetty.pkcs12 | ||
``` |
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