Skip to content

Commit

Permalink
Merge pull request #859 from jjiwooLim/localesa
Browse files Browse the repository at this point in the history
InstallFeature - add local esa install test
  • Loading branch information
cherylking committed Nov 16, 2023
2 parents b772e85 + c343e2b commit bd5ceff
Show file tree
Hide file tree
Showing 5 changed files with 91 additions and 0 deletions.
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

0 comments on commit bd5ceff

Please sign in to comment.