Skip to content

Commit

Permalink
adding more tests based on review comments
Browse files Browse the repository at this point in the history
Signed-off-by: Arun Venmany <[email protected]>
  • Loading branch information
arunvenmany-ibm committed Nov 18, 2024
1 parent 136301d commit 4ffafea
Show file tree
Hide file tree
Showing 6 changed files with 156 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
invoker.buildResult = failure
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
<?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>tests</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>

<artifactId>springboot-3-deploy-multiple-springboot-application-nodes-fail-it</artifactId>
<packaging>jar</packaging>

<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.1</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.14.0</version>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<!-- Test support for classifier configuration parameter -->
<configuration>
<classifier>exec</classifier>
</configuration>
</plugin>
<plugin>
<groupId>io.openliberty.tools</groupId>
<artifactId>liberty-maven-plugin</artifactId>
<version>@pom.version@</version>
<configuration>
<assemblyArtifact>
<groupId>${runtimeGroupId}</groupId>
<artifactId>${runtimeKernelId}</artifactId>
<version>${runtimeVersion}</version>
<type>zip</type>
</assemblyArtifact>
<serverName>test</serverName>
<serverXmlFile>src/test/resources/server.xml</serverXmlFile>
</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>install-feature</id>
<phase>pre-integration-test</phase>
<goals>
<goal>install-feature</goal>
</goals>
<configuration>
<features>
<acceptLicense>true</acceptLicense>
</features>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>3.1.2</version>
<configuration>
<workingDirectory>${project.build.directory}</workingDirectory>
<argLine>-enableassertions</argLine>
</configuration>
<executions>
<execution>
<id>integration-test</id>
<goals>
<goal>integration-test</goal>
</goals>
</execution>
<execution>
<id>verify</id>
<phase>verify</phase>
<goals>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.1.2</version>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<server description="default server">
<featureManager>
<feature>appSecurityClient-1.0</feature>
<feature>jaxws</feature>
<platform>badname</platform>
</featureManager>
</server>
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ public void testThinApplicationExistsInAppsDirectory() throws Exception {

File f = new File("target/liberty/wlp/usr/servers/test/apps/thin-springboot-3-appsdirectory-apps-it-1.0.0.Final-exec.jar");
assertTrue(f.getCanonicalFile() + " doesn't exist. Plugin failed to place the file at right destination.", f.exists());
File f2 = new File("target/liberty/wlp/usr/servers/test/configDropins/defaults");
assertTrue(f2.getCanonicalFile() + " folder doesn't exist. Plugin failed to create the config dropins folder ", f2.exists());
assertTrue(f2.getCanonicalFile() + " folder doesn't contain any files. Plugin failed to place config xml at right destination.", f2.list().length == 1);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,20 @@
<version>3.1.2</version>
<configuration>
<runOrder>alphabetical</runOrder>
<redirectTestOutputToFile>true</redirectTestOutputToFile>
<forkCount>1</forkCount>
<reuseForks>true</reuseForks>
<forkedProcessTimeoutInSeconds>2400</forkedProcessTimeoutInSeconds>
<argLine>-enableassertions</argLine>
<workingDirectory>${project.build.directory}</workingDirectory>
<includes>
<include>**/*IT.java</include>
</includes>
<systemPropertyVariables>
<mavenPluginVersion>@pom.version@</mavenPluginVersion>
<runtimeVersion>${runtimeVersion}</runtimeVersion>
</systemPropertyVariables>
<trimStackTrace>false</trimStackTrace>
</configuration>
<executions>
<execution>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ switch (testname) {
case "kernel-install-versionless-feature-fail-no-platform-it":
expectedMessage = "CWWKF1516E: The platform could not be determined. The following versionless features cannot be installed: [servlet]";
break;
case "springboot-3-deploy-multiple-springboot-application-nodes-fail-it":
expectedMessage = "Found multiple springBootApplication elements specified in the server configuration. Only one springBootApplication can be configured per Liberty server.";
break;
default:
return false;
}
Expand Down

0 comments on commit 4ffafea

Please sign in to comment.