rkrsn commited on
Commit
0406663
·
verified ·
1 Parent(s): 135d4b8

Add files using upload-large-folder tool

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. benchmark/dependency_injection/billpayment/jakarta/.dockerignore +41 -0
  2. benchmark/dependency_injection/billpayment/jakarta/.mvn/wrapper/MavenWrapperDownloader.java +117 -0
  3. benchmark/dependency_injection/billpayment/jakarta/.mvn/wrapper/maven-wrapper.properties +2 -0
  4. benchmark/dependency_injection/billpayment/jakarta/Dockerfile +28 -0
  5. benchmark/dependency_injection/billpayment/jakarta/mvnw +310 -0
  6. benchmark/dependency_injection/billpayment/jakarta/mvnw.cmd +182 -0
  7. benchmark/dependency_injection/billpayment/jakarta/pom.xml +65 -0
  8. benchmark/dependency_injection/billpayment/jakarta/src/main/java/jakarta/tutorial/billpayment/event/PaymentEvent.java +62 -0
  9. benchmark/dependency_injection/billpayment/jakarta/src/main/java/jakarta/tutorial/billpayment/interceptor/Logged.java +29 -0
  10. benchmark/dependency_injection/billpayment/jakarta/src/main/java/jakarta/tutorial/billpayment/interceptor/LoggedInterceptor.java +38 -0
  11. benchmark/dependency_injection/billpayment/jakarta/src/main/java/jakarta/tutorial/billpayment/listener/PaymentHandler.java +53 -0
  12. benchmark/dependency_injection/billpayment/jakarta/src/main/java/jakarta/tutorial/billpayment/payment/Credit.java +32 -0
  13. benchmark/dependency_injection/billpayment/jakarta/src/main/java/jakarta/tutorial/billpayment/payment/Debit.java +32 -0
  14. benchmark/dependency_injection/billpayment/jakarta/src/main/java/jakarta/tutorial/billpayment/payment/PaymentBean.java +118 -0
  15. benchmark/dependency_injection/billpayment/jakarta/src/main/liberty/config/server.xml +15 -0
  16. benchmark/dependency_injection/billpayment/jakarta/src/main/webapp/WEB-INF/beans.xml +23 -0
  17. benchmark/dependency_injection/billpayment/jakarta/src/main/webapp/WEB-INF/web.xml +40 -0
  18. benchmark/dependency_injection/billpayment/jakarta/src/main/webapp/index.xhtml +56 -0
  19. benchmark/dependency_injection/billpayment/jakarta/src/main/webapp/resources/css/default.css +40 -0
  20. benchmark/dependency_injection/billpayment/jakarta/src/main/webapp/response.xhtml +40 -0
  21. benchmark/dependency_injection/billpayment/jakarta/test.sh +15 -0
  22. benchmark/dependency_injection/billpayment/quarkus/.dockerignore +41 -0
  23. benchmark/dependency_injection/billpayment/quarkus/.mvn/wrapper/MavenWrapperDownloader.java +117 -0
  24. benchmark/dependency_injection/billpayment/quarkus/.mvn/wrapper/maven-wrapper.properties +2 -0
  25. benchmark/dependency_injection/billpayment/quarkus/Dockerfile +33 -0
  26. benchmark/dependency_injection/billpayment/quarkus/README.md +58 -0
  27. benchmark/dependency_injection/billpayment/quarkus/mvnw +295 -0
  28. benchmark/dependency_injection/billpayment/quarkus/mvnw.cmd +189 -0
  29. benchmark/dependency_injection/billpayment/quarkus/pom.xml +129 -0
  30. benchmark/dependency_injection/billpayment/quarkus/src/main/docker/Dockerfile.jvm +128 -0
  31. benchmark/dependency_injection/billpayment/quarkus/src/main/docker/Dockerfile.legacy-jar +94 -0
  32. benchmark/dependency_injection/billpayment/quarkus/src/main/docker/Dockerfile.native +29 -0
  33. benchmark/dependency_injection/billpayment/quarkus/src/main/docker/Dockerfile.native-micro +32 -0
  34. benchmark/dependency_injection/billpayment/quarkus/src/main/java/jakarta/tutorial/billpayment/event/PaymentEvent.java +62 -0
  35. benchmark/dependency_injection/billpayment/quarkus/src/main/java/jakarta/tutorial/billpayment/interceptor/Logged.java +29 -0
  36. benchmark/dependency_injection/billpayment/quarkus/src/main/java/jakarta/tutorial/billpayment/interceptor/LoggedInterceptor.java +38 -0
  37. benchmark/dependency_injection/billpayment/quarkus/src/main/java/jakarta/tutorial/billpayment/listener/PaymentHandler.java +53 -0
  38. benchmark/dependency_injection/billpayment/quarkus/src/main/java/jakarta/tutorial/billpayment/payment/Credit.java +32 -0
  39. benchmark/dependency_injection/billpayment/quarkus/src/main/java/jakarta/tutorial/billpayment/payment/Debit.java +32 -0
  40. benchmark/dependency_injection/billpayment/quarkus/src/main/java/jakarta/tutorial/billpayment/payment/PaymentBean.java +118 -0
  41. benchmark/dependency_injection/billpayment/quarkus/src/main/resources/META-INF/faces-config.xml +15 -0
  42. benchmark/dependency_injection/billpayment/quarkus/src/main/resources/META-INF/resources/index.xhtml +56 -0
  43. benchmark/dependency_injection/billpayment/quarkus/src/main/resources/META-INF/resources/resources/css/default.css +40 -0
  44. benchmark/dependency_injection/billpayment/quarkus/src/main/resources/META-INF/resources/response.xhtml +40 -0
  45. benchmark/dependency_injection/billpayment/quarkus/src/main/resources/META-INF/web.xml +40 -0
  46. benchmark/dependency_injection/billpayment/quarkus/src/main/resources/application.properties +1 -0
  47. benchmark/dependency_injection/billpayment/quarkus/src/test/java/jakarta/tutorial/billpayment/payment/PaymentFlowTest.java +93 -0
  48. benchmark/dependency_injection/billpayment/quarkus/test.sh +15 -0
  49. benchmark/dependency_injection/billpayment/spring/.dockerignore +41 -0
  50. benchmark/dependency_injection/billpayment/spring/.mvn/wrapper/MavenWrapperDownloader.java +117 -0
benchmark/dependency_injection/billpayment/jakarta/.dockerignore ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # VCS
2
+ .git/
3
+
4
+ # Maven
5
+ .mvn/
6
+ **/.mvn/
7
+ mvnw
8
+ mvnw.cmd
9
+ **/mvnw
10
+ **/mvnw.cmd
11
+ target/
12
+ **/target/
13
+ pom.xml.tag
14
+ pom.xml.releaseBackup
15
+ pom.xml.versionsBackup
16
+ pom.xml.next
17
+ release.properties
18
+ dependency-reduced-pom.xml
19
+ buildNumber.properties
20
+
21
+ # IDE / Editor
22
+ .vscode/
23
+ **/.vscode/
24
+ .zed/
25
+ **/.zed/
26
+ .idea/
27
+ **/.idea/
28
+ *.iml
29
+ *.ipr
30
+ *.iws
31
+
32
+ # OS
33
+ .DS_Store
34
+ **/.DS_Store
35
+ Thumbs.db
36
+ ehthumbs.db
37
+
38
+ # Logs / temp
39
+ *.log
40
+ *.tmp
41
+ *.temp
benchmark/dependency_injection/billpayment/jakarta/.mvn/wrapper/MavenWrapperDownloader.java ADDED
@@ -0,0 +1,117 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Copyright 2007-present the original author or authors.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import java.net.*;
17
+ import java.io.*;
18
+ import java.nio.channels.*;
19
+ import java.util.Properties;
20
+
21
+ public class MavenWrapperDownloader {
22
+
23
+ private static final String WRAPPER_VERSION = "0.5.6";
24
+ /**
25
+ * Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided.
26
+ */
27
+ private static final String DEFAULT_DOWNLOAD_URL = "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/"
28
+ + WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar";
29
+
30
+ /**
31
+ * Path to the maven-wrapper.properties file, which might contain a downloadUrl property to
32
+ * use instead of the default one.
33
+ */
34
+ private static final String MAVEN_WRAPPER_PROPERTIES_PATH =
35
+ ".mvn/wrapper/maven-wrapper.properties";
36
+
37
+ /**
38
+ * Path where the maven-wrapper.jar will be saved to.
39
+ */
40
+ private static final String MAVEN_WRAPPER_JAR_PATH =
41
+ ".mvn/wrapper/maven-wrapper.jar";
42
+
43
+ /**
44
+ * Name of the property which should be used to override the default download url for the wrapper.
45
+ */
46
+ private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl";
47
+
48
+ public static void main(String args[]) {
49
+ System.out.println("- Downloader started");
50
+ File baseDirectory = new File(args[0]);
51
+ System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath());
52
+
53
+ // If the maven-wrapper.properties exists, read it and check if it contains a custom
54
+ // wrapperUrl parameter.
55
+ File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH);
56
+ String url = DEFAULT_DOWNLOAD_URL;
57
+ if(mavenWrapperPropertyFile.exists()) {
58
+ FileInputStream mavenWrapperPropertyFileInputStream = null;
59
+ try {
60
+ mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile);
61
+ Properties mavenWrapperProperties = new Properties();
62
+ mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream);
63
+ url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url);
64
+ } catch (IOException e) {
65
+ System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'");
66
+ } finally {
67
+ try {
68
+ if(mavenWrapperPropertyFileInputStream != null) {
69
+ mavenWrapperPropertyFileInputStream.close();
70
+ }
71
+ } catch (IOException e) {
72
+ // Ignore ...
73
+ }
74
+ }
75
+ }
76
+ System.out.println("- Downloading from: " + url);
77
+
78
+ File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH);
79
+ if(!outputFile.getParentFile().exists()) {
80
+ if(!outputFile.getParentFile().mkdirs()) {
81
+ System.out.println(
82
+ "- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'");
83
+ }
84
+ }
85
+ System.out.println("- Downloading to: " + outputFile.getAbsolutePath());
86
+ try {
87
+ downloadFileFromURL(url, outputFile);
88
+ System.out.println("Done");
89
+ System.exit(0);
90
+ } catch (Throwable e) {
91
+ System.out.println("- Error downloading");
92
+ e.printStackTrace();
93
+ System.exit(1);
94
+ }
95
+ }
96
+
97
+ private static void downloadFileFromURL(String urlString, File destination) throws Exception {
98
+ if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) {
99
+ String username = System.getenv("MVNW_USERNAME");
100
+ char[] password = System.getenv("MVNW_PASSWORD").toCharArray();
101
+ Authenticator.setDefault(new Authenticator() {
102
+ @Override
103
+ protected PasswordAuthentication getPasswordAuthentication() {
104
+ return new PasswordAuthentication(username, password);
105
+ }
106
+ });
107
+ }
108
+ URL website = new URL(urlString);
109
+ ReadableByteChannel rbc;
110
+ rbc = Channels.newChannel(website.openStream());
111
+ FileOutputStream fos = new FileOutputStream(destination);
112
+ fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
113
+ fos.close();
114
+ rbc.close();
115
+ }
116
+
117
+ }
benchmark/dependency_injection/billpayment/jakarta/.mvn/wrapper/maven-wrapper.properties ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.4/apache-maven-3.9.4-bin.zip
2
+ wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar
benchmark/dependency_injection/billpayment/jakarta/Dockerfile ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM maven:3.9.12-ibm-semeru-21-noble
2
+
3
+ USER root
4
+ # install uv
5
+ RUN apt-get update && apt-get install -y --no-install-recommends curl python3-venv python3-full && curl -LsSf https://astral.sh/uv/install.sh | sh
6
+
7
+ ENV PATH="/root/.local/bin:$PATH"
8
+
9
+ # Shared browsers path so Chromium is cached once
10
+ ENV PLAYWRIGHT_BROWSERS_PATH=/ms-playwright
11
+ RUN mkdir -p /ms-playwright && chmod 755 /ms-playwright
12
+
13
+ # create venv and install
14
+ RUN uv venv /opt/venv && uv pip install --python /opt/venv/bin/python playwright==1.47.0 pytest
15
+
16
+ ENV PATH="/opt/venv/bin:$PATH"
17
+ RUN playwright install --with-deps chromium
18
+
19
+ # Set working directory
20
+ WORKDIR /app
21
+
22
+ # Copy all the assets
23
+ COPY . .
24
+
25
+ COPY test.sh .
26
+ RUN chmod +x test.sh
27
+ RUN mvn clean install -DskipTests
28
+ CMD [ "mvn", "liberty:run" ]
benchmark/dependency_injection/billpayment/jakarta/mvnw ADDED
@@ -0,0 +1,310 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/sh
2
+ # ----------------------------------------------------------------------------
3
+ # Licensed to the Apache Software Foundation (ASF) under one
4
+ # or more contributor license agreements. See the NOTICE file
5
+ # distributed with this work for additional information
6
+ # regarding copyright ownership. The ASF licenses this file
7
+ # to you under the Apache License, Version 2.0 (the
8
+ # "License"); you may not use this file except in compliance
9
+ # with the License. You may obtain a copy of the License at
10
+ #
11
+ # http://www.apache.org/licenses/LICENSE-2.0
12
+ #
13
+ # Unless required by applicable law or agreed to in writing,
14
+ # software distributed under the License is distributed on an
15
+ # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16
+ # KIND, either express or implied. See the License for the
17
+ # specific language governing permissions and limitations
18
+ # under the License.
19
+ # ----------------------------------------------------------------------------
20
+
21
+ # ----------------------------------------------------------------------------
22
+ # Maven Start Up Batch script
23
+ #
24
+ # Required ENV vars:
25
+ # ------------------
26
+ # JAVA_HOME - location of a JDK home dir
27
+ #
28
+ # Optional ENV vars
29
+ # -----------------
30
+ # M2_HOME - location of maven2's installed home dir
31
+ # MAVEN_OPTS - parameters passed to the Java VM when running Maven
32
+ # e.g. to debug Maven itself, use
33
+ # set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
34
+ # MAVEN_SKIP_RC - flag to disable loading of mavenrc files
35
+ # ----------------------------------------------------------------------------
36
+
37
+ if [ -z "$MAVEN_SKIP_RC" ] ; then
38
+
39
+ if [ -f /etc/mavenrc ] ; then
40
+ . /etc/mavenrc
41
+ fi
42
+
43
+ if [ -f "$HOME/.mavenrc" ] ; then
44
+ . "$HOME/.mavenrc"
45
+ fi
46
+
47
+ fi
48
+
49
+ # OS specific support. $var _must_ be set to either true or false.
50
+ cygwin=false;
51
+ darwin=false;
52
+ mingw=false
53
+ case "`uname`" in
54
+ CYGWIN*) cygwin=true ;;
55
+ MINGW*) mingw=true;;
56
+ Darwin*) darwin=true
57
+ # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home
58
+ # See https://developer.apple.com/library/mac/qa/qa1170/_index.html
59
+ if [ -z "$JAVA_HOME" ]; then
60
+ if [ -x "/usr/libexec/java_home" ]; then
61
+ export JAVA_HOME="`/usr/libexec/java_home`"
62
+ else
63
+ export JAVA_HOME="/Library/Java/Home"
64
+ fi
65
+ fi
66
+ ;;
67
+ esac
68
+
69
+ if [ -z "$JAVA_HOME" ] ; then
70
+ if [ -r /etc/gentoo-release ] ; then
71
+ JAVA_HOME=`java-config --jre-home`
72
+ fi
73
+ fi
74
+
75
+ if [ -z "$M2_HOME" ] ; then
76
+ ## resolve links - $0 may be a link to maven's home
77
+ PRG="$0"
78
+
79
+ # need this for relative symlinks
80
+ while [ -h "$PRG" ] ; do
81
+ ls=`ls -ld "$PRG"`
82
+ link=`expr "$ls" : '.*-> \(.*\)$'`
83
+ if expr "$link" : '/.*' > /dev/null; then
84
+ PRG="$link"
85
+ else
86
+ PRG="`dirname "$PRG"`/$link"
87
+ fi
88
+ done
89
+
90
+ saveddir=`pwd`
91
+
92
+ M2_HOME=`dirname "$PRG"`/..
93
+
94
+ # make it fully qualified
95
+ M2_HOME=`cd "$M2_HOME" && pwd`
96
+
97
+ cd "$saveddir"
98
+ # echo Using m2 at $M2_HOME
99
+ fi
100
+
101
+ # For Cygwin, ensure paths are in UNIX format before anything is touched
102
+ if $cygwin ; then
103
+ [ -n "$M2_HOME" ] &&
104
+ M2_HOME=`cygpath --unix "$M2_HOME"`
105
+ [ -n "$JAVA_HOME" ] &&
106
+ JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
107
+ [ -n "$CLASSPATH" ] &&
108
+ CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
109
+ fi
110
+
111
+ # For Mingw, ensure paths are in UNIX format before anything is touched
112
+ if $mingw ; then
113
+ [ -n "$M2_HOME" ] &&
114
+ M2_HOME="`(cd "$M2_HOME"; pwd)`"
115
+ [ -n "$JAVA_HOME" ] &&
116
+ JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`"
117
+ fi
118
+
119
+ if [ -z "$JAVA_HOME" ]; then
120
+ javaExecutable="`which javac`"
121
+ if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then
122
+ # readlink(1) is not available as standard on Solaris 10.
123
+ readLink=`which readlink`
124
+ if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then
125
+ if $darwin ; then
126
+ javaHome="`dirname \"$javaExecutable\"`"
127
+ javaExecutable="`cd \"$javaHome\" && pwd -P`/javac"
128
+ else
129
+ javaExecutable="`readlink -f \"$javaExecutable\"`"
130
+ fi
131
+ javaHome="`dirname \"$javaExecutable\"`"
132
+ javaHome=`expr "$javaHome" : '\(.*\)/bin'`
133
+ JAVA_HOME="$javaHome"
134
+ export JAVA_HOME
135
+ fi
136
+ fi
137
+ fi
138
+
139
+ if [ -z "$JAVACMD" ] ; then
140
+ if [ -n "$JAVA_HOME" ] ; then
141
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
142
+ # IBM's JDK on AIX uses strange locations for the executables
143
+ JAVACMD="$JAVA_HOME/jre/sh/java"
144
+ else
145
+ JAVACMD="$JAVA_HOME/bin/java"
146
+ fi
147
+ else
148
+ JAVACMD="`which java`"
149
+ fi
150
+ fi
151
+
152
+ if [ ! -x "$JAVACMD" ] ; then
153
+ echo "Error: JAVA_HOME is not defined correctly." >&2
154
+ echo " We cannot execute $JAVACMD" >&2
155
+ exit 1
156
+ fi
157
+
158
+ if [ -z "$JAVA_HOME" ] ; then
159
+ echo "Warning: JAVA_HOME environment variable is not set."
160
+ fi
161
+
162
+ CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher
163
+
164
+ # traverses directory structure from process work directory to filesystem root
165
+ # first directory with .mvn subdirectory is considered project base directory
166
+ find_maven_basedir() {
167
+
168
+ if [ -z "$1" ]
169
+ then
170
+ echo "Path not specified to find_maven_basedir"
171
+ return 1
172
+ fi
173
+
174
+ basedir="$1"
175
+ wdir="$1"
176
+ while [ "$wdir" != '/' ] ; do
177
+ if [ -d "$wdir"/.mvn ] ; then
178
+ basedir=$wdir
179
+ break
180
+ fi
181
+ # workaround for JBEAP-8937 (on Solaris 10/Sparc)
182
+ if [ -d "${wdir}" ]; then
183
+ wdir=`cd "$wdir/.."; pwd`
184
+ fi
185
+ # end of workaround
186
+ done
187
+ echo "${basedir}"
188
+ }
189
+
190
+ # concatenates all lines of a file
191
+ concat_lines() {
192
+ if [ -f "$1" ]; then
193
+ echo "$(tr -s '\n' ' ' < "$1")"
194
+ fi
195
+ }
196
+
197
+ BASE_DIR=`find_maven_basedir "$(pwd)"`
198
+ if [ -z "$BASE_DIR" ]; then
199
+ exit 1;
200
+ fi
201
+
202
+ ##########################################################################################
203
+ # Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
204
+ # This allows using the maven wrapper in projects that prohibit checking in binary data.
205
+ ##########################################################################################
206
+ if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then
207
+ if [ "$MVNW_VERBOSE" = true ]; then
208
+ echo "Found .mvn/wrapper/maven-wrapper.jar"
209
+ fi
210
+ else
211
+ if [ "$MVNW_VERBOSE" = true ]; then
212
+ echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..."
213
+ fi
214
+ if [ -n "$MVNW_REPOURL" ]; then
215
+ jarUrl="$MVNW_REPOURL/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
216
+ else
217
+ jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
218
+ fi
219
+ while IFS="=" read key value; do
220
+ case "$key" in (wrapperUrl) jarUrl="$value"; break ;;
221
+ esac
222
+ done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties"
223
+ if [ "$MVNW_VERBOSE" = true ]; then
224
+ echo "Downloading from: $jarUrl"
225
+ fi
226
+ wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar"
227
+ if $cygwin; then
228
+ wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"`
229
+ fi
230
+
231
+ if command -v wget > /dev/null; then
232
+ if [ "$MVNW_VERBOSE" = true ]; then
233
+ echo "Found wget ... using wget"
234
+ fi
235
+ if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
236
+ wget "$jarUrl" -O "$wrapperJarPath"
237
+ else
238
+ wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath"
239
+ fi
240
+ elif command -v curl > /dev/null; then
241
+ if [ "$MVNW_VERBOSE" = true ]; then
242
+ echo "Found curl ... using curl"
243
+ fi
244
+ if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
245
+ curl -o "$wrapperJarPath" "$jarUrl" -f
246
+ else
247
+ curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f
248
+ fi
249
+
250
+ else
251
+ if [ "$MVNW_VERBOSE" = true ]; then
252
+ echo "Falling back to using Java to download"
253
+ fi
254
+ javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java"
255
+ # For Cygwin, switch paths to Windows format before running javac
256
+ if $cygwin; then
257
+ javaClass=`cygpath --path --windows "$javaClass"`
258
+ fi
259
+ if [ -e "$javaClass" ]; then
260
+ if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
261
+ if [ "$MVNW_VERBOSE" = true ]; then
262
+ echo " - Compiling MavenWrapperDownloader.java ..."
263
+ fi
264
+ # Compiling the Java class
265
+ ("$JAVA_HOME/bin/javac" "$javaClass")
266
+ fi
267
+ if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
268
+ # Running the downloader
269
+ if [ "$MVNW_VERBOSE" = true ]; then
270
+ echo " - Running MavenWrapperDownloader.java ..."
271
+ fi
272
+ ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR")
273
+ fi
274
+ fi
275
+ fi
276
+ fi
277
+ ##########################################################################################
278
+ # End of extension
279
+ ##########################################################################################
280
+
281
+ export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}
282
+ if [ "$MVNW_VERBOSE" = true ]; then
283
+ echo $MAVEN_PROJECTBASEDIR
284
+ fi
285
+ MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS"
286
+
287
+ # For Cygwin, switch paths to Windows format before running java
288
+ if $cygwin; then
289
+ [ -n "$M2_HOME" ] &&
290
+ M2_HOME=`cygpath --path --windows "$M2_HOME"`
291
+ [ -n "$JAVA_HOME" ] &&
292
+ JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
293
+ [ -n "$CLASSPATH" ] &&
294
+ CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
295
+ [ -n "$MAVEN_PROJECTBASEDIR" ] &&
296
+ MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"`
297
+ fi
298
+
299
+ # Provide a "standardized" way to retrieve the CLI args that will
300
+ # work with both Windows and non-Windows executions.
301
+ MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@"
302
+ export MAVEN_CMD_LINE_ARGS
303
+
304
+ WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
305
+
306
+ exec "$JAVACMD" \
307
+ $MAVEN_OPTS \
308
+ -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \
309
+ "-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
310
+ ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@"
benchmark/dependency_injection/billpayment/jakarta/mvnw.cmd ADDED
@@ -0,0 +1,182 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @REM ----------------------------------------------------------------------------
2
+ @REM Licensed to the Apache Software Foundation (ASF) under one
3
+ @REM or more contributor license agreements. See the NOTICE file
4
+ @REM distributed with this work for additional information
5
+ @REM regarding copyright ownership. The ASF licenses this file
6
+ @REM to you under the Apache License, Version 2.0 (the
7
+ @REM "License"); you may not use this file except in compliance
8
+ @REM with the License. You may obtain a copy of the License at
9
+ @REM
10
+ @REM http://www.apache.org/licenses/LICENSE-2.0
11
+ @REM
12
+ @REM Unless required by applicable law or agreed to in writing,
13
+ @REM software distributed under the License is distributed on an
14
+ @REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
+ @REM KIND, either express or implied. See the License for the
16
+ @REM specific language governing permissions and limitations
17
+ @REM under the License.
18
+ @REM ----------------------------------------------------------------------------
19
+
20
+ @REM ----------------------------------------------------------------------------
21
+ @REM Maven Start Up Batch script
22
+ @REM
23
+ @REM Required ENV vars:
24
+ @REM JAVA_HOME - location of a JDK home dir
25
+ @REM
26
+ @REM Optional ENV vars
27
+ @REM M2_HOME - location of maven2's installed home dir
28
+ @REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands
29
+ @REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending
30
+ @REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
31
+ @REM e.g. to debug Maven itself, use
32
+ @REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
33
+ @REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files
34
+ @REM ----------------------------------------------------------------------------
35
+
36
+ @REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
37
+ @echo off
38
+ @REM set title of command window
39
+ title %0
40
+ @REM enable echoing by setting MAVEN_BATCH_ECHO to 'on'
41
+ @if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO%
42
+
43
+ @REM set %HOME% to equivalent of $HOME
44
+ if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")
45
+
46
+ @REM Execute a user defined script before this one
47
+ if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre
48
+ @REM check for pre script, once with legacy .bat ending and once with .cmd ending
49
+ if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat"
50
+ if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd"
51
+ :skipRcPre
52
+
53
+ @setlocal
54
+
55
+ set ERROR_CODE=0
56
+
57
+ @REM To isolate internal variables from possible post scripts, we use another setlocal
58
+ @setlocal
59
+
60
+ @REM ==== START VALIDATION ====
61
+ if not "%JAVA_HOME%" == "" goto OkJHome
62
+
63
+ echo.
64
+ echo Error: JAVA_HOME not found in your environment. >&2
65
+ echo Please set the JAVA_HOME variable in your environment to match the >&2
66
+ echo location of your Java installation. >&2
67
+ echo.
68
+ goto error
69
+
70
+ :OkJHome
71
+ if exist "%JAVA_HOME%\bin\java.exe" goto init
72
+
73
+ echo.
74
+ echo Error: JAVA_HOME is set to an invalid directory. >&2
75
+ echo JAVA_HOME = "%JAVA_HOME%" >&2
76
+ echo Please set the JAVA_HOME variable in your environment to match the >&2
77
+ echo location of your Java installation. >&2
78
+ echo.
79
+ goto error
80
+
81
+ @REM ==== END VALIDATION ====
82
+
83
+ :init
84
+
85
+ @REM Find the project base dir, i.e. the directory that contains the folder ".mvn".
86
+ @REM Fallback to current working directory if not found.
87
+
88
+ set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR%
89
+ IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir
90
+
91
+ set EXEC_DIR=%CD%
92
+ set WDIR=%EXEC_DIR%
93
+ :findBaseDir
94
+ IF EXIST "%WDIR%"\.mvn goto baseDirFound
95
+ cd ..
96
+ IF "%WDIR%"=="%CD%" goto baseDirNotFound
97
+ set WDIR=%CD%
98
+ goto findBaseDir
99
+
100
+ :baseDirFound
101
+ set MAVEN_PROJECTBASEDIR=%WDIR%
102
+ cd "%EXEC_DIR%"
103
+ goto endDetectBaseDir
104
+
105
+ :baseDirNotFound
106
+ set MAVEN_PROJECTBASEDIR=%EXEC_DIR%
107
+ cd "%EXEC_DIR%"
108
+
109
+ :endDetectBaseDir
110
+
111
+ IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig
112
+
113
+ @setlocal EnableExtensions EnableDelayedExpansion
114
+ for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a
115
+ @endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS%
116
+
117
+ :endReadAdditionalConfig
118
+
119
+ SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
120
+ set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar"
121
+ set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
122
+
123
+ set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
124
+
125
+ FOR /F "tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO (
126
+ IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B
127
+ )
128
+
129
+ @REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
130
+ @REM This allows using the maven wrapper in projects that prohibit checking in binary data.
131
+ if exist %WRAPPER_JAR% (
132
+ if "%MVNW_VERBOSE%" == "true" (
133
+ echo Found %WRAPPER_JAR%
134
+ )
135
+ ) else (
136
+ if not "%MVNW_REPOURL%" == "" (
137
+ SET DOWNLOAD_URL="%MVNW_REPOURL%/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
138
+ )
139
+ if "%MVNW_VERBOSE%" == "true" (
140
+ echo Couldn't find %WRAPPER_JAR%, downloading it ...
141
+ echo Downloading from: %DOWNLOAD_URL%
142
+ )
143
+
144
+ powershell -Command "&{"^
145
+ "$webclient = new-object System.Net.WebClient;"^
146
+ "if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^
147
+ "$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^
148
+ "}"^
149
+ "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^
150
+ "}"
151
+ if "%MVNW_VERBOSE%" == "true" (
152
+ echo Finished downloading %WRAPPER_JAR%
153
+ )
154
+ )
155
+ @REM End of extension
156
+
157
+ @REM Provide a "standardized" way to retrieve the CLI args that will
158
+ @REM work with both Windows and non-Windows executions.
159
+ set MAVEN_CMD_LINE_ARGS=%*
160
+
161
+ %MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %*
162
+ if ERRORLEVEL 1 goto error
163
+ goto end
164
+
165
+ :error
166
+ set ERROR_CODE=1
167
+
168
+ :end
169
+ @endlocal & set ERROR_CODE=%ERROR_CODE%
170
+
171
+ if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost
172
+ @REM check for post script, once with legacy .bat ending and once with .cmd ending
173
+ if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat"
174
+ if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd"
175
+ :skipRcPost
176
+
177
+ @REM pause the script if MAVEN_BATCH_PAUSE is set to 'on'
178
+ if "%MAVEN_BATCH_PAUSE%" == "on" pause
179
+
180
+ if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE%
181
+
182
+ exit /B %ERROR_CODE%
benchmark/dependency_injection/billpayment/jakarta/pom.xml ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project xmlns="http://maven.apache.org/POM/4.0.0"
3
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
5
+ <modelVersion>4.0.0</modelVersion>
6
+
7
+ <groupId>jakarta.examples.tutorial.cdi</groupId>
8
+ <artifactId>billpayment</artifactId>
9
+ <version>10-SNAPSHOT</version>
10
+ <packaging>war</packaging>
11
+ <name>billpayment</name>
12
+ <description>Jakarta EE CDI Bill Payment Example</description>
13
+
14
+ <properties>
15
+ <maven.compiler.source>11</maven.compiler.source>
16
+ <maven.compiler.target>11</maven.compiler.target>
17
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
18
+ <jakarta.jakartaee-api.version>10.0.0</jakarta.jakartaee-api.version>
19
+ <maven.compiler.plugin.version>3.8.1</maven.compiler.plugin.version>
20
+ <maven.war.plugin.version>3.3.1</maven.war.plugin.version>
21
+ <liberty.maven.plugin.version>3.10.3</liberty.maven.plugin.version>
22
+ <failOnMissingWebXml>false</failOnMissingWebXml>
23
+ </properties>
24
+
25
+ <dependencies>
26
+ <dependency>
27
+ <groupId>jakarta.platform</groupId>
28
+ <artifactId>jakarta.jakartaee-api</artifactId>
29
+ <version>${jakarta.jakartaee-api.version}</version>
30
+ <scope>provided</scope>
31
+ </dependency>
32
+ </dependencies>
33
+
34
+ <build>
35
+ <finalName>billpayment</finalName>
36
+ <plugins>
37
+ <plugin>
38
+ <groupId>org.apache.maven.plugins</groupId>
39
+ <artifactId>maven-compiler-plugin</artifactId>
40
+ <version>${maven.compiler.plugin.version}</version>
41
+ <configuration>
42
+ <source>11</source>
43
+ <target>11</target>
44
+ </configuration>
45
+ </plugin>
46
+ <plugin>
47
+ <groupId>org.apache.maven.plugins</groupId>
48
+ <artifactId>maven-war-plugin</artifactId>
49
+ <version>${maven.war.plugin.version}</version>
50
+ <configuration>
51
+ <failOnMissingWebXml>false</failOnMissingWebXml>
52
+ </configuration>
53
+ </plugin>
54
+ <plugin>
55
+ <groupId>io.openliberty.tools</groupId>
56
+ <artifactId>liberty-maven-plugin</artifactId>
57
+ <version>${liberty.maven.plugin.version}</version>
58
+ <configuration>
59
+ <serverName>defaultServer</serverName>
60
+ <configDirectory>${project.basedir}/src/main/liberty/config</configDirectory>
61
+ </configuration>
62
+ </plugin>
63
+ </plugins>
64
+ </build>
65
+ </project>
benchmark/dependency_injection/billpayment/jakarta/src/main/java/jakarta/tutorial/billpayment/event/PaymentEvent.java ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Copyright (c), Eclipse Foundation, Inc. and its licensors.
3
+ *
4
+ * All rights reserved.
5
+ *
6
+ * This program and the accompanying materials are made available under the
7
+ * terms of the Eclipse Distribution License v1.0, which is available at
8
+ * https://www.eclipse.org/org/documents/edl-v10.php
9
+ *
10
+ * SPDX-License-Identifier: BSD-3-Clause
11
+ */
12
+ package jakarta.tutorial.billpayment.event;
13
+
14
+ import java.io.Serializable;
15
+ import java.math.BigDecimal;
16
+ import java.util.Date;
17
+
18
+ /**
19
+ * Common payment event that handles Debit and Credit payment types.
20
+ */
21
+ public class PaymentEvent implements Serializable {
22
+
23
+ private static final long serialVersionUID = -6407967360613478424L;
24
+
25
+ public String paymentType;
26
+ public BigDecimal value;
27
+ public Date datetime;
28
+
29
+ public PaymentEvent() {
30
+ }
31
+
32
+ @Override
33
+ public String toString() {
34
+ return this.paymentType
35
+ + " = $" + this.value.toString()
36
+ + " at " + this.datetime.toString();
37
+ }
38
+
39
+ public String getPaymentType() {
40
+ return paymentType;
41
+ }
42
+
43
+ public void setPaymentType(String paymentType) {
44
+ this.paymentType = paymentType;
45
+ }
46
+
47
+ public BigDecimal getValue() {
48
+ return value;
49
+ }
50
+
51
+ public void setValue(BigDecimal value) {
52
+ this.value = value;
53
+ }
54
+
55
+ public Date getDatetime() {
56
+ return datetime;
57
+ }
58
+
59
+ public void setDatetime(Date datetime) {
60
+ this.datetime = datetime;
61
+ }
62
+ }
benchmark/dependency_injection/billpayment/jakarta/src/main/java/jakarta/tutorial/billpayment/interceptor/Logged.java ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Copyright (c), Eclipse Foundation, Inc. and its licensors.
3
+ *
4
+ * All rights reserved.
5
+ *
6
+ * This program and the accompanying materials are made available under the
7
+ * terms of the Eclipse Distribution License v1.0, which is available at
8
+ * https://www.eclipse.org/org/documents/edl-v10.php
9
+ *
10
+ * SPDX-License-Identifier: BSD-3-Clause
11
+ */
12
+ package jakarta.tutorial.billpayment.interceptor;
13
+
14
+ import static java.lang.annotation.ElementType.METHOD;
15
+ import static java.lang.annotation.ElementType.TYPE;
16
+ import static java.lang.annotation.RetentionPolicy.RUNTIME;
17
+
18
+ import java.lang.annotation.Inherited;
19
+ import java.lang.annotation.Retention;
20
+ import java.lang.annotation.Target;
21
+
22
+ import jakarta.interceptor.InterceptorBinding;
23
+
24
+ @Inherited
25
+ @InterceptorBinding
26
+ @Retention(RUNTIME)
27
+ @Target({METHOD, TYPE})
28
+ public @interface Logged {
29
+ }
benchmark/dependency_injection/billpayment/jakarta/src/main/java/jakarta/tutorial/billpayment/interceptor/LoggedInterceptor.java ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Copyright (c), Eclipse Foundation, Inc. and its licensors.
3
+ *
4
+ * All rights reserved.
5
+ *
6
+ * This program and the accompanying materials are made available under the
7
+ * terms of the Eclipse Distribution License v1.0, which is available at
8
+ * https://www.eclipse.org/org/documents/edl-v10.php
9
+ *
10
+ * SPDX-License-Identifier: BSD-3-Clause
11
+ */
12
+ package jakarta.tutorial.billpayment.interceptor;
13
+
14
+ import java.io.Serializable;
15
+
16
+ import jakarta.interceptor.AroundInvoke;
17
+ import jakarta.interceptor.Interceptor;
18
+ import jakarta.interceptor.InvocationContext;
19
+
20
+ @Logged
21
+ @Interceptor
22
+ public class LoggedInterceptor implements Serializable {
23
+
24
+ private static final long serialVersionUID = -2230122751970857993L;
25
+
26
+ public LoggedInterceptor() {
27
+ }
28
+
29
+ @AroundInvoke
30
+ public Object logMethodEntry(InvocationContext invocationContext)
31
+ throws Exception {
32
+ System.out.println("Entering method: "
33
+ + invocationContext.getMethod().getName() + " in class "
34
+ + invocationContext.getMethod().getDeclaringClass().getName());
35
+
36
+ return invocationContext.proceed();
37
+ }
38
+ }
benchmark/dependency_injection/billpayment/jakarta/src/main/java/jakarta/tutorial/billpayment/listener/PaymentHandler.java ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Copyright (c), Eclipse Foundation, Inc. and its licensors.
3
+ *
4
+ * All rights reserved.
5
+ *
6
+ * This program and the accompanying materials are made available under the
7
+ * terms of the Eclipse Distribution License v1.0, which is available at
8
+ * https://www.eclipse.org/org/documents/edl-v10.php
9
+ *
10
+ * SPDX-License-Identifier: BSD-3-Clause
11
+ */
12
+ package jakarta.tutorial.billpayment.listener;
13
+
14
+ import java.io.Serializable;
15
+ import java.util.logging.Level;
16
+ import java.util.logging.Logger;
17
+
18
+ import jakarta.enterprise.context.SessionScoped;
19
+ import jakarta.enterprise.event.Observes;
20
+ import jakarta.tutorial.billpayment.event.PaymentEvent;
21
+ import jakarta.tutorial.billpayment.interceptor.Logged;
22
+ import jakarta.tutorial.billpayment.payment.Credit;
23
+ import jakarta.tutorial.billpayment.payment.Debit;
24
+
25
+ /**
26
+ * Handler for the two kinds of PaymentEvent.
27
+ */
28
+ @Logged
29
+ @SessionScoped
30
+ public class PaymentHandler implements Serializable {
31
+
32
+ private static final Logger logger =
33
+ Logger.getLogger(PaymentHandler.class.getCanonicalName());
34
+ private static final long serialVersionUID = 2013564481486393525L;
35
+
36
+ public PaymentHandler() {
37
+ logger.log(Level.INFO, "PaymentHandler created.");
38
+ }
39
+
40
+ public void creditPayment(@Observes @Credit PaymentEvent event) {
41
+ logger.log(Level.INFO, "PaymentHandler - Credit Handler: {0}",
42
+ event.toString());
43
+
44
+ // call a specific Credit handler class...
45
+ }
46
+
47
+ public void debitPayment(@Observes @Debit PaymentEvent event) {
48
+ logger.log(Level.INFO, "PaymentHandler - Debit Handler: {0}",
49
+ event.toString());
50
+
51
+ // call a specific Debit handler class...
52
+ }
53
+ }
benchmark/dependency_injection/billpayment/jakarta/src/main/java/jakarta/tutorial/billpayment/payment/Credit.java ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Copyright (c), Eclipse Foundation, Inc. and its licensors.
3
+ *
4
+ * All rights reserved.
5
+ *
6
+ * This program and the accompanying materials are made available under the
7
+ * terms of the Eclipse Distribution License v1.0, which is available at
8
+ * https://www.eclipse.org/org/documents/edl-v10.php
9
+ *
10
+ * SPDX-License-Identifier: BSD-3-Clause
11
+ */
12
+ package jakarta.tutorial.billpayment.payment;
13
+
14
+ import static java.lang.annotation.ElementType.FIELD;
15
+ import static java.lang.annotation.ElementType.METHOD;
16
+ import static java.lang.annotation.ElementType.PARAMETER;
17
+ import static java.lang.annotation.ElementType.TYPE;
18
+ import static java.lang.annotation.RetentionPolicy.RUNTIME;
19
+
20
+ import java.lang.annotation.Retention;
21
+ import java.lang.annotation.Target;
22
+
23
+ import jakarta.inject.Qualifier;
24
+
25
+ /**
26
+ * Qualifier for Credit payment events.
27
+ */
28
+ @Qualifier
29
+ @Retention(RUNTIME)
30
+ @Target({METHOD, FIELD, PARAMETER, TYPE})
31
+ public @interface Credit {
32
+ }
benchmark/dependency_injection/billpayment/jakarta/src/main/java/jakarta/tutorial/billpayment/payment/Debit.java ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Copyright (c), Eclipse Foundation, Inc. and its licensors.
3
+ *
4
+ * All rights reserved.
5
+ *
6
+ * This program and the accompanying materials are made available under the
7
+ * terms of the Eclipse Distribution License v1.0, which is available at
8
+ * https://www.eclipse.org/org/documents/edl-v10.php
9
+ *
10
+ * SPDX-License-Identifier: BSD-3-Clause
11
+ */
12
+ package jakarta.tutorial.billpayment.payment;
13
+
14
+ import static java.lang.annotation.ElementType.FIELD;
15
+ import static java.lang.annotation.ElementType.METHOD;
16
+ import static java.lang.annotation.ElementType.PARAMETER;
17
+ import static java.lang.annotation.ElementType.TYPE;
18
+ import static java.lang.annotation.RetentionPolicy.RUNTIME;
19
+
20
+ import java.lang.annotation.Retention;
21
+ import java.lang.annotation.Target;
22
+
23
+ import jakarta.inject.Qualifier;
24
+
25
+ /**
26
+ * Qualifier for Debit payment events.
27
+ */
28
+ @Qualifier
29
+ @Retention(RUNTIME)
30
+ @Target({METHOD, FIELD, PARAMETER, TYPE})
31
+ public @interface Debit {
32
+ }
benchmark/dependency_injection/billpayment/jakarta/src/main/java/jakarta/tutorial/billpayment/payment/PaymentBean.java ADDED
@@ -0,0 +1,118 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Copyright (c), Eclipse Foundation, Inc. and its licensors.
3
+ *
4
+ * All rights reserved.
5
+ *
6
+ * This program and the accompanying materials are made available under the
7
+ * terms of the Eclipse Distribution License v1.0, which is available at
8
+ * https://www.eclipse.org/org/documents/edl-v10.php
9
+ *
10
+ * SPDX-License-Identifier: BSD-3-Clause
11
+ */
12
+ package jakarta.tutorial.billpayment.payment;
13
+
14
+ import java.io.Serializable;
15
+ import java.math.BigDecimal;
16
+ import java.util.Calendar;
17
+ import java.util.Date;
18
+ import java.util.logging.Logger;
19
+
20
+ import jakarta.enterprise.context.SessionScoped;
21
+ import jakarta.enterprise.event.Event;
22
+ import jakarta.inject.Inject;
23
+ import jakarta.inject.Named;
24
+ import jakarta.tutorial.billpayment.event.PaymentEvent;
25
+ import jakarta.tutorial.billpayment.interceptor.Logged;
26
+ import jakarta.validation.constraints.Digits;
27
+
28
+ /**
29
+ * Bean that fires DEBIT and CREDIT payment events based on UI selection.
30
+ * Check server log output for event handling output.
31
+ */
32
+ @Named
33
+ @SessionScoped
34
+ public class PaymentBean implements Serializable {
35
+
36
+ private static final Logger logger =
37
+ Logger.getLogger(PaymentBean.class.getCanonicalName());
38
+ private static final long serialVersionUID = 7130389273118012929L;
39
+
40
+ @Inject
41
+ @Credit
42
+ Event<PaymentEvent> creditEvent;
43
+
44
+ @Inject
45
+ @Debit
46
+ Event<PaymentEvent> debitEvent;
47
+
48
+ private static final int DEBIT = 1;
49
+ private static final int CREDIT = 2;
50
+ private int paymentOption = DEBIT;
51
+
52
+ @Digits(integer = 10, fraction = 2, message = "Invalid value")
53
+ private BigDecimal value;
54
+
55
+ private Date datetime;
56
+
57
+ /**
58
+ * Fires a payment event.
59
+ *
60
+ * @return the response page location
61
+ */
62
+ @Logged
63
+ public String pay() {
64
+ this.setDatetime(Calendar.getInstance().getTime());
65
+ switch (paymentOption) {
66
+ case DEBIT:
67
+ PaymentEvent debitPayload = new PaymentEvent();
68
+ debitPayload.setPaymentType("Debit");
69
+ debitPayload.setValue(value);
70
+ debitPayload.setDatetime(datetime);
71
+ debitEvent.fire(debitPayload);
72
+ break;
73
+ case CREDIT:
74
+ PaymentEvent creditPayload = new PaymentEvent();
75
+ creditPayload.setPaymentType("Credit");
76
+ creditPayload.setValue(value);
77
+ creditPayload.setDatetime(datetime);
78
+ creditEvent.fire(creditPayload);
79
+ break;
80
+ default:
81
+ logger.severe("Invalid payment option!");
82
+ }
83
+ return "response";
84
+ }
85
+
86
+ /**
87
+ * Resets the values in the index page.
88
+ */
89
+ @Logged
90
+ public void reset() {
91
+ setPaymentOption(DEBIT);
92
+ setValue(BigDecimal.ZERO);
93
+ }
94
+
95
+ public int getPaymentOption() {
96
+ return this.paymentOption;
97
+ }
98
+
99
+ public void setPaymentOption(int paymentType) {
100
+ this.paymentOption = paymentType;
101
+ }
102
+
103
+ public BigDecimal getValue() {
104
+ return value;
105
+ }
106
+
107
+ public void setValue(BigDecimal value) {
108
+ this.value = value;
109
+ }
110
+
111
+ public Date getDatetime() {
112
+ return datetime;
113
+ }
114
+
115
+ public void setDatetime(Date datetime) {
116
+ this.datetime = datetime;
117
+ }
118
+ }
benchmark/dependency_injection/billpayment/jakarta/src/main/liberty/config/server.xml ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <server description="Open Liberty server">
3
+ <featureManager>
4
+ <feature>jakartaee-10.0</feature>
5
+ </featureManager>
6
+
7
+ <basicRegistry id="basic" realm="BasicRealm">
8
+ <user name="appuser" password="changeMe123!"/>
9
+ </basicRegistry>
10
+
11
+ <httpEndpoint id="defaultHttpEndpoint" host="*" httpPort="9080" httpsPort="9443"/>
12
+
13
+ <application location="billpayment.war" type="war"/>
14
+
15
+ </server>
benchmark/dependency_injection/billpayment/jakarta/src/main/webapp/WEB-INF/beans.xml ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!--
3
+
4
+ Copyright (c), Eclipse Foundation, Inc. and its licensors.
5
+
6
+ All rights reserved.
7
+
8
+ This program and the accompanying materials are made available under the
9
+ terms of the Eclipse Distribution License v1.0, which is available at
10
+ https://www.eclipse.org/org/documents/edl-v10.php
11
+
12
+ SPDX-License-Identifier: BSD-3-Clause
13
+
14
+ -->
15
+ <beans version="3.0" bean-discovery-mode="all"
16
+ xmlns="https://jakarta.ee/xml/ns/jakartaee"
17
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
18
+ xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/beans_3_0.xsd">
19
+ <interceptors>
20
+ <class>jakarta.tutorial.billpayment.interceptor.LoggedInterceptor</class>
21
+ </interceptors>
22
+ </beans>
23
+
benchmark/dependency_injection/billpayment/jakarta/src/main/webapp/WEB-INF/web.xml ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!--
3
+
4
+ Copyright (c), Eclipse Foundation, Inc. and its licensors.
5
+
6
+ All rights reserved.
7
+
8
+ This program and the accompanying materials are made available under the
9
+ terms of the Eclipse Distribution License v1.0, which is available at
10
+ https://www.eclipse.org/org/documents/edl-v10.php
11
+
12
+ SPDX-License-Identifier: BSD-3-Clause
13
+
14
+ -->
15
+ <web-app version="5.0"
16
+ xmlns="https://jakarta.ee/xml/ns/jakartaee"
17
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
18
+ xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-app_5_0.xsd">
19
+ <context-param>
20
+ <param-name>jakarta.faces.PROJECT_STAGE</param-name>
21
+ <param-value>Development</param-value>
22
+ </context-param>
23
+ <servlet>
24
+ <servlet-name>Faces Servlet</servlet-name>
25
+ <servlet-class>jakarta.faces.webapp.FacesServlet</servlet-class>
26
+ <load-on-startup>1</load-on-startup>
27
+ </servlet>
28
+ <servlet-mapping>
29
+ <servlet-name>Faces Servlet</servlet-name>
30
+ <url-pattern>*.xhtml</url-pattern>
31
+ </servlet-mapping>
32
+ <session-config>
33
+ <session-timeout>
34
+ 30
35
+ </session-timeout>
36
+ </session-config>
37
+ <welcome-file-list>
38
+ <welcome-file>index.xhtml</welcome-file>
39
+ </welcome-file-list>
40
+ </web-app>
benchmark/dependency_injection/billpayment/jakarta/src/main/webapp/index.xhtml ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version='1.0' encoding='UTF-8' ?>
2
+ <!--
3
+
4
+ Copyright (c), Eclipse Foundation, Inc. and its licensors.
5
+
6
+ All rights reserved.
7
+
8
+ This program and the accompanying materials are made available under the
9
+ terms of the Eclipse Distribution License v1.0, which is available at
10
+ https://www.eclipse.org/org/documents/edl-v10.php
11
+
12
+ SPDX-License-Identifier: BSD-3-Clause
13
+
14
+ -->
15
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
16
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
17
+ <html lang="en"
18
+ xmlns="http://www.w3.org/1999/xhtml"
19
+ xmlns:h="jakarta.faces.html"
20
+ xmlns:f="jakarta.faces.core">
21
+ <h:head>
22
+ <h:outputStylesheet library="css" name="default.css"/>
23
+ <title>Bill Payment Options</title>
24
+ </h:head>
25
+ <h:body>
26
+ <h3>Bill Payment Options</h3>
27
+ <p>Enter an amount, select Debit Card or Credit Card,
28
+ then click Pay.</p>
29
+ <h:form>
30
+ <p>
31
+ <h:outputLabel value="Amount: $" for="amt"/>
32
+ <h:inputText id="amt" value="#{paymentBean.value}"
33
+ required="true"
34
+ requiredMessage="An amount is required."
35
+ maxlength="15" />
36
+ </p>
37
+ <h:outputLabel value="Options:" for="opt"/>
38
+ <h:selectOneRadio id="opt" value="#{paymentBean.paymentOption}">
39
+ <f:selectItem id="debit" itemLabel="Debit Card"
40
+ itemValue="1"/>
41
+ <f:selectItem id="credit" itemLabel="Credit Card"
42
+ itemValue="2" />
43
+ </h:selectOneRadio>
44
+ <p><h:commandButton id="submit" value="Pay"
45
+ action="#{paymentBean.pay}" /></p>
46
+ <p><h:commandButton value="Reset"
47
+ action="#{paymentBean.reset}" /></p>
48
+ </h:form>
49
+ <div class="messagecolor">
50
+ <h:messages showSummary="true"
51
+ showDetail="false"
52
+ errorStyle="color: #d20005"
53
+ infoStyle="color: blue"/>
54
+ </div>
55
+ </h:body>
56
+ </html>
benchmark/dependency_injection/billpayment/jakarta/src/main/webapp/resources/css/default.css ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Copyright (c), Eclipse Foundation, Inc. and its licensors.
3
+ *
4
+ * All rights reserved.
5
+ *
6
+ * This program and the accompanying materials are made available under the
7
+ * terms of the Eclipse Distribution License v1.0, which is available at
8
+ * https://www.eclipse.org/org/documents/edl-v10.php
9
+ *
10
+ * SPDX-License-Identifier: BSD-3-Clause
11
+ */
12
+ body {
13
+ background-color: #ffffff;
14
+ font-size: 12px;
15
+ font-family: Verdana, "Verdana CE", Arial, "Arial CE", "Lucida Grande CE", lucida, "Helvetica CE", sans-serif;
16
+ color: #000000;
17
+ margin: 10px;
18
+ }
19
+
20
+ h1 {
21
+ font-family: Arial, "Arial CE", "Lucida Grande CE", lucida, "Helvetica CE", sans-serif;
22
+ border-bottom: 1px solid #AFAFAF;
23
+ font-size: 16px;
24
+ font-weight: bold;
25
+ margin: 0px;
26
+ padding: 0px;
27
+ color: #D20005;
28
+ }
29
+
30
+ a:link, a:visited {
31
+ color: #045491;
32
+ font-weight : bold;
33
+ text-decoration: none;
34
+ }
35
+
36
+ a:link:hover, a:visited:hover {
37
+ color: #045491;
38
+ font-weight : bold;
39
+ text-decoration : underline;
40
+ }
benchmark/dependency_injection/billpayment/jakarta/src/main/webapp/response.xhtml ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version='1.0' encoding='UTF-8' ?>
2
+ <!--
3
+
4
+ Copyright (c), Eclipse Foundation, Inc. and its licensors.
5
+
6
+ All rights reserved.
7
+
8
+ This program and the accompanying materials are made available under the
9
+ terms of the Eclipse Distribution License v1.0, which is available at
10
+ https://www.eclipse.org/org/documents/edl-v10.php
11
+
12
+ SPDX-License-Identifier: BSD-3-Clause
13
+
14
+ -->
15
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
16
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
17
+ <html lang="en"
18
+ xmlns="http://www.w3.org/1999/xhtml"
19
+ xmlns:h="jakarta.faces.html"
20
+ xmlns:f="jakarta.faces.core">
21
+ <h:head>
22
+ <h:outputStylesheet library="css" name="default.css"/>
23
+ <title>Bill Payment: Result</title>
24
+ </h:head>
25
+ <h:body>
26
+ <h:form>
27
+ <h2>Bill Payment: Result</h2>
28
+ <h3>Amount Paid with
29
+ <h:outputText id="debit" value="Debit Card: "
30
+ rendered="#{paymentBean.paymentOption eq 1}" />
31
+ <h:outputText id="credit" value="Credit Card: "
32
+ rendered="#{paymentBean.paymentOption eq 2}" />
33
+ <h:outputText id="result" value="#{paymentBean.value}" >
34
+ <f:convertNumber type="currency"/>
35
+ </h:outputText>
36
+ </h3>
37
+ <p><h:commandButton id="back" value="Back" action="index" /></p>
38
+ </h:form>
39
+ </h:body>
40
+ </html>
benchmark/dependency_injection/billpayment/jakarta/test.sh ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+
4
+ BASE_URL="${BASE_URL:-http://localhost:9080/billpayment}"
5
+
6
+ echo "Health check: ${BASE_URL}"
7
+ HTTP_STATUS=$(curl -sL -o /dev/null -w "%{http_code}" "${BASE_URL}")
8
+
9
+ if [ "$HTTP_STATUS" -eq 200 ]; then
10
+ echo "PASS - got HTTP ${HTTP_STATUS}"
11
+ exit 0
12
+ else
13
+ echo "FAIL - got HTTP ${HTTP_STATUS}"
14
+ exit 1
15
+ fi
benchmark/dependency_injection/billpayment/quarkus/.dockerignore ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # VCS
2
+ .git/
3
+
4
+ # Maven
5
+ .mvn/
6
+ **/.mvn/
7
+ mvnw
8
+ mvnw.cmd
9
+ **/mvnw
10
+ **/mvnw.cmd
11
+ target/
12
+ **/target/
13
+ pom.xml.tag
14
+ pom.xml.releaseBackup
15
+ pom.xml.versionsBackup
16
+ pom.xml.next
17
+ release.properties
18
+ dependency-reduced-pom.xml
19
+ buildNumber.properties
20
+
21
+ # IDE / Editor
22
+ .vscode/
23
+ **/.vscode/
24
+ .zed/
25
+ **/.zed/
26
+ .idea/
27
+ **/.idea/
28
+ *.iml
29
+ *.ipr
30
+ *.iws
31
+
32
+ # OS
33
+ .DS_Store
34
+ **/.DS_Store
35
+ Thumbs.db
36
+ ehthumbs.db
37
+
38
+ # Logs / temp
39
+ *.log
40
+ *.tmp
41
+ *.temp
benchmark/dependency_injection/billpayment/quarkus/.mvn/wrapper/MavenWrapperDownloader.java ADDED
@@ -0,0 +1,117 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Copyright 2007-present the original author or authors.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import java.net.*;
17
+ import java.io.*;
18
+ import java.nio.channels.*;
19
+ import java.util.Properties;
20
+
21
+ public class MavenWrapperDownloader {
22
+
23
+ private static final String WRAPPER_VERSION = "0.5.6";
24
+ /**
25
+ * Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided.
26
+ */
27
+ private static final String DEFAULT_DOWNLOAD_URL = "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/"
28
+ + WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar";
29
+
30
+ /**
31
+ * Path to the maven-wrapper.properties file, which might contain a downloadUrl property to
32
+ * use instead of the default one.
33
+ */
34
+ private static final String MAVEN_WRAPPER_PROPERTIES_PATH =
35
+ ".mvn/wrapper/maven-wrapper.properties";
36
+
37
+ /**
38
+ * Path where the maven-wrapper.jar will be saved to.
39
+ */
40
+ private static final String MAVEN_WRAPPER_JAR_PATH =
41
+ ".mvn/wrapper/maven-wrapper.jar";
42
+
43
+ /**
44
+ * Name of the property which should be used to override the default download url for the wrapper.
45
+ */
46
+ private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl";
47
+
48
+ public static void main(String args[]) {
49
+ System.out.println("- Downloader started");
50
+ File baseDirectory = new File(args[0]);
51
+ System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath());
52
+
53
+ // If the maven-wrapper.properties exists, read it and check if it contains a custom
54
+ // wrapperUrl parameter.
55
+ File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH);
56
+ String url = DEFAULT_DOWNLOAD_URL;
57
+ if(mavenWrapperPropertyFile.exists()) {
58
+ FileInputStream mavenWrapperPropertyFileInputStream = null;
59
+ try {
60
+ mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile);
61
+ Properties mavenWrapperProperties = new Properties();
62
+ mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream);
63
+ url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url);
64
+ } catch (IOException e) {
65
+ System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'");
66
+ } finally {
67
+ try {
68
+ if(mavenWrapperPropertyFileInputStream != null) {
69
+ mavenWrapperPropertyFileInputStream.close();
70
+ }
71
+ } catch (IOException e) {
72
+ // Ignore ...
73
+ }
74
+ }
75
+ }
76
+ System.out.println("- Downloading from: " + url);
77
+
78
+ File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH);
79
+ if(!outputFile.getParentFile().exists()) {
80
+ if(!outputFile.getParentFile().mkdirs()) {
81
+ System.out.println(
82
+ "- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'");
83
+ }
84
+ }
85
+ System.out.println("- Downloading to: " + outputFile.getAbsolutePath());
86
+ try {
87
+ downloadFileFromURL(url, outputFile);
88
+ System.out.println("Done");
89
+ System.exit(0);
90
+ } catch (Throwable e) {
91
+ System.out.println("- Error downloading");
92
+ e.printStackTrace();
93
+ System.exit(1);
94
+ }
95
+ }
96
+
97
+ private static void downloadFileFromURL(String urlString, File destination) throws Exception {
98
+ if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) {
99
+ String username = System.getenv("MVNW_USERNAME");
100
+ char[] password = System.getenv("MVNW_PASSWORD").toCharArray();
101
+ Authenticator.setDefault(new Authenticator() {
102
+ @Override
103
+ protected PasswordAuthentication getPasswordAuthentication() {
104
+ return new PasswordAuthentication(username, password);
105
+ }
106
+ });
107
+ }
108
+ URL website = new URL(urlString);
109
+ ReadableByteChannel rbc;
110
+ rbc = Channels.newChannel(website.openStream());
111
+ FileOutputStream fos = new FileOutputStream(destination);
112
+ fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
113
+ fos.close();
114
+ rbc.close();
115
+ }
116
+
117
+ }
benchmark/dependency_injection/billpayment/quarkus/.mvn/wrapper/maven-wrapper.properties ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.4/apache-maven-3.9.4-bin.zip
2
+ wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar
benchmark/dependency_injection/billpayment/quarkus/Dockerfile ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM maven:3.9.12-ibm-semeru-21-noble
2
+
3
+ USER root
4
+ # install uv
5
+ RUN apt-get update && apt-get install -y --no-install-recommends curl lsof python3-venv python3-full && curl -LsSf https://astral.sh/uv/install.sh | sh
6
+
7
+ ENV PATH="/root/.local/bin:$PATH"
8
+
9
+ # Shared browsers path so Chromium is cached once
10
+ ENV PLAYWRIGHT_BROWSERS_PATH=/ms-playwright
11
+ RUN mkdir -p /ms-playwright && chmod 755 /ms-playwright
12
+
13
+ # create venv and install
14
+ RUN uv venv /opt/venv && uv pip install --python /opt/venv/bin/python playwright==1.47.0 pytest
15
+
16
+ ENV PATH="/opt/venv/bin:$PATH"
17
+ RUN playwright install --with-deps chromium
18
+
19
+ # Set working directory
20
+ WORKDIR /app
21
+
22
+ # Copy all the assets
23
+ COPY . .
24
+
25
+ # Build the application at image build time
26
+ RUN mvn clean install -DskipTests
27
+
28
+ COPY test.sh .
29
+ RUN chmod +x test.sh
30
+
31
+ RUN mvn clean install -DskipTests
32
+
33
+ CMD ["mvn", "quarkus:run"]
benchmark/dependency_injection/billpayment/quarkus/README.md ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # billpayment
2
+
3
+ This project uses Quarkus, the Supersonic Subatomic Java Framework.
4
+
5
+ If you want to learn more about Quarkus, please visit its website: <https://quarkus.io/>.
6
+
7
+ ## Running the application in dev mode
8
+
9
+ You can run your application in dev mode that enables live coding using:
10
+
11
+ ```shell script
12
+ ./mvnw quarkus:dev
13
+ ```
14
+
15
+ > **_NOTE:_** Quarkus now ships with a Dev UI, which is available in dev mode only at <http://localhost:8080/q/dev/>.
16
+
17
+ ## Packaging and running the application
18
+
19
+ The application can be packaged using:
20
+
21
+ ```shell script
22
+ ./mvnw package
23
+ ```
24
+
25
+ It produces the `quarkus-run.jar` file in the `target/quarkus-app/` directory.
26
+ Be aware that it’s not an _über-jar_ as the dependencies are copied into the `target/quarkus-app/lib/` directory.
27
+
28
+ The application is now runnable using `java -jar target/quarkus-app/quarkus-run.jar`.
29
+
30
+ If you want to build an _über-jar_, execute the following command:
31
+
32
+ ```shell script
33
+ ./mvnw package -Dquarkus.package.jar.type=uber-jar
34
+ ```
35
+
36
+ The application, packaged as an _über-jar_, is now runnable using `java -jar target/*-runner.jar`.
37
+
38
+ ## Creating a native executable
39
+
40
+ You can create a native executable using:
41
+
42
+ ```shell script
43
+ ./mvnw package -Dnative
44
+ ```
45
+
46
+ Or, if you don't have GraalVM installed, you can run the native executable build in a container using:
47
+
48
+ ```shell script
49
+ ./mvnw package -Dnative -Dquarkus.native.container-build=true
50
+ ```
51
+
52
+ You can then execute your native executable with: `./target/billpayment-1.0.0-SNAPSHOT-runner`
53
+
54
+ If you want to learn more about building native executables, please consult <https://quarkus.io/guides/maven-tooling>.
55
+
56
+ ## Related Guides
57
+
58
+ - Apache MyFaces ([guide](https://myfaces.apache.org/#/coregettingstarted?id=quarkus)): Apache MyFaces is a JSF / Faces implementation.
benchmark/dependency_injection/billpayment/quarkus/mvnw ADDED
@@ -0,0 +1,295 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/sh
2
+ # ----------------------------------------------------------------------------
3
+ # Licensed to the Apache Software Foundation (ASF) under one
4
+ # or more contributor license agreements. See the NOTICE file
5
+ # distributed with this work for additional information
6
+ # regarding copyright ownership. The ASF licenses this file
7
+ # to you under the Apache License, Version 2.0 (the
8
+ # "License"); you may not use this file except in compliance
9
+ # with the License. You may obtain a copy of the License at
10
+ #
11
+ # http://www.apache.org/licenses/LICENSE-2.0
12
+ #
13
+ # Unless required by applicable law or agreed to in writing,
14
+ # software distributed under the License is distributed on an
15
+ # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16
+ # KIND, either express or implied. See the License for the
17
+ # specific language governing permissions and limitations
18
+ # under the License.
19
+ # ----------------------------------------------------------------------------
20
+
21
+ # ----------------------------------------------------------------------------
22
+ # Apache Maven Wrapper startup batch script, version 3.3.4
23
+ #
24
+ # Optional ENV vars
25
+ # -----------------
26
+ # JAVA_HOME - location of a JDK home dir, required when download maven via java source
27
+ # MVNW_REPOURL - repo url base for downloading maven distribution
28
+ # MVNW_USERNAME/MVNW_PASSWORD - user and password for downloading maven
29
+ # MVNW_VERBOSE - true: enable verbose log; debug: trace the mvnw script; others: silence the output
30
+ # ----------------------------------------------------------------------------
31
+
32
+ set -euf
33
+ [ "${MVNW_VERBOSE-}" != debug ] || set -x
34
+
35
+ # OS specific support.
36
+ native_path() { printf %s\\n "$1"; }
37
+ case "$(uname)" in
38
+ CYGWIN* | MINGW*)
39
+ [ -z "${JAVA_HOME-}" ] || JAVA_HOME="$(cygpath --unix "$JAVA_HOME")"
40
+ native_path() { cygpath --path --windows "$1"; }
41
+ ;;
42
+ esac
43
+
44
+ # set JAVACMD and JAVACCMD
45
+ set_java_home() {
46
+ # For Cygwin and MinGW, ensure paths are in Unix format before anything is touched
47
+ if [ -n "${JAVA_HOME-}" ]; then
48
+ if [ -x "$JAVA_HOME/jre/sh/java" ]; then
49
+ # IBM's JDK on AIX uses strange locations for the executables
50
+ JAVACMD="$JAVA_HOME/jre/sh/java"
51
+ JAVACCMD="$JAVA_HOME/jre/sh/javac"
52
+ else
53
+ JAVACMD="$JAVA_HOME/bin/java"
54
+ JAVACCMD="$JAVA_HOME/bin/javac"
55
+
56
+ if [ ! -x "$JAVACMD" ] || [ ! -x "$JAVACCMD" ]; then
57
+ echo "The JAVA_HOME environment variable is not defined correctly, so mvnw cannot run." >&2
58
+ echo "JAVA_HOME is set to \"$JAVA_HOME\", but \"\$JAVA_HOME/bin/java\" or \"\$JAVA_HOME/bin/javac\" does not exist." >&2
59
+ return 1
60
+ fi
61
+ fi
62
+ else
63
+ JAVACMD="$(
64
+ 'set' +e
65
+ 'unset' -f command 2>/dev/null
66
+ 'command' -v java
67
+ )" || :
68
+ JAVACCMD="$(
69
+ 'set' +e
70
+ 'unset' -f command 2>/dev/null
71
+ 'command' -v javac
72
+ )" || :
73
+
74
+ if [ ! -x "${JAVACMD-}" ] || [ ! -x "${JAVACCMD-}" ]; then
75
+ echo "The java/javac command does not exist in PATH nor is JAVA_HOME set, so mvnw cannot run." >&2
76
+ return 1
77
+ fi
78
+ fi
79
+ }
80
+
81
+ # hash string like Java String::hashCode
82
+ hash_string() {
83
+ str="${1:-}" h=0
84
+ while [ -n "$str" ]; do
85
+ char="${str%"${str#?}"}"
86
+ h=$(((h * 31 + $(LC_CTYPE=C printf %d "'$char")) % 4294967296))
87
+ str="${str#?}"
88
+ done
89
+ printf %x\\n $h
90
+ }
91
+
92
+ verbose() { :; }
93
+ [ "${MVNW_VERBOSE-}" != true ] || verbose() { printf %s\\n "${1-}"; }
94
+
95
+ die() {
96
+ printf %s\\n "$1" >&2
97
+ exit 1
98
+ }
99
+
100
+ trim() {
101
+ # MWRAPPER-139:
102
+ # Trims trailing and leading whitespace, carriage returns, tabs, and linefeeds.
103
+ # Needed for removing poorly interpreted newline sequences when running in more
104
+ # exotic environments such as mingw bash on Windows.
105
+ printf "%s" "${1}" | tr -d '[:space:]'
106
+ }
107
+
108
+ scriptDir="$(dirname "$0")"
109
+ scriptName="$(basename "$0")"
110
+
111
+ # parse distributionUrl and optional distributionSha256Sum, requires .mvn/wrapper/maven-wrapper.properties
112
+ while IFS="=" read -r key value; do
113
+ case "${key-}" in
114
+ distributionUrl) distributionUrl=$(trim "${value-}") ;;
115
+ distributionSha256Sum) distributionSha256Sum=$(trim "${value-}") ;;
116
+ esac
117
+ done <"$scriptDir/.mvn/wrapper/maven-wrapper.properties"
118
+ [ -n "${distributionUrl-}" ] || die "cannot read distributionUrl property in $scriptDir/.mvn/wrapper/maven-wrapper.properties"
119
+
120
+ case "${distributionUrl##*/}" in
121
+ maven-mvnd-*bin.*)
122
+ MVN_CMD=mvnd.sh _MVNW_REPO_PATTERN=/maven/mvnd/
123
+ case "${PROCESSOR_ARCHITECTURE-}${PROCESSOR_ARCHITEW6432-}:$(uname -a)" in
124
+ *AMD64:CYGWIN* | *AMD64:MINGW*) distributionPlatform=windows-amd64 ;;
125
+ :Darwin*x86_64) distributionPlatform=darwin-amd64 ;;
126
+ :Darwin*arm64) distributionPlatform=darwin-aarch64 ;;
127
+ :Linux*x86_64*) distributionPlatform=linux-amd64 ;;
128
+ *)
129
+ echo "Cannot detect native platform for mvnd on $(uname)-$(uname -m), use pure java version" >&2
130
+ distributionPlatform=linux-amd64
131
+ ;;
132
+ esac
133
+ distributionUrl="${distributionUrl%-bin.*}-$distributionPlatform.zip"
134
+ ;;
135
+ maven-mvnd-*) MVN_CMD=mvnd.sh _MVNW_REPO_PATTERN=/maven/mvnd/ ;;
136
+ *) MVN_CMD="mvn${scriptName#mvnw}" _MVNW_REPO_PATTERN=/org/apache/maven/ ;;
137
+ esac
138
+
139
+ # apply MVNW_REPOURL and calculate MAVEN_HOME
140
+ # maven home pattern: ~/.m2/wrapper/dists/{apache-maven-<version>,maven-mvnd-<version>-<platform>}/<hash>
141
+ [ -z "${MVNW_REPOURL-}" ] || distributionUrl="$MVNW_REPOURL$_MVNW_REPO_PATTERN${distributionUrl#*"$_MVNW_REPO_PATTERN"}"
142
+ distributionUrlName="${distributionUrl##*/}"
143
+ distributionUrlNameMain="${distributionUrlName%.*}"
144
+ distributionUrlNameMain="${distributionUrlNameMain%-bin}"
145
+ MAVEN_USER_HOME="${MAVEN_USER_HOME:-${HOME}/.m2}"
146
+ MAVEN_HOME="${MAVEN_USER_HOME}/wrapper/dists/${distributionUrlNameMain-}/$(hash_string "$distributionUrl")"
147
+
148
+ exec_maven() {
149
+ unset MVNW_VERBOSE MVNW_USERNAME MVNW_PASSWORD MVNW_REPOURL || :
150
+ exec "$MAVEN_HOME/bin/$MVN_CMD" "$@" || die "cannot exec $MAVEN_HOME/bin/$MVN_CMD"
151
+ }
152
+
153
+ if [ -d "$MAVEN_HOME" ]; then
154
+ verbose "found existing MAVEN_HOME at $MAVEN_HOME"
155
+ exec_maven "$@"
156
+ fi
157
+
158
+ case "${distributionUrl-}" in
159
+ *?-bin.zip | *?maven-mvnd-?*-?*.zip) ;;
160
+ *) die "distributionUrl is not valid, must match *-bin.zip or maven-mvnd-*.zip, but found '${distributionUrl-}'" ;;
161
+ esac
162
+
163
+ # prepare tmp dir
164
+ if TMP_DOWNLOAD_DIR="$(mktemp -d)" && [ -d "$TMP_DOWNLOAD_DIR" ]; then
165
+ clean() { rm -rf -- "$TMP_DOWNLOAD_DIR"; }
166
+ trap clean HUP INT TERM EXIT
167
+ else
168
+ die "cannot create temp dir"
169
+ fi
170
+
171
+ mkdir -p -- "${MAVEN_HOME%/*}"
172
+
173
+ # Download and Install Apache Maven
174
+ verbose "Couldn't find MAVEN_HOME, downloading and installing it ..."
175
+ verbose "Downloading from: $distributionUrl"
176
+ verbose "Downloading to: $TMP_DOWNLOAD_DIR/$distributionUrlName"
177
+
178
+ # select .zip or .tar.gz
179
+ if ! command -v unzip >/dev/null; then
180
+ distributionUrl="${distributionUrl%.zip}.tar.gz"
181
+ distributionUrlName="${distributionUrl##*/}"
182
+ fi
183
+
184
+ # verbose opt
185
+ __MVNW_QUIET_WGET=--quiet __MVNW_QUIET_CURL=--silent __MVNW_QUIET_UNZIP=-q __MVNW_QUIET_TAR=''
186
+ [ "${MVNW_VERBOSE-}" != true ] || __MVNW_QUIET_WGET='' __MVNW_QUIET_CURL='' __MVNW_QUIET_UNZIP='' __MVNW_QUIET_TAR=v
187
+
188
+ # normalize http auth
189
+ case "${MVNW_PASSWORD:+has-password}" in
190
+ '') MVNW_USERNAME='' MVNW_PASSWORD='' ;;
191
+ has-password) [ -n "${MVNW_USERNAME-}" ] || MVNW_USERNAME='' MVNW_PASSWORD='' ;;
192
+ esac
193
+
194
+ if [ -z "${MVNW_USERNAME-}" ] && command -v wget >/dev/null; then
195
+ verbose "Found wget ... using wget"
196
+ wget ${__MVNW_QUIET_WGET:+"$__MVNW_QUIET_WGET"} "$distributionUrl" -O "$TMP_DOWNLOAD_DIR/$distributionUrlName" || die "wget: Failed to fetch $distributionUrl"
197
+ elif [ -z "${MVNW_USERNAME-}" ] && command -v curl >/dev/null; then
198
+ verbose "Found curl ... using curl"
199
+ curl ${__MVNW_QUIET_CURL:+"$__MVNW_QUIET_CURL"} -f -L -o "$TMP_DOWNLOAD_DIR/$distributionUrlName" "$distributionUrl" || die "curl: Failed to fetch $distributionUrl"
200
+ elif set_java_home; then
201
+ verbose "Falling back to use Java to download"
202
+ javaSource="$TMP_DOWNLOAD_DIR/Downloader.java"
203
+ targetZip="$TMP_DOWNLOAD_DIR/$distributionUrlName"
204
+ cat >"$javaSource" <<-END
205
+ public class Downloader extends java.net.Authenticator
206
+ {
207
+ protected java.net.PasswordAuthentication getPasswordAuthentication()
208
+ {
209
+ return new java.net.PasswordAuthentication( System.getenv( "MVNW_USERNAME" ), System.getenv( "MVNW_PASSWORD" ).toCharArray() );
210
+ }
211
+ public static void main( String[] args ) throws Exception
212
+ {
213
+ setDefault( new Downloader() );
214
+ java.nio.file.Files.copy( java.net.URI.create( args[0] ).toURL().openStream(), java.nio.file.Paths.get( args[1] ).toAbsolutePath().normalize() );
215
+ }
216
+ }
217
+ END
218
+ # For Cygwin/MinGW, switch paths to Windows format before running javac and java
219
+ verbose " - Compiling Downloader.java ..."
220
+ "$(native_path "$JAVACCMD")" "$(native_path "$javaSource")" || die "Failed to compile Downloader.java"
221
+ verbose " - Running Downloader.java ..."
222
+ "$(native_path "$JAVACMD")" -cp "$(native_path "$TMP_DOWNLOAD_DIR")" Downloader "$distributionUrl" "$(native_path "$targetZip")"
223
+ fi
224
+
225
+ # If specified, validate the SHA-256 sum of the Maven distribution zip file
226
+ if [ -n "${distributionSha256Sum-}" ]; then
227
+ distributionSha256Result=false
228
+ if [ "$MVN_CMD" = mvnd.sh ]; then
229
+ echo "Checksum validation is not supported for maven-mvnd." >&2
230
+ echo "Please disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties." >&2
231
+ exit 1
232
+ elif command -v sha256sum >/dev/null; then
233
+ if echo "$distributionSha256Sum $TMP_DOWNLOAD_DIR/$distributionUrlName" | sha256sum -c - >/dev/null 2>&1; then
234
+ distributionSha256Result=true
235
+ fi
236
+ elif command -v shasum >/dev/null; then
237
+ if echo "$distributionSha256Sum $TMP_DOWNLOAD_DIR/$distributionUrlName" | shasum -a 256 -c >/dev/null 2>&1; then
238
+ distributionSha256Result=true
239
+ fi
240
+ else
241
+ echo "Checksum validation was requested but neither 'sha256sum' or 'shasum' are available." >&2
242
+ echo "Please install either command, or disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties." >&2
243
+ exit 1
244
+ fi
245
+ if [ $distributionSha256Result = false ]; then
246
+ echo "Error: Failed to validate Maven distribution SHA-256, your Maven distribution might be compromised." >&2
247
+ echo "If you updated your Maven version, you need to update the specified distributionSha256Sum property." >&2
248
+ exit 1
249
+ fi
250
+ fi
251
+
252
+ # unzip and move
253
+ if command -v unzip >/dev/null; then
254
+ unzip ${__MVNW_QUIET_UNZIP:+"$__MVNW_QUIET_UNZIP"} "$TMP_DOWNLOAD_DIR/$distributionUrlName" -d "$TMP_DOWNLOAD_DIR" || die "failed to unzip"
255
+ else
256
+ tar xzf${__MVNW_QUIET_TAR:+"$__MVNW_QUIET_TAR"} "$TMP_DOWNLOAD_DIR/$distributionUrlName" -C "$TMP_DOWNLOAD_DIR" || die "failed to untar"
257
+ fi
258
+
259
+ # Find the actual extracted directory name (handles snapshots where filename != directory name)
260
+ actualDistributionDir=""
261
+
262
+ # First try the expected directory name (for regular distributions)
263
+ if [ -d "$TMP_DOWNLOAD_DIR/$distributionUrlNameMain" ]; then
264
+ if [ -f "$TMP_DOWNLOAD_DIR/$distributionUrlNameMain/bin/$MVN_CMD" ]; then
265
+ actualDistributionDir="$distributionUrlNameMain"
266
+ fi
267
+ fi
268
+
269
+ # If not found, search for any directory with the Maven executable (for snapshots)
270
+ if [ -z "$actualDistributionDir" ]; then
271
+ # enable globbing to iterate over items
272
+ set +f
273
+ for dir in "$TMP_DOWNLOAD_DIR"/*; do
274
+ if [ -d "$dir" ]; then
275
+ if [ -f "$dir/bin/$MVN_CMD" ]; then
276
+ actualDistributionDir="$(basename "$dir")"
277
+ break
278
+ fi
279
+ fi
280
+ done
281
+ set -f
282
+ fi
283
+
284
+ if [ -z "$actualDistributionDir" ]; then
285
+ verbose "Contents of $TMP_DOWNLOAD_DIR:"
286
+ verbose "$(ls -la "$TMP_DOWNLOAD_DIR")"
287
+ die "Could not find Maven distribution directory in extracted archive"
288
+ fi
289
+
290
+ verbose "Found extracted Maven distribution directory: $actualDistributionDir"
291
+ printf %s\\n "$distributionUrl" >"$TMP_DOWNLOAD_DIR/$actualDistributionDir/mvnw.url"
292
+ mv -- "$TMP_DOWNLOAD_DIR/$actualDistributionDir" "$MAVEN_HOME" || [ -d "$MAVEN_HOME" ] || die "fail to move MAVEN_HOME"
293
+
294
+ clean || :
295
+ exec_maven "$@"
benchmark/dependency_injection/billpayment/quarkus/mvnw.cmd ADDED
@@ -0,0 +1,189 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <# : batch portion
2
+ @REM ----------------------------------------------------------------------------
3
+ @REM Licensed to the Apache Software Foundation (ASF) under one
4
+ @REM or more contributor license agreements. See the NOTICE file
5
+ @REM distributed with this work for additional information
6
+ @REM regarding copyright ownership. The ASF licenses this file
7
+ @REM to you under the Apache License, Version 2.0 (the
8
+ @REM "License"); you may not use this file except in compliance
9
+ @REM with the License. You may obtain a copy of the License at
10
+ @REM
11
+ @REM http://www.apache.org/licenses/LICENSE-2.0
12
+ @REM
13
+ @REM Unless required by applicable law or agreed to in writing,
14
+ @REM software distributed under the License is distributed on an
15
+ @REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16
+ @REM KIND, either express or implied. See the License for the
17
+ @REM specific language governing permissions and limitations
18
+ @REM under the License.
19
+ @REM ----------------------------------------------------------------------------
20
+
21
+ @REM ----------------------------------------------------------------------------
22
+ @REM Apache Maven Wrapper startup batch script, version 3.3.4
23
+ @REM
24
+ @REM Optional ENV vars
25
+ @REM MVNW_REPOURL - repo url base for downloading maven distribution
26
+ @REM MVNW_USERNAME/MVNW_PASSWORD - user and password for downloading maven
27
+ @REM MVNW_VERBOSE - true: enable verbose log; others: silence the output
28
+ @REM ----------------------------------------------------------------------------
29
+
30
+ @IF "%__MVNW_ARG0_NAME__%"=="" (SET __MVNW_ARG0_NAME__=%~nx0)
31
+ @SET __MVNW_CMD__=
32
+ @SET __MVNW_ERROR__=
33
+ @SET __MVNW_PSMODULEP_SAVE=%PSModulePath%
34
+ @SET PSModulePath=
35
+ @FOR /F "usebackq tokens=1* delims==" %%A IN (`powershell -noprofile "& {$scriptDir='%~dp0'; $script='%__MVNW_ARG0_NAME__%'; icm -ScriptBlock ([Scriptblock]::Create((Get-Content -Raw '%~f0'))) -NoNewScope}"`) DO @(
36
+ IF "%%A"=="MVN_CMD" (set __MVNW_CMD__=%%B) ELSE IF "%%B"=="" (echo %%A) ELSE (echo %%A=%%B)
37
+ )
38
+ @SET PSModulePath=%__MVNW_PSMODULEP_SAVE%
39
+ @SET __MVNW_PSMODULEP_SAVE=
40
+ @SET __MVNW_ARG0_NAME__=
41
+ @SET MVNW_USERNAME=
42
+ @SET MVNW_PASSWORD=
43
+ @IF NOT "%__MVNW_CMD__%"=="" ("%__MVNW_CMD__%" %*)
44
+ @echo Cannot start maven from wrapper >&2 && exit /b 1
45
+ @GOTO :EOF
46
+ : end batch / begin powershell #>
47
+
48
+ $ErrorActionPreference = "Stop"
49
+ if ($env:MVNW_VERBOSE -eq "true") {
50
+ $VerbosePreference = "Continue"
51
+ }
52
+
53
+ # calculate distributionUrl, requires .mvn/wrapper/maven-wrapper.properties
54
+ $distributionUrl = (Get-Content -Raw "$scriptDir/.mvn/wrapper/maven-wrapper.properties" | ConvertFrom-StringData).distributionUrl
55
+ if (!$distributionUrl) {
56
+ Write-Error "cannot read distributionUrl property in $scriptDir/.mvn/wrapper/maven-wrapper.properties"
57
+ }
58
+
59
+ switch -wildcard -casesensitive ( $($distributionUrl -replace '^.*/','') ) {
60
+ "maven-mvnd-*" {
61
+ $USE_MVND = $true
62
+ $distributionUrl = $distributionUrl -replace '-bin\.[^.]*$',"-windows-amd64.zip"
63
+ $MVN_CMD = "mvnd.cmd"
64
+ break
65
+ }
66
+ default {
67
+ $USE_MVND = $false
68
+ $MVN_CMD = $script -replace '^mvnw','mvn'
69
+ break
70
+ }
71
+ }
72
+
73
+ # apply MVNW_REPOURL and calculate MAVEN_HOME
74
+ # maven home pattern: ~/.m2/wrapper/dists/{apache-maven-<version>,maven-mvnd-<version>-<platform>}/<hash>
75
+ if ($env:MVNW_REPOURL) {
76
+ $MVNW_REPO_PATTERN = if ($USE_MVND -eq $False) { "/org/apache/maven/" } else { "/maven/mvnd/" }
77
+ $distributionUrl = "$env:MVNW_REPOURL$MVNW_REPO_PATTERN$($distributionUrl -replace "^.*$MVNW_REPO_PATTERN",'')"
78
+ }
79
+ $distributionUrlName = $distributionUrl -replace '^.*/',''
80
+ $distributionUrlNameMain = $distributionUrlName -replace '\.[^.]*$','' -replace '-bin$',''
81
+
82
+ $MAVEN_M2_PATH = "$HOME/.m2"
83
+ if ($env:MAVEN_USER_HOME) {
84
+ $MAVEN_M2_PATH = "$env:MAVEN_USER_HOME"
85
+ }
86
+
87
+ if (-not (Test-Path -Path $MAVEN_M2_PATH)) {
88
+ New-Item -Path $MAVEN_M2_PATH -ItemType Directory | Out-Null
89
+ }
90
+
91
+ $MAVEN_WRAPPER_DISTS = $null
92
+ if ((Get-Item $MAVEN_M2_PATH).Target[0] -eq $null) {
93
+ $MAVEN_WRAPPER_DISTS = "$MAVEN_M2_PATH/wrapper/dists"
94
+ } else {
95
+ $MAVEN_WRAPPER_DISTS = (Get-Item $MAVEN_M2_PATH).Target[0] + "/wrapper/dists"
96
+ }
97
+
98
+ $MAVEN_HOME_PARENT = "$MAVEN_WRAPPER_DISTS/$distributionUrlNameMain"
99
+ $MAVEN_HOME_NAME = ([System.Security.Cryptography.SHA256]::Create().ComputeHash([byte[]][char[]]$distributionUrl) | ForEach-Object {$_.ToString("x2")}) -join ''
100
+ $MAVEN_HOME = "$MAVEN_HOME_PARENT/$MAVEN_HOME_NAME"
101
+
102
+ if (Test-Path -Path "$MAVEN_HOME" -PathType Container) {
103
+ Write-Verbose "found existing MAVEN_HOME at $MAVEN_HOME"
104
+ Write-Output "MVN_CMD=$MAVEN_HOME/bin/$MVN_CMD"
105
+ exit $?
106
+ }
107
+
108
+ if (! $distributionUrlNameMain -or ($distributionUrlName -eq $distributionUrlNameMain)) {
109
+ Write-Error "distributionUrl is not valid, must end with *-bin.zip, but found $distributionUrl"
110
+ }
111
+
112
+ # prepare tmp dir
113
+ $TMP_DOWNLOAD_DIR_HOLDER = New-TemporaryFile
114
+ $TMP_DOWNLOAD_DIR = New-Item -Itemtype Directory -Path "$TMP_DOWNLOAD_DIR_HOLDER.dir"
115
+ $TMP_DOWNLOAD_DIR_HOLDER.Delete() | Out-Null
116
+ trap {
117
+ if ($TMP_DOWNLOAD_DIR.Exists) {
118
+ try { Remove-Item $TMP_DOWNLOAD_DIR -Recurse -Force | Out-Null }
119
+ catch { Write-Warning "Cannot remove $TMP_DOWNLOAD_DIR" }
120
+ }
121
+ }
122
+
123
+ New-Item -Itemtype Directory -Path "$MAVEN_HOME_PARENT" -Force | Out-Null
124
+
125
+ # Download and Install Apache Maven
126
+ Write-Verbose "Couldn't find MAVEN_HOME, downloading and installing it ..."
127
+ Write-Verbose "Downloading from: $distributionUrl"
128
+ Write-Verbose "Downloading to: $TMP_DOWNLOAD_DIR/$distributionUrlName"
129
+
130
+ $webclient = New-Object System.Net.WebClient
131
+ if ($env:MVNW_USERNAME -and $env:MVNW_PASSWORD) {
132
+ $webclient.Credentials = New-Object System.Net.NetworkCredential($env:MVNW_USERNAME, $env:MVNW_PASSWORD)
133
+ }
134
+ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
135
+ $webclient.DownloadFile($distributionUrl, "$TMP_DOWNLOAD_DIR/$distributionUrlName") | Out-Null
136
+
137
+ # If specified, validate the SHA-256 sum of the Maven distribution zip file
138
+ $distributionSha256Sum = (Get-Content -Raw "$scriptDir/.mvn/wrapper/maven-wrapper.properties" | ConvertFrom-StringData).distributionSha256Sum
139
+ if ($distributionSha256Sum) {
140
+ if ($USE_MVND) {
141
+ Write-Error "Checksum validation is not supported for maven-mvnd. `nPlease disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties."
142
+ }
143
+ Import-Module $PSHOME\Modules\Microsoft.PowerShell.Utility -Function Get-FileHash
144
+ if ((Get-FileHash "$TMP_DOWNLOAD_DIR/$distributionUrlName" -Algorithm SHA256).Hash.ToLower() -ne $distributionSha256Sum) {
145
+ Write-Error "Error: Failed to validate Maven distribution SHA-256, your Maven distribution might be compromised. If you updated your Maven version, you need to update the specified distributionSha256Sum property."
146
+ }
147
+ }
148
+
149
+ # unzip and move
150
+ Expand-Archive "$TMP_DOWNLOAD_DIR/$distributionUrlName" -DestinationPath "$TMP_DOWNLOAD_DIR" | Out-Null
151
+
152
+ # Find the actual extracted directory name (handles snapshots where filename != directory name)
153
+ $actualDistributionDir = ""
154
+
155
+ # First try the expected directory name (for regular distributions)
156
+ $expectedPath = Join-Path "$TMP_DOWNLOAD_DIR" "$distributionUrlNameMain"
157
+ $expectedMvnPath = Join-Path "$expectedPath" "bin/$MVN_CMD"
158
+ if ((Test-Path -Path $expectedPath -PathType Container) -and (Test-Path -Path $expectedMvnPath -PathType Leaf)) {
159
+ $actualDistributionDir = $distributionUrlNameMain
160
+ }
161
+
162
+ # If not found, search for any directory with the Maven executable (for snapshots)
163
+ if (!$actualDistributionDir) {
164
+ Get-ChildItem -Path "$TMP_DOWNLOAD_DIR" -Directory | ForEach-Object {
165
+ $testPath = Join-Path $_.FullName "bin/$MVN_CMD"
166
+ if (Test-Path -Path $testPath -PathType Leaf) {
167
+ $actualDistributionDir = $_.Name
168
+ }
169
+ }
170
+ }
171
+
172
+ if (!$actualDistributionDir) {
173
+ Write-Error "Could not find Maven distribution directory in extracted archive"
174
+ }
175
+
176
+ Write-Verbose "Found extracted Maven distribution directory: $actualDistributionDir"
177
+ Rename-Item -Path "$TMP_DOWNLOAD_DIR/$actualDistributionDir" -NewName $MAVEN_HOME_NAME | Out-Null
178
+ try {
179
+ Move-Item -Path "$TMP_DOWNLOAD_DIR/$MAVEN_HOME_NAME" -Destination $MAVEN_HOME_PARENT | Out-Null
180
+ } catch {
181
+ if (! (Test-Path -Path "$MAVEN_HOME" -PathType Container)) {
182
+ Write-Error "fail to move MAVEN_HOME"
183
+ }
184
+ } finally {
185
+ try { Remove-Item $TMP_DOWNLOAD_DIR -Recurse -Force | Out-Null }
186
+ catch { Write-Warning "Cannot remove $TMP_DOWNLOAD_DIR" }
187
+ }
188
+
189
+ Write-Output "MVN_CMD=$MAVEN_HOME/bin/$MVN_CMD"
benchmark/dependency_injection/billpayment/quarkus/pom.xml ADDED
@@ -0,0 +1,129 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
3
+ <modelVersion>4.0.0</modelVersion>
4
+ <groupId>quarkus.examples.tutorial.cdi</groupId>
5
+ <artifactId>billpayment</artifactId>
6
+ <version>1.0.0-SNAPSHOT</version>
7
+
8
+ <properties>
9
+ <compiler-plugin.version>3.14.0</compiler-plugin.version>
10
+ <maven.compiler.release>21</maven.compiler.release>
11
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
12
+ <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
13
+ <quarkus.platform.artifact-id>quarkus-bom</quarkus.platform.artifact-id>
14
+ <quarkus.platform.group-id>io.quarkus.platform</quarkus.platform.group-id>
15
+ <quarkus.platform.version>3.30.5</quarkus.platform.version>
16
+ <skipITs>true</skipITs>
17
+ <surefire-plugin.version>3.5.3</surefire-plugin.version>
18
+ </properties>
19
+
20
+ <dependencyManagement>
21
+ <dependencies>
22
+ <dependency>
23
+ <groupId>${quarkus.platform.group-id}</groupId>
24
+ <artifactId>${quarkus.platform.artifact-id}</artifactId>
25
+ <version>${quarkus.platform.version}</version>
26
+ <type>pom</type>
27
+ <scope>import</scope>
28
+ </dependency>
29
+ </dependencies>
30
+ </dependencyManagement>
31
+
32
+ <dependencies>
33
+ <dependency>
34
+ <groupId>org.apache.myfaces.core.extensions.quarkus</groupId>
35
+ <artifactId>myfaces-quarkus</artifactId>
36
+ <version>4.1.2</version>
37
+ </dependency>
38
+ <dependency>
39
+ <groupId>io.quarkus</groupId>
40
+ <artifactId>quarkus-arc</artifactId>
41
+ </dependency>
42
+ <dependency>
43
+ <groupId>io.quarkus</groupId>
44
+ <artifactId>quarkus-hibernate-validator</artifactId>
45
+ </dependency>
46
+ <dependency>
47
+ <groupId>io.quarkus</groupId>
48
+ <artifactId>quarkus-junit5</artifactId>
49
+ <scope>test</scope>
50
+ </dependency>
51
+ <dependency>
52
+ <groupId>io.rest-assured</groupId>
53
+ <artifactId>rest-assured</artifactId>
54
+ <scope>test</scope>
55
+ </dependency>
56
+ </dependencies>
57
+
58
+ <build>
59
+ <plugins>
60
+ <plugin>
61
+ <groupId>${quarkus.platform.group-id}</groupId>
62
+ <artifactId>quarkus-maven-plugin</artifactId>
63
+ <version>${quarkus.platform.version}</version>
64
+ <extensions>true</extensions>
65
+ <executions>
66
+ <execution>
67
+ <goals>
68
+ <goal>build</goal>
69
+ <goal>generate-code</goal>
70
+ <goal>generate-code-tests</goal>
71
+ <goal>native-image-agent</goal>
72
+ </goals>
73
+ </execution>
74
+ </executions>
75
+ </plugin>
76
+ <plugin>
77
+ <artifactId>maven-compiler-plugin</artifactId>
78
+ <version>${compiler-plugin.version}</version>
79
+ <configuration>
80
+ <parameters>true</parameters>
81
+ </configuration>
82
+ </plugin>
83
+ <plugin>
84
+ <artifactId>maven-surefire-plugin</artifactId>
85
+ <version>${surefire-plugin.version}</version>
86
+ <configuration>
87
+ <systemPropertyVariables>
88
+ <java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
89
+ <maven.home>${maven.home}</maven.home>
90
+ </systemPropertyVariables>
91
+ </configuration>
92
+ </plugin>
93
+ <plugin>
94
+ <artifactId>maven-failsafe-plugin</artifactId>
95
+ <version>${surefire-plugin.version}</version>
96
+ <executions>
97
+ <execution>
98
+ <goals>
99
+ <goal>integration-test</goal>
100
+ <goal>verify</goal>
101
+ </goals>
102
+ </execution>
103
+ </executions>
104
+ <configuration>
105
+ <systemPropertyVariables>
106
+ <native.image.path>${project.build.directory}/${project.build.finalName}-runner</native.image.path>
107
+ <java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
108
+ <maven.home>${maven.home}</maven.home>
109
+ </systemPropertyVariables>
110
+ </configuration>
111
+ </plugin>
112
+ </plugins>
113
+ </build>
114
+
115
+ <profiles>
116
+ <profile>
117
+ <id>native</id>
118
+ <activation>
119
+ <property>
120
+ <name>native</name>
121
+ </property>
122
+ </activation>
123
+ <properties>
124
+ <skipITs>false</skipITs>
125
+ <quarkus.native.enabled>true</quarkus.native.enabled>
126
+ </properties>
127
+ </profile>
128
+ </profiles>
129
+ </project>
benchmark/dependency_injection/billpayment/quarkus/src/main/docker/Dockerfile.jvm ADDED
@@ -0,0 +1,128 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ####
2
+ # This Dockerfile is used in order to build a container that runs the Quarkus application in JVM mode
3
+ #
4
+ # Before building the container image run:
5
+ #
6
+ # ./mvnw package
7
+ #
8
+ # Then, build the image with:
9
+ #
10
+ # docker build -f src/main/docker/Dockerfile.jvm -t quarkus/billpayment-jvm .
11
+ #
12
+ # Then run the container using:
13
+ #
14
+ # docker run -i --rm -p 8080:8080 quarkus/billpayment-jvm
15
+ #
16
+ # If you want to include the debug port into your docker image
17
+ # you will have to expose the debug port (default 5005 being the default) like this : EXPOSE 8080 5005.
18
+ # Additionally you will have to set -e JAVA_DEBUG=true and -e JAVA_DEBUG_PORT=*:5005
19
+ # when running the container
20
+ #
21
+ # Then run the container using :
22
+ #
23
+ # docker run -i --rm -p 8080:8080 quarkus/billpayment-jvm
24
+ #
25
+ # This image uses the `run-java.sh` script to run the application.
26
+ # This scripts computes the command line to execute your Java application, and
27
+ # includes memory/GC tuning.
28
+ # You can configure the behavior using the following environment properties:
29
+ # - JAVA_OPTS: JVM options passed to the `java` command (example: "-verbose:class") - Be aware that this will override
30
+ # the default JVM options, use `JAVA_OPTS_APPEND` to append options
31
+ # - JAVA_OPTS_APPEND: User specified Java options to be appended to generated options
32
+ # in JAVA_OPTS (example: "-Dsome.property=foo")
33
+ # - JAVA_MAX_MEM_RATIO: Is used when no `-Xmx` option is given in JAVA_OPTS. This is
34
+ # used to calculate a default maximal heap memory based on a containers restriction.
35
+ # If used in a container without any memory constraints for the container then this
36
+ # option has no effect. If there is a memory constraint then `-Xmx` is set to a ratio
37
+ # of the container available memory as set here. The default is `50` which means 50%
38
+ # of the available memory is used as an upper boundary. You can skip this mechanism by
39
+ # setting this value to `0` in which case no `-Xmx` option is added.
40
+ # - JAVA_INITIAL_MEM_RATIO: Is used when no `-Xms` option is given in JAVA_OPTS. This
41
+ # is used to calculate a default initial heap memory based on the maximum heap memory.
42
+ # If used in a container without any memory constraints for the container then this
43
+ # option has no effect. If there is a memory constraint then `-Xms` is set to a ratio
44
+ # of the `-Xmx` memory as set here. The default is `25` which means 25% of the `-Xmx`
45
+ # is used as the initial heap size. You can skip this mechanism by setting this value
46
+ # to `0` in which case no `-Xms` option is added (example: "25")
47
+ # - JAVA_MAX_INITIAL_MEM: Is used when no `-Xms` option is given in JAVA_OPTS.
48
+ # This is used to calculate the maximum value of the initial heap memory. If used in
49
+ # a container without any memory constraints for the container then this option has
50
+ # no effect. If there is a memory constraint then `-Xms` is limited to the value set
51
+ # here. The default is 4096MB which means the calculated value of `-Xms` never will
52
+ # be greater than 4096MB. The value of this variable is expressed in MB (example: "4096")
53
+ # - JAVA_DIAGNOSTICS: Set this to get some diagnostics information to standard output
54
+ # when things are happening. This option, if set to true, will set
55
+ # `-XX:+UnlockDiagnosticVMOptions`. Disabled by default (example: "true").
56
+ # - JAVA_DEBUG: If set remote debugging will be switched on. Disabled by default (example:
57
+ # true").
58
+ # - JAVA_DEBUG_PORT: Port used for remote debugging. Defaults to 5005 (example: "8787").
59
+ # - CONTAINER_CORE_LIMIT: A calculated core limit as described in
60
+ # https://www.kernel.org/doc/Documentation/scheduler/sched-bwc.txt. (example: "2")
61
+ # - CONTAINER_MAX_MEMORY: Memory limit given to the container (example: "1024").
62
+ # - GC_MIN_HEAP_FREE_RATIO: Minimum percentage of heap free after GC to avoid expansion.
63
+ # (example: "20")
64
+ # - GC_MAX_HEAP_FREE_RATIO: Maximum percentage of heap free after GC to avoid shrinking.
65
+ # (example: "40")
66
+ # - GC_TIME_RATIO: Specifies the ratio of the time spent outside the garbage collection.
67
+ # (example: "4")
68
+ # - GC_ADAPTIVE_SIZE_POLICY_WEIGHT: The weighting given to the current GC time versus
69
+ # previous GC times. (example: "90")
70
+ # - GC_METASPACE_SIZE: The initial metaspace size. (example: "20")
71
+ # - GC_MAX_METASPACE_SIZE: The maximum metaspace size. (example: "100")
72
+ # - GC_CONTAINER_OPTIONS: Specify Java GC to use. The value of this variable should
73
+ # contain the necessary JRE command-line options to specify the required GC, which
74
+ # will override the default of `-XX:+UseParallelGC` (example: -XX:+UseG1GC).
75
+ # - HTTPS_PROXY: The location of the https proxy. (example: "myuser@127.0.0.1:8080")
76
+ # - HTTP_PROXY: The location of the http proxy. (example: "myuser@127.0.0.1:8080")
77
+ # - NO_PROXY: A comma separated lists of hosts, IP addresses or domains that can be
78
+ # accessed directly. (example: "foo.example.com,bar.example.com")
79
+ #
80
+ ###
81
+ FROM registry.access.redhat.com/ubi9/openjdk-21:1.23
82
+
83
+ ENV LANGUAGE='en_US:en'
84
+
85
+ # set smoke test env variables
86
+ ENV BILLPAYMENT_BASE_URL=http://localhost:8080
87
+ ENV BILLPAYMENT_HOME_URI=/billpayment
88
+
89
+ # Install Python 3
90
+ USER root
91
+ RUN microdnf install -y python3 python3-pip && \
92
+ microdnf clean all
93
+
94
+ # Install playwright dependencies
95
+ RUN microdnf install -y \
96
+ libXcomposite libXdamage libXrandr alsa-lib \
97
+ atk cairo cups-libs dbus-glib \
98
+ fontconfig gtk3 libX11 libXcursor \
99
+ libXext libXi libXrender libXtst \
100
+ pango \
101
+ && microdnf clean all
102
+
103
+ # Create and activate virtual environment for Python dependencies (PEP 668 safe)
104
+ RUN python3 -m venv /opt/venv
105
+ ENV PATH="/opt/venv/bin:$PATH"
106
+ # Shared browsers path so Chromium is cached once
107
+ ENV PLAYWRIGHT_BROWSERS_PATH=/ms-playwright
108
+ RUN mkdir -p /ms-playwright && chmod 755 /ms-playwright
109
+
110
+ # Install Playwright and Chromium dependencies inside venv
111
+ RUN pip install --no-cache-dir --upgrade pip setuptools wheel \
112
+ && pip install --no-cache-dir playwright==1.47.0 pytest \
113
+ && playwright install chromium
114
+
115
+ # We make four distinct layers so if there are application changes the library layers can be re-used
116
+ COPY --chown=185 target/quarkus-app/lib/ /deployments/lib/
117
+ COPY --chown=185 target/quarkus-app/*.jar /deployments/
118
+ COPY --chown=185 target/quarkus-app/app/ /deployments/app/
119
+ COPY --chown=185 target/quarkus-app/quarkus/ /deployments/quarkus/
120
+ COPY --chown=185 smoke.py /opt/smoke-test/smoke.py
121
+
122
+ EXPOSE 8080
123
+ USER 185
124
+ ENV JAVA_OPTS_APPEND="-Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager"
125
+ ENV JAVA_APP_JAR="/deployments/quarkus-run.jar"
126
+
127
+ ENTRYPOINT [ "/opt/jboss/container/java/run/run-java.sh" ]
128
+
benchmark/dependency_injection/billpayment/quarkus/src/main/docker/Dockerfile.legacy-jar ADDED
@@ -0,0 +1,94 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ####
2
+ # This Dockerfile is used in order to build a container that runs the Quarkus application in JVM mode
3
+ #
4
+ # Before building the container image run:
5
+ #
6
+ # ./mvnw package -Dquarkus.package.jar.type=legacy-jar
7
+ #
8
+ # Then, build the image with:
9
+ #
10
+ # docker build -f src/main/docker/Dockerfile.legacy-jar -t quarkus/billpayment-legacy-jar .
11
+ #
12
+ # Then run the container using:
13
+ #
14
+ # docker run -i --rm -p 8080:8080 quarkus/billpayment-legacy-jar
15
+ #
16
+ # If you want to include the debug port into your docker image
17
+ # you will have to expose the debug port (default 5005 being the default) like this : EXPOSE 8080 5005.
18
+ # Additionally you will have to set -e JAVA_DEBUG=true and -e JAVA_DEBUG_PORT=*:5005
19
+ # when running the container
20
+ #
21
+ # Then run the container using :
22
+ #
23
+ # docker run -i --rm -p 8080:8080 quarkus/billpayment-legacy-jar
24
+ #
25
+ # This image uses the `run-java.sh` script to run the application.
26
+ # This scripts computes the command line to execute your Java application, and
27
+ # includes memory/GC tuning.
28
+ # You can configure the behavior using the following environment properties:
29
+ # - JAVA_OPTS: JVM options passed to the `java` command (example: "-verbose:class") - Be aware that this will override
30
+ # the default JVM options, use `JAVA_OPTS_APPEND` to append options
31
+ # - JAVA_OPTS_APPEND: User specified Java options to be appended to generated options
32
+ # in JAVA_OPTS (example: "-Dsome.property=foo")
33
+ # - JAVA_MAX_MEM_RATIO: Is used when no `-Xmx` option is given in JAVA_OPTS. This is
34
+ # used to calculate a default maximal heap memory based on a containers restriction.
35
+ # If used in a container without any memory constraints for the container then this
36
+ # option has no effect. If there is a memory constraint then `-Xmx` is set to a ratio
37
+ # of the container available memory as set here. The default is `50` which means 50%
38
+ # of the available memory is used as an upper boundary. You can skip this mechanism by
39
+ # setting this value to `0` in which case no `-Xmx` option is added.
40
+ # - JAVA_INITIAL_MEM_RATIO: Is used when no `-Xms` option is given in JAVA_OPTS. This
41
+ # is used to calculate a default initial heap memory based on the maximum heap memory.
42
+ # If used in a container without any memory constraints for the container then this
43
+ # option has no effect. If there is a memory constraint then `-Xms` is set to a ratio
44
+ # of the `-Xmx` memory as set here. The default is `25` which means 25% of the `-Xmx`
45
+ # is used as the initial heap size. You can skip this mechanism by setting this value
46
+ # to `0` in which case no `-Xms` option is added (example: "25")
47
+ # - JAVA_MAX_INITIAL_MEM: Is used when no `-Xms` option is given in JAVA_OPTS.
48
+ # This is used to calculate the maximum value of the initial heap memory. If used in
49
+ # a container without any memory constraints for the container then this option has
50
+ # no effect. If there is a memory constraint then `-Xms` is limited to the value set
51
+ # here. The default is 4096MB which means the calculated value of `-Xms` never will
52
+ # be greater than 4096MB. The value of this variable is expressed in MB (example: "4096")
53
+ # - JAVA_DIAGNOSTICS: Set this to get some diagnostics information to standard output
54
+ # when things are happening. This option, if set to true, will set
55
+ # `-XX:+UnlockDiagnosticVMOptions`. Disabled by default (example: "true").
56
+ # - JAVA_DEBUG: If set remote debugging will be switched on. Disabled by default (example:
57
+ # true").
58
+ # - JAVA_DEBUG_PORT: Port used for remote debugging. Defaults to 5005 (example: "8787").
59
+ # - CONTAINER_CORE_LIMIT: A calculated core limit as described in
60
+ # https://www.kernel.org/doc/Documentation/scheduler/sched-bwc.txt. (example: "2")
61
+ # - CONTAINER_MAX_MEMORY: Memory limit given to the container (example: "1024").
62
+ # - GC_MIN_HEAP_FREE_RATIO: Minimum percentage of heap free after GC to avoid expansion.
63
+ # (example: "20")
64
+ # - GC_MAX_HEAP_FREE_RATIO: Maximum percentage of heap free after GC to avoid shrinking.
65
+ # (example: "40")
66
+ # - GC_TIME_RATIO: Specifies the ratio of the time spent outside the garbage collection.
67
+ # (example: "4")
68
+ # - GC_ADAPTIVE_SIZE_POLICY_WEIGHT: The weighting given to the current GC time versus
69
+ # previous GC times. (example: "90")
70
+ # - GC_METASPACE_SIZE: The initial metaspace size. (example: "20")
71
+ # - GC_MAX_METASPACE_SIZE: The maximum metaspace size. (example: "100")
72
+ # - GC_CONTAINER_OPTIONS: Specify Java GC to use. The value of this variable should
73
+ # contain the necessary JRE command-line options to specify the required GC, which
74
+ # will override the default of `-XX:+UseParallelGC` (example: -XX:+UseG1GC).
75
+ # - HTTPS_PROXY: The location of the https proxy. (example: "myuser@127.0.0.1:8080")
76
+ # - HTTP_PROXY: The location of the http proxy. (example: "myuser@127.0.0.1:8080")
77
+ # - NO_PROXY: A comma separated lists of hosts, IP addresses or domains that can be
78
+ # accessed directly. (example: "foo.example.com,bar.example.com")
79
+ #
80
+ ###
81
+ FROM registry.access.redhat.com/ubi9/openjdk-21:1.23
82
+
83
+ ENV LANGUAGE='en_US:en'
84
+
85
+
86
+ COPY target/lib/* /deployments/lib/
87
+ COPY target/*-runner.jar /deployments/quarkus-run.jar
88
+
89
+ EXPOSE 8080
90
+ USER 185
91
+ ENV JAVA_OPTS_APPEND="-Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager"
92
+ ENV JAVA_APP_JAR="/deployments/quarkus-run.jar"
93
+
94
+ ENTRYPOINT [ "/opt/jboss/container/java/run/run-java.sh" ]
benchmark/dependency_injection/billpayment/quarkus/src/main/docker/Dockerfile.native ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ####
2
+ # This Dockerfile is used in order to build a container that runs the Quarkus application in native (no JVM) mode.
3
+ #
4
+ # Before building the container image run:
5
+ #
6
+ # ./mvnw package -Dnative
7
+ #
8
+ # Then, build the image with:
9
+ #
10
+ # docker build -f src/main/docker/Dockerfile.native -t quarkus/billpayment .
11
+ #
12
+ # Then run the container using:
13
+ #
14
+ # docker run -i --rm -p 8080:8080 quarkus/billpayment
15
+ #
16
+ # The ` registry.access.redhat.com/ubi9/ubi-minimal:9.6` base image is based on UBI 9.
17
+ # To use UBI 8, switch to `quay.io/ubi8/ubi-minimal:8.10`.
18
+ ###
19
+ FROM registry.access.redhat.com/ubi9/ubi-minimal:9.6
20
+ WORKDIR /work/
21
+ RUN chown 1001 /work \
22
+ && chmod "g+rwX" /work \
23
+ && chown 1001:root /work
24
+ COPY --chown=1001:root --chmod=0755 target/*-runner /work/application
25
+
26
+ EXPOSE 8080
27
+ USER 1001
28
+
29
+ ENTRYPOINT ["./application", "-Dquarkus.http.host=0.0.0.0"]
benchmark/dependency_injection/billpayment/quarkus/src/main/docker/Dockerfile.native-micro ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ####
2
+ # This Dockerfile is used in order to build a container that runs the Quarkus application in native (no JVM) mode.
3
+ # It uses a micro base image, tuned for Quarkus native executables.
4
+ # It reduces the size of the resulting container image.
5
+ # Check https://quarkus.io/guides/quarkus-runtime-base-image for further information about this image.
6
+ #
7
+ # Before building the container image run:
8
+ #
9
+ # ./mvnw package -Dnative
10
+ #
11
+ # Then, build the image with:
12
+ #
13
+ # docker build -f src/main/docker/Dockerfile.native-micro -t quarkus/billpayment .
14
+ #
15
+ # Then run the container using:
16
+ #
17
+ # docker run -i --rm -p 8080:8080 quarkus/billpayment
18
+ #
19
+ # The `quay.io/quarkus/ubi9-quarkus-micro-image:2.0` base image is based on UBI 9.
20
+ # To use UBI 8, switch to `quay.io/quarkus/quarkus-micro-image:2.0`.
21
+ ###
22
+ FROM quay.io/quarkus/ubi9-quarkus-micro-image:2.0
23
+ WORKDIR /work/
24
+ RUN chown 1001 /work \
25
+ && chmod "g+rwX" /work \
26
+ && chown 1001:root /work
27
+ COPY --chown=1001:root --chmod=0755 target/*-runner /work/application
28
+
29
+ EXPOSE 8080
30
+ USER 1001
31
+
32
+ ENTRYPOINT ["./application", "-Dquarkus.http.host=0.0.0.0"]
benchmark/dependency_injection/billpayment/quarkus/src/main/java/jakarta/tutorial/billpayment/event/PaymentEvent.java ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Copyright (c), Eclipse Foundation, Inc. and its licensors.
3
+ *
4
+ * All rights reserved.
5
+ *
6
+ * This program and the accompanying materials are made available under the
7
+ * terms of the Eclipse Distribution License v1.0, which is available at
8
+ * https://www.eclipse.org/org/documents/edl-v10.php
9
+ *
10
+ * SPDX-License-Identifier: BSD-3-Clause
11
+ */
12
+ package jakarta.tutorial.billpayment.event;
13
+
14
+ import java.io.Serializable;
15
+ import java.math.BigDecimal;
16
+ import java.util.Date;
17
+
18
+ /**
19
+ * Common payment event that handles Debit and Credit payment types.
20
+ */
21
+ public class PaymentEvent implements Serializable {
22
+
23
+ private static final long serialVersionUID = -6407967360613478424L;
24
+
25
+ public String paymentType;
26
+ public BigDecimal value;
27
+ public Date datetime;
28
+
29
+ public PaymentEvent() {
30
+ }
31
+
32
+ @Override
33
+ public String toString() {
34
+ return this.paymentType
35
+ + " = $" + this.value.toString()
36
+ + " at " + this.datetime.toString();
37
+ }
38
+
39
+ public String getPaymentType() {
40
+ return paymentType;
41
+ }
42
+
43
+ public void setPaymentType(String paymentType) {
44
+ this.paymentType = paymentType;
45
+ }
46
+
47
+ public BigDecimal getValue() {
48
+ return value;
49
+ }
50
+
51
+ public void setValue(BigDecimal value) {
52
+ this.value = value;
53
+ }
54
+
55
+ public Date getDatetime() {
56
+ return datetime;
57
+ }
58
+
59
+ public void setDatetime(Date datetime) {
60
+ this.datetime = datetime;
61
+ }
62
+ }
benchmark/dependency_injection/billpayment/quarkus/src/main/java/jakarta/tutorial/billpayment/interceptor/Logged.java ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Copyright (c), Eclipse Foundation, Inc. and its licensors.
3
+ *
4
+ * All rights reserved.
5
+ *
6
+ * This program and the accompanying materials are made available under the
7
+ * terms of the Eclipse Distribution License v1.0, which is available at
8
+ * https://www.eclipse.org/org/documents/edl-v10.php
9
+ *
10
+ * SPDX-License-Identifier: BSD-3-Clause
11
+ */
12
+ package jakarta.tutorial.billpayment.interceptor;
13
+
14
+ import static java.lang.annotation.ElementType.METHOD;
15
+ import static java.lang.annotation.ElementType.TYPE;
16
+ import static java.lang.annotation.RetentionPolicy.RUNTIME;
17
+
18
+ import java.lang.annotation.Inherited;
19
+ import java.lang.annotation.Retention;
20
+ import java.lang.annotation.Target;
21
+
22
+ import jakarta.interceptor.InterceptorBinding;
23
+
24
+ @Inherited
25
+ @InterceptorBinding
26
+ @Retention(RUNTIME)
27
+ @Target({METHOD, TYPE})
28
+ public @interface Logged {
29
+ }
benchmark/dependency_injection/billpayment/quarkus/src/main/java/jakarta/tutorial/billpayment/interceptor/LoggedInterceptor.java ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Copyright (c), Eclipse Foundation, Inc. and its licensors.
3
+ *
4
+ * All rights reserved.
5
+ *
6
+ * This program and the accompanying materials are made available under the
7
+ * terms of the Eclipse Distribution License v1.0, which is available at
8
+ * https://www.eclipse.org/org/documents/edl-v10.php
9
+ *
10
+ * SPDX-License-Identifier: BSD-3-Clause
11
+ */
12
+ package jakarta.tutorial.billpayment.interceptor;
13
+
14
+ import java.io.Serializable;
15
+
16
+ import jakarta.interceptor.AroundInvoke;
17
+ import jakarta.interceptor.Interceptor;
18
+ import jakarta.interceptor.InvocationContext;
19
+
20
+ @Logged
21
+ @Interceptor
22
+ public class LoggedInterceptor implements Serializable {
23
+
24
+ private static final long serialVersionUID = -2230122751970857993L;
25
+
26
+ public LoggedInterceptor() {
27
+ }
28
+
29
+ @AroundInvoke
30
+ public Object logMethodEntry(InvocationContext invocationContext)
31
+ throws Exception {
32
+ System.out.println("Entering method: "
33
+ + invocationContext.getMethod().getName() + " in class "
34
+ + invocationContext.getMethod().getDeclaringClass().getName());
35
+
36
+ return invocationContext.proceed();
37
+ }
38
+ }
benchmark/dependency_injection/billpayment/quarkus/src/main/java/jakarta/tutorial/billpayment/listener/PaymentHandler.java ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Copyright (c), Eclipse Foundation, Inc. and its licensors.
3
+ *
4
+ * All rights reserved.
5
+ *
6
+ * This program and the accompanying materials are made available under the
7
+ * terms of the Eclipse Distribution License v1.0, which is available at
8
+ * https://www.eclipse.org/org/documents/edl-v10.php
9
+ *
10
+ * SPDX-License-Identifier: BSD-3-Clause
11
+ */
12
+ package jakarta.tutorial.billpayment.listener;
13
+
14
+ import java.io.Serializable;
15
+ import java.util.logging.Level;
16
+ import java.util.logging.Logger;
17
+
18
+ import jakarta.enterprise.context.SessionScoped;
19
+ import jakarta.enterprise.event.Observes;
20
+ import jakarta.tutorial.billpayment.event.PaymentEvent;
21
+ import jakarta.tutorial.billpayment.interceptor.Logged;
22
+ import jakarta.tutorial.billpayment.payment.Credit;
23
+ import jakarta.tutorial.billpayment.payment.Debit;
24
+
25
+ /**
26
+ * Handler for the two kinds of PaymentEvent.
27
+ */
28
+ @Logged
29
+ @SessionScoped
30
+ public class PaymentHandler implements Serializable {
31
+
32
+ private static final Logger logger =
33
+ Logger.getLogger(PaymentHandler.class.getCanonicalName());
34
+ private static final long serialVersionUID = 2013564481486393525L;
35
+
36
+ public PaymentHandler() {
37
+ logger.log(Level.INFO, "PaymentHandler created.");
38
+ }
39
+
40
+ public void creditPayment(@Observes @Credit PaymentEvent event) {
41
+ logger.log(Level.INFO, "PaymentHandler - Credit Handler: {0}",
42
+ event.toString());
43
+
44
+ // call a specific Credit handler class...
45
+ }
46
+
47
+ public void debitPayment(@Observes @Debit PaymentEvent event) {
48
+ logger.log(Level.INFO, "PaymentHandler - Debit Handler: {0}",
49
+ event.toString());
50
+
51
+ // call a specific Debit handler class...
52
+ }
53
+ }
benchmark/dependency_injection/billpayment/quarkus/src/main/java/jakarta/tutorial/billpayment/payment/Credit.java ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Copyright (c), Eclipse Foundation, Inc. and its licensors.
3
+ *
4
+ * All rights reserved.
5
+ *
6
+ * This program and the accompanying materials are made available under the
7
+ * terms of the Eclipse Distribution License v1.0, which is available at
8
+ * https://www.eclipse.org/org/documents/edl-v10.php
9
+ *
10
+ * SPDX-License-Identifier: BSD-3-Clause
11
+ */
12
+ package jakarta.tutorial.billpayment.payment;
13
+
14
+ import static java.lang.annotation.ElementType.FIELD;
15
+ import static java.lang.annotation.ElementType.METHOD;
16
+ import static java.lang.annotation.ElementType.PARAMETER;
17
+ import static java.lang.annotation.ElementType.TYPE;
18
+ import static java.lang.annotation.RetentionPolicy.RUNTIME;
19
+
20
+ import java.lang.annotation.Retention;
21
+ import java.lang.annotation.Target;
22
+
23
+ import jakarta.inject.Qualifier;
24
+
25
+ /**
26
+ * Qualifier for Credit payment events.
27
+ */
28
+ @Qualifier
29
+ @Retention(RUNTIME)
30
+ @Target({METHOD, FIELD, PARAMETER, TYPE})
31
+ public @interface Credit {
32
+ }
benchmark/dependency_injection/billpayment/quarkus/src/main/java/jakarta/tutorial/billpayment/payment/Debit.java ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Copyright (c), Eclipse Foundation, Inc. and its licensors.
3
+ *
4
+ * All rights reserved.
5
+ *
6
+ * This program and the accompanying materials are made available under the
7
+ * terms of the Eclipse Distribution License v1.0, which is available at
8
+ * https://www.eclipse.org/org/documents/edl-v10.php
9
+ *
10
+ * SPDX-License-Identifier: BSD-3-Clause
11
+ */
12
+ package jakarta.tutorial.billpayment.payment;
13
+
14
+ import static java.lang.annotation.ElementType.FIELD;
15
+ import static java.lang.annotation.ElementType.METHOD;
16
+ import static java.lang.annotation.ElementType.PARAMETER;
17
+ import static java.lang.annotation.ElementType.TYPE;
18
+ import static java.lang.annotation.RetentionPolicy.RUNTIME;
19
+
20
+ import java.lang.annotation.Retention;
21
+ import java.lang.annotation.Target;
22
+
23
+ import jakarta.inject.Qualifier;
24
+
25
+ /**
26
+ * Qualifier for Debit payment events.
27
+ */
28
+ @Qualifier
29
+ @Retention(RUNTIME)
30
+ @Target({METHOD, FIELD, PARAMETER, TYPE})
31
+ public @interface Debit {
32
+ }
benchmark/dependency_injection/billpayment/quarkus/src/main/java/jakarta/tutorial/billpayment/payment/PaymentBean.java ADDED
@@ -0,0 +1,118 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Copyright (c), Eclipse Foundation, Inc. and its licensors.
3
+ *
4
+ * All rights reserved.
5
+ *
6
+ * This program and the accompanying materials are made available under the
7
+ * terms of the Eclipse Distribution License v1.0, which is available at
8
+ * https://www.eclipse.org/org/documents/edl-v10.php
9
+ *
10
+ * SPDX-License-Identifier: BSD-3-Clause
11
+ */
12
+ package jakarta.tutorial.billpayment.payment;
13
+
14
+ import java.io.Serializable;
15
+ import java.math.BigDecimal;
16
+ import java.util.Calendar;
17
+ import java.util.Date;
18
+ import java.util.logging.Logger;
19
+
20
+ import jakarta.enterprise.context.SessionScoped;
21
+ import jakarta.enterprise.event.Event;
22
+ import jakarta.inject.Inject;
23
+ import jakarta.inject.Named;
24
+ import jakarta.tutorial.billpayment.event.PaymentEvent;
25
+ import jakarta.tutorial.billpayment.interceptor.Logged;
26
+ import jakarta.validation.constraints.Digits;
27
+
28
+ /**
29
+ * Bean that fires DEBIT and CREDIT payment events based on UI selection.
30
+ * Check server log output for event handling output.
31
+ */
32
+ @Named
33
+ @SessionScoped
34
+ public class PaymentBean implements Serializable {
35
+
36
+ private static final Logger logger =
37
+ Logger.getLogger(PaymentBean.class.getCanonicalName());
38
+ private static final long serialVersionUID = 7130389273118012929L;
39
+
40
+ @Inject
41
+ @Credit
42
+ Event<PaymentEvent> creditEvent;
43
+
44
+ @Inject
45
+ @Debit
46
+ Event<PaymentEvent> debitEvent;
47
+
48
+ private static final int DEBIT = 1;
49
+ private static final int CREDIT = 2;
50
+ private int paymentOption = DEBIT;
51
+
52
+ @Digits(integer = 10, fraction = 2, message = "Invalid value")
53
+ private BigDecimal value;
54
+
55
+ private Date datetime;
56
+
57
+ /**
58
+ * Fires a payment event.
59
+ *
60
+ * @return the response page location
61
+ */
62
+ @Logged
63
+ public String pay() {
64
+ this.setDatetime(Calendar.getInstance().getTime());
65
+ switch (paymentOption) {
66
+ case DEBIT:
67
+ PaymentEvent debitPayload = new PaymentEvent();
68
+ debitPayload.setPaymentType("Debit");
69
+ debitPayload.setValue(value);
70
+ debitPayload.setDatetime(datetime);
71
+ debitEvent.fire(debitPayload);
72
+ break;
73
+ case CREDIT:
74
+ PaymentEvent creditPayload = new PaymentEvent();
75
+ creditPayload.setPaymentType("Credit");
76
+ creditPayload.setValue(value);
77
+ creditPayload.setDatetime(datetime);
78
+ creditEvent.fire(creditPayload);
79
+ break;
80
+ default:
81
+ logger.severe("Invalid payment option!");
82
+ }
83
+ return "response";
84
+ }
85
+
86
+ /**
87
+ * Resets the values in the index page.
88
+ */
89
+ @Logged
90
+ public void reset() {
91
+ setPaymentOption(DEBIT);
92
+ setValue(BigDecimal.ZERO);
93
+ }
94
+
95
+ public int getPaymentOption() {
96
+ return this.paymentOption;
97
+ }
98
+
99
+ public void setPaymentOption(int paymentType) {
100
+ this.paymentOption = paymentType;
101
+ }
102
+
103
+ public BigDecimal getValue() {
104
+ return value;
105
+ }
106
+
107
+ public void setValue(BigDecimal value) {
108
+ this.value = value;
109
+ }
110
+
111
+ public Date getDatetime() {
112
+ return datetime;
113
+ }
114
+
115
+ public void setDatetime(Date datetime) {
116
+ this.datetime = datetime;
117
+ }
118
+ }
benchmark/dependency_injection/billpayment/quarkus/src/main/resources/META-INF/faces-config.xml ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <faces-config version="2.3"
3
+ xmlns="http://xmlns.jcp.org/xml/ns/javaee"
4
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5
+ xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-facesconfig_2_3.xsd">
6
+
7
+ <!-- <f:convertNumber type="currency"/> does not work correctly without it: https://issues.apache.org/jira/browse/MYFACES-641 -->
8
+ <application>
9
+ <locale-config>
10
+ <default-locale>en_US</default-locale>
11
+ <supported-locale>en_US</supported-locale>
12
+ </locale-config>
13
+ </application>
14
+
15
+ </faces-config>
benchmark/dependency_injection/billpayment/quarkus/src/main/resources/META-INF/resources/index.xhtml ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version='1.0' encoding='UTF-8' ?>
2
+ <!--
3
+
4
+ Copyright (c), Eclipse Foundation, Inc. and its licensors.
5
+
6
+ All rights reserved.
7
+
8
+ This program and the accompanying materials are made available under the
9
+ terms of the Eclipse Distribution License v1.0, which is available at
10
+ https://www.eclipse.org/org/documents/edl-v10.php
11
+
12
+ SPDX-License-Identifier: BSD-3-Clause
13
+
14
+ -->
15
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
16
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
17
+ <html lang="en"
18
+ xmlns="http://www.w3.org/1999/xhtml"
19
+ xmlns:h="jakarta.faces.html"
20
+ xmlns:f="jakarta.faces.core">
21
+ <h:head>
22
+ <h:outputStylesheet library="css" name="default.css"/>
23
+ <title>Bill Payment Options</title>
24
+ </h:head>
25
+ <h:body>
26
+ <h3>Bill Payment Options</h3>
27
+ <p>Enter an amount, select Debit Card or Credit Card,
28
+ then click Pay.</p>
29
+ <h:form id="paymentForm">
30
+ <p>
31
+ <h:outputLabel value="Amount: $" for="amt"/>
32
+ <h:inputText id="amt" value="#{paymentBean.value}"
33
+ required="true"
34
+ requiredMessage="An amount is required."
35
+ maxlength="15" />
36
+ </p>
37
+ <h:outputLabel value="Options:" for="opt"/>
38
+ <h:selectOneRadio id="opt" value="#{paymentBean.paymentOption}">
39
+ <f:selectItem id="debit" itemLabel="Debit Card"
40
+ itemValue="1"/>
41
+ <f:selectItem id="credit" itemLabel="Credit Card"
42
+ itemValue="2" />
43
+ </h:selectOneRadio>
44
+ <p><h:commandButton id="submit" value="Pay"
45
+ action="#{paymentBean.pay}" /></p>
46
+ <p><h:commandButton value="Reset"
47
+ action="#{paymentBean.reset}" /></p>
48
+ </h:form>
49
+ <div class="messagecolor">
50
+ <h:messages showSummary="true"
51
+ showDetail="false"
52
+ errorStyle="color: #d20005"
53
+ infoStyle="color: blue"/>
54
+ </div>
55
+ </h:body>
56
+ </html>
benchmark/dependency_injection/billpayment/quarkus/src/main/resources/META-INF/resources/resources/css/default.css ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Copyright (c), Eclipse Foundation, Inc. and its licensors.
3
+ *
4
+ * All rights reserved.
5
+ *
6
+ * This program and the accompanying materials are made available under the
7
+ * terms of the Eclipse Distribution License v1.0, which is available at
8
+ * https://www.eclipse.org/org/documents/edl-v10.php
9
+ *
10
+ * SPDX-License-Identifier: BSD-3-Clause
11
+ */
12
+ body {
13
+ background-color: #ffffff;
14
+ font-size: 12px;
15
+ font-family: Verdana, "Verdana CE", Arial, "Arial CE", "Lucida Grande CE", lucida, "Helvetica CE", sans-serif;
16
+ color: #000000;
17
+ margin: 10px;
18
+ }
19
+
20
+ h1 {
21
+ font-family: Arial, "Arial CE", "Lucida Grande CE", lucida, "Helvetica CE", sans-serif;
22
+ border-bottom: 1px solid #AFAFAF;
23
+ font-size: 16px;
24
+ font-weight: bold;
25
+ margin: 0px;
26
+ padding: 0px;
27
+ color: #D20005;
28
+ }
29
+
30
+ a:link, a:visited {
31
+ color: #045491;
32
+ font-weight : bold;
33
+ text-decoration: none;
34
+ }
35
+
36
+ a:link:hover, a:visited:hover {
37
+ color: #045491;
38
+ font-weight : bold;
39
+ text-decoration : underline;
40
+ }
benchmark/dependency_injection/billpayment/quarkus/src/main/resources/META-INF/resources/response.xhtml ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version='1.0' encoding='UTF-8' ?>
2
+ <!--
3
+
4
+ Copyright (c), Eclipse Foundation, Inc. and its licensors.
5
+
6
+ All rights reserved.
7
+
8
+ This program and the accompanying materials are made available under the
9
+ terms of the Eclipse Distribution License v1.0, which is available at
10
+ https://www.eclipse.org/org/documents/edl-v10.php
11
+
12
+ SPDX-License-Identifier: BSD-3-Clause
13
+
14
+ -->
15
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
16
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
17
+ <html lang="en"
18
+ xmlns="http://www.w3.org/1999/xhtml"
19
+ xmlns:h="jakarta.faces.html"
20
+ xmlns:f="jakarta.faces.core">
21
+ <h:head>
22
+ <h:outputStylesheet library="css" name="default.css"/>
23
+ <title>Bill Payment: Result</title>
24
+ </h:head>
25
+ <h:body>
26
+ <h:form>
27
+ <h2>Bill Payment: Result</h2>
28
+ <h3>Amount Paid with
29
+ <h:outputText id="debit" value="Debit Card: "
30
+ rendered="#{paymentBean.paymentOption eq 1}" />
31
+ <h:outputText id="credit" value="Credit Card: "
32
+ rendered="#{paymentBean.paymentOption eq 2}" />
33
+ <h:outputText id="result" value="#{paymentBean.value}" >
34
+ <f:convertNumber type="currency"/>
35
+ </h:outputText>
36
+ </h3>
37
+ <p><h:commandButton id="back" value="Back" action="index" /></p>
38
+ </h:form>
39
+ </h:body>
40
+ </html>
benchmark/dependency_injection/billpayment/quarkus/src/main/resources/META-INF/web.xml ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!--
3
+
4
+ Copyright (c), Eclipse Foundation, Inc. and its licensors.
5
+
6
+ All rights reserved.
7
+
8
+ This program and the accompanying materials are made available under the
9
+ terms of the Eclipse Distribution License v1.0, which is available at
10
+ https://www.eclipse.org/org/documents/edl-v10.php
11
+
12
+ SPDX-License-Identifier: BSD-3-Clause
13
+
14
+ -->
15
+ <web-app version="5.0"
16
+ xmlns="https://jakarta.ee/xml/ns/jakartaee"
17
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
18
+ xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-app_5_0.xsd">
19
+ <context-param>
20
+ <param-name>jakarta.faces.PROJECT_STAGE</param-name>
21
+ <param-value>Development</param-value>
22
+ </context-param>
23
+ <servlet>
24
+ <servlet-name>Faces Servlet</servlet-name>
25
+ <servlet-class>jakarta.faces.webapp.FacesServlet</servlet-class>
26
+ <load-on-startup>1</load-on-startup>
27
+ </servlet>
28
+ <servlet-mapping>
29
+ <servlet-name>Faces Servlet</servlet-name>
30
+ <url-pattern>*.xhtml</url-pattern>
31
+ </servlet-mapping>
32
+ <session-config>
33
+ <session-timeout>
34
+ 30
35
+ </session-timeout>
36
+ </session-config>
37
+ <welcome-file-list>
38
+ <welcome-file>index.xhtml</welcome-file>
39
+ </welcome-file-list>
40
+ </web-app>
benchmark/dependency_injection/billpayment/quarkus/src/main/resources/application.properties ADDED
@@ -0,0 +1 @@
 
 
1
+ quarkus.http.root-path=/billpayment
benchmark/dependency_injection/billpayment/quarkus/src/test/java/jakarta/tutorial/billpayment/payment/PaymentFlowTest.java ADDED
@@ -0,0 +1,93 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ package jakarta.tutorial.billpayment.payment;
2
+
3
+ import io.quarkus.test.junit.QuarkusTest;
4
+ import io.restassured.RestAssured;
5
+ import io.restassured.filter.cookie.CookieFilter;
6
+ import io.restassured.response.Response;
7
+ import org.junit.jupiter.api.Test;
8
+
9
+ import static org.hamcrest.MatcherAssert.assertThat;
10
+ import static org.hamcrest.Matchers.*;
11
+
12
+ @QuarkusTest
13
+ public class PaymentFlowTest {
14
+
15
+ @Test
16
+ public void testDebitCardPaymentFlow() {
17
+ CookieFilter cookieFilter = new CookieFilter();
18
+
19
+ // Step 1: GET the index page
20
+ Response getResp = RestAssured
21
+ .given()
22
+ .filter(cookieFilter)
23
+ .when()
24
+ .get("/index.xhtml")
25
+ .then()
26
+ .statusCode(200)
27
+ .extract().response();
28
+
29
+ // Step 2: Extract JSF ViewState
30
+ String viewState = getResp.htmlPath()
31
+ .getString("**.findAll { it.@name == 'jakarta.faces.ViewState' }[0].@value");
32
+
33
+ assertThat("ViewState should not be null", viewState, notNullValue());
34
+
35
+ // Step 3: POST the form with Debit selection and amount
36
+ Response postResp = RestAssured
37
+ .given()
38
+ .filter(cookieFilter)
39
+ .formParam("paymentForm:amt", "123.45") // Input amount
40
+ .formParam("paymentForm:opt", "1") // Debit card
41
+ .formParam("paymentForm:submit", "Pay") // Button clicked
42
+ .formParam("paymentForm_SUBMIT", "1") // REQUIRED for JSF
43
+ .formParam("jakarta.faces.ViewState", viewState)
44
+ .when()
45
+ .post("/index.xhtml")
46
+ .then()
47
+ .statusCode(200)
48
+ .extract().response();
49
+
50
+ String responseHtml = postResp.asString();
51
+
52
+ // Step 4: Assert user is on response.xhtml and sees correct content
53
+ assertThat(responseHtml, containsString("Bill Payment: Result"));
54
+ assertThat(responseHtml, containsString("Debit Card:"));
55
+ assertThat(responseHtml, containsString("$123.45"));
56
+ }
57
+
58
+ @Test
59
+ public void testCreditCardPaymentFlow() {
60
+ CookieFilter cookieFilter = new CookieFilter();
61
+
62
+ // GET page first
63
+ Response getResp = RestAssured
64
+ .given().filter(cookieFilter)
65
+ .when().get("/index.xhtml")
66
+ .then().statusCode(200).extract().response();
67
+
68
+ String viewState = getResp.htmlPath()
69
+ .getString("**.findAll { it.@name == 'jakarta.faces.ViewState' }[0].@value");
70
+
71
+ // POST form for Credit Card
72
+ Response postResp = RestAssured
73
+ .given()
74
+ .filter(cookieFilter)
75
+ .formParam("paymentForm:amt", "999.99")
76
+ .formParam("paymentForm:opt", "2") // Credit
77
+ .formParam("paymentForm:submit", "Pay")
78
+ .formParam("paymentForm_SUBMIT", "1") // REQUIRED for JSF
79
+ .formParam("jakarta.faces.ViewState", viewState)
80
+ .when()
81
+ .post("/index.xhtml")
82
+ .then()
83
+ .statusCode(200)
84
+ .extract().response();
85
+
86
+ String html = postResp.asString();
87
+
88
+ // Confirm response page contains expected content
89
+ assertThat(html, containsString("Bill Payment: Result"));
90
+ assertThat(html, containsString("Credit Card:"));
91
+ assertThat(html, containsString("$999.99"));
92
+ }
93
+ }
benchmark/dependency_injection/billpayment/quarkus/test.sh ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+
4
+ BASE_URL="${BASE_URL:-http://localhost:8080/billpayment}"
5
+
6
+ echo "Health check: ${BASE_URL}"
7
+ HTTP_STATUS=$(curl -sL -o /dev/null -w "%{http_code}" "${BASE_URL}")
8
+
9
+ if [ "$HTTP_STATUS" -eq 200 ]; then
10
+ echo "PASS - got HTTP ${HTTP_STATUS}"
11
+ exit 0
12
+ else
13
+ echo "FAIL - got HTTP ${HTTP_STATUS}"
14
+ exit 1
15
+ fi
benchmark/dependency_injection/billpayment/spring/.dockerignore ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # VCS
2
+ .git/
3
+
4
+ # Maven
5
+ .mvn/
6
+ **/.mvn/
7
+ mvnw
8
+ mvnw.cmd
9
+ **/mvnw
10
+ **/mvnw.cmd
11
+ target/
12
+ **/target/
13
+ pom.xml.tag
14
+ pom.xml.releaseBackup
15
+ pom.xml.versionsBackup
16
+ pom.xml.next
17
+ release.properties
18
+ dependency-reduced-pom.xml
19
+ buildNumber.properties
20
+
21
+ # IDE / Editor
22
+ .vscode/
23
+ **/.vscode/
24
+ .zed/
25
+ **/.zed/
26
+ .idea/
27
+ **/.idea/
28
+ *.iml
29
+ *.ipr
30
+ *.iws
31
+
32
+ # OS
33
+ .DS_Store
34
+ **/.DS_Store
35
+ Thumbs.db
36
+ ehthumbs.db
37
+
38
+ # Logs / temp
39
+ *.log
40
+ *.tmp
41
+ *.temp
benchmark/dependency_injection/billpayment/spring/.mvn/wrapper/MavenWrapperDownloader.java ADDED
@@ -0,0 +1,117 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Copyright 2007-present the original author or authors.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import java.net.*;
17
+ import java.io.*;
18
+ import java.nio.channels.*;
19
+ import java.util.Properties;
20
+
21
+ public class MavenWrapperDownloader {
22
+
23
+ private static final String WRAPPER_VERSION = "0.5.6";
24
+ /**
25
+ * Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided.
26
+ */
27
+ private static final String DEFAULT_DOWNLOAD_URL = "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/"
28
+ + WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar";
29
+
30
+ /**
31
+ * Path to the maven-wrapper.properties file, which might contain a downloadUrl property to
32
+ * use instead of the default one.
33
+ */
34
+ private static final String MAVEN_WRAPPER_PROPERTIES_PATH =
35
+ ".mvn/wrapper/maven-wrapper.properties";
36
+
37
+ /**
38
+ * Path where the maven-wrapper.jar will be saved to.
39
+ */
40
+ private static final String MAVEN_WRAPPER_JAR_PATH =
41
+ ".mvn/wrapper/maven-wrapper.jar";
42
+
43
+ /**
44
+ * Name of the property which should be used to override the default download url for the wrapper.
45
+ */
46
+ private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl";
47
+
48
+ public static void main(String args[]) {
49
+ System.out.println("- Downloader started");
50
+ File baseDirectory = new File(args[0]);
51
+ System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath());
52
+
53
+ // If the maven-wrapper.properties exists, read it and check if it contains a custom
54
+ // wrapperUrl parameter.
55
+ File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH);
56
+ String url = DEFAULT_DOWNLOAD_URL;
57
+ if(mavenWrapperPropertyFile.exists()) {
58
+ FileInputStream mavenWrapperPropertyFileInputStream = null;
59
+ try {
60
+ mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile);
61
+ Properties mavenWrapperProperties = new Properties();
62
+ mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream);
63
+ url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url);
64
+ } catch (IOException e) {
65
+ System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'");
66
+ } finally {
67
+ try {
68
+ if(mavenWrapperPropertyFileInputStream != null) {
69
+ mavenWrapperPropertyFileInputStream.close();
70
+ }
71
+ } catch (IOException e) {
72
+ // Ignore ...
73
+ }
74
+ }
75
+ }
76
+ System.out.println("- Downloading from: " + url);
77
+
78
+ File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH);
79
+ if(!outputFile.getParentFile().exists()) {
80
+ if(!outputFile.getParentFile().mkdirs()) {
81
+ System.out.println(
82
+ "- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'");
83
+ }
84
+ }
85
+ System.out.println("- Downloading to: " + outputFile.getAbsolutePath());
86
+ try {
87
+ downloadFileFromURL(url, outputFile);
88
+ System.out.println("Done");
89
+ System.exit(0);
90
+ } catch (Throwable e) {
91
+ System.out.println("- Error downloading");
92
+ e.printStackTrace();
93
+ System.exit(1);
94
+ }
95
+ }
96
+
97
+ private static void downloadFileFromURL(String urlString, File destination) throws Exception {
98
+ if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) {
99
+ String username = System.getenv("MVNW_USERNAME");
100
+ char[] password = System.getenv("MVNW_PASSWORD").toCharArray();
101
+ Authenticator.setDefault(new Authenticator() {
102
+ @Override
103
+ protected PasswordAuthentication getPasswordAuthentication() {
104
+ return new PasswordAuthentication(username, password);
105
+ }
106
+ });
107
+ }
108
+ URL website = new URL(urlString);
109
+ ReadableByteChannel rbc;
110
+ rbc = Channels.newChannel(website.openStream());
111
+ FileOutputStream fos = new FileOutputStream(destination);
112
+ fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
113
+ fos.close();
114
+ rbc.close();
115
+ }
116
+
117
+ }