Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

InstallFeature - add local esa install test #859

Merged
merged 1 commit into from
Nov 16, 2023
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
package io.openliberty.tools.gradle

import static org.junit.Assert.*

import org.junit.BeforeClass
import org.junit.After
import org.junit.AfterClass
import org.junit.FixMethodOrder
import org.junit.Test
import org.junit.runners.MethodSorters
import io.openliberty.tools.common.plugins.util.PluginExecutionException
import org.gradle.testkit.runner.BuildResult

class InstallFeature_localEsa_Test extends AbstractIntegrationTest{
static File resourceDir = new File("build/resources/test/local-esa-test")
static File buildDir = new File(integTestDir, "/LocalEsaTest")
static File jsonPath = new File(buildDir, "io/openliberty/features/json-1.0/23.0.0.10/json-1.0-23.0.0.10.esa")
def featureFile = new File(buildDir, "build/wlp/lib/features/com.ibm.websphere.appserver.json-1.0.mf")


@BeforeClass
public static void setup() {
createTestProject(buildDir, resourceDir, "build.gradle")
}

@Test
public void test_localEsa() {
try {
def jsonFile = new File(buildDir, "build/wlp/lib/features/com.ibm.websphere.appserver.json-1.0.mf")
def jspFile = new File(buildDir, "build/wlp/lib/features/com.ibm.websphere.appserver.jsp-2.3.mf")
runTasks(buildDir, 'installFeature')

assert jsonFile.exists() : "json-1.0 cannot be generated"
assert jspFile.exists() : "jsp-2.3 cannot be generated"

} catch (Exception e) {
throw new AssertionError ("test should pass", e)
}
}



}
30 changes: 30 additions & 0 deletions src/test/resources/local-esa-test/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
apply plugin: 'liberty'

buildscript {
repositories{
mavenLocal()
mavenCentral()
maven {
name = 'Sonatype Nexus Snapshots'
url = 'https://oss.sonatype.org/content/repositories/snapshots/'
}
}
dependencies {
classpath "io.openliberty.tools:liberty-gradle-plugin:$lgpVersion"
}
}

repositories {
mavenLocal()
mavenCentral()
}

def featureName = new File(project.projectDir, '/json-1.0-23.0.0.10.esa').toString()
liberty {
runtime = ['group': 'io.openliberty','name':'openliberty-kernel','version':runtimeVersion]
server {
features {
name = [featureName, 'jsp-2.3']
}
}
}
Binary file not shown.
17 changes: 17 additions & 0 deletions src/test/resources/local-esa-test/json-1.0-23.0.0.10.esa.asc
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
-----BEGIN PGP SIGNATURE-----
Version: BCPG v1.64

iQIzBAABCAAdFiEE5w5dbD8eRSyw9n3xvZ/Vvp5oygAFAmUpahEACgkQvZ/Vvp5o
ygCtDBAAxCeMDz+Xm5cStFEhkBsSX9AvVgwepQL2wGiUFSrk8deUZEeXBFFFwjVL
Wx/cR+cwaDrSegJnsMHyhSL/yO2OgRPemsqfU356mQjMw1rAczSLdzKmKj4dROPb
TP/4SRGCgPDnxU6ed2SSl9WBXkReLystEvswlEIgxUhFYanIU6RZzEjwZG7Iz3hz
bGBM1Nk/ZRuo/HfGA5iPmRlufzf2XKV31qrsVNyasjeW+jVlHT+WenihQHSoJeAL
xd/605he4oP9bwS2kr/6jub7RQjHwL5UVMQJX+eZvV+qr8cO9+8Z1hpZOaGogCES
H/Ly5iFrH/Z1Gv4q8v9I4wHBnZlv5HBOeDtC8E6VxGmknW4rpTEGiv0pvON/f7TT
X2eKNSIv+rUC4wPKr4UfoXa6qj5duvutDhfBFVtH6BIVSdcA3nLPsKn0FS4Ztk6F
JvgzA0aKqnkOaxfNPPg4kgV69WVhEYw+jk7XmxCoU2xzgaTX4ezQKrSOwF0tQ4sZ
ca5HpF+2gkOwn3pEzeF7UDlAQbcWxXCi2fLyPRBhbBEJwrdJkwzLiCmNrpMOc8jf
VJK3vAdqMwUOnGCoKNLYkegHM3YLFUNAqZhgYTu3I9ZXunlBIf4gNd8qTmEXyMYZ
eAkXG+p7uY6tYB4F2pTDmUS0KFwxECiRjpdlbrJeZGbSzrR+ZBI=
=MrkF
-----END PGP SIGNATURE-----
1 change: 1 addition & 0 deletions src/test/resources/local-esa-test/settings.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
//Empty
Loading