diff --git a/src/test/groovy/io/openliberty/tools/gradle/InstallFeature_localEsa_Test.groovy b/src/test/groovy/io/openliberty/tools/gradle/InstallFeature_localEsa_Test.groovy new file mode 100644 index 00000000..b8b91d44 --- /dev/null +++ b/src/test/groovy/io/openliberty/tools/gradle/InstallFeature_localEsa_Test.groovy @@ -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) + } + } + + + +} diff --git a/src/test/resources/local-esa-test/build.gradle b/src/test/resources/local-esa-test/build.gradle new file mode 100644 index 00000000..f50deee2 --- /dev/null +++ b/src/test/resources/local-esa-test/build.gradle @@ -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'] + } + } +} diff --git a/src/test/resources/local-esa-test/json-1.0-23.0.0.10.esa b/src/test/resources/local-esa-test/json-1.0-23.0.0.10.esa new file mode 100644 index 00000000..936d5827 Binary files /dev/null and b/src/test/resources/local-esa-test/json-1.0-23.0.0.10.esa differ diff --git a/src/test/resources/local-esa-test/json-1.0-23.0.0.10.esa.asc b/src/test/resources/local-esa-test/json-1.0-23.0.0.10.esa.asc new file mode 100644 index 00000000..07377e14 --- /dev/null +++ b/src/test/resources/local-esa-test/json-1.0-23.0.0.10.esa.asc @@ -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----- diff --git a/src/test/resources/local-esa-test/settings.gradle b/src/test/resources/local-esa-test/settings.gradle new file mode 100644 index 00000000..c2d3edc1 --- /dev/null +++ b/src/test/resources/local-esa-test/settings.gradle @@ -0,0 +1 @@ +//Empty \ No newline at end of file