Skip to content

Commit

Permalink
Enabled almost all of GF Embedded Maven plugin tests
Browse files Browse the repository at this point in the history
Only tests which fail and there's no simple fix are disabled.
Signed-off-by:Ondro Mihalyi <mihalyi@omnifish.ee>
  • Loading branch information
OndroMih committed Sep 4, 2023
1 parent d05a4e5 commit 16a7d5c
Show file tree
Hide file tree
Showing 7 changed files with 55 additions and 35 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/*
* Copyright (c) 2023 Contributors to the Eclipse Foundation.
* Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
Expand All @@ -16,13 +17,15 @@

package org.glassfish.tests.embedded.jsftest;

import jakarta.faces.bean.ManagedBean;
import javax.enterprise.context.RequestScoped;
import javax.inject.Named;

/**
* @author bhavanishankar@java.net
*/

@ManagedBean(name = "testbean")
@Named("testbean")
@RequestScoped
public class JSFTestBean {

public TestTable[] getTestTable() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/*
* Copyright (c) 2023 Contributors to the Eclipse Foundation.
* Copyright (c) 2010, 2018 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 @@ protected void doGet(HttpServletRequest httpServletRequest,
System.out.println("TesterServlet invoked");
Result res = JUnitCore.runClasses(LocalEjbTest.class);
if(res.getFailureCount() == 0) {
httpServletResponse.setStatus(200, "All tests passed");
httpServletResponse.setStatus(200);
} else {
httpServletResponse.sendError(500, "One or more tests failed");
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/*
* Copyright (c) 2023 Contributors to the Eclipse Foundation.
* Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
Expand Down Expand Up @@ -33,7 +34,7 @@ public void test() throws Exception {
HttpURLConnection uc = (HttpURLConnection)url.openConnection();
System.out.println("Test status : " + uc.getResponseMessage());
if(uc.getResponseCode() != 200) {
throw new Exception(uc.getResponseMessage());
throw new Exception(uc.getResponseCode() + ": " + uc.getResponseMessage());
}
uc.disconnect();
}
Expand Down
Binary file not shown.
27 changes: 16 additions & 11 deletions appserver/tests/embedded/maven-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,20 @@
<module>index</module>
<module>jmxUndeployEvent</module>
<module>queryString</module>
<!--module>scattered</module-->
<module>sessionDestroyed</module>
<module>standalonewar</module>
<module>websockets</module>
<module>webservice</module>
<!--<module>websockets</module>-->
<!--<module>webservice</module>-->
<module>secureWebApp</module>
<module>jsptest</module>
<module>jsftest</module>
<module>localejbs</module>

<!-- jsftest fails because CDI not available - fixed by adding beans.xml.
Then fails on something else
-->
<!-- <module>jsftest</module>-->

<!-- localejbs only need add-opens=java.base/java.lang=ALL-UNNAMED set in MAVEN_OPTS to pass -->
<!--<module>localejbs</module>-->
<module>multipleApps</module>
</modules>
</profile>
Expand All @@ -82,11 +87,11 @@
<module>queryString</module>
<module>sessionDestroyed</module>
<module>standalonewar</module>
<module>websockets</module>
<module>webservice</module>
<!--<module>websockets</module>-->
<!--<module>webservice</module>-->
<module>secureWebApp</module>
<module>jsptest</module>
<module>jsftest</module>
<!-- <module>jsftest</module>-->
<module>localejbs</module>
<module>multipleApps</module>
</modules>
Expand All @@ -110,11 +115,11 @@
<module>queryString</module>
<module>sessionDestroyed</module>
<module>standalonewar</module>
<module>websockets</module>
<module>webservice</module>
<!--<module>websockets</module>-->
<!--<module>webservice</module>-->
<module>secureWebApp</module>
<module>jsptest</module>
<module>jsftest</module>
<!-- <module>jsftest</module>-->
<module>localejbs</module>
<module>multipleApps</module>
</modules>
Expand Down
5 changes: 5 additions & 0 deletions appserver/tests/embedded/maven-plugin/webservice/pom.xml
Original file line number Diff line number Diff line change
@@ -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 Down Expand Up @@ -71,6 +72,10 @@
<groupId>jakarta.ejb</groupId>
<artifactId>jakarta.ejb-api</artifactId>
</dependency>
<dependency>
<groupId>jakarta.xml.ws</groupId>
<artifactId>jakarta.xml.ws-api</artifactId>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
Expand Down
45 changes: 25 additions & 20 deletions nucleus/parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,13 @@
<hibernate-validator.version>8.0.1.Final</hibernate-validator.version>

<!-- Jakarta Web Services -->
<!--
Jakarta XML Web Services
<jakarta.xml.ws-api.version>4.0.0-RC2</jakarta.xml.ws-api.version>

<!-- Jakarta XML Web Services -->
<jakarta.xml.ws-api.version>4.0.0</jakarta.xml.ws-api.version>

Jakarta SOAP (with Attachments)
<jakarta.xml.soap-api.version>3.0.0-RC2</jakarta.xml.soap-api.version>
-->
<!-- Jakarta SOAP (with Attachments)
<jakarta.xml.soap-api.version>3.0.0-RC2</jakarta.xml.soap-api.version>
-->
<webservices.version>4.0.2</webservices.version>

<!-- Jakarta Inject -->
Expand Down Expand Up @@ -248,6 +248,11 @@
<artifactId>webservices-extra-jdk-packages</artifactId>
<version>${webservices.version}</version>
</dependency>
<dependency>
<groupId>jakarta.xml.ws</groupId>
<artifactId>jakarta.xml.ws-api</artifactId>
<version>${jakarta.xml.ws-api.version}</version>
</dependency>

<!-- Jakarta Inject -->
<dependency>
Expand Down Expand Up @@ -871,8 +876,8 @@
<forkCount>1</forkCount>
<forkNode implementation="org.apache.maven.plugin.surefire.extensions.SurefireForkNodeFactory"/>
<excludes>
<exclude>**/*ITest.java</exclude>
<exclude>**/*IT.java</exclude>
<exclude>**/*ITest.java</exclude>
<exclude>**/*IT.java</exclude>
</excludes>
<systemPropertyVariables>
<java.util.logging.manager>${test.logManager}</java.util.logging.manager>
Expand All @@ -893,8 +898,8 @@
<useSystemClassLoader>true</useSystemClassLoader>
<forkNode implementation="org.apache.maven.plugin.surefire.extensions.SurefireForkNodeFactory"/>
<includes>
<include>**/*ITest.java</include>
<include>**/*IT.java</include>
<include>**/*ITest.java</include>
<include>**/*IT.java</include>
</includes>
<systemPropertyVariables>
<java.util.logging.manager>${test.logManager}</java.util.logging.manager>
Expand Down Expand Up @@ -932,7 +937,7 @@
<logViolationsToConsole>true</logViolationsToConsole>
<excludes>**/generated-sources/**/*, **/module-info.java</excludes>
<!-- build-helper-plugin adds the root as a resource path, but checkstyle overrides the filter and
adds all property files in the tree -->
adds all property files in the tree -->
<resourceExcludes>
**/appserver/**/src/main/resources/**/*,
**/deployment/**/src/main/resources/**/*,
Expand Down Expand Up @@ -1099,13 +1104,13 @@
</goals>
<configuration>
<!--
Exclude several versions that we never want to update to since they are OLDER than
what we currently use.
Exclude several versions that we never want to update to since they are OLDER than
what we currently use.
Note that we actually want to specify the version per artefact, but this is currently
broken.
See https://github.com/mojohaus/versions/issues/258#issuecomment-1438149133
-->
Note that we actually want to specify the version per artefact, but this is currently
broken.
See https://github.com/mojohaus/versions/issues/258#issuecomment-1438149133
-->
<ignoredVersions>3.2-b..,2.5.0-b..,5.0-jdk8-rc.,20030911,10.0-b..</ignoredVersions>
</configuration>
</execution>
Expand Down Expand Up @@ -1278,7 +1283,7 @@
<copy toDir="${project.build.outputDirectory}/META-INF" overwrite="false">
<fileset dir="${basedir}/target" includes="MANIFEST.MF">
<present targetdir="${project.build.outputDirectory}/META-INF"
present="srconly" />
present="srconly" />
</fileset>
</copy>
</target>
Expand Down Expand Up @@ -1318,8 +1323,8 @@
<groupId>org.glassfish.hk2</groupId>
<artifactId>osgiversion-maven-plugin</artifactId>
<!-- Since we don't want qualifier like b05 or SNAPSHOT to appear in package version attribute, we use the
following goal to populate a project property with an OSGi version which is equivalent to maven version without qualifier
and then use that property in osgi.bundle while exporting. -->
following goal to populate a project property with an OSGi version which is equivalent to maven version without qualifier
and then use that property in osgi.bundle while exporting. -->
<configuration>
<dropVersionComponent>qualifier</dropVersionComponent>
<versionPropertyName>project.osgi.version</versionPropertyName>
Expand Down

0 comments on commit 16a7d5c

Please sign in to comment.