Skip to content

Commit

Permalink
Enabled some of GF Embedded Maven plugin tests
Browse files Browse the repository at this point in the history
Until websocket tests, which I only tried to refactor.
Signed-off-by:Ondro Mihalyi <mihalyi@omnifish.ee>
  • Loading branch information
OndroMih committed Sep 4, 2023
1 parent 8ba97b5 commit d05a4e5
Show file tree
Hide file tree
Showing 29 changed files with 119 additions and 691 deletions.
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2023 Contributors to the Eclipse Foundation.
Copyright (c) 1997, 2021 Oracle and/or its affiliates. All rights reserved.
This program and the accompanying materials are made available under the
Expand Down Expand Up @@ -38,7 +39,7 @@
<executions>
<execution>
<id>start</id>
<phase>integration-test</phase>
<phase>pre-integration-test</phase>
<goals>
<goal>start</goal>
<goal>deploy</goal>
Expand Down
Expand Up @@ -21,12 +21,8 @@
import org.junit.Test;

import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.Socket;
import java.net.URL;
import java.net.URLConnection;

Expand Down
3 changes: 2 additions & 1 deletion appserver/tests/embedded/maven-plugin/dirListing/pom.xml
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2023 Contributors to the Eclipse Foundation.
Copyright (c) 1997, 2021 Oracle and/or its affiliates. All rights reserved.
This program and the accompanying materials are made available under the
Expand Down Expand Up @@ -46,7 +47,7 @@
<executions>
<execution>
<id>start</id>
<phase>integration-test</phase>
<phase>pre-integration-test</phase>
<goals>
<goal>start</goal>
<goal>deploy</goal>
Expand Down
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2023 Contributors to the Eclipse Foundation.
Copyright (c) 1997, 2021 Oracle and/or its affiliates. All rights reserved.
This program and the accompanying materials are made available under the
Expand Down Expand Up @@ -38,7 +39,7 @@
<executions>
<execution>
<id>start</id>
<phase>integration-test</phase>
<phase>pre-integration-test</phase>
<goals>
<goal>start</goal>
<goal>deploy</goal>
Expand Down
Expand Up @@ -14,19 +14,15 @@
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
*/

package org.glassfish.tests.sessionDestroyed;
package org.glassfish.tests.filterURIMapping;

import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Test;

import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.Socket;
import java.net.URL;
import java.net.URLConnection;

Expand Down
3 changes: 2 additions & 1 deletion appserver/tests/embedded/maven-plugin/getRequestURI/pom.xml
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2023 Contributors to the Eclipse Foundation.
Copyright (c) 1997, 2021 Oracle and/or its affiliates. All rights reserved.
This program and the accompanying materials are made available under the
Expand Down Expand Up @@ -38,7 +39,7 @@
<executions>
<execution>
<id>start</id>
<phase>integration-test</phase>
<phase>pre-integration-test</phase>
<goals>
<goal>start</goal>
<goal>deploy</goal>
Expand Down
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2023 Contributors to the Eclipse Foundation.
Copyright (c) 1997, 2021 Oracle and/or its affiliates. All rights reserved.
This program and the accompanying materials are made available under the
Expand Down Expand Up @@ -38,7 +39,7 @@
<executions>
<execution>
<id>start</id>
<phase>integration-test</phase>
<phase>pre-integration-test</phase>
<goals>
<goal>start</goal>
<goal>deploy</goal>
Expand Down
Expand Up @@ -25,6 +25,7 @@
import java.net.URL;
import java.net.URLConnection;
import java.net.HttpURLConnection;
import org.hamcrest.CoreMatchers;

public class WebTest {

Expand All @@ -46,7 +47,7 @@ public void testWeb() throws Exception {
out.writeByte(1);
int responseCode= urlConnection.getResponseCode();
System.out.println("responseCode: " + responseCode);
Assert.assertTrue(urlConnection.getResponseCode()==404);
Assert.assertThat(urlConnection.getResponseCode(), CoreMatchers.is(404));
}
}

Expand Down
91 changes: 19 additions & 72 deletions appserver/tests/embedded/maven-plugin/pom.xml
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2023 Contributors to the Eclipse Foundation.
Copyright (c) 2010, 2021 Oracle and/or its affiliates. All rights reserved.
This program and the accompanying materials are made available under the
Expand All @@ -21,9 +22,14 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.glassfish.tests</groupId>
<artifactId>embedded</artifactId>
<version>7.0.9-SNAPSHOT</version>
</parent>

<groupId>org.glassfish.tests.embedded</groupId>
<artifactId>maven-plugin</artifactId>
<version>7.0.9-SNAPSHOT</version>
<packaging>pom</packaging>
<name>GlassFish Embedded Maven Plugin Tests</name>

Expand Down Expand Up @@ -124,46 +130,26 @@
<plugins>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.12</version>
<configuration>
<skip>true</skip>
<forkCount>0</forkCount>
</configuration>
<executions>
<execution>
<phase>integration-test</phase>
<goals>
<goal>test</goal>
</goals>
<configuration>
<skip>false</skip>
<forkCount>0</forkCount>
<additionalClasspathElements>
<additionalClasspathElement>target/classes</additionalClasspathElement>
</additionalClasspathElements>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.5.1</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>2.3</version>
<artifactId>maven-failsafe-plugin</artifactId>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
<forkCount>1</forkCount>
<additionalClasspathElements>
<additionalClasspathElement>target/classes</additionalClasspathElement>
</additionalClasspathElements>
<includes>
<include>**/*Test.java</include>
</includes>
</configuration>
</plugin>
<plugin>
<groupId>org.glassfish.embedded</groupId>
<artifactId>maven-embedded-glassfish-plugin</artifactId>
<version>5.0</version>
<version>5.1</version>
<configuration>
<goalPrefix>glassfish</goalPrefix>
<app>target/${project.artifactId}.war</app>
Expand All @@ -174,6 +160,9 @@
<ports>
<https-listener>8181</https-listener>
</ports>
<systemProperties>
<property>com.sun.enterprise.naming.allowJndiLookupFromOSGi=false</property>
</systemProperties>
</configuration>
<dependencies>
<dependency>
Expand All @@ -199,53 +188,11 @@
<artifactId>maven-plugin-api</artifactId>
<version>3.3.9</version>
</dependency>
<dependency>
<groupId>jakarta.servlet</groupId>
<artifactId>jakarta.servlet-api</artifactId>
<version>4.0.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.2</version>
</dependency>
<dependency>
<groupId>jakarta.faces</groupId>
<artifactId>jakarta.faces-api</artifactId>
<version>2.3.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>jakarta.ejb</groupId>
<artifactId>jakarta.ejb-api</artifactId>
<version>3.2.5</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.glassfish.main.extras</groupId>
<artifactId>glassfish-embedded-all</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.glassfish.grizzly</groupId>
<artifactId>grizzly-websockets</artifactId>
<version>2.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.glassfish.grizzly</groupId>
<artifactId>grizzly-http-servlet</artifactId>
<version>2.4.3</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>jakarta.jms</groupId>
<artifactId>jakarta.jms-api</artifactId>
<scope>provided</scope>
<version>3.0.0-RC1</version>
</dependency>
</dependencies>
</dependencyManagement>
</project>
60 changes: 0 additions & 60 deletions appserver/tests/embedded/maven-plugin/scattered/pom.xml

This file was deleted.

This file was deleted.

0 comments on commit d05a4e5

Please sign in to comment.