-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1635 from jakartaee/migrate_servlet40_refreshPeri…
…od_to_tck Migrate test/servlet40/refreshPeriod* to tck/faces23
- Loading branch information
Showing
15 changed files
with
408 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
Copyright (c) 1997, 2018 Oracle and/or its affiliates. All rights reserved. | ||
This program and the accompanying materials are made available under the | ||
terms of the Eclipse Public License v. 2.0, which is available at | ||
http://www.eclipse.org/legal/epl-2.0. | ||
This Source Code may also be made available under the following Secondary | ||
Licenses when the conditions for such availability set forth in the | ||
Eclipse Public License v. 2.0 are satisfied: GNU General Public License, | ||
version 2 with the GNU Classpath Exception, which is available at | ||
https://www.gnu.org/software/classpath/license.html. | ||
SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 | ||
--> | ||
|
||
|
||
<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>org.glassfish.mojarra.faces23</groupId> | ||
<artifactId>pom</artifactId> | ||
<version>4.0.0-SNAPSHOT</version> | ||
</parent> | ||
|
||
<artifactId>refreshPeriodExplicit</artifactId> | ||
<packaging>war</packaging> | ||
|
||
<name>Mojarra ${project.version} - Test - Faces 2.3 - refreshPeriodExplicit</name> | ||
|
||
<build> | ||
<finalName>test-faces23-refreshPeriodExplicit</finalName> | ||
</build> | ||
</project> |
53 changes: 53 additions & 0 deletions
53
...cit/src/main/java/ee/jakarta/tck/faces/test/servlet40/refreshperiodexplicit/UserBean.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/* | ||
* Copyright (c) 1997, 2018 Oracle and/or its affiliates. All rights reserved. | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License v. 2.0, which is available at | ||
* http://www.eclipse.org/legal/epl-2.0. | ||
* | ||
* This Source Code may also be made available under the following Secondary | ||
* Licenses when the conditions for such availability set forth in the | ||
* Eclipse Public License v. 2.0 are satisfied: GNU General Public License, | ||
* version 2 with the GNU Classpath Exception, which is available at | ||
* https://www.gnu.org/software/classpath/license.html. | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 | ||
*/ | ||
|
||
package ee.jakarta.tck.faces.test.servlet40.refreshperiodexplicit; | ||
|
||
import java.io.Serializable; | ||
|
||
import com.sun.faces.application.ApplicationAssociate; | ||
|
||
import jakarta.annotation.PostConstruct; | ||
import jakarta.enterprise.context.RequestScoped; | ||
import jakarta.faces.context.ExternalContext; | ||
import jakarta.inject.Inject; | ||
import jakarta.inject.Named; | ||
|
||
@Named | ||
@RequestScoped | ||
public class UserBean implements Serializable { | ||
|
||
protected String firstName; | ||
@Inject | ||
ExternalContext extContext; | ||
|
||
public UserBean() { | ||
} | ||
|
||
@PostConstruct | ||
private void init() { | ||
ApplicationAssociate appAss = ApplicationAssociate.getInstance(extContext); | ||
firstName = "" + appAss.getFaceletFactory().getRefreshPeriod(); | ||
} | ||
|
||
public String getFirstName() { | ||
return firstName; | ||
} | ||
|
||
public void setFirstName(String firstName) { | ||
this.firstName = firstName; | ||
} | ||
} |
Empty file.
Empty file.
39 changes: 39 additions & 0 deletions
39
tck/faces23/refreshPeriodExplicit/src/main/webapp/WEB-INF/web.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
Copyright (c) 1997, 2018 Oracle and/or its affiliates. All rights reserved. | ||
This program and the accompanying materials are made available under the | ||
terms of the Eclipse Public License v. 2.0, which is available at | ||
http://www.eclipse.org/legal/epl-2.0. | ||
This Source Code may also be made available under the following Secondary | ||
Licenses when the conditions for such availability set forth in the | ||
Eclipse Public License v. 2.0 are satisfied: GNU General Public License, | ||
version 2 with the GNU Classpath Exception, which is available at | ||
https://www.gnu.org/software/classpath/license.html. | ||
SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 | ||
--> | ||
|
||
<web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"> | ||
|
||
<context-param> | ||
<param-name>jakarta.faces.FACELETS_REFRESH_PERIOD</param-name> | ||
<param-value>30</param-value> | ||
</context-param> | ||
|
||
<context-param> | ||
<param-name>jakarta.faces.PROJECT_STAGE</param-name> | ||
<param-value>${webapp.projectStage}</param-value> | ||
</context-param> | ||
<context-param> | ||
<param-name>jakarta.faces.PARTIAL_STATE_SAVING</param-name> | ||
<param-value>${webapp.partialStateSaving}</param-value> | ||
</context-param> | ||
<context-param> | ||
<param-name>jakarta.faces.STATE_SAVING_METHOD</param-name> | ||
<param-value>${webapp.stateSavingMethod}</param-value> | ||
</context-param> | ||
</web-app> |
33 changes: 33 additions & 0 deletions
33
tck/faces23/refreshPeriodExplicit/src/main/webapp/index.xhtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<!-- | ||
Copyright (c) 1997, 2018 Oracle and/or its affiliates. All rights reserved. | ||
This program and the accompanying materials are made available under the | ||
terms of the Eclipse Public License v. 2.0, which is available at | ||
http://www.eclipse.org/legal/epl-2.0. | ||
This Source Code may also be made available under the following Secondary | ||
Licenses when the conditions for such availability set forth in the | ||
Eclipse Public License v. 2.0 are satisfied: GNU General Public License, | ||
version 2 with the GNU Classpath Exception, which is available at | ||
https://www.gnu.org/software/classpath/license.html. | ||
SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 | ||
--> | ||
|
||
<!DOCTYPE html> | ||
<html xmlns="http://www.w3.org/1999/xhtml" | ||
xmlns:h="http://java.sun.com/jsf/html"> | ||
<head> | ||
<title></title> | ||
</head> | ||
<body> | ||
<h:form id="form"> | ||
<h:inputText value="#{userBean.firstName}" /> | ||
<h:commandButton value="submit" /> | ||
</h:form> | ||
</body> | ||
</html> | ||
|
41 changes: 41 additions & 0 deletions
41
.../src/test/java/ee/jakarta/tck/faces/test/servlet40/refreshperiodexplicit/Isuse3787IT.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* | ||
* Copyright (c) 1997, 2018 Oracle and/or its affiliates. All rights reserved. | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License v. 2.0, which is available at | ||
* http://www.eclipse.org/legal/epl-2.0. | ||
* | ||
* This Source Code may also be made available under the following Secondary | ||
* Licenses when the conditions for such availability set forth in the | ||
* Eclipse Public License v. 2.0 are satisfied: GNU General Public License, | ||
* version 2 with the GNU Classpath Exception, which is available at | ||
* https://www.gnu.org/software/classpath/license.html. | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 | ||
*/ | ||
|
||
package ee.jakarta.tck.faces.test.servlet40.refreshperiodexplicit; | ||
|
||
import static org.junit.Assert.assertTrue; | ||
|
||
import org.junit.Test; | ||
|
||
import com.gargoylesoftware.htmlunit.html.HtmlPage; | ||
|
||
import ee.jakarta.tck.faces.test.util.arquillian.ITBase; | ||
import jakarta.faces.application.ProjectStage; | ||
import jakarta.faces.application.ViewHandler; | ||
|
||
public class Isuse3787IT extends ITBase { | ||
|
||
/** | ||
* @see ViewHandler#FACELETS_REFRESH_PERIOD_PARAM_NAME | ||
* @see ProjectStage#Development | ||
* @see https://github.com/eclipse-ee4j/mojarra/issues/3791 | ||
*/ | ||
@Test | ||
public void testGetRefreshPeriod() throws Exception { | ||
HtmlPage page = getPage("index.xhtml"); | ||
assertTrue(page.getBody().asNormalizedText().contains("30000")); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
Copyright (c) 1997, 2018 Oracle and/or its affiliates. All rights reserved. | ||
This program and the accompanying materials are made available under the | ||
terms of the Eclipse Public License v. 2.0, which is available at | ||
http://www.eclipse.org/legal/epl-2.0. | ||
This Source Code may also be made available under the following Secondary | ||
Licenses when the conditions for such availability set forth in the | ||
Eclipse Public License v. 2.0 are satisfied: GNU General Public License, | ||
version 2 with the GNU Classpath Exception, which is available at | ||
https://www.gnu.org/software/classpath/license.html. | ||
SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 | ||
--> | ||
|
||
|
||
<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>org.glassfish.mojarra.faces23</groupId> | ||
<artifactId>pom</artifactId> | ||
<version>4.0.0-SNAPSHOT</version> | ||
</parent> | ||
|
||
<artifactId>refreshPeriodProduction</artifactId> | ||
<packaging>war</packaging> | ||
|
||
<name>Mojarra ${project.version} - Test - Faces 2.3 - refreshPeriodProduction</name> | ||
|
||
<build> | ||
<finalName>test-faces23-refreshPeriodProduction</finalName> | ||
</build> | ||
</project> |
55 changes: 55 additions & 0 deletions
55
...n/src/main/java/ee/jakarta/tck/faces/test/servlet40/refrehsperiodproduction/UserBean.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/* | ||
* Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved. | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License v. 2.0, which is available at | ||
* http://www.eclipse.org/legal/epl-2.0. | ||
* | ||
* This Source Code may also be made available under the following Secondary | ||
* Licenses when the conditions for such availability set forth in the | ||
* Eclipse Public License v. 2.0 are satisfied: GNU General Public License, | ||
* version 2 with the GNU Classpath Exception, which is available at | ||
* https://www.gnu.org/software/classpath/license.html. | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 | ||
*/ | ||
|
||
package ee.jakarta.tck.faces.test.servlet40.refrehsperiodproduction; | ||
|
||
import java.io.Serializable; | ||
|
||
import com.sun.faces.application.ApplicationAssociate; | ||
|
||
import jakarta.annotation.PostConstruct; | ||
import jakarta.enterprise.context.RequestScoped; | ||
import jakarta.faces.context.ExternalContext; | ||
import jakarta.inject.Inject; | ||
import jakarta.inject.Named; | ||
|
||
@Named | ||
@RequestScoped | ||
public class UserBean implements Serializable { | ||
|
||
protected String firstName; | ||
@Inject | ||
ExternalContext extContext; | ||
|
||
public UserBean() { | ||
} | ||
|
||
@PostConstruct | ||
private void init() { | ||
ApplicationAssociate appAss = ApplicationAssociate.getInstance(extContext); | ||
firstName = "" + appAss.getFaceletFactory().getRefreshPeriod(); | ||
} | ||
|
||
public String getFirstName() { | ||
return firstName; | ||
} | ||
|
||
public void setFirstName(String firstName) { | ||
this.firstName = firstName; | ||
} | ||
|
||
} | ||
|
Empty file.
Empty file.
35 changes: 35 additions & 0 deletions
35
tck/faces23/refreshPeriodProduction/src/main/webapp/WEB-INF/web.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
Copyright (c) 1997, 2018 Oracle and/or its affiliates. All rights reserved. | ||
This program and the accompanying materials are made available under the | ||
terms of the Eclipse Public License v. 2.0, which is available at | ||
http://www.eclipse.org/legal/epl-2.0. | ||
This Source Code may also be made available under the following Secondary | ||
Licenses when the conditions for such availability set forth in the | ||
Eclipse Public License v. 2.0 are satisfied: GNU General Public License, | ||
version 2 with the GNU Classpath Exception, which is available at | ||
https://www.gnu.org/software/classpath/license.html. | ||
SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 | ||
--> | ||
|
||
<web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"> | ||
|
||
<!-- DO NOT PARAMETERIZE PROJECT_STAGE, the test needs it to be production --> | ||
<context-param> | ||
<param-name>jakarta.faces.PROJECT_STAGE</param-name> | ||
<param-value>Production</param-value> | ||
</context-param> | ||
<context-param> | ||
<param-name>jakarta.faces.PARTIAL_STATE_SAVING</param-name> | ||
<param-value>${webapp.partialStateSaving}</param-value> | ||
</context-param> | ||
<context-param> | ||
<param-name>jakarta.faces.STATE_SAVING_METHOD</param-name> | ||
<param-value>${webapp.stateSavingMethod}</param-value> | ||
</context-param> | ||
</web-app> |
33 changes: 33 additions & 0 deletions
33
tck/faces23/refreshPeriodProduction/src/main/webapp/index.xhtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<!-- | ||
Copyright (c) 1997, 2018 Oracle and/or its affiliates. All rights reserved. | ||
This program and the accompanying materials are made available under the | ||
terms of the Eclipse Public License v. 2.0, which is available at | ||
http://www.eclipse.org/legal/epl-2.0. | ||
This Source Code may also be made available under the following Secondary | ||
Licenses when the conditions for such availability set forth in the | ||
Eclipse Public License v. 2.0 are satisfied: GNU General Public License, | ||
version 2 with the GNU Classpath Exception, which is available at | ||
https://www.gnu.org/software/classpath/license.html. | ||
SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 | ||
--> | ||
|
||
<!DOCTYPE html> | ||
<html xmlns="http://www.w3.org/1999/xhtml" | ||
xmlns:h="http://java.sun.com/jsf/html"> | ||
<head> | ||
<title></title> | ||
</head> | ||
<body> | ||
<h:form id="form"> | ||
<h:inputText value="#{userBean.firstName}" /> | ||
<h:commandButton value="submit" /> | ||
</h:form> | ||
</body> | ||
</html> | ||
|
Oops, something went wrong.