Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upstream pull 2024 02 #1468

Closed
wants to merge 58 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
55c3292
put nosto changes on top play master
renat-nosto Feb 7, 2019
ef89ac9
* remove double content on chunk responses in test
renat-nosto Apr 18, 2019
a487d64
Merge remote-tracking branch 'play/master' into put_nosto_changes_on_…
renat-nosto Apr 29, 2019
231073b
sync branch
renat-nosto Apr 29, 2019
19623d0
Merge pull request #32 from Nosto/put_nosto_changes_on_top_play_master
renat-nosto Aug 21, 2019
dfb1738
Escape the localized message parameter values
sergey-moshnikov Aug 21, 2019
7862050
Merge pull request #33 from Nosto/HEALTH-198-localized-messages-xss
sergey-moshnikov Aug 21, 2019
68c88f6
We only apply __safeFaster() to String arguments in __getMessage()
sergey-moshnikov Aug 22, 2019
c3dd3df
Merge pull request #34 from Nosto/HEALTH-198-fix-the-fix
sergey-moshnikov Aug 22, 2019
0ecc779
Initial commit for support SameSite cookie encoding (#36)
mridang Feb 11, 2020
3f196ac
Fix 'ant unittest' by adding missing dependencies and removing tests …
anttip Apr 2, 2020
4f548bb
Fix bug with untruncated milliseconds from File.lastModified preventi…
anttip Apr 2, 2020
13f0030
Added test for the formatter to verify truncation happens in headers
anttip Apr 2, 2020
f3b74a3
Merge pull request #37 from Nosto/bugfix/fix-304-last-modified-compar…
anttip Apr 3, 2020
6e488dc
Add support for adding weak prefix to etags
anttip Apr 3, 2020
8cc27df
Merge pull request #38 from Nosto/improvement/support-weak-etag
anttip Apr 3, 2020
7811070
ADS-2883 Upgrade to Oval 3.0 (#39)
gary-nosto Dec 29, 2020
1586162
ADS-2883 Enable default profile in validation plugin (#40)
gary-nosto Dec 29, 2020
24a169d
Initial commit for a standlone Junit runner
Dec 30, 2020
32bfa00
Added XMLoutputter
Dec 30, 2020
e77edde
Fixed the Junit command
Jan 2, 2021
60dae9b
Added support for test filtering via a plugin
Jan 3, 2021
903e1c7
Reset changes to the autotest runner
Jan 3, 2021
7c2ba1e
ADS-2832 Upgrade to Oval 3.1.0 (#42)
gary-nosto Jan 4, 2021
38214d8
Fixed the NPE when looking up the next test class
Jan 8, 2021
36c09ae
Merge branch 'master' into nosto/standalone-junit-runner
Jan 8, 2021
f2f862b
Fixed the testnames in the XML output
Jan 10, 2021
1ae7a09
Added the log4j-web module and tore down the logger
Jan 27, 2021
18daaa6
Update log4j to version 2.16.0
anttip Dec 15, 2021
780ab9a
Merge pull request #43 from Nosto/fix/update-log4j
anttip Dec 15, 2021
89630b1
Merge branch 'master' into nosto/standalone-junit-runner
mridang Dec 16, 2021
2b37034
Merge pull request #41 from Nosto/nosto/standalone-junit-runner
mridang Dec 16, 2021
6583ab2
Updated the missing log4j-web dependency
Dec 16, 2021
5430edb
Update to log4j 2.17.0
anttip Dec 23, 2021
cf2adc5
Merge pull request #44 from Nosto/fix/update-log4j-2.17.0
anttip Dec 23, 2021
6a67a37
Enabled test suite to run successfully with 'ant test'
anttip Dec 28, 2021
719e757
Merge pull request #45 from Nosto/fix/enable-test-suite
anttip Dec 28, 2021
599e4fd
Update libraries based on security reports
anttip Dec 28, 2021
170a4de
Merge pull request #46 from Nosto/fix/update-libraries
anttip Dec 28, 2021
a06fd5a
Merge remote-tracking branch 'play/master' into play1.7_update-take2
renat-nosto Apr 8, 2022
25da223
fix tests
renat-nosto Apr 11, 2022
d7e83ab
Reset changes to the JPAPlugin
Apr 11, 2022
8463acc
Merge pull request #50 from Nosto/play1.7_update-take2
renat-nosto Apr 11, 2022
ace1920
add bcutil dependency
renat-nosto Jan 11, 2022
f06b73a
Merge pull request #52 from Nosto/fix_bcutils
renat-nosto Apr 14, 2022
400e648
Merge remote-tracking branch 'play/master' into play_1.7.1
renat-nosto Oct 17, 2022
fd4cff0
Merge pull request #54 from Nosto/play_1.7.1
renat-nosto Oct 18, 2022
0b89b7e
report java crash from junit.py
renat-nosto Nov 3, 2022
aa215a1
use ConcurrentHashMap for play.classloading.ApplicationClassloader#as…
renat-nosto Nov 3, 2022
20e7d2e
Merge pull request #57 from Nosto/improvement/use_ConcurrentHashMap_f…
renat-nosto Nov 4, 2022
28a1b71
Merge pull request #56 from Nosto/improvement/report_java_crash_from_…
renat-nosto Nov 7, 2022
42dda25
HEALTH-762 remove mysql from play (#59)
renat-nosto Feb 16, 2023
0905ca3
Fix xmlReportListener for beforeClass annotations
anttip Feb 15, 2024
dd1a604
Merge pull request #61 from Nosto/bugfix/fix-junit-xmllistener-for-be…
anttip Feb 15, 2024
35c3a08
Merge remote-tracking branch 'play/master' into upstream-pull-2024-02
renat-nosto Feb 24, 2024
cd2b066
post-merge cleanup
renat-nosto Feb 27, 2024
152a502
Merge remote-tracking branch 'play/master' into upstream-pull-2024-02
renat-nosto Feb 27, 2024
4c679fe
fix tests.py
renat-nosto Feb 27, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions framework/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -253,10 +253,10 @@
<condition property="playExtension" value="">
<and><os family="unix"/></and>
</condition>
<condition property="pythonExecutable" value="python">
<condition property="pythonExecutable" value="python3">
<and><os family="windows"/></and>
</condition>
<condition property="pythonExecutable" value="python">
<condition property="pythonExecutable" value="python3">
<and><os family="unix"/></and>
</condition>

Expand All @@ -280,30 +280,37 @@
<param name="testAppPath" value="${basedir}/../samples-and-tests/just-test-cases"/>
<param name="play.user.language" value="-Duser.language=en"/>
<param name="play.user.country" value="-Duser.country=US"/>
<param name="play.enhancement" value="-DenableAllEnhancers=true" />
</antcall>

<antcall target="play-test">
<param name="testAppPath" value="${basedir}/../samples-and-tests/forum"/>
<param name="play.enhancement" value="-DenableAllEnhancers=true" />
</antcall>

<antcall target="play-test">
<param name="testAppPath" value="${basedir}/../samples-and-tests/zencontact"/>
<param name="play.enhancement" value="-DenableAllEnhancers=true" />
</antcall>

<antcall target="play-test">
<param name="testAppPath" value="${basedir}/../samples-and-tests/jobboard"/>
<param name="play.enhancement" value="-DenableAllEnhancers=true" />
</antcall>

<antcall target="play-test">
<param name="testAppPath" value="${basedir}/../samples-and-tests/yabe"/>
<param name="play.enhancement" value="-DenableAllEnhancers=true" />
</antcall>

<antcall target="play-test">
<param name="testAppPath" value="${basedir}/../samples-and-tests/nonstatic-app"/>
<param name="play.enhancement" value="-DenableAllEnhancers=true" />
</antcall>

<antcall target="play-test">
<param name="testAppPath" value="${basedir}/../samples-and-tests/fast-tag"/>
<param name="play.enhancement" value="-DenableAllEnhancers=true" />
</antcall>

<antcall target="test-success" />
Expand Down Expand Up @@ -337,6 +344,7 @@
<arg value="${testAppPath}"/>
<arg value="${play.user.language}" if:set="play.user.language"/>
<arg value="${play.user.country}" if:set="play.user.country"/>
<arg value="${play.enhancement}" if:set="play.enhancement"/>
</exec>
<available file="${testAppPath}/test-result/result.passed" property="${testAppPath}testPassed" />
<fail message="Last test has failed ! (Check results in file://${testAppPath}/test-result)">
Expand Down
6 changes: 4 additions & 2 deletions framework/dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@ require: &allDependencies
- net.sf.ehcache -> ehcache 2.10.9.2
- net.sf.ezmorph -> ezmorph 1.0.6
- net.sf.jsr107cache -> jsr107cache 1.1
- net.sf.oval -> oval 1.90
- com.mysql -> mysql-connector-j 8.1.0
- net.sf.oval -> oval 3.1.0
- oauth.signpost -> signpost-core 1.2.1.2
- org.apache.geronimo.specs -> geronimo-servlet_2.5_spec 1.2
- org.apache.ivy -> ivy 2.5.2
- org.bouncycastle -> bcprov-jdk18on 1.76
- org.bouncycastle -> bcpkix-jdk18on 1.76
- org.bouncycastle -> bcutil-jdk18on 1.76
- org.codehaus.groovy -> groovy 3.0.19
- org.codehaus.groovy -> groovy-xml 3.0.19
- org.eclipse.jdt -> org.eclipse.jdt.core 3.33.0
Expand All @@ -63,6 +63,7 @@ require: &allDependencies
- io.smallrye -> jandex 3.1.5
- org.jboss.logging -> jboss-logging 3.5.3.Final
- org.jboss.spec.javax.transaction -> jboss-transaction-api_1.2_spec 1.1.1.Final
- javax.persistence -> javax.persistence-api 2.2
- javax.xml.bind -> jaxb-api 2.3.1
- org.glassfish.jaxb -> jaxb-runtime 2.3.8
- com.fasterxml -> classmate 1.6.0
Expand All @@ -78,6 +79,7 @@ require: &allDependencies
- net.spy -> spymemcached 2.12.3
- com.thoughtworks.xstream -> xstream 1.4.20
- xmlpull 1.1.3.4d_b4_min
- org.apache.logging.log4j -> log4j-web 2.18.0

# Default repositories, used for all projects
repositories:
Expand Down
Binary file added framework/lib/ant-junit-1.10.7.jar
Binary file not shown.
Binary file added framework/lib/bcutil-jdk18on-1.76.jar
Binary file not shown.
Binary file added framework/lib/log4j-web-2.18.0.jar
Binary file not shown.
Binary file removed framework/lib/mysql-connector-j-8.1.0.jar
Binary file not shown.
Binary file removed framework/lib/oval-1.90.jar
Binary file not shown.
Binary file added framework/lib/oval-3.1.0.jar
Binary file not shown.
3 changes: 2 additions & 1 deletion framework/pym/play/commands/autotest.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def autotest(app, args):
sys.exit(-1)

# read parameters
add_options = []
add_options = []
if args.count('--unit'):
args.remove('--unit')
add_options.append('-DrunUnitTests')
Expand Down Expand Up @@ -91,6 +91,7 @@ def autotest(app, args):
if os.path.exists(test_result):
shutil.rmtree(test_result)
sout = open(os.path.join(app.log_path(), 'system.out'), 'w')
args.append('-Dplay.autotest')
java_cmd = app.java_cmd(args)
try:
play_process = subprocess.Popen(java_cmd, env=os.environ, stdout=sout)
Expand Down
2 changes: 2 additions & 0 deletions framework/pym/play/commands/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ def execute(**kargs):
test(app, args)
if command == 'auto-test' or command == 'autotest':
autotest(app, args)
if command == 'junit':
junit(app, args)
if command == 'modules':
show_modules(app, args)

Expand Down
86 changes: 86 additions & 0 deletions framework/pym/play/commands/junit.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
# Command related to execution: junit

import sys
import os, os.path
import shutil
import subprocess
import signal

from play.utils import *

COMMANDS = ['junit']

HELP = {
'junit': "Automatically run all application tests (via Junit directly)"
}

process = None

def handle_sigterm(signum, frame):
global process
if 'process' in globals():
print("~ Terminating Java proces (SIGTERM)")
process.terminate()
sys.exit(0)

first_sigint = True

def handle_sigint(signum, frame):
global process
global first_sigint
if 'process' in globals():
if first_sigint:
# Prefix with new line because ^C usually appears on the terminal
print("\nTerminating Java process")
process.terminate()
first_sigint = False
else:
print("\nKilling Java process")
process.kill()

def execute(**kargs):
app = kargs.get("app")
args = kargs.get("args")
junit(app, args)

def junit(app, args):
app.check()
print("~ Running junit")
print("~ Running in test mode")
print("~ Ctrl+C to stop")
print("~ ")

print("~ Deleting %s" % os.path.normpath(os.path.join(app.path, 'tmp')))
if os.path.exists(os.path.join(app.path, 'tmp')):
shutil.rmtree(os.path.join(app.path, 'tmp'))
print("~")

# read parameters
add_options = []
if args.count('--unit'):
args.remove('--unit')
add_options.append('-DrunUnitTests')

if args.count('--functional'):
args.remove('--functional')
add_options.append('-DrunFunctionalTests')

# Run app
test_result = os.path.join(app.path, 'test-result')
if os.path.exists(test_result):
print("~ cleaning test results")
shutil.rmtree(test_result)
args.append('-Dplay.autotest')
java_cmd = app.java_cmd(args, className='play.test.Runner')
try:
process = subprocess.Popen(java_cmd, env=os.environ)
signal.signal(signal.SIGTERM, handle_sigterm)
signal.signal(signal.SIGINT, handle_sigint)
return_code = process.wait()
if 0 != return_code:
print("~ java process exited with exit code %d" % return_code)
sys.exit(return_code)
except OSError:
print("Could not execute the java executable, please make sure the JAVA_HOME environment variable is set properly (the java executable should reside at JAVA_HOME/bin/java). ")
sys.exit(-1)

25 changes: 21 additions & 4 deletions framework/src/play/Play.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import org.apache.logging.log4j.LogManager;

import play.cache.Cache;
import play.classloading.ApplicationClasses;
import play.classloading.ApplicationClassloader;
Expand Down Expand Up @@ -204,6 +206,9 @@ public boolean isProd() {
* The framework id to use
*/
public static void init(File root, String id) {
long start = System.currentTimeMillis();
Logger.info("Play initializing");

// Simple things
Play.id = id;
Play.started = false;
Expand Down Expand Up @@ -335,6 +340,8 @@ public static void init(File root, String id) {
pluginCollection.onApplicationReady();

Play.initialized = true;
long duration = (System.currentTimeMillis() - start) / 1000;
Logger.info("Play initialized (%s s)", duration);
}

public static void guessFrameworkPath() {
Expand Down Expand Up @@ -470,8 +477,9 @@ private static Properties readOneConfigurationFile(String filename) {
* Start the application. Recall to restart !
*/
public static synchronized void start() {
long start = System.currentTimeMillis();
try {

Logger.info(started ? "Play restarting" : "Play starting");
if (started) {
stop();
}
Expand Down Expand Up @@ -588,19 +596,25 @@ public static synchronized void start() {
}
throw new UnexpectedException(e);
}
long duration = (System.currentTimeMillis() - start) / 1000;
Logger.info("Play started (%s s)", duration);
}

/**
* Stop the application
*/
public static synchronized void stop() {
if (started) {
long start = System.currentTimeMillis();
Logger.trace("Stopping the play application");
pluginCollection.onApplicationStop();
started = false;
Cache.stop();
Router.lastLoading = 0L;
Invoker.resetClassloaders();
long duration = (System.currentTimeMillis() - start) / 1000;
Logger.info("Play stopped (%s s)", duration);
LogManager.shutdown();
}
}

Expand Down Expand Up @@ -653,6 +667,9 @@ public static synchronized void detectChanges() {
if (mode == Mode.PROD) {
return;
}
if (runningInTestMode() && System.getProperty("play.autotest") != null) {
return;
}
try {
pluginCollection.beforeDetectingChanges();
if (!pluginCollection.detectClassesChange()) {
Expand Down Expand Up @@ -723,7 +740,7 @@ public static void loadModules() {
/**
* Load all modules. You can even specify the list using the MODULES environment
* variable.
*
*
* @param appRoot
* the application path virtual file
*/
Expand Down Expand Up @@ -871,11 +888,11 @@ public static File getFile(String path) {
*
* Your app is running in test-mode if the framework id (Play.id) is 'test' or
* 'test-?.*'
*
*
* @return true if test mode
*/
public static boolean runningInTestMode() {
return id.matches("test|test-?.*");
return id.startsWith("test");
}

/**
Expand Down
Loading
Loading