-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1233 from jjiwooLim/prepare-feature-test
Prepare feature test
- Loading branch information
Showing
14 changed files
with
760 additions
and
12 deletions.
There are no files selected for viewing
151 changes: 151 additions & 0 deletions
151
liberty-maven-plugin/src/it/kernel-install-feature-test/install-usr-feature-ext-it/pom.xml
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,151 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<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> | ||
|
||
<parent> | ||
<groupId>io.openliberty.tools.it</groupId> | ||
<artifactId>kernel-install-feature-tests</artifactId> | ||
<version>1.0-SNAPSHOT</version> | ||
</parent> | ||
|
||
<artifactId>install-usr-feature-ext-it</artifactId> | ||
<packaging>jar</packaging> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<artifactId>maven-resources-plugin</artifactId> | ||
<version>3.1.0</version> | ||
<executions> | ||
<execution> | ||
<id>copy-resource-one</id> | ||
<phase>process-test-resources</phase> | ||
<goals> | ||
<goal>copy-resources</goal> | ||
</goals> | ||
|
||
<configuration> | ||
<outputDirectory>${user.home}/.m2/repository/test/user/test/features/features-bom/19.0.0.8</outputDirectory> | ||
<resources> | ||
<resource> | ||
<directory>src/test/resources</directory> | ||
<includes> | ||
<include>features-bom-19.0.0.8.pom</include> | ||
</includes> | ||
</resource> | ||
</resources> | ||
</configuration> | ||
</execution> | ||
<execution> | ||
<id>copy-resource-two</id> | ||
<phase>process-test-resources</phase> | ||
<goals> | ||
<goal>copy-resources</goal> | ||
</goals> | ||
|
||
<configuration> | ||
<outputDirectory>${user.home}/.m2/repository/test/user/test/features/testesa1/19.0.0.8</outputDirectory> | ||
<resources> | ||
<resource> | ||
<directory>src/test/resources</directory> | ||
<includes> | ||
<include>testesa1-19.0.0.8.esa</include> | ||
</includes> | ||
</resource> | ||
</resources> | ||
</configuration> | ||
</execution> | ||
<execution> | ||
<id>copy-resource-three</id> | ||
<phase>process-test-resources</phase> | ||
<goals> | ||
<goal>copy-resources</goal> | ||
</goals> | ||
|
||
<configuration> | ||
<outputDirectory>${project.build.directory}/liberty/wlp/etc/extensions</outputDirectory> | ||
<resources> | ||
<resource> | ||
<directory>src/test/resources</directory> | ||
<includes> | ||
<include>testExt.properties</include> | ||
</includes> | ||
</resource> | ||
</resources> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
|
||
<plugin> | ||
<groupId>io.openliberty.tools</groupId> | ||
<artifactId>liberty-maven-plugin</artifactId> | ||
<version>@pom.version@</version> | ||
<configuration> | ||
<assemblyArtifact> | ||
<groupId>${runtimeGroupId}</groupId> | ||
<artifactId>${runtimeKernelId}</artifactId> | ||
<!-- this goal is only available with ol 21.0.0.11 or later --> | ||
<version>21.0.0.11</version> | ||
<type>zip</type> | ||
</assemblyArtifact> | ||
</configuration> | ||
<executions> | ||
<execution> | ||
<id>install-liberty-server</id> | ||
<phase>compile</phase> | ||
<goals> | ||
<goal>install-server</goal> | ||
</goals> | ||
</execution> | ||
<execution> | ||
<id>create-server</id> | ||
<phase>pre-integration-test</phase> | ||
<goals> | ||
<goal>create</goal> | ||
</goals> | ||
</execution> | ||
<execution> | ||
<id>prepare-feature</id> | ||
<phase>prepare-package</phase> | ||
<goals> | ||
<goal>prepare-feature</goal> | ||
</goals> | ||
<configuration> | ||
<features> | ||
<acceptLicense>true</acceptLicense> | ||
<feature>testesa1</feature> | ||
</features> | ||
</configuration> | ||
</execution> | ||
<execution> | ||
<id>install-feature</id> | ||
<phase>prepare-package</phase> | ||
<goals> | ||
<goal>install-feature</goal> | ||
</goals> | ||
<configuration> | ||
<features> | ||
<acceptLicense>true</acceptLicense> | ||
<to>testExt</to> | ||
<feature>testesa1</feature> | ||
</features> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
<dependencyManagement> | ||
<dependencies> | ||
<dependency> | ||
<groupId>test.user.test.features</groupId> | ||
<artifactId>features-bom</artifactId> | ||
<version>19.0.0.8</version> | ||
<type>pom</type> | ||
</dependency> | ||
</dependencies> | ||
</dependencyManagement> | ||
</project> |
72 changes: 72 additions & 0 deletions
72
...ature-ext-it/src/test/java/net/wasdev/wlp/test/feature/it/InstallUsrFeatureToExtTest.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 | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
/******************************************************************************* | ||
* (c) Copyright IBM Corporation 2021. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*******************************************************************************/ | ||
package net.wasdev.wlp.test.feature.it; | ||
|
||
import static junit.framework.Assert.*; | ||
import org.junit.Test; | ||
import org.junit.AfterClass; | ||
import java.io.File; | ||
import java.io.IOException; | ||
import org.apache.commons.io.FileUtils; | ||
import java.io.FilenameFilter; | ||
|
||
public class InstallUsrFeatureToExtTest { | ||
|
||
static File mavenLocalRepo = new File(System.getProperty("user.home")+ "/.m2/repository"); | ||
static File userTestRepo = new File(mavenLocalRepo, "test/user/test/features"); | ||
|
||
public static boolean deleteFolder(final File directory) { | ||
if (directory.isDirectory()) { | ||
File[] files = directory.listFiles(); | ||
if (null != files) { | ||
for (File file : files) { | ||
if (file.isDirectory()) { | ||
deleteFolder(file); | ||
} else { | ||
if (!file.delete()) { | ||
file.deleteOnExit(); | ||
} | ||
} | ||
} | ||
} | ||
} | ||
if(!directory.delete()){ | ||
directory.deleteOnExit(); | ||
return false; | ||
} | ||
return true; | ||
} | ||
|
||
|
||
@Test | ||
public void testUsrFeatureExtInstall() throws Exception { | ||
try { | ||
File featureFile = new File("liberty/wlp/usr/cik/extensions/testExt/lib/features/testesa1.mf"); | ||
|
||
assert featureFile.exists() : "testesa1.mf cannot be generated"; | ||
|
||
} catch (Exception e) { | ||
throw new AssertionError ("Fail to install user feature. "+e); | ||
} | ||
} | ||
|
||
|
||
@AfterClass | ||
public static void cleanUp() { | ||
deleteFolder(userTestRepo); | ||
} | ||
|
||
} |
42 changes: 42 additions & 0 deletions
42
...tall-feature-test/install-usr-feature-ext-it/src/test/resources/features-bom-19.0.0.8.pom
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,42 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<groupId>test.user.test.features</groupId> | ||
<artifactId>features-bom</artifactId> | ||
<version>19.0.0.8</version> | ||
<packaging>pom</packaging> | ||
<name>user features bill of materials</name> | ||
<description>user features bill of materials</description> | ||
<url>https://openliberty.io/</url> | ||
<licenses> | ||
<license> | ||
<name>Eclipse Public License</name> | ||
<url>https://www.eclipse.org/legal/epl-v10.html</url> | ||
<distribution>repo</distribution> | ||
</license> | ||
</licenses> | ||
<developers> | ||
<developer> | ||
<id>ericglau</id> | ||
<name>Eric Lau</name> | ||
<email>ericglau@ca.ibm.com</email> | ||
</developer> | ||
</developers> | ||
<scm> | ||
<connection>scm:git:git@github.com:OpenLiberty/open-liberty.git</connection> | ||
<developerConnection>scm:git:git@github.com:OpenLiberty/open-liberty.git</developerConnection> | ||
<url>git@github.com:OpenLiberty/open-liberty.git</url> | ||
</scm> | ||
<dependencyManagement> | ||
<dependencies> | ||
<dependency> | ||
<groupId>test.user.test.features</groupId> | ||
<artifactId>testesa1</artifactId> | ||
<version>19.0.0.8</version> | ||
<type>esa</type> | ||
<scope>provided</scope> | ||
</dependency> | ||
</dependencies> | ||
</dependencyManagement> | ||
</project> |
2 changes: 2 additions & 0 deletions
2
...nel-install-feature-test/install-usr-feature-ext-it/src/test/resources/testExt.properties
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,2 @@ | ||
com.ibm.websphere.productId=testExt | ||
com.ibm.websphere.productInstall=wlp/usr/cik/extensions/testExt |
Binary file added
BIN
+1.48 KB
...-install-feature-test/install-usr-feature-ext-it/src/test/resources/testesa1-19.0.0.8.esa
Binary file not shown.
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
Oops, something went wrong.