diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile deleted file mode 100644 index 15771545..00000000 --- a/.devcontainer/Dockerfile +++ /dev/null @@ -1,36 +0,0 @@ -# FROM mcr.microsoft.com/devcontainers/java:1-21-bullseye -FROM ubuntu:22.04 - -# Add any tools that are needed beyond Java -RUN apt-get update && \ - apt-get install -y sudo sed vim git make gcc zlib1g-dev zip unzip tree curl wget jq && \ - apt-get autoremove -y && \ - apt-get clean -y - -# Create a user for development -ARG USERNAME=vscode -ARG USER_UID=1000 -ARG USER_GID=$USER_UID - -# Create the user with passwordless sudo privileges -RUN groupadd --gid $USER_GID $USERNAME \ - && useradd --uid $USER_UID --gid $USER_GID -m $USERNAME -s /bin/bash \ - && usermod -aG sudo $USERNAME \ - && echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \ - && chmod 0440 /etc/sudoers.d/$USERNAME \ - && chown -R $USERNAME:$USERNAME /home/$USERNAME - -WORKDIR /codenet-minerva-code-analyzer - -USER $USERNAME - -# Install Java and Gradle via SDKMan -RUN curl -s "https://get.sdkman.io" | bash - -# This SHELL command is needed to run using `source` -SHELL ["/bin/bash", "-c"] -RUN source "$HOME/.sdkman/bin/sdkman-init.sh" && \ - sdk install java 17.0.12-sem && \ - sdk use java 17.0.12-sem && \ - sdk install gradle 8.9 - diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json deleted file mode 100644 index 8845edf4..00000000 --- a/.devcontainer/devcontainer.json +++ /dev/null @@ -1,44 +0,0 @@ -// cspell: disable -{ - "name": "CodeAnalyzer", - "dockerFile": "Dockerfile", - "context": "..", - "remoteUser": "vscode", - "workspaceFolder": "/codenet-minerva-code-analyzer", - "workspaceMount": "source=${localWorkspaceFolder},target=/codenet-minerva-code-analyzer,type=bind,consistency=delegated", - "runArgs": ["-h", "codenet"], - "customizations": { - "vscode": { - "settings": { - "markdown-preview-github-styles.colorTheme": "light", - "makefile.extensionOutputFolder": "/tmp", - "cSpell.words": [ - "northstar", - "cyclomatic", - "jgrapht", - "stdlibs" - ], - "files.exclude": { - "**/.git": true, - "**/.DS_Store": true - } - }, - "extensions": [ - "vscjava.vscode-java-pack", - "vscjava.vscode-java-test", - "vscjava.vscode-java-debug", - "vscjava.vscode-gradle", - "donjayamanne.githistory", - "bierner.github-markdown-preview", - "yzhang.markdown-all-in-one", - "hnw.vscode-auto-open-markdown-preview", - "davidanson.vscode-markdownlint", - "bierner.markdown-preview-github-styles", - "streetsidesoftware.code-spell-checker", - "ms-azuretools.vscode-docker" - ] - } - }, - // Install the version of gradle the project uses - "postCreateCommand": "./gradlew" -} \ No newline at end of file diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 00000000..3eb44261 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,46 @@ +name: Deploy docs to GitHub Pages + +on: + push: + branches: [docs] + workflow_dispatch: + +permissions: + contents: write + +concurrency: + group: pages-deploy + cancel-in-progress: true + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - name: Checkout docs + uses: actions/checkout@v6 + + - name: Set up Node + uses: actions/setup-node@v4 + with: + node-version: 22 + cache: npm + + - name: Install dependencies + run: npm ci + + - name: Build site + run: npm run build + + - name: Publish dist to gh-pages + run: | + set -euo pipefail + cd dist + touch .nojekyll + git init + git config user.name "github-actions[bot]" + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + git add -A + git commit -m "Deploy ${GITHUB_SHA}" || true + git branch -M gh-pages + git remote add origin "https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git" + git push -f origin gh-pages diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index d31e75cd..00000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,58 +0,0 @@ -name: Java Release - -on: - push: - tags: - - "v*.*.*" - -permissions: - contents: write - -jobs: - release: - runs-on: ubuntu-latest - - env: - JAVA_HOME: ${{ github.workspace }}/graalvm-ce-java11-22.3.3 - - steps: - - name: Check out code - uses: actions/checkout@v4 - - - name: Set up JDK 11 from GraalVM - run: | - echo "${{ env.JAVA_HOME }}/bin" >> $GITHUB_PATH - wget https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-22.3.3/graalvm-ce-java11-linux-amd64-22.3.3.tar.gz - tar -xvzf graalvm-ce-java11-linux-amd64-22.3.3.tar.gz - ${{ env.JAVA_HOME }}/bin/gu install native-image - - - name: Make gradlew executable - run: chmod +x ./gradlew - - - name: Build and Test - id: build - continue-on-error: true # Allow the workflow to continue if this fails - run: ./gradlew clean fatJar - - - name: Delete tag on failure - if: steps.build.outcome != 'success' - run: | - git push --delete origin ${GITHUB_REF#refs/tags/} - exit 1 # Fail the workflow - - - name: Build Changelog - id: gen_changelog - uses: mikepenz/release-changelog-builder-action@v5 - with: - failOnError: "true" - configuration: .github/workflows/release_config.json - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Publish Release - uses: softprops/action-gh-release@v1 - with: - files: build/libs/*.jar - body: ${{ steps.gen_changelog.outputs.changelog }} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release_config.json b/.github/workflows/release_config.json deleted file mode 100644 index f0d4b5b2..00000000 --- a/.github/workflows/release_config.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "categories": [ - { - "title": "## 🚀 Features", - "labels": ["kind/feature", "enhancement"] - }, - { - "title": "## 🐛 Fixes", - "labels": ["fix", "bug"] - }, - { - "title": "## ♻️ Refactoring", - "labels": ["refactoring"] - }, - { - "title": "## ⚡️ Performance Improvements", - "labels": ["performance"] - }, - { - "title": "## \uD83D\uDCDA Documentation", - "labels": ["documentation", "doc"] - }, - { - "title": "## \uD83D\uDEA6 Tests", - "labels": ["test"] - }, - { - "title": "## \uD83D\uDEE0 Other Updates", - "labels": ["other", "kind/dependency-change"] - }, - { - "title": "## 🚨 Breaking Changes", - "labels": ["breaking"] - } - ], - "ignore_labels": [ - "ignore" - ] -} \ No newline at end of file diff --git a/.gitignore b/.gitignore index c4e7b66e..a9602669 100644 --- a/.gitignore +++ b/.gitignore @@ -1,198 +1,28 @@ -# User-specific stuff -.idea -.idea/**/workspace.xml -.idea/**/tasks.xml -.idea/**/usage.statistics.xml -.idea/**/dictionaries -.idea/**/shelf - -# AWS User-specific -.idea/**/aws.xml - -# Generated files -.idea/**/contentModel.xml - -# Sensitive or high-churn files -.idea/**/dataSources/ -.idea/**/dataSources.ids -.idea/**/dataSources.local.xml -.idea/**/sqlDataSources.xml -.idea/**/dynamic.xml -.idea/**/uiDesigner.xml -.idea/**/dbnavigator.xml - -# Gradle -.idea/**/gradle.xml -.idea/**/libraries - -# Gradle and Maven with auto-import -# When using Gradle or Maven with auto-import, you should exclude module files, -# since they will be recreated, and may cause churn. Uncomment if using -# auto-import. -# .idea/artifacts -# .idea/compiler.xml -# .idea/jarRepositories.xml -# .idea/modules.xml -# .idea/*.iml -# .idea/modules -# *.iml -# *.ipr - -# CMake -cmake-build-*/ - -# Mongo Explorer plugin -.idea/**/mongoSettings.xml - -# File-based project format -*.iws - -# IntelliJ -out/ - -# mpeltonen/sbt-idea plugin -.idea_modules/ - -# JIRA plugin -atlassian-ide-plugin.xml - -# Cursive Clojure plugin -.idea/replstate.xml - -# SonarLint plugin -.idea/sonarlint/ - -# Crashlytics plugin (for Android Studio and IntelliJ) -com_crashlytics_export_strings.xml -crashlytics.properties -crashlytics-build.properties -fabric.properties - -# Editor-based Rest Client -.idea/httpRequests - -# Android studio 3.1+ serialized cache file -.idea/caches/build_file_checksums.ser - -### Intellij Patch ### -# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721 - -# *.iml -# modules.xml -# .idea/misc.xml -# *.ipr - -# Sonarlint plugin -# https://plugins.jetbrains.com/plugin/7973-sonarlint -.idea/**/sonarlint/ - -# SonarQube Plugin -# https://plugins.jetbrains.com/plugin/7238-sonarqube-community-plugin -.idea/**/sonarIssues.xml - -# Markdown Navigator plugin -# https://plugins.jetbrains.com/plugin/7896-markdown-navigator-enhanced -.idea/**/markdown-navigator.xml -.idea/**/markdown-navigator-enh.xml -.idea/**/markdown-navigator/ - -# Cache file creation bug -# See https://youtrack.jetbrains.com/issue/JBR-2257 -.idea/$CACHE_FILE$ - -# CodeStream plugin -# https://plugins.jetbrains.com/plugin/12206-codestream -.idea/codestream.xml - -# Azure Toolkit for IntelliJ plugin -# https://plugins.jetbrains.com/plugin/8053-azure-toolkit-for-intellij -.idea/**/azureSettings.xml - -### Java ### -# Compiled class file -*.class - -# Log file -*.log - -# BlueJ files -*.ctxt - -# Mobile Tools for Java (J2ME) -.mtj.tmp/ - -# Package Files # -*.jar -*.war -*.nar -*.ear -*.zip -*.tar.gz -*.rar - -# Don't ignore the demo binaries -!etc/demo/jar/*.jar -!etc/demo/ear/*.ear -!etc/demo/war/*.war - -# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml -hs_err_pid* -replay_pid* - -### VisualStudioCode ### -.vscode/* - -!src/test/resources/sample_apps/daytrader8/binaries/daytrader8.jar -src/test/resources/sample_apps/daytrader8/output - -# Local History for Visual Studio Code -.history/ - -# Built Visual Studio Code Extensions -*.vsix - -### VisualStudioCode Patch ### -# Ignore all local history of files -.history -.ionide - -# Support for Project snippet scope -.vscode/*.code-snippets - -# Ignore code-workspaces -*.code-workspace - -### Gradle ### -.gradle -**/build/ -!src/**/build/ - -# Ignore Gradle GUI config -gradle-app.setting +# macOS +.DS_Store -# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored) -!gradle-wrapper.jar +# environment files +.env +.env.production -# Avoid ignore Gradle wrappper properties -!gradle-wrapper.properties +# Astro build output & generated types +dist/ +.astro/ -# Cache of project -.gradletasknamecache +# dependencies +node_modules/ -# Eclipse Gradle plugin generated files -# Eclipse Core -.project -# JDT-specific (Eclipse Java Development Tools) -.classpath +# logs +npm-debug.log* +yarn-debug.log* +pnpm-debug.log* -### Gradle Patch ### -# Java heap dump -*.hprof +# Python (API doc generation) +__pycache__/ +*.py[cod] +.python-version +.venv/ +.venv-docs/ -# End of https://www.toptal.com/developers/gitignore/api/intellij,gradle,java,visualstudiocode -.idea -.DS_Store -.vscode -bin/ -etc/ -/src/test/resources/sample_apps/daytrader8/output/ +# cache +.cache/ diff --git a/README.md b/README.md index bf70d632..b198755c 100644 --- a/README.md +++ b/README.md @@ -1,191 +1,54 @@ -![logo](./docs/assets/logo.png) +# codeanalyzer-java documentation -Native WALA implementation of source code analysis tool for Enterprise Java Applications. +This branch (`docs`) contains the documentation site for +[**codeanalyzer-java**](https://github.com/codellm-devkit/codeanalyzer-java) — the +WALA + Javaparser static-analysis backend behind CodeLLM-DevKit's Java support. -## 1. Prerequisites +The site is built with [Astro](https://astro.build/) and +[Starlight](https://starlight.astro.build/), and is deployed to GitHub Pages. -Before you begin, ensure you have met the following requirements: +> **Looking for the analyzer source code?** It lives on the +> [`main`](https://github.com/codellm-devkit/codeanalyzer-java/tree/main) branch. -* You have a Linux/MacOS/WSL machine. -* You have installed the latest version of [SDKMan!](sdkman.io/) - -### 1.1. Install SDKMan! -1. Install SDKMan! - Open your terminal and enter the following command: - - ```bash - curl -s "https://get.sdkman.io" | bash - ``` - - Follow the on-screen instructions to complete the installation. - -2. Open a new terminal or source the SDKMan! scripts: - - ```bash - source "$HOME/.sdkman/bin/sdkman-init.sh" - ``` - -## 2. Building `codeanalyzer` - -### 2.1. Install Java 11 or above - -1. You can list all available GraalVM versions with: - - ```bash - sdk list java | grep sem - ``` - You should see the following: - ``` - Semeru | | 21.0.2 | sem | | 21.0.2-sem - | | 21.0.1 | sem | | 21.0.1-sem - | | 17.0.10 | sem | | 17.0.10-sem - | | 17.0.9 | sem | | 17.0.9-sem - | | 11.0.22 | sem | installed | 11.0.22-sem - | | 11.0.21 | sem | | 11.0.21-sem - ``` - -2. Install Java 11 or above (we'll go with 17.0.10-sem): - - ```bash - sdk install java 17.0.10-sem - ``` - -3. Set Java 17 as the current Java version: - - ```bash - sdk use java 17.0.10-sem - ``` - -### 2.2. Build `codeanalyzer` - -Clone the repository (if you haven't already) and navigate into the cloned directory. - -Run the Gradle wrapper script to build the project. This will compile the project using GraalVM native image. +## Local development ```bash -./gradlew fatJar +npm install +npm run dev # start the dev server at http://localhost:4321 ``` -### 2.3. Using `codeanalyzer` - -The jar will be built at `build/libs/codeanalyzer-1.0.jar`. It may be used as follows: +| Command | Action | +|---------|--------| +| `npm install` | Install dependencies | +| `npm run dev` | Start the local dev server | +| `npm run build` | Build the production site to `./dist/` | +| `npm run preview` | Preview the built site locally | -```help -Usage: java -jar /path/to/codeanalyzer.jar [-hvV] [--no-build] [-a=] [-b=] - [-i=] [-o=] [-s=] -Convert java binary into a comprehensive system dependency graph. - -i, --input= Path to the project root directory. - -s, --source-analysis= - Analyze a single string of java source code instead - the project. - -o, --output= Destination directory to save the output graphs. By - default, the SDG formatted as a JSON will be - printed to the console. - -b, --build-cmd= Custom build command. Defaults to auto build. - --no-build Do not build your application. Use this option if - you have already built your application. - -a, --analysis-level= - Level of analysis to perform. Options: 1 (for just - symbol table) or 2 (for call graph). Default: 1 - -v, --verbose Print logs to console. - -h, --help Show this help message and exit. - -V, --version Print version information and exit. - -t, --target-files For each file user wants to perform source analysis on top of existing analysis.json +## Structure ``` - - -## 3. Installing `codeanalyzer` as a native binary (once built, no JVM will be required for running `codeanalyzer`) - -To install `codeanalyzer`, follow these steps: - -### 3.1. Install GraalVM using SDKMan - -1. You can list all available GraalVM versions with: - - ```bash - sdk list java | grep graal - ``` - -2. Install GraalVM 17 or above (we'll go with 21.0.2-graalce): - - ```bash - sdk install java 21.0.2-graalce - ``` - -3. Set GraalVM 21 as the current Java version: - - ```bash - sdk use java 21.0.2-graalce - ``` - -### 3.2. Build the Project - -Clone the repository (if you haven't already) and navigate into the cloned directory. - -Run the Gradle wrapper script to build the project. This will compile the project using GraalVM native image. - -```bash -./gradlew nativeCompile -PbinDir=$HOME/.local/bin +src/ +├── assets/ logos +├── styles/docs.css theme overrides +├── content.config.ts Starlight content collection +└── content/docs/ the documentation pages (MDX) + ├── index.mdx landing page + ├── what-is-codeanalyzer.mdx + ├── quickstart.mdx + ├── installing.mdx + ├── guides/ architecture, analysis levels, build, incremental + ├── reference/ CLI options + examples + ├── schema/ output JSON schema + ├── frameworks/ entry points + CRUD detection + └── integration/ Python SDK (CLDK) +astro.config.mjs site + sidebar configuration ``` -**Note: `-PbinDir` is optional. If not provided, this command places the binaries in `build/bin`.** - -### 3.3. Using `codeanalyzer` - -Assuming the path you provided in `-PbinDir` (in my case `$HOME/.local/bin`) is in your `$PATH`, after installation, you can use `codeanalyzer` by following the below format: - - ```help - Usage: codeanalyzer [-hqV] [-d=] [-e=] -i= - -o= - Convert java binary (*.jar, *.ear, *.war) to a neo4j graph. - -d, --app-deps= Path to the application dependencies. - -e, --extra-libs= - Path to the extra libraries. - -h, --help Show this help message and exit. - -i, --input= Path to the input jar(s). - -o, --output= Destination directory to save the output graphs. - -q, --quiet Don't print logs to console. - -V, --version Print version information and exit. - ``` - -There is a sample application in `src/test/resources/sample_apps/daytrader8/binaries/`. You can use this to test the tool. +## Deployment - ```sh - codeanalyzer -i src/test/resources/sample_apps/daytrader8/binaries/ - ``` +`.github/workflows/deploy.yml` builds the site and publishes it to GitHub Pages +on every push to the `docs` branch. -This will produce print the SDG on the console. Explore other flags to save the output to a JSON. +## License -## FAQ - -1. After making a few code changes, my native binary gives random exceptions. But, my code works perfectly with `java -jar`. - - The `reflect-config.json` is most likely out of date. Plese follow the below instructions: - - a. Build the fatjar using `./gradlew fatJar` - - b. Run the following - - ```sh - java -agentlib:native-image-agent=config-output-dir=src/main/resources/META-INF/native-image-config -jar build/libs/codeanalyzer-1.0.jar -i src/test/resources/sample.applications/daytrader8/source -a 2 -v - ``` - - c. Then build using the instructions in [§3.3](./README.md#33-build-the-project). - - The problem should be resolved. - -## LICENSE - -```LICENSE -Copyright IBM Corporation 2023, 2024 - -Licensed under the Apache Public License 2.0, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -``` +Apache 2.0 — see [LICENSE](./LICENSE). diff --git a/astro.config.mjs b/astro.config.mjs new file mode 100644 index 00000000..bf46ade6 --- /dev/null +++ b/astro.config.mjs @@ -0,0 +1,142 @@ +import { defineConfig } from "astro/config"; +import starlight from "@astrojs/starlight"; +import mermaid from "astro-mermaid"; +import { pluginCollapsibleSections } from "@expressive-code/plugin-collapsible-sections"; +import { pluginLineNumbers } from "@expressive-code/plugin-line-numbers"; + +// https://astro.build/config +export default defineConfig({ + site: "https://codellm-devkit.github.io", + base: "/codeanalyzer-java", + integrations: [ + // Mermaid must run BEFORE Starlight so it can preprocess ```mermaid blocks. + mermaid({ + theme: "neutral", + autoTheme: true, + mermaidConfig: { + flowchart: { curve: "basis" }, + }, + }), + starlight({ + title: "codeanalyzer-java", + tagline: "WALA + Javaparser static analysis for enterprise Java — one JSON artifact or a queryable Neo4j graph.", + description: + "codeanalyzer-java is the JVM static-analysis backend behind CodeLLM-DevKit's Java support: a standalone JAR that turns a Java project into a symbol table and call graph, emitted as one versioned analysis JSON artifact or projected into a queryable Neo4j property graph.", + logo: { + src: "./src/assets/logo.png", + replacesTitle: true, + }, + favicon: "/favicon.png", + customCss: ["./src/styles/docs.css"], + expressiveCode: { + plugins: [pluginCollapsibleSections(), pluginLineNumbers()], + styleOverrides: { + borderRadius: "0.4rem", + frames: { + shadowColor: "transparent", + }, + }, + defaultProps: { + showLineNumbers: false, + }, + }, + head: [ + { + tag: "link", + attrs: { rel: "preconnect", href: "https://fonts.googleapis.com" }, + }, + { + tag: "link", + attrs: { + rel: "preconnect", + href: "https://fonts.gstatic.com", + crossorigin: "", + }, + }, + { + tag: "link", + attrs: { + rel: "stylesheet", + href: "https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Space+Mono:wght@400;700&display=swap", + }, + }, + ], + social: [ + { + icon: "github", + label: "codeanalyzer-java on GitHub", + href: "https://github.com/codellm-devkit/codeanalyzer-java", + }, + { + icon: "seti:java", + label: "codeanalyzer-java releases", + href: "https://github.com/codellm-devkit/codeanalyzer-java/releases", + }, + { + icon: "discord", + label: "CLDK on Discord", + href: "https://discord.gg/zEjz9YrmqN", + }, + ], + editLink: { + baseUrl: "https://github.com/codellm-devkit/codeanalyzer-java/edit/docs/", + }, + sidebar: [ + { + label: "Start here", + items: [ + { label: "What is codeanalyzer-java?", slug: "what-is-codeanalyzer" }, + { label: "Quickstart", slug: "quickstart" }, + { label: "Installation", slug: "installing" }, + ], + }, + { + label: "Guides", + items: [ + { label: "Architecture", slug: "guides/architecture" }, + { label: "Analysis levels", slug: "guides/analysis-levels" }, + { label: "Build integration", slug: "guides/build-integration" }, + { label: "Incremental analysis", slug: "guides/incremental-analysis" }, + { label: "Neo4j output", slug: "guides/neo4j-output" }, + ], + }, + { + label: "CLI Reference", + items: [ + { label: "Command-line options", slug: "reference/cli" }, + { label: "Examples", slug: "reference/examples" }, + ], + }, + { + label: "Output Schema", + items: [ + { label: "Overview", slug: "schema" }, + { label: "Symbol table", slug: "schema/symbol-table" }, + { label: "Call graph", slug: "schema/call-graph" }, + { label: "Neo4j graph", slug: "schema/neo4j-graph" }, + ], + }, + { + label: "Framework Support", + items: [ + { label: "Entry points", slug: "frameworks/entry-points" }, + { label: "CRUD detection", slug: "frameworks/crud" }, + ], + }, + { + label: "Integration", + items: [ + { label: "Python SDK (CLDK)", slug: "integration/python-sdk" }, + ], + }, + { + label: "Project", + items: [ + { label: "Contributing", slug: "contributing" }, + { label: "Troubleshooting", slug: "troubleshooting" }, + ], + }, + ], + }), + ], +}); diff --git a/build.gradle b/build.gradle deleted file mode 100644 index b2ffabf8..00000000 --- a/build.gradle +++ /dev/null @@ -1,298 +0,0 @@ - /* -Copyright IBM Corporation 2023, 2024 - -Licensed under the Apache Public License 2.0, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -plugins { - // Apply the application plugin to add support for building a CLI application in Java. - id 'eclipse' - id 'application' - id 'org.graalvm.buildtools.native' version '0.10.4' - id 'org.jetbrains.kotlin.jvm' - id 'com.diffplug.spotless' version '6.25.0' -} - -// Get the version from the property file first -version = new Properties().with {property -> - file("gradle.properties").withInputStream {property.load(it)} - property.getProperty("version") -} - -repositories { - mavenCentral() - mavenLocal() -} - -java { -} - -if (project.hasProperty('mainClass')) { - mainClassName = project.getProperty('mainClass') -} else { - // use a default - mainClassName =("com.ibm.cldk.CodeAnalyzer") -} - -sourceSets { - main { - java { - srcDirs = ["src/main/java"] - } - resources { - srcDirs = ["src/main/resources"] - } - } - test { - java { - srcDirs = ['src/test/java'] - } - resources { - srcDirs= ["src/test/resources"] - } - } -} - -// Remove that nagging bin folder vscode seems to generate every single time -clean.doFirst { - delete "${rootDir}/bin" -} - -dependencies { - // PICOCLI for handling commandline interface - implementation 'info.picocli:picocli:4.1.0' - testImplementation 'org.junit.jupiter:junit-jupiter:5.8.1' - testImplementation 'org.junit.jupiter:junit-jupiter:5.8.1' - testImplementation 'org.junit.jupiter:junit-jupiter:5.8.1' - testImplementation 'org.junit.jupiter:junit-jupiter:5.8.1' - annotationProcessor 'info.picocli:picocli-codegen:4.1.0' - - implementation 'org.apache.commons:commons-lang3:3.14.0' - - implementation group: 'commons-cli', name: 'commons-cli', version: '1.4' - - implementation 'commons-io:commons-io:2.8.0' - - implementation 'org.apache.logging.log4j:log4j-api:2.18.0' - implementation 'org.apache.logging.log4j:log4j-core:2.18.0' - def walaVersion = '1.6.7' - - compileOnly 'org.projectlombok:lombok:1.18.30' - annotationProcessor 'org.projectlombok:lombok:1.18.30' - - implementation "com.ibm.wala:com.ibm.wala.shrike:${walaVersion}" - implementation "com.ibm.wala:com.ibm.wala.util:${walaVersion}" - implementation "com.ibm.wala:com.ibm.wala.core:${walaVersion}" - implementation "com.ibm.wala:com.ibm.wala.cast:${walaVersion}" - implementation "com.ibm.wala:com.ibm.wala.cast.java:${walaVersion}" - implementation "com.ibm.wala:com.ibm.wala.cast.java.ecj:${walaVersion}" - - compileOnly 'org.projectlombok:lombok:1.18.30' - annotationProcessor 'org.projectlombok:lombok:1.18.30' - - implementation 'com.google.guava:guava:33.0.0-jre' - - implementation("commons-io:commons-io:2.15.1") - implementation("org.ow2.asm:asm:9.6") - implementation("org.eclipse.jdt:org.eclipse.jdt.core:3.21.0") - implementation("org.eclipse.platform:org.eclipse.core.commands:3.9.700") - implementation("org.eclipse.platform:org.eclipse.core.contenttype:3.7.1000") - implementation("org.eclipse.platform:org.eclipse.core.expressions:3.7.100") - implementation("org.eclipse.platform:org.eclipse.core.filesystem:1.9.0") - implementation("org.eclipse.platform:org.eclipse.core.jobs:3.11.0") - implementation('org.eclipse.platform:org.eclipse.core.resources:3.20.0') - implementation("org.eclipse.platform:org.eclipse.core.runtime:3.17.100") - implementation("org.eclipse.platform:org.eclipse.equinox.app:1.5.100") - implementation("org.eclipse.platform:org.eclipse.equinox.common:3.14.100") - implementation("org.eclipse.platform:org.eclipse.equinox.preferences:3.8.200") - implementation("org.eclipse.platform:org.eclipse.equinox.registry:3.10.200") - implementation("org.eclipse.platform:org.eclipse.osgi:3.16.300") - implementation("org.eclipse.platform:org.eclipse.text:3.11.0") - - implementation('org.json:json:20231013') - implementation('com.google.code.gson:gson:2.10.1') - implementation('org.jgrapht:jgrapht-core:1.5.2') - implementation('org.jgrapht:jgrapht-io:1.5.2') - implementation('org.jgrapht:jgrapht-ext:1.5.2') - implementation('com.github.javaparser:javaparser-symbol-solver-core:3.26.3') - implementation('com.github.javaparser:javaparser-core:3.26.3') - - // TestContainers - testImplementation 'org.testcontainers:testcontainers:1.20.6' - testImplementation 'org.testcontainers:junit-jupiter:1.20.6' - - // JUnit 5 - testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.1' - testImplementation 'org.junit.jupiter:junit-jupiter-params:5.10.1' // for @ParameterizedTest - testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.10.1' - - // SLF4J - for TestContainers logging - testImplementation 'org.slf4j:slf4j-api:2.0.9' - testImplementation 'org.slf4j:slf4j-simple:2.0.9' - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8" - -} - -test { - useJUnitPlatform() - // Optional: Enable TestContainers reuse to speed up tests - systemProperty 'testcontainers.reuse.enable', 'true' -} - -spotless { - java { - target 'src/**/*.java' - trimTrailingWhitespace() - endWithNewline() - importOrder() - } -} - -compileJava.dependsOn spotlessApply - -// Optionally, automatically format before compilation -// compileJava.dependsOn googleJavaFormat - -task fatJar(type: Jar) { - archiveBaseName = 'codeanalyzer' - duplicatesStrategy = DuplicatesStrategy.EXCLUDE - manifest { - attributes( - 'Implementation-Title': 'codeanalyzer', - 'Implementation-Version': project.version, - 'Main-Class': 'com.ibm.cldk.CodeAnalyzer' - ) - } - - // Collect and include runtime classpath dependencies, excluding signature files - from { - configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) } - } - exclude 'META-INF/*.RSA', 'META-INF/*.SF', 'META-INF/*.DSA' - with jar -} - -run { - if (project.hasProperty('args')) { - args = project.args.split(',') - } -} - -graalvmNative { - binaries { - main { - imageName = "codeanalyzer" - mainClass = "com.ibm.cldk.CodeAnalyzer" - buildArgs.add("-Ob") - buildArgs.add("-march=compatibility") - buildArgs.add("--no-fallback") - buildArgs.add("--no-server") - buildArgs.add("-H:ReflectionConfigurationFiles=$projectDir/src/main/resources/META-INF/native-image-config/reflect-config.json") - buildArgs.add("-H:ResourceConfigurationFiles=$projectDir/src/main/resources/META-INF/native-image-config/resource-config.json") - buildArgs.add("-H:JNIConfigurationFiles=$projectDir/src/main/resources/META-INF/native-image-config/jni-config.json") - buildArgs.add("-H:DynamicProxyConfigurationFiles=$projectDir/src/main/resources/META-INF/native-image-config/proxy-config.json") - } - test { - buildArgs.add("-O0") - } - } - binaries.configureEach { - buildArgs.add("--verbose") - } -} - -// Define a property for the output directory -def binDir = project.hasProperty('binDir') ? project.property('binDir') : "$projectDir/artifacts/bin" - - -// Task to copy the native executable to the specified directory -task copyNativeExecutable(type: Copy) { - dependsOn nativeCompile // Ensure this runs after the native image is built - - from "${buildDir}/native/nativeCompile/codeanalyzer" - into binDir - - fileMode = 0755 -} - -task createRelease { - doLast { - def releaseTitle = 'latest' - def hostName = 'git@github.ibm.com' - def repo = 'cldk/codeanalyzer' - - // Command to create release - def delete = "gh release delete latest --cleanup-tag --yes -R ${hostName}:${repo}"// - // Execute command - def proc = delete.execute() - proc.in.eachLine { line -> println line } // Print output - proc.err.eachLine { line -> println "Error: $line" } // Print error - proc.waitFor() // Wait for process to complete - def command = "gh release create latest $projectDir/build/libs/codeanalyzer.jar -t ${releaseTitle} -R ${hostName}:${repo}" - try { - def release = command.execute() - release.in.eachLine { line -> println line } // Print output - release.err.eachLine { line -> println "Error: $line" } // Print error - release.waitFor() // Wait for process to complete - } catch (Exception e) { - throw new GradleException("Error executing gh command: ${e.message}") - } - } - -} - -tasks.register('bumpVersion') { - description = 'Bumps the version number (patch, minor, or major)' - group = 'Versioning' - - doLast { - def versionFile = file('gradle.properties') - def versionFileText = versionFile.text - def versionPattern = /version\s*=\s*(\d+)\.(\d+)\.(\d+)/ - def matcher = (versionFileText =~ versionPattern) - - if (matcher.find()) { - def major = matcher.group(1) as int - def minor = matcher.group(2) as int - def patch = matcher.group(3) as int - - def bumpType = project.hasProperty('bumpType') ? project.bumpType : 'patch' - - switch (bumpType) { - case 'major': - major++ - minor = 0 - patch = 0 - break - case 'minor': - minor++ - patch = 0 - break - case 'patch': - default: - patch++ - break - } - - def newVersion = "${major}.${minor}.${patch}" - def updatedContent = versionFileText.replaceFirst(versionPattern, "version=$newVersion") - versionFile.text = updatedContent - - println "Version bumped to $newVersion" - } else { - throw new GradleException("Version not found in gradle.properties") - } - } -} - -nativeCompile.finalizedBy copyNativeExecutable - kotlin { - jvmToolchain(11) - } diff --git a/docs/assets/Artboard 1.png b/docs/assets/Artboard 1.png deleted file mode 100644 index 11244faa..00000000 Binary files a/docs/assets/Artboard 1.png and /dev/null differ diff --git a/docs/assets/ns.png b/docs/assets/ns.png deleted file mode 100644 index b998bf91..00000000 Binary files a/docs/assets/ns.png and /dev/null differ diff --git a/gradle.properties b/gradle.properties deleted file mode 100644 index 867fa98a..00000000 --- a/gradle.properties +++ /dev/null @@ -1 +0,0 @@ -version=2.3.7 diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar deleted file mode 100644 index 2c352119..00000000 Binary files a/gradle/wrapper/gradle-wrapper.jar and /dev/null differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index 09523c0e..00000000 --- a/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,7 +0,0 @@ -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip -networkTimeout=10000 -validateDistributionUrl=true -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew deleted file mode 100755 index f5feea6d..00000000 --- a/gradlew +++ /dev/null @@ -1,252 +0,0 @@ -#!/bin/sh - -# -# Copyright © 2015-2021 the original authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# SPDX-License-Identifier: Apache-2.0 -# - -############################################################################## -# -# Gradle start up script for POSIX generated by Gradle. -# -# Important for running: -# -# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is -# noncompliant, but you have some other compliant shell such as ksh or -# bash, then to run this script, type that shell name before the whole -# command line, like: -# -# ksh Gradle -# -# Busybox and similar reduced shells will NOT work, because this script -# requires all of these POSIX shell features: -# * functions; -# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», -# «${var#prefix}», «${var%suffix}», and «$( cmd )»; -# * compound commands having a testable exit status, especially «case»; -# * various built-in commands including «command», «set», and «ulimit». -# -# Important for patching: -# -# (2) This script targets any POSIX shell, so it avoids extensions provided -# by Bash, Ksh, etc; in particular arrays are avoided. -# -# The "traditional" practice of packing multiple parameters into a -# space-separated string is a well documented source of bugs and security -# problems, so this is (mostly) avoided, by progressively accumulating -# options in "$@", and eventually passing that to Java. -# -# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, -# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; -# see the in-line comments for details. -# -# There are tweaks for specific operating systems such as AIX, CygWin, -# Darwin, MinGW, and NonStop. -# -# (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt -# within the Gradle project. -# -# You can find Gradle at https://github.com/gradle/gradle/. -# -############################################################################## - -# Attempt to set APP_HOME - -# Resolve links: $0 may be a link -app_path=$0 - -# Need this for daisy-chained symlinks. -while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] -do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac -done - -# This is normally unused -# shellcheck disable=SC2034 -APP_BASE_NAME=${0##*/} -# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) -APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s -' "$PWD" ) || exit - -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD=maximum - -warn () { - echo "$*" -} >&2 - -die () { - echo - echo "$*" - echo - exit 1 -} >&2 - -# OS specific support (must be 'true' or 'false'). -cygwin=false -msys=false -darwin=false -nonstop=false -case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; -esac - -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar - - -# Determine the Java command to use to start the JVM. -if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -else - JAVACMD=java - if ! command -v java >/dev/null 2>&1 - then - die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -fi - -# Increase the maximum file descriptors if we can. -if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC2039,SC3045 - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC2039,SC3045 - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac -fi - -# Collect all arguments for the java command, stacking in reverse order: -# * args from the command line -# * the main class name -# * -classpath -# * -D...appname settings -# * --module-path (only if needed) -# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. - -# For Cygwin or MSYS, switch paths to Windows format before running java -if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - - JAVACMD=$( cygpath --unix "$JAVACMD" ) - - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done -fi - - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' - -# Collect all arguments for the java command: -# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, -# and any embedded shellness will be escaped. -# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be -# treated as '${Hostname}' itself on the command line. - -set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" - -# Stop when "xargs" is not available. -if ! command -v xargs >/dev/null 2>&1 -then - die "xargs is not available" -fi - -# Use "xargs" to parse quoted args. -# -# With -n1 it outputs one arg per line, with the quotes and backslashes removed. -# -# In Bash we could simply go: -# -# readarray ARGS < <( xargs -n1 <<<"$var" ) && -# set -- "${ARGS[@]}" "$@" -# -# but POSIX shell has neither arrays nor command substitution, so instead we -# post-process each arg (as a line of input to sed) to backslash-escape any -# character that might be a shell metacharacter, then use eval to reverse -# that process (while maintaining the separation between arguments), and wrap -# the whole thing up as a single "set" statement. -# -# This will of course break if any of these variables contains a newline or -# an unmatched quote. -# - -eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' - -exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat deleted file mode 100644 index 9b42019c..00000000 --- a/gradlew.bat +++ /dev/null @@ -1,94 +0,0 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem -@rem SPDX-License-Identifier: Apache-2.0 -@rem - -@if "%DEBUG%"=="" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -set DIRNAME=%~dp0 -if "%DIRNAME%"=="" set DIRNAME=. -@rem This is normally unused -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if %ERRORLEVEL% equ 0 goto execute - -echo. 1>&2 -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 -echo. 1>&2 -echo Please set the JAVA_HOME variable in your environment to match the 1>&2 -echo location of your Java installation. 1>&2 - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto execute - -echo. 1>&2 -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 -echo. 1>&2 -echo Please set the JAVA_HOME variable in your environment to match the 1>&2 -echo location of your Java installation. 1>&2 - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* - -:end -@rem End local scope for the variables with windows NT shell -if %ERRORLEVEL% equ 0 goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -set EXIT_CODE=%ERRORLEVEL% -if %EXIT_CODE% equ 0 set EXIT_CODE=1 -if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% -exit /b %EXIT_CODE% - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 00000000..8ba56009 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,8065 @@ +{ + "name": "codeanalyzer-java-docs", + "version": "0.0.1", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "codeanalyzer-java-docs", + "version": "0.0.1", + "dependencies": { + "@astrojs/starlight": "^0.37.6", + "@expressive-code/plugin-collapsible-sections": "^0.42.0", + "@expressive-code/plugin-line-numbers": "^0.42.0", + "astro": "^5.18.0", + "astro-mermaid": "^2.0.2", + "mermaid": "^11.15.0", + "sharp": "^0.34.2" + } + }, + "node_modules/@antfu/install-pkg": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@antfu/install-pkg/-/install-pkg-1.1.0.tgz", + "integrity": "sha512-MGQsmw10ZyI+EJo45CdSER4zEb+p31LpDAFp2Z3gkSd1yqVZGi0Ebx++YTEMonJy4oChEMLsxZ64j8FH6sSqtQ==", + "license": "MIT", + "dependencies": { + "package-manager-detector": "^1.3.0", + "tinyexec": "^1.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/antfu" + } + }, + "node_modules/@astrojs/compiler": { + "version": "2.13.1", + "resolved": "https://registry.npmjs.org/@astrojs/compiler/-/compiler-2.13.1.tgz", + "integrity": "sha512-f3FN83d2G/v32ipNClRKgYv30onQlMZX1vCeZMjPsMMPl1mDpmbl0+N5BYo4S/ofzqJyS5hvwacEo0CCVDn/Qg==", + "license": "MIT" + }, + "node_modules/@astrojs/internal-helpers": { + "version": "0.7.6", + "resolved": "https://registry.npmjs.org/@astrojs/internal-helpers/-/internal-helpers-0.7.6.tgz", + "integrity": "sha512-GOle7smBWKfMSP8osUIGOlB5kaHdQLV3foCsf+5Q9Wsuu+C6Fs3Ez/ttXmhjZ1HkSgsogcM1RXSjjOVieHq16Q==", + "license": "MIT" + }, + "node_modules/@astrojs/markdown-remark": { + "version": "6.3.11", + "resolved": "https://registry.npmjs.org/@astrojs/markdown-remark/-/markdown-remark-6.3.11.tgz", + "integrity": "sha512-hcaxX/5aC6lQgHeGh1i+aauvSwIT6cfyFjKWvExYSxUhZZBBdvCliOtu06gbQyhbe0pGJNoNmqNlQZ5zYUuIyQ==", + "license": "MIT", + "dependencies": { + "@astrojs/internal-helpers": "0.7.6", + "@astrojs/prism": "3.3.0", + "github-slugger": "^2.0.0", + "hast-util-from-html": "^2.0.3", + "hast-util-to-text": "^4.0.2", + "import-meta-resolve": "^4.2.0", + "js-yaml": "^4.1.1", + "mdast-util-definitions": "^6.0.0", + "rehype-raw": "^7.0.0", + "rehype-stringify": "^10.0.1", + "remark-gfm": "^4.0.1", + "remark-parse": "^11.0.0", + "remark-rehype": "^11.1.2", + "remark-smartypants": "^3.0.2", + "shiki": "^3.21.0", + "smol-toml": "^1.6.0", + "unified": "^11.0.5", + "unist-util-remove-position": "^5.0.0", + "unist-util-visit": "^5.0.0", + "unist-util-visit-parents": "^6.0.2", + "vfile": "^6.0.3" + } + }, + "node_modules/@astrojs/mdx": { + "version": "4.3.14", + "resolved": "https://registry.npmjs.org/@astrojs/mdx/-/mdx-4.3.14.tgz", + "integrity": "sha512-FBrqJQORVm+rkRa2TS5CjU9PBA6hkhrwLVBSS9A77gN2+iehvjq1w6yya/d0YKC7osiVorKkr3Qd9wNbl0ZkGA==", + "license": "MIT", + "dependencies": { + "@astrojs/markdown-remark": "6.3.11", + "@mdx-js/mdx": "^3.1.1", + "acorn": "^8.15.0", + "es-module-lexer": "^1.7.0", + "estree-util-visit": "^2.0.0", + "hast-util-to-html": "^9.0.5", + "piccolore": "^0.1.3", + "rehype-raw": "^7.0.0", + "remark-gfm": "^4.0.1", + "remark-smartypants": "^3.0.2", + "source-map": "^0.7.6", + "unist-util-visit": "^5.0.0", + "vfile": "^6.0.3" + }, + "engines": { + "node": "18.20.8 || ^20.3.0 || >=22.0.0" + }, + "peerDependencies": { + "astro": "^5.0.0" + } + }, + "node_modules/@astrojs/prism": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/@astrojs/prism/-/prism-3.3.0.tgz", + "integrity": "sha512-q8VwfU/fDZNoDOf+r7jUnMC2//H2l0TuQ6FkGJL8vD8nw/q5KiL3DS1KKBI3QhI9UQhpJ5dc7AtqfbXWuOgLCQ==", + "license": "MIT", + "dependencies": { + "prismjs": "^1.30.0" + }, + "engines": { + "node": "18.20.8 || ^20.3.0 || >=22.0.0" + } + }, + "node_modules/@astrojs/sitemap": { + "version": "3.7.3", + "resolved": "https://registry.npmjs.org/@astrojs/sitemap/-/sitemap-3.7.3.tgz", + "integrity": "sha512-f8euLVsyeAmAkSm/1M2Kb8sL8byQmfgbvBNaHFItCheTj/IpiJYSEWVcqDHZ/yEHxiS7+w87mQkzwZaPHmk5GA==", + "license": "MIT", + "dependencies": { + "sitemap": "^9.0.0", + "stream-replace-string": "^2.0.0", + "zod": "^4.3.6" + } + }, + "node_modules/@astrojs/starlight": { + "version": "0.37.7", + "resolved": "https://registry.npmjs.org/@astrojs/starlight/-/starlight-0.37.7.tgz", + "integrity": "sha512-KyBnou8aKIlPJUSNx6a1SN7XyH22oj/VAvTGC+Edld4Bnei1A//pmCRTBvSrSeoGrdUjK0ErFUfaEhhO1bPfDg==", + "license": "MIT", + "dependencies": { + "@astrojs/markdown-remark": "^6.3.1", + "@astrojs/mdx": "^4.2.3", + "@astrojs/sitemap": "^3.3.0", + "@pagefind/default-ui": "^1.3.0", + "@types/hast": "^3.0.4", + "@types/js-yaml": "^4.0.9", + "@types/mdast": "^4.0.4", + "astro-expressive-code": "^0.41.1", + "bcp-47": "^2.1.0", + "hast-util-from-html": "^2.0.1", + "hast-util-select": "^6.0.2", + "hast-util-to-string": "^3.0.0", + "hastscript": "^9.0.0", + "i18next": "^23.11.5", + "js-yaml": "^4.1.0", + "klona": "^2.0.6", + "magic-string": "^0.30.17", + "mdast-util-directive": "^3.0.0", + "mdast-util-to-markdown": "^2.1.0", + "mdast-util-to-string": "^4.0.0", + "pagefind": "^1.3.0", + "rehype": "^13.0.1", + "rehype-format": "^5.0.0", + "remark-directive": "^3.0.0", + "ultrahtml": "^1.6.0", + "unified": "^11.0.5", + "unist-util-visit": "^5.0.0", + "vfile": "^6.0.2" + }, + "peerDependencies": { + "astro": "^5.5.0" + } + }, + "node_modules/@astrojs/telemetry": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/@astrojs/telemetry/-/telemetry-3.3.0.tgz", + "integrity": "sha512-UFBgfeldP06qu6khs/yY+q1cDAaArM2/7AEIqQ9Cuvf7B1hNLq0xDrZkct+QoIGyjq56y8IaE2I3CTvG99mlhQ==", + "license": "MIT", + "dependencies": { + "ci-info": "^4.2.0", + "debug": "^4.4.0", + "dlv": "^1.1.3", + "dset": "^3.1.4", + "is-docker": "^3.0.0", + "is-wsl": "^3.1.0", + "which-pm-runs": "^1.1.0" + }, + "engines": { + "node": "18.20.8 || ^20.3.0 || >=22.0.0" + } + }, + "node_modules/@babel/helper-string-parser": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.29.7.tgz", + "integrity": "sha512-Pb5ijPrZ89GDH8223L4UP8i6QApWxs04RbPQJTeWDV0/keR2E36MeKnyr6LYmUUvqRRI+Iv87SuF1W6ErINzYw==", + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.29.7.tgz", + "integrity": "sha512-qehxGkRj55h/ff8EMaJ+cYhyaKlHIxqYDn682wQD7RNp9UujOQsHog2uS0r2vzr4pW+sXf90NeeayjcNaX3fFg==", + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/parser": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.29.7.tgz", + "integrity": "sha512-hnORnjP/1P/zFEndoeX+n+t1RwWRJiJpM/jO7FW32Kn9r5+sJB2JWOdYo4L6k78j15eCwY3Gm/7364B1EMwtNg==", + "license": "MIT", + "dependencies": { + "@babel/types": "^7.29.7" + }, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/runtime": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.29.7.tgz", + "integrity": "sha512-Nq8OhGWiZIZGV6hLHoyAKLLcJihP/xFeBMGJoUrxTX2psI8dCifzLhZISFb+VWS3wFMRDmCGw5R+dOySCqPLhw==", + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/types": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.29.7.tgz", + "integrity": "sha512-4zBIxpPzowiZpusoFkyGVwakdRJUyuH5PxQ/PrqghfdFWWasvnCdPfQXHrenDai+gyLARulZjZowCOj6fjT4pA==", + "license": "MIT", + "dependencies": { + "@babel/helper-string-parser": "^7.29.7", + "@babel/helper-validator-identifier": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@braintree/sanitize-url": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/@braintree/sanitize-url/-/sanitize-url-7.1.2.tgz", + "integrity": "sha512-jigsZK+sMF/cuiB7sERuo9V7N9jx+dhmHHnQyDSVdpZwVutaBu7WvNYqMDLSgFgfB30n452TP3vjDAvFC973mA==", + "license": "MIT" + }, + "node_modules/@capsizecss/unpack": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@capsizecss/unpack/-/unpack-4.0.0.tgz", + "integrity": "sha512-VERIM64vtTP1C4mxQ5thVT9fK0apjPFobqybMtA1UdUujWka24ERHbRHFGmpbbhp73MhV+KSsHQH9C6uOTdEQA==", + "license": "MIT", + "dependencies": { + "fontkitten": "^1.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@chevrotain/types": { + "version": "11.1.2", + "resolved": "https://registry.npmjs.org/@chevrotain/types/-/types-11.1.2.tgz", + "integrity": "sha512-U+HFai5+zmJCkK86QsaJtoITlboZHBqrVketcO2ROv865xfCMSFpELQoz1GkX5GzME8pTa+3kbKrZHQtI0gdbw==", + "license": "Apache-2.0" + }, + "node_modules/@ctrl/tinycolor": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/@ctrl/tinycolor/-/tinycolor-4.2.0.tgz", + "integrity": "sha512-kzyuwOAQnXJNLS9PSyrk0CWk35nWJW/zl/6KvnTBMFK65gm7U1/Z5BqjxeapjZCIhQcM/DsrEmcbRwDyXyXK4A==", + "license": "MIT", + "engines": { + "node": ">=14" + } + }, + "node_modules/@emnapi/runtime": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.10.0.tgz", + "integrity": "sha512-ewvYlk86xUoGI0zQRNq/mC+16R1QeDlKQy21Ki3oSYXNgLb45GV1P6A0M+/s6nyCuNDqe5VpaY84BzXGwVbwFA==", + "license": "MIT", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.27.7.tgz", + "integrity": "sha512-EKX3Qwmhz1eMdEJokhALr0YiD0lhQNwDqkPYyPhiSwKrh7/4KRjQc04sZ8db+5DVVnZ1LmbNDI1uAMPEUBnQPg==", + "cpu": [ + "ppc64" + ], + "license": "MIT", + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.27.7.tgz", + "integrity": "sha512-jbPXvB4Yj2yBV7HUfE2KHe4GJX51QplCN1pGbYjvsyCZbQmies29EoJbkEc+vYuU5o45AfQn37vZlyXy4YJ8RQ==", + "cpu": [ + "arm" + ], + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.27.7.tgz", + "integrity": "sha512-62dPZHpIXzvChfvfLJow3q5dDtiNMkwiRzPylSCfriLvZeq0a1bWChrGx/BbUbPwOrsWKMn8idSllklzBy+dgQ==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.27.7.tgz", + "integrity": "sha512-x5VpMODneVDb70PYV2VQOmIUUiBtY3D3mPBG8NxVk5CogneYhkR7MmM3yR/uMdITLrC1ml/NV1rj4bMJuy9MCg==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.27.7.tgz", + "integrity": "sha512-5lckdqeuBPlKUwvoCXIgI2D9/ABmPq3Rdp7IfL70393YgaASt7tbju3Ac+ePVi3KDH6N2RqePfHnXkaDtY9fkw==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.27.7.tgz", + "integrity": "sha512-rYnXrKcXuT7Z+WL5K980jVFdvVKhCHhUwid+dDYQpH+qu+TefcomiMAJpIiC2EM3Rjtq0sO3StMV/+3w3MyyqQ==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.27.7.tgz", + "integrity": "sha512-B48PqeCsEgOtzME2GbNM2roU29AMTuOIN91dsMO30t+Ydis3z/3Ngoj5hhnsOSSwNzS+6JppqWsuhTp6E82l2w==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.27.7.tgz", + "integrity": "sha512-jOBDK5XEjA4m5IJK3bpAQF9/Lelu/Z9ZcdhTRLf4cajlB+8VEhFFRjWgfy3M1O4rO2GQ/b2dLwCUGpiF/eATNQ==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.27.7.tgz", + "integrity": "sha512-RkT/YXYBTSULo3+af8Ib0ykH8u2MBh57o7q/DAs3lTJlyVQkgQvlrPTnjIzzRPQyavxtPtfg0EopvDyIt0j1rA==", + "cpu": [ + "arm" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.27.7.tgz", + "integrity": "sha512-RZPHBoxXuNnPQO9rvjh5jdkRmVizktkT7TCDkDmQ0W2SwHInKCAV95GRuvdSvA7w4VMwfCjUiPwDi0ZO6Nfe9A==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.27.7.tgz", + "integrity": "sha512-GA48aKNkyQDbd3KtkplYWT102C5sn/EZTY4XROkxONgruHPU72l+gW+FfF8tf2cFjeHaRbWpOYa/uRBz/Xq1Pg==", + "cpu": [ + "ia32" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.27.7.tgz", + "integrity": "sha512-a4POruNM2oWsD4WKvBSEKGIiWQF8fZOAsycHOt6JBpZ+JN2n2JH9WAv56SOyu9X5IqAjqSIPTaJkqN8F7XOQ5Q==", + "cpu": [ + "loong64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.27.7.tgz", + "integrity": "sha512-KabT5I6StirGfIz0FMgl1I+R1H73Gp0ofL9A3nG3i/cYFJzKHhouBV5VWK1CSgKvVaG4q1RNpCTR2LuTVB3fIw==", + "cpu": [ + "mips64el" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.27.7.tgz", + "integrity": "sha512-gRsL4x6wsGHGRqhtI+ifpN/vpOFTQtnbsupUF5R5YTAg+y/lKelYR1hXbnBdzDjGbMYjVJLJTd2OFmMewAgwlQ==", + "cpu": [ + "ppc64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.27.7.tgz", + "integrity": "sha512-hL25LbxO1QOngGzu2U5xeXtxXcW+/GvMN3ejANqXkxZ/opySAZMrc+9LY/WyjAan41unrR3YrmtTsUpwT66InQ==", + "cpu": [ + "riscv64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.27.7.tgz", + "integrity": "sha512-2k8go8Ycu1Kb46vEelhu1vqEP+UeRVj2zY1pSuPdgvbd5ykAw82Lrro28vXUrRmzEsUV0NzCf54yARIK8r0fdw==", + "cpu": [ + "s390x" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.27.7.tgz", + "integrity": "sha512-hzznmADPt+OmsYzw1EE33ccA+HPdIqiCRq7cQeL1Jlq2gb1+OyWBkMCrYGBJ+sxVzve2ZJEVeePbLM2iEIZSxA==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-arm64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.27.7.tgz", + "integrity": "sha512-b6pqtrQdigZBwZxAn1UpazEisvwaIDvdbMbmrly7cDTMFnw/+3lVxxCTGOrkPVnsYIosJJXAsILG9XcQS+Yu6w==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.27.7.tgz", + "integrity": "sha512-OfatkLojr6U+WN5EDYuoQhtM+1xco+/6FSzJJnuWiUw5eVcicbyK3dq5EeV/QHT1uy6GoDhGbFpprUiHUYggrw==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-arm64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.27.7.tgz", + "integrity": "sha512-AFuojMQTxAz75Fo8idVcqoQWEHIXFRbOc1TrVcFSgCZtQfSdc1RXgB3tjOn/krRHENUB4j00bfGjyl2mJrU37A==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.27.7.tgz", + "integrity": "sha512-+A1NJmfM8WNDv5CLVQYJ5PshuRm/4cI6WMZRg1by1GwPIQPCTs1GLEUHwiiQGT5zDdyLiRM/l1G0Pv54gvtKIg==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openharmony-arm64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.27.7.tgz", + "integrity": "sha512-+KrvYb/C8zA9CU/g0sR6w2RBw7IGc5J2BPnc3dYc5VJxHCSF1yNMxTV5LQ7GuKteQXZtspjFbiuW5/dOj7H4Yw==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.27.7.tgz", + "integrity": "sha512-ikktIhFBzQNt/QDyOL580ti9+5mL/YZeUPKU2ivGtGjdTYoqz6jObj6nOMfhASpS4GU4Q/Clh1QtxWAvcYKamA==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.27.7.tgz", + "integrity": "sha512-7yRhbHvPqSpRUV7Q20VuDwbjW5kIMwTHpptuUzV+AA46kiPze5Z7qgt6CLCK3pWFrHeNfDd1VKgyP4O+ng17CA==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.27.7.tgz", + "integrity": "sha512-SmwKXe6VHIyZYbBLJrhOoCJRB/Z1tckzmgTLfFYOfpMAx63BJEaL9ExI8x7v0oAO3Zh6D/Oi1gVxEYr5oUCFhw==", + "cpu": [ + "ia32" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.27.7.tgz", + "integrity": "sha512-56hiAJPhwQ1R4i+21FVF7V8kSD5zZTdHcVuRFMW0hn753vVfQN8xlx4uOPT4xoGH0Z/oVATuR82AiqSTDIpaHg==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@expressive-code/core": { + "version": "0.42.0", + "resolved": "https://registry.npmjs.org/@expressive-code/core/-/core-0.42.0.tgz", + "integrity": "sha512-MN11+9nfmaC7sYu2BZJXAXqwkBRt8t1xTSqP+Ti1NfTEskgl6xUnzDxoaiQkg0BMzpglA0pys4dpDKquP/cyIw==", + "license": "MIT", + "dependencies": { + "@ctrl/tinycolor": "^4.0.4", + "hast-util-select": "^6.0.2", + "hast-util-to-html": "^9.0.1", + "hast-util-to-text": "^4.0.1", + "hastscript": "^9.0.0", + "postcss": "^8.4.38", + "postcss-nested": "^6.0.1", + "unist-util-visit": "^5.0.0", + "unist-util-visit-parents": "^6.0.1" + } + }, + "node_modules/@expressive-code/plugin-collapsible-sections": { + "version": "0.42.0", + "resolved": "https://registry.npmjs.org/@expressive-code/plugin-collapsible-sections/-/plugin-collapsible-sections-0.42.0.tgz", + "integrity": "sha512-HAksURXFxFmN/tuqIHvt8N47WVFTG7kYWZswJ1LMuts6496l9c7nBBRZCaTpce1dOLRrfGjKytWixqkgGWno8Q==", + "license": "MIT", + "dependencies": { + "@expressive-code/core": "^0.42.0" + } + }, + "node_modules/@expressive-code/plugin-frames": { + "version": "0.41.7", + "resolved": "https://registry.npmjs.org/@expressive-code/plugin-frames/-/plugin-frames-0.41.7.tgz", + "integrity": "sha512-diKtxjQw/979cTglRFaMCY/sR6hWF0kSMg8jsKLXaZBSfGS0I/Hoe7Qds3vVEgeoW+GHHQzMcwvgx/MOIXhrTA==", + "license": "MIT", + "dependencies": { + "@expressive-code/core": "^0.41.7" + } + }, + "node_modules/@expressive-code/plugin-frames/node_modules/@expressive-code/core": { + "version": "0.41.7", + "resolved": "https://registry.npmjs.org/@expressive-code/core/-/core-0.41.7.tgz", + "integrity": "sha512-ck92uZYZ9Wba2zxkiZLsZGi9N54pMSAVdrI9uW3Oo9AtLglD5RmrdTwbYPCT2S/jC36JGB2i+pnQtBm/Ib2+dg==", + "license": "MIT", + "dependencies": { + "@ctrl/tinycolor": "^4.0.4", + "hast-util-select": "^6.0.2", + "hast-util-to-html": "^9.0.1", + "hast-util-to-text": "^4.0.1", + "hastscript": "^9.0.0", + "postcss": "^8.4.38", + "postcss-nested": "^6.0.1", + "unist-util-visit": "^5.0.0", + "unist-util-visit-parents": "^6.0.1" + } + }, + "node_modules/@expressive-code/plugin-line-numbers": { + "version": "0.42.0", + "resolved": "https://registry.npmjs.org/@expressive-code/plugin-line-numbers/-/plugin-line-numbers-0.42.0.tgz", + "integrity": "sha512-xY0s/b8UTF8fGrHWbJ8uX95yCDU1NpepXOTtcLBJobQV08RA7G+hzxL0BtDRso7RK4bCrJHio+BgYzI/M21BBA==", + "license": "MIT", + "dependencies": { + "@expressive-code/core": "^0.42.0" + } + }, + "node_modules/@expressive-code/plugin-shiki": { + "version": "0.41.7", + "resolved": "https://registry.npmjs.org/@expressive-code/plugin-shiki/-/plugin-shiki-0.41.7.tgz", + "integrity": "sha512-DL605bLrUOgqTdZ0Ot5MlTaWzppRkzzqzeGEu7ODnHF39IkEBbFdsC7pbl3LbUQ1DFtnfx6rD54k/cdofbW6KQ==", + "license": "MIT", + "dependencies": { + "@expressive-code/core": "^0.41.7", + "shiki": "^3.2.2" + } + }, + "node_modules/@expressive-code/plugin-shiki/node_modules/@expressive-code/core": { + "version": "0.41.7", + "resolved": "https://registry.npmjs.org/@expressive-code/core/-/core-0.41.7.tgz", + "integrity": "sha512-ck92uZYZ9Wba2zxkiZLsZGi9N54pMSAVdrI9uW3Oo9AtLglD5RmrdTwbYPCT2S/jC36JGB2i+pnQtBm/Ib2+dg==", + "license": "MIT", + "dependencies": { + "@ctrl/tinycolor": "^4.0.4", + "hast-util-select": "^6.0.2", + "hast-util-to-html": "^9.0.1", + "hast-util-to-text": "^4.0.1", + "hastscript": "^9.0.0", + "postcss": "^8.4.38", + "postcss-nested": "^6.0.1", + "unist-util-visit": "^5.0.0", + "unist-util-visit-parents": "^6.0.1" + } + }, + "node_modules/@expressive-code/plugin-text-markers": { + "version": "0.41.7", + "resolved": "https://registry.npmjs.org/@expressive-code/plugin-text-markers/-/plugin-text-markers-0.41.7.tgz", + "integrity": "sha512-Ewpwuc5t6eFdZmWlFyeuy3e1PTQC0jFvw2Q+2bpcWXbOZhPLsT7+h8lsSIJxb5mS7wZko7cKyQ2RLYDyK6Fpmw==", + "license": "MIT", + "dependencies": { + "@expressive-code/core": "^0.41.7" + } + }, + "node_modules/@expressive-code/plugin-text-markers/node_modules/@expressive-code/core": { + "version": "0.41.7", + "resolved": "https://registry.npmjs.org/@expressive-code/core/-/core-0.41.7.tgz", + "integrity": "sha512-ck92uZYZ9Wba2zxkiZLsZGi9N54pMSAVdrI9uW3Oo9AtLglD5RmrdTwbYPCT2S/jC36JGB2i+pnQtBm/Ib2+dg==", + "license": "MIT", + "dependencies": { + "@ctrl/tinycolor": "^4.0.4", + "hast-util-select": "^6.0.2", + "hast-util-to-html": "^9.0.1", + "hast-util-to-text": "^4.0.1", + "hastscript": "^9.0.0", + "postcss": "^8.4.38", + "postcss-nested": "^6.0.1", + "unist-util-visit": "^5.0.0", + "unist-util-visit-parents": "^6.0.1" + } + }, + "node_modules/@iconify/types": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@iconify/types/-/types-2.0.0.tgz", + "integrity": "sha512-+wluvCrRhXrhyOmRDJ3q8mux9JkKy5SJ/v8ol2tu4FVjyYvtEzkc/3pK15ET6RKg4b4w4BmTk1+gsCUhf21Ykg==", + "license": "MIT" + }, + "node_modules/@iconify/utils": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/@iconify/utils/-/utils-3.1.3.tgz", + "integrity": "sha512-LPKOXPn/zV+zis1oOfGWogaXVpqUybF3ZS6SCZIsz8vg0ivVp9+fVqyYB7xq0aiST/VhUQYGO1qo6uoYSiEJqw==", + "license": "MIT", + "dependencies": { + "@antfu/install-pkg": "^1.1.0", + "@iconify/types": "^2.0.0", + "import-meta-resolve": "^4.2.0" + } + }, + "node_modules/@img/colour": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@img/colour/-/colour-1.1.0.tgz", + "integrity": "sha512-Td76q7j57o/tLVdgS746cYARfSyxk8iEfRxewL9h4OMzYhbW4TAcppl0mT4eyqXddh6L/jwoM75mo7ixa/pCeQ==", + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/@img/sharp-darwin-arm64": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-darwin-arm64/-/sharp-darwin-arm64-0.34.5.tgz", + "integrity": "sha512-imtQ3WMJXbMY4fxb/Ndp6HBTNVtWCUI0WdobyheGf5+ad6xX8VIDO8u2xE4qc/fr08CKG/7dDseFtn6M6g/r3w==", + "cpu": [ + "arm64" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-darwin-arm64": "1.2.4" + } + }, + "node_modules/@img/sharp-darwin-x64": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-darwin-x64/-/sharp-darwin-x64-0.34.5.tgz", + "integrity": "sha512-YNEFAF/4KQ/PeW0N+r+aVVsoIY0/qxxikF2SWdp+NRkmMB7y9LBZAVqQ4yhGCm/H3H270OSykqmQMKLBhBJDEw==", + "cpu": [ + "x64" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-darwin-x64": "1.2.4" + } + }, + "node_modules/@img/sharp-libvips-darwin-arm64": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-arm64/-/sharp-libvips-darwin-arm64-1.2.4.tgz", + "integrity": "sha512-zqjjo7RatFfFoP0MkQ51jfuFZBnVE2pRiaydKJ1G/rHZvnsrHAOcQALIi9sA5co5xenQdTugCvtb1cuf78Vf4g==", + "cpu": [ + "arm64" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "darwin" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-darwin-x64": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-x64/-/sharp-libvips-darwin-x64-1.2.4.tgz", + "integrity": "sha512-1IOd5xfVhlGwX+zXv2N93k0yMONvUlANylbJw1eTah8K/Jtpi15KC+WSiaX/nBmbm2HxRM1gZ0nSdjSsrZbGKg==", + "cpu": [ + "x64" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "darwin" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-arm": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm/-/sharp-libvips-linux-arm-1.2.4.tgz", + "integrity": "sha512-bFI7xcKFELdiNCVov8e44Ia4u2byA+l3XtsAj+Q8tfCwO6BQ8iDojYdvoPMqsKDkuoOo+X6HZA0s0q11ANMQ8A==", + "cpu": [ + "arm" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-arm64": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm64/-/sharp-libvips-linux-arm64-1.2.4.tgz", + "integrity": "sha512-excjX8DfsIcJ10x1Kzr4RcWe1edC9PquDRRPx3YVCvQv+U5p7Yin2s32ftzikXojb1PIFc/9Mt28/y+iRklkrw==", + "cpu": [ + "arm64" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-ppc64": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-ppc64/-/sharp-libvips-linux-ppc64-1.2.4.tgz", + "integrity": "sha512-FMuvGijLDYG6lW+b/UvyilUWu5Ayu+3r2d1S8notiGCIyYU/76eig1UfMmkZ7vwgOrzKzlQbFSuQfgm7GYUPpA==", + "cpu": [ + "ppc64" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-riscv64": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-riscv64/-/sharp-libvips-linux-riscv64-1.2.4.tgz", + "integrity": "sha512-oVDbcR4zUC0ce82teubSm+x6ETixtKZBh/qbREIOcI3cULzDyb18Sr/Wcyx7NRQeQzOiHTNbZFF1UwPS2scyGA==", + "cpu": [ + "riscv64" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-s390x": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-s390x/-/sharp-libvips-linux-s390x-1.2.4.tgz", + "integrity": "sha512-qmp9VrzgPgMoGZyPvrQHqk02uyjA0/QrTO26Tqk6l4ZV0MPWIW6LTkqOIov+J1yEu7MbFQaDpwdwJKhbJvuRxQ==", + "cpu": [ + "s390x" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-x64": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-x64/-/sharp-libvips-linux-x64-1.2.4.tgz", + "integrity": "sha512-tJxiiLsmHc9Ax1bz3oaOYBURTXGIRDODBqhveVHonrHJ9/+k89qbLl0bcJns+e4t4rvaNBxaEZsFtSfAdquPrw==", + "cpu": [ + "x64" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linuxmusl-arm64": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-arm64/-/sharp-libvips-linuxmusl-arm64-1.2.4.tgz", + "integrity": "sha512-FVQHuwx1IIuNow9QAbYUzJ+En8KcVm9Lk5+uGUQJHaZmMECZmOlix9HnH7n1TRkXMS0pGxIJokIVB9SuqZGGXw==", + "cpu": [ + "arm64" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linuxmusl-x64": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-x64/-/sharp-libvips-linuxmusl-x64-1.2.4.tgz", + "integrity": "sha512-+LpyBk7L44ZIXwz/VYfglaX/okxezESc6UxDSoyo2Ks6Jxc4Y7sGjpgU9s4PMgqgjj1gZCylTieNamqA1MF7Dg==", + "cpu": [ + "x64" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-linux-arm": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm/-/sharp-linux-arm-0.34.5.tgz", + "integrity": "sha512-9dLqsvwtg1uuXBGZKsxem9595+ujv0sJ6Vi8wcTANSFpwV/GONat5eCkzQo/1O6zRIkh0m/8+5BjrRr7jDUSZw==", + "cpu": [ + "arm" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-arm": "1.2.4" + } + }, + "node_modules/@img/sharp-linux-arm64": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm64/-/sharp-linux-arm64-0.34.5.tgz", + "integrity": "sha512-bKQzaJRY/bkPOXyKx5EVup7qkaojECG6NLYswgktOZjaXecSAeCWiZwwiFf3/Y+O1HrauiE3FVsGxFg8c24rZg==", + "cpu": [ + "arm64" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-arm64": "1.2.4" + } + }, + "node_modules/@img/sharp-linux-ppc64": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-ppc64/-/sharp-linux-ppc64-0.34.5.tgz", + "integrity": "sha512-7zznwNaqW6YtsfrGGDA6BRkISKAAE1Jo0QdpNYXNMHu2+0dTrPflTLNkpc8l7MUP5M16ZJcUvysVWWrMefZquA==", + "cpu": [ + "ppc64" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-ppc64": "1.2.4" + } + }, + "node_modules/@img/sharp-linux-riscv64": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-riscv64/-/sharp-linux-riscv64-0.34.5.tgz", + "integrity": "sha512-51gJuLPTKa7piYPaVs8GmByo7/U7/7TZOq+cnXJIHZKavIRHAP77e3N2HEl3dgiqdD/w0yUfiJnII77PuDDFdw==", + "cpu": [ + "riscv64" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-riscv64": "1.2.4" + } + }, + "node_modules/@img/sharp-linux-s390x": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-s390x/-/sharp-linux-s390x-0.34.5.tgz", + "integrity": "sha512-nQtCk0PdKfho3eC5MrbQoigJ2gd1CgddUMkabUj+rBevs8tZ2cULOx46E7oyX+04WGfABgIwmMC0VqieTiR4jg==", + "cpu": [ + "s390x" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-s390x": "1.2.4" + } + }, + "node_modules/@img/sharp-linux-x64": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-x64/-/sharp-linux-x64-0.34.5.tgz", + "integrity": "sha512-MEzd8HPKxVxVenwAa+JRPwEC7QFjoPWuS5NZnBt6B3pu7EG2Ge0id1oLHZpPJdn3OQK+BQDiw9zStiHBTJQQQQ==", + "cpu": [ + "x64" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-x64": "1.2.4" + } + }, + "node_modules/@img/sharp-linuxmusl-arm64": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-arm64/-/sharp-linuxmusl-arm64-0.34.5.tgz", + "integrity": "sha512-fprJR6GtRsMt6Kyfq44IsChVZeGN97gTD331weR1ex1c1rypDEABN6Tm2xa1wE6lYb5DdEnk03NZPqA7Id21yg==", + "cpu": [ + "arm64" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linuxmusl-arm64": "1.2.4" + } + }, + "node_modules/@img/sharp-linuxmusl-x64": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-x64/-/sharp-linuxmusl-x64-0.34.5.tgz", + "integrity": "sha512-Jg8wNT1MUzIvhBFxViqrEhWDGzqymo3sV7z7ZsaWbZNDLXRJZoRGrjulp60YYtV4wfY8VIKcWidjojlLcWrd8Q==", + "cpu": [ + "x64" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linuxmusl-x64": "1.2.4" + } + }, + "node_modules/@img/sharp-wasm32": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-wasm32/-/sharp-wasm32-0.34.5.tgz", + "integrity": "sha512-OdWTEiVkY2PHwqkbBI8frFxQQFekHaSSkUIJkwzclWZe64O1X4UlUjqqqLaPbUpMOQk6FBu/HtlGXNblIs0huw==", + "cpu": [ + "wasm32" + ], + "license": "Apache-2.0 AND LGPL-3.0-or-later AND MIT", + "optional": true, + "dependencies": { + "@emnapi/runtime": "^1.7.0" + }, + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-win32-arm64": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-arm64/-/sharp-win32-arm64-0.34.5.tgz", + "integrity": "sha512-WQ3AgWCWYSb2yt+IG8mnC6Jdk9Whs7O0gxphblsLvdhSpSTtmu69ZG1Gkb6NuvxsNACwiPV6cNSZNzt0KPsw7g==", + "cpu": [ + "arm64" + ], + "license": "Apache-2.0 AND LGPL-3.0-or-later", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-win32-ia32": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-ia32/-/sharp-win32-ia32-0.34.5.tgz", + "integrity": "sha512-FV9m/7NmeCmSHDD5j4+4pNI8Cp3aW+JvLoXcTUo0IqyjSfAZJ8dIUmijx1qaJsIiU+Hosw6xM5KijAWRJCSgNg==", + "cpu": [ + "ia32" + ], + "license": "Apache-2.0 AND LGPL-3.0-or-later", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-win32-x64": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-x64/-/sharp-win32-x64-0.34.5.tgz", + "integrity": "sha512-+29YMsqY2/9eFEiW93eqWnuLcWcufowXewwSNIT6UwZdUUCrM3oFjMWH/Z6/TMmb4hlFenmfAVbpWeup2jryCw==", + "cpu": [ + "x64" + ], + "license": "Apache-2.0 AND LGPL-3.0-or-later", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.5.5", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz", + "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==", + "license": "MIT" + }, + "node_modules/@mdx-js/mdx": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/@mdx-js/mdx/-/mdx-3.1.1.tgz", + "integrity": "sha512-f6ZO2ifpwAQIpzGWaBQT2TXxPv6z3RBzQKpVftEWN78Vl/YweF1uwussDx8ECAXVtr3Rs89fKyG9YlzUs9DyGQ==", + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.0", + "@types/estree-jsx": "^1.0.0", + "@types/hast": "^3.0.0", + "@types/mdx": "^2.0.0", + "acorn": "^8.0.0", + "collapse-white-space": "^2.0.0", + "devlop": "^1.0.0", + "estree-util-is-identifier-name": "^3.0.0", + "estree-util-scope": "^1.0.0", + "estree-walker": "^3.0.0", + "hast-util-to-jsx-runtime": "^2.0.0", + "markdown-extensions": "^2.0.0", + "recma-build-jsx": "^1.0.0", + "recma-jsx": "^1.0.0", + "recma-stringify": "^1.0.0", + "rehype-recma": "^1.0.0", + "remark-mdx": "^3.0.0", + "remark-parse": "^11.0.0", + "remark-rehype": "^11.0.0", + "source-map": "^0.7.0", + "unified": "^11.0.0", + "unist-util-position-from-estree": "^2.0.0", + "unist-util-stringify-position": "^4.0.0", + "unist-util-visit": "^5.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/@mermaid-js/parser": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@mermaid-js/parser/-/parser-1.1.1.tgz", + "integrity": "sha512-VuHdsYMK1bT6X2JbcAaWAhugTRvRBRyuZgd+c22swUeI9g/ntaxF7CY7dYarhZovofCbUNO0G7JesfmNtjYOCw==", + "license": "MIT", + "dependencies": { + "@chevrotain/types": "~11.1.1" + } + }, + "node_modules/@oslojs/encoding": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@oslojs/encoding/-/encoding-1.1.0.tgz", + "integrity": "sha512-70wQhgYmndg4GCPxPPxPGevRKqTIJ2Nh4OkiMWmDAVYsTQ+Ta7Sq+rPevXyXGdzr30/qZBnyOalCszoMxlyldQ==", + "license": "MIT" + }, + "node_modules/@pagefind/darwin-arm64": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/@pagefind/darwin-arm64/-/darwin-arm64-1.5.2.tgz", + "integrity": "sha512-MXpI+7HsAdPkvJ0gk9xj9g541BCqBZOBbdwj9g6lB5LCj6kSV6nqDSjzcAJwvOsfu0fjwvC8hQU+ecfhp+MpiQ==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@pagefind/darwin-x64": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/@pagefind/darwin-x64/-/darwin-x64-1.5.2.tgz", + "integrity": "sha512-IojxFWMEJe0RQ7PQ3KXQsPIImNsbpPYpoZ+QUDrL8fAl/O27IX+LVLs74/UzEZy5uA2LD8Nz1AiwKr72vrkZQw==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@pagefind/default-ui": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/@pagefind/default-ui/-/default-ui-1.5.2.tgz", + "integrity": "sha512-pm1LMnQg8N2B3n2TnjKlhaFihpz6zTiA4HiGQ6/slKO/+8K9CAU5kcjdSSPgpuk1PMuuN4hxLipUIifnrkl3Sg==", + "license": "MIT" + }, + "node_modules/@pagefind/freebsd-x64": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/@pagefind/freebsd-x64/-/freebsd-x64-1.5.2.tgz", + "integrity": "sha512-7EVzo9+0w+2cbe671BtMj10UlNo83I+HrLVLfRxO731svHRJKUfJ/mo05gU14pe9PCfpKNQT8FS3Xc/oDN6pOA==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@pagefind/linux-arm64": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/@pagefind/linux-arm64/-/linux-arm64-1.5.2.tgz", + "integrity": "sha512-Ovt9+K35sqzn8H3ZMXGwls4TD/wMJuvRtShHIsmUQREmaxjrDEX7gHckRCrwYJ4XE1H1p6HkLz3wukrAnsfXQw==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@pagefind/linux-x64": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/@pagefind/linux-x64/-/linux-x64-1.5.2.tgz", + "integrity": "sha512-V+tFqHKXhQKq/WqPBD67AFy7scn1/aZID00ws4fSDd+1daSi5UHR9VVlRrOUYKxn3VuFQYRD7lYXdZK1WED1YA==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@pagefind/windows-arm64": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/@pagefind/windows-arm64/-/windows-arm64-1.5.2.tgz", + "integrity": "sha512-hN9Nh90fNW61nNRCW9ZyQrAj/mD0eRvmJ8NlTUzkbuW8kIzGJUi3cxjFkEcMZ5h/8FsKWD/VcouZl4yo1F7B6g==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@pagefind/windows-x64": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/@pagefind/windows-x64/-/windows-x64-1.5.2.tgz", + "integrity": "sha512-Fa2Iyw7kaDRzGMfNYNUXNW2zbL5FQVDgSOcbDHdzBrDEdpqOqg8TcZ68F22ol6NJ9IGzvUdmeyZypLW5dyhqsg==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/pluginutils": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.4.0.tgz", + "integrity": "sha512-MfPp06CjRLfXQ3wY0R8vJDYBy/MvVcc9OulEfR0B8Iv9ko+GCNaRZ+EpJYFl27LhKsZK0o420sYCRHCjfCgeUg==", + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.0", + "estree-walker": "^2.0.2", + "picomatch": "^4.0.2" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "rollup": "^1.20.0||^2.0.0||^3.0.0||^4.0.0" + }, + "peerDependenciesMeta": { + "rollup": { + "optional": true + } + } + }, + "node_modules/@rollup/pluginutils/node_modules/estree-walker": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", + "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", + "license": "MIT" + }, + "node_modules/@rollup/rollup-android-arm-eabi": { + "version": "4.61.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.61.1.tgz", + "integrity": "sha512-JnBB8MdXj45cajvTuO5FmPlvFVJRQgvrz1uSEl3NwqFnReAPGwb8EanbGi4z2nRaqLzjJSv5/JmycoTKlRZxHA==", + "cpu": [ + "arm" + ], + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-android-arm64": { + "version": "4.61.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.61.1.tgz", + "integrity": "sha512-Jx2g7iSjw4AOT0HDPHM9RV3GNjRXwybWtSFZiZAYUTjUwjVrYIwq3kBf+LnhqJlzXFAqTAh2F7IGI+O568exPw==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-darwin-arm64": { + "version": "4.61.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.61.1.tgz", + "integrity": "sha512-0F1L/Z3Eqv8mT2n3dCpeO8GcTvHvVqkP5/t6DMsn0KzhYVcg+s7Ncl5DS8qjKYEeio6Az0Gt6nyBORay5qIlCA==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-darwin-x64": { + "version": "4.61.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.61.1.tgz", + "integrity": "sha512-qLttcH871ujY4YcVfUSShhOw+CsoTatYz8gRbHO7Bb92QH059/P0y5do1KMs41fY0BpD2x4AJH/gID0zFiqVKQ==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-freebsd-arm64": { + "version": "4.61.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.61.1.tgz", + "integrity": "sha512-fUI4RapGE0Oh3mb8mgfvC1O2nU1RpDZUKnDQm3xB1Ipg7C2wTs5Kstz7G2uWK99a8S2yTMq8/P4uycwNa0nJyw==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@rollup/rollup-freebsd-x64": { + "version": "4.61.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.61.1.tgz", + "integrity": "sha512-H5YrdvJaDtI/U9/emrD4b++xkvp3y/JvOe4rizHbxvkyMfRS/CiRYdji+Pl8D0brEaNFWUh1drQxgAGIl6Xudw==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@rollup/rollup-linux-arm-gnueabihf": { + "version": "4.61.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.61.1.tgz", + "integrity": "sha512-Q8CBCCQtDFrYtXoeUXSrnFXKOnyUhx6bz+SkL6A0E7V8kAiCJ5pamq1WtbfpVGhR5TSpXY6ak3avmDc5fHTyJA==", + "cpu": [ + "arm" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm-musleabihf": { + "version": "4.61.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.61.1.tgz", + "integrity": "sha512-nwnhk1581l0FBVellGcVCAT0Oi06onEA3WB53sf01VO3I0UPBkMH9sXONYME2K0ovXcNayJfNtHfm6mpJElatQ==", + "cpu": [ + "arm" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-gnu": { + "version": "4.61.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.61.1.tgz", + "integrity": "sha512-x5Xr49hwt3hdW75UOZm3395YwwzPyauktslv29KpWL/T+vVAzoT3azLcTWv0eMciBNrx+DYjH4paehHoLpPvpg==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-musl": { + "version": "4.61.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.61.1.tgz", + "integrity": "sha512-unMS3H73DpaoPyyEVPjGKleM/s0mkmsauTENpw4INQY8y4+IuLNjkueQ5QCtC0D3N38Y38yhAU8OoZ20S2Tm6w==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-loong64-gnu": { + "version": "4.61.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.61.1.tgz", + "integrity": "sha512-zNZzGRnAhwjFEYmvphJRV5XaQGjs62cCmeYYHUT//NbvEnHauw+I85nGG+SiVg5ld4GX8D1IbKIX+ozITQnhMQ==", + "cpu": [ + "loong64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-loong64-musl": { + "version": "4.61.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-musl/-/rollup-linux-loong64-musl-4.61.1.tgz", + "integrity": "sha512-LdpWGL8X209B2SIvWjqlc8VZgM6PKfontSerGepuldQmHYrAOtnMCXeJkxXGbC+PPZVOuu5czJo7fNV6aeW8rQ==", + "cpu": [ + "loong64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-ppc64-gnu": { + "version": "4.61.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.61.1.tgz", + "integrity": "sha512-EC5kTtNaNGOmbMGqar8dvJy6y/hg99GAwjfBz++pxZhQATXGcRjd6c5en5wcbru0vkRmiMGsQKdMJOOf6sza4g==", + "cpu": [ + "ppc64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-ppc64-musl": { + "version": "4.61.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-musl/-/rollup-linux-ppc64-musl-4.61.1.tgz", + "integrity": "sha512-8hiwp6D4acEcNK78I4rP0/XtS1sknWIAMJBPdR4l6zUtyTm5KiTDr5bXmWt4foY7nAN7AThDHgkLIEZOWKbzWw==", + "cpu": [ + "ppc64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-gnu": { + "version": "4.61.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.61.1.tgz", + "integrity": "sha512-10dh/h/BqA7DuMPWSxkR8uks18FRwnwOEqr5zOTEl+NOwP/OMzKX8OFR/Of9xxDA7D5qef1Nzar5WDD2kCCr1g==", + "cpu": [ + "riscv64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-musl": { + "version": "4.61.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.61.1.tgz", + "integrity": "sha512-YKJ5lg35DP17gcAOggnihe+APw9HLyj1Xn7gsmGumBJAUDa6NGXNixJzmkWLhcK9TOuuyQjdamzvJefkO7qHZQ==", + "cpu": [ + "riscv64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-s390x-gnu": { + "version": "4.61.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.61.1.tgz", + "integrity": "sha512-Mlil5G2Jj6a7B3LWGctg+XPL9vdXYuzCtNXfxOQ0nPjc2m6ueUktocPGH9bnAM0bNRKb/bAWTujUU7IJQdQA+g==", + "cpu": [ + "s390x" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-gnu": { + "version": "4.61.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.61.1.tgz", + "integrity": "sha512-bVWIOIk6pV01p4CdUbPP7CJ/434z+OooYjDuFcR+44N35YvKUC66G8MGnvcWx5mWKW3g61J+t74l3Kj15Kwn2Q==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-musl": { + "version": "4.61.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.61.1.tgz", + "integrity": "sha512-qy5pBvZbqNFheBz61R1rzsezjm0J7O2oNGoWtGoY89SZYLUfxAJTBAqDChqAIdB4rCiIbi9nF7yZ83GnNiLwSw==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-openbsd-x64": { + "version": "4.61.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-openbsd-x64/-/rollup-openbsd-x64-4.61.1.tgz", + "integrity": "sha512-E83TXjI4zm0+5f2qO+UOudaCYIhYwpJ5jq6YCZNIZ+6CbfhKrkAGezeiASBL9ElxAxFsRS9ZhESv8mfnj6TKeg==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ] + }, + "node_modules/@rollup/rollup-openharmony-arm64": { + "version": "4.61.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.61.1.tgz", + "integrity": "sha512-fbWnKqVkjrJN38vNe3ahkbk6iejS/3b0Nt7EEtPpE6RBacZcGXNKbzfHN3GUUlXOPghUg0j6XUGrtjX9z1sIvA==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ] + }, + "node_modules/@rollup/rollup-win32-arm64-msvc": { + "version": "4.61.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.61.1.tgz", + "integrity": "sha512-ArMl38iVAbk0New1ogihQNY6iphLi4ZaRsa037gUzv5yeKPY8TD3Dmy4x2RNC1VztU/uqm+G+/RwFrSka3Oy2g==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-ia32-msvc": { + "version": "4.61.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.61.1.tgz", + "integrity": "sha512-0mYtjHS9ucAbcATycCNK9IGBk/cCe/ma7EmSLGZdsxnOA8cjRIyU04wDpVAD9NiOfLUR9KTxdiO53uOkherqjQ==", + "cpu": [ + "ia32" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-x64-gnu": { + "version": "4.61.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-gnu/-/rollup-win32-x64-gnu-4.61.1.tgz", + "integrity": "sha512-gK1iCEPfpoSG9wfBihXxvBMi8ZfcWffYkEsC/Eih+iFENTaewvNcrEQ69lIOWYO5pePHKLHHO7nq5AILGO/HQQ==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-x64-msvc": { + "version": "4.61.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.61.1.tgz", + "integrity": "sha512-X+zaP2x+j4RXGfbp/seSoRHWnPxzApilDszisZxbYH5C/jTxFhCtDNdPGZb9lJyYPs24wGxruPF7Y+sIXt9Gzw==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@shikijs/core": { + "version": "3.23.0", + "resolved": "https://registry.npmjs.org/@shikijs/core/-/core-3.23.0.tgz", + "integrity": "sha512-NSWQz0riNb67xthdm5br6lAkvpDJRTgB36fxlo37ZzM2yq0PQFFzbd8psqC2XMPgCzo1fW6cVi18+ArJ44wqgA==", + "license": "MIT", + "dependencies": { + "@shikijs/types": "3.23.0", + "@shikijs/vscode-textmate": "^10.0.2", + "@types/hast": "^3.0.4", + "hast-util-to-html": "^9.0.5" + } + }, + "node_modules/@shikijs/engine-javascript": { + "version": "3.23.0", + "resolved": "https://registry.npmjs.org/@shikijs/engine-javascript/-/engine-javascript-3.23.0.tgz", + "integrity": "sha512-aHt9eiGFobmWR5uqJUViySI1bHMqrAgamWE1TYSUoftkAeCCAiGawPMwM+VCadylQtF4V3VNOZ5LmfItH5f3yA==", + "license": "MIT", + "dependencies": { + "@shikijs/types": "3.23.0", + "@shikijs/vscode-textmate": "^10.0.2", + "oniguruma-to-es": "^4.3.4" + } + }, + "node_modules/@shikijs/engine-oniguruma": { + "version": "3.23.0", + "resolved": "https://registry.npmjs.org/@shikijs/engine-oniguruma/-/engine-oniguruma-3.23.0.tgz", + "integrity": "sha512-1nWINwKXxKKLqPibT5f4pAFLej9oZzQTsby8942OTlsJzOBZ0MWKiwzMsd+jhzu8YPCHAswGnnN1YtQfirL35g==", + "license": "MIT", + "dependencies": { + "@shikijs/types": "3.23.0", + "@shikijs/vscode-textmate": "^10.0.2" + } + }, + "node_modules/@shikijs/langs": { + "version": "3.23.0", + "resolved": "https://registry.npmjs.org/@shikijs/langs/-/langs-3.23.0.tgz", + "integrity": "sha512-2Ep4W3Re5aB1/62RSYQInK9mM3HsLeB91cHqznAJMuylqjzNVAVCMnNWRHFtcNHXsoNRayP9z1qj4Sq3nMqYXg==", + "license": "MIT", + "dependencies": { + "@shikijs/types": "3.23.0" + } + }, + "node_modules/@shikijs/themes": { + "version": "3.23.0", + "resolved": "https://registry.npmjs.org/@shikijs/themes/-/themes-3.23.0.tgz", + "integrity": "sha512-5qySYa1ZgAT18HR/ypENL9cUSGOeI2x+4IvYJu4JgVJdizn6kG4ia5Q1jDEOi7gTbN4RbuYtmHh0W3eccOrjMA==", + "license": "MIT", + "dependencies": { + "@shikijs/types": "3.23.0" + } + }, + "node_modules/@shikijs/types": { + "version": "3.23.0", + "resolved": "https://registry.npmjs.org/@shikijs/types/-/types-3.23.0.tgz", + "integrity": "sha512-3JZ5HXOZfYjsYSk0yPwBrkupyYSLpAE26Qc0HLghhZNGTZg/SKxXIIgoxOpmmeQP0RRSDJTk1/vPfw9tbw+jSQ==", + "license": "MIT", + "dependencies": { + "@shikijs/vscode-textmate": "^10.0.2", + "@types/hast": "^3.0.4" + } + }, + "node_modules/@shikijs/vscode-textmate": { + "version": "10.0.2", + "resolved": "https://registry.npmjs.org/@shikijs/vscode-textmate/-/vscode-textmate-10.0.2.tgz", + "integrity": "sha512-83yeghZ2xxin3Nj8z1NMd/NCuca+gsYXswywDy5bHvwlWL8tpTQmzGeUuHd9FC3E/SBEMvzJRwWEOz5gGes9Qg==", + "license": "MIT" + }, + "node_modules/@types/d3": { + "version": "7.4.3", + "resolved": "https://registry.npmjs.org/@types/d3/-/d3-7.4.3.tgz", + "integrity": "sha512-lZXZ9ckh5R8uiFVt8ogUNf+pIrK4EsWrx2Np75WvF/eTpJ0FMHNhjXk8CKEx/+gpHbNQyJWehbFaTvqmHWB3ww==", + "license": "MIT", + "dependencies": { + "@types/d3-array": "*", + "@types/d3-axis": "*", + "@types/d3-brush": "*", + "@types/d3-chord": "*", + "@types/d3-color": "*", + "@types/d3-contour": "*", + "@types/d3-delaunay": "*", + "@types/d3-dispatch": "*", + "@types/d3-drag": "*", + "@types/d3-dsv": "*", + "@types/d3-ease": "*", + "@types/d3-fetch": "*", + "@types/d3-force": "*", + "@types/d3-format": "*", + "@types/d3-geo": "*", + "@types/d3-hierarchy": "*", + "@types/d3-interpolate": "*", + "@types/d3-path": "*", + "@types/d3-polygon": "*", + "@types/d3-quadtree": "*", + "@types/d3-random": "*", + "@types/d3-scale": "*", + "@types/d3-scale-chromatic": "*", + "@types/d3-selection": "*", + "@types/d3-shape": "*", + "@types/d3-time": "*", + "@types/d3-time-format": "*", + "@types/d3-timer": "*", + "@types/d3-transition": "*", + "@types/d3-zoom": "*" + } + }, + "node_modules/@types/d3-array": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/@types/d3-array/-/d3-array-3.2.2.tgz", + "integrity": "sha512-hOLWVbm7uRza0BYXpIIW5pxfrKe0W+D5lrFiAEYR+pb6w3N2SwSMaJbXdUfSEv+dT4MfHBLtn5js0LAWaO6otw==", + "license": "MIT" + }, + "node_modules/@types/d3-axis": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/@types/d3-axis/-/d3-axis-3.0.6.tgz", + "integrity": "sha512-pYeijfZuBd87T0hGn0FO1vQ/cgLk6E1ALJjfkC0oJ8cbwkZl3TpgS8bVBLZN+2jjGgg38epgxb2zmoGtSfvgMw==", + "license": "MIT", + "dependencies": { + "@types/d3-selection": "*" + } + }, + "node_modules/@types/d3-brush": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/@types/d3-brush/-/d3-brush-3.0.6.tgz", + "integrity": "sha512-nH60IZNNxEcrh6L1ZSMNA28rj27ut/2ZmI3r96Zd+1jrZD++zD3LsMIjWlvg4AYrHn/Pqz4CF3veCxGjtbqt7A==", + "license": "MIT", + "dependencies": { + "@types/d3-selection": "*" + } + }, + "node_modules/@types/d3-chord": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/@types/d3-chord/-/d3-chord-3.0.6.tgz", + "integrity": "sha512-LFYWWd8nwfwEmTZG9PfQxd17HbNPksHBiJHaKuY1XeqscXacsS2tyoo6OdRsjf+NQYeB6XrNL3a25E3gH69lcg==", + "license": "MIT" + }, + "node_modules/@types/d3-color": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/@types/d3-color/-/d3-color-3.1.3.tgz", + "integrity": "sha512-iO90scth9WAbmgv7ogoq57O9YpKmFBbmoEoCHDB2xMBY0+/KVrqAaCDyCE16dUspeOvIxFFRI+0sEtqDqy2b4A==", + "license": "MIT" + }, + "node_modules/@types/d3-contour": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/@types/d3-contour/-/d3-contour-3.0.6.tgz", + "integrity": "sha512-BjzLgXGnCWjUSYGfH1cpdo41/hgdWETu4YxpezoztawmqsvCeep+8QGfiY6YbDvfgHz/DkjeIkkZVJavB4a3rg==", + "license": "MIT", + "dependencies": { + "@types/d3-array": "*", + "@types/geojson": "*" + } + }, + "node_modules/@types/d3-delaunay": { + "version": "6.0.4", + "resolved": "https://registry.npmjs.org/@types/d3-delaunay/-/d3-delaunay-6.0.4.tgz", + "integrity": "sha512-ZMaSKu4THYCU6sV64Lhg6qjf1orxBthaC161plr5KuPHo3CNm8DTHiLw/5Eq2b6TsNP0W0iJrUOFscY6Q450Hw==", + "license": "MIT" + }, + "node_modules/@types/d3-dispatch": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/@types/d3-dispatch/-/d3-dispatch-3.0.7.tgz", + "integrity": "sha512-5o9OIAdKkhN1QItV2oqaE5KMIiXAvDWBDPrD85e58Qlz1c1kI/J0NcqbEG88CoTwJrYe7ntUCVfeUl2UJKbWgA==", + "license": "MIT" + }, + "node_modules/@types/d3-drag": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/@types/d3-drag/-/d3-drag-3.0.7.tgz", + "integrity": "sha512-HE3jVKlzU9AaMazNufooRJ5ZpWmLIoc90A37WU2JMmeq28w1FQqCZswHZ3xR+SuxYftzHq6WU6KJHvqxKzTxxQ==", + "license": "MIT", + "dependencies": { + "@types/d3-selection": "*" + } + }, + "node_modules/@types/d3-dsv": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/@types/d3-dsv/-/d3-dsv-3.0.7.tgz", + "integrity": "sha512-n6QBF9/+XASqcKK6waudgL0pf/S5XHPPI8APyMLLUHd8NqouBGLsU8MgtO7NINGtPBtk9Kko/W4ea0oAspwh9g==", + "license": "MIT" + }, + "node_modules/@types/d3-ease": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/d3-ease/-/d3-ease-3.0.2.tgz", + "integrity": "sha512-NcV1JjO5oDzoK26oMzbILE6HW7uVXOHLQvHshBUW4UMdZGfiY6v5BeQwh9a9tCzv+CeefZQHJt5SRgK154RtiA==", + "license": "MIT" + }, + "node_modules/@types/d3-fetch": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/@types/d3-fetch/-/d3-fetch-3.0.7.tgz", + "integrity": "sha512-fTAfNmxSb9SOWNB9IoG5c8Hg6R+AzUHDRlsXsDZsNp6sxAEOP0tkP3gKkNSO/qmHPoBFTxNrjDprVHDQDvo5aA==", + "license": "MIT", + "dependencies": { + "@types/d3-dsv": "*" + } + }, + "node_modules/@types/d3-force": { + "version": "3.0.10", + "resolved": "https://registry.npmjs.org/@types/d3-force/-/d3-force-3.0.10.tgz", + "integrity": "sha512-ZYeSaCF3p73RdOKcjj+swRlZfnYpK1EbaDiYICEEp5Q6sUiqFaFQ9qgoshp5CzIyyb/yD09kD9o2zEltCexlgw==", + "license": "MIT" + }, + "node_modules/@types/d3-format": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@types/d3-format/-/d3-format-3.0.4.tgz", + "integrity": "sha512-fALi2aI6shfg7vM5KiR1wNJnZ7r6UuggVqtDA+xiEdPZQwy/trcQaHnwShLuLdta2rTymCNpxYTiMZX/e09F4g==", + "license": "MIT" + }, + "node_modules/@types/d3-geo": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@types/d3-geo/-/d3-geo-3.1.0.tgz", + "integrity": "sha512-856sckF0oP/diXtS4jNsiQw/UuK5fQG8l/a9VVLeSouf1/PPbBE1i1W852zVwKwYCBkFJJB7nCFTbk6UMEXBOQ==", + "license": "MIT", + "dependencies": { + "@types/geojson": "*" + } + }, + "node_modules/@types/d3-hierarchy": { + "version": "3.1.7", + "resolved": "https://registry.npmjs.org/@types/d3-hierarchy/-/d3-hierarchy-3.1.7.tgz", + "integrity": "sha512-tJFtNoYBtRtkNysX1Xq4sxtjK8YgoWUNpIiUee0/jHGRwqvzYxkq0hGVbbOGSz+JgFxxRu4K8nb3YpG3CMARtg==", + "license": "MIT" + }, + "node_modules/@types/d3-interpolate": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@types/d3-interpolate/-/d3-interpolate-3.0.4.tgz", + "integrity": "sha512-mgLPETlrpVV1YRJIglr4Ez47g7Yxjl1lj7YKsiMCb27VJH9W8NVM6Bb9d8kkpG/uAQS5AmbA48q2IAolKKo1MA==", + "license": "MIT", + "dependencies": { + "@types/d3-color": "*" + } + }, + "node_modules/@types/d3-path": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/@types/d3-path/-/d3-path-3.1.1.tgz", + "integrity": "sha512-VMZBYyQvbGmWyWVea0EHs/BwLgxc+MKi1zLDCONksozI4YJMcTt8ZEuIR4Sb1MMTE8MMW49v0IwI5+b7RmfWlg==", + "license": "MIT" + }, + "node_modules/@types/d3-polygon": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/d3-polygon/-/d3-polygon-3.0.2.tgz", + "integrity": "sha512-ZuWOtMaHCkN9xoeEMr1ubW2nGWsp4nIql+OPQRstu4ypeZ+zk3YKqQT0CXVe/PYqrKpZAi+J9mTs05TKwjXSRA==", + "license": "MIT" + }, + "node_modules/@types/d3-quadtree": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/@types/d3-quadtree/-/d3-quadtree-3.0.6.tgz", + "integrity": "sha512-oUzyO1/Zm6rsxKRHA1vH0NEDG58HrT5icx/azi9MF1TWdtttWl0UIUsjEQBBh+SIkrpd21ZjEv7ptxWys1ncsg==", + "license": "MIT" + }, + "node_modules/@types/d3-random": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@types/d3-random/-/d3-random-3.0.3.tgz", + "integrity": "sha512-Imagg1vJ3y76Y2ea0871wpabqp613+8/r0mCLEBfdtqC7xMSfj9idOnmBYyMoULfHePJyxMAw3nWhJxzc+LFwQ==", + "license": "MIT" + }, + "node_modules/@types/d3-scale": { + "version": "4.0.9", + "resolved": "https://registry.npmjs.org/@types/d3-scale/-/d3-scale-4.0.9.tgz", + "integrity": "sha512-dLmtwB8zkAeO/juAMfnV+sItKjlsw2lKdZVVy6LRr0cBmegxSABiLEpGVmSJJ8O08i4+sGR6qQtb6WtuwJdvVw==", + "license": "MIT", + "dependencies": { + "@types/d3-time": "*" + } + }, + "node_modules/@types/d3-scale-chromatic": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@types/d3-scale-chromatic/-/d3-scale-chromatic-3.1.0.tgz", + "integrity": "sha512-iWMJgwkK7yTRmWqRB5plb1kadXyQ5Sj8V/zYlFGMUBbIPKQScw+Dku9cAAMgJG+z5GYDoMjWGLVOvjghDEFnKQ==", + "license": "MIT" + }, + "node_modules/@types/d3-selection": { + "version": "3.0.11", + "resolved": "https://registry.npmjs.org/@types/d3-selection/-/d3-selection-3.0.11.tgz", + "integrity": "sha512-bhAXu23DJWsrI45xafYpkQ4NtcKMwWnAC/vKrd2l+nxMFuvOT3XMYTIj2opv8vq8AO5Yh7Qac/nSeP/3zjTK0w==", + "license": "MIT" + }, + "node_modules/@types/d3-shape": { + "version": "3.1.8", + "resolved": "https://registry.npmjs.org/@types/d3-shape/-/d3-shape-3.1.8.tgz", + "integrity": "sha512-lae0iWfcDeR7qt7rA88BNiqdvPS5pFVPpo5OfjElwNaT2yyekbM0C9vK+yqBqEmHr6lDkRnYNoTBYlAgJa7a4w==", + "license": "MIT", + "dependencies": { + "@types/d3-path": "*" + } + }, + "node_modules/@types/d3-time": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@types/d3-time/-/d3-time-3.0.4.tgz", + "integrity": "sha512-yuzZug1nkAAaBlBBikKZTgzCeA+k1uy4ZFwWANOfKw5z5LRhV0gNA7gNkKm7HoK+HRN0wX3EkxGk0fpbWhmB7g==", + "license": "MIT" + }, + "node_modules/@types/d3-time-format": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/d3-time-format/-/d3-time-format-4.0.3.tgz", + "integrity": "sha512-5xg9rC+wWL8kdDj153qZcsJ0FWiFt0J5RB6LYUNZjwSnesfblqrI/bJ1wBdJ8OQfncgbJG5+2F+qfqnqyzYxyg==", + "license": "MIT" + }, + "node_modules/@types/d3-timer": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/d3-timer/-/d3-timer-3.0.2.tgz", + "integrity": "sha512-Ps3T8E8dZDam6fUyNiMkekK3XUsaUEik+idO9/YjPtfj2qruF8tFBXS7XhtE4iIXBLxhmLjP3SXpLhVf21I9Lw==", + "license": "MIT" + }, + "node_modules/@types/d3-transition": { + "version": "3.0.9", + "resolved": "https://registry.npmjs.org/@types/d3-transition/-/d3-transition-3.0.9.tgz", + "integrity": "sha512-uZS5shfxzO3rGlu0cC3bjmMFKsXv+SmZZcgp0KD22ts4uGXp5EVYGzu/0YdwZeKmddhcAccYtREJKkPfXkZuCg==", + "license": "MIT", + "dependencies": { + "@types/d3-selection": "*" + } + }, + "node_modules/@types/d3-zoom": { + "version": "3.0.8", + "resolved": "https://registry.npmjs.org/@types/d3-zoom/-/d3-zoom-3.0.8.tgz", + "integrity": "sha512-iqMC4/YlFCSlO8+2Ii1GGGliCAY4XdeG748w5vQUbevlbDu0zSjH/+jojorQVBK/se0j6DUFNPBGSqD3YWYnDw==", + "license": "MIT", + "dependencies": { + "@types/d3-interpolate": "*", + "@types/d3-selection": "*" + } + }, + "node_modules/@types/debug": { + "version": "4.1.13", + "resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.13.tgz", + "integrity": "sha512-KSVgmQmzMwPlmtljOomayoR89W4FynCAi3E8PPs7vmDVPe84hT+vGPKkJfThkmXs0x0jAaa9U8uW8bbfyS2fWw==", + "license": "MIT", + "dependencies": { + "@types/ms": "*" + } + }, + "node_modules/@types/estree": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.9.tgz", + "integrity": "sha512-GhdPgy1el4/ImP05X05Uw4cw2/M93BCUmnEvWZNStlCzEKME4Fkk+YpoA5OiHNQmoS7Cafb8Xa3Pya8m1Qrzeg==", + "license": "MIT" + }, + "node_modules/@types/estree-jsx": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@types/estree-jsx/-/estree-jsx-1.0.5.tgz", + "integrity": "sha512-52CcUVNFyfb1A2ALocQw/Dd1BQFNmSdkuC3BkZ6iqhdMfQz7JWOFRuJFloOzjk+6WijU56m9oKXFAXc7o3Towg==", + "license": "MIT", + "dependencies": { + "@types/estree": "*" + } + }, + "node_modules/@types/geojson": { + "version": "7946.0.16", + "resolved": "https://registry.npmjs.org/@types/geojson/-/geojson-7946.0.16.tgz", + "integrity": "sha512-6C8nqWur3j98U6+lXDfTUWIfgvZU+EumvpHKcYjujKH7woYyLj2sUmff0tRhrqM7BohUw7Pz3ZB1jj2gW9Fvmg==", + "license": "MIT" + }, + "node_modules/@types/hast": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@types/hast/-/hast-3.0.4.tgz", + "integrity": "sha512-WPs+bbQw5aCj+x6laNGWLH3wviHtoCv/P3+otBhbOhJgG8qtpdAMlTCxLtsTWA7LH1Oh/bFCHsBn0TPS5m30EQ==", + "license": "MIT", + "dependencies": { + "@types/unist": "*" + } + }, + "node_modules/@types/js-yaml": { + "version": "4.0.9", + "resolved": "https://registry.npmjs.org/@types/js-yaml/-/js-yaml-4.0.9.tgz", + "integrity": "sha512-k4MGaQl5TGo/iipqb2UDG2UwjXziSWkh0uysQelTlJpX1qGlpUZYm8PnO4DxG1qBomtJUdYJ6qR6xdIah10JLg==", + "license": "MIT" + }, + "node_modules/@types/mdast": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.4.tgz", + "integrity": "sha512-kGaNbPh1k7AFzgpud/gMdvIm5xuECykRR+JnWKQno9TAXVa6WIVCGTPvYGekIDL4uwCZQSYbUxNBSb1aUo79oA==", + "license": "MIT", + "dependencies": { + "@types/unist": "*" + } + }, + "node_modules/@types/mdx": { + "version": "2.0.13", + "resolved": "https://registry.npmjs.org/@types/mdx/-/mdx-2.0.13.tgz", + "integrity": "sha512-+OWZQfAYyio6YkJb3HLxDrvnx6SWWDbC0zVPfBRzUk0/nqoDyf6dNxQi3eArPe8rJ473nobTMQ/8Zk+LxJ+Yuw==", + "license": "MIT" + }, + "node_modules/@types/ms": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@types/ms/-/ms-2.1.0.tgz", + "integrity": "sha512-GsCCIZDE/p3i96vtEqx+7dBUGXrc7zeSK3wwPHIaRThS+9OhWIXRqzs4d6k1SVU8g91DrNRWxWUGhp5KXQb2VA==", + "license": "MIT" + }, + "node_modules/@types/nlcst": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@types/nlcst/-/nlcst-2.0.3.tgz", + "integrity": "sha512-vSYNSDe6Ix3q+6Z7ri9lyWqgGhJTmzRjZRqyq15N0Z/1/UnVsno9G/N40NBijoYx2seFDIl0+B2mgAb9mezUCA==", + "license": "MIT", + "dependencies": { + "@types/unist": "*" + } + }, + "node_modules/@types/node": { + "version": "24.13.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-24.13.0.tgz", + "integrity": "sha512-5vtOqGQr4NJKeEzV441FcOi2MeG9UTWq9LqVLGneDdu4vlX17H8kQ2PA2UmNwCUGPVDj4oBjNhS7ReVEIWJJrg==", + "license": "MIT", + "dependencies": { + "undici-types": "~7.18.0" + } + }, + "node_modules/@types/sax": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/@types/sax/-/sax-1.2.7.tgz", + "integrity": "sha512-rO73L89PJxeYM3s3pPPjiPgVVcymqU490g0YO5n5By0k2Erzj6tay/4lr1CHAAU4JyOWd1rpQ8bCf6cZfHU96A==", + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/trusted-types": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/@types/trusted-types/-/trusted-types-2.0.7.tgz", + "integrity": "sha512-ScaPdn1dQczgbl0QFTeTOmVHFULt394XJgOQNoyVhZ6r2vLnMLJfBPd53SB52T/3G36VI1/g2MZaX0cwDuXsfw==", + "license": "MIT", + "optional": true + }, + "node_modules/@types/unist": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.3.tgz", + "integrity": "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==", + "license": "MIT" + }, + "node_modules/@ungap/structured-clone": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.3.1.tgz", + "integrity": "sha512-mUFwbeTqrVgDQxFveS+df2yfap6iuP20NAKAsBt5jDEoOTDew+zwLAOilHCeQJOVSvmgCX4ogqIrA0mnyr08yQ==", + "license": "ISC" + }, + "node_modules/@upsetjs/venn.js": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@upsetjs/venn.js/-/venn.js-2.0.0.tgz", + "integrity": "sha512-WbBhLrooyePuQ1VZxrJjtLvTc4NVfpOyKx0sKqioq9bX1C1m7Jgykkn8gLrtwumBioXIqam8DLxp88Adbue6Hw==", + "license": "MIT", + "optionalDependencies": { + "d3-selection": "^3.0.0", + "d3-transition": "^3.0.1" + } + }, + "node_modules/acorn": { + "version": "8.16.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.16.0.tgz", + "integrity": "sha512-UVJyE9MttOsBQIDKw1skb9nAwQuR5wuGD3+82K6JgJlm/Y+KI92oNsMNGZCYdDsVtRHSak0pcV5Dno5+4jh9sw==", + "license": "MIT", + "peer": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-jsx": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "license": "MIT", + "peerDependencies": { + "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, + "node_modules/ansi-align": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/ansi-align/-/ansi-align-3.0.1.tgz", + "integrity": "sha512-IOfwwBF5iczOjp/WeY4YxyjqAFMQoZufdQWDd19SEExbVLNXqvpzSJ/M7Za4/sCPmQ0+GRquoA7bGcINcxew6w==", + "license": "ISC", + "dependencies": { + "string-width": "^4.1.0" + } + }, + "node_modules/ansi-align/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-align/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "license": "MIT" + }, + "node_modules/ansi-align/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-align/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-regex": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz", + "integrity": "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==", + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/ansi-styles": { + "version": "6.2.3", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.3.tgz", + "integrity": "sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==", + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/anymatch": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", + "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", + "license": "ISC", + "dependencies": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/anymatch/node_modules/picomatch": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.2.tgz", + "integrity": "sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==", + "license": "MIT", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/arg": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/arg/-/arg-5.0.2.tgz", + "integrity": "sha512-PYjyFOLKQ9y57JvQ6QLo8dAgNqswh8M1RMJYdQduT6xbWSgK36P/Z/v+p888pM69jMMfS8Xd8F6I1kQ/I9HUGg==", + "license": "MIT" + }, + "node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "license": "Python-2.0" + }, + "node_modules/aria-query": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.3.2.tgz", + "integrity": "sha512-COROpnaoap1E2F000S62r6A60uHZnmlvomhfyT2DlTcrY1OrBKn2UhH7qn5wTC9zMvD0AY7csdPSNwKP+7WiQw==", + "license": "Apache-2.0", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/array-iterate": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/array-iterate/-/array-iterate-2.0.1.tgz", + "integrity": "sha512-I1jXZMjAgCMmxT4qxXfPXa6SthSoE8h6gkSI9BGGNv8mP8G/v0blc+qFnZu6K42vTOiuME596QaLO0TP3Lk0xg==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/astring": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/astring/-/astring-1.9.0.tgz", + "integrity": "sha512-LElXdjswlqjWrPpJFg1Fx4wpkOCxj1TDHlSV4PlaRxHGWko024xICaa97ZkMfs6DRKlCguiAI+rbXv5GWwXIkg==", + "license": "MIT", + "bin": { + "astring": "bin/astring" + } + }, + "node_modules/astro": { + "version": "5.18.2", + "resolved": "https://registry.npmjs.org/astro/-/astro-5.18.2.tgz", + "integrity": "sha512-TnFwLnAXty5MXKPDGuKXqK4AMBXG+FH6RUdK7Oyc3gyfNoFIthT+4eRbzOK43bdRlLaZuxgciDSjgtggZ3OtGQ==", + "license": "MIT", + "peer": true, + "dependencies": { + "@astrojs/compiler": "^2.13.0", + "@astrojs/internal-helpers": "0.7.6", + "@astrojs/markdown-remark": "6.3.11", + "@astrojs/telemetry": "3.3.0", + "@capsizecss/unpack": "^4.0.0", + "@oslojs/encoding": "^1.1.0", + "@rollup/pluginutils": "^5.3.0", + "acorn": "^8.15.0", + "aria-query": "^5.3.2", + "axobject-query": "^4.1.0", + "boxen": "8.0.1", + "ci-info": "^4.3.1", + "clsx": "^2.1.1", + "common-ancestor-path": "^1.0.1", + "cookie": "^1.1.1", + "cssesc": "^3.0.0", + "debug": "^4.4.3", + "deterministic-object-hash": "^2.0.2", + "devalue": "^5.6.2", + "diff": "^8.0.3", + "dlv": "^1.1.3", + "dset": "^3.1.4", + "es-module-lexer": "^1.7.0", + "esbuild": "^0.27.3", + "estree-walker": "^3.0.3", + "flattie": "^1.1.1", + "fontace": "~0.4.0", + "github-slugger": "^2.0.0", + "html-escaper": "3.0.3", + "http-cache-semantics": "^4.2.0", + "import-meta-resolve": "^4.2.0", + "js-yaml": "^4.1.1", + "magic-string": "^0.30.21", + "magicast": "^0.5.1", + "mrmime": "^2.0.1", + "neotraverse": "^0.6.18", + "p-limit": "^6.2.0", + "p-queue": "^8.1.1", + "package-manager-detector": "^1.6.0", + "piccolore": "^0.1.3", + "picomatch": "^4.0.3", + "prompts": "^2.4.2", + "rehype": "^13.0.2", + "semver": "^7.7.3", + "shiki": "^3.21.0", + "smol-toml": "^1.6.0", + "svgo": "^4.0.0", + "tinyexec": "^1.0.2", + "tinyglobby": "^0.2.15", + "tsconfck": "^3.1.6", + "ultrahtml": "^1.6.0", + "unifont": "~0.7.3", + "unist-util-visit": "^5.0.0", + "unstorage": "^1.17.4", + "vfile": "^6.0.3", + "vite": "^6.4.1", + "vitefu": "^1.1.1", + "xxhash-wasm": "^1.1.0", + "yargs-parser": "^21.1.1", + "yocto-spinner": "^0.2.3", + "zod": "^3.25.76", + "zod-to-json-schema": "^3.25.1", + "zod-to-ts": "^1.2.0" + }, + "bin": { + "astro": "astro.js" + }, + "engines": { + "node": "18.20.8 || ^20.3.0 || >=22.0.0", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/astrodotbuild" + }, + "optionalDependencies": { + "sharp": "^0.34.0" + } + }, + "node_modules/astro-expressive-code": { + "version": "0.41.7", + "resolved": "https://registry.npmjs.org/astro-expressive-code/-/astro-expressive-code-0.41.7.tgz", + "integrity": "sha512-hUpogGc6DdAd+I7pPXsctyYPRBJDK7Q7d06s4cyP0Vz3OcbziP3FNzN0jZci1BpCvLn9675DvS7B9ctKKX64JQ==", + "license": "MIT", + "dependencies": { + "rehype-expressive-code": "^0.41.7" + }, + "peerDependencies": { + "astro": "^4.0.0-beta || ^5.0.0-beta || ^3.3.0 || ^6.0.0-beta" + } + }, + "node_modules/astro-mermaid": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/astro-mermaid/-/astro-mermaid-2.0.2.tgz", + "integrity": "sha512-ihx63qwZ0hlu9mDjs6auQEXyo13s9h5HFHFIHovjTJH6ot97u0VqyGk3P1kkjPYZeOMrZ1Y7QAOevUfLs9cDfA==", + "license": "MIT", + "dependencies": { + "import-meta-resolve": "^4.2.0", + "mdast-util-to-string": "^4.0.0", + "unist-util-visit": "^5.0.0" + }, + "peerDependencies": { + "@mermaid-js/layout-elk": "^0.2.0", + "astro": ">=4", + "mermaid": "^10.0.0 || ^11.0.0" + }, + "peerDependenciesMeta": { + "@mermaid-js/layout-elk": { + "optional": true + } + } + }, + "node_modules/astro/node_modules/zod": { + "version": "3.25.76", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.25.76.tgz", + "integrity": "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==", + "license": "MIT", + "peer": true, + "funding": { + "url": "https://github.com/sponsors/colinhacks" + } + }, + "node_modules/astro/node_modules/zod-to-ts": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/zod-to-ts/-/zod-to-ts-1.2.0.tgz", + "integrity": "sha512-x30XE43V+InwGpvTySRNz9kB7qFU8DlyEy7BsSTCHPH1R0QasMmHWZDCzYm6bVXtj/9NNJAZF3jW8rzFvH5OFA==", + "peerDependencies": { + "typescript": "^4.9.4 || ^5.0.2", + "zod": "^3" + } + }, + "node_modules/axobject-query": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-4.1.0.tgz", + "integrity": "sha512-qIj0G9wZbMGNLjLmg1PT6v2mE9AH2zlnADJD/2tC6E00hgmhUOfEB6greHPAfLRSufHqROIUTkw6E+M3lH0PTQ==", + "license": "Apache-2.0", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/bail": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.2.tgz", + "integrity": "sha512-0xO6mYd7JB2YesxDKplafRpsiOzPt9V02ddPCLbY1xYGPOX24NTyN50qnUxgCPcSoYMhKpAuBTjQoRZCAkUDRw==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/base-64": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/base-64/-/base-64-1.0.0.tgz", + "integrity": "sha512-kwDPIFCGx0NZHog36dj+tHiwP4QMzsZ3AgMViUBKI0+V5n4U0ufTCUMhnQ04diaRI8EX/QcPfql7zlhZ7j4zgg==", + "license": "MIT" + }, + "node_modules/bcp-47": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/bcp-47/-/bcp-47-2.1.0.tgz", + "integrity": "sha512-9IIS3UPrvIa1Ej+lVDdDwO7zLehjqsaByECw0bu2RRGP73jALm6FYbzI5gWbgHLvNdkvfXB5YrSbocZdOS0c0w==", + "license": "MIT", + "dependencies": { + "is-alphabetical": "^2.0.0", + "is-alphanumerical": "^2.0.0", + "is-decimal": "^2.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/bcp-47-match": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/bcp-47-match/-/bcp-47-match-2.0.3.tgz", + "integrity": "sha512-JtTezzbAibu8G0R9op9zb3vcWZd9JF6M0xOYGPn0fNCd7wOpRB1mU2mH9T8gaBGbAAyIIVgB2G7xG0GP98zMAQ==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/boolbase": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", + "integrity": "sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==", + "license": "ISC" + }, + "node_modules/boxen": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/boxen/-/boxen-8.0.1.tgz", + "integrity": "sha512-F3PH5k5juxom4xktynS7MoFY+NUWH5LC4CnH11YB8NPew+HLpmBLCybSAEyb2F+4pRXhuhWqFesoQd6DAyc2hw==", + "license": "MIT", + "dependencies": { + "ansi-align": "^3.0.1", + "camelcase": "^8.0.0", + "chalk": "^5.3.0", + "cli-boxes": "^3.0.0", + "string-width": "^7.2.0", + "type-fest": "^4.21.0", + "widest-line": "^5.0.0", + "wrap-ansi": "^9.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/camelcase": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-8.0.0.tgz", + "integrity": "sha512-8WB3Jcas3swSvjIeA2yvCJ+Miyz5l1ZmB6HFb9R1317dt9LCQoswg/BGrmAmkWVEszSrrg4RwmO46qIm2OEnSA==", + "license": "MIT", + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ccount": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/ccount/-/ccount-2.0.1.tgz", + "integrity": "sha512-eyrF0jiFpY+3drT6383f1qhkbGsLSifNAjA61IUjZjmLCWjItY6LB9ft9YhoDgwfmclB2zhu51Lc7+95b8NRAg==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/chalk": { + "version": "5.6.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.6.2.tgz", + "integrity": "sha512-7NzBL0rN6fMUW+f7A6Io4h40qQlG+xGmtMxfbnH/K7TAtt8JQWVQK+6g0UXKMeVJoyV5EkkNsErQ8pVD3bLHbA==", + "license": "MIT", + "engines": { + "node": "^12.17.0 || ^14.13 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/character-entities": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/character-entities/-/character-entities-2.0.2.tgz", + "integrity": "sha512-shx7oQ0Awen/BRIdkjkvz54PnEEI/EjwXDSIZp86/KKdbafHh1Df/RYGBhn4hbe2+uKC9FnT5UCEdyPz3ai9hQ==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/character-entities-html4": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/character-entities-html4/-/character-entities-html4-2.1.0.tgz", + "integrity": "sha512-1v7fgQRj6hnSwFpq1Eu0ynr/CDEw0rXo2B61qXrLNdHZmPKgb7fqS1a2JwF0rISo9q77jDI8VMEHoApn8qDoZA==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/character-entities-legacy": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/character-entities-legacy/-/character-entities-legacy-3.0.0.tgz", + "integrity": "sha512-RpPp0asT/6ufRm//AJVwpViZbGM/MkjQFxJccQRHmISF/22NBtsHqAWmL+/pmkPWoIUJdWyeVleTl1wydHATVQ==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/character-reference-invalid": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/character-reference-invalid/-/character-reference-invalid-2.0.1.tgz", + "integrity": "sha512-iBZ4F4wRbyORVsu0jPV7gXkOsGYjGHPmAyv+HiHG8gi5PtC9KI2j1+v8/tlibRvjoWX027ypmG/n0HtO5t7unw==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/chokidar": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-5.0.0.tgz", + "integrity": "sha512-TQMmc3w+5AxjpL8iIiwebF73dRDF4fBIieAqGn9RGCWaEVwQ6Fb2cGe31Yns0RRIzii5goJ1Y7xbMwo1TxMplw==", + "license": "MIT", + "dependencies": { + "readdirp": "^5.0.0" + }, + "engines": { + "node": ">= 20.19.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/ci-info": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-4.4.0.tgz", + "integrity": "sha512-77PSwercCZU2Fc4sX94eF8k8Pxte6JAwL4/ICZLFjJLqegs7kCuAsqqj/70NQF6TvDpgFjkubQB2FW2ZZddvQg==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/sibiraj-s" + } + ], + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/cli-boxes": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/cli-boxes/-/cli-boxes-3.0.0.tgz", + "integrity": "sha512-/lzGpEWL/8PfI0BmBOPRwp0c/wFNX1RdUML3jK/RcSBA9T8mZDdQpqYBKtCFTOfQbwPqWEOpjqW+Fnayc0969g==", + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/clsx": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/clsx/-/clsx-2.1.1.tgz", + "integrity": "sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/collapse-white-space": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/collapse-white-space/-/collapse-white-space-2.1.0.tgz", + "integrity": "sha512-loKTxY1zCOuG4j9f6EPnuyyYkf58RnhhWTvRoZEokgB+WbdXehfjFviyOVYkqzEWz1Q5kRiZdBYS5SwxbQYwzw==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/comma-separated-tokens": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/comma-separated-tokens/-/comma-separated-tokens-2.0.3.tgz", + "integrity": "sha512-Fu4hJdvzeylCfQPp9SGWidpzrMs7tTrlu6Vb8XGaRGck8QSNZJJp538Wrb60Lax4fPwR64ViY468OIUTbRlGZg==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/commander": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz", + "integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==", + "license": "MIT", + "engines": { + "node": ">= 10" + } + }, + "node_modules/common-ancestor-path": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/common-ancestor-path/-/common-ancestor-path-1.0.1.tgz", + "integrity": "sha512-L3sHRo1pXXEqX8VU28kfgUY+YGsk09hPqZiZmLacNib6XNTCM8ubYeT7ryXQw8asB1sKgcU5lkB7ONug08aB8w==", + "license": "ISC" + }, + "node_modules/cookie": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-1.1.1.tgz", + "integrity": "sha512-ei8Aos7ja0weRpFzJnEA9UHJ/7XQmqglbRwnf2ATjcB9Wq874VKH9kfjjirM6UhU2/E5fFYadylyhFldcqSidQ==", + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/cookie-es": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/cookie-es/-/cookie-es-1.2.3.tgz", + "integrity": "sha512-lXVyvUvrNXblMqzIRrxHb57UUVmqsSWlxqt3XIjCkUP0wDAf6uicO6KMbEgYrMNtEvWgWHwe42CKxPu9MYAnWw==", + "license": "MIT" + }, + "node_modules/cose-base": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/cose-base/-/cose-base-1.0.3.tgz", + "integrity": "sha512-s9whTXInMSgAp/NVXVNuVxVKzGH2qck3aQlVHxDCdAEPgtMKwc4Wq6/QKhgdEdgbLSi9rBTAcPoRa6JpiG4ksg==", + "license": "MIT", + "dependencies": { + "layout-base": "^1.0.0" + } + }, + "node_modules/crossws": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/crossws/-/crossws-0.3.5.tgz", + "integrity": "sha512-ojKiDvcmByhwa8YYqbQI/hg7MEU0NC03+pSdEq4ZUnZR9xXpwk7E43SMNGkn+JxJGPFtNvQ48+vV2p+P1ml5PA==", + "license": "MIT", + "dependencies": { + "uncrypto": "^0.1.3" + } + }, + "node_modules/css-select": { + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/css-select/-/css-select-5.2.2.tgz", + "integrity": "sha512-TizTzUddG/xYLA3NXodFM0fSbNizXjOKhqiQQwvhlspadZokn1KDy0NZFS0wuEubIYAV5/c1/lAr0TaaFXEXzw==", + "license": "BSD-2-Clause", + "dependencies": { + "boolbase": "^1.0.0", + "css-what": "^6.1.0", + "domhandler": "^5.0.2", + "domutils": "^3.0.1", + "nth-check": "^2.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/fb55" + } + }, + "node_modules/css-selector-parser": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/css-selector-parser/-/css-selector-parser-3.3.0.tgz", + "integrity": "sha512-Y2asgMGFqJKF4fq4xHDSlFYIkeVfRsm69lQC1q9kbEsH5XtnINTMrweLkjYMeaUgiXBy/uvKeO/a1JHTNnmB2g==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/mdevils" + }, + { + "type": "patreon", + "url": "https://patreon.com/mdevils" + } + ], + "license": "MIT" + }, + "node_modules/css-tree": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-3.2.1.tgz", + "integrity": "sha512-X7sjQzceUhu1u7Y/ylrRZFU2FS6LRiFVp6rKLPg23y3x3c3DOKAwuXGDp+PAGjh6CSnCjYeAul8pcT8bAl+lSA==", + "license": "MIT", + "dependencies": { + "mdn-data": "2.27.1", + "source-map-js": "^1.2.1" + }, + "engines": { + "node": "^10 || ^12.20.0 || ^14.13.0 || >=15.0.0" + } + }, + "node_modules/css-what": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/css-what/-/css-what-6.2.2.tgz", + "integrity": "sha512-u/O3vwbptzhMs3L1fQE82ZSLHQQfto5gyZzwteVIEyeaY5Fc7R4dapF/BvRoSYFeqfBk4m0V1Vafq5Pjv25wvA==", + "license": "BSD-2-Clause", + "engines": { + "node": ">= 6" + }, + "funding": { + "url": "https://github.com/sponsors/fb55" + } + }, + "node_modules/cssesc": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/cssesc/-/cssesc-3.0.0.tgz", + "integrity": "sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==", + "license": "MIT", + "bin": { + "cssesc": "bin/cssesc" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/csso": { + "version": "5.0.5", + "resolved": "https://registry.npmjs.org/csso/-/csso-5.0.5.tgz", + "integrity": "sha512-0LrrStPOdJj+SPCCrGhzryycLjwcgUSHBtxNA8aIDxf0GLsRh1cKYhB00Gd1lDOS4yGH69+SNn13+TWbVHETFQ==", + "license": "MIT", + "dependencies": { + "css-tree": "~2.2.0" + }, + "engines": { + "node": "^10 || ^12.20.0 || ^14.13.0 || >=15.0.0", + "npm": ">=7.0.0" + } + }, + "node_modules/csso/node_modules/css-tree": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-2.2.1.tgz", + "integrity": "sha512-OA0mILzGc1kCOCSJerOeqDxDQ4HOh+G8NbOJFOTgOCzpw7fCBubk0fEyxp8AgOL/jvLgYA/uV0cMbe43ElF1JA==", + "license": "MIT", + "dependencies": { + "mdn-data": "2.0.28", + "source-map-js": "^1.0.1" + }, + "engines": { + "node": "^10 || ^12.20.0 || ^14.13.0 || >=15.0.0", + "npm": ">=7.0.0" + } + }, + "node_modules/csso/node_modules/mdn-data": { + "version": "2.0.28", + "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.28.tgz", + "integrity": "sha512-aylIc7Z9y4yzHYAJNuESG3hfhC+0Ibp/MAMiaOZgNv4pmEdFyfZhhhny4MNiAfWdBQ1RQ2mfDWmM1x8SvGyp8g==", + "license": "CC0-1.0" + }, + "node_modules/cytoscape": { + "version": "3.34.0", + "resolved": "https://registry.npmjs.org/cytoscape/-/cytoscape-3.34.0.tgz", + "integrity": "sha512-62rNSrioXw93uliKFBwjukeQyeWwH2PqDrTac31r2P6464u3AUvTk0xS4LVvT251g7IgkFunrI48ZEZGjywSOg==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/cytoscape-cose-bilkent": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/cytoscape-cose-bilkent/-/cytoscape-cose-bilkent-4.1.0.tgz", + "integrity": "sha512-wgQlVIUJF13Quxiv5e1gstZ08rnZj2XaLHGoFMYXz7SkNfCDOOteKBE6SYRfA9WxxI/iBc3ajfDoc6hb/MRAHQ==", + "license": "MIT", + "dependencies": { + "cose-base": "^1.0.0" + }, + "peerDependencies": { + "cytoscape": "^3.2.0" + } + }, + "node_modules/cytoscape-fcose": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/cytoscape-fcose/-/cytoscape-fcose-2.2.0.tgz", + "integrity": "sha512-ki1/VuRIHFCzxWNrsshHYPs6L7TvLu3DL+TyIGEsRcvVERmxokbf5Gdk7mFxZnTdiGtnA4cfSmjZJMviqSuZrQ==", + "license": "MIT", + "dependencies": { + "cose-base": "^2.2.0" + }, + "peerDependencies": { + "cytoscape": "^3.2.0" + } + }, + "node_modules/cytoscape-fcose/node_modules/cose-base": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/cose-base/-/cose-base-2.2.0.tgz", + "integrity": "sha512-AzlgcsCbUMymkADOJtQm3wO9S3ltPfYOFD5033keQn9NJzIbtnZj+UdBJe7DYml/8TdbtHJW3j58SOnKhWY/5g==", + "license": "MIT", + "dependencies": { + "layout-base": "^2.0.0" + } + }, + "node_modules/cytoscape-fcose/node_modules/layout-base": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/layout-base/-/layout-base-2.0.1.tgz", + "integrity": "sha512-dp3s92+uNI1hWIpPGH3jK2kxE2lMjdXdr+DH8ynZHpd6PUlH6x6cbuXnoMmiNumznqaNO31xu9e79F0uuZ0JFg==", + "license": "MIT" + }, + "node_modules/d3": { + "version": "7.9.0", + "resolved": "https://registry.npmjs.org/d3/-/d3-7.9.0.tgz", + "integrity": "sha512-e1U46jVP+w7Iut8Jt8ri1YsPOvFpg46k+K8TpCb0P+zjCkjkPnV7WzfDJzMHy1LnA+wj5pLT1wjO901gLXeEhA==", + "license": "ISC", + "dependencies": { + "d3-array": "3", + "d3-axis": "3", + "d3-brush": "3", + "d3-chord": "3", + "d3-color": "3", + "d3-contour": "4", + "d3-delaunay": "6", + "d3-dispatch": "3", + "d3-drag": "3", + "d3-dsv": "3", + "d3-ease": "3", + "d3-fetch": "3", + "d3-force": "3", + "d3-format": "3", + "d3-geo": "3", + "d3-hierarchy": "3", + "d3-interpolate": "3", + "d3-path": "3", + "d3-polygon": "3", + "d3-quadtree": "3", + "d3-random": "3", + "d3-scale": "4", + "d3-scale-chromatic": "3", + "d3-selection": "3", + "d3-shape": "3", + "d3-time": "3", + "d3-time-format": "4", + "d3-timer": "3", + "d3-transition": "3", + "d3-zoom": "3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-array": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/d3-array/-/d3-array-3.2.4.tgz", + "integrity": "sha512-tdQAmyA18i4J7wprpYq8ClcxZy3SC31QMeByyCFyRt7BVHdREQZ5lpzoe5mFEYZUWe+oq8HBvk9JjpibyEV4Jg==", + "license": "ISC", + "dependencies": { + "internmap": "1 - 2" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-axis": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/d3-axis/-/d3-axis-3.0.0.tgz", + "integrity": "sha512-IH5tgjV4jE/GhHkRV0HiVYPDtvfjHQlQfJHs0usq7M30XcSBvOotpmH1IgkcXsO/5gEQZD43B//fc7SRT5S+xw==", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-brush": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/d3-brush/-/d3-brush-3.0.0.tgz", + "integrity": "sha512-ALnjWlVYkXsVIGlOsuWH1+3udkYFI48Ljihfnh8FZPF2QS9o+PzGLBslO0PjzVoHLZ2KCVgAM8NVkXPJB2aNnQ==", + "license": "ISC", + "dependencies": { + "d3-dispatch": "1 - 3", + "d3-drag": "2 - 3", + "d3-interpolate": "1 - 3", + "d3-selection": "3", + "d3-transition": "3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-chord": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-chord/-/d3-chord-3.0.1.tgz", + "integrity": "sha512-VE5S6TNa+j8msksl7HwjxMHDM2yNK3XCkusIlpX5kwauBfXuyLAtNg9jCp/iHH61tgI4sb6R/EIMWCqEIdjT/g==", + "license": "ISC", + "dependencies": { + "d3-path": "1 - 3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-color": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/d3-color/-/d3-color-3.1.0.tgz", + "integrity": "sha512-zg/chbXyeBtMQ1LbD/WSoW2DpC3I0mpmPdW+ynRTj/x2DAWYrIY7qeZIHidozwV24m4iavr15lNwIwLxRmOxhA==", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-contour": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/d3-contour/-/d3-contour-4.0.2.tgz", + "integrity": "sha512-4EzFTRIikzs47RGmdxbeUvLWtGedDUNkTcmzoeyg4sP/dvCexO47AaQL7VKy/gul85TOxw+IBgA8US2xwbToNA==", + "license": "ISC", + "dependencies": { + "d3-array": "^3.2.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-delaunay": { + "version": "6.0.4", + "resolved": "https://registry.npmjs.org/d3-delaunay/-/d3-delaunay-6.0.4.tgz", + "integrity": "sha512-mdjtIZ1XLAM8bm/hx3WwjfHt6Sggek7qH043O8KEjDXN40xi3vx/6pYSVTwLjEgiXQTbvaouWKynLBiUZ6SK6A==", + "license": "ISC", + "dependencies": { + "delaunator": "5" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-dispatch": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-dispatch/-/d3-dispatch-3.0.1.tgz", + "integrity": "sha512-rzUyPU/S7rwUflMyLc1ETDeBj0NRuHKKAcvukozwhshr6g6c5d8zh4c2gQjY2bZ0dXeGLWc1PF174P2tVvKhfg==", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-drag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/d3-drag/-/d3-drag-3.0.0.tgz", + "integrity": "sha512-pWbUJLdETVA8lQNJecMxoXfH6x+mO2UQo8rSmZ+QqxcbyA3hfeprFgIT//HW2nlHChWeIIMwS2Fq+gEARkhTkg==", + "license": "ISC", + "dependencies": { + "d3-dispatch": "1 - 3", + "d3-selection": "3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-dsv": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-dsv/-/d3-dsv-3.0.1.tgz", + "integrity": "sha512-UG6OvdI5afDIFP9w4G0mNq50dSOsXHJaRE8arAS5o9ApWnIElp8GZw1Dun8vP8OyHOZ/QJUKUJwxiiCCnUwm+Q==", + "license": "ISC", + "dependencies": { + "commander": "7", + "iconv-lite": "0.6", + "rw": "1" + }, + "bin": { + "csv2json": "bin/dsv2json.js", + "csv2tsv": "bin/dsv2dsv.js", + "dsv2dsv": "bin/dsv2dsv.js", + "dsv2json": "bin/dsv2json.js", + "json2csv": "bin/json2dsv.js", + "json2dsv": "bin/json2dsv.js", + "json2tsv": "bin/json2dsv.js", + "tsv2csv": "bin/dsv2dsv.js", + "tsv2json": "bin/dsv2json.js" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-ease": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-ease/-/d3-ease-3.0.1.tgz", + "integrity": "sha512-wR/XK3D3XcLIZwpbvQwQ5fK+8Ykds1ip7A2Txe0yxncXSdq1L9skcG7blcedkOX+ZcgxGAmLX1FrRGbADwzi0w==", + "license": "BSD-3-Clause", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-fetch": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-fetch/-/d3-fetch-3.0.1.tgz", + "integrity": "sha512-kpkQIM20n3oLVBKGg6oHrUchHM3xODkTzjMoj7aWQFq5QEM+R6E4WkzT5+tojDY7yjez8KgCBRoj4aEr99Fdqw==", + "license": "ISC", + "dependencies": { + "d3-dsv": "1 - 3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-force": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/d3-force/-/d3-force-3.0.0.tgz", + "integrity": "sha512-zxV/SsA+U4yte8051P4ECydjD/S+qeYtnaIyAs9tgHCqfguma/aAQDjo85A9Z6EKhBirHRJHXIgJUlffT4wdLg==", + "license": "ISC", + "dependencies": { + "d3-dispatch": "1 - 3", + "d3-quadtree": "1 - 3", + "d3-timer": "1 - 3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-format": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/d3-format/-/d3-format-3.1.2.tgz", + "integrity": "sha512-AJDdYOdnyRDV5b6ArilzCPPwc1ejkHcoyFarqlPqT7zRYjhavcT3uSrqcMvsgh2CgoPbK3RCwyHaVyxYcP2Arg==", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-geo": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/d3-geo/-/d3-geo-3.1.1.tgz", + "integrity": "sha512-637ln3gXKXOwhalDzinUgY83KzNWZRKbYubaG+fGVuc/dxO64RRljtCTnf5ecMyE1RIdtqpkVcq0IbtU2S8j2Q==", + "license": "ISC", + "dependencies": { + "d3-array": "2.5.0 - 3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-hierarchy": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/d3-hierarchy/-/d3-hierarchy-3.1.2.tgz", + "integrity": "sha512-FX/9frcub54beBdugHjDCdikxThEqjnR93Qt7PvQTOHxyiNCAlvMrHhclk3cD5VeAaq9fxmfRp+CnWw9rEMBuA==", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-interpolate": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-interpolate/-/d3-interpolate-3.0.1.tgz", + "integrity": "sha512-3bYs1rOD33uo8aqJfKP3JWPAibgw8Zm2+L9vBKEHJ2Rg+viTR7o5Mmv5mZcieN+FRYaAOWX5SJATX6k1PWz72g==", + "license": "ISC", + "dependencies": { + "d3-color": "1 - 3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-path": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/d3-path/-/d3-path-3.1.0.tgz", + "integrity": "sha512-p3KP5HCf/bvjBSSKuXid6Zqijx7wIfNW+J/maPs+iwR35at5JCbLUT0LzF1cnjbCHWhqzQTIN2Jpe8pRebIEFQ==", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-polygon": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-polygon/-/d3-polygon-3.0.1.tgz", + "integrity": "sha512-3vbA7vXYwfe1SYhED++fPUQlWSYTTGmFmQiany/gdbiWgU/iEyQzyymwL9SkJjFFuCS4902BSzewVGsHHmHtXg==", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-quadtree": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-quadtree/-/d3-quadtree-3.0.1.tgz", + "integrity": "sha512-04xDrxQTDTCFwP5H6hRhsRcb9xxv2RzkcsygFzmkSIOJy3PeRJP7sNk3VRIbKXcog561P9oU0/rVH6vDROAgUw==", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-random": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-random/-/d3-random-3.0.1.tgz", + "integrity": "sha512-FXMe9GfxTxqd5D6jFsQ+DJ8BJS4E/fT5mqqdjovykEB2oFbTMDVdg1MGFxfQW+FBOGoB++k8swBrgwSHT1cUXQ==", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-sankey": { + "version": "0.12.3", + "resolved": "https://registry.npmjs.org/d3-sankey/-/d3-sankey-0.12.3.tgz", + "integrity": "sha512-nQhsBRmM19Ax5xEIPLMY9ZmJ/cDvd1BG3UVvt5h3WRxKg5zGRbvnteTyWAbzeSvlh3tW7ZEmq4VwR5mB3tutmQ==", + "license": "BSD-3-Clause", + "dependencies": { + "d3-array": "1 - 2", + "d3-shape": "^1.2.0" + } + }, + "node_modules/d3-sankey/node_modules/d3-array": { + "version": "2.12.1", + "resolved": "https://registry.npmjs.org/d3-array/-/d3-array-2.12.1.tgz", + "integrity": "sha512-B0ErZK/66mHtEsR1TkPEEkwdy+WDesimkM5gpZr5Dsg54BiTA5RXtYW5qTLIAcekaS9xfZrzBLF/OAkB3Qn1YQ==", + "license": "BSD-3-Clause", + "dependencies": { + "internmap": "^1.0.0" + } + }, + "node_modules/d3-sankey/node_modules/d3-path": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/d3-path/-/d3-path-1.0.9.tgz", + "integrity": "sha512-VLaYcn81dtHVTjEHd8B+pbe9yHWpXKZUC87PzoFmsFrJqgFwDe/qxfp5MlfsfM1V5E/iVt0MmEbWQ7FVIXh/bg==", + "license": "BSD-3-Clause" + }, + "node_modules/d3-sankey/node_modules/d3-shape": { + "version": "1.3.7", + "resolved": "https://registry.npmjs.org/d3-shape/-/d3-shape-1.3.7.tgz", + "integrity": "sha512-EUkvKjqPFUAZyOlhY5gzCxCeI0Aep04LwIRpsZ/mLFelJiUfnK56jo5JMDSE7yyP2kLSb6LtF+S5chMk7uqPqw==", + "license": "BSD-3-Clause", + "dependencies": { + "d3-path": "1" + } + }, + "node_modules/d3-sankey/node_modules/internmap": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/internmap/-/internmap-1.0.1.tgz", + "integrity": "sha512-lDB5YccMydFBtasVtxnZ3MRBHuaoE8GKsppq+EchKL2U4nK/DmEpPHNH8MZe5HkMtpSiTSOZwfN0tzYjO/lJEw==", + "license": "ISC" + }, + "node_modules/d3-scale": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/d3-scale/-/d3-scale-4.0.2.tgz", + "integrity": "sha512-GZW464g1SH7ag3Y7hXjf8RoUuAFIqklOAq3MRl4OaWabTFJY9PN/E1YklhXLh+OQ3fM9yS2nOkCoS+WLZ6kvxQ==", + "license": "ISC", + "dependencies": { + "d3-array": "2.10.0 - 3", + "d3-format": "1 - 3", + "d3-interpolate": "1.2.0 - 3", + "d3-time": "2.1.1 - 3", + "d3-time-format": "2 - 4" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-scale-chromatic": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/d3-scale-chromatic/-/d3-scale-chromatic-3.1.0.tgz", + "integrity": "sha512-A3s5PWiZ9YCXFye1o246KoscMWqf8BsD9eRiJ3He7C9OBaxKhAd5TFCdEx/7VbKtxxTsu//1mMJFrEt572cEyQ==", + "license": "ISC", + "dependencies": { + "d3-color": "1 - 3", + "d3-interpolate": "1 - 3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-selection": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/d3-selection/-/d3-selection-3.0.0.tgz", + "integrity": "sha512-fmTRWbNMmsmWq6xJV8D19U/gw/bwrHfNXxrIN+HfZgnzqTHp9jOmKMhsTUjXOJnZOdZY9Q28y4yebKzqDKlxlQ==", + "license": "ISC", + "peer": true, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-shape": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/d3-shape/-/d3-shape-3.2.0.tgz", + "integrity": "sha512-SaLBuwGm3MOViRq2ABk3eLoxwZELpH6zhl3FbAoJ7Vm1gofKx6El1Ib5z23NUEhF9AsGl7y+dzLe5Cw2AArGTA==", + "license": "ISC", + "dependencies": { + "d3-path": "^3.1.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-time": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/d3-time/-/d3-time-3.1.0.tgz", + "integrity": "sha512-VqKjzBLejbSMT4IgbmVgDjpkYrNWUYJnbCGo874u7MMKIWsILRX+OpX/gTk8MqjpT1A/c6HY2dCA77ZN0lkQ2Q==", + "license": "ISC", + "dependencies": { + "d3-array": "2 - 3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-time-format": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/d3-time-format/-/d3-time-format-4.1.0.tgz", + "integrity": "sha512-dJxPBlzC7NugB2PDLwo9Q8JiTR3M3e4/XANkreKSUxF8vvXKqm1Yfq4Q5dl8budlunRVlUUaDUgFt7eA8D6NLg==", + "license": "ISC", + "dependencies": { + "d3-time": "1 - 3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-timer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-timer/-/d3-timer-3.0.1.tgz", + "integrity": "sha512-ndfJ/JxxMd3nw31uyKoY2naivF+r29V+Lc0svZxe1JvvIRmi8hUsrMvdOwgS1o6uBHmiz91geQ0ylPP0aj1VUA==", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-transition": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-transition/-/d3-transition-3.0.1.tgz", + "integrity": "sha512-ApKvfjsSR6tg06xrL434C0WydLr7JewBB3V+/39RMHsaXTOG0zmt/OAXeng5M5LBm0ojmxJrpomQVZ1aPvBL4w==", + "license": "ISC", + "dependencies": { + "d3-color": "1 - 3", + "d3-dispatch": "1 - 3", + "d3-ease": "1 - 3", + "d3-interpolate": "1 - 3", + "d3-timer": "1 - 3" + }, + "engines": { + "node": ">=12" + }, + "peerDependencies": { + "d3-selection": "2 - 3" + } + }, + "node_modules/d3-zoom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/d3-zoom/-/d3-zoom-3.0.0.tgz", + "integrity": "sha512-b8AmV3kfQaqWAuacbPuNbL6vahnOJflOhexLzMMNLga62+/nh0JzvJ0aO/5a5MVgUFGS7Hu1P9P03o3fJkDCyw==", + "license": "ISC", + "dependencies": { + "d3-dispatch": "1 - 3", + "d3-drag": "2 - 3", + "d3-interpolate": "1 - 3", + "d3-selection": "2 - 3", + "d3-transition": "2 - 3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/dagre-d3-es": { + "version": "7.0.14", + "resolved": "https://registry.npmjs.org/dagre-d3-es/-/dagre-d3-es-7.0.14.tgz", + "integrity": "sha512-P4rFMVq9ESWqmOgK+dlXvOtLwYg0i7u0HBGJER0LZDJT2VHIPAMZ/riPxqJceWMStH5+E61QxFra9kIS3AqdMg==", + "license": "MIT", + "dependencies": { + "d3": "^7.9.0", + "lodash-es": "^4.17.21" + } + }, + "node_modules/dayjs": { + "version": "1.11.21", + "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.21.tgz", + "integrity": "sha512-98IT+HOahAisibz/yjKbzuOBwYcjJ7BCLPzARyHiyEBmRz4fatF+KPJszEHXsGYjUG234aH/cOjW1wwTbKUZlA==", + "license": "MIT" + }, + "node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/decode-named-character-reference": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/decode-named-character-reference/-/decode-named-character-reference-1.3.0.tgz", + "integrity": "sha512-GtpQYB283KrPp6nRw50q3U9/VfOutZOe103qlN7BPP6Ad27xYnOIWv4lPzo8HCAL+mMZofJ9KEy30fq6MfaK6Q==", + "license": "MIT", + "dependencies": { + "character-entities": "^2.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/defu": { + "version": "6.1.7", + "resolved": "https://registry.npmjs.org/defu/-/defu-6.1.7.tgz", + "integrity": "sha512-7z22QmUWiQ/2d0KkdYmANbRUVABpZ9SNYyH5vx6PZ+nE5bcC0l7uFvEfHlyld/HcGBFTL536ClDt3DEcSlEJAQ==", + "license": "MIT" + }, + "node_modules/delaunator": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/delaunator/-/delaunator-5.1.0.tgz", + "integrity": "sha512-AGrQ4QSgssa1NGmWmLPqN5NY2KajF5MqxetNEO+o0n3ZwZZeTmt7bBnvzHWrmkZFxGgr4HdyFgelzgi06otLuQ==", + "license": "ISC", + "dependencies": { + "robust-predicates": "^3.0.2" + } + }, + "node_modules/dequal": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.3.tgz", + "integrity": "sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/destr": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/destr/-/destr-2.0.5.tgz", + "integrity": "sha512-ugFTXCtDZunbzasqBxrK93Ik/DRYsO6S/fedkWEMKqt04xZ4csmnmwGDBAb07QWNaGMAmnTIemsYZCksjATwsA==", + "license": "MIT" + }, + "node_modules/detect-libc": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz", + "integrity": "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==", + "license": "Apache-2.0", + "engines": { + "node": ">=8" + } + }, + "node_modules/deterministic-object-hash": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/deterministic-object-hash/-/deterministic-object-hash-2.0.2.tgz", + "integrity": "sha512-KxektNH63SrbfUyDiwXqRb1rLwKt33AmMv+5Nhsw1kqZ13SJBRTgZHtGbE+hH3a1mVW1cz+4pqSWVPAtLVXTzQ==", + "license": "MIT", + "dependencies": { + "base-64": "^1.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/devalue": { + "version": "5.8.1", + "resolved": "https://registry.npmjs.org/devalue/-/devalue-5.8.1.tgz", + "integrity": "sha512-4CXDYRBGqN+57wVJkuXBYmpAVUSg3L6JAQa/DFqm238G73E1wuyc/JhGQJzN7vUf/CMphYau2zXbfWzDR5aTEw==", + "license": "MIT" + }, + "node_modules/devlop": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/devlop/-/devlop-1.1.0.tgz", + "integrity": "sha512-RWmIqhcFf1lRYBvNmr7qTNuyCt/7/ns2jbpp1+PalgE/rDQcBT0fioSMUpJ93irlUhC5hrg4cYqe6U+0ImW0rA==", + "license": "MIT", + "dependencies": { + "dequal": "^2.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/diff": { + "version": "8.0.4", + "resolved": "https://registry.npmjs.org/diff/-/diff-8.0.4.tgz", + "integrity": "sha512-DPi0FmjiSU5EvQV0++GFDOJ9ASQUVFh5kD+OzOnYdi7n3Wpm9hWWGfB/O2blfHcMVTL5WkQXSnRiK9makhrcnw==", + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.3.1" + } + }, + "node_modules/direction": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/direction/-/direction-2.0.1.tgz", + "integrity": "sha512-9S6m9Sukh1cZNknO1CWAr2QAWsbKLafQiyM5gZ7VgXHeuaoUwffKN4q6NC4A/Mf9iiPlOXQEKW/Mv/mh9/3YFA==", + "license": "MIT", + "bin": { + "direction": "cli.js" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/dlv": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/dlv/-/dlv-1.1.3.tgz", + "integrity": "sha512-+HlytyjlPKnIG8XuRG8WvmBP8xs8P71y+SKKS6ZXWoEgLuePxtDoUEiH7WkdePWrQ5JBpE6aoVqfZfJUQkjXwA==", + "license": "MIT" + }, + "node_modules/dom-serializer": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-2.0.0.tgz", + "integrity": "sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==", + "license": "MIT", + "dependencies": { + "domelementtype": "^2.3.0", + "domhandler": "^5.0.2", + "entities": "^4.2.0" + }, + "funding": { + "url": "https://github.com/cheeriojs/dom-serializer?sponsor=1" + } + }, + "node_modules/dom-serializer/node_modules/entities": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", + "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", + "license": "BSD-2-Clause", + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, + "node_modules/domelementtype": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.3.0.tgz", + "integrity": "sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fb55" + } + ], + "license": "BSD-2-Clause" + }, + "node_modules/domhandler": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-5.0.3.tgz", + "integrity": "sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==", + "license": "BSD-2-Clause", + "dependencies": { + "domelementtype": "^2.3.0" + }, + "engines": { + "node": ">= 4" + }, + "funding": { + "url": "https://github.com/fb55/domhandler?sponsor=1" + } + }, + "node_modules/dompurify": { + "version": "3.4.8", + "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-3.4.8.tgz", + "integrity": "sha512-yb1cEmaOum7wFvOCSQxyfgVlv5D47Rc30iZWoMpbDIWTnJ6grDDQyu2KFJzB2k7u0pMuJcQ1zphH//fFnw2tjQ==", + "license": "(MPL-2.0 OR Apache-2.0)", + "optionalDependencies": { + "@types/trusted-types": "^2.0.7" + } + }, + "node_modules/domutils": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-3.2.2.tgz", + "integrity": "sha512-6kZKyUajlDuqlHKVX1w7gyslj9MPIXzIFiz/rGu35uC1wMi+kMhQwGhl4lt9unC9Vb9INnY9Z3/ZA3+FhASLaw==", + "license": "BSD-2-Clause", + "dependencies": { + "dom-serializer": "^2.0.0", + "domelementtype": "^2.3.0", + "domhandler": "^5.0.3" + }, + "funding": { + "url": "https://github.com/fb55/domutils?sponsor=1" + } + }, + "node_modules/dset": { + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/dset/-/dset-3.1.4.tgz", + "integrity": "sha512-2QF/g9/zTaPDc3BjNcVTGoBbXBgYfMTTceLaYcFJ/W9kggFUkhxD/hMEeuLKbugyef9SqAx8cpgwlIP/jinUTA==", + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/emoji-regex": { + "version": "10.6.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.6.0.tgz", + "integrity": "sha512-toUI84YS5YmxW219erniWD0CIVOo46xGKColeNQRgOzDorgBi1v4D71/OFzgD9GO2UGKIv1C3Sp8DAn0+j5w7A==", + "license": "MIT" + }, + "node_modules/entities": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/entities/-/entities-6.0.1.tgz", + "integrity": "sha512-aN97NXWF6AWBTahfVOIrB/NShkzi5H7F9r1s9mD3cDj4Ko5f2qhhVoYMibXF7GlLveb/D2ioWay8lxI97Ven3g==", + "license": "BSD-2-Clause", + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, + "node_modules/es-module-lexer": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.7.0.tgz", + "integrity": "sha512-jEQoCwk8hyb2AZziIOLhDqpm5+2ww5uIE6lkO/6jcOCusfk6LhMHpXXfBLXTZ7Ydyt0j4VoUQv6uGNYbdW+kBA==", + "license": "MIT" + }, + "node_modules/es-toolkit": { + "version": "1.47.0", + "resolved": "https://registry.npmjs.org/es-toolkit/-/es-toolkit-1.47.0.tgz", + "integrity": "sha512-n1GuoD0WEQZMBk5tttoZSqwgyLx01oqa5XsBmCHwPyNe1S9jPBEmtR2pSgp2kJuWE3ciFZ6yRHmY4pM4C3OOkw==", + "license": "MIT", + "workspaces": [ + "docs", + "benchmarks" + ] + }, + "node_modules/esast-util-from-estree": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/esast-util-from-estree/-/esast-util-from-estree-2.0.0.tgz", + "integrity": "sha512-4CyanoAudUSBAn5K13H4JhsMH6L9ZP7XbLVe/dKybkxMO7eDyLsT8UHl9TRNrU2Gr9nz+FovfSIjuXWJ81uVwQ==", + "license": "MIT", + "dependencies": { + "@types/estree-jsx": "^1.0.0", + "devlop": "^1.0.0", + "estree-util-visit": "^2.0.0", + "unist-util-position-from-estree": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/esast-util-from-js": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/esast-util-from-js/-/esast-util-from-js-2.0.1.tgz", + "integrity": "sha512-8Ja+rNJ0Lt56Pcf3TAmpBZjmx8ZcK5Ts4cAzIOjsjevg9oSXJnl6SUQ2EevU8tv3h6ZLWmoKL5H4fgWvdvfETw==", + "license": "MIT", + "dependencies": { + "@types/estree-jsx": "^1.0.0", + "acorn": "^8.0.0", + "esast-util-from-estree": "^2.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/esbuild": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.27.7.tgz", + "integrity": "sha512-IxpibTjyVnmrIQo5aqNpCgoACA/dTKLTlhMHihVHhdkxKyPO1uBBthumT0rdHmcsk9uMonIWS0m4FljWzILh3w==", + "hasInstallScript": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.27.7", + "@esbuild/android-arm": "0.27.7", + "@esbuild/android-arm64": "0.27.7", + "@esbuild/android-x64": "0.27.7", + "@esbuild/darwin-arm64": "0.27.7", + "@esbuild/darwin-x64": "0.27.7", + "@esbuild/freebsd-arm64": "0.27.7", + "@esbuild/freebsd-x64": "0.27.7", + "@esbuild/linux-arm": "0.27.7", + "@esbuild/linux-arm64": "0.27.7", + "@esbuild/linux-ia32": "0.27.7", + "@esbuild/linux-loong64": "0.27.7", + "@esbuild/linux-mips64el": "0.27.7", + "@esbuild/linux-ppc64": "0.27.7", + "@esbuild/linux-riscv64": "0.27.7", + "@esbuild/linux-s390x": "0.27.7", + "@esbuild/linux-x64": "0.27.7", + "@esbuild/netbsd-arm64": "0.27.7", + "@esbuild/netbsd-x64": "0.27.7", + "@esbuild/openbsd-arm64": "0.27.7", + "@esbuild/openbsd-x64": "0.27.7", + "@esbuild/openharmony-arm64": "0.27.7", + "@esbuild/sunos-x64": "0.27.7", + "@esbuild/win32-arm64": "0.27.7", + "@esbuild/win32-ia32": "0.27.7", + "@esbuild/win32-x64": "0.27.7" + } + }, + "node_modules/escape-string-regexp": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", + "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==", + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/estree-util-attach-comments": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/estree-util-attach-comments/-/estree-util-attach-comments-3.0.0.tgz", + "integrity": "sha512-cKUwm/HUcTDsYh/9FgnuFqpfquUbwIqwKM26BVCGDPVgvaCl/nDCCjUfiLlx6lsEZ3Z4RFxNbOQ60pkaEwFxGw==", + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/estree-util-build-jsx": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/estree-util-build-jsx/-/estree-util-build-jsx-3.0.1.tgz", + "integrity": "sha512-8U5eiL6BTrPxp/CHbs2yMgP8ftMhR5ww1eIKoWRMlqvltHF8fZn5LRDvTKuxD3DUn+shRbLGqXemcP51oFCsGQ==", + "license": "MIT", + "dependencies": { + "@types/estree-jsx": "^1.0.0", + "devlop": "^1.0.0", + "estree-util-is-identifier-name": "^3.0.0", + "estree-walker": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/estree-util-is-identifier-name": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/estree-util-is-identifier-name/-/estree-util-is-identifier-name-3.0.0.tgz", + "integrity": "sha512-hFtqIDZTIUZ9BXLb8y4pYGyk6+wekIivNVTcmvk8NoOh+VeRn5y6cEHzbURrWbfp1fIqdVipilzj+lfaadNZmg==", + "license": "MIT", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/estree-util-scope": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/estree-util-scope/-/estree-util-scope-1.0.0.tgz", + "integrity": "sha512-2CAASclonf+JFWBNJPndcOpA8EMJwa0Q8LUFJEKqXLW6+qBvbFZuF5gItbQOs/umBUkjviCSDCbBwU2cXbmrhQ==", + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.0", + "devlop": "^1.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/estree-util-to-js": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/estree-util-to-js/-/estree-util-to-js-2.0.0.tgz", + "integrity": "sha512-WDF+xj5rRWmD5tj6bIqRi6CkLIXbbNQUcxQHzGysQzvHmdYG2G7p/Tf0J0gpxGgkeMZNTIjT/AoSvC9Xehcgdg==", + "license": "MIT", + "dependencies": { + "@types/estree-jsx": "^1.0.0", + "astring": "^1.8.0", + "source-map": "^0.7.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/estree-util-visit": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/estree-util-visit/-/estree-util-visit-2.0.0.tgz", + "integrity": "sha512-m5KgiH85xAhhW8Wta0vShLcUvOsh3LLPI2YVwcbio1l7E09NTLL1EyMZFM1OyWowoH0skScNbhOPl4kcBgzTww==", + "license": "MIT", + "dependencies": { + "@types/estree-jsx": "^1.0.0", + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/estree-walker": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz", + "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==", + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.0" + } + }, + "node_modules/eventemitter3": { + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.4.tgz", + "integrity": "sha512-mlsTRyGaPBjPedk6Bvw+aqbsXDtoAyAzm5MO7JgU+yVRyMQ5O8bD4Kcci7BS85f93veegeCPkL8R4GLClnjLFw==", + "license": "MIT" + }, + "node_modules/expressive-code": { + "version": "0.41.7", + "resolved": "https://registry.npmjs.org/expressive-code/-/expressive-code-0.41.7.tgz", + "integrity": "sha512-2wZjC8OQ3TaVEMcBtYY4Va3lo6J+Ai9jf3d4dbhURMJcU4Pbqe6EcHe424MIZI0VHUA1bR6xdpoHYi3yxokWqA==", + "license": "MIT", + "dependencies": { + "@expressive-code/core": "^0.41.7", + "@expressive-code/plugin-frames": "^0.41.7", + "@expressive-code/plugin-shiki": "^0.41.7", + "@expressive-code/plugin-text-markers": "^0.41.7" + } + }, + "node_modules/expressive-code/node_modules/@expressive-code/core": { + "version": "0.41.7", + "resolved": "https://registry.npmjs.org/@expressive-code/core/-/core-0.41.7.tgz", + "integrity": "sha512-ck92uZYZ9Wba2zxkiZLsZGi9N54pMSAVdrI9uW3Oo9AtLglD5RmrdTwbYPCT2S/jC36JGB2i+pnQtBm/Ib2+dg==", + "license": "MIT", + "dependencies": { + "@ctrl/tinycolor": "^4.0.4", + "hast-util-select": "^6.0.2", + "hast-util-to-html": "^9.0.1", + "hast-util-to-text": "^4.0.1", + "hastscript": "^9.0.0", + "postcss": "^8.4.38", + "postcss-nested": "^6.0.1", + "unist-util-visit": "^5.0.0", + "unist-util-visit-parents": "^6.0.1" + } + }, + "node_modules/extend": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", + "license": "MIT" + }, + "node_modules/fdir": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz", + "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==", + "license": "MIT", + "engines": { + "node": ">=12.0.0" + }, + "peerDependencies": { + "picomatch": "^3 || ^4" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } + } + }, + "node_modules/flattie": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/flattie/-/flattie-1.1.1.tgz", + "integrity": "sha512-9UbaD6XdAL97+k/n+N7JwX46K/M6Zc6KcFYskrYL8wbBV/Uyk0CTAMY0VT+qiK5PM7AIc9aTWYtq65U7T+aCNQ==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/fontace": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/fontace/-/fontace-0.4.1.tgz", + "integrity": "sha512-lDMvbAzSnHmbYMTEld5qdtvNH2/pWpICOqpean9IgC7vUbUJc3k+k5Dokp85CegamqQpFbXf0rAVkbzpyTA8aw==", + "license": "MIT", + "dependencies": { + "fontkitten": "^1.0.2" + } + }, + "node_modules/fontkitten": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/fontkitten/-/fontkitten-1.0.3.tgz", + "integrity": "sha512-Wp1zXWPVUPBmfoa3Cqc9ctaKuzKAV6uLstRqlR56kSjplf5uAce+qeyYym7F+PHbGTk+tCEdkCW6RD7DX/gBZw==", + "license": "MIT", + "dependencies": { + "tiny-inflate": "^1.0.3" + }, + "engines": { + "node": ">=20" + } + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/get-east-asian-width": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/get-east-asian-width/-/get-east-asian-width-1.6.0.tgz", + "integrity": "sha512-QRbvDIbx6YklUe6RxeTeleMR0yv3cYH6PsPZHcnVn7xv7zO1BHN8r0XETu8n6Ye3Q+ahtSarc3WgtNWmehIBfA==", + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/github-slugger": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/github-slugger/-/github-slugger-2.0.0.tgz", + "integrity": "sha512-IaOQ9puYtjrkq7Y0Ygl9KDZnrf/aiUJYUpVf89y8kyaxbRG7Y1SrX/jaumrv81vc61+kiMempujsM3Yw7w5qcw==", + "license": "ISC" + }, + "node_modules/h3": { + "version": "1.15.11", + "resolved": "https://registry.npmjs.org/h3/-/h3-1.15.11.tgz", + "integrity": "sha512-L3THSe2MPeBwgIZVSH5zLdBBU90TOxarvhK9d04IDY2AmVS8j2Jz2LIWtwsGOU3lu2I5jCN7FNvVfY2+XyF+mg==", + "license": "MIT", + "dependencies": { + "cookie-es": "^1.2.3", + "crossws": "^0.3.5", + "defu": "^6.1.6", + "destr": "^2.0.5", + "iron-webcrypto": "^1.2.1", + "node-mock-http": "^1.0.4", + "radix3": "^1.1.2", + "ufo": "^1.6.3", + "uncrypto": "^0.1.3" + } + }, + "node_modules/hachure-fill": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/hachure-fill/-/hachure-fill-0.5.2.tgz", + "integrity": "sha512-3GKBOn+m2LX9iq+JC1064cSFprJY4jL1jCXTcpnfER5HYE2l/4EfWSGzkPa/ZDBmYI0ZOEj5VHV/eKnPGkHuOg==", + "license": "MIT" + }, + "node_modules/hast-util-embedded": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/hast-util-embedded/-/hast-util-embedded-3.0.0.tgz", + "integrity": "sha512-naH8sld4Pe2ep03qqULEtvYr7EjrLK2QHY8KJR6RJkTUjPGObe1vnx585uzem2hGra+s1q08DZZpfgDVYRbaXA==", + "license": "MIT", + "dependencies": { + "@types/hast": "^3.0.0", + "hast-util-is-element": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/hast-util-format": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/hast-util-format/-/hast-util-format-1.1.0.tgz", + "integrity": "sha512-yY1UDz6bC9rDvCWHpx12aIBGRG7krurX0p0Fm6pT547LwDIZZiNr8a+IHDogorAdreULSEzP82Nlv5SZkHZcjA==", + "license": "MIT", + "dependencies": { + "@types/hast": "^3.0.0", + "hast-util-embedded": "^3.0.0", + "hast-util-minify-whitespace": "^1.0.0", + "hast-util-phrasing": "^3.0.0", + "hast-util-whitespace": "^3.0.0", + "html-whitespace-sensitive-tag-names": "^3.0.0", + "unist-util-visit-parents": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/hast-util-from-html": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/hast-util-from-html/-/hast-util-from-html-2.0.3.tgz", + "integrity": "sha512-CUSRHXyKjzHov8yKsQjGOElXy/3EKpyX56ELnkHH34vDVw1N1XSQ1ZcAvTyAPtGqLTuKP/uxM+aLkSPqF/EtMw==", + "license": "MIT", + "dependencies": { + "@types/hast": "^3.0.0", + "devlop": "^1.1.0", + "hast-util-from-parse5": "^8.0.0", + "parse5": "^7.0.0", + "vfile": "^6.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/hast-util-from-parse5": { + "version": "8.0.3", + "resolved": "https://registry.npmjs.org/hast-util-from-parse5/-/hast-util-from-parse5-8.0.3.tgz", + "integrity": "sha512-3kxEVkEKt0zvcZ3hCRYI8rqrgwtlIOFMWkbclACvjlDw8Li9S2hk/d51OI0nr/gIpdMHNepwgOKqZ/sy0Clpyg==", + "license": "MIT", + "dependencies": { + "@types/hast": "^3.0.0", + "@types/unist": "^3.0.0", + "devlop": "^1.0.0", + "hastscript": "^9.0.0", + "property-information": "^7.0.0", + "vfile": "^6.0.0", + "vfile-location": "^5.0.0", + "web-namespaces": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/hast-util-has-property": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/hast-util-has-property/-/hast-util-has-property-3.0.0.tgz", + "integrity": "sha512-MNilsvEKLFpV604hwfhVStK0usFY/QmM5zX16bo7EjnAEGofr5YyI37kzopBlZJkHD4t887i+q/C8/tr5Q94cA==", + "license": "MIT", + "dependencies": { + "@types/hast": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/hast-util-is-body-ok-link": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/hast-util-is-body-ok-link/-/hast-util-is-body-ok-link-3.0.1.tgz", + "integrity": "sha512-0qpnzOBLztXHbHQenVB8uNuxTnm/QBFUOmdOSsEn7GnBtyY07+ENTWVFBAnXd/zEgd9/SUG3lRY7hSIBWRgGpQ==", + "license": "MIT", + "dependencies": { + "@types/hast": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/hast-util-is-element": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/hast-util-is-element/-/hast-util-is-element-3.0.0.tgz", + "integrity": "sha512-Val9mnv2IWpLbNPqc/pUem+a7Ipj2aHacCwgNfTiK0vJKl0LF+4Ba4+v1oPHFpf3bLYmreq0/l3Gud9S5OH42g==", + "license": "MIT", + "dependencies": { + "@types/hast": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/hast-util-minify-whitespace": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/hast-util-minify-whitespace/-/hast-util-minify-whitespace-1.0.1.tgz", + "integrity": "sha512-L96fPOVpnclQE0xzdWb/D12VT5FabA7SnZOUMtL1DbXmYiHJMXZvFkIZfiMmTCNJHUeO2K9UYNXoVyfz+QHuOw==", + "license": "MIT", + "dependencies": { + "@types/hast": "^3.0.0", + "hast-util-embedded": "^3.0.0", + "hast-util-is-element": "^3.0.0", + "hast-util-whitespace": "^3.0.0", + "unist-util-is": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/hast-util-parse-selector": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/hast-util-parse-selector/-/hast-util-parse-selector-4.0.0.tgz", + "integrity": "sha512-wkQCkSYoOGCRKERFWcxMVMOcYE2K1AaNLU8DXS9arxnLOUEWbOXKXiJUNzEpqZ3JOKpnha3jkFrumEjVliDe7A==", + "license": "MIT", + "dependencies": { + "@types/hast": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/hast-util-phrasing": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/hast-util-phrasing/-/hast-util-phrasing-3.0.1.tgz", + "integrity": "sha512-6h60VfI3uBQUxHqTyMymMZnEbNl1XmEGtOxxKYL7stY2o601COo62AWAYBQR9lZbYXYSBoxag8UpPRXK+9fqSQ==", + "license": "MIT", + "dependencies": { + "@types/hast": "^3.0.0", + "hast-util-embedded": "^3.0.0", + "hast-util-has-property": "^3.0.0", + "hast-util-is-body-ok-link": "^3.0.0", + "hast-util-is-element": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/hast-util-raw": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/hast-util-raw/-/hast-util-raw-9.1.0.tgz", + "integrity": "sha512-Y8/SBAHkZGoNkpzqqfCldijcuUKh7/su31kEBp67cFY09Wy0mTRgtsLYsiIxMJxlu0f6AA5SUTbDR8K0rxnbUw==", + "license": "MIT", + "dependencies": { + "@types/hast": "^3.0.0", + "@types/unist": "^3.0.0", + "@ungap/structured-clone": "^1.0.0", + "hast-util-from-parse5": "^8.0.0", + "hast-util-to-parse5": "^8.0.0", + "html-void-elements": "^3.0.0", + "mdast-util-to-hast": "^13.0.0", + "parse5": "^7.0.0", + "unist-util-position": "^5.0.0", + "unist-util-visit": "^5.0.0", + "vfile": "^6.0.0", + "web-namespaces": "^2.0.0", + "zwitch": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/hast-util-select": { + "version": "6.0.4", + "resolved": "https://registry.npmjs.org/hast-util-select/-/hast-util-select-6.0.4.tgz", + "integrity": "sha512-RqGS1ZgI0MwxLaKLDxjprynNzINEkRHY2i8ln4DDjgv9ZhcYVIHN9rlpiYsqtFwrgpYU361SyWDQcGNIBVu3lw==", + "license": "MIT", + "dependencies": { + "@types/hast": "^3.0.0", + "@types/unist": "^3.0.0", + "bcp-47-match": "^2.0.0", + "comma-separated-tokens": "^2.0.0", + "css-selector-parser": "^3.0.0", + "devlop": "^1.0.0", + "direction": "^2.0.0", + "hast-util-has-property": "^3.0.0", + "hast-util-to-string": "^3.0.0", + "hast-util-whitespace": "^3.0.0", + "nth-check": "^2.0.0", + "property-information": "^7.0.0", + "space-separated-tokens": "^2.0.0", + "unist-util-visit": "^5.0.0", + "zwitch": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/hast-util-to-estree": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/hast-util-to-estree/-/hast-util-to-estree-3.1.3.tgz", + "integrity": "sha512-48+B/rJWAp0jamNbAAf9M7Uf//UVqAoMmgXhBdxTDJLGKY+LRnZ99qcG+Qjl5HfMpYNzS5v4EAwVEF34LeAj7w==", + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.0", + "@types/estree-jsx": "^1.0.0", + "@types/hast": "^3.0.0", + "comma-separated-tokens": "^2.0.0", + "devlop": "^1.0.0", + "estree-util-attach-comments": "^3.0.0", + "estree-util-is-identifier-name": "^3.0.0", + "hast-util-whitespace": "^3.0.0", + "mdast-util-mdx-expression": "^2.0.0", + "mdast-util-mdx-jsx": "^3.0.0", + "mdast-util-mdxjs-esm": "^2.0.0", + "property-information": "^7.0.0", + "space-separated-tokens": "^2.0.0", + "style-to-js": "^1.0.0", + "unist-util-position": "^5.0.0", + "zwitch": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/hast-util-to-html": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/hast-util-to-html/-/hast-util-to-html-9.0.5.tgz", + "integrity": "sha512-OguPdidb+fbHQSU4Q4ZiLKnzWo8Wwsf5bZfbvu7//a9oTYoqD/fWpe96NuHkoS9h0ccGOTe0C4NGXdtS0iObOw==", + "license": "MIT", + "dependencies": { + "@types/hast": "^3.0.0", + "@types/unist": "^3.0.0", + "ccount": "^2.0.0", + "comma-separated-tokens": "^2.0.0", + "hast-util-whitespace": "^3.0.0", + "html-void-elements": "^3.0.0", + "mdast-util-to-hast": "^13.0.0", + "property-information": "^7.0.0", + "space-separated-tokens": "^2.0.0", + "stringify-entities": "^4.0.0", + "zwitch": "^2.0.4" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/hast-util-to-jsx-runtime": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/hast-util-to-jsx-runtime/-/hast-util-to-jsx-runtime-2.3.6.tgz", + "integrity": "sha512-zl6s8LwNyo1P9uw+XJGvZtdFF1GdAkOg8ujOw+4Pyb76874fLps4ueHXDhXWdk6YHQ6OgUtinliG7RsYvCbbBg==", + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.0", + "@types/hast": "^3.0.0", + "@types/unist": "^3.0.0", + "comma-separated-tokens": "^2.0.0", + "devlop": "^1.0.0", + "estree-util-is-identifier-name": "^3.0.0", + "hast-util-whitespace": "^3.0.0", + "mdast-util-mdx-expression": "^2.0.0", + "mdast-util-mdx-jsx": "^3.0.0", + "mdast-util-mdxjs-esm": "^2.0.0", + "property-information": "^7.0.0", + "space-separated-tokens": "^2.0.0", + "style-to-js": "^1.0.0", + "unist-util-position": "^5.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/hast-util-to-parse5": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/hast-util-to-parse5/-/hast-util-to-parse5-8.0.1.tgz", + "integrity": "sha512-MlWT6Pjt4CG9lFCjiz4BH7l9wmrMkfkJYCxFwKQic8+RTZgWPuWxwAfjJElsXkex7DJjfSJsQIt931ilUgmwdA==", + "license": "MIT", + "dependencies": { + "@types/hast": "^3.0.0", + "comma-separated-tokens": "^2.0.0", + "devlop": "^1.0.0", + "property-information": "^7.0.0", + "space-separated-tokens": "^2.0.0", + "web-namespaces": "^2.0.0", + "zwitch": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/hast-util-to-string": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/hast-util-to-string/-/hast-util-to-string-3.0.1.tgz", + "integrity": "sha512-XelQVTDWvqcl3axRfI0xSeoVKzyIFPwsAGSLIsKdJKQMXDYJS4WYrBNF/8J7RdhIcFI2BOHgAifggsvsxp/3+A==", + "license": "MIT", + "dependencies": { + "@types/hast": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/hast-util-to-text": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/hast-util-to-text/-/hast-util-to-text-4.0.2.tgz", + "integrity": "sha512-KK6y/BN8lbaq654j7JgBydev7wuNMcID54lkRav1P0CaE1e47P72AWWPiGKXTJU271ooYzcvTAn/Zt0REnvc7A==", + "license": "MIT", + "dependencies": { + "@types/hast": "^3.0.0", + "@types/unist": "^3.0.0", + "hast-util-is-element": "^3.0.0", + "unist-util-find-after": "^5.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/hast-util-whitespace": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/hast-util-whitespace/-/hast-util-whitespace-3.0.0.tgz", + "integrity": "sha512-88JUN06ipLwsnv+dVn+OIYOvAuvBMy/Qoi6O7mQHxdPXpjy+Cd6xRkWwux7DKO+4sYILtLBRIKgsdpS2gQc7qw==", + "license": "MIT", + "dependencies": { + "@types/hast": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/hastscript": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/hastscript/-/hastscript-9.0.1.tgz", + "integrity": "sha512-g7df9rMFX/SPi34tyGCyUBREQoKkapwdY/T04Qn9TDWfHhAYt4/I0gMVirzK5wEzeUqIjEB+LXC/ypb7Aqno5w==", + "license": "MIT", + "dependencies": { + "@types/hast": "^3.0.0", + "comma-separated-tokens": "^2.0.0", + "hast-util-parse-selector": "^4.0.0", + "property-information": "^7.0.0", + "space-separated-tokens": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/html-escaper": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-3.0.3.tgz", + "integrity": "sha512-RuMffC89BOWQoY0WKGpIhn5gX3iI54O6nRA0yC124NYVtzjmFWBIiFd8M0x+ZdX0P9R4lADg1mgP8C7PxGOWuQ==", + "license": "MIT" + }, + "node_modules/html-void-elements": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/html-void-elements/-/html-void-elements-3.0.0.tgz", + "integrity": "sha512-bEqo66MRXsUGxWHV5IP0PUiAWwoEjba4VCzg0LjFJBpchPaTfyfCKTG6bc5F8ucKec3q5y6qOdGyYTSBEvhCrg==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/html-whitespace-sensitive-tag-names": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/html-whitespace-sensitive-tag-names/-/html-whitespace-sensitive-tag-names-3.0.1.tgz", + "integrity": "sha512-q+310vW8zmymYHALr1da4HyXUQ0zgiIwIicEfotYPWGN0OJVEN/58IJ3A4GBYcEq3LGAZqKb+ugvP0GNB9CEAA==", + "license": "MIT", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/http-cache-semantics": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.2.0.tgz", + "integrity": "sha512-dTxcvPXqPvXBQpq5dUr6mEMJX4oIEFv6bwom3FDwKRDsuIjjJGANqhBuoAn9c1RQJIdAKav33ED65E2ys+87QQ==", + "license": "BSD-2-Clause" + }, + "node_modules/i18next": { + "version": "23.16.8", + "resolved": "https://registry.npmjs.org/i18next/-/i18next-23.16.8.tgz", + "integrity": "sha512-06r/TitrM88Mg5FdUXAKL96dJMzgqLE5dv3ryBAra4KCwD9mJ4ndOTS95ZuymIGoE+2hzfdaMak2X11/es7ZWg==", + "funding": [ + { + "type": "individual", + "url": "https://locize.com" + }, + { + "type": "individual", + "url": "https://locize.com/i18next.html" + }, + { + "type": "individual", + "url": "https://www.i18next.com/how-to/faq#i18next-is-awesome.-how-can-i-support-the-project" + } + ], + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.23.2" + } + }, + "node_modules/iconv-lite": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "license": "MIT", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/import-meta-resolve": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/import-meta-resolve/-/import-meta-resolve-4.2.0.tgz", + "integrity": "sha512-Iqv2fzaTQN28s/FwZAoFq0ZSs/7hMAHJVX+w8PZl3cY19Pxk6jFFalxQoIfW2826i/fDLXv8IiEZRIT0lDuWcg==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/inline-style-parser": { + "version": "0.2.7", + "resolved": "https://registry.npmjs.org/inline-style-parser/-/inline-style-parser-0.2.7.tgz", + "integrity": "sha512-Nb2ctOyNR8DqQoR0OwRG95uNWIC0C1lCgf5Naz5H6Ji72KZ8OcFZLz2P5sNgwlyoJ8Yif11oMuYs5pBQa86csA==", + "license": "MIT" + }, + "node_modules/internmap": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/internmap/-/internmap-2.0.3.tgz", + "integrity": "sha512-5Hh7Y1wQbvY5ooGgPbDaL5iYLAPzMTUrjMulskHLH6wnv/A+1q5rgEaiuqEjB+oxGXIVZs1FF+R/KPN3ZSQYYg==", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/iron-webcrypto": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/iron-webcrypto/-/iron-webcrypto-1.2.1.tgz", + "integrity": "sha512-feOM6FaSr6rEABp/eDfVseKyTMDt+KGpeB35SkVn9Tyn0CqvVsY3EwI0v5i8nMHyJnzCIQf7nsy3p41TPkJZhg==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/brc-dd" + } + }, + "node_modules/is-alphabetical": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-alphabetical/-/is-alphabetical-2.0.1.tgz", + "integrity": "sha512-FWyyY60MeTNyeSRpkM2Iry0G9hpr7/9kD40mD/cGQEuilcZYS4okz8SN2Q6rLCJ8gbCt6fN+rC+6tMGS99LaxQ==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/is-alphanumerical": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-alphanumerical/-/is-alphanumerical-2.0.1.tgz", + "integrity": "sha512-hmbYhX/9MUMF5uh7tOXyK/n0ZvWpad5caBA17GsC6vyuCqaWliRG5K1qS9inmUhEMaOBIW7/whAnSwveW/LtZw==", + "license": "MIT", + "dependencies": { + "is-alphabetical": "^2.0.0", + "is-decimal": "^2.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/is-decimal": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-decimal/-/is-decimal-2.0.1.tgz", + "integrity": "sha512-AAB9hiomQs5DXWcRB1rqsxGUstbRroFOPPVAomNk/3XHR5JyEZChOyTWe2oayKnsSsr/kcGqF+z6yuH6HHpN0A==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/is-docker": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-3.0.0.tgz", + "integrity": "sha512-eljcgEDlEns/7AXFosB5K/2nCM4P7FQPkGc/DWLy5rmFEWvZayGrik1d9/QIY5nJ4f9YsVvBkA6kJpHn9rISdQ==", + "license": "MIT", + "bin": { + "is-docker": "cli.js" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-hexadecimal": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-hexadecimal/-/is-hexadecimal-2.0.1.tgz", + "integrity": "sha512-DgZQp241c8oO6cA1SbTEWiXeoxV42vlcJxgH+B3hi1AiqqKruZR3ZGF8In3fj4+/y/7rHvlOZLZtgJ/4ttYGZg==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/is-inside-container": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-inside-container/-/is-inside-container-1.0.0.tgz", + "integrity": "sha512-KIYLCCJghfHZxqjYBE7rEy0OBuTd5xCHS7tHVgvCLkx7StIoaxwNW3hCALgEUjFfeRk+MG/Qxmp/vtETEF3tRA==", + "license": "MIT", + "dependencies": { + "is-docker": "^3.0.0" + }, + "bin": { + "is-inside-container": "cli.js" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-plain-obj": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.1.0.tgz", + "integrity": "sha512-+Pgi+vMuUNkJyExiMBt5IlFoMyKnr5zhJ4Uspz58WOhBF5QoIZkFyNHIbBAtHwzVAgk5RtndVNsDRN61/mmDqg==", + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-wsl": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-3.1.1.tgz", + "integrity": "sha512-e6rvdUCiQCAuumZslxRJWR/Doq4VpPR82kqclvcS0efgt430SlGIk05vdCN58+VrzgtIcfNODjozVielycD4Sw==", + "license": "MIT", + "dependencies": { + "is-inside-container": "^1.0.0" + }, + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/js-yaml": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.2.0.tgz", + "integrity": "sha512-ePWsvanv0DWuDRsW8dnt+R4jQ31SCRCQ7hhNcPXZPsoBZiemuZNYGf7adZdqX2D86j6rvKp3RpCxVTSb8WQlOw==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/puzrin" + }, + { + "type": "github", + "url": "https://github.com/sponsors/nodeca" + } + ], + "license": "MIT", + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/katex": { + "version": "0.16.47", + "resolved": "https://registry.npmjs.org/katex/-/katex-0.16.47.tgz", + "integrity": "sha512-Eeo8Ys1doU1z+x8AZsPpQu+p/QcZBI5PeOo7QGQdy2x2m0MU/hYagBbGOmXwr5KVbEfVuWv9LpnQWeehogurjg==", + "funding": [ + "https://opencollective.com/katex", + "https://github.com/sponsors/katex" + ], + "license": "MIT", + "dependencies": { + "commander": "^8.3.0" + }, + "bin": { + "katex": "cli.js" + } + }, + "node_modules/katex/node_modules/commander": { + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-8.3.0.tgz", + "integrity": "sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww==", + "license": "MIT", + "engines": { + "node": ">= 12" + } + }, + "node_modules/khroma": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/khroma/-/khroma-2.1.0.tgz", + "integrity": "sha512-Ls993zuzfayK269Svk9hzpeGUKob/sIgZzyHYdjQoAdQetRKpOLj+k/QQQ/6Qi0Yz65mlROrfd+Ev+1+7dz9Kw==" + }, + "node_modules/kleur": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", + "integrity": "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/klona": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/klona/-/klona-2.0.6.tgz", + "integrity": "sha512-dhG34DXATL5hSxJbIexCft8FChFXtmskoZYnoPWjXQuebWYCNkVeV3KkGegCK9CP1oswI/vQibS2GY7Em/sJJA==", + "license": "MIT", + "engines": { + "node": ">= 8" + } + }, + "node_modules/layout-base": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/layout-base/-/layout-base-1.0.2.tgz", + "integrity": "sha512-8h2oVEZNktL4BH2JCOI90iD1yXwL6iNW7KcCKT2QZgQJR2vbqDsldCTPRU9NifTCqHZci57XvQQ15YTu+sTYPg==", + "license": "MIT" + }, + "node_modules/lodash-es": { + "version": "4.18.1", + "resolved": "https://registry.npmjs.org/lodash-es/-/lodash-es-4.18.1.tgz", + "integrity": "sha512-J8xewKD/Gk22OZbhpOVSwcs60zhd95ESDwezOFuA3/099925PdHJ7OFHNTGtajL3AlZkykD32HykiMo+BIBI8A==", + "license": "MIT" + }, + "node_modules/longest-streak": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/longest-streak/-/longest-streak-3.1.0.tgz", + "integrity": "sha512-9Ri+o0JYgehTaVBBDoMqIl8GXtbWg711O3srftcHhZ0dqnETqLaoIK0x17fUw9rFSlK/0NlsKe0Ahhyl5pXE2g==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/lru-cache": { + "version": "11.5.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.5.1.tgz", + "integrity": "sha512-RPimw/7aMdv2oqRrxKwvZXcPfwBrn/JZ2xYcY9Hus/6LaS3VOAKVWKWgNLCFSiOm1ESXinjsDlidVU7JlnCN2A==", + "license": "BlueOak-1.0.0", + "engines": { + "node": "20 || >=22" + } + }, + "node_modules/magic-string": { + "version": "0.30.21", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.21.tgz", + "integrity": "sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==", + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.5" + } + }, + "node_modules/magicast": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/magicast/-/magicast-0.5.3.tgz", + "integrity": "sha512-pVKE4UdSQ7DvHzivsCIFx2BJn1mHG6KsyrFcaxFx6tONdneEuThrDx0Cj3AMg58KyN4pzYT+LHOotxDQDjNvkw==", + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.29.3", + "@babel/types": "^7.29.0", + "source-map-js": "^1.2.1" + } + }, + "node_modules/markdown-extensions": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/markdown-extensions/-/markdown-extensions-2.0.0.tgz", + "integrity": "sha512-o5vL7aDWatOTX8LzaS1WMoaoxIiLRQJuIKKe2wAw6IeULDHaqbiqiggmx+pKvZDb1Sj+pE46Sn1T7lCqfFtg1Q==", + "license": "MIT", + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/markdown-table": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/markdown-table/-/markdown-table-3.0.4.tgz", + "integrity": "sha512-wiYz4+JrLyb/DqW2hkFJxP7Vd7JuTDm77fvbM8VfEQdmSMqcImWeeRbHwZjBjIFki/VaMK2BhFi7oUUZeM5bqw==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/marked": { + "version": "16.4.2", + "resolved": "https://registry.npmjs.org/marked/-/marked-16.4.2.tgz", + "integrity": "sha512-TI3V8YYWvkVf3KJe1dRkpnjs68JUPyEa5vjKrp1XEEJUAOaQc+Qj+L1qWbPd0SJuAdQkFU0h73sXXqwDYxsiDA==", + "license": "MIT", + "bin": { + "marked": "bin/marked.js" + }, + "engines": { + "node": ">= 20" + } + }, + "node_modules/mdast-util-definitions": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/mdast-util-definitions/-/mdast-util-definitions-6.0.0.tgz", + "integrity": "sha512-scTllyX6pnYNZH/AIp/0ePz6s4cZtARxImwoPJ7kS42n+MnVsI4XbnG6d4ibehRIldYMWM2LD7ImQblVhUejVQ==", + "license": "MIT", + "dependencies": { + "@types/mdast": "^4.0.0", + "@types/unist": "^3.0.0", + "unist-util-visit": "^5.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-directive": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/mdast-util-directive/-/mdast-util-directive-3.1.0.tgz", + "integrity": "sha512-I3fNFt+DHmpWCYAT7quoM6lHf9wuqtI+oCOfvILnoicNIqjh5E3dEJWiXuYME2gNe8vl1iMQwyUHa7bgFmak6Q==", + "license": "MIT", + "dependencies": { + "@types/mdast": "^4.0.0", + "@types/unist": "^3.0.0", + "ccount": "^2.0.0", + "devlop": "^1.0.0", + "mdast-util-from-markdown": "^2.0.0", + "mdast-util-to-markdown": "^2.0.0", + "parse-entities": "^4.0.0", + "stringify-entities": "^4.0.0", + "unist-util-visit-parents": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-find-and-replace": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/mdast-util-find-and-replace/-/mdast-util-find-and-replace-3.0.2.tgz", + "integrity": "sha512-Tmd1Vg/m3Xz43afeNxDIhWRtFZgM2VLyaf4vSTYwudTyeuTneoL3qtWMA5jeLyz/O1vDJmmV4QuScFCA2tBPwg==", + "license": "MIT", + "dependencies": { + "@types/mdast": "^4.0.0", + "escape-string-regexp": "^5.0.0", + "unist-util-is": "^6.0.0", + "unist-util-visit-parents": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-from-markdown": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/mdast-util-from-markdown/-/mdast-util-from-markdown-2.0.3.tgz", + "integrity": "sha512-W4mAWTvSlKvf8L6J+VN9yLSqQ9AOAAvHuoDAmPkz4dHf553m5gVj2ejadHJhoJmcmxEnOv6Pa8XJhpxE93kb8Q==", + "license": "MIT", + "dependencies": { + "@types/mdast": "^4.0.0", + "@types/unist": "^3.0.0", + "decode-named-character-reference": "^1.0.0", + "devlop": "^1.0.0", + "mdast-util-to-string": "^4.0.0", + "micromark": "^4.0.0", + "micromark-util-decode-numeric-character-reference": "^2.0.0", + "micromark-util-decode-string": "^2.0.0", + "micromark-util-normalize-identifier": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0", + "unist-util-stringify-position": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-gfm": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/mdast-util-gfm/-/mdast-util-gfm-3.1.0.tgz", + "integrity": "sha512-0ulfdQOM3ysHhCJ1p06l0b0VKlhU0wuQs3thxZQagjcjPrlFRqY215uZGHHJan9GEAXd9MbfPjFJz+qMkVR6zQ==", + "license": "MIT", + "dependencies": { + "mdast-util-from-markdown": "^2.0.0", + "mdast-util-gfm-autolink-literal": "^2.0.0", + "mdast-util-gfm-footnote": "^2.0.0", + "mdast-util-gfm-strikethrough": "^2.0.0", + "mdast-util-gfm-table": "^2.0.0", + "mdast-util-gfm-task-list-item": "^2.0.0", + "mdast-util-to-markdown": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-gfm-autolink-literal": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/mdast-util-gfm-autolink-literal/-/mdast-util-gfm-autolink-literal-2.0.1.tgz", + "integrity": "sha512-5HVP2MKaP6L+G6YaxPNjuL0BPrq9orG3TsrZ9YXbA3vDw/ACI4MEsnoDpn6ZNm7GnZgtAcONJyPhOP8tNJQavQ==", + "license": "MIT", + "dependencies": { + "@types/mdast": "^4.0.0", + "ccount": "^2.0.0", + "devlop": "^1.0.0", + "mdast-util-find-and-replace": "^3.0.0", + "micromark-util-character": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-gfm-footnote": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mdast-util-gfm-footnote/-/mdast-util-gfm-footnote-2.1.0.tgz", + "integrity": "sha512-sqpDWlsHn7Ac9GNZQMeUzPQSMzR6Wv0WKRNvQRg0KqHh02fpTz69Qc1QSseNX29bhz1ROIyNyxExfawVKTm1GQ==", + "license": "MIT", + "dependencies": { + "@types/mdast": "^4.0.0", + "devlop": "^1.1.0", + "mdast-util-from-markdown": "^2.0.0", + "mdast-util-to-markdown": "^2.0.0", + "micromark-util-normalize-identifier": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-gfm-strikethrough": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/mdast-util-gfm-strikethrough/-/mdast-util-gfm-strikethrough-2.0.0.tgz", + "integrity": "sha512-mKKb915TF+OC5ptj5bJ7WFRPdYtuHv0yTRxK2tJvi+BDqbkiG7h7u/9SI89nRAYcmap2xHQL9D+QG/6wSrTtXg==", + "license": "MIT", + "dependencies": { + "@types/mdast": "^4.0.0", + "mdast-util-from-markdown": "^2.0.0", + "mdast-util-to-markdown": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-gfm-table": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/mdast-util-gfm-table/-/mdast-util-gfm-table-2.0.0.tgz", + "integrity": "sha512-78UEvebzz/rJIxLvE7ZtDd/vIQ0RHv+3Mh5DR96p7cS7HsBhYIICDBCu8csTNWNO6tBWfqXPWekRuj2FNOGOZg==", + "license": "MIT", + "dependencies": { + "@types/mdast": "^4.0.0", + "devlop": "^1.0.0", + "markdown-table": "^3.0.0", + "mdast-util-from-markdown": "^2.0.0", + "mdast-util-to-markdown": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-gfm-task-list-item": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/mdast-util-gfm-task-list-item/-/mdast-util-gfm-task-list-item-2.0.0.tgz", + "integrity": "sha512-IrtvNvjxC1o06taBAVJznEnkiHxLFTzgonUdy8hzFVeDun0uTjxxrRGVaNFqkU1wJR3RBPEfsxmU6jDWPofrTQ==", + "license": "MIT", + "dependencies": { + "@types/mdast": "^4.0.0", + "devlop": "^1.0.0", + "mdast-util-from-markdown": "^2.0.0", + "mdast-util-to-markdown": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-mdx": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/mdast-util-mdx/-/mdast-util-mdx-3.0.0.tgz", + "integrity": "sha512-JfbYLAW7XnYTTbUsmpu0kdBUVe+yKVJZBItEjwyYJiDJuZ9w4eeaqks4HQO+R7objWgS2ymV60GYpI14Ug554w==", + "license": "MIT", + "dependencies": { + "mdast-util-from-markdown": "^2.0.0", + "mdast-util-mdx-expression": "^2.0.0", + "mdast-util-mdx-jsx": "^3.0.0", + "mdast-util-mdxjs-esm": "^2.0.0", + "mdast-util-to-markdown": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-mdx-expression": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/mdast-util-mdx-expression/-/mdast-util-mdx-expression-2.0.1.tgz", + "integrity": "sha512-J6f+9hUp+ldTZqKRSg7Vw5V6MqjATc+3E4gf3CFNcuZNWD8XdyI6zQ8GqH7f8169MM6P7hMBRDVGnn7oHB9kXQ==", + "license": "MIT", + "dependencies": { + "@types/estree-jsx": "^1.0.0", + "@types/hast": "^3.0.0", + "@types/mdast": "^4.0.0", + "devlop": "^1.0.0", + "mdast-util-from-markdown": "^2.0.0", + "mdast-util-to-markdown": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-mdx-jsx": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/mdast-util-mdx-jsx/-/mdast-util-mdx-jsx-3.2.0.tgz", + "integrity": "sha512-lj/z8v0r6ZtsN/cGNNtemmmfoLAFZnjMbNyLzBafjzikOM+glrjNHPlf6lQDOTccj9n5b0PPihEBbhneMyGs1Q==", + "license": "MIT", + "dependencies": { + "@types/estree-jsx": "^1.0.0", + "@types/hast": "^3.0.0", + "@types/mdast": "^4.0.0", + "@types/unist": "^3.0.0", + "ccount": "^2.0.0", + "devlop": "^1.1.0", + "mdast-util-from-markdown": "^2.0.0", + "mdast-util-to-markdown": "^2.0.0", + "parse-entities": "^4.0.0", + "stringify-entities": "^4.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-mdxjs-esm": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/mdast-util-mdxjs-esm/-/mdast-util-mdxjs-esm-2.0.1.tgz", + "integrity": "sha512-EcmOpxsZ96CvlP03NghtH1EsLtr0n9Tm4lPUJUBccV9RwUOneqSycg19n5HGzCf+10LozMRSObtVr3ee1WoHtg==", + "license": "MIT", + "dependencies": { + "@types/estree-jsx": "^1.0.0", + "@types/hast": "^3.0.0", + "@types/mdast": "^4.0.0", + "devlop": "^1.0.0", + "mdast-util-from-markdown": "^2.0.0", + "mdast-util-to-markdown": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-phrasing": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/mdast-util-phrasing/-/mdast-util-phrasing-4.1.0.tgz", + "integrity": "sha512-TqICwyvJJpBwvGAMZjj4J2n0X8QWp21b9l0o7eXyVJ25YNWYbJDVIyD1bZXE6WtV6RmKJVYmQAKWa0zWOABz2w==", + "license": "MIT", + "dependencies": { + "@types/mdast": "^4.0.0", + "unist-util-is": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-to-hast": { + "version": "13.2.1", + "resolved": "https://registry.npmjs.org/mdast-util-to-hast/-/mdast-util-to-hast-13.2.1.tgz", + "integrity": "sha512-cctsq2wp5vTsLIcaymblUriiTcZd0CwWtCbLvrOzYCDZoWyMNV8sZ7krj09FSnsiJi3WVsHLM4k6Dq/yaPyCXA==", + "license": "MIT", + "dependencies": { + "@types/hast": "^3.0.0", + "@types/mdast": "^4.0.0", + "@ungap/structured-clone": "^1.0.0", + "devlop": "^1.0.0", + "micromark-util-sanitize-uri": "^2.0.0", + "trim-lines": "^3.0.0", + "unist-util-position": "^5.0.0", + "unist-util-visit": "^5.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-to-markdown": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/mdast-util-to-markdown/-/mdast-util-to-markdown-2.1.2.tgz", + "integrity": "sha512-xj68wMTvGXVOKonmog6LwyJKrYXZPvlwabaryTjLh9LuvovB/KAH+kvi8Gjj+7rJjsFi23nkUxRQv1KqSroMqA==", + "license": "MIT", + "dependencies": { + "@types/mdast": "^4.0.0", + "@types/unist": "^3.0.0", + "longest-streak": "^3.0.0", + "mdast-util-phrasing": "^4.0.0", + "mdast-util-to-string": "^4.0.0", + "micromark-util-classify-character": "^2.0.0", + "micromark-util-decode-string": "^2.0.0", + "unist-util-visit": "^5.0.0", + "zwitch": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-to-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mdast-util-to-string/-/mdast-util-to-string-4.0.0.tgz", + "integrity": "sha512-0H44vDimn51F0YwvxSJSm0eCDOJTRlmN0R1yBh4HLj9wiV1Dn0QoXGbvFAWj2hSItVTlCmBF1hqKlIyUBVFLPg==", + "license": "MIT", + "dependencies": { + "@types/mdast": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdn-data": { + "version": "2.27.1", + "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.27.1.tgz", + "integrity": "sha512-9Yubnt3e8A0OKwxYSXyhLymGW4sCufcLG6VdiDdUGVkPhpqLxlvP5vl1983gQjJl3tqbrM731mjaZaP68AgosQ==", + "license": "CC0-1.0" + }, + "node_modules/mermaid": { + "version": "11.15.0", + "resolved": "https://registry.npmjs.org/mermaid/-/mermaid-11.15.0.tgz", + "integrity": "sha512-pTMbcf3rWdtLiYGpmoTjHEpeY8seiy6sR+9nD7LOs8KfUbHE4lOUAprTRqRAcWSQ6MQpdX+YEsxShtGsINtPtw==", + "license": "MIT", + "peer": true, + "dependencies": { + "@braintree/sanitize-url": "^7.1.1", + "@iconify/utils": "^3.0.2", + "@mermaid-js/parser": "^1.1.1", + "@types/d3": "^7.4.3", + "@upsetjs/venn.js": "^2.0.0", + "cytoscape": "^3.33.1", + "cytoscape-cose-bilkent": "^4.1.0", + "cytoscape-fcose": "^2.2.0", + "d3": "^7.9.0", + "d3-sankey": "^0.12.3", + "dagre-d3-es": "7.0.14", + "dayjs": "^1.11.19", + "dompurify": "^3.3.1", + "es-toolkit": "^1.45.1", + "katex": "^0.16.25", + "khroma": "^2.1.0", + "marked": "^16.3.0", + "roughjs": "^4.6.6", + "stylis": "^4.3.6", + "ts-dedent": "^2.2.0", + "uuid": "^11.1.0 || ^12 || ^13 || ^14.0.0" + } + }, + "node_modules/micromark": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/micromark/-/micromark-4.0.2.tgz", + "integrity": "sha512-zpe98Q6kvavpCr1NPVSCMebCKfD7CA2NqZ+rykeNhONIJBpc1tFKt9hucLGwha3jNTNI8lHpctWJWoimVF4PfA==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "@types/debug": "^4.0.0", + "debug": "^4.0.0", + "decode-named-character-reference": "^1.0.0", + "devlop": "^1.0.0", + "micromark-core-commonmark": "^2.0.0", + "micromark-factory-space": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-chunked": "^2.0.0", + "micromark-util-combine-extensions": "^2.0.0", + "micromark-util-decode-numeric-character-reference": "^2.0.0", + "micromark-util-encode": "^2.0.0", + "micromark-util-normalize-identifier": "^2.0.0", + "micromark-util-resolve-all": "^2.0.0", + "micromark-util-sanitize-uri": "^2.0.0", + "micromark-util-subtokenize": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-core-commonmark": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/micromark-core-commonmark/-/micromark-core-commonmark-2.0.3.tgz", + "integrity": "sha512-RDBrHEMSxVFLg6xvnXmb1Ayr2WzLAWjeSATAoxwKYJV94TeNavgoIdA0a9ytzDSVzBy2YKFK+emCPOEibLeCrg==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "decode-named-character-reference": "^1.0.0", + "devlop": "^1.0.0", + "micromark-factory-destination": "^2.0.0", + "micromark-factory-label": "^2.0.0", + "micromark-factory-space": "^2.0.0", + "micromark-factory-title": "^2.0.0", + "micromark-factory-whitespace": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-chunked": "^2.0.0", + "micromark-util-classify-character": "^2.0.0", + "micromark-util-html-tag-name": "^2.0.0", + "micromark-util-normalize-identifier": "^2.0.0", + "micromark-util-resolve-all": "^2.0.0", + "micromark-util-subtokenize": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-extension-directive": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/micromark-extension-directive/-/micromark-extension-directive-3.0.2.tgz", + "integrity": "sha512-wjcXHgk+PPdmvR58Le9d7zQYWy+vKEU9Se44p2CrCDPiLr2FMyiT4Fyb5UFKFC66wGB3kPlgD7q3TnoqPS7SZA==", + "license": "MIT", + "dependencies": { + "devlop": "^1.0.0", + "micromark-factory-space": "^2.0.0", + "micromark-factory-whitespace": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0", + "parse-entities": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/micromark-extension-gfm": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm/-/micromark-extension-gfm-3.0.0.tgz", + "integrity": "sha512-vsKArQsicm7t0z2GugkCKtZehqUm31oeGBV/KVSorWSy8ZlNAv7ytjFhvaryUiCUJYqs+NoE6AFhpQvBTM6Q4w==", + "license": "MIT", + "dependencies": { + "micromark-extension-gfm-autolink-literal": "^2.0.0", + "micromark-extension-gfm-footnote": "^2.0.0", + "micromark-extension-gfm-strikethrough": "^2.0.0", + "micromark-extension-gfm-table": "^2.0.0", + "micromark-extension-gfm-tagfilter": "^2.0.0", + "micromark-extension-gfm-task-list-item": "^2.0.0", + "micromark-util-combine-extensions": "^2.0.0", + "micromark-util-types": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/micromark-extension-gfm-autolink-literal": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm-autolink-literal/-/micromark-extension-gfm-autolink-literal-2.1.0.tgz", + "integrity": "sha512-oOg7knzhicgQ3t4QCjCWgTmfNhvQbDDnJeVu9v81r7NltNCVmhPy1fJRX27pISafdjL+SVc4d3l48Gb6pbRypw==", + "license": "MIT", + "dependencies": { + "micromark-util-character": "^2.0.0", + "micromark-util-sanitize-uri": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/micromark-extension-gfm-footnote": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm-footnote/-/micromark-extension-gfm-footnote-2.1.0.tgz", + "integrity": "sha512-/yPhxI1ntnDNsiHtzLKYnE3vf9JZ6cAisqVDauhp4CEHxlb4uoOTxOCJ+9s51bIB8U1N1FJ1RXOKTIlD5B/gqw==", + "license": "MIT", + "dependencies": { + "devlop": "^1.0.0", + "micromark-core-commonmark": "^2.0.0", + "micromark-factory-space": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-normalize-identifier": "^2.0.0", + "micromark-util-sanitize-uri": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/micromark-extension-gfm-strikethrough": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm-strikethrough/-/micromark-extension-gfm-strikethrough-2.1.0.tgz", + "integrity": "sha512-ADVjpOOkjz1hhkZLlBiYA9cR2Anf8F4HqZUO6e5eDcPQd0Txw5fxLzzxnEkSkfnD0wziSGiv7sYhk/ktvbf1uw==", + "license": "MIT", + "dependencies": { + "devlop": "^1.0.0", + "micromark-util-chunked": "^2.0.0", + "micromark-util-classify-character": "^2.0.0", + "micromark-util-resolve-all": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/micromark-extension-gfm-table": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm-table/-/micromark-extension-gfm-table-2.1.1.tgz", + "integrity": "sha512-t2OU/dXXioARrC6yWfJ4hqB7rct14e8f7m0cbI5hUmDyyIlwv5vEtooptH8INkbLzOatzKuVbQmAYcbWoyz6Dg==", + "license": "MIT", + "dependencies": { + "devlop": "^1.0.0", + "micromark-factory-space": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/micromark-extension-gfm-tagfilter": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm-tagfilter/-/micromark-extension-gfm-tagfilter-2.0.0.tgz", + "integrity": "sha512-xHlTOmuCSotIA8TW1mDIM6X2O1SiX5P9IuDtqGonFhEK0qgRI4yeC6vMxEV2dgyr2TiD+2PQ10o+cOhdVAcwfg==", + "license": "MIT", + "dependencies": { + "micromark-util-types": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/micromark-extension-gfm-task-list-item": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm-task-list-item/-/micromark-extension-gfm-task-list-item-2.1.0.tgz", + "integrity": "sha512-qIBZhqxqI6fjLDYFTBIa4eivDMnP+OZqsNwmQ3xNLE4Cxwc+zfQEfbs6tzAo2Hjq+bh6q5F+Z8/cksrLFYWQQw==", + "license": "MIT", + "dependencies": { + "devlop": "^1.0.0", + "micromark-factory-space": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/micromark-extension-mdx-expression": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/micromark-extension-mdx-expression/-/micromark-extension-mdx-expression-3.0.1.tgz", + "integrity": "sha512-dD/ADLJ1AeMvSAKBwO22zG22N4ybhe7kFIZ3LsDI0GlsNr2A3KYxb0LdC1u5rj4Nw+CHKY0RVdnHX8vj8ejm4Q==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.0", + "devlop": "^1.0.0", + "micromark-factory-mdx-expression": "^2.0.0", + "micromark-factory-space": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-events-to-acorn": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-extension-mdx-jsx": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/micromark-extension-mdx-jsx/-/micromark-extension-mdx-jsx-3.0.2.tgz", + "integrity": "sha512-e5+q1DjMh62LZAJOnDraSSbDMvGJ8x3cbjygy2qFEi7HCeUT4BDKCvMozPozcD6WmOt6sVvYDNBKhFSz3kjOVQ==", + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.0", + "devlop": "^1.0.0", + "estree-util-is-identifier-name": "^3.0.0", + "micromark-factory-mdx-expression": "^2.0.0", + "micromark-factory-space": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-events-to-acorn": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/micromark-extension-mdx-md": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-extension-mdx-md/-/micromark-extension-mdx-md-2.0.0.tgz", + "integrity": "sha512-EpAiszsB3blw4Rpba7xTOUptcFeBFi+6PY8VnJ2hhimH+vCQDirWgsMpz7w1XcZE7LVrSAUGb9VJpG9ghlYvYQ==", + "license": "MIT", + "dependencies": { + "micromark-util-types": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/micromark-extension-mdxjs": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/micromark-extension-mdxjs/-/micromark-extension-mdxjs-3.0.0.tgz", + "integrity": "sha512-A873fJfhnJ2siZyUrJ31l34Uqwy4xIFmvPY1oj+Ean5PHcPBYzEsvqvWGaWcfEIr11O5Dlw3p2y0tZWpKHDejQ==", + "license": "MIT", + "dependencies": { + "acorn": "^8.0.0", + "acorn-jsx": "^5.0.0", + "micromark-extension-mdx-expression": "^3.0.0", + "micromark-extension-mdx-jsx": "^3.0.0", + "micromark-extension-mdx-md": "^2.0.0", + "micromark-extension-mdxjs-esm": "^3.0.0", + "micromark-util-combine-extensions": "^2.0.0", + "micromark-util-types": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/micromark-extension-mdxjs-esm": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/micromark-extension-mdxjs-esm/-/micromark-extension-mdxjs-esm-3.0.0.tgz", + "integrity": "sha512-DJFl4ZqkErRpq/dAPyeWp15tGrcrrJho1hKK5uBS70BCtfrIFg81sqcTVu3Ta+KD1Tk5vAtBNElWxtAa+m8K9A==", + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.0", + "devlop": "^1.0.0", + "micromark-core-commonmark": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-events-to-acorn": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0", + "unist-util-position-from-estree": "^2.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/micromark-factory-destination": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-factory-destination/-/micromark-factory-destination-2.0.1.tgz", + "integrity": "sha512-Xe6rDdJlkmbFRExpTOmRj9N3MaWmbAgdpSrBQvCFqhezUn4AHqJHbaEnfbVYYiexVSs//tqOdY/DxhjdCiJnIA==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-factory-label": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-factory-label/-/micromark-factory-label-2.0.1.tgz", + "integrity": "sha512-VFMekyQExqIW7xIChcXn4ok29YE3rnuyveW3wZQWWqF4Nv9Wk5rgJ99KzPvHjkmPXF93FXIbBp6YdW3t71/7Vg==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "devlop": "^1.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-factory-mdx-expression": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/micromark-factory-mdx-expression/-/micromark-factory-mdx-expression-2.0.3.tgz", + "integrity": "sha512-kQnEtA3vzucU2BkrIa8/VaSAsP+EJ3CKOvhMuJgOEGg9KDC6OAY6nSnNDVRiVNRqj7Y4SlSzcStaH/5jge8JdQ==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.0", + "devlop": "^1.0.0", + "micromark-factory-space": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-events-to-acorn": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0", + "unist-util-position-from-estree": "^2.0.0", + "vfile-message": "^4.0.0" + } + }, + "node_modules/micromark-factory-space": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-factory-space/-/micromark-factory-space-2.0.1.tgz", + "integrity": "sha512-zRkxjtBxxLd2Sc0d+fbnEunsTj46SWXgXciZmHq0kDYGnck/ZSGj9/wULTV95uoeYiK5hRXP2mJ98Uo4cq/LQg==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-util-character": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-factory-title": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-factory-title/-/micromark-factory-title-2.0.1.tgz", + "integrity": "sha512-5bZ+3CjhAd9eChYTHsjy6TGxpOFSKgKKJPJxr293jTbfry2KDoWkhBb6TcPVB4NmzaPhMs1Frm9AZH7OD4Cjzw==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-factory-space": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-factory-whitespace": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-factory-whitespace/-/micromark-factory-whitespace-2.0.1.tgz", + "integrity": "sha512-Ob0nuZ3PKt/n0hORHyvoD9uZhr+Za8sFoP+OnMcnWK5lngSzALgQYKMr9RJVOWLqQYuyn6ulqGWSXdwf6F80lQ==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-factory-space": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-util-character": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/micromark-util-character/-/micromark-util-character-2.1.1.tgz", + "integrity": "sha512-wv8tdUTJ3thSFFFJKtpYKOYiGP2+v96Hvk4Tu8KpCAsTMs6yi+nVmGh1syvSCsaxz45J6Jbw+9DD6g97+NV67Q==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-util-chunked": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-chunked/-/micromark-util-chunked-2.0.1.tgz", + "integrity": "sha512-QUNFEOPELfmvv+4xiNg2sRYeS/P84pTW0TCgP5zc9FpXetHY0ab7SxKyAQCNCc1eK0459uoLI1y5oO5Vc1dbhA==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-util-symbol": "^2.0.0" + } + }, + "node_modules/micromark-util-classify-character": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-classify-character/-/micromark-util-classify-character-2.0.1.tgz", + "integrity": "sha512-K0kHzM6afW/MbeWYWLjoHQv1sgg2Q9EccHEDzSkxiP/EaagNzCm7T/WMKZ3rjMbvIpvBiZgwR3dKMygtA4mG1Q==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-util-combine-extensions": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-combine-extensions/-/micromark-util-combine-extensions-2.0.1.tgz", + "integrity": "sha512-OnAnH8Ujmy59JcyZw8JSbK9cGpdVY44NKgSM7E9Eh7DiLS2E9RNQf0dONaGDzEG9yjEl5hcqeIsj4hfRkLH/Bg==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-util-chunked": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-util-decode-numeric-character-reference": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/micromark-util-decode-numeric-character-reference/-/micromark-util-decode-numeric-character-reference-2.0.2.tgz", + "integrity": "sha512-ccUbYk6CwVdkmCQMyr64dXz42EfHGkPQlBj5p7YVGzq8I7CtjXZJrubAYezf7Rp+bjPseiROqe7G6foFd+lEuw==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-util-symbol": "^2.0.0" + } + }, + "node_modules/micromark-util-decode-string": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-decode-string/-/micromark-util-decode-string-2.0.1.tgz", + "integrity": "sha512-nDV/77Fj6eH1ynwscYTOsbK7rR//Uj0bZXBwJZRfaLEJ1iGBR6kIfNmlNqaqJf649EP0F3NWNdeJi03elllNUQ==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "decode-named-character-reference": "^1.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-decode-numeric-character-reference": "^2.0.0", + "micromark-util-symbol": "^2.0.0" + } + }, + "node_modules/micromark-util-encode": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-encode/-/micromark-util-encode-2.0.1.tgz", + "integrity": "sha512-c3cVx2y4KqUnwopcO9b/SCdo2O67LwJJ/UyqGfbigahfegL9myoEFoDYZgkT7f36T0bLrM9hZTAaAyH+PCAXjw==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT" + }, + "node_modules/micromark-util-events-to-acorn": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/micromark-util-events-to-acorn/-/micromark-util-events-to-acorn-2.0.3.tgz", + "integrity": "sha512-jmsiEIiZ1n7X1Rr5k8wVExBQCg5jy4UXVADItHmNk1zkwEVhBuIUKRu3fqv+hs4nxLISi2DQGlqIOGiFxgbfHg==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.0", + "@types/unist": "^3.0.0", + "devlop": "^1.0.0", + "estree-util-visit": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0", + "vfile-message": "^4.0.0" + } + }, + "node_modules/micromark-util-html-tag-name": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-html-tag-name/-/micromark-util-html-tag-name-2.0.1.tgz", + "integrity": "sha512-2cNEiYDhCWKI+Gs9T0Tiysk136SnR13hhO8yW6BGNyhOC4qYFnwF1nKfD3HFAIXA5c45RrIG1ub11GiXeYd1xA==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT" + }, + "node_modules/micromark-util-normalize-identifier": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-normalize-identifier/-/micromark-util-normalize-identifier-2.0.1.tgz", + "integrity": "sha512-sxPqmo70LyARJs0w2UclACPUUEqltCkJ6PhKdMIDuJ3gSf/Q+/GIe3WKl0Ijb/GyH9lOpUkRAO2wp0GVkLvS9Q==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-util-symbol": "^2.0.0" + } + }, + "node_modules/micromark-util-resolve-all": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-resolve-all/-/micromark-util-resolve-all-2.0.1.tgz", + "integrity": "sha512-VdQyxFWFT2/FGJgwQnJYbe1jjQoNTS4RjglmSjTUlpUMa95Htx9NHeYW4rGDJzbjvCsl9eLjMQwGeElsqmzcHg==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-util-sanitize-uri": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-sanitize-uri/-/micromark-util-sanitize-uri-2.0.1.tgz", + "integrity": "sha512-9N9IomZ/YuGGZZmQec1MbgxtlgougxTodVwDzzEouPKo3qFWvymFHWcnDi2vzV1ff6kas9ucW+o3yzJK9YB1AQ==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-util-character": "^2.0.0", + "micromark-util-encode": "^2.0.0", + "micromark-util-symbol": "^2.0.0" + } + }, + "node_modules/micromark-util-subtokenize": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/micromark-util-subtokenize/-/micromark-util-subtokenize-2.1.0.tgz", + "integrity": "sha512-XQLu552iSctvnEcgXw6+Sx75GflAPNED1qx7eBJ+wydBb2KCbRZe+NwvIEEMM83uml1+2WSXpBAcp9IUCgCYWA==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "devlop": "^1.0.0", + "micromark-util-chunked": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-util-symbol": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-symbol/-/micromark-util-symbol-2.0.1.tgz", + "integrity": "sha512-vs5t8Apaud9N28kgCrRUdEed4UJ+wWNvicHLPxCa9ENlYuAY31M0ETy5y1vA33YoNPDFTghEbnh6efaE8h4x0Q==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT" + }, + "node_modules/micromark-util-types": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/micromark-util-types/-/micromark-util-types-2.0.2.tgz", + "integrity": "sha512-Yw0ECSpJoViF1qTU4DC6NwtC4aWGt1EkzaQB8KPPyCRR8z9TWeV0HbEFGTO+ZY1wB22zmxnJqhPyTpOVCpeHTA==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT" + }, + "node_modules/mrmime": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/mrmime/-/mrmime-2.0.1.tgz", + "integrity": "sha512-Y3wQdFg2Va6etvQ5I82yUhGdsKrcYox6p7FfL1LbK2J4V01F9TGlepTIhnK24t7koZibmg82KGglhA1XK5IsLQ==", + "license": "MIT", + "engines": { + "node": ">=10" + } + }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT" + }, + "node_modules/nanoid": { + "version": "3.3.12", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.12.tgz", + "integrity": "sha512-ZB9RH/39qpq5Vu6Y+NmUaFhQR6pp+M2Xt76XBnEwDaGcVAqhlvxrl3B2bKS5D3NH3QR76v3aSrKaF/Kiy7lEtQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/neotraverse": { + "version": "0.6.18", + "resolved": "https://registry.npmjs.org/neotraverse/-/neotraverse-0.6.18.tgz", + "integrity": "sha512-Z4SmBUweYa09+o6pG+eASabEpP6QkQ70yHj351pQoEXIs8uHbaU2DWVmzBANKgflPa47A50PtB2+NgRpQvr7vA==", + "license": "MIT", + "engines": { + "node": ">= 10" + } + }, + "node_modules/nlcst-to-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/nlcst-to-string/-/nlcst-to-string-4.0.0.tgz", + "integrity": "sha512-YKLBCcUYKAg0FNlOBT6aI91qFmSiFKiluk655WzPF+DDMA02qIyy8uiRqI8QXtcFpEvll12LpL5MXqEmAZ+dcA==", + "license": "MIT", + "dependencies": { + "@types/nlcst": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/node-fetch-native": { + "version": "1.6.7", + "resolved": "https://registry.npmjs.org/node-fetch-native/-/node-fetch-native-1.6.7.tgz", + "integrity": "sha512-g9yhqoedzIUm0nTnTqAQvueMPVOuIY16bqgAJJC8XOOubYFNwz6IER9qs0Gq2Xd0+CecCKFjtdDTMA4u4xG06Q==", + "license": "MIT" + }, + "node_modules/node-mock-http": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/node-mock-http/-/node-mock-http-1.0.4.tgz", + "integrity": "sha512-8DY+kFsDkNXy1sJglUfuODx1/opAGJGyrTuFqEoN90oRc2Vk0ZbD4K2qmKXBBEhZQzdKHIVfEJpDU8Ak2NJEvQ==", + "license": "MIT" + }, + "node_modules/normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/nth-check": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.1.1.tgz", + "integrity": "sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==", + "license": "BSD-2-Clause", + "dependencies": { + "boolbase": "^1.0.0" + }, + "funding": { + "url": "https://github.com/fb55/nth-check?sponsor=1" + } + }, + "node_modules/ofetch": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/ofetch/-/ofetch-1.5.1.tgz", + "integrity": "sha512-2W4oUZlVaqAPAil6FUg/difl6YhqhUR7x2eZY4bQCko22UXg3hptq9KLQdqFClV+Wu85UX7hNtdGTngi/1BxcA==", + "license": "MIT", + "dependencies": { + "destr": "^2.0.5", + "node-fetch-native": "^1.6.7", + "ufo": "^1.6.1" + } + }, + "node_modules/ohash": { + "version": "2.0.11", + "resolved": "https://registry.npmjs.org/ohash/-/ohash-2.0.11.tgz", + "integrity": "sha512-RdR9FQrFwNBNXAr4GixM8YaRZRJ5PUWbKYbE5eOsrwAjJW0q2REGcf79oYPsLyskQCZG1PLN+S/K1V00joZAoQ==", + "license": "MIT" + }, + "node_modules/oniguruma-parser": { + "version": "0.12.2", + "resolved": "https://registry.npmjs.org/oniguruma-parser/-/oniguruma-parser-0.12.2.tgz", + "integrity": "sha512-6HVa5oIrgMC6aA6WF6XyyqbhRPJrKR02L20+2+zpDtO5QAzGHAUGw5TKQvwi5vctNnRHkJYmjAhRVQF2EKdTQw==", + "license": "MIT" + }, + "node_modules/oniguruma-to-es": { + "version": "4.3.6", + "resolved": "https://registry.npmjs.org/oniguruma-to-es/-/oniguruma-to-es-4.3.6.tgz", + "integrity": "sha512-csuQ9x3Yr0cEIs/Zgx/OEt9iBw9vqIunAPQkx19R/fiMq2oGVTgcMqO/V3Ybqefr1TBvosI6jU539ksaBULJyA==", + "license": "MIT", + "dependencies": { + "oniguruma-parser": "^0.12.2", + "regex": "^6.1.0", + "regex-recursion": "^6.0.2" + } + }, + "node_modules/p-limit": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-6.2.0.tgz", + "integrity": "sha512-kuUqqHNUqoIWp/c467RI4X6mmyuojY5jGutNU0wVTmEOOfcuwLqyMVoAi9MKi2Ak+5i9+nhmrK4ufZE8069kHA==", + "license": "MIT", + "dependencies": { + "yocto-queue": "^1.1.1" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-queue": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/p-queue/-/p-queue-8.1.1.tgz", + "integrity": "sha512-aNZ+VfjobsWryoiPnEApGGmf5WmNsCo9xu8dfaYamG5qaLP7ClhLN6NgsFe6SwJ2UbLEBK5dv9x8Mn5+RVhMWQ==", + "license": "MIT", + "dependencies": { + "eventemitter3": "^5.0.1", + "p-timeout": "^6.1.2" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-timeout": { + "version": "6.1.4", + "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-6.1.4.tgz", + "integrity": "sha512-MyIV3ZA/PmyBN/ud8vV9XzwTrNtR4jFrObymZYnZqMmW0zA8Z17vnT0rBgFE/TlohB+YCHqXMgZzb3Csp49vqg==", + "license": "MIT", + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/package-manager-detector": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/package-manager-detector/-/package-manager-detector-1.6.0.tgz", + "integrity": "sha512-61A5ThoTiDG/C8s8UMZwSorAGwMJ0ERVGj2OjoW5pAalsNOg15+iQiPzrLJ4jhZ1HJzmC2PIHT2oEiH3R5fzNA==", + "license": "MIT" + }, + "node_modules/pagefind": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/pagefind/-/pagefind-1.5.2.tgz", + "integrity": "sha512-XTUaK0hXMCu2jszWE584JGQT7y284TmMV9l/HX3rnG5uo3rHI/uHU56XTyyyPFjeWEBxECbAi0CaFDJOONtG0Q==", + "license": "MIT", + "bin": { + "pagefind": "lib/runner/bin.cjs" + }, + "optionalDependencies": { + "@pagefind/darwin-arm64": "1.5.2", + "@pagefind/darwin-x64": "1.5.2", + "@pagefind/freebsd-x64": "1.5.2", + "@pagefind/linux-arm64": "1.5.2", + "@pagefind/linux-x64": "1.5.2", + "@pagefind/windows-arm64": "1.5.2", + "@pagefind/windows-x64": "1.5.2" + } + }, + "node_modules/parse-entities": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/parse-entities/-/parse-entities-4.0.2.tgz", + "integrity": "sha512-GG2AQYWoLgL877gQIKeRPGO1xF9+eG1ujIb5soS5gPvLQ1y2o8FL90w2QWNdf9I361Mpp7726c+lj3U0qK1uGw==", + "license": "MIT", + "dependencies": { + "@types/unist": "^2.0.0", + "character-entities-legacy": "^3.0.0", + "character-reference-invalid": "^2.0.0", + "decode-named-character-reference": "^1.0.0", + "is-alphanumerical": "^2.0.0", + "is-decimal": "^2.0.0", + "is-hexadecimal": "^2.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/parse-entities/node_modules/@types/unist": { + "version": "2.0.11", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.11.tgz", + "integrity": "sha512-CmBKiL6NNo/OqgmMn95Fk9Whlp2mtvIv+KNpQKN2F4SjvrEesubTRWGYSg+BnWZOnlCaSTU1sMpsBOzgbYhnsA==", + "license": "MIT" + }, + "node_modules/parse-latin": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/parse-latin/-/parse-latin-7.0.0.tgz", + "integrity": "sha512-mhHgobPPua5kZ98EF4HWiH167JWBfl4pvAIXXdbaVohtK7a6YBOy56kvhCqduqyo/f3yrHFWmqmiMg/BkBkYYQ==", + "license": "MIT", + "dependencies": { + "@types/nlcst": "^2.0.0", + "@types/unist": "^3.0.0", + "nlcst-to-string": "^4.0.0", + "unist-util-modify-children": "^4.0.0", + "unist-util-visit-children": "^3.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/parse5": { + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.3.0.tgz", + "integrity": "sha512-IInvU7fabl34qmi9gY8XOVxhYyMyuH2xUNpb2q8/Y+7552KlejkRvqvD19nMoUW/uQGGbqNpA6Tufu5FL5BZgw==", + "license": "MIT", + "dependencies": { + "entities": "^6.0.0" + }, + "funding": { + "url": "https://github.com/inikulin/parse5?sponsor=1" + } + }, + "node_modules/path-data-parser": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/path-data-parser/-/path-data-parser-0.1.0.tgz", + "integrity": "sha512-NOnmBpt5Y2RWbuv0LMzsayp3lVylAHLPUTut412ZA3l+C4uw4ZVkQbjShYCQ8TCpUMdPapr4YjUqLYD6v68j+w==", + "license": "MIT" + }, + "node_modules/piccolore": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/piccolore/-/piccolore-0.1.3.tgz", + "integrity": "sha512-o8bTeDWjE086iwKrROaDf31K0qC/BENdm15/uH9usSC/uZjJOKb2YGiVHfLY4GhwsERiPI1jmwI2XrA7ACOxVw==", + "license": "ISC" + }, + "node_modules/picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "license": "ISC" + }, + "node_modules/picomatch": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.4.tgz", + "integrity": "sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A==", + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/points-on-curve": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/points-on-curve/-/points-on-curve-0.2.0.tgz", + "integrity": "sha512-0mYKnYYe9ZcqMCWhUjItv/oHjvgEsfKvnUTg8sAtnHr3GVy7rGkXCb6d5cSyqrWqL4k81b9CPg3urd+T7aop3A==", + "license": "MIT" + }, + "node_modules/points-on-path": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/points-on-path/-/points-on-path-0.2.1.tgz", + "integrity": "sha512-25ClnWWuw7JbWZcgqY/gJ4FQWadKxGWk+3kR/7kD0tCaDtPPMj7oHu2ToLaVhfpnHrZzYby2w6tUA0eOIuUg8g==", + "license": "MIT", + "dependencies": { + "path-data-parser": "0.1.0", + "points-on-curve": "0.2.0" + } + }, + "node_modules/postcss": { + "version": "8.5.15", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.15.tgz", + "integrity": "sha512-FfR8sjd4em2T6fb3I2MwAJU7HWVMr9zba+enmQeeWFfCbm+UOC/0X4DS8XtpUTMwWMGbjKYP7xjfNekzyGmB3A==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "peer": true, + "dependencies": { + "nanoid": "^3.3.12", + "picocolors": "^1.1.1", + "source-map-js": "^1.2.1" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/postcss-nested": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/postcss-nested/-/postcss-nested-6.2.0.tgz", + "integrity": "sha512-HQbt28KulC5AJzG+cZtj9kvKB93CFCdLvog1WFLf1D+xmMvPGlBstkpTEZfK5+AN9hfJocyBFCNiqyS48bpgzQ==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "postcss-selector-parser": "^6.1.1" + }, + "engines": { + "node": ">=12.0" + }, + "peerDependencies": { + "postcss": "^8.2.14" + } + }, + "node_modules/postcss-selector-parser": { + "version": "6.1.2", + "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.1.2.tgz", + "integrity": "sha512-Q8qQfPiZ+THO/3ZrOrO0cJJKfpYCagtMUkXbnEfmgUjwXg6z/WBeOyS9APBBPCTSiDV+s4SwQGu8yFsiMRIudg==", + "license": "MIT", + "dependencies": { + "cssesc": "^3.0.0", + "util-deprecate": "^1.0.2" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/prismjs": { + "version": "1.30.0", + "resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.30.0.tgz", + "integrity": "sha512-DEvV2ZF2r2/63V+tK8hQvrR2ZGn10srHbXviTlcv7Kpzw8jWiNTqbVgjO3IY8RxrrOUF8VPMQQFysYYYv0YZxw==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/prompts": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.4.2.tgz", + "integrity": "sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==", + "license": "MIT", + "dependencies": { + "kleur": "^3.0.3", + "sisteransi": "^1.0.5" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/property-information": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/property-information/-/property-information-7.2.0.tgz", + "integrity": "sha512-IAtzIB6sUiWaJYrX9smp3V46pBGbBeLFRGdh25kg1334VcBlD8HzhPeNIWQH9zhGmo2itIe25EHt9dQP7G5hmg==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/radix3": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/radix3/-/radix3-1.1.2.tgz", + "integrity": "sha512-b484I/7b8rDEdSDKckSSBA8knMpcdsXudlE/LNL639wFoHKwLbEkQFZHWEYwDC0wa0FKUcCY+GAF73Z7wxNVFA==", + "license": "MIT" + }, + "node_modules/readdirp": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-5.0.0.tgz", + "integrity": "sha512-9u/XQ1pvrQtYyMpZe7DXKv2p5CNvyVwzUB6uhLAnQwHMSgKMBR62lc7AHljaeteeHXn11XTAaLLUVZYVZyuRBQ==", + "license": "MIT", + "engines": { + "node": ">= 20.19.0" + }, + "funding": { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/recma-build-jsx": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/recma-build-jsx/-/recma-build-jsx-1.0.0.tgz", + "integrity": "sha512-8GtdyqaBcDfva+GUKDr3nev3VpKAhup1+RvkMvUxURHpW7QyIvk9F5wz7Vzo06CEMSilw6uArgRqhpiUcWp8ew==", + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.0", + "estree-util-build-jsx": "^3.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/recma-jsx": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/recma-jsx/-/recma-jsx-1.0.1.tgz", + "integrity": "sha512-huSIy7VU2Z5OLv6oFLosQGGDqPqdO1iq6bWNAdhzMxSJP7RAso4fCZ1cKu8j9YHCZf3TPrq4dw3okhrylgcd7w==", + "license": "MIT", + "dependencies": { + "acorn-jsx": "^5.0.0", + "estree-util-to-js": "^2.0.0", + "recma-parse": "^1.0.0", + "recma-stringify": "^1.0.0", + "unified": "^11.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + }, + "peerDependencies": { + "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, + "node_modules/recma-parse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/recma-parse/-/recma-parse-1.0.0.tgz", + "integrity": "sha512-OYLsIGBB5Y5wjnSnQW6t3Xg7q3fQ7FWbw/vcXtORTnyaSFscOtABg+7Pnz6YZ6c27fG1/aN8CjfwoUEUIdwqWQ==", + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.0", + "esast-util-from-js": "^2.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/recma-stringify": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/recma-stringify/-/recma-stringify-1.0.0.tgz", + "integrity": "sha512-cjwII1MdIIVloKvC9ErQ+OgAtwHBmcZ0Bg4ciz78FtbT8In39aAYbaA7zvxQ61xVMSPE8WxhLwLbhif4Js2C+g==", + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.0", + "estree-util-to-js": "^2.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/regex": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/regex/-/regex-6.1.0.tgz", + "integrity": "sha512-6VwtthbV4o/7+OaAF9I5L5V3llLEsoPyq9P1JVXkedTP33c7MfCG0/5NOPcSJn0TzXcG9YUrR0gQSWioew3LDg==", + "license": "MIT", + "dependencies": { + "regex-utilities": "^2.3.0" + } + }, + "node_modules/regex-recursion": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/regex-recursion/-/regex-recursion-6.0.2.tgz", + "integrity": "sha512-0YCaSCq2VRIebiaUviZNs0cBz1kg5kVS2UKUfNIx8YVs1cN3AV7NTctO5FOKBA+UT2BPJIWZauYHPqJODG50cg==", + "license": "MIT", + "dependencies": { + "regex-utilities": "^2.3.0" + } + }, + "node_modules/regex-utilities": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/regex-utilities/-/regex-utilities-2.3.0.tgz", + "integrity": "sha512-8VhliFJAWRaUiVvREIiW2NXXTmHs4vMNnSzuJVhscgmGav3g9VDxLrQndI3dZZVVdp0ZO/5v0xmX516/7M9cng==", + "license": "MIT" + }, + "node_modules/rehype": { + "version": "13.0.2", + "resolved": "https://registry.npmjs.org/rehype/-/rehype-13.0.2.tgz", + "integrity": "sha512-j31mdaRFrwFRUIlxGeuPXXKWQxet52RBQRvCmzl5eCefn/KGbomK5GMHNMsOJf55fgo3qw5tST5neDuarDYR2A==", + "license": "MIT", + "dependencies": { + "@types/hast": "^3.0.0", + "rehype-parse": "^9.0.0", + "rehype-stringify": "^10.0.0", + "unified": "^11.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/rehype-expressive-code": { + "version": "0.41.7", + "resolved": "https://registry.npmjs.org/rehype-expressive-code/-/rehype-expressive-code-0.41.7.tgz", + "integrity": "sha512-25f8ZMSF1d9CMscX7Cft0TSQIqdwjce2gDOvQ+d/w0FovsMwrSt3ODP4P3Z7wO1jsIJ4eYyaDRnIR/27bd/EMQ==", + "license": "MIT", + "dependencies": { + "expressive-code": "^0.41.7" + } + }, + "node_modules/rehype-format": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/rehype-format/-/rehype-format-5.0.1.tgz", + "integrity": "sha512-zvmVru9uB0josBVpr946OR8ui7nJEdzZobwLOOqHb/OOD88W0Vk2SqLwoVOj0fM6IPCCO6TaV9CvQvJMWwukFQ==", + "license": "MIT", + "dependencies": { + "@types/hast": "^3.0.0", + "hast-util-format": "^1.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/rehype-parse": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/rehype-parse/-/rehype-parse-9.0.1.tgz", + "integrity": "sha512-ksCzCD0Fgfh7trPDxr2rSylbwq9iYDkSn8TCDmEJ49ljEUBxDVCzCHv7QNzZOfODanX4+bWQ4WZqLCRWYLfhag==", + "license": "MIT", + "dependencies": { + "@types/hast": "^3.0.0", + "hast-util-from-html": "^2.0.0", + "unified": "^11.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/rehype-raw": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/rehype-raw/-/rehype-raw-7.0.0.tgz", + "integrity": "sha512-/aE8hCfKlQeA8LmyeyQvQF3eBiLRGNlfBJEvWH7ivp9sBqs7TNqBL5X3v157rM4IFETqDnIOO+z5M/biZbo9Ww==", + "license": "MIT", + "dependencies": { + "@types/hast": "^3.0.0", + "hast-util-raw": "^9.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/rehype-recma": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/rehype-recma/-/rehype-recma-1.0.0.tgz", + "integrity": "sha512-lqA4rGUf1JmacCNWWZx0Wv1dHqMwxzsDWYMTowuplHF3xH0N/MmrZ/G3BDZnzAkRmxDadujCjaKM2hqYdCBOGw==", + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.0", + "@types/hast": "^3.0.0", + "hast-util-to-estree": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/rehype-stringify": { + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/rehype-stringify/-/rehype-stringify-10.0.1.tgz", + "integrity": "sha512-k9ecfXHmIPuFVI61B9DeLPN0qFHfawM6RsuX48hoqlaKSF61RskNjSm1lI8PhBEM0MRdLxVVm4WmTqJQccH9mA==", + "license": "MIT", + "dependencies": { + "@types/hast": "^3.0.0", + "hast-util-to-html": "^9.0.0", + "unified": "^11.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-directive": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/remark-directive/-/remark-directive-3.0.1.tgz", + "integrity": "sha512-gwglrEQEZcZYgVyG1tQuA+h58EZfq5CSULw7J90AFuCTyib1thgHPoqQ+h9iFvU6R+vnZ5oNFQR5QKgGpk741A==", + "license": "MIT", + "dependencies": { + "@types/mdast": "^4.0.0", + "mdast-util-directive": "^3.0.0", + "micromark-extension-directive": "^3.0.0", + "unified": "^11.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-gfm": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/remark-gfm/-/remark-gfm-4.0.1.tgz", + "integrity": "sha512-1quofZ2RQ9EWdeN34S79+KExV1764+wCUGop5CPL1WGdD0ocPpu91lzPGbwWMECpEpd42kJGQwzRfyov9j4yNg==", + "license": "MIT", + "dependencies": { + "@types/mdast": "^4.0.0", + "mdast-util-gfm": "^3.0.0", + "micromark-extension-gfm": "^3.0.0", + "remark-parse": "^11.0.0", + "remark-stringify": "^11.0.0", + "unified": "^11.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-mdx": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/remark-mdx/-/remark-mdx-3.1.1.tgz", + "integrity": "sha512-Pjj2IYlUY3+D8x00UJsIOg5BEvfMyeI+2uLPn9VO9Wg4MEtN/VTIq2NEJQfde9PnX15KgtHyl9S0BcTnWrIuWg==", + "license": "MIT", + "dependencies": { + "mdast-util-mdx": "^3.0.0", + "micromark-extension-mdxjs": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-parse": { + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/remark-parse/-/remark-parse-11.0.0.tgz", + "integrity": "sha512-FCxlKLNGknS5ba/1lmpYijMUzX2esxW5xQqjWxw2eHFfS2MSdaHVINFmhjo+qN1WhZhNimq0dZATN9pH0IDrpA==", + "license": "MIT", + "dependencies": { + "@types/mdast": "^4.0.0", + "mdast-util-from-markdown": "^2.0.0", + "micromark-util-types": "^2.0.0", + "unified": "^11.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-rehype": { + "version": "11.1.2", + "resolved": "https://registry.npmjs.org/remark-rehype/-/remark-rehype-11.1.2.tgz", + "integrity": "sha512-Dh7l57ianaEoIpzbp0PC9UKAdCSVklD8E5Rpw7ETfbTl3FqcOOgq5q2LVDhgGCkaBv7p24JXikPdvhhmHvKMsw==", + "license": "MIT", + "dependencies": { + "@types/hast": "^3.0.0", + "@types/mdast": "^4.0.0", + "mdast-util-to-hast": "^13.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-smartypants": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/remark-smartypants/-/remark-smartypants-3.0.2.tgz", + "integrity": "sha512-ILTWeOriIluwEvPjv67v7Blgrcx+LZOkAUVtKI3putuhlZm84FnqDORNXPPm+HY3NdZOMhyDwZ1E+eZB/Df5dA==", + "license": "MIT", + "dependencies": { + "retext": "^9.0.0", + "retext-smartypants": "^6.0.0", + "unified": "^11.0.4", + "unist-util-visit": "^5.0.0" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/remark-stringify": { + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/remark-stringify/-/remark-stringify-11.0.0.tgz", + "integrity": "sha512-1OSmLd3awB/t8qdoEOMazZkNsfVTeY4fTsgzcQFdXNq8ToTN4ZGwrMnlda4K6smTFKD+GRV6O48i6Z4iKgPPpw==", + "license": "MIT", + "dependencies": { + "@types/mdast": "^4.0.0", + "mdast-util-to-markdown": "^2.0.0", + "unified": "^11.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/retext": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/retext/-/retext-9.0.0.tgz", + "integrity": "sha512-sbMDcpHCNjvlheSgMfEcVrZko3cDzdbe1x/e7G66dFp0Ff7Mldvi2uv6JkJQzdRcvLYE8CA8Oe8siQx8ZOgTcA==", + "license": "MIT", + "dependencies": { + "@types/nlcst": "^2.0.0", + "retext-latin": "^4.0.0", + "retext-stringify": "^4.0.0", + "unified": "^11.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/retext-latin": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/retext-latin/-/retext-latin-4.0.0.tgz", + "integrity": "sha512-hv9woG7Fy0M9IlRQloq/N6atV82NxLGveq+3H2WOi79dtIYWN8OaxogDm77f8YnVXJL2VD3bbqowu5E3EMhBYA==", + "license": "MIT", + "dependencies": { + "@types/nlcst": "^2.0.0", + "parse-latin": "^7.0.0", + "unified": "^11.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/retext-smartypants": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/retext-smartypants/-/retext-smartypants-6.2.0.tgz", + "integrity": "sha512-kk0jOU7+zGv//kfjXEBjdIryL1Acl4i9XNkHxtM7Tm5lFiCog576fjNC9hjoR7LTKQ0DsPWy09JummSsH1uqfQ==", + "license": "MIT", + "dependencies": { + "@types/nlcst": "^2.0.0", + "nlcst-to-string": "^4.0.0", + "unist-util-visit": "^5.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/retext-stringify": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/retext-stringify/-/retext-stringify-4.0.0.tgz", + "integrity": "sha512-rtfN/0o8kL1e+78+uxPTqu1Klt0yPzKuQ2BfWwwfgIUSayyzxpM1PJzkKt4V8803uB9qSy32MvI7Xep9khTpiA==", + "license": "MIT", + "dependencies": { + "@types/nlcst": "^2.0.0", + "nlcst-to-string": "^4.0.0", + "unified": "^11.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/robust-predicates": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/robust-predicates/-/robust-predicates-3.0.3.tgz", + "integrity": "sha512-NS3levdsRIUOmiJ8FZWCP7LG3QpJyrs/TE0Zpf1yvZu8cAJJ6QMW92H1c7kWpdIHo8RvmLxN/o2JXTKHp74lUA==", + "license": "Unlicense" + }, + "node_modules/rollup": { + "version": "4.61.1", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.61.1.tgz", + "integrity": "sha512-I4KW6iuRpuu2uHBLraZ1wNZe0DP7lnRha+VJ9tNaYVaVgKhW0aI3h4RYnoRPeql0flHm/Co55b7snEDcOfOJrA==", + "license": "MIT", + "dependencies": { + "@types/estree": "1.0.9" + }, + "bin": { + "rollup": "dist/bin/rollup" + }, + "engines": { + "node": ">=18.0.0", + "npm": ">=8.0.0" + }, + "optionalDependencies": { + "@rollup/rollup-android-arm-eabi": "4.61.1", + "@rollup/rollup-android-arm64": "4.61.1", + "@rollup/rollup-darwin-arm64": "4.61.1", + "@rollup/rollup-darwin-x64": "4.61.1", + "@rollup/rollup-freebsd-arm64": "4.61.1", + "@rollup/rollup-freebsd-x64": "4.61.1", + "@rollup/rollup-linux-arm-gnueabihf": "4.61.1", + "@rollup/rollup-linux-arm-musleabihf": "4.61.1", + "@rollup/rollup-linux-arm64-gnu": "4.61.1", + "@rollup/rollup-linux-arm64-musl": "4.61.1", + "@rollup/rollup-linux-loong64-gnu": "4.61.1", + "@rollup/rollup-linux-loong64-musl": "4.61.1", + "@rollup/rollup-linux-ppc64-gnu": "4.61.1", + "@rollup/rollup-linux-ppc64-musl": "4.61.1", + "@rollup/rollup-linux-riscv64-gnu": "4.61.1", + "@rollup/rollup-linux-riscv64-musl": "4.61.1", + "@rollup/rollup-linux-s390x-gnu": "4.61.1", + "@rollup/rollup-linux-x64-gnu": "4.61.1", + "@rollup/rollup-linux-x64-musl": "4.61.1", + "@rollup/rollup-openbsd-x64": "4.61.1", + "@rollup/rollup-openharmony-arm64": "4.61.1", + "@rollup/rollup-win32-arm64-msvc": "4.61.1", + "@rollup/rollup-win32-ia32-msvc": "4.61.1", + "@rollup/rollup-win32-x64-gnu": "4.61.1", + "@rollup/rollup-win32-x64-msvc": "4.61.1", + "fsevents": "~2.3.2" + } + }, + "node_modules/roughjs": { + "version": "4.6.6", + "resolved": "https://registry.npmjs.org/roughjs/-/roughjs-4.6.6.tgz", + "integrity": "sha512-ZUz/69+SYpFN/g/lUlo2FXcIjRkSu3nDarreVdGGndHEBJ6cXPdKguS8JGxwj5HA5xIbVKSmLgr5b3AWxtRfvQ==", + "license": "MIT", + "dependencies": { + "hachure-fill": "^0.5.2", + "path-data-parser": "^0.1.0", + "points-on-curve": "^0.2.0", + "points-on-path": "^0.2.1" + } + }, + "node_modules/rw": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/rw/-/rw-1.3.3.tgz", + "integrity": "sha512-PdhdWy89SiZogBLaw42zdeqtRJ//zFd2PgQavcICDUgJT5oW10QCRKbJ6bg4r0/UY2M6BWd5tkxuGFRvCkgfHQ==", + "license": "BSD-3-Clause" + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "license": "MIT" + }, + "node_modules/sax": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/sax/-/sax-1.6.0.tgz", + "integrity": "sha512-6R3J5M4AcbtLUdZmRv2SygeVaM7IhrLXu9BmnOGmmACak8fiUtOsYNWUS4uK7upbmHIBbLBeFeI//477BKLBzA==", + "license": "BlueOak-1.0.0", + "engines": { + "node": ">=11.0.0" + } + }, + "node_modules/semver": { + "version": "7.8.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.2.tgz", + "integrity": "sha512-c8jsqUZm3omBOI66G90z1Dyw5z622G8oLG+omfsHBJf3CWQTlOcwOjvOG6wtiNfW6anKm/eA39LMwMtMez2TiQ==", + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/sharp": { + "version": "0.34.5", + "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.34.5.tgz", + "integrity": "sha512-Ou9I5Ft9WNcCbXrU9cMgPBcCK8LiwLqcbywW3t4oDV37n1pzpuNLsYiAV8eODnjbtQlSDwZ2cUEeQz4E54Hltg==", + "hasInstallScript": true, + "license": "Apache-2.0", + "dependencies": { + "@img/colour": "^1.0.0", + "detect-libc": "^2.1.2", + "semver": "^7.7.3" + }, + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-darwin-arm64": "0.34.5", + "@img/sharp-darwin-x64": "0.34.5", + "@img/sharp-libvips-darwin-arm64": "1.2.4", + "@img/sharp-libvips-darwin-x64": "1.2.4", + "@img/sharp-libvips-linux-arm": "1.2.4", + "@img/sharp-libvips-linux-arm64": "1.2.4", + "@img/sharp-libvips-linux-ppc64": "1.2.4", + "@img/sharp-libvips-linux-riscv64": "1.2.4", + "@img/sharp-libvips-linux-s390x": "1.2.4", + "@img/sharp-libvips-linux-x64": "1.2.4", + "@img/sharp-libvips-linuxmusl-arm64": "1.2.4", + "@img/sharp-libvips-linuxmusl-x64": "1.2.4", + "@img/sharp-linux-arm": "0.34.5", + "@img/sharp-linux-arm64": "0.34.5", + "@img/sharp-linux-ppc64": "0.34.5", + "@img/sharp-linux-riscv64": "0.34.5", + "@img/sharp-linux-s390x": "0.34.5", + "@img/sharp-linux-x64": "0.34.5", + "@img/sharp-linuxmusl-arm64": "0.34.5", + "@img/sharp-linuxmusl-x64": "0.34.5", + "@img/sharp-wasm32": "0.34.5", + "@img/sharp-win32-arm64": "0.34.5", + "@img/sharp-win32-ia32": "0.34.5", + "@img/sharp-win32-x64": "0.34.5" + } + }, + "node_modules/shiki": { + "version": "3.23.0", + "resolved": "https://registry.npmjs.org/shiki/-/shiki-3.23.0.tgz", + "integrity": "sha512-55Dj73uq9ZXL5zyeRPzHQsK7Nbyt6Y10k5s7OjuFZGMhpp4r/rsLBH0o/0fstIzX1Lep9VxefWljK/SKCzygIA==", + "license": "MIT", + "dependencies": { + "@shikijs/core": "3.23.0", + "@shikijs/engine-javascript": "3.23.0", + "@shikijs/engine-oniguruma": "3.23.0", + "@shikijs/langs": "3.23.0", + "@shikijs/themes": "3.23.0", + "@shikijs/types": "3.23.0", + "@shikijs/vscode-textmate": "^10.0.2", + "@types/hast": "^3.0.4" + } + }, + "node_modules/sisteransi": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz", + "integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==", + "license": "MIT" + }, + "node_modules/sitemap": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/sitemap/-/sitemap-9.0.1.tgz", + "integrity": "sha512-S6hzjGJSG3d6if0YoF5kTyeRJvia6FSTBroE5fQ0bu1QNxyJqhhinfUsXi9fH3MgtXODWvwo2BDyQSnhPQ88uQ==", + "license": "MIT", + "dependencies": { + "@types/node": "^24.9.2", + "@types/sax": "^1.2.1", + "arg": "^5.0.0", + "sax": "^1.4.1" + }, + "bin": { + "sitemap": "dist/esm/cli.js" + }, + "engines": { + "node": ">=20.19.5", + "npm": ">=10.8.2" + } + }, + "node_modules/smol-toml": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/smol-toml/-/smol-toml-1.6.1.tgz", + "integrity": "sha512-dWUG8F5sIIARXih1DTaQAX4SsiTXhInKf1buxdY9DIg4ZYPZK5nGM1VRIYmEbDbsHt7USo99xSLFu5Q1IqTmsg==", + "license": "BSD-3-Clause", + "engines": { + "node": ">= 18" + }, + "funding": { + "url": "https://github.com/sponsors/cyyynthia" + } + }, + "node_modules/source-map": { + "version": "0.7.6", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.6.tgz", + "integrity": "sha512-i5uvt8C3ikiWeNZSVZNWcfZPItFQOsYTUAOkcUPGd8DqDy1uOUikjt5dG+uRlwyvR108Fb9DOd4GvXfT0N2/uQ==", + "license": "BSD-3-Clause", + "engines": { + "node": ">= 12" + } + }, + "node_modules/source-map-js": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", + "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/space-separated-tokens": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/space-separated-tokens/-/space-separated-tokens-2.0.2.tgz", + "integrity": "sha512-PEGlAwrG8yXGXRjW32fGbg66JAlOAwbObuqVoJpv/mRgoWDQfgH1wDPvtzWyUSNAXBGSk8h755YDbbcEy3SH2Q==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/stream-replace-string": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/stream-replace-string/-/stream-replace-string-2.0.0.tgz", + "integrity": "sha512-TlnjJ1C0QrmxRNrON00JvaFFlNh5TTG00APw23j74ET7gkQpTASi6/L2fuiav8pzK715HXtUeClpBTw2NPSn6w==", + "license": "MIT" + }, + "node_modules/string-width": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-7.2.0.tgz", + "integrity": "sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==", + "license": "MIT", + "dependencies": { + "emoji-regex": "^10.3.0", + "get-east-asian-width": "^1.0.0", + "strip-ansi": "^7.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/stringify-entities": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/stringify-entities/-/stringify-entities-4.0.4.tgz", + "integrity": "sha512-IwfBptatlO+QCJUo19AqvrPNqlVMpW9YEL2LIVY+Rpv2qsjCGxaDLNRgeGsQWJhfItebuJhsGSLjaBbNSQ+ieg==", + "license": "MIT", + "dependencies": { + "character-entities-html4": "^2.0.0", + "character-entities-legacy": "^3.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/strip-ansi": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.2.0.tgz", + "integrity": "sha512-yDPMNjp4WyfYBkHnjIRLfca1i6KMyGCtsVgoKe/z1+6vukgaENdgGBZt+ZmKPc4gavvEZ5OgHfHdrazhgNyG7w==", + "license": "MIT", + "dependencies": { + "ansi-regex": "^6.2.2" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, + "node_modules/style-to-js": { + "version": "1.1.21", + "resolved": "https://registry.npmjs.org/style-to-js/-/style-to-js-1.1.21.tgz", + "integrity": "sha512-RjQetxJrrUJLQPHbLku6U/ocGtzyjbJMP9lCNK7Ag0CNh690nSH8woqWH9u16nMjYBAok+i7JO1NP2pOy8IsPQ==", + "license": "MIT", + "dependencies": { + "style-to-object": "1.0.14" + } + }, + "node_modules/style-to-object": { + "version": "1.0.14", + "resolved": "https://registry.npmjs.org/style-to-object/-/style-to-object-1.0.14.tgz", + "integrity": "sha512-LIN7rULI0jBscWQYaSswptyderlarFkjQ+t79nzty8tcIAceVomEVlLzH5VP4Cmsv6MtKhs7qaAiwlcp+Mgaxw==", + "license": "MIT", + "dependencies": { + "inline-style-parser": "0.2.7" + } + }, + "node_modules/stylis": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/stylis/-/stylis-4.4.0.tgz", + "integrity": "sha512-5Z9ZpRzfuH6l/UAvCPAPUo3665Nk2wLaZU3x+TLHKVzIz33+sbJqbtrYoC3KD4/uVOr2Zp+L0LySezP9OHV9yA==", + "license": "MIT" + }, + "node_modules/svgo": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/svgo/-/svgo-4.0.1.tgz", + "integrity": "sha512-XDpWUOPC6FEibaLzjfe0ucaV0YrOjYotGJO1WpF0Zd+n6ZGEQUsSugaoLq9QkEZtAfQIxT42UChcssDVPP3+/w==", + "license": "MIT", + "dependencies": { + "commander": "^11.1.0", + "css-select": "^5.1.0", + "css-tree": "^3.0.1", + "css-what": "^6.1.0", + "csso": "^5.0.5", + "picocolors": "^1.1.1", + "sax": "^1.5.0" + }, + "bin": { + "svgo": "bin/svgo.js" + }, + "engines": { + "node": ">=16" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/svgo" + } + }, + "node_modules/svgo/node_modules/commander": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-11.1.0.tgz", + "integrity": "sha512-yPVavfyCcRhmorC7rWlkHn15b4wDVgVmBA7kV4QVBsF7kv/9TKJAbAXVTxvTnwP8HHKjRCJDClKbciiYS7p0DQ==", + "license": "MIT", + "engines": { + "node": ">=16" + } + }, + "node_modules/tiny-inflate": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/tiny-inflate/-/tiny-inflate-1.0.3.tgz", + "integrity": "sha512-pkY1fj1cKHb2seWDy0B16HeWyczlJA9/WW3u3c4z/NiWDsO3DOU5D7nhTLE9CF0yXv/QZFY7sEJmj24dK+Rrqw==", + "license": "MIT" + }, + "node_modules/tinyexec": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-1.2.4.tgz", + "integrity": "sha512-SHf/r48b7vOrjve9PxJo3MN5v5yuyjHvdUcrQffT3WXMUfnGmHDVbC4k3sHJaJTgZCwpUplIaAo5ANtMyp3YHg==", + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/tinyglobby": { + "version": "0.2.17", + "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.17.tgz", + "integrity": "sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g==", + "license": "MIT", + "dependencies": { + "fdir": "^6.5.0", + "picomatch": "^4.0.4" + }, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/SuperchupuDev" + } + }, + "node_modules/trim-lines": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/trim-lines/-/trim-lines-3.0.1.tgz", + "integrity": "sha512-kRj8B+YHZCc9kQYdWfJB2/oUl9rA99qbowYYBtr4ui4mZyAQ2JpvVBd/6U2YloATfqBhBTSMhTpgBHtU0Mf3Rg==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/trough": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/trough/-/trough-2.2.0.tgz", + "integrity": "sha512-tmMpK00BjZiUyVyvrBK7knerNgmgvcV/KLVyuma/SC+TQN167GrMRciANTz09+k3zW8L8t60jWO1GpfkZdjTaw==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/ts-dedent": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/ts-dedent/-/ts-dedent-2.2.0.tgz", + "integrity": "sha512-q5W7tVM71e2xjHZTlgfTDoPF/SmqKG5hddq9SzR49CH2hayqRKJtQ4mtRlSxKaJlR/+9rEM+mnBHf7I2/BQcpQ==", + "license": "MIT", + "engines": { + "node": ">=6.10" + } + }, + "node_modules/tsconfck": { + "version": "3.1.6", + "resolved": "https://registry.npmjs.org/tsconfck/-/tsconfck-3.1.6.tgz", + "integrity": "sha512-ks6Vjr/jEw0P1gmOVwutM3B7fWxoWBL2KRDb1JfqGVawBmO5UsvmWOQFGHBPl5yxYz4eERr19E6L7NMv+Fej4w==", + "license": "MIT", + "bin": { + "tsconfck": "bin/tsconfck.js" + }, + "engines": { + "node": "^18 || >=20" + }, + "peerDependencies": { + "typescript": "^5.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/tslib": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", + "license": "0BSD", + "optional": true + }, + "node_modules/type-fest": { + "version": "4.41.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.41.0.tgz", + "integrity": "sha512-TeTSQ6H5YHvpqVwBRcnLDCBnDOHWYu7IvGbHT6N8AOymcr9PJGjc1GTtiWZTYg0NCgYwvnYWEkVChQAr9bjfwA==", + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/typescript": { + "version": "5.9.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", + "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", + "license": "Apache-2.0", + "peer": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/ufo": { + "version": "1.6.4", + "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.6.4.tgz", + "integrity": "sha512-JFNbkD1Svwe0KvGi8GOeLcP4kAWQ609twvCdcHxq1oSL8svv39ZuSvajcD8B+5D0eL4+s1Is2D/O6KN3qcTeRA==", + "license": "MIT" + }, + "node_modules/ultrahtml": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/ultrahtml/-/ultrahtml-1.6.0.tgz", + "integrity": "sha512-R9fBn90VTJrqqLDwyMph+HGne8eqY1iPfYhPzZrvKpIfwkWZbcYlfpsb8B9dTvBfpy1/hqAD7Wi8EKfP9e8zdw==", + "license": "MIT" + }, + "node_modules/uncrypto": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/uncrypto/-/uncrypto-0.1.3.tgz", + "integrity": "sha512-Ql87qFHB3s/De2ClA9e0gsnS6zXG27SkTiSJwjCc9MebbfapQfuPzumMIUMi38ezPZVNFcHI9sUIepeQfw8J8Q==", + "license": "MIT" + }, + "node_modules/undici-types": { + "version": "7.18.2", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.18.2.tgz", + "integrity": "sha512-AsuCzffGHJybSaRrmr5eHr81mwJU3kjw6M+uprWvCXiNeN9SOGwQ3Jn8jb8m3Z6izVgknn1R0FTCEAP2QrLY/w==", + "license": "MIT" + }, + "node_modules/unified": { + "version": "11.0.5", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.5.tgz", + "integrity": "sha512-xKvGhPWw3k84Qjh8bI3ZeJjqnyadK+GEFtazSfZv/rKeTkTjOJho6mFqh2SM96iIcZokxiOpg78GazTSg8+KHA==", + "license": "MIT", + "dependencies": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/unifont": { + "version": "0.7.4", + "resolved": "https://registry.npmjs.org/unifont/-/unifont-0.7.4.tgz", + "integrity": "sha512-oHeis4/xl42HUIeHuNZRGEvxj5AaIKR+bHPNegRq5LV1gdc3jundpONbjglKpihmJf+dswygdMJn3eftGIMemg==", + "license": "MIT", + "dependencies": { + "css-tree": "^3.1.0", + "ofetch": "^1.5.1", + "ohash": "^2.0.11" + } + }, + "node_modules/unist-util-find-after": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-find-after/-/unist-util-find-after-5.0.0.tgz", + "integrity": "sha512-amQa0Ep2m6hE2g72AugUItjbuM8X8cGQnFoHk0pGfrFeT9GZhzN5SW8nRsiGKK7Aif4CrACPENkA6P/Lw6fHGQ==", + "license": "MIT", + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-is": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/unist-util-is": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-6.0.1.tgz", + "integrity": "sha512-LsiILbtBETkDz8I9p1dQ0uyRUWuaQzd/cuEeS1hoRSyW5E5XGmTzlwY1OrNzzakGowI9Dr/I8HVaw4hTtnxy8g==", + "license": "MIT", + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/unist-util-modify-children": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-modify-children/-/unist-util-modify-children-4.0.0.tgz", + "integrity": "sha512-+tdN5fGNddvsQdIzUF3Xx82CU9sMM+fA0dLgR9vOmT0oPT2jH+P1nd5lSqfCfXAw+93NhcXNY2qqvTUtE4cQkw==", + "license": "MIT", + "dependencies": { + "@types/unist": "^3.0.0", + "array-iterate": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/unist-util-position": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-5.0.0.tgz", + "integrity": "sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA==", + "license": "MIT", + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/unist-util-position-from-estree": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/unist-util-position-from-estree/-/unist-util-position-from-estree-2.0.0.tgz", + "integrity": "sha512-KaFVRjoqLyF6YXCbVLNad/eS4+OfPQQn2yOd7zF/h5T/CSL2v8NpN6a5TPvtbXthAGw5nG+PuTtq+DdIZr+cRQ==", + "license": "MIT", + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/unist-util-remove-position": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-remove-position/-/unist-util-remove-position-5.0.0.tgz", + "integrity": "sha512-Hp5Kh3wLxv0PHj9m2yZhhLt58KzPtEYKQQ4yxfYFEO7EvHwzyDYnduhHnY1mDxoqr7VUwVuHXk9RXKIiYS1N8Q==", + "license": "MIT", + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-visit": "^5.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "license": "MIT", + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/unist-util-visit": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-5.1.0.tgz", + "integrity": "sha512-m+vIdyeCOpdr/QeQCu2EzxX/ohgS8KbnPDgFni4dQsfSCtpz8UqDyY5GjRru8PDKuYn7Fq19j1CQ+nJSsGKOzg==", + "license": "MIT", + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-is": "^6.0.0", + "unist-util-visit-parents": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/unist-util-visit-children": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unist-util-visit-children/-/unist-util-visit-children-3.0.0.tgz", + "integrity": "sha512-RgmdTfSBOg04sdPcpTSD1jzoNBjt9a80/ZCzp5cI9n1qPzLZWF9YdvWGN2zmTumP1HWhXKdUWexjy/Wy/lJ7tA==", + "license": "MIT", + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/unist-util-visit-parents": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-6.0.2.tgz", + "integrity": "sha512-goh1s1TBrqSqukSc8wrjwWhL0hiJxgA8m4kFxGlQ+8FYQ3C/m11FcTs4YYem7V664AhHVvgoQLk890Ssdsr2IQ==", + "license": "MIT", + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-is": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/unstorage": { + "version": "1.17.5", + "resolved": "https://registry.npmjs.org/unstorage/-/unstorage-1.17.5.tgz", + "integrity": "sha512-0i3iqvRfx29hkNntHyQvJTpf5W9dQ9ZadSoRU8+xVlhVtT7jAX57fazYO9EHvcRCfBCyi5YRya7XCDOsbTgkPg==", + "license": "MIT", + "dependencies": { + "anymatch": "^3.1.3", + "chokidar": "^5.0.0", + "destr": "^2.0.5", + "h3": "^1.15.10", + "lru-cache": "^11.2.7", + "node-fetch-native": "^1.6.7", + "ofetch": "^1.5.1", + "ufo": "^1.6.3" + }, + "peerDependencies": { + "@azure/app-configuration": "^1.8.0", + "@azure/cosmos": "^4.2.0", + "@azure/data-tables": "^13.3.0", + "@azure/identity": "^4.6.0", + "@azure/keyvault-secrets": "^4.9.0", + "@azure/storage-blob": "^12.26.0", + "@capacitor/preferences": "^6 || ^7 || ^8", + "@deno/kv": ">=0.9.0", + "@netlify/blobs": "^6.5.0 || ^7.0.0 || ^8.1.0 || ^9.0.0 || ^10.0.0", + "@planetscale/database": "^1.19.0", + "@upstash/redis": "^1.34.3", + "@vercel/blob": ">=0.27.1", + "@vercel/functions": "^2.2.12 || ^3.0.0", + "@vercel/kv": "^1 || ^2 || ^3", + "aws4fetch": "^1.0.20", + "db0": ">=0.2.1", + "idb-keyval": "^6.2.1", + "ioredis": "^5.4.2", + "uploadthing": "^7.4.4" + }, + "peerDependenciesMeta": { + "@azure/app-configuration": { + "optional": true + }, + "@azure/cosmos": { + "optional": true + }, + "@azure/data-tables": { + "optional": true + }, + "@azure/identity": { + "optional": true + }, + "@azure/keyvault-secrets": { + "optional": true + }, + "@azure/storage-blob": { + "optional": true + }, + "@capacitor/preferences": { + "optional": true + }, + "@deno/kv": { + "optional": true + }, + "@netlify/blobs": { + "optional": true + }, + "@planetscale/database": { + "optional": true + }, + "@upstash/redis": { + "optional": true + }, + "@vercel/blob": { + "optional": true + }, + "@vercel/functions": { + "optional": true + }, + "@vercel/kv": { + "optional": true + }, + "aws4fetch": { + "optional": true + }, + "db0": { + "optional": true + }, + "idb-keyval": { + "optional": true + }, + "ioredis": { + "optional": true + }, + "uploadthing": { + "optional": true + } + } + }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", + "license": "MIT" + }, + "node_modules/uuid": { + "version": "14.0.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-14.0.0.tgz", + "integrity": "sha512-Qo+uWgilfSmAhXCMav1uYFynlQO7fMFiMVZsQqZRMIXp0O7rR7qjkj+cPvBHLgBqi960QCoo/PH2/6ZtVqKvrg==", + "funding": [ + "https://github.com/sponsors/broofa", + "https://github.com/sponsors/ctavan" + ], + "license": "MIT", + "bin": { + "uuid": "dist-node/bin/uuid" + } + }, + "node_modules/vfile": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.3.tgz", + "integrity": "sha512-KzIbH/9tXat2u30jf+smMwFCsno4wHVdNmzFyL+T/L3UGqqk6JKfVqOFOZEpZSHADH1k40ab6NUIXZq422ov3Q==", + "license": "MIT", + "dependencies": { + "@types/unist": "^3.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/vfile-location": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/vfile-location/-/vfile-location-5.0.3.tgz", + "integrity": "sha512-5yXvWDEgqeiYiBe1lbxYF7UMAIm/IcopxMHrMQDq3nvKcjPKIhZklUKL+AE7J7uApI4kwe2snsK+eI6UTj9EHg==", + "license": "MIT", + "dependencies": { + "@types/unist": "^3.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/vfile-message": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.3.tgz", + "integrity": "sha512-QTHzsGd1EhbZs4AsQ20JX1rC3cOlt/IWJruk893DfLRr57lcnOeMaWG4K0JrRta4mIJZKth2Au3mM3u03/JWKw==", + "license": "MIT", + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/vite": { + "version": "6.4.3", + "resolved": "https://registry.npmjs.org/vite/-/vite-6.4.3.tgz", + "integrity": "sha512-NTKlcQjlAK7MlQoyb6LgaqHc8sso/pVyUJYWMws3jg21uTJw/LddqIFPcPqP6PzpgbIcZyKI85sFE4HBrQDA8A==", + "license": "MIT", + "dependencies": { + "esbuild": "^0.25.0", + "fdir": "^6.4.4", + "picomatch": "^4.0.2", + "postcss": "^8.5.3", + "rollup": "^4.34.9", + "tinyglobby": "^0.2.13" + }, + "bin": { + "vite": "bin/vite.js" + }, + "engines": { + "node": "^18.0.0 || ^20.0.0 || >=22.0.0" + }, + "funding": { + "url": "https://github.com/vitejs/vite?sponsor=1" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + }, + "peerDependencies": { + "@types/node": "^18.0.0 || ^20.0.0 || >=22.0.0", + "jiti": ">=1.21.0", + "less": "*", + "lightningcss": "^1.21.0", + "sass": "*", + "sass-embedded": "*", + "stylus": "*", + "sugarss": "*", + "terser": "^5.16.0", + "tsx": "^4.8.1", + "yaml": "^2.4.2" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "jiti": { + "optional": true + }, + "less": { + "optional": true + }, + "lightningcss": { + "optional": true + }, + "sass": { + "optional": true + }, + "sass-embedded": { + "optional": true + }, + "stylus": { + "optional": true + }, + "sugarss": { + "optional": true + }, + "terser": { + "optional": true + }, + "tsx": { + "optional": true + }, + "yaml": { + "optional": true + } + } + }, + "node_modules/vite/node_modules/@esbuild/aix-ppc64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.12.tgz", + "integrity": "sha512-Hhmwd6CInZ3dwpuGTF8fJG6yoWmsToE+vYgD4nytZVxcu1ulHpUQRAB1UJ8+N1Am3Mz4+xOByoQoSZf4D+CpkA==", + "cpu": [ + "ppc64" + ], + "license": "MIT", + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/vite/node_modules/@esbuild/android-arm": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.25.12.tgz", + "integrity": "sha512-VJ+sKvNA/GE7Ccacc9Cha7bpS8nyzVv0jdVgwNDaR4gDMC/2TTRc33Ip8qrNYUcpkOHUT5OZ0bUcNNVZQ9RLlg==", + "cpu": [ + "arm" + ], + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/vite/node_modules/@esbuild/android-arm64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.25.12.tgz", + "integrity": "sha512-6AAmLG7zwD1Z159jCKPvAxZd4y/VTO0VkprYy+3N2FtJ8+BQWFXU+OxARIwA46c5tdD9SsKGZ/1ocqBS/gAKHg==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/vite/node_modules/@esbuild/android-x64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.25.12.tgz", + "integrity": "sha512-5jbb+2hhDHx5phYR2By8GTWEzn6I9UqR11Kwf22iKbNpYrsmRB18aX/9ivc5cabcUiAT/wM+YIZ6SG9QO6a8kg==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/vite/node_modules/@esbuild/darwin-arm64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.25.12.tgz", + "integrity": "sha512-N3zl+lxHCifgIlcMUP5016ESkeQjLj/959RxxNYIthIg+CQHInujFuXeWbWMgnTo4cp5XVHqFPmpyu9J65C1Yg==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/vite/node_modules/@esbuild/darwin-x64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.25.12.tgz", + "integrity": "sha512-HQ9ka4Kx21qHXwtlTUVbKJOAnmG1ipXhdWTmNXiPzPfWKpXqASVcWdnf2bnL73wgjNrFXAa3yYvBSd9pzfEIpA==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/vite/node_modules/@esbuild/freebsd-arm64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.25.12.tgz", + "integrity": "sha512-gA0Bx759+7Jve03K1S0vkOu5Lg/85dou3EseOGUes8flVOGxbhDDh/iZaoek11Y8mtyKPGF3vP8XhnkDEAmzeg==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/vite/node_modules/@esbuild/freebsd-x64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.25.12.tgz", + "integrity": "sha512-TGbO26Yw2xsHzxtbVFGEXBFH0FRAP7gtcPE7P5yP7wGy7cXK2oO7RyOhL5NLiqTlBh47XhmIUXuGciXEqYFfBQ==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/vite/node_modules/@esbuild/linux-arm": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.25.12.tgz", + "integrity": "sha512-lPDGyC1JPDou8kGcywY0YILzWlhhnRjdof3UlcoqYmS9El818LLfJJc3PXXgZHrHCAKs/Z2SeZtDJr5MrkxtOw==", + "cpu": [ + "arm" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/vite/node_modules/@esbuild/linux-arm64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.25.12.tgz", + "integrity": "sha512-8bwX7a8FghIgrupcxb4aUmYDLp8pX06rGh5HqDT7bB+8Rdells6mHvrFHHW2JAOPZUbnjUpKTLg6ECyzvas2AQ==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/vite/node_modules/@esbuild/linux-ia32": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.25.12.tgz", + "integrity": "sha512-0y9KrdVnbMM2/vG8KfU0byhUN+EFCny9+8g202gYqSSVMonbsCfLjUO+rCci7pM0WBEtz+oK/PIwHkzxkyharA==", + "cpu": [ + "ia32" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/vite/node_modules/@esbuild/linux-loong64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.25.12.tgz", + "integrity": "sha512-h///Lr5a9rib/v1GGqXVGzjL4TMvVTv+s1DPoxQdz7l/AYv6LDSxdIwzxkrPW438oUXiDtwM10o9PmwS/6Z0Ng==", + "cpu": [ + "loong64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/vite/node_modules/@esbuild/linux-mips64el": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.25.12.tgz", + "integrity": "sha512-iyRrM1Pzy9GFMDLsXn1iHUm18nhKnNMWscjmp4+hpafcZjrr2WbT//d20xaGljXDBYHqRcl8HnxbX6uaA/eGVw==", + "cpu": [ + "mips64el" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/vite/node_modules/@esbuild/linux-ppc64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.25.12.tgz", + "integrity": "sha512-9meM/lRXxMi5PSUqEXRCtVjEZBGwB7P/D4yT8UG/mwIdze2aV4Vo6U5gD3+RsoHXKkHCfSxZKzmDssVlRj1QQA==", + "cpu": [ + "ppc64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/vite/node_modules/@esbuild/linux-riscv64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.25.12.tgz", + "integrity": "sha512-Zr7KR4hgKUpWAwb1f3o5ygT04MzqVrGEGXGLnj15YQDJErYu/BGg+wmFlIDOdJp0PmB0lLvxFIOXZgFRrdjR0w==", + "cpu": [ + "riscv64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/vite/node_modules/@esbuild/linux-s390x": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.25.12.tgz", + "integrity": "sha512-MsKncOcgTNvdtiISc/jZs/Zf8d0cl/t3gYWX8J9ubBnVOwlk65UIEEvgBORTiljloIWnBzLs4qhzPkJcitIzIg==", + "cpu": [ + "s390x" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/vite/node_modules/@esbuild/linux-x64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.25.12.tgz", + "integrity": "sha512-uqZMTLr/zR/ed4jIGnwSLkaHmPjOjJvnm6TVVitAa08SLS9Z0VM8wIRx7gWbJB5/J54YuIMInDquWyYvQLZkgw==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/vite/node_modules/@esbuild/netbsd-arm64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.25.12.tgz", + "integrity": "sha512-xXwcTq4GhRM7J9A8Gv5boanHhRa/Q9KLVmcyXHCTaM4wKfIpWkdXiMog/KsnxzJ0A1+nD+zoecuzqPmCRyBGjg==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/vite/node_modules/@esbuild/netbsd-x64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.25.12.tgz", + "integrity": "sha512-Ld5pTlzPy3YwGec4OuHh1aCVCRvOXdH8DgRjfDy/oumVovmuSzWfnSJg+VtakB9Cm0gxNO9BzWkj6mtO1FMXkQ==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/vite/node_modules/@esbuild/openbsd-arm64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.25.12.tgz", + "integrity": "sha512-fF96T6KsBo/pkQI950FARU9apGNTSlZGsv1jZBAlcLL1MLjLNIWPBkj5NlSz8aAzYKg+eNqknrUJ24QBybeR5A==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/vite/node_modules/@esbuild/openbsd-x64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.25.12.tgz", + "integrity": "sha512-MZyXUkZHjQxUvzK7rN8DJ3SRmrVrke8ZyRusHlP+kuwqTcfWLyqMOE3sScPPyeIXN/mDJIfGXvcMqCgYKekoQw==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/vite/node_modules/@esbuild/openharmony-arm64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.25.12.tgz", + "integrity": "sha512-rm0YWsqUSRrjncSXGA7Zv78Nbnw4XL6/dzr20cyrQf7ZmRcsovpcRBdhD43Nuk3y7XIoW2OxMVvwuRvk9XdASg==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/vite/node_modules/@esbuild/sunos-x64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.25.12.tgz", + "integrity": "sha512-3wGSCDyuTHQUzt0nV7bocDy72r2lI33QL3gkDNGkod22EsYl04sMf0qLb8luNKTOmgF/eDEDP5BFNwoBKH441w==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/vite/node_modules/@esbuild/win32-arm64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.25.12.tgz", + "integrity": "sha512-rMmLrur64A7+DKlnSuwqUdRKyd3UE7oPJZmnljqEptesKM8wx9J8gx5u0+9Pq0fQQW8vqeKebwNXdfOyP+8Bsg==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/vite/node_modules/@esbuild/win32-ia32": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.25.12.tgz", + "integrity": "sha512-HkqnmmBoCbCwxUKKNPBixiWDGCpQGVsrQfJoVGYLPT41XWF8lHuE5N6WhVia2n4o5QK5M4tYr21827fNhi4byQ==", + "cpu": [ + "ia32" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/vite/node_modules/@esbuild/win32-x64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.25.12.tgz", + "integrity": "sha512-alJC0uCZpTFrSL0CCDjcgleBXPnCrEAhTBILpeAp7M/OFgoqtAetfBzX0xM00MUsVVPpVjlPuMbREqnZCXaTnA==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/vite/node_modules/esbuild": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.25.12.tgz", + "integrity": "sha512-bbPBYYrtZbkt6Os6FiTLCTFxvq4tt3JKall1vRwshA3fdVztsLAatFaZobhkBC8/BrPetoa0oksYoKXoG4ryJg==", + "hasInstallScript": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.25.12", + "@esbuild/android-arm": "0.25.12", + "@esbuild/android-arm64": "0.25.12", + "@esbuild/android-x64": "0.25.12", + "@esbuild/darwin-arm64": "0.25.12", + "@esbuild/darwin-x64": "0.25.12", + "@esbuild/freebsd-arm64": "0.25.12", + "@esbuild/freebsd-x64": "0.25.12", + "@esbuild/linux-arm": "0.25.12", + "@esbuild/linux-arm64": "0.25.12", + "@esbuild/linux-ia32": "0.25.12", + "@esbuild/linux-loong64": "0.25.12", + "@esbuild/linux-mips64el": "0.25.12", + "@esbuild/linux-ppc64": "0.25.12", + "@esbuild/linux-riscv64": "0.25.12", + "@esbuild/linux-s390x": "0.25.12", + "@esbuild/linux-x64": "0.25.12", + "@esbuild/netbsd-arm64": "0.25.12", + "@esbuild/netbsd-x64": "0.25.12", + "@esbuild/openbsd-arm64": "0.25.12", + "@esbuild/openbsd-x64": "0.25.12", + "@esbuild/openharmony-arm64": "0.25.12", + "@esbuild/sunos-x64": "0.25.12", + "@esbuild/win32-arm64": "0.25.12", + "@esbuild/win32-ia32": "0.25.12", + "@esbuild/win32-x64": "0.25.12" + } + }, + "node_modules/vitefu": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/vitefu/-/vitefu-1.1.3.tgz", + "integrity": "sha512-ub4okH7Z5KLjb6hDyjqrGXqWtWvoYdU3IGm/NorpgHncKoLTCfRIbvlhBm7r0YstIaQRYlp4yEbFqDcKSzXSSg==", + "license": "MIT", + "workspaces": [ + "tests/deps/*", + "tests/projects/*", + "tests/projects/workspace/packages/*" + ], + "peerDependencies": { + "vite": "^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "vite": { + "optional": true + } + } + }, + "node_modules/web-namespaces": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/web-namespaces/-/web-namespaces-2.0.1.tgz", + "integrity": "sha512-bKr1DkiNa2krS7qxNtdrtHAmzuYGFQLiQ13TsorsdT6ULTkPLKuu5+GsFpDlg6JFjUTwX2DyhMPG2be8uPrqsQ==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/which-pm-runs": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/which-pm-runs/-/which-pm-runs-1.1.0.tgz", + "integrity": "sha512-n1brCuqClxfFfq/Rb0ICg9giSZqCS+pLtccdag6C2HyufBrh3fBOiy9nb6ggRMvWOVH5GrdJskj5iGTZNxd7SA==", + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/widest-line": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-5.0.0.tgz", + "integrity": "sha512-c9bZp7b5YtRj2wOe6dlj32MK+Bx/M/d+9VB2SHM1OtsUHR0aV0tdP6DWh/iMt0kWi1t5g1Iudu6hQRNd1A4PVA==", + "license": "MIT", + "dependencies": { + "string-width": "^7.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/wrap-ansi": { + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-9.0.2.tgz", + "integrity": "sha512-42AtmgqjV+X1VpdOfyTGOYRi0/zsoLqtXQckTmqTeybT+BDIbM/Guxo7x3pE2vtpr1ok6xRqM9OpBe+Jyoqyww==", + "license": "MIT", + "dependencies": { + "ansi-styles": "^6.2.1", + "string-width": "^7.0.0", + "strip-ansi": "^7.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/xxhash-wasm": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/xxhash-wasm/-/xxhash-wasm-1.1.0.tgz", + "integrity": "sha512-147y/6YNh+tlp6nd/2pWq38i9h6mz/EuQ6njIrmW8D1BS5nCqs0P6DG+m6zTGnNz5I+uhZ0SHxBs9BsPrwcKDA==", + "license": "MIT" + }, + "node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/yocto-queue": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.2.2.tgz", + "integrity": "sha512-4LCcse/U2MHZ63HAJVE+v71o7yOdIe4cZ70Wpf8D/IyjDKYQLV5GD46B+hSTjJsvV5PztjvHoU580EftxjDZFQ==", + "license": "MIT", + "engines": { + "node": ">=12.20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/yocto-spinner": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/yocto-spinner/-/yocto-spinner-0.2.3.tgz", + "integrity": "sha512-sqBChb33loEnkoXte1bLg45bEBsOP9N1kzQh5JZNKj/0rik4zAPTNSAVPj3uQAdc6slYJ0Ksc403G2XgxsJQFQ==", + "license": "MIT", + "dependencies": { + "yoctocolors": "^2.1.1" + }, + "engines": { + "node": ">=18.19" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/yoctocolors": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/yoctocolors/-/yoctocolors-2.1.2.tgz", + "integrity": "sha512-CzhO+pFNo8ajLM2d2IW/R93ipy99LWjtwblvC1RsoSUMZgyLbYFr221TnSNT7GjGdYui6P459mw9JH/g/zW2ug==", + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/zod": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/zod/-/zod-4.4.3.tgz", + "integrity": "sha512-ytENFjIJFl2UwYglde2jchW2Hwm4GJFLDiSXWdTrJQBIN9Fcyp7n4DhxJEiWNAJMV1/BqWfW/kkg71UDcHJyTQ==", + "license": "MIT", + "peer": true, + "funding": { + "url": "https://github.com/sponsors/colinhacks" + } + }, + "node_modules/zod-to-json-schema": { + "version": "3.25.2", + "resolved": "https://registry.npmjs.org/zod-to-json-schema/-/zod-to-json-schema-3.25.2.tgz", + "integrity": "sha512-O/PgfnpT1xKSDeQYSCfRI5Gy3hPf91mKVDuYLUHZJMiDFptvP41MSnWofm8dnCm0256ZNfZIM7DSzuSMAFnjHA==", + "license": "ISC", + "peerDependencies": { + "zod": "^3.25.28 || ^4" + } + }, + "node_modules/zwitch": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/zwitch/-/zwitch-2.0.4.tgz", + "integrity": "sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 00000000..8dfd03a8 --- /dev/null +++ b/package.json @@ -0,0 +1,21 @@ +{ + "name": "codeanalyzer-java-docs", + "type": "module", + "version": "0.0.1", + "scripts": { + "dev": "astro dev", + "start": "astro dev", + "build": "astro build", + "preview": "astro preview", + "astro": "astro" + }, + "dependencies": { + "@astrojs/starlight": "^0.37.6", + "@expressive-code/plugin-collapsible-sections": "^0.42.0", + "@expressive-code/plugin-line-numbers": "^0.42.0", + "astro": "^5.18.0", + "astro-mermaid": "^2.0.2", + "mermaid": "^11.15.0", + "sharp": "^0.34.2" + } +} diff --git a/docs/assets/logo.png b/public/assets/images/codeanalyzer.png similarity index 100% rename from docs/assets/logo.png rename to public/assets/images/codeanalyzer.png diff --git a/public/favicon.png b/public/favicon.png new file mode 100644 index 00000000..4c32c517 Binary files /dev/null and b/public/favicon.png differ diff --git a/settings.gradle b/settings.gradle deleted file mode 100644 index a6b36d6a..00000000 --- a/settings.gradle +++ /dev/null @@ -1,20 +0,0 @@ -/* -Copyright IBM Corporation 2023, 2024 - -Licensed under the Apache Public License 2.0, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -pluginManagement { - plugins { - id 'org.jetbrains.kotlin.jvm' version '2.1.10' - } -} -plugins { - id 'org.gradle.toolchains.foojay-resolver-convention' version '0.8.0' -} diff --git a/src/assets/logo.png b/src/assets/logo.png new file mode 100644 index 00000000..93cab6b3 Binary files /dev/null and b/src/assets/logo.png differ diff --git a/src/components/Neo4jPropertyGraph.astro b/src/components/Neo4jPropertyGraph.astro new file mode 100644 index 00000000..7252cdbf --- /dev/null +++ b/src/components/Neo4jPropertyGraph.astro @@ -0,0 +1,121 @@ +--- +// AUTO-GENERATED property-graph hero for java. Encodes the real Neo4j schema +// (node labels, typed relationships, key properties). Theme-aware via Starlight +// CSS custom properties; renders as static SVG (no client JS). +--- +
+ + + + + + + + + + + + + + + + + +J_HAS_UNIT + +J_DECLARES_TYPE + +J_HAS_FIELD + +J_HAS_CALLABLE + +J_HAS_PARAMETER + +J_HAS_CALLSITE + +J_RESOLVES_TO + +J_CALLS + + +:JApplication +name +schema_version + + +:JCompilationUnit +file_path +package_name + + +:JType +:JSymbol +fqn +is_interface + + +:JField +name +type + + + +:JCallable +:JSymbol +★ :JEntrypoint +signature +cyclomatic_complexity + + +:JParameter +name +type + + +:JCallSite +method_name +receiver_type + + +:JCallable +name +is_entrypoint + +
+ The analysis is a Neo4j property graph: every node carries a + label (its color) and properties; every relationship carries a + type. The dashed ring marks an :JEntrypoint; + the J_CALLS edge is the resolved call graph. +
+
+ + diff --git a/src/content.config.ts b/src/content.config.ts new file mode 100644 index 00000000..d9ee8c9d --- /dev/null +++ b/src/content.config.ts @@ -0,0 +1,7 @@ +import { defineCollection } from 'astro:content'; +import { docsLoader } from '@astrojs/starlight/loaders'; +import { docsSchema } from '@astrojs/starlight/schema'; + +export const collections = { + docs: defineCollection({ loader: docsLoader(), schema: docsSchema() }), +}; diff --git a/src/content/docs/contributing.mdx b/src/content/docs/contributing.mdx new file mode 100644 index 00000000..2374a763 --- /dev/null +++ b/src/content/docs/contributing.mdx @@ -0,0 +1,110 @@ +--- +title: Contributing +description: How to build, test, and extend codeanalyzer-java — adding framework finders, evolving the schema, and keeping native-image config current. +--- + +import { Steps, Aside, LinkCard, CardGrid } from "@astrojs/starlight/components"; + +codeanalyzer-java is open source under the Apache 2.0 license. Contributions — bug fixes, new framework finders, schema enrichments — are welcome. + +## Build and test locally + + + +1. **Install a JDK (11+)** and clone: + + ```bash + sdk install java 17.0.10-sem + git clone https://github.com/codellm-devkit/codeanalyzer-java + cd codeanalyzer-java + ``` + +2. **Build the fat JAR:** + + ```bash + ./gradlew fatJar + # build/libs/codeanalyzer-2.3.7.jar + ``` + +3. **Run the test suite:** + + ```bash + ./gradlew test + ``` + +4. **Try it against a sample project:** + + ```bash + java -jar build/libs/codeanalyzer-2.3.7.jar \ + -i src/test/resources/test-applications/ \ + -a 2 -v + ``` + + + + + +## Where things live + +The codebase is organized under `com.ibm.cldk` (see [Architecture](/codeanalyzer-java/guides/architecture/) for the full map): + +- **`CodeAnalyzer.java`** — the CLI orchestrator; add or change flags here. +- **`SymbolTable.java`** — Javaparser symbol extraction. +- **`SystemDependencyGraph.java`** — WALA call-graph construction. +- **`entities/`** — the output data model. Changing these changes the [JSON schema](/codeanalyzer-java/schema/). +- **`javaee/`** — framework finders, dispatched by `EntrypointsFinderFactory` and `CRUDFinderFactory`. +- **`utils/BuildProject.java`** — Maven/Gradle build and dependency download. + +## Adding a framework finder + +Entry-point and CRUD detection are pluggable per framework. To add support for a new framework: + + + +1. **Pick the dimension** — entry points, CRUD, or both — and find the matching factory (`EntrypointsFinderFactory` / `CRUDFinderFactory`). + +2. **Add a finder** under `javaee//` implementing the finder interface, with the annotations / superclasses / interfaces / method conventions that identify the construct (mirror an existing finder like the Spring or JAX-RS ones). + +3. **Register it** in the factory so it's selected when that framework is present. + +4. **Set the schema flags** — entry-point finders mark `is_entrypoint` / `is_entrypoint_class`; CRUD finders populate `crud_operations` / `crud_queries`. + +5. **Add a test application** under `src/test/resources/test-applications/` and assert the expected output. + + + +See the existing [entry-point](/codeanalyzer-java/frameworks/entry-points/) and [CRUD](/codeanalyzer-java/frameworks/crud/) coverage for the patterns to follow. The Camel finder is a good example of a stub awaiting completion. + +## Evolving the schema + +The output JSON is a versioned contract that the [CLDK Python SDK](/codeanalyzer-java/integration/python-sdk/) and other consumers depend on. + +- Changing an `entities/` class changes the wire format. Field names serialize as `snake_case`. +- For incompatible changes, bump the version (in `gradle.properties`) and, where feasible, add a guard for the old shape — as was done for the legacy string-import format. +- Update the [schema docs](/codeanalyzer-java/schema/) alongside the code. + +## Keeping native-image config current + +If you add reflection-dependent code, regenerate the native-image config so the [native binary](/codeanalyzer-java/installing/#option-2-native-binary-graalvm) keeps working: + +```bash +./gradlew fatJar +java -agentlib:native-image-agent=config-output-dir=src/main/resources/META-INF/native-image-config \ + -jar build/libs/codeanalyzer-2.3.7.jar -i -a 2 -v +./gradlew nativeCompile +``` + +## Opening a PR + +- Branch from `main`, keep changes focused, and include a test. +- Run `./gradlew spotlessApply test` before pushing. +- Reference any related issue in the PR description. + + + + + + +Found a limitation? Open an [issue](https://github.com/codellm-devkit/codeanalyzer-java/issues) with details. diff --git a/src/content/docs/frameworks/crud.mdx b/src/content/docs/frameworks/crud.mdx new file mode 100644 index 00000000..2e76a22e --- /dev/null +++ b/src/content/docs/frameworks/crud.mdx @@ -0,0 +1,120 @@ +--- +title: CRUD detection +description: How codeanalyzer-java detects database operations — JPA persistence calls and queries classified as CREATE / READ / UPDATE / DELETE — and where they appear in the schema. +--- + +import { Aside } from "@astrojs/starlight/components"; + +codeanalyzer-java surfaces data-access patterns by detecting **CRUD operations** in method bodies and attaching them to the relevant [callable](/codeanalyzer-java/schema/symbol-table/#callable-jcallable). This lets you audit where an application reads from and writes to persistent storage without reading every method by hand. + +Detection is dispatched per framework by a `CRUDFinderFactory`. Today **JPA / Jakarta Persistence** detection is fully implemented; **Spring Data** and **JDBC** finders exist but are currently stubs. + +## Where it appears + +Each callable carries two arrays: + +```typescript +{ + crud_operations: JCRUDOperation[] // persistence operations (persist/find/merge/remove, ...) + crud_queries: JCRUDQuery[] // query definitions (createQuery / createNamedQuery) +} +``` + +## CRUD operations (`JCRUDOperation`) + +```typescript +{ + line_number: number + operation_type: "CREATE" | "READ" | "UPDATE" | "DELETE" + target_table: string // reserved — not yet populated + involved_columns: string[] // reserved — not yet populated + condition: string // reserved — not yet populated + joined_tables: string[] // reserved — not yet populated +} +``` + +### JPA operation mapping + +For JPA, calls on the `EntityManager` and on query objects map to operation types: + +| Operation type | Detected from | +|----------------|---------------| +| **CREATE** | `EntityManager.persist(...)` | +| **READ** | `EntityManager.find(...)`; query execution `getResultList()`, `getSingleResult()`, `getFirstResult()`, `getMaxResults()` | +| **UPDATE** | `EntityManager.merge(...)`; query `executeUpdate()` | +| **DELETE** | `EntityManager.remove(...)` | + + + +## CRUD queries (`JCRUDQuery`) + +Query *definitions* (as opposed to executions) are captured separately: + +```typescript +{ + line_number: number + query_arguments: string[] // the query string and any parameters + query_type: "READ" | "WRITE" | "NAMED" +} +``` + +These come from `EntityManager.createQuery(String)` and `EntityManager.createNamedQuery(String)`. The `query_type` is inferred from the query text: + +| `query_type` | Inferred when | +|--------------|---------------| +| **READ** | the query string begins with `select` | +| **WRITE** | the query string begins with `update`, `delete`, or `insert` | +| **NAMED** | the query was created via `createNamedQuery(...)` | + +## Coverage and limits + +- **JPA / Jakarta Persistence** — implemented as described above. +- **Spring Data** — finder present but stubbed; repository-derived queries are not yet classified. +- **JDBC** — finder present but stubbed; raw `Statement` / `PreparedStatement` calls are not yet classified. +- The `target_table`, `involved_columns`, `condition`, and `joined_tables` fields on `JCRUDOperation` are reserved for future enrichment and are not populated yet. + + + +## In the Neo4j graph + +When you project the analysis with `--emit neo4j`, CRUD detection is not flattened into the callable — it becomes **first-class graph structure**. Each detected operation is a `:JCrudOperation` node and each query a `:JCrudQuery` node, hung off its owning `:JCallable` or `:JCallSite`: + +```cypher +(:JCallable | :JCallSite)-[:J_HAS_CRUD_OPERATION]->(:JCrudOperation) +(:JCallable | :JCallSite)-[:J_HAS_CRUD_QUERY]->(:JCrudQuery) +``` + +That turns "where does this application write to persistent storage?" into a Cypher traversal across the whole graph — and, once many applications share one database, across the entire portfolio. For example, every method that issues a write: + +```cypher +MATCH (c:JCallable)-[:J_HAS_CRUD_OPERATION]->(op:JCrudOperation) +WHERE op.operation_type IN ['CREATE', 'UPDATE', 'DELETE'] +RETURN c.signature, op.operation_type +``` + +`JCrudOperation` exposes `operation_type` along with the `target_table`, `involved_columns`, `condition`, and `joined_tables` properties — keep in mind those last four are reserved (see above), so today you filter on `operation_type`. See the [Neo4j graph-schema reference](/codeanalyzer-java/schema/neo4j-graph/) for the full node and relationship inventory. + +## Using it downstream + +```python +from cldk import CLDK +from cldk.analysis import AnalysisLevel + +analysis = CLDK.java( + project_path="my-app", + analysis_level=AnalysisLevel.symbol_table, +) + +for cls in analysis.get_classes(): + for sig, m in analysis.get_methods_in_class(cls).items(): + for op in m.crud_operations: + print(f"{op.operation_type} at {cls}:{op.line_number}") +``` + +The same query works unchanged against a graph that was produced out of band: pass a `Neo4jConnectionConfig` instead of `project_path` and the read-only Neo4j backend reconstructs the identical models — no JDK, native binary, or project source required. Set `application_name` to the `--app-name` the graph was loaded with. See the [Neo4j graph output guide](/codeanalyzer-java/guides/neo4j-output/) for the full read-back flow. + +Combine with [entry-point](/codeanalyzer-java/frameworks/entry-points/) and call-graph data to answer questions like "which externally-reachable methods perform writes?" diff --git a/src/content/docs/frameworks/entry-points.mdx b/src/content/docs/frameworks/entry-points.mdx new file mode 100644 index 00000000..9413ddc5 --- /dev/null +++ b/src/content/docs/frameworks/entry-points.mdx @@ -0,0 +1,114 @@ +--- +title: Entry points +description: How codeanalyzer-java identifies program entry points — main methods plus Spring, JAX-RS, Struts, and Jakarta/Servlet endpoints — and how that surfaces in the schema. +--- + +import { Aside, Tabs, TabItem } from "@astrojs/starlight/components"; + +An **entry point** is a method the runtime (or a framework) can invoke without an in-program caller: a `main`, a REST handler, a servlet, a scheduled job. They matter because they anchor the WALA [call graph](/codeanalyzer-java/schema/call-graph/) and seed reachability — a taint path has to start *somewhere*. + +codeanalyzer-java detects entry points through an `EntrypointsFinderFactory` that dispatches to per-framework finders. Detected entry points surface in the schema as: + +- `type.is_entrypoint_class` — `true` on the [type](/codeanalyzer-java/schema/symbol-table/#type-jtype) when it's a recognized entry-point class (including any class with a `main(String[])`). +- `callable.is_entrypoint` — `true` on the [callable](/codeanalyzer-java/schema/symbol-table/#callable-jcallable) for the specific entry-point method. + +## Supported frameworks + + + +**Class-level annotations:** `@RestController`, `@Controller`, `@HandlerInterceptor`, `@SpringBootApplication`, `@Configuration`, `@Component`, `@Service`, `@Repository`. + +**Interfaces:** classes implementing `CommandLineRunner` or `ApplicationRunner`. + +**Method-level annotations:** `@GetMapping`, `@PostMapping`, `@PutMapping`, `@DeleteMapping`, `@PatchMapping`, `@RequestMapping`, `@EventListener`, `@Scheduled`, `@KafkaListener`, `@RabbitListener`, `@JmsListener`, `@PreAuthorize`, `@PostAuthorize`, `@PostConstruct`, `@PreDestroy`, plus AOP advice (`@Around`, `@Before`, `@After`) and batch scopes (`@JobScope`, `@StepScope`). + + +**HTTP-method annotations** (at class or method level) mark REST resource methods: `@GET`, `@POST`, `@PUT`, `@DELETE`, `@HEAD`. + + +**Class-level annotations:** `@Action`, `@Namespace`, `@InterceptorRef`. + +**Superclass / interface:** classes extending `ActionSupport` or implementing `Interceptor`. + +**Method-level annotations:** `@Action`, `@Actions`, `@ValidationMethod`, `@InputConfig`, `@BeforeResult`, `@Before`, `@After`, `@Result`, `@Results`. + +**Convention:** a method named `execute()`. + + +**Class-level annotations:** `@WebServlet`, `@WebFilter`, `@WebListener`, `@ServerEndpoint`, `@MessageDriven`, `@WebService`. + +**Superclasses:** classes extending `HttpServlet` or `GenericServlet`. + +**Interfaces:** classes implementing `ServletContextListener`, `HttpSessionListener`, `ServletRequestListener`, or `MessageListener`. + +**Method signature:** methods taking `HttpServletRequest` or `HttpServletResponse` parameters. + + + +## Plain `main` methods + +Independent of any framework, a class declaring `public static void main(String[] args)` is an entry point. Its type gets `is_entrypoint_class: true` and the `main` callable gets `is_entrypoint: true`. This is the baseline anchor for ordinary applications. + + + +## Why entry points matter for the call graph + +WALA builds the call graph by traversing outward from entry points. If a project has no `main` and none of the framework patterns above match, WALA may have nothing to anchor on and the `call_graph` can come back empty. When that happens, confirm the project actually has a recognized entry point — see [Troubleshooting](/codeanalyzer-java/troubleshooting/). + +## Using entry points downstream + +Once analyzed, you can filter on the flags to drive reachability. Via the Python SDK, against an in-process analysis: + +```python +analysis = CLDK(language="java").analysis( + project_path="my-web-app", + analysis_level=AnalysisLevel.call_graph, +) + +# Every method flagged as an entry point +entrypoints = [ + (cls, sig) + for cls in analysis.get_classes() + for sig, m in analysis.get_methods_in_class(cls).items() + if m.is_entrypoint +] +``` + +Seed a `networkx` reachability query from these to ask whether a sink is reachable from any externally-invocable method. + +## Entry points in the Neo4j projection + +When you project to a Neo4j property graph with [`--emit neo4j`](/codeanalyzer-java/guides/neo4j-output/), the `is_entrypoint` / `is_entrypoint_class` properties are still carried on the `:JCallable` and `:JType` nodes — but the projection *also* layers a marker label, `:JEntrypoint`, onto the owning callable (and entry-point class). That turns reachability seeding into a one-line `MATCH` instead of a property filter: + +```cypher +// Every entry-point method in one application — the reachability seeds +MATCH (a:JApplication {name: 'daytrader8'})-[:J_HAS_UNIT]->(:JCompilationUnit) + -[:J_DECLARES_TYPE]->(:JType)-[:J_HAS_CALLABLE]->(c:JCallable:JEntrypoint) +RETURN c.signature +``` + +From there you traverse `J_CALLS` edges (present once you analyze at [level 2](/codeanalyzer-java/guides/analysis-levels/)) to ask the same reachability question entirely in Cypher, across every application in the database. Reading the seeds back through the SDK is identical to the in-process path above — point the facade at the graph and the same typed `JCallable` objects come back, with no JDK, native binary, or project source on the consumer: + +```python +from cldk import CLDK +from cldk.analysis import AnalysisLevel +from cldk.analysis.commons.backend_config import Neo4jConnectionConfig + +analysis = CLDK.java( + analysis_level=AnalysisLevel.call_graph, + backend=Neo4jConnectionConfig( + uri="bolt://localhost:7687", + username="neo4j", + password="neo4j", # or set NEO4J_PASSWORD + application_name="daytrader8", # must match the --app-name the graph was loaded with + ), +) + +entrypoints = analysis.get_entry_point_methods() +``` + + diff --git a/src/content/docs/guides/analysis-levels.mdx b/src/content/docs/guides/analysis-levels.mdx new file mode 100644 index 00000000..17e4a245 --- /dev/null +++ b/src/content/docs/guides/analysis-levels.mdx @@ -0,0 +1,67 @@ +--- +title: Analysis levels +description: codeanalyzer-java has two analysis levels — level 1 builds the symbol table, level 2 adds the WALA call graph. What each computes, what it costs, and when to use which. +--- + +import { Aside, CardGrid, LinkCard } from "@astrojs/starlight/components"; + +The `-a` / `--analysis-level` flag selects how much work codeanalyzer-java does. There are two levels. + +| Level | Produces | Builds the project? | Relative cost | +|-------|----------|---------------------|---------------| +| **1** (default) | `symbol_table` only | No (source parse only) | Fast | +| **2** | `symbol_table` + `call_graph` | Yes, by default | Slower | + +## Level 1 — Symbol table + +```bash +java -jar codeanalyzer-2.3.7.jar -i /path/to/project -a 1 -o ./output +``` + +Level 1 runs only the Javaparser pipeline. It parses every `.java` file and produces the [symbol table](/codeanalyzer-java/schema/symbol-table/): all types, their fields, methods and constructors, comments, and imports — with source locations, method bodies, and cyclomatic complexity. + +It does **not** build the project. Library dependencies are still downloaded for type resolution (so qualified names resolve), but no compilation of *your* code is required. This makes level 1 the fast path, suitable when you only need program structure — not who-calls-whom. + + + +## Level 2 — Symbol table + call graph + +```bash +java -jar codeanalyzer-2.3.7.jar -i /path/to/project -a 2 -o ./output -v +``` + +Level 2 does everything level 1 does, then runs WALA to build an interprocedural [call graph](/codeanalyzer-java/schema/call-graph/). The result is a `call_graph` array of caller→callee edges added alongside the symbol table. + +Because WALA analyzes the *compiled* program, level 2 builds the project by default (auto-detecting Maven or Gradle). You can control this: + +- **`-b ""`** — supply a custom build command instead of auto-build. +- **`--no-build`** — skip building entirely; use this when the project is already compiled. + +See [Build integration](/codeanalyzer-java/guides/build-integration/) for how the build is invoked. + + + +## The level also shapes the Neo4j graph + +The analysis level governs the [Neo4j projection](/codeanalyzer-java/guides/neo4j-output/) the same way it governs `analysis.json`. Level 1 emits the lossless symbol-table subgraph — compilation units, types, callables, fields, and the rest — with **no `J_CALLS` edges**. Level 2 adds the call graph as `(:JCallable)-[:J_CALLS]->(:JCallable)` relationships on top of it. + +This carries through the `-t` downgrade: because passing `-t` with `-a 2` forces level 1, a targeted incremental Bolt push (`--emit neo4j -t ...`) replaces only the changed units' symbol-table subgraphs and **carries no call edges**. Refresh `J_CALLS` with a full level-2 run. + +## Choosing a level + +- **Use level 1** when you need the program's *structure*: listing classes and methods, reading method bodies, finding fields, extracting Javadoc, surveying imports, or doing incremental per-file updates. +- **Use level 2** when you need *reachability* or *call relationships*: who calls a method, what a method transitively reaches, or seeding a taint/reachability query from an entry point. + +## Next steps + + + + + + + + diff --git a/src/content/docs/guides/architecture.mdx b/src/content/docs/guides/architecture.mdx new file mode 100644 index 00000000..0ff9ef55 --- /dev/null +++ b/src/content/docs/guides/architecture.mdx @@ -0,0 +1,148 @@ +--- +title: Architecture +description: How codeanalyzer-java is built — the Javaparser symbol-extraction pipeline, WALA call-graph construction, the package layout, and the core dependencies. +--- + +import { Aside, FileTree } from "@astrojs/starlight/components"; + +codeanalyzer-java combines two complementary static-analysis technologies behind a single CLI. The same intermediate representation (IR) — a symbol table plus an optional call graph — is emitted either as the canonical `analysis.json` or as a Neo4j property graph. This page describes how the pieces fit together. + +## The analysis pipeline + +```mermaid +graph LR + A["Java source files"] --> B["Javaparser
+ Symbol Solver"] + B --> C["Symbol Table"] + C --> D["Type & Method
extraction"] + D --> IR["In-memory IR
(symbol table + call graph)"] + + G["Built project
+ dependencies"] --> H["WALA
ClassHierarchy"] + H --> I["Call graph
construction"] + I --> J["call_graph edges"] + J --> IR + + IR -->|"default (--emit json)"| E["Gson serialization"] + E --> F["analysis.json"] + + IR -->|"--emit neo4j"| GP["GraphProjector
.project()"] + GP --> GR["GraphRows
(nodes + relationships)"] + GR -->|"no Bolt URI"| CW["CypherWriter"] + CW --> SNAP["graph.cypher snapshot"] + GR -->|"URI present (fat jar)"| BW["BoltWriter"] + BW --> N4J["Neo4j property graph
(live, incremental)"] +``` + +There are two analysis tracks that converge into one IR, which then fans out to one of two emitters: + +1. **Symbol extraction (Javaparser).** Always runs. Parses each `.java` file into an AST, resolves types against downloaded library dependencies (or, for single-source mode, against the JDK only), and walks the AST to collect types, callables, fields, comments, and imports. + +2. **Call-graph construction (WALA).** Runs only at [analysis level 2](/codeanalyzer-java/guides/analysis-levels/). Builds a class hierarchy from the compiled project and computes an interprocedural call graph, emitted as caller→callee edges. + +By default both tracks are serialized by Gson into a single `analysis.json` whose field names use `lower_case_with_underscores`, with nulls preserved (`serializeNulls`) so consumers see a stable shape. With `--emit neo4j`, the *same* IR is instead projected into a Neo4j property graph — a **lossless** projection where every IR entity becomes a first-class node or relationship. + +### Stage by stage + +The CLI orchestrator (`CodeAnalyzer`) runs roughly this sequence: + +1. **Resolve inputs** — determine project root, output path, analysis level, emit target, and whether to build. +2. **Download dependencies** — `BuildProject` invokes Maven/Gradle to fetch library JARs into a temporary `_library_dependencies` directory, used by the symbol solver for type resolution. See [Build integration](/codeanalyzer-java/guides/build-integration/). +3. **Extract symbol table** — `SymbolTable` parses sources. There are three entry points: `extractAll` (whole project), `extract` (specific [target files](/codeanalyzer-java/guides/incremental-analysis/)), and `extractSingle` (a source string). +4. **Construct call graph** (level 2 only) — `SystemDependencyGraph` runs WALA over the built project and produces a list of edges. +5. **Clean up** — the temporary dependency directory is removed (unless `--no-clean-dependencies` is set). +6. **Emit** — selected by `--emit` (default `json`): + - **`json`** — Gson serializes `{ symbol_table, call_graph?, version }` to `analysis.json`, or to stdout if no output directory was given. + - **`neo4j`** — projects the IR to a Neo4j property graph instead of writing `analysis.json` (see below). This is an *alternative*, not an addition: when `emit == neo4j` the analyzer returns without writing `analysis.json`. + - **`schema`** — prints the machine-readable schema contract (`schema.neo4j.json`) and returns before any project analysis. Useful for publishing the graph's versioned shape to consumers. + + + +### The Neo4j emit path + +When `--emit neo4j` is given, the orchestrator hands the in-memory IR to `GraphProjector.project()`, which turns it into `GraphRows` — a flat, batched set of node and relationship rows that mirrors the [graph schema](/codeanalyzer-java/schema/). At level 2 the projection also includes `J_CALLS` edges from the WALA call graph; at level 1 it emits the lossless symbol-table subgraph with no `J_CALLS`. Every emitted graph is anchored at a single `:JApplication` node (keyed on `--app-name`) and stamped with `schema_version` `1.0.0`. + +`GraphRows` is then handed to one of two writers, chosen purely by whether a Bolt URI resolved (the `--neo4j-uri` flag or the `NEO4J_URI` environment variable): + +- **No URI → `CypherWriter`.** Renders a self-contained, re-runnable `graph.cypher` snapshot: the constraints and indexes, a *scoped wipe* of this application's prior subgraph, then batched `UNWIND … MERGE` statements (batch size 500) for nodes and edges. The snapshot is **not** incremental — it expresses the full truth of one analysis run. Load it with `cypher-shell < graph.cypher`. + +- **URI present → `BoltWriter`.** Pushes incrementally over the official Neo4j Java driver: it ensures constraints/indexes, diffs each compilation unit's `content_hash` (a SHA-256 over the unit) against the live database, and replaces *only* changed units' subgraphs via idempotent `MERGE` upserts (batch size 1000). Shared `:JPackage`/`:JAnnotation` nodes are `MERGE`-only so they coexist across applications. On a full run it prunes units whose source file has vanished; on a [targeted run](/codeanalyzer-java/guides/incremental-analysis/) (`-t`) that orphan pruning is skipped. + +This is the producer side of a producer/consumer split: the analyzer runs out-of-band (a CI job or Kubernetes `CronJob`) and pushes app-scoped subgraphs into a shared cluster, while lightweight read-only consumers — agents, dashboards, and the [CLDK Python SDK](/codeanalyzer-java/integration/python-sdk/) — fan out reads from it. See the [Neo4j graph guide](/codeanalyzer-java/guides/neo4j-output/) for the full producer/consumer story. + + + +## Package structure + +The analyzer lives under the `com.ibm.cldk` package: + + +- com.ibm.cldk + - CodeAnalyzer.java CLI entry point; orchestrates the pipeline + - SymbolTable.java Javaparser-based symbol extraction + - SystemDependencyGraph.java WALA-based call-graph construction + - entities/ Output data model (serialized to JSON) + - JavaCompilationUnit.java one .java file: types + imports + comments + - Type.java class / interface / enum / record + - Callable.java method or constructor + - Field.java member field + - Comment.java Javadoc / inline comment + - Import.java import declaration (path, static, wildcard) + - CallableVertex.java call-graph node + - CallEdge.java call-graph edge + - CallSite.java an individual call within a method body + - CRUDOperation.java a detected DB operation + - CRUDQuery.java a detected query definition + - ... + - neo4j/ Neo4j property-graph projection (`--emit neo4j`) + - Neo4jEmitter.java emit entry point; picks snapshot vs. live Bolt + - GraphProjector.java IR → graph nodes + relationships + - RowBuilder.java builds per-label/relationship row sets + - GraphRows.java the batched node + relationship payload + - CypherWriter.java renders the re-runnable graph.cypher snapshot + - BoltWriter.java incremental, content_hash-diffed live push + - BoltSink.java reflective seam over the Neo4j driver + - BoltConfig.java driver-free Bolt connection config + - SchemaCatalog.java builds schema.neo4j.json (`--emit schema`) + - Schema.java constraints + indexes DDL (labels, fulltext) + - javaee/ framework-specific finders + - EntrypointsFinderFactory.java selects entry-point detectors + - CRUDFinderFactory.java selects CRUD detectors + - spring/ Spring detectors + - struts/ Struts detectors + - jax/ JAX-RS detectors + - jakarta/ Servlet / JPA detectors + - camel/ Camel (stub) + - utils/ + - BuildProject.java Maven/Gradle build + dependency download + - Log.java verbosity-aware logging + + +## Core dependencies + +| Library | Version | Role | +|---------|---------|------| +| **WALA** | 1.6.7 | Class hierarchy, interprocedural call graph (`shrike`, `util`, `core`, `cast`, `cast.java`, `cast.java.ecj`) | +| **Javaparser** | — | Source parsing and symbol/type resolution | +| **Eclipse JDT** | 3.21.0 | Backing compiler/AST infrastructure used during analysis | +| **Picocli** | 4.1.0 | Command-line interface | +| **Gson** | 2.10.1 | JSON serialization of the output schema | +| **Neo4j Java driver** | 4.4.12 | Live, incremental Bolt push for `--emit neo4j --neo4j-uri …` | +| **JGraphT** | 1.5.2 | Graph data structures | +| **Guava** | 33.0.0 | General utilities | +| **Log4j** | 2.18.0 | Logging | + +The whole set is shaded into one fat JAR by `./gradlew fatJar`, so a single `java -jar` invocation has everything it needs — including the Neo4j driver for the live Bolt push. + + + +## Where to go next + +- [Analysis levels](/codeanalyzer-java/guides/analysis-levels/) — what level 1 vs. level 2 actually compute. +- [Build integration](/codeanalyzer-java/guides/build-integration/) — how dependency download and project builds work. +- [Neo4j property graph](/codeanalyzer-java/guides/neo4j-output/) — the producer/consumer architecture, snapshot vs. live Bolt, and multi-tenant graph design. +- [Output schema](/codeanalyzer-java/schema/) — the JSON and the Neo4j graph these stages produce. diff --git a/src/content/docs/guides/build-integration.mdx b/src/content/docs/guides/build-integration.mdx new file mode 100644 index 00000000..8ee167e3 --- /dev/null +++ b/src/content/docs/guides/build-integration.mdx @@ -0,0 +1,82 @@ +--- +title: Build integration +description: How codeanalyzer-java auto-detects Maven and Gradle, downloads library dependencies for type resolution, and builds the project for WALA call-graph construction. +--- + +import { Aside, Tabs, TabItem } from "@astrojs/starlight/components"; + +Accurate analysis needs two things from the build system: **resolved dependencies** (so the symbol solver can resolve qualified type names) and, at [level 2](/codeanalyzer-java/guides/analysis-levels/), **compiled classes** (so WALA can build the call graph). The `BuildProject` utility handles both, auto-detecting the build tool. + +## Build-tool auto-detection + +codeanalyzer-java inspects the project root and picks a build system: + +| Marker file | Build system | Invoked as | +|-------------|--------------|------------| +| `pom.xml` | Maven | `mvnw`/`mvnw.cmd` wrapper if present, otherwise system `mvn` | +| `build.gradle` / `build.gradle.kts` | Gradle | `gradlew`/`gradlew.bat` wrapper if present, otherwise system `gradle` | + +Wrappers are preferred when present so the project's pinned tool version is used. The tool is validated by running its `--version` before any real work. + +## Dependency download (type resolution) + +Before parsing, codeanalyzer downloads the project's library dependencies so Javaparser's symbol solver can resolve types from third-party libraries. The JARs land in a temporary directory inside the project: + + + +Runs the equivalent of `dependency:copy-dependencies`, copying dependency JARs into: + +``` +target/_library_dependencies/ +``` + + +Applies an init script defining a `downloadDependencies` task that copies resolved dependencies into: + +``` +build/_library_dependencies/ +``` + + + +After analysis, this `_library_dependencies` directory is removed automatically. Pass **`--no-clean-dependencies`** to keep it (useful for debugging resolution problems). + + + +## Project build (call graph) + +At analysis level 2, WALA needs compiled classes. The `-b` / `--build-cmd` and `--no-build` flags control how that happens: + +- **Default (auto):** codeanalyzer compiles the project itself. + - Maven: `mvn compile` (tests skipped; common verification plugins — RAT, Findbugs, Checkstyle, PMD, Spotbugs, Enforcer, Javadoc, Spotless — are disabled to keep the build fast and resilient). + - Gradle: `gradle compileJava`. +- **`-b "mvn clean install"`** — run your own build command instead of the auto-build. +- **`--no-build`** — skip building; point the analyzer at an already-compiled project. + +### Including test classes + +By default only main sources are compiled. The hidden `--include-test-classes` flag additionally compiles test sources (`mvn test-compile` / `gradle compileTestJava`) so tests are included in analysis. + +## Pointing at a non-root build file + +For multi-module projects, the build descriptor may not sit at the input directory. Use **`-f` / `--project-root-path`** to point at the root `pom.xml` / `build.gradle` while `-i` still names the source directory you want analyzed. When omitted, the project root defaults to the input path. + +## Common build scenarios + +```bash +# Pre-built project — skip the build, just analyze +java -jar codeanalyzer-2.3.7.jar -i ./project -a 2 --no-build -o ./out + +# Custom build command +java -jar codeanalyzer-2.3.7.jar -i ./project -a 2 -b "mvn -q clean package -DskipTests" -o ./out + +# Multi-module: analyze a submodule, build from the reactor root +java -jar codeanalyzer-2.3.7.jar -i ./project/web -f ./project/pom.xml -a 2 -o ./out + +# Keep downloaded dependencies for inspection +java -jar codeanalyzer-2.3.7.jar -i ./project -a 1 --no-clean-dependencies -o ./out +``` + +See the full flag list in the [CLI reference](/codeanalyzer-java/reference/cli/). diff --git a/src/content/docs/guides/incremental-analysis.mdx b/src/content/docs/guides/incremental-analysis.mdx new file mode 100644 index 00000000..8526b997 --- /dev/null +++ b/src/content/docs/guides/incremental-analysis.mdx @@ -0,0 +1,111 @@ +--- +title: Incremental analysis +description: Use target files to re-analyze only the files that changed and patch them into an existing analysis.json, instead of re-running the whole project. +--- + +import { Aside, Steps } from "@astrojs/starlight/components"; + +When only a handful of files change, re-analyzing the whole project is wasteful. The **`-t` / `--target-files`** flag re-runs symbol extraction for just the named files and merges the result into an existing `analysis.json` — or, when you emit to Neo4j, replaces just those files' subgraphs in a live property graph. + +## How it works + +```bash +java -jar codeanalyzer-2.3.7.jar \ + -i /path/to/project \ + -t src/main/java/com/example/Service.java \ + -t src/main/java/com/example/Repository.java \ + -o ./output +``` + + + +1. codeanalyzer extracts the symbol table for **only** the target files. +2. If `./output/analysis.json` already exists, the analyzer reads its existing `symbol_table`. +3. Each re-analyzed compilation unit is tagged `is_modified: true` and replaces the corresponding entry in the existing table. +4. The merged symbol table is written back to `analysis.json`. + + + +This is much faster than a full run because only the named files are parsed, while the rest of the symbol table is preserved as-is. + + + +## The `is_modified` flag + +Files updated through a target-file run carry `is_modified: true` on their compilation unit in the output. Consumers can use this to detect which entries changed since the last full run — for example, to invalidate caches or re-render only the affected parts of a UI. + +## Schema-compatibility guard + +When merging into an existing `analysis.json`, codeanalyzer checks that the file uses the current import schema (imports as structured objects, not bare strings). If it detects the **legacy** string-based import format, it refuses to merge and raises: + +> Existing analysis.json uses legacy import schema (imports as strings). Regenerate analysis with codeanalyzer 2.3.7 or newer. + +The fix is to regenerate the base `analysis.json` with a current JAR (2.3.7+) before applying incremental updates. See [Troubleshooting](/codeanalyzer-java/troubleshooting/). + +## Incremental updates to a Neo4j graph + +`-t` patches an `analysis.json` in place. The Neo4j Bolt writer is the graph analogue of the same idea: instead of merging compilation units back into a JSON file, it replaces only the changed units' subgraphs in a live, persistent property graph that many applications and many consumers share. Where the JSON form lives in one file you load whole, the graph is a queryable system of record you push deltas into over time. + +To target a live database, add `--emit neo4j` and a Bolt URI: + +```bash +NEO4J_PASSWORD=secret java -jar codeanalyzer-2.3.7.jar \ + -i /path/to/project \ + --emit neo4j \ + --app-name daytrader8 \ + --neo4j-uri bolt://localhost:7687 \ + --neo4j-user neo4j \ + --neo4j-database neo4j \ + -t src/main/java/com/example/Service.java \ + -t src/main/java/com/example/Repository.java +``` + +The push is scoped to one application by `--app-name` (the `:JApplication` anchor node, here `daytrader8`), so independent apps coexist in one database without clobbering each other. + + + +### How the Bolt writer decides what changed + +The Bolt writer is incremental by construction — it does not rewrite the whole graph on every run. It reads the database's current state and updates only what actually moved: + + + +1. It ensures the schema's constraints and indexes exist (idempotent — a no-op after the first run). +2. For each compilation unit, it computes a `content_hash` (SHA-256 over the unit) and diffs it against the `content_hash` already stored on the unit in the live database. +3. Units whose hash is **unchanged** are skipped entirely. +4. Units whose hash **changed** have their subgraph replaced via idempotent `MERGE` upserts — types, callables, fields, call sites, and the rest are re-projected in batches. +5. Shared `:JPackage` and `:JAnnotation` nodes are `MERGE`-only, so re-pushing one app never disturbs nodes another app depends on. + + + +Because every write is a `MERGE`, re-running the same analysis is a no-op against the graph — the push is fully idempotent. This makes it safe to run on every commit from CI, where most units hash identically and only the touched files cost anything. + +### `-t` skips orphan pruning, just as it forces level 1 + +`-t` changes the Bolt push the same way it changes a JSON run: it narrows the scope and disables a whole-project step. + +On a **full run** (no `-t`), the writer knows it is seeing every compilation unit, so after upserting it **prunes orphans** — compilation units whose source file has vanished are detached and deleted, keeping the graph honest about what still exists on disk. + +On a **targeted run** (`-t` present), the writer only sees the files you named. It cannot tell a deleted file apart from one you simply didn't pass this run, so it marks the run as targeted and **skips orphan pruning** — only the named units' subgraphs are replaced; nothing is deleted. + + + + + +## When to use it + +- **CI / editor integrations** that re-analyze on save and want sub-second turnaround, patching either `analysis.json` or a shared graph. +- **Large codebases** where a full parse is expensive but most files are unchanged — content-hash diffing means an unchanged unit costs nothing to re-push. +- **A long-lived Neo4j graph** kept current commit-by-commit, where each run pushes only the delta rather than reloading the whole project. + +For call-graph-dependent work, or after large structural changes (including file deletions you want pruned from the graph), prefer a full [level-2 analysis](/codeanalyzer-java/guides/analysis-levels/). + +For the full Neo4j story — snapshot vs. live Bolt modes, the scoped wipe, multi-tenancy, and reading the graph back from the [Python SDK](/codeanalyzer-java/integration/python-sdk/) — see [Neo4j graph output](/codeanalyzer-java/guides/neo4j-output/). diff --git a/src/content/docs/guides/neo4j-output.mdx b/src/content/docs/guides/neo4j-output.mdx new file mode 100644 index 00000000..5036aa19 --- /dev/null +++ b/src/content/docs/guides/neo4j-output.mdx @@ -0,0 +1,258 @@ +--- +title: Neo4j graph output +description: Project the analysis into a Neo4j property graph with --emit neo4j — a re-runnable graph.cypher snapshot or a live, incremental Bolt push — and read it back from the CLDK Python SDK. +--- + +import { Aside, Steps, Tabs, TabItem, Card, CardGrid } from "@astrojs/starlight/components"; +import Neo4jPropertyGraph from '../../../components/Neo4jPropertyGraph.astro'; + +By default codeanalyzer-java writes one `analysis.json` per project. That file is self-contained, but it doesn't compose: to ask a question across a portfolio you load every blob into memory and stitch them together yourself. `--emit neo4j` projects the same symbol table and call graph into a **Neo4j property graph** instead — a queryable, persistent system of record that many applications can share, and that downstream tools read with Cypher rather than by parsing giant JSON files. + + + +The projection is **lossless**: every entity the analyzer extracts — compilation units, types, callables, fields, parameters, call sites, variables, enum constants, record components, initialization blocks, CRUD operations and queries, comments, annotations, and packages — becomes a first-class node or relationship. All node labels are `J`-prefixed and all relationship types are `J_`-prefixed, so a Java graph can share one Neo4j database with the Python (`Py*` / `PY_*`) and TypeScript (`TS*` / `TS_*`) backends without colliding. For the full label and relationship inventory, see the [graph-schema reference](/codeanalyzer-java/schema/). + + + +## Two emit modes + +`--emit neo4j` has two sub-modes, chosen purely by **whether a Bolt URI resolved** — from `--neo4j-uri` or the `NEO4J_URI` environment variable: + +```mermaid +flowchart TD + A["--emit neo4j"] --> B{"Bolt URI resolved?
(--neo4j-uri or NEO4J_URI)"} + B -->|"no"| C["CypherWriter
writes graph.cypher"] + C --> C1["constraints + indexes"] + C --> C2["scoped wipe of this app's
prior subgraph"] + C --> C3["batched UNWIND ... MERGE
(BATCH = 500)"] + C --> C4["load later:
cypher-shell < graph.cypher"] + B -->|"yes"| D["BoltWriter
pushes over Bolt"] + D --> D1["ensure constraints + indexes"] + D --> D2["diff each unit's content_hash
vs the live DB"] + D --> D3["replace only changed units'
subgraphs (MERGE, BATCH = 1000)"] + D --> D4{"full run?"} + D4 -->|"yes"| D5["prune units whose
source file vanished"] + D4 -->|"no (-t targeted)"| D6["skip orphan pruning"] +``` + +- **No URI → a `graph.cypher` snapshot.** A self-contained, re-runnable Cypher file expressing the *full* truth of this run. Good for review, version control, air-gapped loads, and CI artifacts. +- **URI present → a live, incremental Bolt push.** The analyzer connects to a running Neo4j and updates only what changed since the last run. This is the mode you deploy against a shared cluster. + + + +## The `graph.cypher` snapshot + +With no Bolt URI, codeanalyzer renders a `CypherWriter` snapshot to `/graph.cypher` (defaulting to the current working directory if `-o` is omitted): + +```bash +java -jar codeanalyzer-2.3.7.jar \ + -i /path/to/project -a 2 \ + --emit neo4j \ + --app-name daytrader8 \ + -o ./out +# -> ./out/graph.cypher +``` + +The file is a single, ordered, re-runnable script that: + + + +1. Declares the **constraints and indexes** (uniqueness constraints plus a fulltext index for code search — see [The schema contract](#the-schema-contract)). +2. Runs a **scoped wipe** of *this application's* prior subgraph — `MATCH (a:JApplication {name: 'daytrader8'})` then `DETACH DELETE` its units and their descendants. Shared `:JPackage` and `:JAnnotation` nodes are left intact so other applications keep theirs. +3. Loads nodes and edges with **batched `UNWIND ... MERGE`** (`BATCH = 500`). + + + +Because the snapshot expresses full truth and wipes-then-reloads, **it is not incremental** — re-running it replaces this app's subgraph wholesale. Load it whenever you're ready: + +```bash +cypher-shell -a bolt://localhost:7687 -u neo4j < ./out/graph.cypher +``` + +The scoped wipe means the snapshot is safe to load into a database that already hosts *other* applications: only the matching `:JApplication` anchor and its descendants are touched. + +## The live Bolt push + +When a Bolt URI resolves, the `BoltWriter` connects over the official `neo4j-java-driver` and updates the graph in place. Prefer the `NEO4J_PASSWORD` environment variable over `--neo4j-password` so the secret never lands in shell history or process listings: + +```bash +export NEO4J_URI=bolt://localhost:7687 +export NEO4J_USERNAME=neo4j +export NEO4J_PASSWORD=secret # keep credentials out of argv + +java -jar codeanalyzer-2.3.7.jar \ + -i /path/to/project -a 2 \ + --emit neo4j \ + --app-name daytrader8 +``` + +Everything resolves with a consistent precedence — **flag > environment variable > default**: + +| Setting | Flag | Environment | Default | +|---------|------|-------------|---------| +| Bolt URI | `--neo4j-uri` | `NEO4J_URI` | *(none → snapshot mode)* | +| Username | `--neo4j-user` | `NEO4J_USERNAME` | `neo4j` | +| Password | `--neo4j-password` | `NEO4J_PASSWORD` | `neo4j` | +| Database | `--neo4j-database` | `NEO4J_DATABASE` | *(server default)* | + +The database is only pinned (`SessionConfig.forDatabase`) when you set it non-null; otherwise the driver uses the server's default database. + +### What "incremental" means here + +The push is genuinely incremental, not a wipe-and-reload. For each compilation unit, `BoltWriter`: + + + +1. **Diffs the `content_hash`.** Each unit carries a SHA-256 over its source. The writer reads the live DB's current state and compares — units whose hash is unchanged are skipped entirely. +2. **Replaces only changed units' subgraphs** via idempotent `MERGE` upserts (`BATCH = 1000`), so re-running the same analysis is a no-op against an up-to-date graph. +3. **Upserts shared nodes `MERGE`-only.** `:JPackage` and `:JAnnotation` are shared across applications; they are merged, never deleted, so concurrent app writers don't clobber each other. +4. **Prunes orphans on a full run.** When you analyze the whole project (no `-t`), units whose source file has vanished are removed. On a **targeted** run (`-t` / `--target-files`), pruning is **skipped** — a targeted run only knows about the files you named, so it replaces just those subgraphs and leaves everything else alone. + + + +This is what makes the graph cheap to keep current: a CI job that re-analyzes on every push touches only the units that actually changed. + + + +## Scoping and multi-tenancy + +`--app-name` is the tenancy key. It sets the `name` of the single `:JApplication` anchor node (a uniqueness constraint guarantees one per name), and **every** analyzed compilation unit hangs off it via `(:JApplication {name})-[:J_HAS_UNIT]->(:JCompilationUnit)`. Both emit modes scope all of their writes — the snapshot's wipe and the Bolt push's upserts and pruning — to that one anchor. + +If you omit `--app-name`, it defaults to the base name of the `-i` input directory (or the literal `application` when there is no input). Because the wipe and the push are app-scoped, **many applications coexist in one database**, each rooted at its own anchor: + +```cypher +// list every application living in this database +MATCH (a:JApplication) +RETURN a.name AS application, a.schema_version AS schema +ORDER BY application; +``` + +Cross-service questions become a graph traversal instead of a memory problem. A whole-portfolio query never loads anything it doesn't need: + +```cypher +// which applications declare a type that implements javax.servlet.Filter? +MATCH (a:JApplication)-[:J_HAS_UNIT]->(:JCompilationUnit) + -[:J_DECLARES_TYPE]->(t:JType) +WHERE 'javax.servlet.Filter' IN t.implements_list +RETURN DISTINCT a.name AS application, t.fqn AS filter +ORDER BY application; +``` + +### Schema version stamping + +Every emitted graph stamps `schema_version` on its `:JApplication` node. The current schema version is **`1.0.0`**. Read it straight off the anchor to confirm what contract a given application was loaded under: + +```cypher +MATCH (a:JApplication {name: 'daytrader8'}) +RETURN a.schema_version; // -> "1.0.0" +``` + +## The schema contract + +`--emit schema` publishes the machine-readable schema contract — the catalog of every label, relationship, and property the projector is allowed to emit — and runs **no project analysis** (it short-circuits before any source is parsed, so it needs no `-i`): + +```bash +# print the contract to stdout +java -jar codeanalyzer-2.3.7.jar --emit schema + +# or write it to a file +java -jar codeanalyzer-2.3.7.jar --emit schema -o ./out +# -> ./out/schema.neo4j.json +``` + +The contract ships as DDL inside the analyzer: uniqueness constraints (including a global `:JSymbol.id` identity), plus indexes — among them a **fulltext index** (`j_code_fts`) over `JCallable.code` and `JCallable.docstring`, so you can full-text search source from Cypher: + +```cypher +CALL db.index.fulltext.queryNodes('j_code_fts', 'executeQuery') +YIELD node, score +RETURN node.signature, score +ORDER BY score DESC +LIMIT 10; +``` + +A conformance test (`Neo4jSchemaConformanceTest`, no container required) asserts that the projector never emits an undeclared label, relationship, or property, and that `schema.neo4j.json` is current — so the contract you read is the contract the graph honors. For the full topology, see the [graph-schema reference](/codeanalyzer-java/schema/). + +## Deploying the producer/consumer split + +The Neo4j output naturally divides into a **producer** and **consumers**: + + + +Runs out-of-band as a CI / Kubernetes **Job** or **CronJob** from the fat JAR, pushing app-scoped subgraphs into a managed or clustered Neo4j over Bolt. These are the heavy pods — they build the project and run WALA. + + +Agents, the CLDK Python SDK, and dashboards are lightweight, **read-only** Bolt clients. They never build or analyze anything; they query the graph and scale independently of the analysis pods. + + + +Many analyzer jobs write into one shared cluster — each anchored at its own `:JApplication` — and reads fan out from it. Give consumers **read-only credentials**; the SDK and Cypher dashboards need nothing more. For high availability, point producers at Neo4j Aura or an Enterprise cluster. Because the push is incremental and idempotent, a CronJob can re-run safely on a schedule without ever rebuilding the whole graph. + + + +## Reading the graph from the CLDK Python SDK + +The big payoff: analysis is **produced once, centrally, and read cheaply everywhere**. CLDK has a read-only Neo4j backend that reconstructs the **same typed model objects and the same `networkx` call graph** as the in-process analyzer — with **no JDK, no native binary, and no project source** on the consumer. It needs only the Bolt URI and read-only credentials. + +Install the driver extra: + +```bash +pip install cldk[neo4j] # or: pip install neo4j +``` + +Select the backend by passing a `Neo4jConnectionConfig` to the `CLDK.java(...)` factory. The `application_name` here must match the `--app-name` the graph was loaded with — that's how the SDK scopes every query back to the right `:JApplication`: + +```python +# Java project — read-only Neo4j backend +from cldk import CLDK +from cldk.analysis import AnalysisLevel +from cldk.analysis.commons.backend_config import Neo4jConnectionConfig + +analysis = CLDK.java( + analysis_level=AnalysisLevel.call_graph, + backend=Neo4jConnectionConfig( + uri="bolt://localhost:7687", + username="neo4j", + password="neo4j", # read-only credentials are sufficient + application_name="daytrader8", # == the CLI --app-name + ), +) + +symbol_table = analysis.get_symbol_table() # Dict[str, JCompilationUnit] +cg = analysis.get_call_graph() # networkx.DiGraph +klass = analysis.get_class("com.example.MyService") +methods = analysis.get_methods_in_class("com.example.MyService") +``` + +The backend bulk-fetches nodes and relationships in a handful of Cypher queries and rebuilds the canonical `JApplication` — the same shape the in-process analyzer produces — so `get_*` returns identical `JType` / `JCallable` objects and the same call graph. Available methods include `get_symbol_table()`, `get_call_graph()`, `get_classes()`, `get_class()`, `get_methods()`, `get_methods_in_class()`, `get_callers()`, `get_callees()`, `get_entry_point_methods()`, and `get_all_crud_operations()`. + + + + + +## Where to go next + +- [Graph-schema reference](/codeanalyzer-java/schema/) — every node label, relationship type, and property. +- [Incremental analysis](/codeanalyzer-java/guides/incremental-analysis/) — how `-t` / `--target-files` works, and why it forces level 1. +- [Analysis levels](/codeanalyzer-java/guides/analysis-levels/) — what `-a 1` vs. `-a 2` compute, and why only level 2 emits `J_CALLS`. +- [Python SDK (CLDK)](/codeanalyzer-java/integration/python-sdk/) — the JSON-backed facade and how it relates to the Neo4j backend. diff --git a/src/content/docs/index.mdx b/src/content/docs/index.mdx new file mode 100644 index 00000000..76da1337 --- /dev/null +++ b/src/content/docs/index.mdx @@ -0,0 +1,45 @@ +--- +title: codeanalyzer-java +description: The WALA + Javaparser static-analysis backend behind CodeLLM-DevKit's Java support — a standalone JAR that turns a Java project into a symbol table and call graph, emitted as a versioned JSON schema or a Neo4j property graph. +template: doc +hero: + tagline: One JAR turns an enterprise Java project into a symbol table and call graph — emitted as a single versioned JSON document, or projected losslessly into a Neo4j property graph your tools can query. + actions: + - text: Quickstart + link: /codeanalyzer-java/quickstart/ + icon: rocket + variant: primary + - text: Output schema + link: /codeanalyzer-java/schema/ + icon: right-arrow + variant: secondary + - text: GitHub + link: https://github.com/codellm-devkit/codeanalyzer-java + icon: github + variant: minimal +--- + +import { CardGrid, LinkCard } from "@astrojs/starlight/components"; + +Point **codeanalyzer-java** at a Java project and get back `analysis.json` — a single document describing every class, method, field, and import in the codebase, plus an interprocedural call graph computed by WALA. The schema is the *same shape* the CLDK Python SDK deserializes into typed models, so whatever consumes it — an agent, a script, or the SDK — works against structured analysis instead of raw source. + +The same symbol table and call graph can also be projected, losslessly, into a **Neo4j property graph** with `--emit neo4j` — a re-runnable `graph.cypher` snapshot, or a live, incremental push over Bolt. One database can hold many applications side by side, each anchored at its own `:JApplication` node, so cross-service questions become a Cypher traversal instead of a memory problem. The SDK can then read straight from the graph — no JDK, native binary, or project source on the consumer. + +## Start here + + + + + + + + +## Go deeper + + + + + + + + diff --git a/src/content/docs/installing.mdx b/src/content/docs/installing.mdx new file mode 100644 index 00000000..3979112c --- /dev/null +++ b/src/content/docs/installing.mdx @@ -0,0 +1,191 @@ +--- +title: Installation +description: Run codeanalyzer-java as a fat JAR, compile a native binary with GraalVM, or let the CLDK Python SDK bundle a compatible JAR for you. +--- + +import { Steps, Tabs, TabItem, Aside, CardGrid, LinkCard } from "@astrojs/starlight/components"; + +There are three ways to get codeanalyzer-java, depending on what you're doing. + + + + + + + + + +## Prerequisites + +- A Linux, macOS, or WSL machine. +- [SDKMan!](https://sdkman.io/) for managing JDK / GraalVM versions (recommended). + +Install SDKMan! if you don't have it: + +```bash +curl -s "https://get.sdkman.io" | bash +source "$HOME/.sdkman/bin/sdkman-init.sh" +``` + +## Option 1: Fat JAR (recommended) + +The fat JAR is the standard distribution — the CLDK SDK expects a JVM, and this is the simplest path. It is also the **only** build that can push live to Neo4j over Bolt (see the [native-image caveat](#native-image-and-the-neo4j-driver) below). + + + +1. **Install a JDK (Java 11 or above).** List available versions and install one: + + ```bash + sdk list java | grep sem # IBM Semeru builds + sdk install java 17.0.10-sem + sdk use java 17.0.10-sem + ``` + +2. **Build the JAR:** + + ```bash + git clone https://github.com/codellm-devkit/codeanalyzer-java + cd codeanalyzer-java + ./gradlew fatJar + ``` + +3. **Use it** — the JAR lands at `build/libs/codeanalyzer-2.3.7.jar`: + + ```bash + java -jar build/libs/codeanalyzer-2.3.7.jar -i /path/to/project -a 2 -o ./output + ``` + + + +The fat JAR is what you run as the **producer** in a Neo4j deployment — a CI or Kubernetes Job that projects analysis into the graph with `--emit neo4j` and pushes incrementally over Bolt. Prefer the `NEO4J_PASSWORD` environment variable over `--neo4j-password` so the secret never lands in shell history or process listings: + +```bash +export NEO4J_URI=bolt://localhost:7687 +export NEO4J_USERNAME=neo4j +export NEO4J_PASSWORD=secret # keep credentials out of argv + +java -jar build/libs/codeanalyzer-2.3.7.jar \ + -i /path/to/project -a 2 \ + --emit neo4j \ + --app-name daytrader8 +``` + +See the [Neo4j output guide](/codeanalyzer-java/guides/neo4j-output/) for the snapshot-vs-Bolt distinction, multi-tenancy, and the producer/consumer deployment model. + +## Option 2: Native binary (GraalVM) + +A native image needs no JVM at runtime. This is heavier to build but gives a standalone executable. + + + +1. **Install GraalVM** (17 or above): + + ```bash + sdk list java | grep graal + sdk install java 21.0.2-graalce + sdk use java 21.0.2-graalce + ``` + +2. **Compile the native binary.** `-PbinDir` is optional; without it the binary lands in `build/bin`: + + ```bash + ./gradlew nativeCompile -PbinDir=$HOME/.local/bin + ``` + +3. **Run it** (assuming the output dir is on your `$PATH`): + + ```bash + codeanalyzer -i /path/to/project -a 2 -o ./output + ``` + + + + + + + +## Option 3: Via the Python SDK + +If your goal is to use Java analysis from Python, you don't need to build anything. The CLDK SDK ships a compatible JAR and discovers it automatically: + +```bash +pip install cldk +``` + +```python +from cldk import CLDK +from cldk.analysis import AnalysisLevel + +analysis = CLDK.java( + project_path="commons-cli", + analysis_level=AnalysisLevel.call_graph, +) +print(len(analysis.get_classes()), "classes") +``` + +This is the **in-process** backend: the SDK runs the bundled `codeanalyzer` over your project, parses the resulting `analysis.json`, and builds the model in process. To point it at a JAR you built yourself, pass `analysis_backend_path`. See [Python SDK integration](/codeanalyzer-java/integration/python-sdk/). + +### Reading a Neo4j graph from Python + +There's a second SDK path that builds nothing on the read side. When analysis has already been projected into a Neo4j property graph — by a separate `codeanalyzer --emit neo4j` job — the SDK can become a **read-only Cypher client** that reconstructs the **same typed model objects and the same `networkx` call graph** as the in-process analyzer, with **no JDK, no analyzer binary, and no project source** required. It needs only a Bolt URI and read-only credentials. + +Install the optional driver extra: + +```bash +pip install "cldk[neo4j]" # or: pip install neo4j +``` + +Select this backend by passing a `Neo4jConnectionConfig` to the `CLDK.java(...)` factory. The `application_name` must match the `--app-name` the graph was loaded with — that's how the SDK scopes every query to the right `:JApplication`: + +```python +from cldk import CLDK +from cldk.analysis import AnalysisLevel +from cldk.analysis.commons.backend_config import Neo4jConnectionConfig + +analysis = CLDK.java( + analysis_level=AnalysisLevel.call_graph, + backend=Neo4jConnectionConfig( + uri="bolt://localhost:7687", + username="neo4j", + password="neo4j", # read-only credentials are sufficient + application_name="daytrader8", # == the CLI --app-name + ), +) + +symbol_table = analysis.get_symbol_table() # Dict[str, JCompilationUnit] +cg = analysis.get_call_graph() # networkx.DiGraph +``` + +Because the graph is external, `project_path` is **optional** for this backend — there is no source tree to point at. The Neo4j read-back expects an emitter at **2.4.0 or newer** (with projection fixes landed in **2.4.1**). For the full deployment story, see the [Python SDK integration](/codeanalyzer-java/integration/python-sdk/) and the [Neo4j output guide](/codeanalyzer-java/guides/neo4j-output/). + +## Verify your install + +```bash +java -jar build/libs/codeanalyzer-2.3.7.jar --version +# 2.3.7 +``` + +If you see the version string, you're ready — head to the [Quickstart](/codeanalyzer-java/quickstart/). diff --git a/src/content/docs/integration/python-sdk.mdx b/src/content/docs/integration/python-sdk.mdx new file mode 100644 index 00000000..fde8ea4d --- /dev/null +++ b/src/content/docs/integration/python-sdk.mdx @@ -0,0 +1,241 @@ +--- +title: Python SDK (CLDK) +description: How the CodeLLM-DevKit Python SDK drives codeanalyzer-java — running the analyzer to produce analysis.json, or reading a Neo4j property graph it populated out of band — behind the JavaAnalysis facade. +--- + +import { Steps, Aside, Tabs, TabItem } from "@astrojs/starlight/components"; + +codeanalyzer-java is the JVM analysis engine behind [CodeLLM-DevKit (CLDK)](https://github.com/codellm-devkit/python-sdk)'s Java support. The SDK doesn't re-implement Java analysis — it gets the analysis from this engine and wraps it in a typed facade so Python callers never touch the backend directly. + +There are two ways it gets that analysis, and you pick between them by the **type** of object you pass to `backend=`: + +- **`CodeAnalyzerConfig`** (the default) — the SDK runs `codeanalyzer` on your project, parses the resulting `analysis.json`, and builds the model in process. This is the classic flow: source in, models out. +- **`Neo4jConnectionConfig`** — the SDK becomes a **read-only Cypher client**. It reads a Neo4j property graph that some *other* job already populated with `codeanalyzer --emit neo4j`, and reconstructs the **same typed models** from the graph. No JDK, no analyzer binary, no project source on the consumer. + +Both produce an identical `JavaAnalysis` facade. The second is the one that scales across a portfolio — more on that below. + +## The flow + +```mermaid +flowchart LR + A["CLDK.java(...)"] --> SEL{"backend type?"} + + SEL -->|"CodeAnalyzerConfig
(default)"| B["JCodeanalyzer
backend"] + B --> C["codeanalyzer
-i project -a level"] + C --> D["analysis.json (IR)"] + + SEL -->|"Neo4jConnectionConfig"| N["JavaAnalysisBackend
(read-only Cypher)"] + N --> G["Neo4j property graph
(:JApplication {name})"] + + C -. "out of band:
codeanalyzer --emit neo4j" .-> EMIT{"Bolt URI set?"} + EMIT -->|"yes (fat jar)"| BOLT["live Bolt push
(incremental, content_hash diff)"] + EMIT -->|"no"| SNAP["graph.cypher snapshot
(scoped wipe + UNWIND MERGE)"] + BOLT --> G + SNAP -.->|"cypher-shell < graph.cypher"| G + + D --> E["typed models
JApplication / JType / JCallable"] + G --> E + E --> F["JavaAnalysis facade"] +``` + +The left half is the in-process backend; the right half is the Neo4j backend. The dotted edges show how the graph gets there in the first place: an analyzer run with `--emit neo4j` projects the very same IR (the thing that would otherwise become `analysis.json`) into the graph, either as a re-runnable `graph.cypher` snapshot or as a live incremental Bolt push. Whichever path filled the graph, the SDK reads it back into the same Pydantic models. + +## Default backend: running the analyzer + +This is the in-process flow. If you don't pass `backend=`, CLDK shells out to `codeanalyzer`, parses `analysis.json`, and builds the model. + + + +1. **Binary discovery** — if you don't point the SDK at a specific build, it locates a bundled `codeanalyzer` distribution from its package resources. +2. **Invocation** — it runs the analyzer over your project at the requested level (`codeanalyzer -i -a -o `) and reads back the emitted `analysis.json`. +3. **Parsing** — the JSON is deserialized into Pydantic models: `JApplication` (the whole document), `JType`, `JCallable`, and the rest — mirroring the [output schema](/codeanalyzer-java/schema/). +4. **Facade** — the models are wrapped in `JavaAnalysis`, which exposes query methods like `get_classes()`, `get_methods_in_class()`, `get_call_graph()`, and `get_callers()`. + + + +```python +from cldk import CLDK +from cldk.analysis import AnalysisLevel + +# No backend= -> the default in-process JCodeanalyzer backend +analysis = CLDK.java( + project_path="commons-cli", + analysis_level=AnalysisLevel.call_graph, # -> runs with -a 2 +) + +print(len(analysis.get_classes()), "classes") +print(analysis.get_call_graph()) # -> networkx.DiGraph +``` + +The `analysis_level` maps directly onto the analyzer's [`-a` flag](/codeanalyzer-java/reference/cli/): `AnalysisLevel.symbol_table` → `-a 1`, `AnalysisLevel.call_graph` → `-a 2`. + + + +## Neo4j backend: reading from the graph + +The default backend re-analyzes the project on every run, in process. That's fine for one project on a developer's laptop. It does **not** compose across a portfolio: every `analysis.json` is a standalone document that has to be loaded whole into memory, and forty services means forty JSON blobs and forty re-runs. + +The Neo4j backend inverts this. Analysis is produced **once, centrally** — a CI or Kubernetes job runs `codeanalyzer --emit neo4j` and pushes an app-scoped subgraph into a shared Neo4j database (see the [Neo4j output guide](/codeanalyzer-java/guides/neo4j-output/)). Every consumer — agents, dashboards, and this SDK — is then a lightweight read-only client that just queries the graph. No analysis happens on the read side at all. + +Pass a `Neo4jConnectionConfig` to `backend=` and the facade swaps onto the read-only `JavaAnalysisBackend`: + +```python +from cldk import CLDK +from cldk.analysis import AnalysisLevel +from cldk.analysis.commons.backend_config import Neo4jConnectionConfig + +analysis = CLDK.java( + analysis_level=AnalysisLevel.call_graph, + backend=Neo4jConnectionConfig( + uri="bolt://localhost:7687", + username="neo4j", + password="neo4j", + application_name="daytrader8", + ), +) + +symbol_table = analysis.get_symbol_table() # Dict[str, JCompilationUnit] +cg = analysis.get_call_graph() # networkx.DiGraph +klass = analysis.get_class("com.example.MyService") # JType +methods = analysis.get_methods_in_class("com.example.MyService") +``` + +The driver is an **optional dependency** — install it with the extra: + +```bash +pip install "cldk[neo4j]" # or: pip install neo4j +``` + +If the `neo4j` driver isn't installed, constructing the backend raises `CodeanalyzerExecutionException` with that install hint. + +### Connection config + +`Neo4jConnectionConfig` is a thin wrapper over the official `neo4j` Python driver. The driver is created with `GraphDatabase.driver(uri, auth=(username, password))` and every query runs in `session(database=database)`. + +| Field | Default | Notes | +| --- | --- | --- | +| `uri` | *(required)* | Bolt URI of the Neo4j server, e.g. `bolt://localhost:7687`. | +| `username` | `"neo4j"` | **Read-only credentials are sufficient** — the SDK never writes. | +| `password` | `"neo4j"` | Read-only credentials are sufficient. | +| `database` | `None` | Database name; `None` uses the server's default database. | +| `application_name` | `None` | The `:JApplication` anchor to scope every query to. | + + + +Because the graph is external, **`project_path` is optional** for the Neo4j backend — there is no source tree to point at. The backend is also a context manager, so you can scope the driver's lifetime: + +```python +import os + +with CLDK.java( + backend=Neo4jConnectionConfig( + uri="bolt://neo4j.internal:7687", + username="reader", # read-only RBAC role + password=os.environ["NEO4J_PASSWORD"], + application_name="daytrader8", + ), +) as analysis: + entrypoints = analysis.get_entry_point_methods() + cruds = analysis.get_all_crud_operations() +``` + +### What you get back + +The backend doesn't return raw graph rows. It bulk-fetches nodes and relationships in a handful of Cypher queries and **reconstructs the canonical `JApplication`** — handing an `analysis.json`-shaped payload to `JApplication(**payload)` — exactly the model the in-process analyzer would have built. So the `get_*` methods return the **identical typed objects** (`JType`, `JCallable`, a `networkx.DiGraph` call graph) regardless of which backend produced them: + +```python +# Same methods, same return types, whichever backend you chose +analysis.get_symbol_table() # Dict[str, JCompilationUnit] +analysis.get_classes() # all JType nodes for this application +analysis.get_class(fqn) # one JType +analysis.get_methods_in_class(fqn) # callables in a class +analysis.get_callers(...) # who calls this (level 2) +analysis.get_callees(...) # what this calls (level 2) +analysis.get_entry_point_methods() +analysis.get_all_crud_operations() +``` + +A `get_call_graph()` over the Neo4j backend reads the projected `J_CALLS` edges directly out of the graph: + +```cypher +MATCH (app:JApplication {name: $appName})-[:J_HAS_UNIT]->(:JCompilationUnit) + -[:J_DECLARES_TYPE]->(:JType)-[:J_HAS_CALLABLE]->(caller:JCallable) +MATCH (caller)-[:J_CALLS]->(callee:JCallable) +RETURN caller.id AS source, callee.id AS target +``` + +### Caveats and version requirements + + + +## Choosing a backend + + + + +Use when you have the project source on hand and want a self-contained, one-shot analysis — local development, a single repo in CI, a notebook. + +```python +analysis = CLDK.java( + project_path="my_project", + analysis_level=AnalysisLevel.call_graph, +) +``` + +Every run re-analyzes the project; nothing is shared between runs or services. + + + + +Use when analysis is produced centrally and read in many places — agents, dashboards, cross-service queries — without shipping the JDK, the analyzer binary, or the source to every consumer. + +```python +analysis = CLDK.java( + analysis_level=AnalysisLevel.call_graph, + backend=Neo4jConnectionConfig( + uri="bolt://neo4j.internal:7687", + password=os.environ["NEO4J_PASSWORD"], + application_name="daytrader8", + ), +) +``` + +Analysis is produced once by a separate `--emit neo4j` job; reads scale independently and cost a Cypher query. + + + + +The whole point of the Neo4j backend is that **the read side carries no analysis dependency**. Forty services analyzed by forty Kubernetes jobs land in one cluster, each anchored at its own `:JApplication`, and a single SDK client queries across all of them by `application_name` — a graph traversal, not forty JSON parses. + +## Pointing at a custom build + +To use an analyzer you built yourself — say, a local development build — pass `analysis_backend_path` (a directory containing the analyzer distribution): + +```python +analysis = CLDK.java( + project_path="my_project", + analysis_level=AnalysisLevel.call_graph, + analysis_backend_path="/path/containing/codeanalyzer", +) +``` + +This is the bridge between this repo and the SDK: build it ([Installation](/codeanalyzer-java/installing/)), then point the SDK at your build output. This applies to the **in-process** backend only — the Neo4j backend has no analyzer to locate, since the graph was populated out of band. + +## See also + +- [Neo4j graph output](/codeanalyzer-java/guides/neo4j-output/) — how to populate the graph with `--emit neo4j`, snapshot vs. live Bolt, and the producer/consumer deployment model. +- [Neo4j graph schema](/codeanalyzer-java/schema/neo4j-graph/) — the node labels, `J_*` relationships, constraints, and indexes the backend reads. +- [CLI options](/codeanalyzer-java/reference/cli/) — `--emit`, `--app-name`, and the `--neo4j-*` connection flags. + +For the bigger picture — concepts, agent recipes, the cross-language API — see the main [CodeLLM-DevKit documentation](https://codellm-devkit.info). diff --git a/src/content/docs/quickstart.mdx b/src/content/docs/quickstart.mdx new file mode 100644 index 00000000..453ef90a --- /dev/null +++ b/src/content/docs/quickstart.mdx @@ -0,0 +1,143 @@ +--- +title: Quickstart +description: Build the codeanalyzer-java JAR and run your first analysis — symbol table and call graph, as analysis.json or a Neo4j graph — in a couple of minutes. +--- + +import { Steps, Tabs, TabItem, Aside } from "@astrojs/starlight/components"; + +This guide gets you from a clone to a working `analysis.json` in a couple of minutes. For installation alternatives (native binary, pre-built JAR via the Python SDK), see [Installation](/codeanalyzer-java/installing/). + +## Prerequisites + +- A Linux, macOS, or WSL machine +- A JDK, version **11 or above** (Java 17 recommended). We suggest installing it with [SDKMan!](https://sdkman.io/) + + + +## Build the JAR + + + +1. **Install a JDK** (Java 17 shown here, via SDKMan!): + + ```bash + sdk install java 17.0.10-sem + sdk use java 17.0.10-sem + ``` + +2. **Clone and build the fat JAR:** + + ```bash + git clone https://github.com/codellm-devkit/codeanalyzer-java + cd codeanalyzer-java + ./gradlew fatJar + ``` + + The build produces a self-contained JAR at `build/libs/codeanalyzer-2.3.7.jar`. + +3. **Confirm it runs:** + + ```bash + java -jar build/libs/codeanalyzer-2.3.7.jar --version + ``` + + + +## Run your first analysis + +### Symbol table only (fast) + +Analysis level 1 parses source and builds the symbol table. It does not require building the target project, so it's quick: + +```bash +java -jar build/libs/codeanalyzer-2.3.7.jar \ + -i /path/to/your/project \ + -a 1 \ + -o ./output +``` + +This writes `./output/analysis.json` containing the `symbol_table` for every `.java` file. + +### Symbol table + call graph + +Analysis level 2 additionally builds the WALA call graph. By default codeanalyzer will build the target project (so WALA has compiled classes and resolved dependencies to work from): + +```bash +java -jar build/libs/codeanalyzer-2.3.7.jar \ + -i /path/to/your/project \ + -a 2 \ + -o ./output \ + -v +``` + +The `-v` flag streams progress logs so you can watch the build and call-graph construction. + +### Analyze a single source string + +No project, no build — pass Java source directly and get a symbol table back on stdout: + +```bash +java -jar build/libs/codeanalyzer-2.3.7.jar \ + -s "public class Hello { public static void main(String[] a){} }" \ + -a 1 +``` + + + +## Read the output + +`analysis.json` has this top-level shape: + +```json +{ + "symbol_table": { "/abs/path/File.java": { /* compilation unit */ } }, + "call_graph": [ /* caller→callee edges, present at level 2 */ ], + "version": "2.3.7" +} +``` + +Continue to the [Output schema](/codeanalyzer-java/schema/) for the full structure, or the [CLI reference](/codeanalyzer-java/reference/cli/) for every flag. + +## Emit to Neo4j + +`analysis.json` is self-contained, but it doesn't compose: to ask a question across a portfolio you load every blob into memory and stitch it together yourself. `--emit neo4j` projects the *same* symbol table and call graph into a **Neo4j property graph** instead — a queryable system of record that many applications can share. `--emit` selects *one* output target, so `--emit neo4j` returns **without** writing `analysis.json`. + +The quickest path needs no running database. With no Bolt URI, codeanalyzer renders a self-contained, re-runnable `graph.cypher` snapshot: + +```bash +java -jar build/libs/codeanalyzer-2.3.7.jar \ + -i /path/to/your/project \ + -a 2 \ + --emit neo4j \ + --app-name daytrader8 \ + -o ./output +# -> ./output/graph.cypher +``` + +`--app-name` is the tenancy key — it anchors this app's subgraph at a `:JApplication` node, so one database can host many apps side by side. Load the snapshot into any Neo4j whenever you're ready; the script declares its constraints and indexes, does a scoped wipe of just *this* app's prior subgraph, then `MERGE`-loads the graph: + +```bash +cypher-shell -a bolt://localhost:7687 -u neo4j < ./output/graph.cypher +``` + +To push **live and incrementally** to a running cluster — only re-sending the compilation units whose `content_hash` changed — set a Bolt URI instead. Prefer the `NEO4J_PASSWORD` environment variable so the secret never lands in shell history: + +```bash +export NEO4J_URI=bolt://localhost:7687 +export NEO4J_USERNAME=neo4j +export NEO4J_PASSWORD=secret + +java -jar build/libs/codeanalyzer-2.3.7.jar \ + -i /path/to/your/project -a 2 \ + --emit neo4j --app-name daytrader8 +``` + + + +Once the graph is populated, the CLDK Python SDK reads it back with **no JDK, binary, or project source** — only read-only credentials. See the [Neo4j graph output guide](/codeanalyzer-java/guides/neo4j-output/) for the two emit modes, deployment as a Kubernetes Job, and the `--emit schema` contract, or [Python SDK integration](/codeanalyzer-java/integration/python-sdk/) to read the graph from Python. diff --git a/src/content/docs/reference/cli.mdx b/src/content/docs/reference/cli.mdx new file mode 100644 index 00000000..ab8e55e5 --- /dev/null +++ b/src/content/docs/reference/cli.mdx @@ -0,0 +1,160 @@ +--- +title: Command-line options +description: The complete codeanalyzer-java CLI reference — every flag, what it does, and its default. +--- + +import { Aside } from "@astrojs/starlight/components"; + +codeanalyzer-java is a Picocli command. Invoke it as a fat JAR (`java -jar codeanalyzer-2.3.7.jar ...`) or, if you built a native image, as `codeanalyzer ...`. + +By default the analyzer writes one `analysis.json` per project. Pass `--emit neo4j` to project that same model into a [Neo4j property graph](/codeanalyzer-java/guides/neo4j-output/) instead — either a self-contained `graph.cypher` snapshot or a live, incremental push over Bolt. The Neo4j-specific flags below all hang off that mode. + +## Usage + +``` +Usage: codeanalyzer [-hvV] [--no-build] [--no-clean-dependencies] + [--include-test-classes] [-a=] [-b=] + [-f=] [-i=] [-o=] + [-s=] [-t=]... + [--emit=] [--app-name=] + [--neo4j-uri=] [--neo4j-user=] + [--neo4j-password=] [--neo4j-database=] + +Analyze java application. +``` + +## Options + +| Flag | Argument | Description | Default | +|------|----------|-------------|---------| +| `-i`, `--input` | path | Path to the project root directory to analyze. | — | +| `-s`, `--source-analysis` | string | Analyze a single string of Java source instead of a project. No build required. | — | +| `-o`, `--output` | path | Destination directory. Holds `analysis.json` for the default emit, `graph.cypher` for `--emit neo4j` without a URI, or `schema.neo4j.json` for `--emit schema`. If omitted, output goes to stdout. | stdout / cwd | +| `-a`, `--analysis-level` | `1` \| `2` | `1` = symbol table only; `2` = symbol table + call graph. | `1` | +| `-b`, `--build-cmd` | string | Custom build command. When omitted at level 2, an auto build is used. | auto | +| `--no-build` | flag | Do not build the application; use already-compiled output. | off | +| `--no-clean-dependencies` | flag | Do not delete the downloaded `_library_dependencies` directory after analysis. | off | +| `-f`, `--project-root-path` | path | Path to the root `pom.xml` / `build.gradle` (for multi-module projects). | value of `-i` | +| `-t`, `--target-files` | path | A file to (re)analyze incrementally; repeatable. Forces level 1. | — | +| `--include-test-classes` | flag | Also compile/analyze test sources. (Hidden option.) | off | +| `--emit` | `json` \| `neo4j` \| `schema` | Output target. `json` writes `analysis.json`; `neo4j` projects the model into a Neo4j property graph; `schema` prints the graph schema contract. Matched case-insensitively. | `json` | +| `--app-name` | string | Logical application name used as the `:JApplication` anchor that scopes the graph. (Neo4j emit only.) | input dir base name | +| `--neo4j-uri` | uri | Bolt URI of a live Neo4j, e.g. `bolt://localhost:7687`. Its presence is what switches `--emit neo4j` from a snapshot to a live push. Falls back to `NEO4J_URI`. | — | +| `--neo4j-user` | string | Neo4j username for the Bolt push. Falls back to `NEO4J_USERNAME`. | `neo4j` | +| `--neo4j-password` | string | Neo4j password for the Bolt push. Falls back to `NEO4J_PASSWORD`. Prefer the env var. | `neo4j` | +| `--neo4j-database` | string | Target Neo4j database. Falls back to `NEO4J_DATABASE`; when unset, the server default database is used. | server default | +| `-v`, `--verbose` | flag | Print logs to the console. | off | +| `-h`, `--help` | flag | Show help and exit. | — | +| `-V`, `--version` | flag | Print version information and exit. | — | + + + +## Notes on key flags + +### `-i` vs. `-s` + +- **`-i`** points at a project directory on disk. This is the normal mode; dependencies are downloaded and (at level 2) the project is built. +- **`-s`** passes Java source as a string. The symbol table is built directly from that snippet with JDK-only type resolution — no project, no build, no dependency download. + +Exactly one of these is the analysis subject. `-s` takes precedence when both are present. + +### `-o` (output) + +What lands in `-o` depends on `--emit`: + +- **`json`** (default) — writes `/analysis.json`, creating the directory if needed. Without `-o`, the consolidated JSON goes to stdout — convenient for piping, and how the [Python SDK](/codeanalyzer-java/integration/python-sdk/) can capture output without a temp file. +- **`neo4j` without a URI** — writes `/graph.cypher` (defaults to the current working directory if `-o` is omitted). +- **`schema`** — writes `/schema.neo4j.json`, or prints it to stdout when `-o` is omitted. + +### `-a` (analysis level) + +See [Analysis levels](/codeanalyzer-java/guides/analysis-levels/). Level 2 implies a build unless you pass `--no-build` or a custom `-b`. In the Neo4j projection, level 2 is also what adds `J_CALLS` edges (the WALA call graph) to the graph; level 1 emits the lossless symbol-table subgraph with no `J_CALLS`. + +### `-t` (target files) + +See [Incremental analysis](/codeanalyzer-java/guides/incremental-analysis/). Repeat the flag for multiple files. Forces level 1; merges into an existing `analysis.json` when one is present in the output directory. + +On a **live Bolt push** (`--emit neo4j` with a URI), `-t` marks the run as *targeted*: only the changed compilation units' subgraphs are replaced, and orphan pruning of vanished units is **skipped**. A full run (no `-t`) prunes units whose source file has disappeared. See [Neo4j output](#neo4j-output) below. + +## Neo4j output + +The four `--emit neo4j` modifiers (`--app-name`, `--neo4j-uri`, `--neo4j-user`, `--neo4j-password`, `--neo4j-database`) follow the same resolution order: + +> **flag > environment variable > default** + +A flag wins when set; otherwise the matching env var is used; otherwise the built-in default. + +| Flag | Environment variable | Default | +|------|----------------------|---------| +| `--neo4j-uri` | `NEO4J_URI` | — (no URI → `graph.cypher` snapshot) | +| `--neo4j-user` | `NEO4J_USERNAME` | `neo4j` | +| `--neo4j-password` | `NEO4J_PASSWORD` | `neo4j` | +| `--neo4j-database` | `NEO4J_DATABASE` | server default | + +Keep credentials off the command line — prefer the `NEO4J_PASSWORD` environment variable to `--neo4j-password`, which would otherwise show up in shell history and process listings. + +### Two emit modes + +Whether `--emit neo4j` writes a file or talks to a server is decided **purely by whether a Bolt URI resolved** (from `--neo4j-uri` or `NEO4J_URI`): + +- **No URI → `graph.cypher` snapshot.** A self-contained, re-runnable Cypher script: constraints and indexes, a scoped wipe of *this* application's prior subgraph, then batched `UNWIND ... MERGE` for nodes and edges. It expresses the full truth (it is **not** incremental). Load it with `cypher-shell < graph.cypher`. +- **URI present → live incremental Bolt push.** The Bolt writer ensures constraints and indexes, diffs each compilation unit's `content_hash` against the live database, and replaces **only changed units' subgraphs** via idempotent `MERGE` upserts. Shared `:JPackage` / `:JAnnotation` nodes are upserted once. On a full run it prunes units whose source file has vanished; a `-t` targeted run skips that pruning. + +`--app-name` is the tenancy key in both modes: it sets the `name` of the single `:JApplication` anchor, the wipe deletes only that application's subgraph, and many applications can share one Neo4j database side by side, each rooted at its own `:JApplication`. When omitted, it defaults to the base name of the `-i` input directory. The `:JApplication` node also carries `schema_version` (`1.0.0`), the versioned schema contract the graph conforms to. + + + +### `--emit schema` + +`--emit schema` prints the machine-readable schema contract — every node label, relationship type, and property the projection can emit — and **requires no project**: it short-circuits before any analysis, so `-i` / `-s` are unnecessary. Writes `schema.neo4j.json` to `-o` if given, otherwise stdout. + +```bash +java -jar codeanalyzer-2.3.7.jar --emit schema -o ./out # ./out/schema.neo4j.json +java -jar codeanalyzer-2.3.7.jar --emit schema # prints to stdout +``` + +### Examples + +Write a re-runnable snapshot for one application: + +```bash +java -jar codeanalyzer-2.3.7.jar \ + -i /path/to/daytrader8 -a 2 \ + --emit neo4j --app-name daytrader8 \ + -o ./out +cypher-shell -u neo4j -p "$NEO4J_PASSWORD" < ./out/graph.cypher +``` + +Push live and incrementally over Bolt (credentials from the environment): + +```bash +export NEO4J_PASSWORD=secret +java -jar codeanalyzer-2.3.7.jar \ + -i /path/to/daytrader8 -a 2 \ + --emit neo4j --app-name daytrader8 \ + --neo4j-uri bolt://localhost:7687 \ + --neo4j-user neo4j \ + --neo4j-database neo4j +``` + +Re-push only the files that changed (targeted — no orphan pruning): + +```bash +java -jar codeanalyzer-2.3.7.jar \ + -i /path/to/daytrader8 -a 2 \ + --emit neo4j --app-name daytrader8 \ + --neo4j-uri bolt://localhost:7687 \ + -t src/main/java/com/example/AccountService.java +``` + +The `--app-name` you load with is the same value a reader scopes to. In the [Python SDK](/codeanalyzer-java/integration/python-sdk/), `Neo4jConnectionConfig(application_name="daytrader8")` reads back exactly the graph produced by `--app-name daytrader8` — no JDK, no JAR, no project sources, just the Bolt URI and read-only credentials. See the [Neo4j guide](/codeanalyzer-java/guides/neo4j-output/) for the producer/consumer split and the full schema. + +## Exit behavior + +The command exits non-zero on failure. Run with `-v` to see the underlying logs (build invocation, dependency download, parse problems, WALA progress, and — for a live push — the Bolt connection and per-unit upserts) when diagnosing a failed run. + +See worked invocations in [Examples](/codeanalyzer-java/reference/examples/). diff --git a/src/content/docs/reference/examples.mdx b/src/content/docs/reference/examples.mdx new file mode 100644 index 00000000..de050f2c --- /dev/null +++ b/src/content/docs/reference/examples.mdx @@ -0,0 +1,255 @@ +--- +title: Examples +description: Worked codeanalyzer-java invocations — symbol-table runs, full call-graph analysis, single-source mode, incremental updates, Neo4j property-graph output, and reading the graph back from the Python SDK. +--- + +import { Aside } from "@astrojs/starlight/components"; + +A collection of complete, copy-pasteable invocations. Replace `codeanalyzer-2.3.7.jar` with your built JAR path (or `codeanalyzer` if you compiled a native binary). + +## Symbol table only (fast, no build) + +Parse a project and emit the symbol table. No project build required: + +```bash +java -jar codeanalyzer-2.3.7.jar \ + -i /path/to/commons-cli \ + -a 1 \ + -o ./output +# -> ./output/analysis.json with symbol_table +``` + +## Full analysis with call graph + +Symbol table plus the WALA call graph. The project is built automatically: + +```bash +java -jar codeanalyzer-2.3.7.jar \ + -i /path/to/commons-cli \ + -a 2 \ + -o ./output \ + -v +# -> ./output/analysis.json with symbol_table + call_graph +``` + +## Single source string (no project, no build) + +Analyze a snippet directly; output goes to stdout: + +```bash +java -jar codeanalyzer-2.3.7.jar \ + -s "public class HelloWorld { public static void main(String[] args) {} }" \ + -a 1 +``` + +## Pre-built project (skip the build) + +If the project is already compiled, skip the build step for a faster level-2 run: + +```bash +java -jar codeanalyzer-2.3.7.jar \ + -i /path/to/project \ + -a 2 \ + --no-build \ + -o ./output +``` + +## Custom build command + +Use your own build instead of the auto build: + +```bash +java -jar codeanalyzer-2.3.7.jar \ + -i /path/to/project \ + -a 2 \ + -b "mvn -q clean package -DskipTests" \ + -o ./output +``` + +## Incremental analysis (target files) + +Re-analyze just two files and patch them into an existing `analysis.json`: + +```bash +java -jar codeanalyzer-2.3.7.jar \ + -i /path/to/project \ + -t src/main/java/org/apache/commons/cli/Option.java \ + -t src/main/java/org/apache/commons/cli/Options.java \ + -o ./output +``` + +The named files are tagged `is_modified: true` in the merged output. See [Incremental analysis](/codeanalyzer-java/guides/incremental-analysis/). + +## Multi-module project + +Analyze a submodule while building from the reactor root: + +```bash +java -jar codeanalyzer-2.3.7.jar \ + -i /path/to/project/web-module \ + -f /path/to/project/pom.xml \ + -a 2 \ + -o ./output +``` + +## Pipe stdout into a tool + +Omit `-o` to stream JSON to stdout and process it inline: + +```bash +java -jar codeanalyzer-2.3.7.jar -i /path/to/project -a 1 \ + | jq '.symbol_table | keys | length' +# prints the number of analyzed source files +``` + +## Emit a Neo4j property graph (snapshot) + +`--emit neo4j` projects the same IR as `analysis.json` — losslessly — into a Neo4j property graph. With **no Bolt URI present**, the analyzer writes a self-contained, re-runnable `graph.cypher` snapshot to the output directory: + +```bash +java -jar codeanalyzer-2.3.7.jar \ + -i /path/to/daytrader8 \ + -a 2 \ + --emit neo4j \ + --app-name daytrader8 \ + -o ./out +# -> ./out/graph.cypher +``` + +The snapshot is constraints + indexes, a **scoped wipe** of this application's prior subgraph, then batched `UNWIND ... MERGE` for every node and edge. It expresses the full truth of the application — it is *not* incremental. Load it into a running Neo4j with `cypher-shell`: + +```bash +cypher-shell -u neo4j -p "$NEO4J_PASSWORD" < ./out/graph.cypher +``` + + + +## Push a live graph over Bolt (incremental) + +When a Bolt URI resolves — from `--neo4j-uri` or the `NEO4J_URI` env var — `--emit neo4j` pushes **incrementally** to a running Neo4j instead of writing a file. Prefer the `NEO4J_*` environment variables for credentials so secrets stay off the command line: + +```bash +export NEO4J_URI=bolt://localhost:7687 +export NEO4J_USERNAME=neo4j +export NEO4J_PASSWORD=secret + +java -jar codeanalyzer-2.3.7.jar \ + -i /path/to/daytrader8 \ + -a 2 \ + --emit neo4j \ + --app-name daytrader8 +# -> pushes the daytrader8 subgraph to bolt://localhost:7687 +``` + +The Bolt writer ensures constraints/indexes, diffs each compilation unit's `content_hash` (SHA-256) against the live database, and replaces **only changed units' subgraphs** with idempotent `MERGE` upserts. Shared `:JPackage` / `:JAnnotation` nodes are `MERGE`d in place. On a **full run** (no `-t`), units whose source file vanished are pruned. + + + +You can also pass the flags explicitly instead of the env vars; a flag wins when both are set: + +```bash +java -jar codeanalyzer-2.3.7.jar \ + -i /path/to/daytrader8 \ + -a 2 \ + --emit neo4j \ + --app-name daytrader8 \ + --neo4j-uri bolt://localhost:7687 \ + --neo4j-user neo4j \ + --neo4j-database neo4j +# password comes from NEO4J_PASSWORD; --neo4j-password also works +``` + +`--app-name` is the tenancy key: it sets the `name` of the single `:JApplication` anchor (`(:JApplication {name})-[:J_HAS_UNIT]->(:JCompilationUnit)`). Many applications coexist in one database, each rooted at its own anchor, so a wipe or re-push of `daytrader8` never touches another app's subgraph. If you omit `--app-name`, it defaults to the base name of the `-i` directory. + +## Targeted incremental re-push + +Combine `-t` with a live Bolt push to update only the units you changed. A targeted run replaces just those changed-unit subgraphs and **skips orphan pruning** — units for files that vanished are left alone, because a targeted run does not claim to know about the whole application: + +```bash +export NEO4J_URI=bolt://localhost:7687 +export NEO4J_PASSWORD=secret + +java -jar codeanalyzer-2.3.7.jar \ + -i /path/to/daytrader8 \ + --emit neo4j \ + --app-name daytrader8 \ + -t src/main/java/com/ibm/websphere/samples/daytrader/TradeAction.java +# replaces only TradeAction's subgraph; vanished units are NOT pruned +``` + + + +## Emit the schema contract + +`--emit schema` publishes the versioned schema contract — every node label, relationship type, and property the projector can produce — with **no project analysis required**. It short-circuits before any analysis runs. Write it to a file: + +```bash +java -jar codeanalyzer-2.3.7.jar --emit schema -o ./out +# -> ./out/schema.neo4j.json +``` + +Or print it to stdout when `-o` is omitted — handy for diffing against a checked-in copy in CI: + +```bash +java -jar codeanalyzer-2.3.7.jar --emit schema \ + | jq '.schema_version' +# "1.0.0" +``` + +The `schema_version` (`1.0.0`) printed here is the same value stamped on the `:JApplication` node of every graph you emit, so consumers can assert they are reading a contract they understand. See the [Neo4j graph schema](/codeanalyzer-java/schema/neo4j-graph/) for the full label and relationship catalog. + +## From Python via CLDK (local analysis) + +If you'd rather not manage the JAR yourself, the CLDK SDK invokes it for you: + +```python +from cldk import CLDK +from cldk.analysis import AnalysisLevel + +analysis = CLDK(language="java").analysis( + project_path="commons-cli", + analysis_level=AnalysisLevel.call_graph, +) +print(len(analysis.get_classes()), "classes") +print(analysis.get_call_graph()) # -> networkx.DiGraph +``` + +See [Python SDK integration](/codeanalyzer-java/integration/python-sdk/) for details. + +## Read the graph back from Python (no JAR, no JDK) + +Once an application is in Neo4j, the SDK can read it directly — no JDK, no native binary, and no project source on the consumer. It only needs the Bolt URI and read-only credentials. Install the driver extra (`pip install cldk[neo4j]`), then point CLDK at the same `application_name` the graph was loaded with: + +```python +# Java application — read-only Neo4j backend +from cldk import CLDK +from cldk.analysis import AnalysisLevel +from cldk.analysis.commons.backend_config import Neo4jConnectionConfig + +analysis = CLDK.java( + analysis_level=AnalysisLevel.call_graph, + backend=Neo4jConnectionConfig( + uri="bolt://localhost:7687", + username="neo4j", + password="neo4j", + application_name="daytrader8", # == --app-name from the push + ), +) + +symbol_table = analysis.get_symbol_table() # Dict[str, JCompilationUnit] +cg = analysis.get_call_graph() # networkx.DiGraph +klass = analysis.get_class("com.example.MyService") +methods = analysis.get_methods_in_class("com.example.MyService") +``` + +The backend bulk-fetches nodes and relationships in a handful of Cypher queries and rebuilds the **same canonical model objects** the in-process analyzer produces — the same `JType` / `JCallable` symbol table and the same `networkx` call graph. Analysis is produced once, centrally, by a `codeanalyzer --emit neo4j` job; every consumer reads it cheaply. + + diff --git a/src/content/docs/schema.mdx b/src/content/docs/schema.mdx new file mode 100644 index 00000000..54960778 --- /dev/null +++ b/src/content/docs/schema.mdx @@ -0,0 +1,137 @@ +--- +title: Output schema overview +description: The two emit targets — the analysis.json document and the Neo4j property graph — the same IR serialized two ways, and how each is versioned. +--- + +import { Aside, CardGrid, LinkCard } from "@astrojs/starlight/components"; + +codeanalyzer-java extracts one symbol table and call graph per run, then emits that intermediate representation through one of two targets selected by `--emit`: + +- **`--emit json`** (the default) — a single `analysis.json` document (or the same JSON on stdout). Self-contained, loaded whole by its consumer. +- **`--emit neo4j`** — the same IR projected into a **Neo4j property graph**: a `graph.cypher` snapshot, or a live incremental push over Bolt. A queryable, persistent system of record that composes across many applications in one database. + +Both targets carry the same model — types, callables, fields, parameters, call sites, variables, enum constants, record components, initialization blocks, CRUD operations, comments, annotations, packages. The graph is a **lossless projection** of the IR, not a summary of it. This page describes the top-level shape of the JSON document and how it relates to the graph; the sub-pages cover each section in detail. + + + +## Top-level shape (`analysis.json`) + +```json +{ + "symbol_table": { + "/absolute/path/to/File.java": { /* JavaCompilationUnit */ } + }, + "call_graph": [ /* edges — present only at analysis level 2 */ ], + "version": "2.4.1" +} +``` + +| Key | Type | When present | Description | +|-----|------|--------------|-------------| +| `symbol_table` | object | always | Map of absolute file path → compilation unit. See [Symbol table](/codeanalyzer-java/schema/symbol-table/). | +| `call_graph` | array | level 2 only | Caller→callee edges from WALA. See [Call graph](/codeanalyzer-java/schema/call-graph/). | +| `version` | string | always | The analyzer version that produced this document, e.g. `"2.4.1"`. | + +## Serialization conventions + +The JSON is produced by Gson with a fixed configuration: + +- **Field naming:** `LOWER_CASE_WITH_UNDERSCORES` — Java fields like `filePath` serialize as `file_path`, `callableDeclarations` as `callable_declarations`, and so on. +- **Nulls preserved:** `serializeNulls` is on, so absent values appear as explicit `null` rather than being omitted. Consumers can rely on keys existing. +- **Pretty-printed**, with HTML escaping disabled (so `<`, `>`, `&` in code/strings stay literal). + + + +## The Neo4j projection + +The same compilation units, types, and call edges become first-class nodes and relationships in a Neo4j property graph. Every node label is **J-prefixed** (`:JApplication`, `:JCompilationUnit`, `:JType`, `:JCallable`, …) and every relationship type **`J_`-prefixed** (`:J_HAS_UNIT`, `:J_DECLARES_TYPE`, `:J_CALLS`, …). The prefix is deliberate: a Java graph shares one Neo4j database with the Python (`Py*` / `PY_*`) and TypeScript (`TS*` / `TS_*`) backends without colliding, so a polyglot portfolio lives in a single store. + +Each run is anchored at a `(:JApplication {name, schema_version})` node — the value of `--app-name` — and every analyzed file hangs off it via `(:JApplication)-[:J_HAS_UNIT]->(:JCompilationUnit)`. Because each application is rooted at its own anchor, many applications coexist side by side and you query across them with Cypher instead of parsing one giant JSON blob per project. + +```bash +# Live incremental push over Bolt (fat jar) — app-scoped, content-hash diffed +export NEO4J_PASSWORD=secret +codeanalyzer -i /path/to/project -a 2 \ + --emit neo4j --app-name daytrader8 \ + --neo4j-uri bolt://localhost:7687 --neo4j-user neo4j --neo4j-database neo4j +``` + +The two `--emit neo4j` sub-modes are decided purely by whether a Bolt URI resolved (the `--neo4j-uri` flag or the `NEO4J_URI` env var): + +- **No URI → a `graph.cypher` snapshot.** Self-contained and re-runnable: constraints and indexes, a scoped wipe of *this* application's prior subgraph, then batched `UNWIND … MERGE` of nodes and edges. It expresses full truth, so it is not incremental. Load it with `cypher-shell < graph.cypher`. +- **URI present → a live incremental Bolt push.** The driver reads the database's current state and updates **only what changed**: it diffs each compilation unit's `content_hash` (a SHA-256 over the unit), replaces only changed units' subgraphs via idempotent `MERGE` upserts, and on a full run prunes units whose source file vanished. Shared `:JPackage` / `:JAnnotation` nodes are upserted `MERGE`-only and left intact across apps. + + + +For the full node-label and relationship topology — every property on every node, the gating rules, and the constraints and indexes shipped as DDL — see the dedicated reference: + + + +## Versioning: two contracts, two version fields + +The JSON document and the graph each declare their own version, and the two are independent: + +| Field | Lives on | Identifies | +|-------|----------|------------| +| `version` | the root of `analysis.json` | the **analyzer** that produced the document, e.g. `"2.4.1"`. | +| `schema_version` | the `:JApplication` node in the graph | the **graph schema contract**, currently `1.0.0`. | + +`schema_version` is stamped on the application anchor of every emitted graph, so any consumer can read it back and confirm the contract before traversing. The machine-readable form of that contract is `schema.neo4j.json`, which you can publish directly without analyzing a project: + +```bash +# Print the property-graph schema contract to stdout (no project analysis) +codeanalyzer --emit schema +``` + +Pass `-o ` to write it to `/schema.neo4j.json` instead of stdout. The document enumerates every declared node label, relationship type, and property; the projector is tested to never emit an undeclared label, relationship, or property, so the contract and the graph stay in lockstep. + +For the JSON document, the `version` field is the schema identifier: the CLDK Python SDK's Pydantic models (`JApplication`, `JType`, `JCallable`, …) are locked to a compatible version, and your own consumers should treat `version` as the schema key. + +When the JSON schema changes incompatibly, `version` bumps. One concrete example: imports changed from bare strings to structured objects (`{ path, is_static, is_wildcard }`). Tools reading an older `analysis.json` against newer code — or vice versa — should check the version. See the [legacy import schema guard](/codeanalyzer-java/guides/incremental-analysis/#schema-compatibility-guard). + + + +## Reading either output from the Python SDK + +The CLDK Python SDK reconstructs the **same typed model objects** — `JType`, `JCallable`, and a `networkx` call graph — from either output. Point it at a project directory to run the in-process analyzer, or at a Bolt URI to read a graph that was populated out of band. The graph path needs no JDK, no native binary, and no project source on the consumer — only read-only credentials and the `application_name` that matches the `--app-name` the graph was loaded with: + +```python +from cldk import CLDK +from cldk.analysis import AnalysisLevel +from cldk.analysis.commons.backend_config import Neo4jConnectionConfig + +analysis = CLDK.java( + analysis_level=AnalysisLevel.call_graph, + backend=Neo4jConnectionConfig( + uri="bolt://localhost:7687", + username="neo4j", + password="neo4j", + application_name="daytrader8", # == --app-name on the producing run + ), +) +symbol_table = analysis.get_symbol_table() # Dict[str, JCompilationUnit] +cg = analysis.get_call_graph() # networkx.DiGraph +``` + +See [Python SDK (CLDK)](/codeanalyzer-java/integration/python-sdk/) for the full read-back API. + +## The two sections + +These describe the JSON document; the same model is mirrored node-for-node in the graph. + + + + + diff --git a/src/content/docs/schema/call-graph.mdx b/src/content/docs/schema/call-graph.mdx new file mode 100644 index 00000000..feb59f3c --- /dev/null +++ b/src/content/docs/schema/call-graph.mdx @@ -0,0 +1,126 @@ +--- +title: Call graph schema +description: The call_graph section of analysis.json — WALA-derived caller→callee edges, their endpoints, and how to load them into a graph library or read them as J_CALLS edges from Neo4j. +--- + +import { Aside } from "@astrojs/starlight/components"; + +At [analysis level 2](/codeanalyzer-java/guides/analysis-levels/), codeanalyzer-java runs WALA over the compiled program and adds a `call_graph` array to the output. Each element is one **caller→callee edge**. + +```json +{ + "call_graph": [ + { + "source": { "file_path": "...", "type_declaration": "...", "signature": "...", "callable_declaration": "..." }, + "target": { "file_path": "...", "type_declaration": "...", "signature": "...", "callable_declaration": "..." }, + "type": "CALL", + "weight": "1" + } + ] +} +``` + +## Edge shape + +```typescript +{ + source: CallableVertex // The caller + target: CallableVertex // The callee + type: string // Edge kind, e.g. "CALL" + weight: string // Call multiplicity (usually "1") +} +``` + +## Vertex shape (`CallableVertex`) + +Both `source` and `target` identify a method or constructor: + +```typescript +{ + file_path: string // File the callable lives in + type_declaration: string // Declaring type + signature: string // "methodName(Type1, Type2)" + callable_declaration: string // Full declaration text +} +``` + +The `signature` matches the keys used in the symbol table's `callable_declarations`, so you can join an edge endpoint back to its full [callable](/codeanalyzer-java/schema/symbol-table/#callable-jcallable) record (body, complexity, annotations, …). + + + +## Working with the edges + +Because edges are flat, the natural move is to load them into a graph library. The CLDK Python SDK does exactly this, exposing the call graph as a `networkx.DiGraph`: + +```python +from cldk import CLDK +from cldk.analysis import AnalysisLevel +import networkx as nx + +analysis = CLDK.java( + project_path="commons-cli", + analysis_level=AnalysisLevel.call_graph, # -> runs with -a 2 +) + +cg = analysis.get_call_graph() # networkx.DiGraph +nx.has_path(cg, source_node, sink_node) # reachability as a graph query +``` + +If you consume the JSON directly, the same idea applies — build adjacency from `source` → `target` and run your traversal of choice. + +## The same edges in the Neo4j graph + +When you emit to Neo4j (`--emit neo4j`) instead of JSON, these edges are projected as a first-class relationship rather than a flat array. Each caller→callee pair becomes a typed `J_CALLS` edge between the two `:JCallable` nodes: + +```cypher +(:JCallable)-[:J_CALLS {type, weight, source_kind, destination_kind}]->(:JCallable) +``` + +The edge properties carry the same `type` and `weight` you see in JSON, plus `source_kind` and `destination_kind` describing the endpoints. The endpoints are the same `:JCallable` nodes the symbol-table projection already created — so a call edge and the method bodies it connects live in one graph, queryable together. See the [Neo4j graph schema](/codeanalyzer-java/schema/neo4j-graph/) for the full node-and-relationship reference. + +Two projection rules are worth stating plainly, because they shape what you can and can't query: + +- **`J_CALLS` exists only at `-a 2`.** Level 1 emits the lossless symbol-table subgraph with types, methods, and fields but no call edges — exactly mirroring a level-1 `analysis.json`. Combining `-t/--target-files` with `-a 2` downgrades the run to level 1, so a targeted incremental push refreshes structure without recomputing `J_CALLS`. +- **`J_CALLS` is gated to resolved application callables.** A call edge is kept only when *both* endpoints were emitted as `:JCallable` nodes. Calls into the JDK or third-party jars therefore do not appear as `J_CALLS` edges — the same boundary as the in-memory call graph. The projector keys vertices off `callable_declaration` (the raw declaration signature) rather than the display `signature`, which is what lets constructor edges resolve to their target nodes instead of dangling (fix [#158](https://github.com/codellm-devkit/codeanalyzer-java/issues/158)). + +### Reachability as a Cypher traversal + +The `networkx` `has_path` check above has a direct graph-database analogue. Scope to one application by its `:JApplication` anchor — the `--app-name` the graph was loaded with — and ask Cypher for a path along `J_CALLS`: + +```cypher +MATCH (app:JApplication {name: $appName}) +MATCH (app)-[:J_HAS_UNIT]->(:JCompilationUnit)-[:J_DECLARES_TYPE]->(:JType) + -[:J_HAS_CALLABLE]->(src:JCallable {signature: $sourceSig}) +MATCH (dst:JCallable {signature: $sinkSig}) +RETURN exists((src)-[:J_CALLS*1..]->(dst)) AS reachable +``` + +Because the graph is persistent and multi-tenant — many applications anchored at their own `:JApplication` in one database — this traversal runs without re-analyzing anything. The CLDK SDK reads the same edges back as a `networkx.DiGraph` over a read-only Neo4j connection, so the Python example above is unchanged except for the backend: + +```python +from cldk import CLDK +from cldk.analysis import AnalysisLevel +from cldk.analysis.commons.backend_config import Neo4jConnectionConfig +import networkx as nx + +analysis = CLDK.java( + analysis_level=AnalysisLevel.call_graph, + backend=Neo4jConnectionConfig( + uri="bolt://localhost:7687", + username="neo4j", + password="neo4j", + application_name="daytrader8", # == the --app-name the graph was loaded with + ), +) + +cg = analysis.get_call_graph() # networkx.DiGraph, rebuilt from J_CALLS +nx.has_path(cg, source_node, sink_node) # identical query, no JDK or project source +``` + +The analysis is produced once — out of band, by a job running `codeanalyzer -a 2 --emit neo4j` — and read cheaply everywhere after that. Read-only credentials are sufficient on the consumer. + +## Why a build is required + +WALA analyzes *compiled* classes and needs an entry point to anchor traversal. That's why level 2 builds the project by default ([Build integration](/codeanalyzer-java/guides/build-integration/)) and why a project with no `main` and no recognized framework [entry points](/codeanalyzer-java/frameworks/entry-points/) can yield an empty `call_graph`. See [Troubleshooting](/codeanalyzer-java/troubleshooting/) if that happens. diff --git a/src/content/docs/schema/neo4j-graph.mdx b/src/content/docs/schema/neo4j-graph.mdx new file mode 100644 index 00000000..7b3689b4 --- /dev/null +++ b/src/content/docs/schema/neo4j-graph.mdx @@ -0,0 +1,240 @@ +--- +title: Neo4j graph schema +description: The property-graph projection of analysis.json — every node label, relationship type, constraint, and index, plus how the CLDK Python SDK reads the same model back out. +--- + +import Neo4jPropertyGraph from '../../../components/Neo4jPropertyGraph.astro'; +import { Aside } from "@astrojs/starlight/components"; + +`--emit neo4j` projects the same analysis IR you get from `analysis.json` into a **Neo4j property graph** instead of a file. Nothing is dropped: every compilation unit, type, callable, field, parameter, call site, variable, enum constant, record component, initializer block, CRUD operation/query, comment, annotation, and package becomes a first-class node or relationship. This page is the contract for that graph — the labels, the relationships, the keys, and the DDL — and is generated from the same source as the machine-readable [`schema.neo4j.json`](#the-schema-contract). + + + +Why a graph instead of one big JSON document? An `analysis.json` describes exactly one application and must be loaded whole into memory to be useful. The graph composes: many applications live in one Neo4j database, each anchored at its own `:JApplication` node, and you query across all of them in Cypher rather than parsing giant blobs. Whole-monorepo and cross-service questions become a graph traversal, not a memory problem. The graph is the same lossless model — just persistent, queryable, and shared. + + + +## Topology at a glance + +The graph is rooted at a single `:JApplication` anchor and fans out through the compilation units it owns. The diagram below mirrors the canonical `neo4j-schema.drawio`; the `J_CALLS` edge (drawn dashed) is added only at [analysis level 2](/codeanalyzer-java/guides/analysis-levels/). + +```mermaid +graph LR + App[":JApplication"] -->|J_HAS_UNIT| CU[":JCompilationUnit"] + CU -->|J_DECLARES_TYPE| T[":JType :JSymbol"] + CU -->|J_IMPORTS| Pkg[":JPackage"] + T -->|J_HAS_NESTED_TYPE| T + T -->|J_HAS_CALLABLE| C[":JCallable :JSymbol"] + T -->|J_HAS_FIELD| F[":JField"] + T -->|J_EXTENDS / J_IMPLEMENTS| T + T -->|J_HAS_ENUM_CONSTANT| EC[":JEnumConstant"] + T -->|J_HAS_RECORD_COMPONENT| RC[":JRecordComponent"] + T -->|J_HAS_INIT_BLOCK| IB[":JInitializationBlock"] + C -->|J_HAS_PARAMETER| P[":JParameter"] + C -->|J_HAS_CALLSITE| CS[":JCallSite"] + C -->|J_DECLARES_VAR| V[":JVariable"] + CS -->|J_RESOLVES_TO| C + C -->|"J_CALLS (level 2)"| C + T -->|J_ANNOTATED_BY| An[":JAnnotation"] + C -->|J_HAS_CRUD_OPERATION| CO[":JCrudOperation"] + C -->|J_HAS_CRUD_QUERY| CQ[":JCrudQuery"] + C -->|J_HAS_COMMENT| Cm[":JComment"] +``` + +The `(:JApplication)-[:J_HAS_UNIT]->(:JCompilationUnit)` edge is the **scoping spine**: every project-owned node is reachable from exactly one application anchor. That is what lets one database host many apps without them colliding — and what `--app-name` controls. + +## Node labels + +Sixteen node labels, all `J`-prefixed. The `key` column is the property each label MERGEs on; it is enforced by a uniqueness constraint (see [DDL](#constraints-and-indexes)). + +| Label | Key | Notable properties | +|-------|-----|--------------------| +| `:JApplication` | `name` | `name`, `schema_version` | +| `:JCompilationUnit` | `file_key` | `file_path`, `package_name`, `content_hash`, `comment_count`, `is_modified`, `_module` | +| `:JType` | `id` | `fqn`, `name`, `kind`, `modifiers`, `annotations`, `extends_list`, `implements_list`, `is_interface`, `is_entrypoint_class` | +| `:JCallable` | `id` | `signature`, `return_type`, `parameter_types`, `code`, `cyclomatic_complexity`, `is_constructor`, `is_entrypoint` | +| `:JField` | `id` | `name`, `type`, `modifiers`, `annotations`, `variables`, `variable_initializers_json`, `_module` | +| `:JParameter` | `id` | `name`, `type`, `annotations`, `modifiers`, `_module` | +| `:JVariable` | `id` | `name`, `type`, `initializer`, `_module` | +| `:JCallSite` | `id` | `method_name`, `receiver_type`, `callee_signature`, `is_static_call`, `is_constructor_call`, `_module` | +| `:JEnumConstant` | `id` | `name`, `arguments`, `_module` | +| `:JRecordComponent` | `id` | `name`, `type`, `default_value`, `is_var_args`, `_module` | +| `:JInitializationBlock` | `id` | `file_path`, `code`, `is_static`, `cyclomatic_complexity`, `_module` | +| `:JCrudOperation` | `id` | `operation_type`, `target_table`, `involved_columns`, `condition`, `joined_tables`, `_module` | +| `:JCrudQuery` | `id` | `query_type`, `query_arguments`, `_module` | +| `:JComment` | `id` | `content`, `is_javadoc`, `_module` | +| `:JPackage` | `name` | `name` | +| `:JAnnotation` | `name` | `name` | + +### Identity, merge labels, and the entrypoint marker + +A few conventions make the keys above unambiguous: + +- **`:JType` and `:JCallable` also carry a shared `:JSymbol` label.** That is the global-identity / MERGE key for anything that can be referenced from elsewhere in the graph. A single constraint on `:JSymbol(id)` enforces that no two symbols collide, across all types and callables. A type's `id` is its **fully-qualified name** (`com.example.MyService`); a callable's `id` is `#` (`com.example.MyService#doWork(java.lang.String)`), so overloads stay distinct. +- **`:JCompilationUnit` keys on `file_key`, which is the file path.** `file_key` is the unique merge key; `file_path` is the same string carried as an ordinary property for convenience. +- **`:JEntrypoint` is a marker label, not a node type.** It is added to the owning `:JCallable` (or `:JType`) when that element is a `main` method or a recognized [framework entry point](/codeanalyzer-java/frameworks/entry-points/). Find every entry point with `MATCH (c:JEntrypoint)`. + + + +### Shared vs. app-scoped nodes + +`:JPackage` and `:JAnnotation` are keyed only by `name` and are **shared across applications** in the same database — `java.util` is `java.util` for everyone. Every other node hangs off the `:JApplication` spine and belongs to exactly one app. The [per-application wipe](#multi-tenancy-and-the-app-name-anchor) deletes an app's own subgraph while leaving these shared nodes intact. + +## Relationship types + +Twenty relationship types, all `J_`-prefixed. Endpoints with a `|` accept any of the listed labels. + +| Relationship | From → To | Properties | +|--------------|-----------|------------| +| `J_HAS_UNIT` | `:JApplication` → `:JCompilationUnit` | — | +| `J_DECLARES_TYPE` | `:JCompilationUnit` → `:JType` | — | +| `J_HAS_NESTED_TYPE` | `:JType` → `:JType` | — | +| `J_HAS_CALLABLE` | `:JType` → `:JCallable` | — | +| `J_HAS_FIELD` | `:JType` → `:JField` | — | +| `J_HAS_PARAMETER` | `:JCallable` → `:JParameter` | — | +| `J_HAS_CALLSITE` | `:JCallable` \| `:JInitializationBlock` → `:JCallSite` | — | +| `J_DECLARES_VAR` | `:JCallable` \| `:JInitializationBlock` → `:JVariable` | — | +| `J_HAS_ENUM_CONSTANT` | `:JType` → `:JEnumConstant` | — | +| `J_HAS_RECORD_COMPONENT` | `:JType` → `:JRecordComponent` | — | +| `J_HAS_INIT_BLOCK` | `:JType` → `:JInitializationBlock` | — | +| `J_EXTENDS` | `:JType` → `:JType` | gated | +| `J_IMPLEMENTS` | `:JType` → `:JType` | gated | +| `J_ANNOTATED_BY` | `:JType` \| `:JCallable` \| `:JField` → `:JAnnotation` | — | +| `J_IMPORTS` | `:JCompilationUnit` → `:JType` \| `:JPackage` | `path`, `is_static`, `is_wildcard` | +| `J_RESOLVES_TO` | `:JCallSite` → `:JCallable` | gated | +| `J_CALLS` | `:JCallable` → `:JCallable` | `type`, `weight`, `source_kind`, `destination_kind` — gated, level 2 only | +| `J_HAS_CRUD_OPERATION` | `:JCallable` \| `:JCallSite` → `:JCrudOperation` | — | +| `J_HAS_CRUD_QUERY` | `:JCallable` \| `:JCallSite` → `:JCrudQuery` | — | +| `J_HAS_COMMENT` | `:JCompilationUnit` \| `:JType` \| `:JCallable` \| `:JField` \| `:JCallSite` \| `:JVariable` \| `:JRecordComponent` \| `:JInitializationBlock` → `:JComment` | — | + +A single-type import (`import com.example.Foo;`) links to the `:JType`; a wildcard or static import links to the `:JPackage`. The `J_IMPORTS` edge carries `path`, `is_static`, and `is_wildcard` so the three cases stay distinguishable. + + + +## Constraints and indexes + +The writers run this DDL before any load, so every `MERGE` is an index seek rather than a label scan and the identity invariants are enforced by the database. Every statement is idempotent (`IF NOT EXISTS`). + +**15 uniqueness constraints** — one per keyed label. The first is the global identity constraint that backs the shared `:JSymbol` merge: + +```cypher +CREATE CONSTRAINT j_symbol_id IF NOT EXISTS FOR (s:JSymbol) REQUIRE s.id IS UNIQUE; +CREATE CONSTRAINT j_application_name IF NOT EXISTS FOR (a:JApplication) REQUIRE a.name IS UNIQUE; +CREATE CONSTRAINT j_compilation_unit_key IF NOT EXISTS FOR (c:JCompilationUnit) REQUIRE c.file_key IS UNIQUE; +-- … plus JPackage.name, JAnnotation.name, and per-id constraints on +-- JCallSite, JField, JParameter, JVariable, JEnumConstant, +-- JRecordComponent, JInitializationBlock, JCrudOperation, +-- JCrudQuery, and JComment (15 total). +``` + +**4 indexes**, including a fulltext index over callable source for code search: + +```cypher +CREATE INDEX j_callable_name IF NOT EXISTS FOR (c:JCallable) ON (c.name); +CREATE INDEX j_type_name IF NOT EXISTS FOR (t:JType) ON (t.name); +CREATE INDEX j_annotation_name_idx IF NOT EXISTS FOR (an:JAnnotation) ON (an.name); +CREATE FULLTEXT INDEX j_code_fts IF NOT EXISTS FOR (c:JCallable) ON EACH [c.code, c.docstring]; +``` + +The `j_code_fts` fulltext index lets you search method bodies and docstrings directly: + +```cypher +CALL db.index.fulltext.queryNodes('j_code_fts', 'executeQuery AND prepareStatement') +YIELD node, score +RETURN node.signature, score +ORDER BY score DESC; +``` + +## Multi-tenancy and the `--app-name` anchor + +`--app-name` names the single `:JApplication` anchor that scopes everything you push. It defaults to the base name of the `-i` input directory (and is the literal `application` when there is no input). Because the anchor name is unique (`j_application_name`), one Neo4j database can host many applications side by side, each rooted at its own anchor — and you query across them, or scope to one, in Cypher. + +```cypher +// Every callable in one application +MATCH (a:JApplication {name: 'daytrader8'})-[:J_HAS_UNIT]->(:JCompilationUnit) + -[:J_DECLARES_TYPE]->(:JType)-[:J_HAS_CALLABLE]->(c:JCallable) +RETURN count(c); + +// Cross-application: which apps declare a type named "AccountServiceImpl"? +MATCH (a:JApplication)-[:J_HAS_UNIT]->(:JCompilationUnit) + -[:J_DECLARES_TYPE]->(t:JType {name: 'AccountServiceImpl'}) +RETURN a.name, t.fqn; +``` + +Re-pushing an app is scoped, too. The `graph.cypher` snapshot wipes only the named app's prior subgraph — `MATCH (a:JApplication {name: })` then `DETACH DELETE` its units and descendants — leaving other apps and the shared `:JPackage` / `:JAnnotation` nodes untouched. The live Bolt writer goes further: it diffs each compilation unit's `content_hash` against the database and replaces **only the changed units' subgraphs**, pruning units whose source file vanished on a full run (pruning is skipped on a `-t` targeted run). See [the two emit modes](#producing-the-graph) below. + + + +## Producing the graph + +`--emit neo4j` has two sub-modes, decided purely by whether a Bolt URI resolved (the `--neo4j-uri` flag or the `NEO4J_URI` environment variable): + +- **No URI → `graph.cypher` snapshot.** A self-contained, re-runnable Cypher script: the DDL above, a scoped wipe of this app's prior subgraph, then batched `UNWIND … MERGE` for nodes and edges. It expresses the *full* truth of the analysis and is **not** incremental. Load it with `cypher-shell`. +- **URI present → live incremental Bolt push.** The Bolt writer ensures the DDL, content-hash-diffs each compilation unit against the live database, and upserts **only what changed** via idempotent `MERGE`. Shared `:JPackage` / `:JAnnotation` nodes are MERGE-only. + +```bash +# Snapshot: write graph.cypher, then load it +codeanalyzer -i /path/to/project -a 2 --emit neo4j --app-name daytrader8 -o ./out +cypher-shell -u neo4j -p "$NEO4J_PASSWORD" < ./out/graph.cypher + +# Live incremental push over Bolt (NEO4J_PASSWORD from the environment) +export NEO4J_PASSWORD=… +codeanalyzer -i /path/to/project -a 2 --emit neo4j --app-name daytrader8 \ + --neo4j-uri bolt://localhost:7687 --neo4j-user neo4j --neo4j-database neo4j +``` + +`SCHEMA_VERSION` (currently `1.0.0`) is stamped on the `:JApplication` node of every emitted graph, so consumers can check the contract version before querying. + + + +## The schema contract + +`--emit schema` prints this entire schema as machine-readable JSON — labels, relationships, constraints, and indexes — without analyzing any project: + +```bash +codeanalyzer --emit schema -o ./out # → ./out/schema.neo4j.json (stdout if -o is omitted) +``` + +The document is `schema.neo4j.json` (`schema_version` `1.0.0`). A conformance test asserts the projector never emits a label, relationship, or property the catalog doesn't declare, and that the checked-in `schema.neo4j.json` is current — so this page and the database stay in lockstep with the code. + +## Reading the graph from the Python SDK + +The big payoff: once a graph exists, the [CLDK Python SDK](/codeanalyzer-java/integration/python-sdk/) reads the **same typed model** back out of Neo4j without re-analyzing anything. There is **no JDK, no native binary, and no project source** on the consumer — only the Bolt URI and read-only credentials. Analysis is produced once, centrally, and read cheaply everywhere. + +```python +# Read-only Neo4j backend — no analyzer engine, no JDK, no project source +from cldk import CLDK +from cldk.analysis import AnalysisLevel +from cldk.analysis.commons.backend_config import Neo4jConnectionConfig + +analysis = CLDK.java( + analysis_level=AnalysisLevel.call_graph, + backend=Neo4jConnectionConfig( + uri="bolt://localhost:7687", + username="neo4j", + password="neo4j", # read-only credentials suffice + application_name="daytrader8", # == the --app-name the graph was pushed with + ), +) + +symbol_table = analysis.get_symbol_table() # Dict[str, JCompilationUnit] +cg = analysis.get_call_graph() # networkx.DiGraph +klass = analysis.get_class("com.example.AccountServiceImpl") +methods = analysis.get_methods_in_class("com.example.AccountServiceImpl") +``` + +The backend bulk-fetches nodes and relationships in a handful of Cypher queries and rebuilds the *same* canonical `JApplication` — symbol table of `JCompilationUnit` plus the `networkx` call graph — that the in-process analyzer produces. The `get_*` methods (`get_classes`, `get_methods`, `get_callers`, `get_callees`, `get_entry_point_methods`, `get_all_crud_operations`, …) return the identical typed objects (`JType`, `JCallable`). + + diff --git a/src/content/docs/schema/symbol-table.mdx b/src/content/docs/schema/symbol-table.mdx new file mode 100644 index 00000000..515f6ad0 --- /dev/null +++ b/src/content/docs/schema/symbol-table.mdx @@ -0,0 +1,203 @@ +--- +title: Symbol table schema +description: The full structure of the symbol_table section of analysis.json — compilation units, types, callables, fields, comments, and imports. +--- + +import { Aside } from "@astrojs/starlight/components"; + +The `symbol_table` is the always-present structural model of the program. It is a map from **absolute file path** to a **compilation unit** (one `.java` file). Everything below is serialized in `snake_case` (see [serialization conventions](/codeanalyzer-java/schema/#serialization-conventions)); field types are shown in TypeScript-ish notation for clarity. + + + +```json +{ + "symbol_table": { + "/abs/path/to/Foo.java": { /* JavaCompilationUnit */ } + } +} +``` + +## Compilation unit + +A single `.java` source file. + +```typescript +{ + file_path: string // Absolute path + package_name: string // Package declaration + comments: JComment[] // File-level comments + imports: JImport[] // Import declarations + type_declarations: { // Top-level types in this file + [typeName: string]: JType + } + is_modified?: boolean // Set on incremental updates +} +``` + +The `is_modified` flag is set when a file is re-analyzed through [incremental target-file analysis](/codeanalyzer-java/guides/incremental-analysis/). + +## Type (`JType`) + +A class, interface, enum, annotation, or record. + +```typescript +{ + is_class_or_interface_declaration: boolean + is_enum_declaration: boolean + is_annotation_declaration: boolean + is_record_declaration: boolean + is_interface: boolean + is_nested_type: boolean + is_inner_class: boolean + is_local_class: boolean + + modifiers: string[] // "public", "abstract", ... + annotations: string[] // "@Deprecated", ... + + extends_list: string[] // Superclass name(s), qualified + implements_list: string[] // Implemented interface names + parent_type: string | null // For nested / inner types + nested_type_declarations: string[] // Names of nested types + + field_declarations: JField[] + callable_declarations: { // Methods + constructors + [signature: string]: JCallable + } + enum_constants: JEnumConstant[] // Enum members + record_components: JRecordComponent[] // Record components + initialization_blocks: JInitializationBlock[] + comments: JComment[] + + is_entrypoint_class: boolean // true for main(String[]) classes +} +``` + +The boolean discriminators (`is_enum_declaration`, `is_record_declaration`, …) tell you which kind of type this is. See [Entry points](/codeanalyzer-java/frameworks/entry-points/) for `is_entrypoint_class`. + +## Callable (`JCallable`) + +A method or constructor. Keyed in `callable_declarations` by its signature. + +```typescript +{ + signature: string // "methodName(Type1, Type2)" + declaration: string // Full declaration with modifiers + + modifiers: string[] // "public", "static", "final", ... + annotations: string[] + return_type: string | null // null for constructors + thrown_exceptions: string[] + + parameters: JParameter[] // Declared parameters + comments: JComment[] + + code: string // Method body source + file_path: string + start_line: number // Span in source + end_line: number + code_start_line: number // Where the body begins + + call_sites: JCallSite[] // Calls made inside this method + referenced_types: string[] // Types referenced in the body + accessed_fields: string[] // Fields read or written + variable_declarations: JVariableDeclaration[] + + crud_operations: JCRUDOperation[] // Detected DB operations + crud_queries: JCRUDQuery[] // Detected query definitions + + cyclomatic_complexity: number + is_constructor: boolean + is_implicit: boolean // Synthesized (e.g. default ctor) + is_entrypoint: boolean // main or framework entry point +} +``` + +`call_sites` give you the syntactic calls within a body even at level 1; the semantic, resolved [call graph](/codeanalyzer-java/schema/call-graph/) is the level-2 `call_graph`. See [CRUD detection](/codeanalyzer-java/frameworks/crud/) for `crud_operations` / `crud_queries`. + +## Field (`JField`) + +```typescript +{ + comments: JComment[] + name: string[] // Declared names (supports multi-declarators) + type: string // Field type + start_line: number + end_line: number + modifiers: string[] + annotations: string[] + initializer: string // Initializer expression, if any +} +``` + +## Comment (`JComment`) + +```typescript +{ + content: string // Comment text + start_line: number + end_line: number + start_column: number + end_column: number + is_javadoc: boolean // true for /** ... */ blocks +} +``` + +Comments appear both at file level (on the compilation unit and type) and attached to individual callables. + +## Import (`JImport`) + +```typescript +{ + path: string // Fully-qualified name, or package for wildcards + is_static: boolean // true for "import static ..." + is_wildcard: boolean // true for "import ....*" +} +``` + + + +## Other entities + +Records, enums, and initializer blocks have their own small entities referenced above: + +- **`JEnumConstant`** — an enum member, with its name, arguments, and comments. +- **`JRecordComponent`** — a record component, with name, type, modifiers, and annotations. +- **`JInitializationBlock`** — a static or instance initializer block, with its source and span. +- **`JParameter`** — a callable parameter: name, type, annotations. +- **`JVariableDeclaration`** — a local variable declared in a method body. +- **`JCallSite`** — a single call expression inside a body (receiver, method name, argument types, location). + +## Projection to the property graph + +When you emit with `--emit neo4j`, every entity above maps to a Neo4j node label. The mapping is direct — the graph is a lossless projection of the same IR, so nothing is dropped: + +| `symbol_table` entity | Node label | Node key | +| --- | --- | --- | +| Compilation unit | `:JCompilationUnit` | `file_key` (the absolute file path) | +| `JType` | `:JType` (`:JSymbol`) | `id` = the type's `fqn` | +| `JCallable` | `:JCallable` (`:JSymbol`) | `id` = `#` | +| `JField` | `:JField` | `id` = `#field#` | +| `JParameter` | `:JParameter` | `id` | +| `JVariableDeclaration` | `:JVariable` | `id` | +| `JCallSite` | `:JCallSite` | `id` | +| `JEnumConstant` | `:JEnumConstant` | `id` | +| `JRecordComponent` | `:JRecordComponent` | `id` | +| `JInitializationBlock` | `:JInitializationBlock` | `id` | +| `JComment` | `:JComment` | `id` | + +`:JType` and `:JCallable` carry the shared `:JSymbol` merge label (one global `id` namespace), and `main(String[])` types and entry-point callables additionally get the `:JEntrypoint` marker. + +Containment is expressed as relationships: a compilation unit `J_DECLARES_TYPE` its top-level types, a type `J_HAS_CALLABLE` / `J_HAS_FIELD` / `J_HAS_ENUM_CONSTANT` / `J_HAS_RECORD_COMPONENT` / `J_HAS_INIT_BLOCK` its members, and a callable `J_HAS_PARAMETER` / `J_HAS_CALLSITE` / `J_DECLARES_VAR` its parts. Two things from `analysis.json` are promoted from inline values to shared, deduplicated nodes: + +- **Imports.** Each `JImport` becomes a `J_IMPORTS` relationship carrying `path`, `is_static`, and `is_wildcard`. A single-type import links to the imported `:JType`; a wildcard or static import links to a `:JPackage`. Multiple imports from one package stay distinct edges. +- **Comments and annotations.** Comments become first-class `:JComment` nodes (via `J_HAS_COMMENT`) in addition to a convenience docstring property; annotation strings become shared `:JAnnotation` nodes (via `J_ANNOTATED_BY`) alongside the `annotations` string array. + + + +For the semantic call graph that resolves these call sites across the whole program, continue to the [call graph schema](/codeanalyzer-java/schema/call-graph/). diff --git a/src/content/docs/troubleshooting.mdx b/src/content/docs/troubleshooting.mdx new file mode 100644 index 00000000..0421900c --- /dev/null +++ b/src/content/docs/troubleshooting.mdx @@ -0,0 +1,176 @@ +--- +title: Troubleshooting +description: Common codeanalyzer-java problems and fixes — missing JDK, unresolved types, empty call graphs, legacy import schema, native-image quirks, and Neo4j graph output. +--- + +import { Aside } from "@astrojs/starlight/components"; + +Quick fixes for the issues you're most likely to hit. Run with `-v` first — most failures explain themselves in the verbose logs. + +## Reference table + +| Symptom | Likely cause | Fix | +|---------|--------------|-----| +| `java: command not found` | No JDK on `PATH` | Install Java 11+ and add it to `PATH` (see [Installation](/codeanalyzer-java/installing/)). | +| `Cannot find symbol type X` / unresolved types | Dependencies not downloaded | Let codeanalyzer build (don't use `--no-build` on an uncompiled project), or ensure dependencies are resolvable. Use `--no-clean-dependencies` to inspect what was fetched. | +| `call_graph` is empty | No entry point for WALA to anchor on | Verify the project has a `main(String[])` or a recognized framework [entry point](/codeanalyzer-java/frameworks/entry-points/). | +| Legacy import schema error | Old `analysis.json` read by a new JAR | Regenerate `analysis.json` with codeanalyzer 2.3.7+ (see below). | +| Build fails during level-2 analysis | Project doesn't build with the default command | Pass a working `-b ""`, or pre-build and use `--no-build`. | +| Native binary throws, JAR doesn't | Stale `reflect-config.json` | Regenerate native-image config (see below). | +| `analysis.json` truncated / corrupt | Process killed or out of disk | Check disk space and re-run; ensure the run completes. | +| `--neo4j-uri` ignored, `graph.cypher` written instead | Running the native binary (no bundled driver) | Push over Bolt from the fat JAR, `java -jar` (see below). | +| Graph empty / wrong app when reading from CLDK | `application_name` doesn't match the `--app-name` the graph was loaded with | Pass the same name in `Neo4jConnectionConfig` (see below). | +| Stale or duplicate nodes after a rename | Snapshot wipe / Bolt prune are scoped per app; deletes only pruned on a full run | Re-run without `-t`, or re-load the snapshot (see below). | +| Bolt push: `authentication failure` / wrong database | Default `neo4j`/`neo4j` credentials or unset `NEO4J_*` env | Set `NEO4J_PASSWORD` / `--neo4j-database` (see below). | +| `J_CALLS` edges missing from the graph | Ran at level 1, or callee is an external library symbol | Run `-a 2` on a full (non-`-t`) analysis (see below). | + +## Empty call graph + +WALA traverses the call graph outward from entry points. If none are found, the graph can be empty even though the symbol table is complete. + +- Confirm the project actually has an entry point — a `main(String[])` or one of the [supported framework patterns](/codeanalyzer-java/frameworks/entry-points/). +- Confirm the project **built**. WALA needs compiled classes; if the build silently failed, there's nothing to analyze. Re-run with `-v` and check the build log. +- If you used `--no-build`, make sure the compiled output is actually present and current. + +## Unresolved types + +Symbol resolution depends on library dependencies being available. If types from third-party libraries show up as simple (unqualified) names: + +- Don't run `--no-build` on a project that isn't already built — dependency download is part of the normal flow. +- Inspect what was fetched by adding `--no-clean-dependencies` and looking in `target/_library_dependencies/` (Maven) or `build/_library_dependencies/` (Gradle). +- For multi-module projects, point `-f` at the reactor root `pom.xml` / `build.gradle`. See [Build integration](/codeanalyzer-java/guides/build-integration/). + +## Legacy import schema + +When merging [incremental updates](/codeanalyzer-java/guides/incremental-analysis/) into an existing `analysis.json`, you may see: + +> Existing analysis.json uses legacy import schema (imports as strings). Regenerate analysis with codeanalyzer 2.3.7 or newer. + +Older analyzers emitted imports as bare strings; from 2.3.7 they are structured objects (`{ path, is_static, is_wildcard }`). The merge guard refuses to mix the two. **Fix:** delete the old `analysis.json` and regenerate it with a current JAR before re-running incremental updates. + +## Native-image exceptions + +If the GraalVM [native binary](/codeanalyzer-java/installing/#option-2-native-binary-graalvm) throws random exceptions that `java -jar` does not, the reflection config is likely out of date. Regenerate it with the native-image agent and rebuild: + +```bash +./gradlew fatJar +java -agentlib:native-image-agent=config-output-dir=src/main/resources/META-INF/native-image-config \ + -jar build/libs/codeanalyzer-2.3.7.jar -i -a 2 -v +./gradlew nativeCompile +``` + +## Neo4j graph output + +These cover the [`--emit neo4j`](/codeanalyzer-java/guides/neo4j-output/) projection — the live Bolt push, the `graph.cypher` snapshot, and reading the graph back from the [CLDK Python SDK](/codeanalyzer-java/integration/python-sdk/). + +### `--neo4j-uri` is ignored and a `graph.cypher` file is written instead + +The Neo4j driver is deliberately **not** bundled into the GraalVM native binary — it's loaded reflectively so native-image can prune the driver and Netty. The prebuilt `codeanalyzer` native binary therefore cannot open a Bolt connection: when you pass `--neo4j-uri` it **degrades gracefully to writing `graph.cypher`** and logs a warning, rather than pushing anything live. + +If you actually wanted the live, incremental push, run it from the fat JAR instead: + +```bash +NEO4J_PASSWORD=secret java -jar codeanalyzer-2.3.7.jar \ + -i /path/to/project -a 2 \ + --emit neo4j --app-name daytrader8 \ + --neo4j-uri bolt://localhost:7687 --neo4j-user neo4j +``` + +This is the producer side of the [producer/consumer split](/codeanalyzer-java/guides/architecture/): the JAR runs out-of-band (a CI step, or a Kubernetes Job / CronJob) and pushes app-scoped subgraphs to a shared Neo4j over Bolt. If you only need the snapshot — for review, version control, or an air-gapped load — the native binary's degraded behaviour is fine; just load the file afterwards with `cypher-shell < graph.cypher`. + + + +### Graph is empty, or you get the wrong app, when reading from CLDK + +The Neo4j-backed SDK is a pure read-only client — it never builds the graph, it only queries one that a `codeanalyzer --emit neo4j` job has already populated. Every query is scoped to a single application by `application_name`, which **must equal the `--app-name` the graph was loaded with**. A mismatch silently returns nothing, because the query anchors on a `:JApplication` node that doesn't exist. + +```python +from cldk import CLDK +from cldk.analysis import AnalysisLevel +from cldk.analysis.commons.backend_config import Neo4jConnectionConfig + +analysis = CLDK.java( + analysis_level=AnalysisLevel.call_graph, + backend=Neo4jConnectionConfig( + uri="bolt://localhost:7687", + username="neo4j", + password="neo4j", + application_name="daytrader8", # == the CLI --app-name + ), +) +symbol_table = analysis.get_symbol_table() # Dict[str, JCompilationUnit] +cg = analysis.get_call_graph() # networkx.DiGraph +``` + +Checklist: + +- **Match the name exactly.** Remember the default: when you populated the graph without `--app-name`, the anchor took the base name of the `-i` input directory (or the literal `application` if there was no input). Confirm what's actually in the database: + + ```cypher + MATCH (a:JApplication) RETURN a.name, a.schema_version + ``` + +- **Confirm the graph was populated at all.** If the producer ran the native binary with `--neo4j-uri`, it may have written `graph.cypher` instead of pushing (see above) — nothing reached the database. +- **Install the driver.** Constructing the backend without it raises `CodeanalyzerExecutionException` with an install hint. Run `pip install cldk[neo4j]` (or `pip install neo4j`). +- **Check the schema version.** The read-back expects an emitter at **2.4.0 or newer** (projection fixes landed in **2.4.1**). The `schema_version` stamped on the `:JApplication` node is `1.0.0`; keep the analyzer that writes the graph and the SDK that reads it on compatible versions. + + + +### Stale or duplicate nodes after a rename or delete + +Both emit modes are **scoped per application**, and they handle vanished files differently: + +- The **`graph.cypher` snapshot** opens with a wipe that deletes *only this app's* prior subgraph — `MATCH (a:JApplication {name: })` then detaches its units and descendants — before re-loading the full truth. Shared `:JPackage` / `:JAnnotation` nodes are intentionally left in place so other apps that reference them aren't disturbed. Re-loading the snapshot is therefore always a clean slate for that one app. +- The **live Bolt push** is incremental. It diffs each compilation unit's `content_hash` and replaces only changed units' subgraphs. Orphan pruning — deleting units whose source file has vanished — runs **only on a full analysis**. A **targeted run (`-t`) skips pruning** so it can touch just the files you named, which means a deleted or renamed file's old nodes can linger. + +So if you renamed or deleted a class and its old nodes are still in the graph: + +- Re-run a **full** analysis (no `-t`) over Bolt so orphan pruning removes the vanished unit: + + ```bash + NEO4J_PASSWORD=secret java -jar codeanalyzer-2.3.7.jar \ + -i /path/to/project -a 2 \ + --emit neo4j --app-name daytrader8 \ + --neo4j-uri bolt://localhost:7687 --neo4j-user neo4j + ``` + +- Or regenerate and re-load the `graph.cypher` snapshot, whose scoped wipe clears this app's subgraph wholesale before reloading. + +Renames produce *duplicates* (not just staleness) precisely because the old FQN and the new one are distinct node keys — the upsert can't know they're the same logical unit. A full run reconciles them. + +### Bolt connection or authentication failures + +Credentials and target database resolve from a flag first, then the matching environment variable, then a built-in default. Prefer the `NEO4J_*` environment variables — especially `NEO4J_PASSWORD` — so secrets stay off the command line and out of shell history. + +| Setting | Flag | Env var | Default | +|---------|------|---------|---------| +| URI | `--neo4j-uri` | `NEO4J_URI` | *(none — without it, no live push)* | +| User | `--neo4j-user` | `NEO4J_USERNAME` | `neo4j` | +| Password | `--neo4j-password` | `NEO4J_PASSWORD` | `neo4j` | +| Database | `--neo4j-database` | `NEO4J_DATABASE` | *(server default)* | + +- An `authentication failure` usually means the run fell back to the `neo4j`/`neo4j` defaults against a server with real credentials. Export `NEO4J_PASSWORD` (and `NEO4J_USERNAME` if it isn't `neo4j`) before running. +- A "database not found" error means `--neo4j-database` / `NEO4J_DATABASE` names a database that doesn't exist on the server. Leave it unset to use the server default, or create the database first. +- The analyzer only needs write access. The SDK consumers that read the graph can — and in production should — use separate **read-only** credentials, which is the point of the producer/consumer split. + +### `J_CALLS` edges are missing + +`J_CALLS` is the level-2 call-graph edge between two application callables. If your queries find types and methods but no `J_CALLS` relationships: + +- **Run at `-a 2`.** Level 1 emits the lossless symbol-table subgraph with no `J_CALLS`. Only level 2 adds the WALA call-graph edges. +- **Don't combine `-t` with `-a 2`.** A targeted run downgrades to level 1, so it refreshes the symbol-table subgraph but recomputes no call edges. Run a full `-a 2` analysis to (re)build `J_CALLS`. +- **Expect gaps at the boundary.** `J_CALLS` is gated to both endpoints being emitted application callables. Calls into external/library targets that were never emitted as `:JCallable` nodes have no edge — this is documented projection-lossy behaviour, not a bug. Verify with: + + ```cypher + MATCH (a:JApplication {name: "daytrader8"})-[:J_HAS_UNIT]->(:JCompilationUnit) + -[:J_DECLARES_TYPE]->(:JType)-[:J_HAS_CALLABLE]->(c:JCallable) + RETURN count { (c)-[:J_CALLS]->() } AS outgoing_calls + ``` + + diff --git a/src/content/docs/what-is-codeanalyzer.mdx b/src/content/docs/what-is-codeanalyzer.mdx new file mode 100644 index 00000000..d5984e14 --- /dev/null +++ b/src/content/docs/what-is-codeanalyzer.mdx @@ -0,0 +1,129 @@ +--- +title: What is codeanalyzer-java? +description: The mental model — a standalone JVM tool that turns a Java project into one versioned JSON document, or projects it into a Neo4j property graph, combining a Javaparser symbol table and a WALA call graph. +--- + +import Neo4jPropertyGraph from '../../components/Neo4jPropertyGraph.astro'; +import { Aside, LinkCard, CardGrid } from "@astrojs/starlight/components"; + +**codeanalyzer-java** is a standalone, self-contained JVM tool that performs static analysis on enterprise Java applications. You hand it a project (or a single source string); it extracts a comprehensive symbol table and, at analysis level 2, an interprocedural call graph — and emits them either as the canonical `analysis.json` document or as a **Neo4j property graph** (`--emit neo4j`). + +It is the JVM analysis engine behind [CodeLLM-DevKit (CLDK)](https://github.com/codellm-devkit/python-sdk)'s Java support. The Python SDK does not re-implement Java analysis — it either shells out to this binary and deserializes the JSON into typed models, or, when you point it at Neo4j, reads the same typed models straight from the graph. You can also run the binary directly and consume the output yourself. + + + +## The mental model + +```mermaid +flowchart LR + A["Java project
(or source string)"] --> B["codeanalyzer
(fat JAR / native image)"] + B --> IR["analysis IR
(symbol table + call graph)"] + IR -->|"default"| C["analysis.json"] + IR -->|"--emit neo4j"| G["Neo4j property graph
(J* labels, J_* relationships)"] + C --> D["CLDK Python SDK
(JavaAnalysis)"] + C --> E["Your own tooling
/ agent / script"] + G -->|"no URI"| SNAP["graph.cypher snapshot
(scoped wipe + UNWIND ... MERGE)"] + G -->|"--neo4j-uri (Bolt)"| LIVE["live Neo4j cluster
(incremental content_hash diff)"] + SNAP -->|"cypher-shell < graph.cypher"| LIVE + LIVE --> SDK["CLDK Neo4j backend
(read-only, no JDK / source)"] + LIVE --> Q["Cypher / dashboards
/ agents"] +``` + +There are a few things to keep straight: + +1. **The project** — the Java source you want to understand. codeanalyzer can resolve types either from a built project's dependencies or from a single in-memory source string. +2. **The binary** — `codeanalyzer`, a single fat JAR (or a GraalVM native image) bundling WALA, Javaparser, and everything else. No server, no database are required *to run it*; it reads source/binaries and writes its output. +3. **The output** — by default a versioned `analysis.json` with `symbol_table` and (at analysis level 2) `call_graph` keys. With `--emit neo4j`, the same intermediate representation is instead projected into a Neo4j property graph — losslessly, as first-class nodes and relationships. + +## Two analysis engines, one IR, two outputs + +codeanalyzer-java combines two complementary static-analysis technologies: + +- **Javaparser + Symbol Solver** does the *syntactic* work — parsing `.java` files into ASTs and resolving types — to build the **symbol table**: every class, interface, enum, and record, with their fields, methods, constructors, comments, and imports. +- **WALA** (the T.J. Watson Libraries for Analysis) does the *semantic* work — building a class hierarchy and an interprocedural **call graph** from the compiled program. + +The symbol table is always produced. The call graph is produced only when you ask for analysis level 2 (`-a 2`). That single intermediate representation is then serialized one of two ways — and the output target is an *alternative*, not additive: + +- `--emit json` (the default) writes `analysis.json`. +- `--emit neo4j` projects the IR into a graph instead and returns **without** writing `analysis.json`. + +See [Architecture](/codeanalyzer-java/guides/architecture/) and [Analysis levels](/codeanalyzer-java/guides/analysis-levels/). + + + +## The Neo4j property graph + +`--emit neo4j` turns a per-project JSON file into a **queryable, persistent system of record**. The graph is a lossless projection of the IR: compilation units, types, callables, fields, parameters, call sites, variables, enum constants, record components, initialization blocks, CRUD operations and queries, comments, annotations, and packages all become first-class nodes. Java labels are `J`-prefixed and relationship types `J_`-prefixed (e.g. `(:JApplication)-[:J_HAS_UNIT]->(:JCompilationUnit)`, `(:JCallable)-[:J_CALLS]->(:JCallable)`), so a Java graph can share one Neo4j database with the Python (`Py*`/`PY_*`) and TypeScript (`TS*`/`TS_*`) backends without colliding. + +Every application is anchored at its own `:JApplication` node, keyed by `--app-name`. That anchor is the **tenancy boundary**: one Neo4j database can host many applications side by side, each rooted at its own `:JApplication`, and you query across all of them with Cypher instead of loading giant JSON blobs into memory. Whole-monorepo and cross-service analysis becomes a graph traversal, not a memory problem. + +There are two emit modes, decided purely by whether a Bolt URI resolves (from `--neo4j-uri` or the `NEO4J_URI` env var): + +- **No URI → a `graph.cypher` snapshot.** Self-contained and re-runnable: constraints and indexes, a scoped wipe of *this* application's prior subgraph, then batched `UNWIND ... MERGE` loads of the full truth. The snapshot is not incremental — it expresses the whole current state — and you load it with `cypher-shell < graph.cypher`. +- **URI present → a live, incremental Bolt push.** The writer reads the database's current state and updates only what changed: it diffs each compilation unit's `content_hash` (SHA-256 over the unit) against the live DB, replaces only changed units' subgraphs via idempotent `MERGE` upserts, upserts shared `:JPackage`/`:JAnnotation` nodes MERGE-only, and on a full run prunes units whose source file has vanished (orphan pruning is skipped on a targeted `-t` run). + +```bash +# Snapshot: no URI, writes ./graph.cypher +codeanalyzer -i /path/to/daytrader8 -a 2 --emit neo4j --app-name daytrader8 + +# Live incremental push over Bolt (prefer the NEO4J_PASSWORD env var) +export NEO4J_PASSWORD=secret +codeanalyzer -i /path/to/daytrader8 -a 2 --emit neo4j \ + --app-name daytrader8 \ + --neo4j-uri bolt://localhost:7687 \ + --neo4j-user neo4j \ + --neo4j-database neo4j +``` + + + +Once the graph exists, the Python SDK can read from it instead of re-analyzing. Point CLDK at the Bolt URI with a `Neo4jConnectionConfig` and it reconstructs the **same** typed `JApplication` (symbol table + `networkx` call graph) as the in-process analyzer — with no JDK, no native binary, and no project source on the consumer. It only needs the graph and read-only credentials. The `application_name` here must match the `--app-name` the graph was loaded with: + +```python +# Java project — read-only Neo4j backend (no JDK, no binary, no source) +from cldk import CLDK +from cldk.analysis import AnalysisLevel +from cldk.analysis.commons.backend_config import Neo4jConnectionConfig + +analysis = CLDK.java( + analysis_level=AnalysisLevel.call_graph, + backend=Neo4jConnectionConfig( + uri="bolt://localhost:7687", + username="neo4j", + password="neo4j", # read-only credentials suffice + application_name="daytrader8", # == the producer's --app-name + ), +) +symbol_table = analysis.get_symbol_table() # Dict[str, JCompilationUnit] +cg = analysis.get_call_graph() # networkx.DiGraph +klass = analysis.get_class("com.example.MyService") +methods = analysis.get_methods_in_class("com.example.MyService") +``` + +This is the enterprise unlock: analysis is **produced once, centrally** (a CI / Kubernetes Job or CronJob running the jar pushes app-scoped subgraphs into a shared cluster) and **read cheaply everywhere** (agents, the SDK, and dashboards are lightweight read-only clients that scale independently of the heavier analysis pods). See [Reading from Neo4j with the Python SDK](/codeanalyzer-java/integration/python-sdk/) and the [Neo4j graph schema](/codeanalyzer-java/schema/). + +## What it is good at + +- **Enterprise Java** — it understands Maven and Gradle projects, downloads dependencies for type resolution, and recognizes Spring, JAX-RS, Struts, and Servlet entry points. +- **Structured output for tools** — the output is meant to be consumed by code, not read by humans. Method bodies, source spans, cyclomatic complexity, call sites, and accessed fields are all captured. +- **Reachability groundwork** — the call graph is explicit caller→callee edges, ready to load into a graph library and query. +- **Graph-native consumption at portfolio scale** — with `--emit neo4j`, reachability and cross-service queries run as Cypher traversals over a persistent, multi-application graph. A fulltext index (`j_code_fts`) over callable code and docstrings makes the same graph searchable, and read-only credentials / RBAC let many consumers depend on it as governed infrastructure. + +## What it is not + +- It is **not** a linter or a bug finder — it extracts facts, it does not pass judgment. +- It is **not** an incremental *server* — each invocation is a batch run. The Bolt push is still a batch invocation; it just updates the graph *incrementally* (content-hash diff, only changed units re-pushed) instead of rewriting it. The default JSON path writes a fresh `analysis.json` each run, though [incremental target-file analysis](/codeanalyzer-java/guides/incremental-analysis/) can patch an existing one. +- It does **not** require the Python SDK — that is one consumer among several. And the SDK, in turn, does **not** require this binary when it reads from Neo4j: the graph is populated out of band, and the SDK only polls it. + +## Next steps + + + + + + + diff --git a/src/main/java/com/ibm/cldk/CodeAnalyzer.java b/src/main/java/com/ibm/cldk/CodeAnalyzer.java deleted file mode 100644 index 37eb7799..00000000 --- a/src/main/java/com/ibm/cldk/CodeAnalyzer.java +++ /dev/null @@ -1,291 +0,0 @@ -/* -Copyright IBM Corporation 2023, 2024 - -Licensed under the Apache Public License 2.0, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. - */ -package com.ibm.cldk; - -import com.github.javaparser.Problem; -import com.google.common.reflect.TypeToken; -import com.google.gson.FieldNamingPolicy; -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParser; -import com.ibm.cldk.entities.JavaCompilationUnit; -import com.ibm.cldk.utils.BuildProject; -import com.ibm.cldk.utils.Log; -import java.io.File; -import java.io.FileReader; -import java.io.FileWriter; -import java.io.IOException; -import java.lang.reflect.Type; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; -import org.apache.commons.lang3.tuple.Pair; -import picocli.CommandLine; -import picocli.CommandLine.Command; -import picocli.CommandLine.Option; - -class VersionProvider implements CommandLine.IVersionProvider { - - public String[] getVersion() throws Exception { - String version = getClass().getPackage().getImplementationVersion(); - return new String[] { version != null ? version : "unknown" }; - } -} - -/** - * The type Code analyzer. - */ -@Command(name = "codeanalyzer", mixinStandardHelpOptions = true, sortOptions = false, versionProvider = VersionProvider.class, description = "Analyze java application.") -public class CodeAnalyzer implements Runnable { - - @Option(names = { "-i", "--input" }, description = "Path to the project root directory.") - private static String input; - - @Option(names = { "-t", - "--target-files" }, description = "Paths to files to be analyzed from the input application.") - private static List targetFiles; - - @Option(names = { "-s", - "--source-analysis" }, description = "Analyze a single string of java source code instead the project.") - private static String sourceAnalysis; - - @Option(names = { "-o", - "--output" }, description = "Destination directory to save the output graphs. By default, the SDG formatted as a JSON will be printed to the console.") - private static String output; - - @Option(names = { "-b", "--build-cmd" }, description = "Custom build command. Defaults to auto build.") - private static String build; - - @Option(names = { - "--no-build" }, description = "Do not build your application. Use this option if you have already built your application.") - private static boolean noBuild = false; - - @Option(names = { "--no-clean-dependencies" }, description = "Do not attempt to auto-clean dependencies") - public static boolean noCleanDependencies = false; - - @Option(names = { "-f", - "--project-root-path" }, description = "Path to the root pom.xml/build.gradle file of the project.") - public static String projectRootPom; - - @Option(names = { "-a", - "--analysis-level" }, description = "Level of analysis to perform. Options: 1 (for just symbol table); 2 (for call graph). Default: 1") - public static int analysisLevel = 1; - - @Option(names = { "--include-test-classes" }, hidden = true, description = "Print logs to console.") - public static boolean includeTestClasses = false; - - @Option(names = { "-v", "--verbose" }, description = "Print logs to console.") - private static boolean verbose = false; - - private static final String outputFileName = "analysis.json"; - - public static Gson gson = new GsonBuilder() - .setFieldNamingPolicy(FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES) - .setPrettyPrinting() - .serializeNulls() // Fix for issue #108 - .disableHtmlEscaping() - .create(); - - /** - * The entry point of application. - * - * @param args the input arguments - */ - public static void main(String[] args) { - int exitCode = new CommandLine(new CodeAnalyzer()).execute(args); - System.exit(exitCode); - } - - @Override - public void run() { - // Set log level based on quiet option - Log.setVerbosity(verbose); - try { - analyze(); - } catch (Exception e) { - throw new RuntimeException(e); - } - } - - private static void analyze() throws Exception { - - JsonObject combinedJsonObject = new JsonObject(); - Map symbolTable; - projectRootPom = projectRootPom == null ? input : projectRootPom; - // First of all if, sourceAnalysis is provided, we will analyze the source code - // instead of the project. - if (sourceAnalysis != null) { - // Construct symbol table for source code - Log.debug("Single file analysis."); - Pair, Map>> symbolTableExtractionResult = SymbolTable - .extractSingle(sourceAnalysis); - symbolTable = symbolTableExtractionResult.getLeft(); - } else { - // download library dependencies of project for type resolution - String dependencies = null; - try { - if (BuildProject.downloadLibraryDependencies(input, projectRootPom)) { - dependencies = String.valueOf(BuildProject.libDownloadPath); - } else { - Log.warn("Failed to download library dependencies of project"); - } - } catch (IllegalStateException illegalStateException) { - Log.warn("Failed to download library dependencies of project"); - } - - boolean analysisFileExists = output != null - && Files.exists(Paths.get(output + File.separator + outputFileName)); - - // if target files are specified, compute symbol table information for the given - // files - if (targetFiles != null) { - Log.info(targetFiles.size() + "target files specified for analysis: " + targetFiles); - - // if target files specified for analysis level 2, downgrade to analysis level 1 - if (analysisLevel > 1) { - Log.warn("Incremental analysis is supported at analysis level 1 only; " - + "performing analysis level 1 for target files"); - analysisLevel = 1; - } - - // Previous code was pointing to toList, which has been introduced in Java 16 - // symbolTable = SymbolTable.extract(Paths.get(input), - // targetFiles.stream().map(Paths::get).toList()).getLeft(); - // extract symbol table for the specified files - symbolTable = SymbolTable - .extract(Paths.get(input), targetFiles.stream().map(Paths::get).collect(Collectors.toList())) - .getLeft(); - - // if analysis file exists, update it with new symbol table information for the - // specified fiels - if (analysisFileExists) { - // read symbol table information from existing analysis file - Map existingSymbolTable = readSymbolTableFromFile( - new File(output, outputFileName)); - if (existingSymbolTable != null) { - // for each file, tag its symbol table information as "updated" and update - // existing symbol table - for (String targetFile : targetFiles) { - String targetPathAbs = Paths.get(targetFile).toAbsolutePath().toString(); - JavaCompilationUnit javaCompilationUnit = symbolTable.get(targetPathAbs); - javaCompilationUnit.setModified(true); - existingSymbolTable.put(targetPathAbs, javaCompilationUnit); - } - } - symbolTable = existingSymbolTable; - } - } else { - // construct symbol table for project, write parse problems to file in output - // directory if specified - Pair, Map>> symbolTableExtractionResult = SymbolTable - .extractAll(Paths.get(input)); - - symbolTable = symbolTableExtractionResult.getLeft(); - } - - if (analysisLevel > 1) { - // Save SDG, and Call graph as JSON - // If noBuild is not true, and build is also not provided, we will use "auto" as - // the build command - build = build == null ? "auto" : build; - // Is noBuild is true, we will not build the project - build = noBuild ? null : build; - List sdgEdges = SystemDependencyGraph.construct(input, dependencies, build); - combinedJsonObject.add("call_graph", gson.toJsonTree(sdgEdges)); - } - } - // Cleanup library dependencies directory - BuildProject.cleanLibraryDependencies(); - - // Convert the JavaCompilationUnit to JSON and add to consolidated json object - String symbolTableJSONString = gson.toJson(symbolTable); - JsonElement symbolTableJSON = gson.fromJson(symbolTableJSONString, JsonElement.class); - combinedJsonObject.add("symbol_table", symbolTableJSON); - - // Add version number to the output JSON - try { - String[] versions = new VersionProvider().getVersion(); - if (versions.length > 0) { - combinedJsonObject.addProperty("version", versions[0]); - } else { - combinedJsonObject.addProperty("version", "unknown"); - } - } catch (Exception e) { - combinedJsonObject.addProperty("version", "error retrieving version"); - } - String consolidatedJSONString = gson.toJson(combinedJsonObject); - emit(consolidatedJSONString); - } - - private static void emit(String consolidatedJSONString) throws IOException { - if (output == null) { - System.out.println(consolidatedJSONString); - } else { - Path outputPath = Paths.get(output); - if (!Files.exists(outputPath)) { - Files.createDirectories(outputPath); - } - // If output is not null, export to a file - File file = new File(output, "analysis.json"); - try (FileWriter fileWriter = new FileWriter(file)) { - fileWriter.write(consolidatedJSONString); - Log.done("Analysis output saved at " + output); - } catch (IOException e) { - Log.error("Error writing to file: " + e.getMessage()); - } - } - } - - private static boolean hasLegacyImportSchema(JsonObject symbolTableJson) { - if (symbolTableJson == null) { - return false; - } - for (Map.Entry entry : symbolTableJson.entrySet()) { - JsonElement compilationUnitElement = entry.getValue(); - if (!compilationUnitElement.isJsonObject()) { - continue; - } - JsonObject compilationUnitJson = compilationUnitElement.getAsJsonObject(); - if (!compilationUnitJson.has("imports") || !compilationUnitJson.get("imports").isJsonArray()) { - continue; - } - for (JsonElement importElement : compilationUnitJson.getAsJsonArray("imports")) { - if (importElement.isJsonPrimitive() && importElement.getAsJsonPrimitive().isString()) { - return true; - } - } - } - return false; - } - - private static Map readSymbolTableFromFile(File analysisJsonFile) { - Type symbolTableType = new TypeToken>() { - }.getType(); - try (FileReader reader = new FileReader(analysisJsonFile)) { - JsonObject jsonObject = JsonParser.parseReader(reader).getAsJsonObject(); - JsonObject symbolTableJson = jsonObject.getAsJsonObject("symbol_table"); - if (hasLegacyImportSchema(symbolTableJson)) { - throw new IllegalStateException("Existing analysis.json uses legacy import schema (imports as strings). Regenerate analysis with codeanalyzer 2.3.7 or newer."); - } - return gson.fromJson(symbolTableJson, symbolTableType); - } catch (IOException e) { - Log.error("Error reading analysis file: " + e.getMessage()); - } - return null; - } -} diff --git a/src/main/java/com/ibm/cldk/SymbolTable.java b/src/main/java/com/ibm/cldk/SymbolTable.java deleted file mode 100644 index c7a203d6..00000000 --- a/src/main/java/com/ibm/cldk/SymbolTable.java +++ /dev/null @@ -1,1290 +0,0 @@ -package com.ibm.cldk; - -import com.github.javaparser.*; -import com.github.javaparser.ast.*; -import com.github.javaparser.ast.body.*; -import com.github.javaparser.ast.comments.Comment; -import com.github.javaparser.ast.comments.JavadocComment; -import com.github.javaparser.ast.expr.*; -import com.github.javaparser.ast.nodeTypes.NodeWithJavadoc; -import com.github.javaparser.ast.nodeTypes.NodeWithName; -import com.github.javaparser.ast.stmt.*; -import com.github.javaparser.ast.type.ReferenceType; -import com.github.javaparser.ast.type.Type; -import com.github.javaparser.printer.DefaultPrettyPrinter; -import com.github.javaparser.printer.lexicalpreservation.LexicalPreservingPrinter; -import com.github.javaparser.resolution.declarations.ResolvedMethodDeclaration; -import com.github.javaparser.resolution.declarations.ResolvedMethodLikeDeclaration; -import com.github.javaparser.resolution.types.ResolvedType; -import com.github.javaparser.symbolsolver.JavaSymbolSolver; -import com.github.javaparser.symbolsolver.resolution.typesolvers.CombinedTypeSolver; -import com.github.javaparser.symbolsolver.resolution.typesolvers.ReflectionTypeSolver; -import com.github.javaparser.symbolsolver.utils.SymbolSolverCollectionStrategy; -import com.github.javaparser.utils.ProjectRoot; -import com.github.javaparser.utils.SourceRoot; -import com.google.common.collect.Table; -import com.google.common.collect.Tables; -import com.ibm.cldk.entities.*; -import com.ibm.cldk.javaee.CRUDFinderFactory; -import com.ibm.cldk.javaee.EntrypointsFinderFactory; -import com.ibm.cldk.javaee.utils.enums.CRUDOperationType; -import com.ibm.cldk.javaee.utils.enums.CRUDQueryType; -import com.ibm.cldk.utils.Log; -import java.io.IOException; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.util.*; -import java.util.regex.Pattern; -import java.util.stream.Collectors; -import java.util.stream.IntStream; -import org.apache.commons.lang3.tuple.Pair; - -@SuppressWarnings({"unchecked", "rawtypes"}) -public class SymbolTable { - - private static JavaSymbolSolver javaSymbolSolver; - private static Set unresolvedTypes = new HashSet<>(); - private static Set unresolvedExpressions = new HashSet<>(); - - /** - * Processes the given compilation unit to extract information about classes - * and interfaces declared in the unit and returns a JSON object containing - * the extracted information. - * - * @param parseResult compilation unit to be processed - * @return JSON object containing extracted information - */ - // Let's store the known callables here for future use. - public static Table declaredMethodsAndConstructors = Tables - .newCustomTable(new HashMap<>(), () -> new HashMap<>() { - @Override - public Callable get(Object key) { - if (key instanceof String) { - Optional> matchingEntry = this.entrySet().stream() - .filter(entry -> isMethodSignatureMatch((String) key, entry.getKey())).findFirst(); - if (matchingEntry.isPresent()) { - return matchingEntry.get().getValue(); - } - } - return super.get(key); - } - - private boolean isMethodSignatureMatch(String fullSignature, String searchSignature) { - String methodName = fullSignature.split("\\(")[0]; - String searchMethodName = searchSignature.split("\\(")[0]; - - // Check method name match - if (!methodName.equals(searchMethodName)) { - return false; - } - - // Extract parameters, split by comma, and trim - String[] fullParams = fullSignature - .substring(fullSignature.indexOf("(") + 1, fullSignature.lastIndexOf(")")).split(","); - String[] searchParams = searchSignature - .substring(searchSignature.indexOf("(") + 1, searchSignature.lastIndexOf(")")).split(","); - - // Allow matching with fewer search parameters - if (searchParams.length != fullParams.length) { - return false; - } - - return IntStream.range(0, searchParams.length).allMatch(i -> { - String fullParamTrimmed = fullParams[i].trim(); - String searchParamTrimmed = searchParams[i].trim(); - return fullParamTrimmed.endsWith(searchParamTrimmed); - }); - } - }); - - private static JavaCompilationUnit processCompilationUnit(CompilationUnit parseResult) { - JavaCompilationUnit cUnit = new JavaCompilationUnit(); - - cUnit.setFilePath(parseResult.getStorage().map(s -> s.getPath().toString()).orElse("")); - - // Set file level comment - parseResult.getAllComments().stream().findFirst().ifPresent(c -> { - com.ibm.cldk.entities.Comment fileComment = new com.ibm.cldk.entities.Comment(); - fileComment.setContent(c.getContent()); - fileComment.setStartLine(c.getRange().isPresent() ? c.getRange().get().begin.line : -1); - fileComment.setEndLine(c.getRange().isPresent() ? c.getRange().get().end.line : -1); - fileComment.setStartColumn(c.getRange().isPresent() ? c.getRange().get().begin.column : -1); - fileComment.setEndColumn(c.getRange().isPresent() ? c.getRange().get().end.column : -1); - fileComment.setJavadoc(c.isJavadocComment()); - cUnit.getComments().add(fileComment); - }); - - // Add class comment - cUnit.setComments( - parseResult.getAllComments().stream().map(c -> { - com.ibm.cldk.entities.Comment fileComment = new com.ibm.cldk.entities.Comment(); - fileComment.setContent(c.getContent()); - fileComment.setStartLine(c.getRange().isPresent() ? c.getRange().get().begin.line : -1); - fileComment.setEndLine(c.getRange().isPresent() ? c.getRange().get().end.line : -1); - fileComment.setStartColumn(c.getRange().isPresent() ? c.getRange().get().begin.column : -1); - fileComment.setEndColumn(c.getRange().isPresent() ? c.getRange().get().end.column : -1); - fileComment.setJavadoc(c.isJavadocComment()); - return fileComment; - }) - .collect(Collectors.toList())); - - // Set package name - cUnit.setPackageName(parseResult.getPackageDeclaration().map(NodeWithName::getNameAsString).orElse("")); - // Add javadoc comment - // Add imports - cUnit.setImports( - parseResult.getImports().stream().map(importDecl -> { - Import importNode = new Import(); - importNode.setPath(importDecl.getNameAsString()); - importNode.setStatic(importDecl.isStatic()); - importNode.setWildcard(importDecl.isAsterisk()); - return importNode; - }).collect(Collectors.toList())); - - // create array node for type declarations - cUnit.setTypeDeclarations(parseResult.findAll(TypeDeclaration.class).stream() - .filter(typeDecl -> typeDecl.getFullyQualifiedName().isPresent()).map(typeDecl -> { - // get type name and initialize the type object - String typeName = typeDecl.getFullyQualifiedName().get().toString(); - com.ibm.cldk.entities.Type typeNode = new com.ibm.cldk.entities.Type(); - - if (typeDecl instanceof ClassOrInterfaceDeclaration) { - ClassOrInterfaceDeclaration classDecl = (ClassOrInterfaceDeclaration) typeDecl; - - // Add interfaces implemented by class - typeNode.setImplementsList(classDecl.getImplementedTypes().stream() - .map(SymbolTable::resolveType).collect(Collectors.toList())); - - // Add class modifiers - typeNode.setModifiers(classDecl.getModifiers().stream().map(m -> m.toString().strip()) - .collect(Collectors.toList())); - - // Add class annotations - typeNode.setAnnotations(classDecl.getAnnotations().stream().map(a -> a.toString().strip()) - .collect(Collectors.toList())); - - // add booleans indicating interfaces and inner/local classes - typeNode.setInterface(classDecl.isInterface()); - typeNode.setInnerClass(classDecl.isInnerClass()); - typeNode.setLocalClass(classDecl.isLocalClassDeclaration()); - - // Add extends - typeNode.setExtendsList(classDecl.getExtendedTypes().stream().map(SymbolTable::resolveType) - .collect(Collectors.toList())); - - } else if (typeDecl instanceof EnumDeclaration) { - EnumDeclaration enumDecl = (EnumDeclaration) typeDecl; - - // Add interfaces implemented by enum - typeNode.setImplementsList(enumDecl.getImplementedTypes().stream().map(SymbolTable::resolveType) - .collect(Collectors.toList())); - - // Add enum modifiers - typeNode.setModifiers(enumDecl.getModifiers().stream().map(m -> m.toString().strip()) - .collect(Collectors.toList())); - - // Add enum annotations - typeNode.setAnnotations(enumDecl.getAnnotations().stream().map(a -> a.toString().strip()) - .collect(Collectors.toList())); - - // Add enum constants - typeNode.setEnumConstants(enumDecl.getEntries().stream() - .map(SymbolTable::processEnumConstantDeclaration).collect(Collectors.toList())); - } else if (typeDecl instanceof RecordDeclaration) { - RecordDeclaration recordDecl = (RecordDeclaration) typeDecl; - - // Set that this is a record declaration - typeNode.setRecordDeclaration(typeDecl.isRecordDeclaration()); - - // Add interfaces implemented by record - typeNode.setImplementsList(recordDecl.getImplementedTypes().stream() - .map(SymbolTable::resolveType).collect(Collectors.toList())); - - // Add record modifiers - typeNode.setModifiers(recordDecl.getModifiers().stream().map(m -> m.toString().strip()) - .collect(Collectors.toList())); - - // Add record annotations - typeNode.setAnnotations(recordDecl.getAnnotations().stream().map(a -> a.toString().strip()) - .collect(Collectors.toList())); - - // Add record components - typeNode.setRecordComponents(processRecordComponents(recordDecl)); - } else { - // TODO: handle AnnotationDeclaration, RecordDeclaration - // set the common type attributes only - typeNode = new com.ibm.cldk.entities.Type(); - } - - /* - * set common attributes of types that available in type declarations: - * is nested type, is class or interface declaration, is enum declaration, - * comments, parent class, callable declarations, field declarations - */ - // Discover initialization blocks - typeNode.setInitializationBlocks(typeDecl.findAll(InitializerDeclaration.class).stream() - .map(initializerDeclaration -> { - return createInitializationBlock(initializerDeclaration, parseResult.getStorage() - .map(s -> s.getPath().toString()).orElse("")); - }) - .collect(Collectors.toList())); - // Set fields indicating nested, class/interface, enum, annotation, and record - // types - typeNode.setNestedType(typeDecl.isNestedType()); - typeNode.setClassOrInterfaceDeclaration(typeDecl.isClassOrInterfaceDeclaration()); - typeNode.setEnumDeclaration(typeDecl.isEnumDeclaration()); - typeNode.setAnnotationDeclaration(typeDecl.isAnnotationDeclaration()); - - // Add class comment - typeNode.setComments( - typeDecl.getAllContainedComments().stream() -// .filter(c -> c.getParentNode().isEmpty() || (c.getParentNode().isPresent() && parseResult.getPrimaryType().get().equals(c.getCommentedNode().get()))) - .map(c -> { - com.ibm.cldk.entities.Comment typeNodeComment = new com.ibm.cldk.entities.Comment(); - typeNodeComment.setContent(c.getContent()); - typeNodeComment.setStartLine(c.getRange().isPresent() ? c.getRange().get().begin.line : -1); - typeNodeComment.setEndLine(c.getRange().isPresent() ? c.getRange().get().end.line : -1); - typeNodeComment.setStartColumn(c.getRange().isPresent() ? c.getRange().get().begin.column : -1); - typeNodeComment.setEndColumn(c.getRange().isPresent() ? c.getRange().get().end.column : -1); - typeNodeComment.setJavadoc(c.isJavadocComment()); - return typeNodeComment; - }) - .collect(Collectors.toList())); - - // Get JavaDoc comments - // Check to see if there is a java doc comment if so, add it to the comments list - if (getJavadoc(typeDecl).isPresent()) { - typeNode.getComments().add(getJavadoc(typeDecl).get()); - } - - // add parent class (for nested type declarations) - typeNode.setParentType(typeDecl.getParentNode().get() instanceof TypeDeclaration - ? ((TypeDeclaration>) typeDecl.getParentNode().get()) - .getFullyQualifiedName().get() - : ""); - - typeNode.setNestedTypeDeclarations(typeDecl.findAll(TypeDeclaration.class).stream() - .filter(typ -> typ.isClassOrInterfaceDeclaration() || typ.isEnumDeclaration()) - .filter(typ -> typ.getParentNode().isPresent() && typ.getParentNode().get() == typeDecl) - .map(typ -> typ.getFullyQualifiedName().get().toString()).collect(Collectors.toList())); - - // Add information about declared fields (filtering to fields declared in the - // type, not in a nested type) - typeNode.setFieldDeclarations(typeDecl.findAll(FieldDeclaration.class).stream() - .filter(f -> f.getParentNode().isPresent() && f.getParentNode().get() == typeDecl) - .map(SymbolTable::processFieldDeclaration).collect(Collectors.toList())); - List fieldNames = new ArrayList<>(); - typeNode.getFieldDeclarations().stream().map(Field::getVariables).forEach(fieldNames::addAll); - - // Add information about declared methods (filtering to methods declared in the - // class, not in a nested class) - typeNode.setCallableDeclarations(typeDecl.findAll(CallableDeclaration.class).stream() - .filter(c -> c.getParentNode().isPresent() && c.getParentNode().get() == typeDecl) - .map(meth -> { - Pair callableDeclaration = processCallableDeclaration(meth, - fieldNames, typeName, parseResult.getStorage().map(s -> s.getPath().toString()) - .orElse("")); - declaredMethodsAndConstructors.put(typeName, callableDeclaration.getLeft(), - callableDeclaration.getRight()); - return callableDeclaration; - }).collect(Collectors.toMap(p -> p.getLeft(), p -> p.getRight()))); - - // Add information about if the TypeNode is an entry point class - typeNode.setEntrypointClass(isEntryPointClass(typeDecl)); - - return Pair.of(typeName, typeNode); - - }).collect(Collectors.toMap(p -> p.getLeft(), p -> p.getRight()))); - - return cUnit; - } - - private static InitializationBlock createInitializationBlock(InitializerDeclaration initializerDeclaration, - String filePath) { - InitializationBlock initializationBlock = new InitializationBlock(); - initializationBlock.setFilePath(filePath); - - com.ibm.cldk.entities.Comment comment = new com.ibm.cldk.entities.Comment(); - - // Add class comment - initializationBlock.setComments( - initializerDeclaration.getAllContainedComments().stream() - .map(c -> { - com.ibm.cldk.entities.Comment typeNodeComment = new com.ibm.cldk.entities.Comment(); - typeNodeComment.setContent(c.getContent()); - typeNodeComment.setStartLine(c.getRange().isPresent() ? c.getRange().get().begin.line : -1); - typeNodeComment.setEndLine(c.getRange().isPresent() ? c.getRange().get().end.line : -1); - typeNodeComment.setStartColumn(c.getRange().isPresent() ? c.getRange().get().begin.column : -1); - typeNodeComment.setEndColumn(c.getRange().isPresent() ? c.getRange().get().end.column : -1); - typeNodeComment.setJavadoc(c.isJavadocComment()); - return typeNodeComment; - }) - .collect(Collectors.toList())); - - // Check to see if there is a java doc comment if so, add it to the comments list - getJavadoc(initializerDeclaration).ifPresent(value -> initializationBlock.getComments().add(value)); - - - // Set annotations - initializationBlock.setAnnotations(initializerDeclaration.getAnnotations().stream() - .map(a -> a.toString().strip()).collect(Collectors.toList())); - // add exceptions declared in "throws" clause - initializationBlock.setThrownExceptions(initializerDeclaration.getBody().getStatements().stream() - .filter(Statement::isThrowStmt).map(throwStmt -> { - try { - return javaSymbolSolver.calculateType(throwStmt.asThrowStmt().getExpression()).describe(); - } catch (Exception e) { - return throwStmt.asThrowStmt().getExpression().toString(); - } - }).collect(Collectors.toList())); - initializationBlock.setCode(LexicalPreservingPrinter.print(initializerDeclaration.getBody())); - initializationBlock.setStartLine( - initializerDeclaration.getRange().isPresent() ? initializerDeclaration.getRange().get().begin.line - : -1); - initializationBlock.setEndLine( - initializerDeclaration.getRange().isPresent() ? initializerDeclaration.getRange().get().end.line : -1); - initializationBlock.setStatic(initializerDeclaration.isStatic()); - initializationBlock - .setReferencedTypes(getReferencedTypes(Optional.ofNullable(initializerDeclaration.getBody()))); - initializationBlock.setAccessedFields( - getAccessedFields(Optional.ofNullable(initializerDeclaration.getBody()), Collections.emptyList(), "")); - initializationBlock.setCallSites(getCallSites(Optional.ofNullable(initializerDeclaration.getBody()))); - initializationBlock.setVariableDeclarations( - getVariableDeclarations(Optional.ofNullable(initializerDeclaration.getBody()))); - initializationBlock.setCyclomaticComplexity(getCyclomaticComplexity(initializerDeclaration)); - return initializationBlock; - } - - private static Optional getJavadoc(NodeWithJavadoc bodyDeclaration) { - Optional javadocComment = bodyDeclaration.getJavadocComment(); - if (!javadocComment.isPresent()) { - return Optional.empty(); - } - com.ibm.cldk.entities.Comment javadoc = new com.ibm.cldk.entities.Comment(); - javadoc.setContent(javadocComment.get().getContent().isEmpty() || javadocComment.get().getContent().isBlank() ? "" : javadocComment.get().getContent()); - javadoc.setStartLine(javadocComment.get().getRange().get().begin.line); - javadoc.setEndLine(javadocComment.get().getRange().get().end.line); - javadoc.setStartColumn(javadocComment.get().getRange().get().begin.column); - javadoc.setEndColumn(javadocComment.get().getRange().get().end.column); - javadoc.setJavadoc(!(javadocComment.get().getContent().isEmpty() && javadocComment.get().getContent().isBlank())); - return Optional.of(javadoc); - } - - /** - * Processes the given record to extract information about the - * declared field and returns a JSON object containing the extracted - * information. - * - * @param recordDecl field declaration to be processed - * @return Field object containing extracted information - */ - private static List processRecordComponents(RecordDeclaration recordDecl) { - return recordDecl.getParameters().stream().map( - parameter -> { - RecordComponent recordComponent = new RecordComponent(); - com.ibm.cldk.entities.Comment comment = new com.ibm.cldk.entities.Comment(); - if (parameter.getComment().isPresent()) { - Comment parsedComment = parameter.getComment().get(); - comment.setContent(parsedComment.getContent()); - parsedComment.getRange().ifPresent(range -> { - comment.setStartLine(range.begin.line); - comment.setEndLine(range.end.line); - comment.setStartColumn(range.begin.column); - comment.setEndColumn(range.end.column); - }); - - } else { - comment.setContent(""); - comment.setStartLine(-1); - comment.setEndLine(-1); - comment.setStartColumn(-1); - comment.setEndColumn(-1); - } - - recordComponent.setComment(comment); - recordComponent.setName(parameter.getNameAsString()); - recordComponent.setType(resolveType(parameter.getType())); - recordComponent.setAnnotations(parameter.getAnnotations().stream().map(a -> a.toString().strip()) - .collect(Collectors.toList())); - recordComponent.setModifiers(parameter.getModifiers().stream().map(a -> a.toString().strip()) - .collect(Collectors.toList())); - recordComponent.setVarArgs(parameter.isVarArgs()); - recordComponent.setDefaultValue( - mapRecordConstructorDefaults(recordDecl).getOrDefault(parameter.getNameAsString(), null)); - return recordComponent; - }).collect(Collectors.toList()); - } - - private static Map mapRecordConstructorDefaults(RecordDeclaration recordDecl) { - - return recordDecl.getCompactConstructors().stream() - .flatMap(constructor -> constructor.findAll(AssignExpr.class).stream()) // Flatten all assignments - .filter(assignExpr -> assignExpr.getTarget().isNameExpr()) // Ensure assignment is to a parameter - .collect(Collectors.toMap( - assignExpr -> assignExpr.getTarget().asNameExpr().getNameAsString(), // Key: Parameter Name - assignExpr -> Optional.ofNullable(assignExpr.getValue()).map(valueExpr -> { // Value: Default - // Value - return valueExpr.isStringLiteralExpr() ? valueExpr.asStringLiteralExpr().asString() - : valueExpr.isBooleanLiteralExpr() ? valueExpr.asBooleanLiteralExpr().getValue() - : valueExpr.isCharLiteralExpr() ? valueExpr.asCharLiteralExpr().getValue() - : valueExpr.isDoubleLiteralExpr() - ? valueExpr.asDoubleLiteralExpr().asDouble() - : valueExpr.isIntegerLiteralExpr() - ? valueExpr.asIntegerLiteralExpr().asNumber() - : valueExpr.isLongLiteralExpr() - ? valueExpr.asLongLiteralExpr().asNumber() - : valueExpr.isNullLiteralExpr() ? null - : valueExpr.toString(); - }).orElse("null"))); // Default: store as a string - } - - private static boolean isEntryPointClass(TypeDeclaration typeDecl) { - return EntrypointsFinderFactory.getEntrypointFinders() - .anyMatch(finder -> finder.isEntrypointClass(typeDecl)); - } - - /** - * Process enum constant declaration. - * - * @param enumConstDecl enum constant declaration to be processed - * @return EnumConstant object containing extracted information - */ - private static EnumConstant processEnumConstantDeclaration(EnumConstantDeclaration enumConstDecl) { - EnumConstant enumConstant = new EnumConstant(); - - // add enum constant name - enumConstant.setName(enumConstDecl.getNameAsString()); - - // add enum constant arguments - enumConstant.setArguments( - enumConstDecl.getArguments().stream().map(Node::toString).collect(Collectors.toList())); - - return enumConstant; - } - - /** - * Process parameter declarations on callables. - * - * @param paramDecl parameter declaration to be processed - */ - private static ParameterInCallable processParameterDeclaration(Parameter paramDecl) { - ParameterInCallable parameter = new ParameterInCallable(); - parameter.setType(resolveType(paramDecl.getType())); - parameter.setName(paramDecl.getName().toString()); - parameter.setAnnotations( - paramDecl.getAnnotations().stream().map(a -> a.toString().strip()).collect(Collectors.toList())); - parameter.setModifiers( - paramDecl.getModifiers().stream().map(a -> a.toString().strip()).collect(Collectors.toList())); - parameter.setStartLine(paramDecl.getRange().isPresent() ? paramDecl.getRange().get().begin.line : -1); - parameter.setStartColumn(paramDecl.getRange().isPresent() ? paramDecl.getRange().get().begin.column : -1); - parameter.setEndLine(paramDecl.getRange().isPresent() ? paramDecl.getRange().get().end.line : -1); - parameter.setEndColumn(paramDecl.getRange().isPresent() ? paramDecl.getRange().get().end.column : -1); - return parameter; - } - - /** - * Processes the given callable declaration to extract information about the - * declared method or constructor and returns a JSON object containing the - * extracted information. - * - * @param callableDecl callable (method or constructor) to be processed - * @return Callable object containing extracted information - */ - @SuppressWarnings("unchecked") - private static Pair processCallableDeclaration(CallableDeclaration callableDecl, - List classFields, String typeName, String filePath) { - Callable callableNode = new Callable(); - - // Set file path - callableNode.setFilePath(filePath); - - // add callable signature - callableNode.setSignature(getTypeErasureSignature(callableDecl)); - - // add comment associated with method/constructor - callableNode.setComments( - callableDecl.getAllContainedComments().stream() - .map(c -> { - com.ibm.cldk.entities.Comment methodComment = new com.ibm.cldk.entities.Comment(); - methodComment.setContent(c.getContent()); - methodComment.setStartLine(c.getRange().isPresent() ? c.getRange().get().begin.line : -1); - methodComment.setEndLine(c.getRange().isPresent() ? c.getRange().get().end.line : -1); - methodComment.setStartColumn(c.getRange().isPresent() ? c.getRange().get().begin.column : -1); - methodComment.setEndColumn(c.getRange().isPresent() ? c.getRange().get().end.column : -1); - methodComment.setJavadoc(c.isJavadocComment()); - return methodComment; - }) - .collect(Collectors.toList())); - - // Check to see if there are JavaDoc comments - getJavadoc(callableDecl).ifPresent(value -> callableNode.getComments().add(value)); - - // add annotations on method/constructor - callableNode.setAnnotations((List) callableDecl.getAnnotations().stream() - .map(mod -> mod.toString().strip()).collect(Collectors.toList())); - - // add method or constructor modifiers - callableNode.setModifiers((List) callableDecl.getModifiers().stream().map(mod -> mod.toString().strip()) - .collect(Collectors.toList())); - - // add exceptions declared in "throws" clause - callableNode.setThrownExceptions(((NodeList) callableDecl.getThrownExceptions()).stream() - .map(SymbolTable::resolveType).collect(Collectors.toList())); - - // add the complete declaration string, including modifiers, throws, and - // parameter names - callableNode - .setDeclaration(callableDecl.getDeclarationAsString(true, true, true).strip().replaceAll("//.*\n", "")); - - // add information about callable parameters: for each parameter, type, name, - // annotations, - // modifiers - callableNode.setParameters((List) callableDecl.getParameters().stream() - .map(param -> processParameterDeclaration((Parameter) param)).collect(Collectors.toList())); - - callableNode.setEntrypoint(isEntryPointMethod(callableDecl)); - - // A method declaration may not have a body if it is an abstract method. A - // constructor always has a body. So, we need to check if the body is present before processing it - // and capture it using the Optional type. - Optional body = (callableDecl instanceof MethodDeclaration) - ? ((MethodDeclaration) callableDecl).getBody() - : Optional.ofNullable(((ConstructorDeclaration) callableDecl).getBody()); - - // Same as above, a constructor declaration may not have a return type - // and method declaration always has a return type. - callableNode.setReturnType( - (callableDecl instanceof MethodDeclaration) ? resolveType(((MethodDeclaration) callableDecl).getType()) - : null); - - callableNode.setConstructor(callableDecl instanceof ConstructorDeclaration); - callableNode.setStartLine(callableDecl.getRange().isPresent() ? callableDecl.getRange().get().begin.line : -1); - callableNode.setEndLine(callableDecl.getRange().isPresent() ? callableDecl.getRange().get().end.line : -1); - callableNode.setReferencedTypes(getReferencedTypes(body)); - try { - callableNode.setCode(body.isPresent() ? LexicalPreservingPrinter.print(body.get()) : ""); - } catch (UnsupportedOperationException uoe) { - Log.warn("LexicalPreservingPrinter.print() failed on method " + callableDecl.getSignature() + - " of type "+typeName); - Log.warn("Reverting to default printing"); - Log.warn(body.get().toString()); - callableNode.setCode(body.get().toString()); - } - callableNode.setCodeStartLine(body.isPresent()? body.get().getBegin().get().line : -1); - - callableNode.setAccessedFields(getAccessedFields(body, classFields, typeName)); - callableNode.setCallSites(getCallSites(body)); - callableNode.setCrudOperations( - callableNode.getCallSites().stream() - .map(CallSite::getCrudOperation) - .filter(Objects::nonNull) - .collect(Collectors.toList())); - callableNode.setCrudQueries( - callableNode.getCallSites().stream() - .map(CallSite::getCrudQuery) - .filter(Objects::nonNull) - .collect(Collectors.toList())); - callableNode.setVariableDeclarations(getVariableDeclarations(body)); - callableNode.setCyclomaticComplexity(getCyclomaticComplexity(callableDecl)); - - String callableSignature = getTypeErasureSignature(callableDecl); - return Pair.of(callableSignature, callableNode); - } - - /** - * Returns type erasure signature for the given callable. Returns regular signature if an - * error occurs in getting erased types. - * - * @param callableDecl: Callable to compute type erasure signature for - * @return String representing type erasure or regular signature - */ - private static String getTypeErasureSignature(CallableDeclaration callableDecl) { - try { - StringBuilder signature = new StringBuilder( - (callableDecl instanceof MethodDeclaration) ? callableDecl.getNameAsString() : "" - ); - List erasureParameterTypes = new ArrayList<>(); - for (Object param : callableDecl.getParameters()) { - Parameter parameter = (Parameter) param; - ResolvedType resolvedType = parameter.getType().resolve(); - if (parameter.isVarArgs()) { - erasureParameterTypes.add(resolvedType.erasure().describe() + "[]"); - } else { - erasureParameterTypes.add(resolvedType.erasure().describe()); - } - } - signature.append("("); - signature.append(String.join(", ", erasureParameterTypes)); - signature.append(")"); - return signature.toString(); - } catch (Throwable e) { - Log.warn("Could not compute type erasure signature for "+callableDecl.getSignature().asString()+ - "; computing regular signature"); - return callableDecl.getSignature().asString(); - } - } - - /** - * Returns type erasure signature for the given method or constructor declaration - * resolved for a call site. - * - * @param methodDecl: Resolved method/constructor to compute type erasure signature for - * @return String representing type erasure signature - */ - private static String getTypeErasureSignature(ResolvedMethodLikeDeclaration methodDecl) { - StringBuilder signature = new StringBuilder(methodDecl.getName()); - List erasureParameterTypes = new ArrayList<>(); - for (int i = 0; i < methodDecl.getNumberOfParams(); i++) { - erasureParameterTypes.add(methodDecl.getParam(i).getType().erasure().describe()); - } - signature.append("("); - signature.append(String.join(", ", erasureParameterTypes)); - signature.append(")"); - return signature.toString(); - } - - private static boolean isEntryPointMethod(CallableDeclaration callableDecl) { - return EntrypointsFinderFactory.getEntrypointFinders() - .anyMatch(finder -> finder.isEntrypointMethod(callableDecl)); - } - - - /** - * Computes cyclomatic complexity for the given callable. - * - * @param callableDeclaration Callable to compute cyclomatic complexity for - * @return cyclomatic complexity - */ - private static int getCyclomaticComplexity(CallableDeclaration callableDeclaration) { - int ifStmtCount = callableDeclaration.findAll(IfStmt.class).size(); - int loopStmtCount = callableDeclaration.findAll(DoStmt.class).size() - + callableDeclaration.findAll(ForStmt.class).size() - + callableDeclaration.findAll(ForEachStmt.class).size() - + callableDeclaration.findAll(WhileStmt.class).size(); - int switchCaseCount = callableDeclaration.findAll(SwitchStmt.class).stream() - .map(stmt -> stmt.getEntries().size()).reduce(0, Integer::sum); - int conditionalExprCount = callableDeclaration.findAll(ConditionalExpr.class).size(); - int catchClauseCount = callableDeclaration.findAll(CatchClause.class).size(); - return ifStmtCount + loopStmtCount + switchCaseCount + conditionalExprCount + catchClauseCount + 1; - } - - private static int getCyclomaticComplexity(InitializerDeclaration initializerDeclaration) { - int ifStmtCount = initializerDeclaration.findAll(IfStmt.class).size(); - int loopStmtCount = initializerDeclaration.findAll(DoStmt.class).size() - + initializerDeclaration.findAll(ForStmt.class).size() - + initializerDeclaration.findAll(ForEachStmt.class).size() - + initializerDeclaration.findAll(WhileStmt.class).size(); - int switchCaseCount = initializerDeclaration.findAll(SwitchStmt.class).stream() - .map(stmt -> stmt.getEntries().size()).reduce(0, Integer::sum); - int conditionalExprCount = initializerDeclaration.findAll(ConditionalExpr.class).size(); - int catchClauseCount = initializerDeclaration.findAll(CatchClause.class).size(); - return ifStmtCount + loopStmtCount + switchCaseCount + conditionalExprCount + catchClauseCount + 1; - } - - /** - * Processes the given field declaration to extract information about the - * declared field and returns a JSON object containing the extracted - * information. - * - * @param fieldDecl field declaration to be processed - * @return Field object containing extracted information - */ - private static Field processFieldDeclaration(FieldDeclaration fieldDecl) { - Field field = new Field(); - - // add comment associated with field - com.ibm.cldk.entities.Comment comment = new com.ibm.cldk.entities.Comment(); - if (fieldDecl.getComment().isPresent()) { - Comment parsedComment = fieldDecl.getComment().get(); - comment.setContent(parsedComment.getContent()); - parsedComment.getRange().ifPresent(range -> { - comment.setStartLine(range.begin.line); - comment.setEndLine(range.end.line); - comment.setStartColumn(range.begin.column); - comment.setEndColumn(range.end.column); - }); - } - field.setComment(comment); - - // add annotations on field - field.setAnnotations( - fieldDecl.getAnnotations().stream().map(a -> a.toString().strip()).collect(Collectors.toList())); - - // add variable names - field.setVariables( - fieldDecl.getVariables().stream().map(v -> v.getName().asString()).collect(Collectors.toList())); - - // add field modifiers - field.setModifiers( - fieldDecl.getModifiers().stream().map(m -> m.toString().strip()).collect(Collectors.toList())); - - // add field type - field.setType(resolveType(fieldDecl.getCommonType())); - - // add field start and end lines - field.setStartLine(fieldDecl.getRange().isPresent() ? fieldDecl.getRange().get().begin.line : null); - - field.setEndLine(fieldDecl.getRange().get().end.line); - - return field; - } - - /** - * Computes and returns the set of types references in a block of statement - * (method or constructor body). - * - * @param blockStmt Block statement to compute referenced types for - * @return List of types referenced in the block statement - */ - private static List getReferencedTypes(Optional blockStmt) { - Set referencedTypes = new HashSet<>(); - blockStmt.ifPresent( - bs -> bs.findAll(VariableDeclarator.class).stream().filter(vd -> vd.getType().isClassOrInterfaceType()) - .map(vd -> resolveType(vd.getType())).forEach(referencedTypes::add)); - - // add types of accessed fields to the set of referenced types - blockStmt.ifPresent( - bs -> bs.findAll(FieldAccessExpr.class).stream().filter(faExpr -> faExpr.getParentNode().isPresent() - && !(faExpr.getParentNode().get() instanceof FieldAccessExpr)).map(faExpr -> { - if (faExpr.getParentNode().isPresent() - && faExpr.getParentNode().get() instanceof CastExpr) { - return resolveType(((CastExpr) faExpr.getParentNode().get()).getType()); - } else { - return resolveExpression(faExpr); - } - }).filter(type -> !type.isEmpty()).forEach(referencedTypes::add)); - - // TODO: add resolved method access expressions - return new ArrayList<>(referencedTypes); - } - - /** - * Returns information about variable declarations in the given callable. - * The information includes var name, var type, var initializer, and - * position. - * - * @param blockStmt Callable to compute var declaration information for - * @return list of variable declarations - */ - private static List getVariableDeclarations(Optional blockStmt) { - List varDeclarations = new ArrayList<>(); - if (blockStmt.isEmpty()) { - return varDeclarations; - } - for (VariableDeclarator declarator : blockStmt.get().findAll(VariableDeclarator.class)) { - VariableDeclaration varDeclaration = new VariableDeclaration(); - com.ibm.cldk.entities.Comment comment = new com.ibm.cldk.entities.Comment(); - if (declarator.getComment().isPresent()) { - Comment parsedComment = declarator.getComment().get(); - comment.setContent(parsedComment.getContent().isBlank() ? "" : parsedComment.getContent().isEmpty() ? "" : parsedComment.getContent()); - parsedComment.getRange().ifPresent(range -> { - comment.setStartLine(range.begin.line); - comment.setEndLine(range.end.line); - comment.setStartColumn(range.begin.column); - comment.setEndColumn(range.end.column); - }); - } - varDeclaration.setComment(comment); - varDeclaration.setName(declarator.getNameAsString()); - varDeclaration.setType(resolveType(declarator.getType())); - varDeclaration.setInitializer( - declarator.getInitializer().isPresent() ? declarator.getInitializer().get().toString() : ""); - if (declarator.getRange().isPresent()) { - varDeclaration.setStartLine(declarator.getRange().get().begin.line); - varDeclaration.setStartColumn(declarator.getRange().get().begin.column); - varDeclaration.setEndLine(declarator.getRange().get().end.line); - varDeclaration.setEndColumn(declarator.getRange().get().end.column); - } else { - varDeclaration.setStartLine(-1); - varDeclaration.setStartColumn(-1); - varDeclaration.setEndLine(-1); - varDeclaration.setEndColumn(-1); - } - varDeclarations.add(varDeclaration); - } - return varDeclarations; - } - - /** - * Computes and returns the list of fields accessed in the given callable - * body. The returned values contain field names qualified by names of the - * declaring types. - * - * @param callableBody Callable body to compute accessed fields for - * @return List of fully qualified field names - */ - private static List getAccessedFields(Optional callableBody, List classFields, - String typeName) { - Set accessedFields = new HashSet<>(); - - // process field access expressions in the callable - callableBody.ifPresent( - cb -> cb.findAll(FieldAccessExpr.class).stream().filter(faExpr -> faExpr.getParentNode().isPresent() - && !(faExpr.getParentNode().get() instanceof FieldAccessExpr)).map(faExpr -> { - String fieldDeclaringType = resolveExpression(faExpr.getScope()); - if (!fieldDeclaringType.isEmpty()) { - return fieldDeclaringType + "." + faExpr.getNameAsString(); - } else { - return faExpr.getNameAsString(); - } - }).forEach(accessedFields::add)); - - // process all names expressions in callable and match against names of declared - // fields - // in class TODO: handle local variable declarations with the same name - if (callableBody.isPresent()) { - for (NameExpr nameExpr : callableBody.get().findAll(NameExpr.class)) { - for (String fieldName : classFields) { - if (nameExpr.getNameAsString().equals(fieldName)) { - accessedFields.add(typeName + "." + nameExpr.getNameAsString()); - } - } - } - } - - return new ArrayList<>(accessedFields); - } - - /** - * Returns information about call sites in the given callable. The - * information includes: the method name, the declaring type name, and types - * of arguments used in method call. - * - * @param callableBody callable to compute call-site information for - * @return list of call sites - */ - @SuppressWarnings({ "OptionalUsedAsFieldOrParameterType" }) - private static List getCallSites(Optional callableBody) { - List callSites = new ArrayList<>(); - if (callableBody.isEmpty()) { - return callSites; - } - for (MethodCallExpr methodCallExpr : callableBody.get().findAll(MethodCallExpr.class)) { - // resolve declaring type for called method - boolean isStaticCall = false; - String declaringType = ""; - String receiverName = ""; - String returnType = ""; - if (methodCallExpr.getScope().isPresent()) { - Expression scopeExpr = methodCallExpr.getScope().get(); - receiverName = scopeExpr.toString(); - declaringType = resolveExpression(scopeExpr); - if (declaringType.contains(" | ")) { - declaringType = declaringType.split(" \\| ")[0]; - } - String declaringTypeName = declaringType.contains(".") - ? declaringType.substring(declaringType.lastIndexOf(".") + 1) - : declaringType; - if (declaringTypeName.equals(scopeExpr.toString())) { - isStaticCall = true; - } - } - - // compute return type for method call taking into account typecast of return - // value - if (methodCallExpr.getParentNode().isPresent() - && methodCallExpr.getParentNode().get() instanceof CastExpr) { - returnType = resolveType(((CastExpr) methodCallExpr.getParentNode().get()).getType()); - } else { - returnType = resolveExpression(methodCallExpr); - } - - // resolve callee and get signature - String calleeSignature = ""; - try { - calleeSignature = getTypeErasureSignature(methodCallExpr.resolve()); - } catch (Throwable exception) { - Log.debug("Could not resolve method call: " + methodCallExpr + ": " + exception.getMessage()); - } - - // Resolve access qualifier - AccessSpecifier accessSpecifier = AccessSpecifier.NONE; - try { - ResolvedMethodDeclaration resolvedMethodDeclaration = methodCallExpr.resolve(); - accessSpecifier = resolvedMethodDeclaration.accessSpecifier(); - } catch (Throwable exception) { - Log.debug("Could not resolve access specifier for method call: " + methodCallExpr + ": " - + exception.getMessage()); - } - // resolve arguments of the method call to types - List argumentTypes = methodCallExpr.getArguments().stream().map(SymbolTable::resolveExpression) - .collect(Collectors.toList()); - // Get argument string from the callsite - List listOfArgumentStrings = methodCallExpr.getArguments().stream().map(Expression::toString) - .collect(Collectors.toList()); - // Determine if this call site is potentially a CRUD operation. - CRUDOperation crudOperation = null; - Optional crudOperationType = findCRUDOperation(declaringType, - methodCallExpr.getNameAsString()); - if (crudOperationType.isPresent()) { - // We found a CRUD operation, so we need to populate the details of the call - // site this CRUD operation. - int lineNumber = methodCallExpr.getRange().isPresent() ? methodCallExpr.getRange().get().begin.line - : -1; - crudOperation = new CRUDOperation(); - crudOperation.setLineNumber(lineNumber); - crudOperation.setOperationType(crudOperationType.get()); - } - // Determine if this call site is potentially a CRUD query. - CRUDQuery crudQuery = null; - Optional crudQueryType = findCRUDQuery(declaringType, methodCallExpr.getNameAsString(), - Optional.of(listOfArgumentStrings)); - if (crudQueryType.isPresent()) { - // We found a CRUD query, so we need to populate the details of the call site - // this CRUD query. - int lineNumber = methodCallExpr.getRange().isPresent() ? methodCallExpr.getRange().get().begin.line - : -1; - crudQuery = new CRUDQuery(); - crudQuery.setLineNumber(lineNumber); - crudQuery.setQueryType(crudQueryType.get()); - crudQuery.setQueryArguments(listOfArgumentStrings); - } - // add a new call site object - - - callSites.add(createCallSite(methodCallExpr, methodCallExpr.getNameAsString(), receiverName, declaringType, - argumentTypes, listOfArgumentStrings, returnType, calleeSignature, isStaticCall, false, crudOperation, crudQuery, - accessSpecifier)); - } - - for (ObjectCreationExpr objectCreationExpr : callableBody.get().findAll(ObjectCreationExpr.class)) { - // resolve declaring type for called method - String instantiatedType = resolveType(objectCreationExpr.getType()); - - // resolve arguments of the constructor call to types - List argumentTypes = objectCreationExpr.getArguments().stream().map(SymbolTable::resolveExpression) - .collect(Collectors.toList()); - - // get argument expressions for constructor call - List argumentExpressions = objectCreationExpr.getArguments().stream().map(Expression::toString) - .collect(Collectors.toList()); - - // resolve callee and get signature - String calleeSignature = ""; - try { - calleeSignature = getTypeErasureSignature(objectCreationExpr.resolve()); - } catch (Throwable exception) { - Log.debug("Could not resolve constructor call: " + objectCreationExpr + ": " + exception.getMessage()); - } - - // add a new call site object - callSites - .add(createCallSite(objectCreationExpr, "", - objectCreationExpr.getScope().isPresent() ? objectCreationExpr.getScope().get().toString() - : "", - instantiatedType, argumentTypes, argumentExpressions, instantiatedType, calleeSignature, false, true, null, null, - AccessSpecifier.NONE)); - } - - return callSites; - } - - @SuppressWarnings("OptionalUsedAsFieldOrParameterType") - private static Optional findCRUDQuery(String declaringType, String nameAsString, - Optional> arguments) { - return CRUDFinderFactory.getCRUDFinders().map( - finder -> { - if (finder.isReadQuery(declaringType, nameAsString, arguments)) { - return CRUDQueryType.READ; - } else if (finder.isWriteQuery(declaringType, nameAsString, arguments)) { - return CRUDQueryType.WRITE; - } else if (finder.isNamedQuery(declaringType, nameAsString, arguments)) { - return CRUDQueryType.NAMED; - } else - return null; - }) - .filter(Objects::nonNull) - .findFirst(); - } - - private static Optional findCRUDOperation(String declaringType, String nameAsString) { - return CRUDFinderFactory.getCRUDFinders().map( - finder -> { - if (finder.isCreateOperation(declaringType, nameAsString)) { - return CRUDOperationType.CREATE; - } else if (finder.isReadOperation(declaringType, nameAsString)) { - return CRUDOperationType.READ; - } else if (finder.isUpdateOperation(declaringType, nameAsString)) { - return CRUDOperationType.UPDATE; - } else if (finder.isDeleteOperation(declaringType, nameAsString)) { - return CRUDOperationType.DELETE; - } else - return null; - }) - .filter(Objects::nonNull) - .findFirst(); - } - - /** - * Creates and returns a new CallSite object for the given expression, which - * can be a method-call or object-creation expression. - * - * @param callExpr - * @param calleeName - * @param receiverExpr - * @param receiverType - * @param argumentTypes - * @param argumentExpr - * @param returnType - * @param calleeSignature - * @param isStaticCall - * @param isConstructorCall - * @param crudOperation, - * @param crudQuery, - * @param accessSpecifier - * @return - */ - private static CallSite createCallSite( - Expression callExpr, - String calleeName, - String receiverExpr, - String receiverType, - List argumentTypes, - List argumentExpr, - String returnType, - String calleeSignature, - boolean isStaticCall, - boolean isConstructorCall, - CRUDOperation crudOperation, - CRUDQuery crudQuery, - AccessSpecifier accessSpecifier) { - CallSite callSite = new CallSite(); - - com.ibm.cldk.entities.Comment comment = new com.ibm.cldk.entities.Comment(); - callExpr.findAncestor(Node.class).ifPresent(stmt -> { - stmt.getComment().ifPresent(c -> { - comment.setContent(c.getContent()); - c.getRange().ifPresent(range -> { - comment.setStartLine(range.begin.line); - comment.setEndLine(range.end.line); - comment.setStartColumn(range.begin.column); - comment.setEndColumn(range.end.column); - }); - callSite.setComment(comment); - }); - }); - callSite.setMethodName(calleeName); - callSite.setReceiverExpr(receiverExpr); - callSite.setReceiverType(receiverType); - callSite.setArgumentTypes(argumentTypes); - callSite.setArgumentExpr(argumentExpr); - callSite.setReturnType(returnType); - callSite.setCalleeSignature(calleeSignature); - callSite.setStaticCall(isStaticCall); - callSite.setConstructorCall(isConstructorCall); - callSite.setPrivate(accessSpecifier.equals(AccessSpecifier.PRIVATE)); - callSite.setPublic(accessSpecifier.equals(AccessSpecifier.PUBLIC)); - callSite.setProtected(accessSpecifier.equals(AccessSpecifier.PROTECTED)); - callSite.setUnspecified(accessSpecifier.equals(AccessSpecifier.NONE)); - callSite.setCrudOperation(crudOperation); - callSite.setCrudQuery(crudQuery); - if (callExpr.getRange().isPresent()) { - callSite.setStartLine(callExpr.getRange().get().begin.line); - callSite.setStartColumn(callExpr.getRange().get().begin.column); - callSite.setEndLine(callExpr.getRange().get().end.line); - callSite.setEndColumn(callExpr.getRange().get().end.column); - } else { - callSite.setStartLine(-1); - callSite.setStartColumn(-1); - callSite.setEndLine(-1); - callSite.setEndColumn(-1); - } - return callSite; - } - - /** - * Calculates type for the given expression and returns the resolved type - * name, or empty string if exception occurs during type resolution. - * - * @param expression Expression to be resolved - * @return Resolved type name or empty string if type resolution fails - */ - private static String resolveExpression(Expression expression) { - // perform expression resolution if resolution of this expression did not fail - // previously - if (!unresolvedExpressions.contains(expression.toString())) { - try { - ResolvedType resolvedType = javaSymbolSolver.calculateType(expression); - if (resolvedType.isReferenceType() || resolvedType.isUnionType()) { - return resolvedType.describe(); - } - } catch (Throwable exception) { - Log.debug("Could not resolve expression: " + expression + ": " + exception.getMessage()); - unresolvedExpressions.add(expression.toString()); - } - } - return ""; - } - - /** - * Resolves the given type and returns string representation of the resolved - * type. If type resolution fails, returns string representation (name) of - * the type. - * - * @param type Type to be resolved - * @return Resolved (qualified) type name - */ - private static String resolveType(Type type) { - // perform type resolution if resolution of this type did not fail previously - if (!unresolvedTypes.contains(type.asString())) { - try { - return type.resolve().describe(); - } catch (Throwable e) { - Log.warn("Could not resolve type: " + type.asString() + ": " + e.getMessage()); - unresolvedTypes.add(type.asString()); - } - } - return type.asString(); - } - - /** - * Collects all source roots (e.g., "src/main/java", "src/test/java") under - * the given project root path using the symbol solver collection strategy. - * Parses all source files under each source root and returns the complete - * symbol table as map of file path and java compilation unit pairs. - * - * @param projectRootPath root path of the project to be analyzed - * @return Pair of extracted symbol table map and parse problems map for - * project - * @throws IOException - */ - private static final String[] EXCLUDED_SOURCE_ROOTS = { - Paths.get("src", "test", "resources").toString(), - Paths.get("src", "it", "resources").toString(), - Paths.get("src", "xdocs-examples").toString() - }; - private static boolean excludeSourceRoot(Path sourceRoot) { - for (String excludedSrcRoot : EXCLUDED_SOURCE_ROOTS) { - if (Pattern.compile(excludedSrcRoot).matcher(sourceRoot.toString()).find()) { - return true; - } - } - return false; - } - - /** - * Sets up lexical preserving printer for the given compilation unit in a safe manner by checking - * whether any node in the unit is missing ranges, which can result in exception. - * - * @param compilationUnit Compilation unit to be set with lexical preserving printer - * @return compilation unit set up with lexical preserving printer or the original compilation - * unit if the unit contains range-missing nodes - */ - private static CompilationUnit safeLexicalPreservingPrinterSetup(CompilationUnit compilationUnit) { - // setup lexical-preserving printer only if CU has no missing-range nodes - boolean hasNodeWithMissingRange = compilationUnit.findAll(Node.class).stream() - .anyMatch(n -> !n.getRange().isPresent()); - if (!hasNodeWithMissingRange) { - return LexicalPreservingPrinter.setup(compilationUnit); - } - return compilationUnit; - } - - public static Pair, Map>> extractAll(Path projectRootPath) - throws IOException { - ParserConfiguration config = new ParserConfiguration() - .setStoreTokens(true) - .setAttributeComments(true) - .setLanguageLevel(ParserConfiguration.LanguageLevel.JAVA_21); - SymbolSolverCollectionStrategy symbolSolverCollectionStrategy = new SymbolSolverCollectionStrategy(config); - ProjectRoot projectRoot = symbolSolverCollectionStrategy.collect(projectRootPath); - javaSymbolSolver = (JavaSymbolSolver) symbolSolverCollectionStrategy.getParserConfiguration() - .getSymbolResolver().get(); - Map symbolTable = new LinkedHashMap<>(); - Map> parseProblems = new HashMap<>(); - for (SourceRoot sourceRoot : projectRoot.getSourceRoots()) { - if (excludeSourceRoot(sourceRoot.getRoot())) { - continue; - } - sourceRoot.setParserConfiguration(config); - for (ParseResult parseResult : sourceRoot.tryToParse()) { - if (parseResult.isSuccessful()) { - CompilationUnit compilationUnit = safeLexicalPreservingPrinterSetup(parseResult.getResult().get()); - symbolTable.put(compilationUnit.getStorage().get().getPath().toString(), - processCompilationUnit(compilationUnit)); - } else { - parseProblems.put(sourceRoot.getRoot().toString(), parseResult.getProblems()); - } - } - } - return Pair.of(symbolTable, parseProblems); - } - - public static Pair, Map>> extractSingle(String code) - throws IOException { - Map symbolTable = new LinkedHashMap(); - Map parseProblems = new HashMap>(); - // Setting up symbol solvers - CombinedTypeSolver combinedTypeSolver = new CombinedTypeSolver(); - combinedTypeSolver.add(new ReflectionTypeSolver()); - - ParserConfiguration parserConfiguration = new ParserConfiguration() - .setStoreTokens(true) - .setAttributeComments(true) - .setLanguageLevel(ParserConfiguration.LanguageLevel.JAVA_21); - parserConfiguration.setSymbolResolver(new JavaSymbolSolver(combinedTypeSolver)); - - JavaParser javaParser = new JavaParser(parserConfiguration); - ParseResult parseResult = javaParser.parse(code); - if (parseResult.isSuccessful()) { - CompilationUnit compilationUnit = safeLexicalPreservingPrinterSetup(parseResult.getResult().get()); - Log.debug("Successfully parsed code. Now processing compilation unit"); - symbolTable.put("", processCompilationUnit(compilationUnit)); - } else { - Log.error(parseResult.getProblems().toString()); - parseProblems.put("code", parseResult.getProblems()); - } - return Pair.of(symbolTable, parseProblems); - } - - /** - * Parses the given set of Java source files from the given project and - * constructs the symbol table. - * - * @param projectRootPath - * @param javaFilePaths - * @return - * @throws IOException - */ - public static Pair, Map>> extract(Path projectRootPath, - List javaFilePaths) throws IOException { - - // create symbol solver and parser configuration - SymbolSolverCollectionStrategy symbolSolverCollectionStrategy = new SymbolSolverCollectionStrategy(); - ProjectRoot projectRoot = symbolSolverCollectionStrategy.collect(projectRootPath); - javaSymbolSolver = (JavaSymbolSolver) symbolSolverCollectionStrategy.getParserConfiguration() - .getSymbolResolver().get(); - Log.info("Setting parser language level to JAVA_21"); - ParserConfiguration parserConfiguration = new ParserConfiguration() - .setStoreTokens(true) - .setAttributeComments(true) - .setLanguageLevel(ParserConfiguration.LanguageLevel.JAVA_21); - parserConfiguration.setSymbolResolver(javaSymbolSolver); - - // create java parser with the configuration - JavaParser javaParser = new JavaParser(parserConfiguration); - - Map symbolTable = new LinkedHashMap(); - Map parseProblems = new HashMap>(); - - // parse all given files and return pair of symbol table and parse problems - for (Path javaFilePath : javaFilePaths) { - ParseResult parseResult = javaParser.parse(javaFilePath); - if (parseResult.isSuccessful()) { - CompilationUnit compilationUnit = safeLexicalPreservingPrinterSetup(parseResult.getResult().get()); - System.out.println("Successfully parsed file: " + javaFilePath.toString()); - symbolTable.put(compilationUnit.getStorage().get().getPath().toString(), - processCompilationUnit(compilationUnit)); - } else { - Log.error(parseResult.getProblems().toString()); - parseProblems.put(javaFilePath.toString(), parseResult.getProblems()); - } - } - return Pair.of(symbolTable, parseProblems); - } - - public static void main(String[] args) throws IOException { - extractAll(Paths.get(args[0])); - } - -} diff --git a/src/main/java/com/ibm/cldk/SystemDependencyGraph.java b/src/main/java/com/ibm/cldk/SystemDependencyGraph.java deleted file mode 100644 index 066f46ab..00000000 --- a/src/main/java/com/ibm/cldk/SystemDependencyGraph.java +++ /dev/null @@ -1,240 +0,0 @@ -/* -Copyright IBM Corporation 2023, 2024 - -Licensed under the Apache Public License 2.0, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package com.ibm.cldk; - -import static com.ibm.cldk.CodeAnalyzer.analysisLevel; -import static com.ibm.cldk.utils.AnalysisUtils.*; - -import com.ibm.cldk.entities.*; -import com.ibm.cldk.utils.AnalysisUtils; -import com.ibm.cldk.utils.Log; -import com.ibm.cldk.utils.ScopeUtils; -import com.ibm.wala.cast.ir.ssa.AstIRFactory; -import com.ibm.wala.cast.java.translator.jdt.ecj.ECJClassLoaderFactory; -import com.ibm.wala.classLoader.CallSiteReference; -import com.ibm.wala.classLoader.JavaLanguage; -import com.ibm.wala.classLoader.Language; -import com.ibm.wala.ipa.callgraph.*; -import com.ibm.wala.ipa.callgraph.AnalysisOptions.ReflectionOptions; -import com.ibm.wala.ipa.callgraph.impl.Util; -import com.ibm.wala.ipa.callgraph.propagation.InstanceKey; -import com.ibm.wala.ipa.cha.ClassHierarchyException; -import com.ibm.wala.ipa.cha.ClassHierarchyFactory; -import com.ibm.wala.ipa.cha.IClassHierarchy; -import com.ibm.wala.ipa.modref.ModRef; -import com.ibm.wala.ipa.slicer.MethodEntryStatement; -import com.ibm.wala.ipa.slicer.SDG; -import com.ibm.wala.ipa.slicer.Slicer; -import com.ibm.wala.ipa.slicer.Statement; -import com.ibm.wala.types.ClassLoaderReference; -import com.ibm.wala.util.collections.HashMapFactory; -import com.ibm.wala.util.graph.Graph; -import com.ibm.wala.util.graph.GraphSlicer; -import com.ibm.wala.util.graph.traverse.DFS; -import java.io.IOException; -import java.io.PrintStream; -import java.util.*; -import java.util.function.BiFunction; -import java.util.function.Supplier; -import java.util.stream.Collectors; -import lombok.Data; -import lombok.EqualsAndHashCode; -import org.apache.commons.io.output.NullOutputStream; -import org.jgrapht.graph.DefaultDirectedGraph; -import org.jgrapht.nio.json.JSONExporter; - - -@Data -abstract class Dependency { - public CallableVertex source; - public CallableVertex target; -} - -@Data -@EqualsAndHashCode(callSuper = true) -class SDGDependency extends Dependency { - public String sourceKind; - public String destinationKind; - public String type; - public String weight; - - public SDGDependency(CallableVertex source, CallableVertex target, SystemDepEdge edge) { - super.source = source; - super.target = target; - this.sourceKind = edge.getSourceKind(); - this.destinationKind = edge.getDestinationKind(); - this.type = edge.getType(); - this.weight = String.valueOf(edge.getWeight()); - } -} - -@Data -@EqualsAndHashCode(callSuper = true) -class CallDependency extends Dependency { - public String type; - public String weight; - - public CallDependency(CallableVertex source, CallableVertex target, AbstractGraphEdge edge) { - this.source = source; - this.target = target; - this.type = edge.toString(); - this.weight = String.valueOf(edge.getWeight()); - } -} - -/** - * The type Sdg 2 json. - */ -public class SystemDependencyGraph { - - /** - * Get a JGraphT graph exporter to save graph as JSON. - * - * @return the graph exporter - */ - - private static JSONExporter getGraphExporter() { - JSONExporter exporter = new JSONExporter<>(); - exporter.setEdgeAttributeProvider(AbstractGraphEdge::getAttributes); - exporter.setVertexAttributeProvider(CallableVertex::getAttributes); - return exporter; - } - - /** - * Convert SDG to a formal Graph representation. - * - * @param callGraph - * @return - */ - private static org.jgrapht.Graph buildOnlyCallGraph(CallGraph callGraph) { - - org.jgrapht.Graph graph = new DefaultDirectedGraph<>( - AbstractGraphEdge.class); - callGraph.getEntrypointNodes() - .forEach(p -> { - // Get call statements that may execute in a given method - Iterator outGoingCalls = p.iterateCallSites(); - outGoingCalls.forEachRemaining(n -> { - callGraph.getPossibleTargets(p, n).stream() - .filter(o -> AnalysisUtils.isApplicationClass(o.getMethod().getDeclaringClass())) - .forEach(o -> { - - // Add the source nodes to the graph as vertices - Map source = Optional.ofNullable(getCallableFromSymbolTable(p.getMethod())).orElseGet(() -> createAndPutNewCallableInSymbolTable(p.getMethod())); - CallableVertex source_vertex = new CallableVertex(source); - - // Add the target nodes to the graph as vertices - Map target = Optional.ofNullable(getCallableFromSymbolTable(o.getMethod())).orElseGet(() -> createAndPutNewCallableInSymbolTable(o.getMethod())); - CallableVertex target_vertex = new CallableVertex(target); - - if (!source.equals(target) && target != null) { - // Get the edge between the source and the target - graph.addVertex(source_vertex); - graph.addVertex(target_vertex); - AbstractGraphEdge cgEdge = graph.getEdge(source_vertex, target_vertex); - if (cgEdge instanceof CallEdge) { - ((CallEdge) cgEdge).incrementWeight(); - } else { - graph.addEdge(source_vertex, target_vertex, new CallEdge()); - } - } - }); - }); - }); - - return graph; - } - - /** - * Construct a System Dependency Graph from a given input. - * - * @param input the input - * @param dependencies the dependencies - * @param build The build options - * @return A List of triples containing the source, destination, and edge type - * @throws IOException the io exception - * @throws ClassHierarchyException the class hierarchy exception - * @throws IllegalArgumentException the illegal argument exception - * @throws CallGraphBuilderCancelException the call graph builder cancel - * exception - */ - public static List construct( - String input, String dependencies, String build) - throws IOException, ClassHierarchyException, IllegalArgumentException, CallGraphBuilderCancelException { - - // Initialize scope - AnalysisScope scope = ScopeUtils.createScope(input, dependencies, build); - IClassHierarchy cha = ClassHierarchyFactory.make(scope, - new ECJClassLoaderFactory(scope.getExclusions())); - Log.done("There were a total of " + cha.getNumberOfClasses() + " classes of which " - + AnalysisUtils.getNumberOfApplicationClasses(cha) + " are application classes."); - - // Initialize javaee options - AnalysisOptions options = new AnalysisOptions(); - Iterable entryPoints = AnalysisUtils.getEntryPoints(cha); - options.setEntrypoints(entryPoints); - options.getSSAOptions().setDefaultValues(com.ibm.wala.ssa.SymbolTable::getDefaultValue); - options.setReflectionOptions(ReflectionOptions.NONE); - IAnalysisCacheView cache = new AnalysisCacheImpl(AstIRFactory.makeDefaultFactory(), - options.getSSAOptions()); - - // Build call graph - Log.info("Building call graph."); - - // Some fu to remove WALA's console out... - PrintStream originalOut = System.out; - PrintStream originalErr = System.err; - long start_time = System.currentTimeMillis(); - CallGraph callGraph; - CallGraphBuilder builder; - try { - System.setOut(new PrintStream(NullOutputStream.INSTANCE)); - System.setErr(new PrintStream(NullOutputStream.INSTANCE)); - builder = Util.makeRTABuilder(options, cache, cha); - callGraph = builder.makeCallGraph(options, null); - } finally { - System.setOut(originalOut); - System.setErr(originalErr); - } - - Log.done("Finished construction of call graph. Took " - + Math.ceil((double) (System.currentTimeMillis() - start_time) / 1000) + " seconds."); - - // set cyclomatic complexity for callables in the symbol table - callGraph.forEach(cgNode -> { - Callable callable = getCallableObjectFromSymbolTable(cgNode.getMethod()).getRight(); - if (callable != null) { - callable.setCyclomaticComplexity(getCyclomaticComplexity(cgNode.getIR())); - } - }); - - org.jgrapht.Graph graph; - - graph = buildOnlyCallGraph(callGraph); - - List edges = graph.edgeSet().stream() - .map(abstractGraphEdge -> { - CallableVertex source = graph.getEdgeSource(abstractGraphEdge); - CallableVertex target = graph.getEdgeTarget(abstractGraphEdge); - if (abstractGraphEdge instanceof CallEdge) { - return new CallDependency(source, target, abstractGraphEdge); - } else { - return new SDGDependency(source, target, (SystemDepEdge) abstractGraphEdge); - } - }) - .collect(Collectors.toList()); - - return edges; - } -} diff --git a/src/main/java/com/ibm/cldk/entities/AbstractGraphEdge.java b/src/main/java/com/ibm/cldk/entities/AbstractGraphEdge.java deleted file mode 100644 index 34fbc251..00000000 --- a/src/main/java/com/ibm/cldk/entities/AbstractGraphEdge.java +++ /dev/null @@ -1,123 +0,0 @@ -/* -Copyright IBM Corporation 2023, 2024 - -Licensed under the Apache Public License 2.0, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package com.ibm.cldk.entities; - -import static com.ibm.cldk.CodeAnalyzer.gson; - -import com.ibm.wala.ipa.callgraph.CGNode; -import com.ibm.wala.ipa.slicer.Statement; -import com.ibm.wala.shrike.shrikeCT.InvalidClassFileException; -import com.ibm.wala.ssa.IR; -import com.ibm.wala.ssa.SSAInstruction; -import java.io.Serializable; -import java.util.Map; -import lombok.Getter; -import org.jgrapht.nio.Attribute; - -/** - * The type Abstract graph edge. - */ -@Getter -public abstract class AbstractGraphEdge implements Serializable { - /** - * The Context. - * -- GETTER -- - * Gets context. - * - * @return the context - - */ - public final String context; - /** - * The Weight. - * -- GETTER -- - * Gets weight. - * - * @return the weight - - */ - public Integer weight = 1; - - /** - * Instantiates a new Abstract graph edge. - */ - protected AbstractGraphEdge() { - this(null); - } - - /** - * Instantiates a new Abstract graph edge. - * - * @param context the context - */ - protected AbstractGraphEdge(String context) { - this.context = context; - } - - /** - * Increment weight. - */ - public void incrementWeight() { - this.weight += 1; - } - - /** - * Gets id. - * - * @return the id - */ - public Integer getId() { - return this.hashCode(); - } - - /** - * Gets statement position. - * - * @param statement the statement - * @return the statement position - */ - Integer getStatementPosition(Statement statement) { - CGNode statementNode = statement.getNode(); - IR statementIR = statementNode.getIR(); - Integer pos = null; - // TODO: check this assumption: the same source instruction maps to several - // SSAInstructions, - // therefore it is sufficient to return the position of the first statement. - for (SSAInstruction inst : statementNode.getIR().getInstructions()) { - try { - pos = statementIR.getMethod().getSourcePosition(inst.iIndex()).getLastLine(); - return pos; - } catch (InvalidClassFileException e) { - throw new RuntimeException(e); - } catch (NullPointerException npe) { - return -1; - } - } - return pos; - } - - @Override - public String toString() { - return gson.toJson(this); - } - - /** - * Gets attributes. - * - * @return the attributes - */ - public abstract Map getAttributes(); - - public abstract Map getAttributesMap(); -} diff --git a/src/main/java/com/ibm/cldk/entities/AbstractGraphVertex.java b/src/main/java/com/ibm/cldk/entities/AbstractGraphVertex.java deleted file mode 100644 index 0381b23c..00000000 --- a/src/main/java/com/ibm/cldk/entities/AbstractGraphVertex.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.ibm.cldk.entities; - -import java.io.Serializable; -import java.util.Map; -import org.jgrapht.nio.Attribute; - - -public abstract class AbstractGraphVertex implements Serializable { - - public abstract Map getAttributes(); - - @Override - public boolean equals(Object obj) { - return super.equals(obj); - } - - @Override - public int hashCode() { - return super.hashCode(); - } -} diff --git a/src/main/java/com/ibm/cldk/entities/CRUDOperation.java b/src/main/java/com/ibm/cldk/entities/CRUDOperation.java deleted file mode 100644 index d318f10a..00000000 --- a/src/main/java/com/ibm/cldk/entities/CRUDOperation.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.ibm.cldk.entities; - -import com.ibm.cldk.javaee.utils.enums.CRUDOperationType; -import com.ibm.cldk.utils.annotations.NotImplemented; -import java.util.List; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@NoArgsConstructor -@AllArgsConstructor -public class CRUDOperation { - private int lineNumber = -1; - private CRUDOperationType operationType; - - @NotImplemented - private String targetTable = null; - @NotImplemented - private List involvedColumns; - @NotImplemented - private String condition; - @NotImplemented - private List joinedTables; -} diff --git a/src/main/java/com/ibm/cldk/entities/CRUDQuery.java b/src/main/java/com/ibm/cldk/entities/CRUDQuery.java deleted file mode 100644 index 45bd9ce4..00000000 --- a/src/main/java/com/ibm/cldk/entities/CRUDQuery.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.ibm.cldk.entities; - -import com.ibm.cldk.javaee.utils.enums.CRUDQueryType; -import java.util.List; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@NoArgsConstructor -@AllArgsConstructor -public class CRUDQuery { - private int lineNumber = -1; - private List queryArguments; - private CRUDQueryType queryType; -} diff --git a/src/main/java/com/ibm/cldk/entities/CallEdge.java b/src/main/java/com/ibm/cldk/entities/CallEdge.java deleted file mode 100644 index b4c407e2..00000000 --- a/src/main/java/com/ibm/cldk/entities/CallEdge.java +++ /dev/null @@ -1,75 +0,0 @@ -/* -Copyright IBM Corporation 2023, 2024 - -Licensed under the Apache Public License 2.0, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package com.ibm.cldk.entities; - -import java.util.LinkedHashMap; -import java.util.Map; -import org.jgrapht.nio.Attribute; -import org.jgrapht.nio.DefaultAttribute; - -/** - * The type Call edge. - */ -public class CallEdge extends AbstractGraphEdge { - /** - * The constant serialVersionUID. - */ - public static final long serialVersionUID = -8284030936836318929L; - /** - * The Type. - */ - public final String type; - - /** - * Instantiates a new Call edge. - */ - public CallEdge() { - super(); - this.type = toString(); - } - - /** - * Instantiates a new Call edge. - * - * @param context the context - */ - public CallEdge(String context) { - super(context); - this.type = toString(); - } - - @Override - public String toString() { - return "CALL_DEP"; - } - - @Override - public boolean equals(Object o) { - return (o instanceof CallEdge) && (toString().equals(o.toString())); - } - - public Map getAttributes() { - Map map = new LinkedHashMap<>(); - map.put("type", DefaultAttribute.createAttribute(toString())); - map.put("weight", DefaultAttribute.createAttribute(String.valueOf(getWeight()))); - return map; - } - - public Map getAttributesMap() { - Map map = new LinkedHashMap<>(); - map.put("type", toString()); - map.put("weight", String.valueOf(getWeight())); - return map; - } -} diff --git a/src/main/java/com/ibm/cldk/entities/CallSite.java b/src/main/java/com/ibm/cldk/entities/CallSite.java deleted file mode 100644 index 0c45ee80..00000000 --- a/src/main/java/com/ibm/cldk/entities/CallSite.java +++ /dev/null @@ -1,88 +0,0 @@ -package com.ibm.cldk.entities; - -import java.util.ArrayList; -import java.util.List; -import java.util.Optional; -import lombok.Data; - -/** - * Represents a call site within source code, encapsulating information about method invocations - * and their contextual details. - * - *

- * A call site contains information about the method being called, its receiver, - * arguments, return type, and various properties that characterize the method call. - * It also tracks the position of the call site within the source file. - *

- * - *

- * This class leverages Lombok's {@code @Data} annotation to automatically generate - * getters, setters, {@code toString()}, {@code equals()}, and {@code hashCode()} methods. - *

- * - * @author Rahul Krishna - * @version 2.3.0 - */ -@Data -@SuppressWarnings("OptionalUsedAsFieldOrParameterType") -public class CallSite { - /** Name of the method being called */ - private String methodName; - - /** Comment associated with the call site */ - private Comment comment; - - /** Expression representing the receiver of the method call */ - private String receiverExpr; - - /** Type of the receiver object */ - private String receiverType; - - /** List of argument types for the method call */ - private List argumentTypes; - - /** List of argument expressions for the method call */ - private List argumentExpr; - - /** Return type of the called method */ - private String returnType; - - /** Full signature of the callee method */ - private String calleeSignature; - - /** Flag indicating if the method has public access */ - private boolean isPublic = false; - - /** Flag indicating if the method has protected access */ - private boolean isProtected = false; - - /** Flag indicating if the method has private access */ - private boolean isPrivate = false; - - /** Flag indicating if the method has unspecified access */ - private boolean isUnspecified = false; - - /** Flag indicating if this is a static method call */ - private boolean isStaticCall; - - /** Flag indicating if this is a constructor call */ - private boolean isConstructorCall; - - /** CRUD operation associated with this call site, if any */ - private CRUDOperation crudOperation = null; - - /** CRUD query associated with this call site, if any */ - private CRUDQuery crudQuery = null; - - /** Starting line number of the call site in the source file */ - private int startLine; - - /** Starting column number of the call site in the source file */ - private int startColumn; - - /** Ending line number of the call site in the source file */ - private int endLine; - - /** Ending column number of the call site in the source file */ - private int endColumn; -} diff --git a/src/main/java/com/ibm/cldk/entities/Callable.java b/src/main/java/com/ibm/cldk/entities/Callable.java deleted file mode 100644 index dc25ac99..00000000 --- a/src/main/java/com/ibm/cldk/entities/Callable.java +++ /dev/null @@ -1,107 +0,0 @@ -package com.ibm.cldk.entities; - -import java.util.ArrayList; -import java.util.List; -import lombok.Data; - -/** - * Represents a callable entity in the source code, such as a method or constructor. - * - *

- * This class encapsulates information about the callable's file path, signature, comments, - * annotations, modifiers, thrown exceptions, declaration, parameters, code, position within - * the source file, return type, and various properties that characterize the callable. - *

- * - *

- * This class leverages Lombok's {@code @Data} annotation to automatically generate - * getters, setters, {@code toString()}, {@code equals()}, and {@code hashCode()} methods. - *

- * - *

- * Example usage: - *

- *     Callable callable = new Callable();
- *     callable.setFilePath("src/main/java/com/ibm/cldk/entities/Example.java");
- *     callable.setSignature("public void exampleMethod()");
- *     callable.setStartLine(10);
- *     callable.setEndLine(20);
- *     callable.setReturnType("void");
- *     callable.setConstructor(false);
- * 
- *

- * - * @author Rahul Krishna - * @version 2.3.0 - */ -@Data -public class Callable { - /** The file path where the callable entity is defined. */ - private String filePath; - - /** The signature of the callable entity. */ - private String signature; - - /** A list of comments associated with the callable entity. */ - private List comments; - - /** A list of annotations applied to the callable entity. */ - private List annotations; - - /** A list of modifiers applied to the callable entity (e.g., public, private). */ - private List modifiers; - - /** A list of exceptions thrown by the callable entity. */ - private List thrownExceptions; - - /** The declaration of the callable entity. */ - private String declaration; - - /** A list of parameters for the callable entity. */ - private List parameters; - - /** The code of the callable entity. */ - private String code; - - /** The starting line number of the callable entity in the source file. */ - private int startLine; - - /** The ending line number of the callable entity in the source file. */ - private int endLine; - - /** The starting line number of the callable code in the source file. */ - private int codeStartLine; - - /** The return type of the callable entity. */ - private String returnType = null; - - /** Indicates whether the callable entity is implicit. */ - private boolean isImplicit = false; - - /** Indicates whether the callable entity is a constructor. */ - private boolean isConstructor = false; - - /** A list of types referenced by the callable entity. */ - private List referencedTypes; - - /** A list of fields accessed by the callable entity. */ - private List accessedFields; - - /** A list of call sites within the callable entity. */ - private List callSites; - - /** A list of variable declarations within the callable entity. */ - private List variableDeclarations; - - /** A list of CRUD operations associated with the callable entity. */ - private List crudOperations = new ArrayList<>(); - - /** A list of CRUD queries associated with the callable entity. */ - private List crudQueries = new ArrayList<>(); - - /** The cyclomatic complexity of the callable entity. */ - private int cyclomaticComplexity; - - /** Indicates whether the callable entity is an entry point. */ - private boolean isEntrypoint = false; -} diff --git a/src/main/java/com/ibm/cldk/entities/CallableVertex.java b/src/main/java/com/ibm/cldk/entities/CallableVertex.java deleted file mode 100644 index 7e7e25a5..00000000 --- a/src/main/java/com/ibm/cldk/entities/CallableVertex.java +++ /dev/null @@ -1,39 +0,0 @@ -package com.ibm.cldk.entities; - -import static com.ibm.cldk.CodeAnalyzer.gson; - -import java.util.Map; -import lombok.Data; -import lombok.EqualsAndHashCode; -import org.jgrapht.nio.Attribute; -import org.jgrapht.nio.DefaultAttribute; - -@Data -@EqualsAndHashCode(callSuper = true) -public class CallableVertex extends AbstractGraphVertex { - private String filePath; - private String typeDeclaration; - private String signature; - private String callableDeclaration; - - public CallableVertex(Map callable) { - this.filePath = callable.get("filePath"); - this.typeDeclaration = callable.get("typeDeclaration"); - this.signature = callable.get("signature"); - this.callableDeclaration = callable.get("callableDeclaration"); - } - - @Override - public String toString() { - return gson.toJson(this); - } - - @Override - public Map getAttributes() { - return Map.ofEntries( - Map.entry("filePath", DefaultAttribute.createAttribute(getFilePath())), - Map.entry("typeDeclaration", DefaultAttribute.createAttribute(getTypeDeclaration())), - Map.entry("signature", DefaultAttribute.createAttribute(getSignature())), - Map.entry("callableDeclaration", DefaultAttribute.createAttribute(getCallableDeclaration()))); - } -} diff --git a/src/main/java/com/ibm/cldk/entities/Comment.java b/src/main/java/com/ibm/cldk/entities/Comment.java deleted file mode 100644 index e248a1a0..00000000 --- a/src/main/java/com/ibm/cldk/entities/Comment.java +++ /dev/null @@ -1,80 +0,0 @@ -package com.ibm.cldk.entities; - -import lombok.Data; - -/** - * Represents a comment entity extracted from source code. - * This class encapsulates information about the content, position, - * and type of a comment within a source file. - * - *

- * The comment can be of various types, including Javadoc, block comments, or line comments. - * The class also keeps track of the comment's position within the file (line and column numbers). - *

- * - *

- * This class leverages Lombok's {@code @Data} annotation to automatically generate - * getters, setters, {@code toString()}, {@code equals()}, and {@code hashCode()} methods. - *

- * - * Example usage: - *
- *     Comment comment = new Comment();
- *     comment.setContent("This is a sample comment.");
- *     comment.setStartLine(10);
- *     comment.setEndLine(12);
- *     comment.setJavadoc(true);
- * 
- * - * @author Rahul Krishna - * @version 2.3.0 - */ -@Data -public class Comment { - - /** - * The textual content of the comment. - */ - private String content; - - /** - * The starting line number of the comment in the source file. - *

- * Defaults to {@code -1} if the position is unknown. - *

- */ - private int startLine = -1; - - /** - * The ending line number of the comment in the source file. - *

- * Defaults to {@code -1} if the position is unknown. - *

- */ - private int endLine = -1; - - /** - * The starting column number of the comment in the source file. - *

- * Defaults to {@code -1} if the position is unknown. - *

- */ - private int startColumn = -1; - - /** - * The ending column number of the comment in the source file. - *

- * Defaults to {@code -1} if the position is unknown. - *

- */ - private int endColumn = -1; - - /** - * Indicates whether the comment is a Javadoc comment. - *

- * Javadoc comments are special block comments used for generating documentation - * and typically start with {@code /**}. - *

- */ - private boolean isJavadoc = false; -} diff --git a/src/main/java/com/ibm/cldk/entities/EnumConstant.java b/src/main/java/com/ibm/cldk/entities/EnumConstant.java deleted file mode 100644 index 0ac11ff9..00000000 --- a/src/main/java/com/ibm/cldk/entities/EnumConstant.java +++ /dev/null @@ -1,10 +0,0 @@ -package com.ibm.cldk.entities; - -import java.util.List; -import lombok.Data; - -@Data -public class EnumConstant { - private String name; - private List arguments; -} diff --git a/src/main/java/com/ibm/cldk/entities/Field.java b/src/main/java/com/ibm/cldk/entities/Field.java deleted file mode 100644 index e1f9f6ad..00000000 --- a/src/main/java/com/ibm/cldk/entities/Field.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.ibm.cldk.entities; - -import java.util.List; -import lombok.Data; - -@Data -public class Field { - private Comment comment; - private String name; - private String type; - private Integer startLine; - private Integer endLine; - private List variables; - private List modifiers; - private List annotations; -} diff --git a/src/main/java/com/ibm/cldk/entities/Import.java b/src/main/java/com/ibm/cldk/entities/Import.java deleted file mode 100644 index 6688b9a6..00000000 --- a/src/main/java/com/ibm/cldk/entities/Import.java +++ /dev/null @@ -1,11 +0,0 @@ -package com.ibm.cldk.entities; - -import lombok.Data; - -/** Represents an import declaration in a Java compilation unit. */ -@Data -public class Import { - private String path; - private boolean isStatic = false; - private boolean isWildcard = false; -} diff --git a/src/main/java/com/ibm/cldk/entities/InitializationBlock.java b/src/main/java/com/ibm/cldk/entities/InitializationBlock.java deleted file mode 100644 index 8c106477..00000000 --- a/src/main/java/com/ibm/cldk/entities/InitializationBlock.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.ibm.cldk.entities; - -import java.util.List; -import java.util.stream.Collector; -import lombok.Data; - -@Data -public class InitializationBlock { - private String filePath; - private List comments; - private List annotations; - private List thrownExceptions; - private String code; - private int startLine; - private int endLine; - private boolean isStatic; - private List referencedTypes; - private List accessedFields; - private List callSites; - private List variableDeclarations; - private int cyclomaticComplexity; - -} diff --git a/src/main/java/com/ibm/cldk/entities/JavaCompilationUnit.java b/src/main/java/com/ibm/cldk/entities/JavaCompilationUnit.java deleted file mode 100644 index 0c71fa44..00000000 --- a/src/main/java/com/ibm/cldk/entities/JavaCompilationUnit.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.ibm.cldk.entities; - -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import lombok.Data; - -@Data -public class JavaCompilationUnit { - private String filePath; - private String packageName; - private List comments = new ArrayList<>(); - private List imports; - private Map typeDeclarations; - private boolean isModified; -} diff --git a/src/main/java/com/ibm/cldk/entities/ParameterInCallable.java b/src/main/java/com/ibm/cldk/entities/ParameterInCallable.java deleted file mode 100644 index 9699dd9c..00000000 --- a/src/main/java/com/ibm/cldk/entities/ParameterInCallable.java +++ /dev/null @@ -1,62 +0,0 @@ -package com.ibm.cldk.entities; - -import java.util.List; -import lombok.Data; - -/** - * Represents a parameter in a callable entity (e.g., method or constructor). - * - *

- * This class encapsulates information about the parameter's type, name, annotations, - * modifiers, and its position within the source file. - *

- * - *

- * This class leverages Lombok's {@code @Data} annotation to automatically generate - * getters, setters, {@code toString()}, {@code equals()}, and {@code hashCode()} methods. - *

- * - *

- * Example usage: - *

- *     ParameterInCallable param = new ParameterInCallable();
- *     param.setType("String");
- *     param.setName("exampleParam");
- *     param.setAnnotations(Arrays.asList("NotNull"));
- *     param.setModifiers(Arrays.asList("final"));
- *     param.setStartLine(10);
- *     param.setEndLine(10);
- *     param.setStartColumn(5);
- *     param.setEndColumn(20);
- * 
- *

- * - * @author Rahul Krishna - * @version 2.3.0 - */ -@Data -public class ParameterInCallable { - /** The type of the parameter (e.g., int, String). */ - private String type; - - /** The name of the parameter. */ - private String name; - - /** A list of annotations applied to the parameter. */ - private List annotations; - - /** A list of modifiers applied to the parameter (e.g., final, static). */ - private List modifiers; - - /** The starting line number of the parameter in the source file. */ - private int startLine; - - /** The ending line number of the parameter in the source file. */ - private int endLine; - - /** The starting column number of the parameter in the source file. */ - private int startColumn; - - /** The ending column number of the parameter in the source file. */ - private int endColumn; -} diff --git a/src/main/java/com/ibm/cldk/entities/RecordComponent.java b/src/main/java/com/ibm/cldk/entities/RecordComponent.java deleted file mode 100644 index 48052a16..00000000 --- a/src/main/java/com/ibm/cldk/entities/RecordComponent.java +++ /dev/null @@ -1,58 +0,0 @@ -package com.ibm.cldk.entities; - -import java.util.ArrayList; -import java.util.List; -import lombok.Data; - -/** - * Represents a component of a record in the source code. - * - *

- * This class encapsulates information about the component's name, type, modifiers, - * annotations, default value, and whether it is a varargs parameter. - *

- * - *

- * This class leverages Lombok's {@code @Data} annotation to automatically generate - * getters, setters, {@code toString()}, {@code equals()}, and {@code hashCode()} methods. - *

- * - *

- * Example usage: - *

- *     RecordComponent component = new RecordComponent();
- *     component.setName("exampleComponent");
- *     component.setType("String");
- *     component.setModifiers(Arrays.asList("private"));
- *     component.setAnnotations(Arrays.asList("NotNull"));
- *     component.setDefaultValue("defaultValue");
- *     component.setVarArgs(false);
- * 
- *

- * - * @author Rahul Krishna - * @version 2.3.0 - */ -@Data -public class RecordComponent { - /** The comment associated with the record component. */ - private Comment comment; - - /** The name of the record component. */ - private String name; - - /** The type of the record component. */ - private String type; - - /** A list of modifiers applied to the record component (e.g., final, static). */ - private List modifiers; - - /** A list of annotations applied to the record component. */ - private List annotations = new ArrayList<>(); - - /** The default value of the record component, stored as a string representation. */ - private Object defaultValue = null; - - /** Indicates whether the record component is a varargs parameter. */ - private boolean isVarArgs = false; -} diff --git a/src/main/java/com/ibm/cldk/entities/SystemDepEdge.java b/src/main/java/com/ibm/cldk/entities/SystemDepEdge.java deleted file mode 100644 index 00261840..00000000 --- a/src/main/java/com/ibm/cldk/entities/SystemDepEdge.java +++ /dev/null @@ -1,128 +0,0 @@ -/* -Copyright IBM Corporation 2023, 2024 - -Licensed under the Apache Public License 2.0, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package com.ibm.cldk.entities; - -import com.ibm.wala.ipa.slicer.Statement; -import java.util.LinkedHashMap; -import java.util.Map; -import org.apache.commons.lang3.builder.HashCodeBuilder; -import org.jgrapht.nio.Attribute; -import org.jgrapht.nio.DefaultAttribute; - -/** - * The type System dep edge. - */ -public class SystemDepEdge extends AbstractGraphEdge { - /** - * The constant serialVersionUID. - */ - public static final long serialVersionUID = -8284030936836318929L; - /** - * The Source pos. - */ - public final Integer sourcePos; - /** - * The Destination pos. - */ - public final Integer destinationPos; - /** - * The Type. - */ - public final String type; - public final String sourceKind; - public final String destinationKind; - - /** - * Instantiates a new System dep edge. - * - * @param sourceStatement the source statement - * @param destinationStatement the destination statement - * @param type the type - */ - public SystemDepEdge(Statement sourceStatement, Statement destinationStatement, String type) { - super(); - this.sourceKind = sourceStatement.getKind().toString(); - this.destinationKind = destinationStatement.getKind().toString(); - this.type = type; - this.sourcePos = getStatementPosition(sourceStatement); - this.destinationPos = getStatementPosition(destinationStatement); - } - - @Override - public int hashCode() { - return new HashCodeBuilder(17, 37).append(sourcePos).append(destinationPos).append(context).append(type) - .build(); - } - - @Override - public boolean equals(Object o) { - return (o instanceof SystemDepEdge) && (this.toString().equals(o.toString())) - && Integer.valueOf(this.hashCode()).equals(o.hashCode()) - && this.type.equals(((SystemDepEdge) o).getType()); - } - - - public String getSourceKind() { - return sourceKind; - } - - public String getDestinationKind() { - return destinationKind; - } - - /** - * Gets type. - * - * @return the type - */ - public String getType() { - return type; - } - - /** - * Gets source pos. - * - * @return the source pos - */ - public Integer getSourcePos() { - return sourcePos; - } - - /** - * Gets destination pos. - * - * @return the destination pos - */ - public Integer getDestinationPos() { - return destinationPos; - } - - public Map getAttributes() { - Map map = new LinkedHashMap<>(); - map.put("source_kind", DefaultAttribute.createAttribute(getSourceKind())); - map.put("type", DefaultAttribute.createAttribute(getType())); - map.put("destination_kind", DefaultAttribute.createAttribute(getDestinationKind())); - map.put("weight", DefaultAttribute.createAttribute(String.valueOf(getWeight()))); - return map; - } - - public Map getAttributesMap() { - Map map = new LinkedHashMap<>(); - map.put("source_kind", getSourceKind()); - map.put("type", getType()); - map.put("destination_kind", getDestinationKind()); - map.put("weight", String.valueOf(getWeight())); - return map; - } -} diff --git a/src/main/java/com/ibm/cldk/entities/Type.java b/src/main/java/com/ibm/cldk/entities/Type.java deleted file mode 100644 index d7ae5cab..00000000 --- a/src/main/java/com/ibm/cldk/entities/Type.java +++ /dev/null @@ -1,80 +0,0 @@ -package com.ibm.cldk.entities; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import lombok.Data; - -/** - * Represents a type in the system with various characteristics. - * This class uses Lombok's @Data annotation to generate boilerplate code. - * - * @author Rahul Krishna - * @version 2.3.0 - */ -@Data -public class Type { - /** Indicates if this type is nested. */ - private boolean isNestedType; - - /** Indicates if this type is a class or interface declaration. */ - private boolean isClassOrInterfaceDeclaration; - - /** Indicates if this type is an enum declaration. */ - private boolean isEnumDeclaration; - - /** Indicates if this type is an annotation declaration. */ - private boolean isAnnotationDeclaration; - - /** Indicates if this type is a record declaration. */ - private boolean isRecordDeclaration; - - /** Indicates if this type is an interface. */ - private boolean isInterface; - - /** Indicates if this type is an inner class. */ - private boolean isInnerClass; - - /** Indicates if this type is a local class. */ - private boolean isLocalClass; - - /** List of types that this type extends. */ - private List extendsList = new ArrayList<>(); - - /** List of comments associated with this type. */ - private List comments; - - /** List of interfaces that this type implements. */ - private List implementsList = new ArrayList<>(); - - /** List of modifiers for this type. */ - private List modifiers = new ArrayList<>(); - - /** List of annotations for this type. */ - private List annotations = new ArrayList<>(); - - /** The parent type of this type. */ - private String parentType; - - /** List of nested type declarations within this type. */ - private List nestedTypeDeclarations = new ArrayList<>(); - - /** Map of callable declarations within this type. */ - private Map callableDeclarations = new HashMap<>(); - - /** List of field declarations within this type. */ - private List fieldDeclarations = new ArrayList<>(); - - /** List of enum constants within this type. */ - private List enumConstants = new ArrayList<>(); - - /** List of record components within this type. */ - private List recordComponents = new ArrayList<>(); - - /** List of initialization blocks within this type. */ - private List initializationBlocks = new ArrayList<>(); - - /** Indicates if this type is an entry point class. */ - private boolean isEntrypointClass = false; -} diff --git a/src/main/java/com/ibm/cldk/entities/VariableDeclaration.java b/src/main/java/com/ibm/cldk/entities/VariableDeclaration.java deleted file mode 100644 index c9284aea..00000000 --- a/src/main/java/com/ibm/cldk/entities/VariableDeclaration.java +++ /dev/null @@ -1,61 +0,0 @@ -package com.ibm.cldk.entities; - -import lombok.Data; - -/** - * Represents a variable declaration in the source code. - * - *

- * This class encapsulates information about the variable's name, type, initializer, - * and its position within the source file. It also includes an optional comment - * associated with the variable declaration. - *

- * - *

- * This class leverages Lombok's {@code @Data} annotation to automatically generate - * getters, setters, {@code toString()}, {@code equals()}, and {@code hashCode()} methods. - *

- * - *

- * Example usage: - *

- *     VariableDeclaration varDecl = new VariableDeclaration();
- *     varDecl.setName("exampleVar");
- *     varDecl.setType("String");
- *     varDecl.setInitializer("\"defaultValue\"");
- *     varDecl.setStartLine(10);
- *     varDecl.setEndLine(10);
- *     varDecl.setStartColumn(5);
- *     varDecl.setEndColumn(20);
- * 
- *

- * - * @author Rahul Krishna - * @version 2.3.0 - */ -@Data -public class VariableDeclaration { - /** The comment associated with the variable declaration. */ - private Comment comment; - - /** The name of the variable. */ - private String name; - - /** The type of the variable. */ - private String type; - - /** The initializer of the variable, stored as a string representation. */ - private String initializer; - - /** The starting line number of the variable declaration in the source file. */ - private int startLine = -1; - - /** The starting column number of the variable declaration in the source file. */ - private int startColumn = -1; - - /** The ending line number of the variable declaration in the source file. */ - private int endLine = -1; - - /** The ending column number of the variable declaration in the source file. */ - private int endColumn = -1; -} diff --git a/src/main/java/com/ibm/cldk/javaee/CRUDFinderFactory.java b/src/main/java/com/ibm/cldk/javaee/CRUDFinderFactory.java deleted file mode 100644 index 02411db2..00000000 --- a/src/main/java/com/ibm/cldk/javaee/CRUDFinderFactory.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.ibm.cldk.javaee; - -import com.ibm.cldk.javaee.jakarta.JPACRUDFinder; -import com.ibm.cldk.javaee.jdbc.JDBCCRUDFinder; -import com.ibm.cldk.javaee.spring.SpringCRUDFinder; -import com.ibm.cldk.javaee.utils.interfaces.AbstractCRUDFinder; -import java.util.stream.Stream; -import org.apache.commons.lang3.NotImplementedException; - -public class CRUDFinderFactory { - public static AbstractCRUDFinder getCRUDFinder(String framework) { - switch (framework.toLowerCase()) { - case "jpa": - case "jakarta": - return new JPACRUDFinder(); - case "spring": - case "springboot": - return new SpringCRUDFinder(); - case "jdbc": - return new JDBCCRUDFinder(); - case "camel": - throw new NotImplementedException("Camel CRUD finder not implemented yet"); - case "struts": - throw new NotImplementedException("Struts CRUD finder not implemented yet"); - default: - throw new IllegalArgumentException("Unknown framework: " + framework); - } - } - - public static Stream getCRUDFinders() { - return Stream.of(new JPACRUDFinder(), new SpringCRUDFinder(), new JDBCCRUDFinder()); - } -} diff --git a/src/main/java/com/ibm/cldk/javaee/EntrypointsFinderFactory.java b/src/main/java/com/ibm/cldk/javaee/EntrypointsFinderFactory.java deleted file mode 100644 index 96da1838..00000000 --- a/src/main/java/com/ibm/cldk/javaee/EntrypointsFinderFactory.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.ibm.cldk.javaee; - -import com.ibm.cldk.javaee.camel.CamelEntrypointFinder; -import com.ibm.cldk.javaee.jakarta.JakartaEntrypointFinder; -import com.ibm.cldk.javaee.jax.JaxRsEntrypointFinder; -import com.ibm.cldk.javaee.spring.SpringEntrypointFinder; -import com.ibm.cldk.javaee.struts.StrutsEntrypointFinder; -import com.ibm.cldk.javaee.utils.interfaces.AbstractEntrypointFinder; -import java.util.stream.Stream; -import org.apache.commons.lang3.NotImplementedException; - -public class EntrypointsFinderFactory { - public static AbstractEntrypointFinder getEntrypointFinder(String framework) { - switch (framework.toLowerCase()) { - case "jakarta": - return new JakartaEntrypointFinder(); - case "spring": - return new SpringEntrypointFinder(); - case "camel": - throw new NotImplementedException("Camel CRUD finder not implemented yet"); - case "struts": - throw new NotImplementedException("Struts CRUD finder not implemented yet"); - default: - throw new IllegalArgumentException("Unknown framework: " + framework); - } - } - - public static Stream getEntrypointFinders() { - return Stream.of(new JakartaEntrypointFinder(), new StrutsEntrypointFinder(), new SpringEntrypointFinder(), new CamelEntrypointFinder(), new JaxRsEntrypointFinder()); - } -} diff --git a/src/main/java/com/ibm/cldk/javaee/camel/CamelEntrypointFinder.java b/src/main/java/com/ibm/cldk/javaee/camel/CamelEntrypointFinder.java deleted file mode 100644 index dfdc6935..00000000 --- a/src/main/java/com/ibm/cldk/javaee/camel/CamelEntrypointFinder.java +++ /dev/null @@ -1,55 +0,0 @@ -package com.ibm.cldk.javaee.camel; - -import com.github.javaparser.ast.body.CallableDeclaration; -import com.github.javaparser.ast.body.ClassOrInterfaceDeclaration; -import com.github.javaparser.ast.body.TypeDeclaration; -import com.github.javaparser.resolution.UnsolvedSymbolException; -import com.github.javaparser.resolution.declarations.ResolvedReferenceTypeDeclaration; -import com.ibm.cldk.javaee.utils.interfaces.AbstractEntrypointFinder; -import com.ibm.cldk.utils.Log; -import com.ibm.cldk.utils.annotations.NotImplemented; - -@NotImplemented(comment = "This class is not implemented yet. Leaving this here to refactor entrypoint detection.") -public class CamelEntrypointFinder extends AbstractEntrypointFinder { - /** - * Detect if the method is an entrypoint. - * - * @param typeDecl@return True if the method is an entrypoint, false otherwise. - */ - @Override - public boolean isEntrypointClass(TypeDeclaration typeDecl) { - if (!(typeDecl instanceof ClassOrInterfaceDeclaration)) { - return false; - } - - ClassOrInterfaceDeclaration classDecl = (ClassOrInterfaceDeclaration) typeDecl; - - // Check Camel class annotations - if (classDecl.getAnnotations().stream().anyMatch(a -> a.getNameAsString().contains("Component"))) { - return true; - } - - // Check Camel parent classes and interfaces - try { - ResolvedReferenceTypeDeclaration resolved = classDecl.resolve(); - return resolved.getAllAncestors().stream().anyMatch(ancestor -> { - String name = ancestor.getQualifiedName(); - return name.contains("RouteBuilder") || name.contains("Processor") || name.contains("Producer") - || name.contains("Consumer"); - }); - } catch (RuntimeException e) { - Log.warn("Could not resolve class: " + e.getMessage()); - } - - return false; - } - - /** - * @param callableDecl - * @return - */ - @Override - public boolean isEntrypointMethod(CallableDeclaration callableDecl) { - return false; - } -} diff --git a/src/main/java/com/ibm/cldk/javaee/jakarta/JPACRUDFinder.java b/src/main/java/com/ibm/cldk/javaee/jakarta/JPACRUDFinder.java deleted file mode 100644 index 1f9fa4cf..00000000 --- a/src/main/java/com/ibm/cldk/javaee/jakarta/JPACRUDFinder.java +++ /dev/null @@ -1,95 +0,0 @@ -package com.ibm.cldk.javaee.jakarta; - -import com.ibm.cldk.javaee.utils.enums.CRUDOperationType; -import com.ibm.cldk.javaee.utils.enums.JPAQueryMethod; -import com.ibm.cldk.javaee.utils.interfaces.AbstractCRUDFinder; -import java.util.List; -import java.util.Optional; - -public class JPACRUDFinder extends AbstractCRUDFinder { - - // Detect CREATE Operation - @Override - public boolean isCreateOperation(String receiverType, String name) { - return receiverType.endsWith("EntityManager") && name.equals("persist"); - } - - // Detect DELETE Operation - @Override - public boolean isDeleteOperation(String receiverType, String name) { - return receiverType.endsWith("EntityManager") && name.equals("remove"); - } - - // Detect UPDATE Operation, including query executions - @Override - public boolean isUpdateOperation(String receiverType, String name) { - if (receiverType.endsWith("Query")) { - Optional operation = JPAQueryMethod.getOperationForMethod(name); - // There's a caveat here because UPDATE/DELETE operations are both represented by the same method. - // See https://github.com/codellm-devkit/codeanalyzer-java/issues/100#issuecomment-2644492440 - return operation.isPresent() && (operation.get() == CRUDOperationType.UPDATE); - } - return receiverType.endsWith("EntityManager") && name.equals("merge"); - } - - // Detect READ Operation, including query executions using the JPAQueryMethod enum - @Override - public boolean isReadOperation(String receiverType, String name) { - if (receiverType.endsWith("EntityManager") && name.equals("find")) { - return true; - } - - if (receiverType.endsWith("Query")) { - Optional operation = JPAQueryMethod.getOperationForMethod(name); - return operation.isPresent() && operation.get() == CRUDOperationType.READ; - } - - return false; - } - - // Detect CRUD Query Creation (Only query definitions, not execution) - @Override - public boolean isCRUDQueryCreation(String declaringType, String methodName) { - return declaringType.endsWith("EntityManager") && - (methodName.equals("createQuery") || methodName.equals("createNamedQuery")); - } - - /** - * @param declaringType - * @param nameAsString - * @param arguments - * @return - */ - @Override - public boolean isReadQuery(String declaringType, String nameAsString, Optional> arguments) { - return isCRUDQueryCreation(declaringType, nameAsString) && arguments.stream().anyMatch(args -> { - String query = args.get(0).toLowerCase(); - return query.startsWith("select"); - }); - } - - /** - * @param declaringType - * @param nameAsString - * @param arguments - * @return - */ - @Override - public boolean isWriteQuery(String declaringType, String nameAsString, Optional> arguments) { - return isCRUDQueryCreation(declaringType, nameAsString) && arguments.stream().anyMatch(args -> { - String query = args.get(0).toLowerCase(); - return query.startsWith("update") || query.startsWith("delete") || query.startsWith("insert"); - }); - } - - /** - * @param declaringType - * @param nameAsString - * @param arguments - * @return - */ - @Override - public boolean isNamedQuery(String declaringType, String nameAsString, Optional> arguments) { - return declaringType.endsWith("EntityManager") && nameAsString.equals("createNamedQuery"); - } -} diff --git a/src/main/java/com/ibm/cldk/javaee/jakarta/JakartaEntrypointFinder.java b/src/main/java/com/ibm/cldk/javaee/jakarta/JakartaEntrypointFinder.java deleted file mode 100644 index 91e5e9cf..00000000 --- a/src/main/java/com/ibm/cldk/javaee/jakarta/JakartaEntrypointFinder.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.ibm.cldk.javaee.jakarta; - -import com.github.javaparser.ast.NodeList; -import com.github.javaparser.ast.body.CallableDeclaration; -import com.github.javaparser.ast.body.ClassOrInterfaceDeclaration; -import com.github.javaparser.ast.body.Parameter; -import com.github.javaparser.ast.body.TypeDeclaration; -import com.github.javaparser.ast.type.ClassOrInterfaceType; -import com.ibm.cldk.javaee.utils.interfaces.AbstractEntrypointFinder; - -@SuppressWarnings({"unchecked", "rawtypes"}) -public class JakartaEntrypointFinder extends AbstractEntrypointFinder { - @Override - public boolean isEntrypointClass(TypeDeclaration typeDecl) { - if (!(typeDecl instanceof ClassOrInterfaceDeclaration)) { - return false; - } - - ClassOrInterfaceDeclaration classDecl = (ClassOrInterfaceDeclaration) typeDecl; - - // Check annotations - if (classDecl.getAnnotations().stream() - .anyMatch(a -> a.getNameAsString().contains("WebServlet") || a.getNameAsString().contains("WebFilter") - || a.getNameAsString().contains("WebListener") || a.getNameAsString().contains("ServerEndpoint") - || a.getNameAsString().contains("MessageDriven") - || a.getNameAsString().contains("WebService"))) { - return true; - } - - // Check types - return classDecl.getExtendedTypes().stream() - .map(ClassOrInterfaceType::getNameAsString) - .anyMatch(n -> n.contains("HttpServlet") || n.contains("GenericServlet")) - || classDecl.getImplementedTypes().stream().map( - ClassOrInterfaceType::asString).anyMatch( - n -> n.contains("ServletContextListener") - || n.contains("HttpSessionListener") - || n.contains("ServletRequestListener") - || n.contains("MessageListener")); - } - - @Override - public boolean isEntrypointMethod(CallableDeclaration callableDecl) { - return ((NodeList) callableDecl.getParameters()).stream() - .anyMatch(parameter -> parameter.getType().asString().contains("HttpServletRequest") || - parameter.getType().asString().contains("HttpServletResponse")); - } -} diff --git a/src/main/java/com/ibm/cldk/javaee/jax/JaxRsEntrypointFinder.java b/src/main/java/com/ibm/cldk/javaee/jax/JaxRsEntrypointFinder.java deleted file mode 100644 index 97d9f6cf..00000000 --- a/src/main/java/com/ibm/cldk/javaee/jax/JaxRsEntrypointFinder.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.ibm.cldk.javaee.jax; - -import com.github.javaparser.ast.body.CallableDeclaration; -import com.github.javaparser.ast.body.TypeDeclaration; -import com.ibm.cldk.javaee.utils.interfaces.AbstractEntrypointFinder; -import java.util.List; - -@SuppressWarnings({"unchecked", "rawtypes"}) -public class JaxRsEntrypointFinder extends AbstractEntrypointFinder { - /** - * Detect if the method is an entrypoint. - * - * @return True if the method is an entrypoint, false otherwise. - */ - @Override - public boolean isEntrypointClass(TypeDeclaration typeDeclaration) { - List callableDeclarations = typeDeclaration.findAll(CallableDeclaration.class); - for (CallableDeclaration callableDeclaration : callableDeclarations) { - if (callableDeclaration.getAnnotations().stream().anyMatch(a -> a.toString().contains("POST")) - || callableDeclaration.getAnnotations().stream().anyMatch(a -> a.toString().contains("PUT")) - || callableDeclaration.getAnnotations().stream().anyMatch(a -> a.toString().contains("GET")) - || callableDeclaration.getAnnotations().stream().anyMatch(a -> a.toString().contains("HEAD")) - || callableDeclaration.getAnnotations().stream().anyMatch(a -> a.toString().contains("DELETE"))) { - return true; - } - } - - return false; - } - - /** - * @param callableDecl - * @return - */ - @Override - public boolean isEntrypointMethod(CallableDeclaration callableDecl) { - return callableDecl.getAnnotations().stream().anyMatch(a -> a.toString().contains("POST") || a.toString().contains("PUT") - || a.toString().contains("GET") || a.toString().contains("HEAD") - || a.toString().contains("DELETE")); - } -} diff --git a/src/main/java/com/ibm/cldk/javaee/jdbc/JDBCCRUDFinder.java b/src/main/java/com/ibm/cldk/javaee/jdbc/JDBCCRUDFinder.java deleted file mode 100644 index 2a85ee47..00000000 --- a/src/main/java/com/ibm/cldk/javaee/jdbc/JDBCCRUDFinder.java +++ /dev/null @@ -1,98 +0,0 @@ -package com.ibm.cldk.javaee.jdbc; - -import com.ibm.cldk.javaee.utils.interfaces.AbstractCRUDFinder; -import java.util.List; -import java.util.Optional; - -public class JDBCCRUDFinder extends AbstractCRUDFinder { - /** - * Detect if the method call is a create operation. - * - * @param receiverType - * @param name - * @return - */ - @Override - public boolean isCreateOperation(String receiverType, String name) { - return false; - } - - /** - * Detect if the method call is a delete operation. - * - * @param receiverType - * @param name - * @return - */ - @Override - public boolean isDeleteOperation(String receiverType, String name) { - return false; - } - - /** - * Detect if the method call is an update operation. - * - * @param receiverType - * @param name - * @return - */ - @Override - public boolean isUpdateOperation(String receiverType, String name) { - return false; - } - - /** - * Detect if the method call is a read operation. - * - * @param receiverType - * @param name - * @return - */ - @Override - public boolean isReadOperation(String receiverType, String name) { - return false; - } - - /** - * @param declaringType - * @param methodName - * @return - */ - @Override - public boolean isCRUDQueryCreation(String declaringType, String methodName) { - return false; - } - - /** - * @param declaringType - * @param nameAsString - * @param arguments - * @return - */ - @Override - public boolean isReadQuery(String declaringType, String nameAsString, Optional> arguments) { - return false; - } - - /** - * @param declaringType - * @param nameAsString - * @param arguments - * @return - */ - @Override - public boolean isWriteQuery(String declaringType, String nameAsString, Optional> arguments) { - return false; - } - - /** - * @param declaringType - * @param nameAsString - * @param arguments - * @return - */ - @Override - public boolean isNamedQuery(String declaringType, String nameAsString, Optional> arguments) { - return false; - } -} diff --git a/src/main/java/com/ibm/cldk/javaee/spring/SpringCRUDFinder.java b/src/main/java/com/ibm/cldk/javaee/spring/SpringCRUDFinder.java deleted file mode 100644 index 2338980f..00000000 --- a/src/main/java/com/ibm/cldk/javaee/spring/SpringCRUDFinder.java +++ /dev/null @@ -1,99 +0,0 @@ -package com.ibm.cldk.javaee.spring; - -import com.ibm.cldk.javaee.utils.interfaces.AbstractCRUDFinder; -import java.util.List; -import java.util.Optional; - -public class SpringCRUDFinder extends AbstractCRUDFinder { - /** - * Detect if the method call is a create operation. - * - * @param receiverType The type of the receiver object. - * @param name The name of the method. - * @return True if the method call is a create operation, false otherwise. - */ - @Override - public boolean isCreateOperation(String receiverType, String name) { - return false; - } - - /** - * Detect if the method call is a delete operation. - * - * @param receiverType The type of the receiver object. - * @param name The name of the method. - * @return True if the method call is a delete operation, false otherwise. - */ - @Override - public boolean isDeleteOperation(String receiverType, String name) { - return false; - } - - /** - * Detect if the method call is an update operation. - * - * @param receiverType The type of the receiver object. - * @param name The name of the method. - * @return True if the method call is an update operation, false otherwise. - */ - @Override - public boolean isUpdateOperation(String receiverType, String name) { - return false; - } - - /** - * Detect if the method call is a read operation. - * - * @param receiverType The type of the receiver object. - * @param name The name of the method. - * @return True if the method call is a read operation, false otherwise. - */ - @Override - public boolean isReadOperation(String receiverType, String name) { - return false; - } - - /** - * @param declaringType - * @param methodName - * @return - */ - @Override - public boolean isCRUDQueryCreation(String declaringType, String methodName) { - return false; - } - - /** - * @param declaringType - * @param nameAsString - * @param arguments - * @return - */ - @Override - public boolean isReadQuery(String declaringType, String nameAsString, Optional> arguments) { - return false; - } - - /** - * @param declaringType - * @param nameAsString - * @param arguments - * @return - */ - @Override - public boolean isWriteQuery(String declaringType, String nameAsString, Optional> arguments) { - return false; - } - - /** - * @param declaringType - * @param nameAsString - * @param arguments - * @return - */ - @Override - public boolean isNamedQuery(String declaringType, String nameAsString, Optional> arguments) { - return false; - } - -} diff --git a/src/main/java/com/ibm/cldk/javaee/spring/SpringEntrypointFinder.java b/src/main/java/com/ibm/cldk/javaee/spring/SpringEntrypointFinder.java deleted file mode 100644 index 4f48ead2..00000000 --- a/src/main/java/com/ibm/cldk/javaee/spring/SpringEntrypointFinder.java +++ /dev/null @@ -1,69 +0,0 @@ -package com.ibm.cldk.javaee.spring; - -import com.github.javaparser.ast.body.CallableDeclaration; -import com.github.javaparser.ast.body.ClassOrInterfaceDeclaration; -import com.github.javaparser.ast.body.TypeDeclaration; -import com.github.javaparser.ast.expr.AnnotationExpr; -import com.github.javaparser.ast.type.ClassOrInterfaceType; -import com.ibm.cldk.javaee.utils.interfaces.AbstractEntrypointFinder; -import java.util.List; - -public class SpringEntrypointFinder extends AbstractEntrypointFinder { - @Override - public boolean isEntrypointClass(TypeDeclaration typeDeclaration) { - List annotations = typeDeclaration.getAnnotations(); - for (AnnotationExpr annotation : annotations) { - // Existing checks - if (annotation.getNameAsString().contains("RestController") - || annotation.getNameAsString().contains("Controller") - || annotation.getNameAsString().contains("HandleInterceptor") - || annotation.getNameAsString().contains("HandlerInterceptor")) { - return true; - } - - // Spring Boot specific checks - if (annotation.getNameAsString().contains("SpringBootApplication") - || annotation.getNameAsString().contains("Configuration") - || annotation.getNameAsString().contains("Component") - || annotation.getNameAsString().contains("Service") - || annotation.getNameAsString().contains("Repository")) { - return true; - } - } - - // Check if class implements CommandLineRunner or ApplicationRunner - if (typeDeclaration instanceof ClassOrInterfaceDeclaration) { - ClassOrInterfaceDeclaration classDecl = (ClassOrInterfaceDeclaration) typeDeclaration; - for (ClassOrInterfaceType implementedType : classDecl.getImplementedTypes()) { - String typeName = implementedType.getNameAsString(); - if (typeName.equals("CommandLineRunner") || typeName.equals("ApplicationRunner")) { - return true; - } - } - } - - return false; - } - - @Override - public boolean isEntrypointMethod(CallableDeclaration callableDecl) { return callableDecl.getAnnotations().stream().anyMatch(a -> a.toString().contains("GetMapping") || - a.toString().contains("PostMapping") || - a.toString().contains("PutMapping") || - a.toString().contains("DeleteMapping") || - a.toString().contains("PatchMapping") || - a.toString().contains("RequestMapping") || - a.toString().contains("EventListener") || - a.toString().contains("Scheduled") || - a.toString().contains("KafkaListener") || - a.toString().contains("RabbitListener") || - a.toString().contains("JmsListener") || - a.toString().contains("PreAuthorize") || - a.toString().contains("PostAuthorize") || - a.toString().contains("PostConstruct") || - a.toString().contains("PreDestroy") || - a.toString().contains("Around") || - a.toString().contains("Before") || - a.toString().contains("After") || - a.toString().contains("JobScope") || - a.toString().contains("StepScope")); } -} diff --git a/src/main/java/com/ibm/cldk/javaee/struts/StrutsEntrypointFinder.java b/src/main/java/com/ibm/cldk/javaee/struts/StrutsEntrypointFinder.java deleted file mode 100644 index a506364d..00000000 --- a/src/main/java/com/ibm/cldk/javaee/struts/StrutsEntrypointFinder.java +++ /dev/null @@ -1,67 +0,0 @@ -package com.ibm.cldk.javaee.struts; - -import com.github.javaparser.ast.Node; -import com.github.javaparser.ast.body.CallableDeclaration; -import com.github.javaparser.ast.body.ClassOrInterfaceDeclaration; -import com.github.javaparser.ast.body.TypeDeclaration; -import com.github.javaparser.ast.type.ClassOrInterfaceType; -import com.github.javaparser.resolution.UnsolvedSymbolException; -import com.github.javaparser.resolution.declarations.ResolvedReferenceTypeDeclaration; -import com.ibm.cldk.javaee.utils.interfaces.AbstractEntrypointFinder; -import com.ibm.cldk.utils.Log; -import java.util.Optional; - -public class StrutsEntrypointFinder extends AbstractEntrypointFinder { - @Override - public boolean isEntrypointClass(TypeDeclaration typeDeclaration){ - if (!(typeDeclaration instanceof ClassOrInterfaceDeclaration)) { - return false; - } - - ClassOrInterfaceDeclaration classDecl = (ClassOrInterfaceDeclaration) typeDeclaration; - - // Check class-level Struts annotations - if (classDecl.getAnnotations().stream().anyMatch(a -> a.getNameAsString().contains("Action") - || a.getNameAsString().contains("Namespace") || a.getNameAsString().contains("InterceptorRef"))) { - return true; - } - - // Check if extends ActionSupport or implements Interceptor - try { - ResolvedReferenceTypeDeclaration resolved = classDecl.resolve(); - return resolved.getAllAncestors().stream().anyMatch(ancestor -> { - String name = ancestor.getQualifiedName(); - return name.contains("ActionSupport") || name.contains("Interceptor"); - }); - } catch (RuntimeException e) { - Log.warn("Could not resolve class: " + e.getMessage()); - } - - return false; - } - - @Override - public boolean isEntrypointMethod(CallableDeclaration callableDecl) { - // First check if this method is in a Struts Action class - Optional parentNode = callableDecl.getParentNode(); - if (parentNode.isEmpty() || !(parentNode.get() instanceof ClassOrInterfaceDeclaration)) { - return false; - } - - ClassOrInterfaceDeclaration parentClass = (ClassOrInterfaceDeclaration) parentNode.get(); - if (parentClass.getExtendedTypes().stream() - .map(ClassOrInterfaceType::asString) - .noneMatch(type -> type.contains("ActionSupport") || type.contains("Action"))) - return false; - - return callableDecl.getAnnotations().stream().anyMatch(a -> a.toString().contains("Action") || - a.toString().contains("Actions") || - a.toString().contains("ValidationMethod") || - a.toString().contains("InputConfig") || - a.toString().contains("BeforeResult") || - a.toString().contains("After") || - a.toString().contains("Before") || - a.toString().contains("Result") || - a.toString().contains("Results")) || callableDecl.getNameAsString().equals("execute"); - } -} diff --git a/src/main/java/com/ibm/cldk/javaee/utils/enums/CRUDOperationType.java b/src/main/java/com/ibm/cldk/javaee/utils/enums/CRUDOperationType.java deleted file mode 100644 index 45375e73..00000000 --- a/src/main/java/com/ibm/cldk/javaee/utils/enums/CRUDOperationType.java +++ /dev/null @@ -1,8 +0,0 @@ -package com.ibm.cldk.javaee.utils.enums; - -public enum CRUDOperationType { - CREATE, - READ, - UPDATE, - DELETE; -} diff --git a/src/main/java/com/ibm/cldk/javaee/utils/enums/CRUDQueryType.java b/src/main/java/com/ibm/cldk/javaee/utils/enums/CRUDQueryType.java deleted file mode 100644 index 8f95f0f9..00000000 --- a/src/main/java/com/ibm/cldk/javaee/utils/enums/CRUDQueryType.java +++ /dev/null @@ -1,7 +0,0 @@ -package com.ibm.cldk.javaee.utils.enums; - -public enum CRUDQueryType { - READ, - WRITE, - NAMED; -} diff --git a/src/main/java/com/ibm/cldk/javaee/utils/enums/JPAQueryMethod.java b/src/main/java/com/ibm/cldk/javaee/utils/enums/JPAQueryMethod.java deleted file mode 100644 index 25d666fb..00000000 --- a/src/main/java/com/ibm/cldk/javaee/utils/enums/JPAQueryMethod.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.ibm.cldk.javaee.utils.enums; - -import com.ibm.cldk.utils.annotations.Note; -import java.util.Optional; -import lombok.Getter; - -@Getter -public enum JPAQueryMethod { - // Read Operations - GET_RESULT_LIST(CRUDOperationType.READ), - GET_SINGLE_RESULT(CRUDOperationType.READ), - GET_FIRST_RESULT(CRUDOperationType.READ), - GET_MAX_RESULTS(CRUDOperationType.READ), - - // Write Operations - @Note("There is a possiblity that the user may execute a delete action using the executeUpdate method. There is no way to differentiate between an update and delete operation without doing a dataflow analysis on the query string because the query string may be defined anywhere in the code. So for now, we are assuming that executeUpdate is an update operation.") - EXECUTE_UPDATE(CRUDOperationType.UPDATE), - - // Non-CRUD Methods (configuration or metadata) - GET_FLUSH_MODE(null), - GET_HINTS(null), - GET_LOCK_MODE(null), - GET_PARAMETER(null), - GET_PARAMETERS(null), - GET_PARAMETER_VALUE(null), - IS_BOUND(null), - UNWRAP(null); - - private final CRUDOperationType crudOperation; - - JPAQueryMethod(CRUDOperationType crudOperation) { - this.crudOperation = crudOperation; - } - - public static Optional getOperationForMethod(String methodName) { - try { - // A small hack to convert camelCase to snake_case and also to uppercase. Basically, we want getSingleResult to get converted to GET_SINGLE_RESULT so as to - // match the enum values conventions. - return Optional.ofNullable(JPAQueryMethod.valueOf(methodName.replaceAll("([a-z])([A-Z]+)", "$1_$2").toUpperCase()).getCrudOperation()); - } catch (IllegalArgumentException e) { - return Optional.empty(); - } - } -} diff --git a/src/main/java/com/ibm/cldk/javaee/utils/interfaces/AbstractCRUDFinder.java b/src/main/java/com/ibm/cldk/javaee/utils/interfaces/AbstractCRUDFinder.java deleted file mode 100644 index 02a331f4..00000000 --- a/src/main/java/com/ibm/cldk/javaee/utils/interfaces/AbstractCRUDFinder.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.ibm.cldk.javaee.utils.interfaces; - -import java.util.List; -import java.util.Optional; - -/** - * Abstract base class for finding CRUD operations in various frameworks. - */ -@SuppressWarnings("OptionalUsedAsFieldOrParameterType") -public abstract class AbstractCRUDFinder { - public abstract boolean isCreateOperation(String receiverType, String methodName); - - public abstract boolean isDeleteOperation(String receiverType, String methodName); - - public abstract boolean isUpdateOperation(String receiverType, String methodName); - - public abstract boolean isReadOperation(String receiverType, String methodName); - - // Detect CRUD Query Creation (Only query definitions, not execution) - public abstract boolean isCRUDQueryCreation(String declaringType, String methodName); - - public abstract boolean isReadQuery(String declaringType, String nameAsString, Optional> arguments); - - public abstract boolean isWriteQuery(String declaringType, String nameAsString, Optional> arguments); - - public abstract boolean isNamedQuery(String declaringType, String nameAsString, Optional> arguments); -} diff --git a/src/main/java/com/ibm/cldk/javaee/utils/interfaces/AbstractEntrypointFinder.java b/src/main/java/com/ibm/cldk/javaee/utils/interfaces/AbstractEntrypointFinder.java deleted file mode 100644 index 7fca2d2f..00000000 --- a/src/main/java/com/ibm/cldk/javaee/utils/interfaces/AbstractEntrypointFinder.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.ibm.cldk.javaee.utils.interfaces; - -import com.github.javaparser.ast.body.CallableDeclaration; -import com.github.javaparser.ast.body.TypeDeclaration; -import com.ibm.cldk.utils.annotations.NotImplemented; - -@SuppressWarnings({"unchecked", "rawtypes"}) -public abstract class AbstractEntrypointFinder { - /** - * Enum for rules. - */ - enum Rulset{ - } - - /** - * Detect if the method is an entrypoint. - * - * @param receiverType The type of the receiver object. - * @param name The name of the method. - * @return True if the method is an entrypoint, false otherwise. - */ - public abstract boolean isEntrypointClass(TypeDeclaration typeDecl); - - public abstract boolean isEntrypointMethod(CallableDeclaration callableDecl); -} diff --git a/src/main/java/com/ibm/cldk/utils/AnalysisUtils.java b/src/main/java/com/ibm/cldk/utils/AnalysisUtils.java deleted file mode 100644 index ab4e5285..00000000 --- a/src/main/java/com/ibm/cldk/utils/AnalysisUtils.java +++ /dev/null @@ -1,204 +0,0 @@ -/* -Copyright IBM Corporation 2023, 2024 - -Licensed under the Apache Public License 2.0, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. - */ -package com.ibm.cldk.utils; - -import static com.ibm.cldk.SymbolTable.declaredMethodsAndConstructors; - -import com.ibm.cldk.entities.Callable; -import com.ibm.cldk.entities.Comment; -import com.ibm.cldk.entities.ParameterInCallable; -import com.ibm.wala.classLoader.IClass; -import com.ibm.wala.classLoader.IMethod; -import com.ibm.wala.ipa.callgraph.CallGraph; -import com.ibm.wala.ipa.callgraph.Entrypoint; -import com.ibm.wala.ipa.callgraph.impl.DefaultEntrypoint; -import com.ibm.wala.ipa.cha.IClassHierarchy; -import com.ibm.wala.ssa.IR; -import com.ibm.wala.ssa.ISSABasicBlock; -import com.ibm.wala.ssa.SSAConditionalBranchInstruction; -import com.ibm.wala.ssa.SSASwitchInstruction; -import com.ibm.wala.types.ClassLoaderReference; -import java.util.*; -import java.util.stream.Collectors; -import java.util.stream.Stream; -import java.util.stream.StreamSupport; -import org.apache.commons.lang3.tuple.Pair; -import org.objectweb.asm.Type; - -/** - * The type Analysis utils. - */ -public class AnalysisUtils { - - /** - * The constant classAttr. - */ - public static Map createAndPutNewCallableInSymbolTable(IMethod method) { - // Get the class name, with a . representation. - String declaringClassSignature = method.getDeclaringClass().getName().toString().substring(1).replace("/", ".").replace("$", "."); - - // Get the method arguments, use a . notation for types. - List arguments = Arrays.stream(Type.getMethodType(method.getDescriptor().toString()).getArgumentTypes()).map(Type::getClassName).collect(Collectors.toList()); - - String methodName = method.getName().toString(); - - // Get the method signature. - String methodSignature = String.join("", methodName, "(", String.join(", ", Optional.of(arguments).orElseGet(Collections::emptyList)), ")"); - - Callable newCallable = new Callable(); - newCallable.setFilePath(""); - newCallable.setImplicit(true); - newCallable.setConstructor(methodName.contains("")); - newCallable.setComments(new ArrayList<>()); - newCallable.setModifiers(Stream.of(method.isPublic() ? "public" : null, method.isProtected() ? "protected" : null, method.isPrivate() ? "private" : null, method.isAbstract() ? "abstract" : null, method.isStatic() ? "static" : null, method.isFinal() ? "final" : null, method.isSynchronized() ? "synchronized" : null, method.isNative() ? "native" : null, method.isSynthetic() ? "synthetic" : null, method.isBridge() ? "bridge" : null).filter(Objects::nonNull).collect(Collectors.toList())); - newCallable.setCode(""); - newCallable.setSignature(methodSignature); - newCallable.setDeclaration(methodSignature); - newCallable.setEndLine(-1); - newCallable.setStartLine(-1); - newCallable.setParameters(Arrays.stream(Type.getMethodType(method.getDescriptor().toString()).getArgumentTypes()).map(param -> { - ParameterInCallable parameter = new ParameterInCallable(); - parameter.setType(param.getClassName()); - parameter.setName(null); - parameter.setModifiers(Collections.emptyList()); - parameter.setAnnotations(Collections.emptyList()); - return parameter; - }).collect(Collectors.toList())); - newCallable.setReferencedTypes(Collections.emptyList()); - newCallable.setAnnotations(method.getAnnotations().stream().map(annotation -> annotation.toString().replace("[", "(").replace("]", ")").replace("Annotation type ", "@")).collect(Collectors.toList())); - - declaredMethodsAndConstructors.put(declaringClassSignature, methodSignature, newCallable); - String signature = newCallable.getSignature(); - if (signature.contains("")) { - signature = signature.replace("", declaringClassSignature.substring(declaringClassSignature.lastIndexOf(".") + 1)); - } else if (signature.contains("")) { - signature = signature.replace("", declaringClassSignature.substring(declaringClassSignature.lastIndexOf(".") + 1)); - } - return Map.ofEntries( - Map.entry("typeDeclaration", declaringClassSignature), - Map.entry("filePath", "<>"), - Map.entry("signature", signature), - Map.entry("callableDeclaration", newCallable.getDeclaration()) - ); - } - - /** - * Computes and returns cyclomatic complexity for the given IR (for a method - * or constructor). - * - * @param ir IR for method or constructor - * @return int Cyclomatic complexity for method/constructor - */ - public static int getCyclomaticComplexity(IR ir) { - if (ir == null) { - return 0; - } - int conditionalBranchCount = (int) Arrays.stream(ir.getInstructions()) - .filter(inst -> inst instanceof SSAConditionalBranchInstruction) - .count(); - int switchBranchCount = Arrays.stream(ir.getInstructions()) - .filter(inst -> inst instanceof SSASwitchInstruction) - .map(inst -> ((SSASwitchInstruction) inst).getCasesAndLabels().length).reduce(0, Integer::sum); - Iterable iterableBasicBlocks = ir::getBlocks; - int catchBlockCount = (int) StreamSupport.stream(iterableBasicBlocks.spliterator(), false) - .filter(ISSABasicBlock::isCatchBlock) - .count(); - return conditionalBranchCount + switchBranchCount + catchBlockCount + 1; - } - - public static Map getCallableFromSymbolTable(IMethod method) { - - // Get the class name, with a . representation. - String declaringClassSignature = method.getDeclaringClass().getName().toString().substring(1).replace("/", ".").replace("$", "."); - - // Get the method arguments, use a . notation for types. - List arguments = Arrays.stream(Type.getMethodType(method.getDescriptor().toString()).getArgumentTypes()).map(Type::getClassName).collect(Collectors.toList()); - - // Get the method signature. - String methodSignature = String.join("", method.getName().toString(), "(", String.join(", ", Optional.of(arguments).orElseGet(Collections::emptyList)), ")"); - Callable callable = declaredMethodsAndConstructors.get(declaringClassSignature, methodSignature); - - if (callable == null) { - return null; - } else { - String signature = callable.getSignature(); - if (signature.contains("")) { - signature = signature.replace("", declaringClassSignature.substring(declaringClassSignature.lastIndexOf(".") + 1)); - } else if (signature.contains("")) { - signature = signature.replace("", declaringClassSignature.substring(declaringClassSignature.lastIndexOf(".") + 1)); - } - return Map.ofEntries( - Map.entry("typeDeclaration", declaringClassSignature), - Map.entry("filePath", callable.getFilePath()), - Map.entry("signature", signature), - Map.entry("callableDeclaration", callable.getSignature()) - ); - } - } - - public static Pair getCallableObjectFromSymbolTable(IMethod method) { - - // Get the class name, with a . representation. - String declaringClassSignature = method.getDeclaringClass().getName().toString().substring(1).replace("/", ".").replace("$", "."); - - // Get the method arguments, use a . notation for types. - List arguments = Arrays.stream(Type.getMethodType(method.getDescriptor().toString()).getArgumentTypes()).map(Type::getClassName).collect(Collectors.toList()); - - // Get the method signature. - String methodSignature = String.join("", method.getName().toString(), "(", String.join(", ", Optional.of(arguments).orElseGet(Collections::emptyList)), ")"); - - return Pair.of(declaringClassSignature, declaredMethodsAndConstructors.get(declaringClassSignature, methodSignature)); - } - - - /** - * Verfy if a class is an application class. - * - * @param _class the class - * @return Boolean boolean - */ - public static Boolean isApplicationClass(IClass _class) { - return _class.getClassLoader().getReference().equals(ClassLoaderReference.Application); - } - - /** - * Gets number of application classes. - * - * @param cha the cha - * @return the number of application classes - */ - public static long getNumberOfApplicationClasses(IClassHierarchy cha) { - return StreamSupport.stream(cha.spliterator(), false).filter(AnalysisUtils::isApplicationClass).count(); - } - - /** - * Use all public methods of all application classes as entrypoints. - * - * @param cha the cha - * @return Iterable entry points - */ - public static Iterable getEntryPoints(IClassHierarchy cha) { - List entrypoints = StreamSupport.stream(cha.spliterator(), true).filter(AnalysisUtils::isApplicationClass).flatMap(c -> { - try { - return c.getDeclaredMethods().stream(); - } catch (NullPointerException nullPointerException) { - Log.error(c.getSourceFileName()); - System.exit(1); - return Stream.empty(); - } - }).map(method -> new DefaultEntrypoint(method, cha)).collect(Collectors.toList()); - // We're assuming that all methods are potential entrypoints. May revisit this later if the assumption is incorrect. - Log.info("Registered " + entrypoints.size() + " entrypoints."); - return entrypoints; - } -} diff --git a/src/main/java/com/ibm/cldk/utils/BuildProject.java b/src/main/java/com/ibm/cldk/utils/BuildProject.java deleted file mode 100644 index 53dcd649..00000000 --- a/src/main/java/com/ibm/cldk/utils/BuildProject.java +++ /dev/null @@ -1,304 +0,0 @@ -package com.ibm.cldk.utils; - -import static com.ibm.cldk.CodeAnalyzer.includeTestClasses; -import static com.ibm.cldk.CodeAnalyzer.noCleanDependencies; -import static com.ibm.cldk.CodeAnalyzer.projectRootPom; -import static com.ibm.cldk.utils.ProjectDirectoryScanner.classFilesStream; - -import java.io.BufferedReader; -import java.io.File; -import java.io.IOException; -import java.io.InputStreamReader; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.text.MessageFormat; -import java.util.*; -import java.util.function.Predicate; -import java.util.stream.Stream; - -public class BuildProject { - public static Path libDownloadPath; - private static final String LIB_DEPS_DOWNLOAD_DIR = "_library_dependencies"; - private static final String MAVEN_CMD = BuildProject.getMavenCommand(); - private static final String GRADLE_CMD = BuildProject.getGradleCommand(); - - /** - * Gets the maven command to be used for building the project. - * - * @return the maven command - */ - public static String getMavenCommand() { - String mvnSystemCommand = Arrays.stream(System.getenv("PATH").split(File.pathSeparator)).filter(Predicate.not(String::isBlank)).filter(Predicate.not(String::isEmpty)).map(path -> new File(path, System.getProperty("os.name").toLowerCase().contains("windows") ? "mvn.cmd" : "mvn")).filter(File::exists).findFirst().map(File::getAbsolutePath).orElse(null); - File mvnWrapper = System.getProperty("os.name").toLowerCase().contains("windows") ? new File(projectRootPom, "mvnw.cmd") : new File(projectRootPom, "mvnw"); - return commandExists(mvnWrapper.getAbsoluteFile()).getKey() ? mvnWrapper.getAbsoluteFile().toString() : mvnSystemCommand; - } - - /** - * Gets the gradle command to be used for building the project. - * - * @return the gradle command - */ - public static String getGradleCommand() { - String gradleSystemCommand = Arrays.stream(System.getenv("PATH").split(File.pathSeparator)).filter(Predicate.not(String::isBlank)).filter(Predicate.not(String::isEmpty)).map(path -> new File(path, System.getProperty("os.name").toLowerCase().contains("windows") ? "gradle.bat" : "gradle")).filter(File::exists).findFirst().map(File::getAbsolutePath).orElse(null); - File gradleWrapper = System.getProperty("os.name").toLowerCase().contains("windows") ? new File(projectRootPom, "gradlew.bat") : new File(projectRootPom, "gradlew"); - - return commandExists(gradleWrapper.getAbsoluteFile()).getKey() ? gradleWrapper.getAbsoluteFile() .toString() : gradleSystemCommand; - } - - public static Path tempInitScript; - - static { - try { - tempInitScript = Files.createTempFile("gradle-init-", ".gradle"); - } catch (IOException e) { - throw new RuntimeException(e); - } - } - - private static final String GRADLE_DEPENDENCIES_TASK = "allprojects { afterEvaluate { project -> task downloadDependencies(type: Copy) { def configs = project.configurations.findAll { it.canBeResolved }; dependsOn configs; from configs; into project.hasProperty('outputDir') ? project.property('outputDir') : \"${project.buildDir}/libs\"; eachFile { fileCopyDetails -> fileCopyDetails.file.setWritable(true) }; doFirst { println \"Downloading dependencies for project ${project.name} to: ${destinationDir}\"; configs.each { config -> println \"Configuration: ${config.name}\"; config.resolvedConfiguration.resolvedArtifacts.each { artifact -> println \"\\t${artifact.moduleVersion.id}:${artifact.extension}\" } } } } } }"; - private static AbstractMap.SimpleEntry commandExists(File command) { - StringBuilder output = new StringBuilder(); - if (!command.exists()) { - return new AbstractMap.SimpleEntry<>(false, MessageFormat.format("Command {0} does not exist.", command)); - } - try { - Process process = new ProcessBuilder().directory(new File(projectRootPom)).command(String.valueOf(command), "--version").start(); - // Read the output stream - BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream())); - String line; - while ((line = reader.readLine()) != null) { - output.append(line).append("\n"); - } - - // Read the error stream - BufferedReader errorReader = new BufferedReader(new InputStreamReader(process.getErrorStream())); - while ((line = errorReader.readLine()) != null) { - output.append(line).append("\n"); - } - - int exitCode = process.waitFor(); - return new AbstractMap.SimpleEntry<>(exitCode == 0, output.toString().trim()); - } catch (IOException | InterruptedException exceptions) { - Log.error(exceptions.getMessage()); - return new AbstractMap.SimpleEntry<>(false, exceptions.getMessage()); - } - } - - private static boolean buildWithTool(String[] buildCommand) { - Log.info("Building the project using " + buildCommand[0] + "."); - ProcessBuilder processBuilder = new ProcessBuilder().directory(new File(projectRootPom)).command(buildCommand); - try { - Process process = processBuilder.start(); - BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream())); - String line; - while ((line = reader.readLine()) != null) { - Log.info(line); - } - int exitCode = process.waitFor(); - process.getErrorStream().transferTo(System.err); - Log.info(buildCommand[0].toUpperCase() + " build exited with code " + exitCode); - return exitCode == 0; - } catch (IOException | InterruptedException e) { - e.printStackTrace(); - return false; - } - } - - /** - * Checks if Maven is installed in the system. - * - * @return true if Maven is installed, false otherwise. - */ - private static boolean isMavenInstalled() { - ProcessBuilder processBuilder = new ProcessBuilder().directory(new File(projectRootPom)).command(MAVEN_CMD, "--version"); - try { - Process process = processBuilder.start(); - BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream())); - String line = reader.readLine(); // Read the first line of the output - if (line != null && line.contains("Apache Maven")) { - return true; - } - } catch (IOException e) { - Log.error("An error occurred while checking if Maven is installed: " + e.getMessage()); - } - Log.error("Maven is not installed or not properly configured in the system's PATH."); - return false; - } - - /** - * Initiates a maven build process for the given project path. - * - * @param projectPath is the path to the project to be built. - * @return true if the build was successful, false otherwise. - */ - private static boolean mavenBuild(String projectPath) { - Log.info("Building the project using Maven."); - if (!isMavenInstalled()) { - Log.info("Checking if Maven is installed."); - return false; - } - - String[] mavenCommand; - if (includeTestClasses) { - Log.warn("Hidden flag `--include-test-classes` is turned on. We'll including test classes in WALA analysis"); - mavenCommand = new String[]{MAVEN_CMD, "test-compile", "-f", projectPath + "/pom.xml", "-B", "-V", "-e", "-Drat.skip", "-Dfindbugs.skip", "-Dcheckstyle.skip", "-Dpmd.skip=true", "-Dspotbugs.skip", "-Denforcer.skip", "-Dmaven.javadoc.skip", "-DskipTests", "-Dmaven.test.skip.exec", "-Dlicense.skip=true", "-Drat.skip=true", "-Dspotless.check.skip=true"}; - } - else - mavenCommand = new String[]{MAVEN_CMD, "compile", "-f", projectPath + "/pom.xml", "-B", "-V", "-e", "-Drat.skip", "-Dfindbugs.skip", "-Dcheckstyle.skip", "-Dpmd.skip=true", "-Dspotbugs.skip", "-Denforcer.skip", "-Dmaven.javadoc.skip", "-DskipTests", "-Dmaven.test.skip.exec", "-Dlicense.skip=true", "-Drat.skip=true", "-Dspotless.check.skip=true"}; - - return buildWithTool(mavenCommand); - } - - public static boolean gradleBuild(String projectPath) { - // Adjust Gradle command as needed - String[] gradleCommand; - if (GRADLE_CMD.equals("gradlew") || GRADLE_CMD.equals("gradlew.bat")) { - gradleCommand = new String[]{projectPath + File.separator + GRADLE_CMD, "compileJava", "-p", projectPath}; - } else { - if (includeTestClasses) { - Log.warn("Hidden flag `--include-test-classes` is turned on. We'll including test classes in WALA analysis"); - gradleCommand = new String[]{GRADLE_CMD, "compileTestJava", "-p", projectPath}; - } - else - gradleCommand = new String[]{GRADLE_CMD, "compileJava", "-p", projectPath}; - } - return buildWithTool(gradleCommand); - } - - private static boolean buildProject(String projectPath, String build) { - File pomFile = new File(String.valueOf(Paths.get(projectPath).toAbsolutePath()), "pom.xml"); - if (build == null) { - return true; - } else if (build.equals("auto")) { - if (pomFile.exists()) { - Log.info("Found pom.xml in the project directory. Using Maven to build the project."); - return mavenBuild(Paths.get(projectPath).toAbsolutePath().toString()); // Use Maven if pom.xml exists - } else { - Log.info("Did not find a pom.xml in the project directory. Using Gradle to build the project."); - return gradleBuild(projectPath); // Otherwise, use Gradle - } - } else { - // Update command with a project path - build = build.replace(MAVEN_CMD, MAVEN_CMD + " -f " + projectPath); - Log.info("Using custom build command: " + build); - String[] customBuildCommand = build.split(" "); - return buildWithTool(customBuildCommand); - } - } - - /** - * Streams the files in the given project path. - * - * @param projectPath is the path to the project to be streamed. - * @return true if the streaming was successful, false otherwise. - */ - public static List buildProjectAndStreamClassFiles(String projectPath, String build) throws IOException { - return buildProject(projectPath, build) ? classFilesStream(projectPath) : new ArrayList<>(); - } - - private static boolean mkLibDepDirs(String projectPath) { - if (!Files.exists(libDownloadPath)) { - try { - Files.createDirectories(libDownloadPath); - } catch (IOException e) { - Log.error("Error creating library dependency directory for " + projectPath + ": " + e.getMessage()); - return false; - } - } - return true; - } - /** - * Downloads library dependency jars of the given project so that the jars can be used - * for type resolution during symbol table creation. - * - * @param projectPath Path to the project under javaee - * @return true if dependency download succeeds; false otherwise - */ - public static boolean downloadLibraryDependencies(String projectPath, String projectRootPom) throws IOException { - // created download dir if it does not exist - String projectRoot = projectRootPom != null ? projectRootPom : projectPath; - - File pomFile = new File((new File(projectRoot)).getAbsoluteFile(), "pom.xml"); - if (pomFile.exists()) { - libDownloadPath = Paths.get(projectPath, "target", LIB_DEPS_DOWNLOAD_DIR).toAbsolutePath(); - if (mkLibDepDirs(projectPath)) - Log.debug("Dependencies found/created in " + libDownloadPath); - else - throw new IllegalStateException("Error creating library dependency directory in " + libDownloadPath); - - if (MAVEN_CMD == null || !commandExists(new File(MAVEN_CMD)).getKey()) { - String msg = MAVEN_CMD == null ? - "Could not find Maven or a valid Maven Wrapper" : - MessageFormat.format("Could not verify that {0} exists", MAVEN_CMD); - Log.error(msg); - throw new IllegalStateException("Unable to execute Maven command. " + - (MAVEN_CMD == null ? - "Could not find Maven or a valid Maven Wrapper" : - "Attempt failed with message\n" + commandExists(new File(MAVEN_CMD)).getValue() - )); - } - Log.info("Found pom.xml in the project directory. Using Maven to download dependencies."); - String[] mavenCommand = {MAVEN_CMD, "--no-transfer-progress", "-f", Paths.get(projectRoot, "pom.xml").toAbsolutePath().toString(), "dependency:copy-dependencies", "-DoutputDirectory=" + libDownloadPath.toString(), "-Doverwrite=true", "--fail-never"}; - return buildWithTool(mavenCommand); - } else if (new File(projectRoot, "build.gradle").exists() || new File(projectRoot, "build.gradle.kts").exists()) { - libDownloadPath = Paths.get(projectPath, "build", LIB_DEPS_DOWNLOAD_DIR).toAbsolutePath(); - if (mkLibDepDirs(projectPath)) - Log.debug("Dependencies found/created in " + libDownloadPath); - else - throw new IllegalStateException("Error creating library dependency directory in " + libDownloadPath); - - if (GRADLE_CMD == null || !commandExists(new File(GRADLE_CMD)).getKey()) { - String msg = GRADLE_CMD == null ? - "Could not find Gradle or valid Gradle Wrapper" : - MessageFormat.format("Could not verify that {0} exists", GRADLE_CMD); - Log.error(msg); - throw new IllegalStateException("Unable to execute Gradle command. " + - (GRADLE_CMD == null ? - "Could not find Gradle or valid Gradle Wrapper" : - "Attempt failed with message\n" + commandExists(new File(GRADLE_CMD)).getValue() - )); - } - Log.info("Found build.gradle or build.gradle.kts in the project directory. Using Gradle to download dependencies."); - tempInitScript = Files.writeString(tempInitScript, GRADLE_DEPENDENCIES_TASK); - String[] gradleCommand; - if (GRADLE_CMD.equals("gradlew") || GRADLE_CMD.equals("gradlew.bat")) { - gradleCommand = new String[]{projectRoot + File.separator + GRADLE_CMD, "--init-script", tempInitScript.toFile().getAbsolutePath(), "downloadDependencies", "-PoutputDir=" + libDownloadPath.toString()}; - } else { - gradleCommand = new String[]{GRADLE_CMD, "--init-script", tempInitScript.toFile().getAbsolutePath(), "downloadDependencies", "-PoutputDir=" + libDownloadPath.toString()}; - } - return buildWithTool(gradleCommand); - } - return false; - } - - public static void cleanLibraryDependencies() { - if (noCleanDependencies) { - return; - } - if (libDownloadPath != null) { - Log.info("Cleaning up library dependency directory: " + libDownloadPath); - try { - if (libDownloadPath.toFile().getAbsoluteFile().exists()) { - try (Stream paths = Files.walk(libDownloadPath)) { - paths.sorted(Comparator.reverseOrder()) // Delete files first, then directories - .map(Path::toFile) - .forEach(file -> { - if (!file.delete()) - Log.warn("Failed to delete: " + file.getAbsolutePath()); - }); - } - } - } catch (IOException e) { - Log.warn("Unable to fully delete library dependency directory: " + e.getMessage()); - } - } - if (tempInitScript != null) { - try { - Files.delete(tempInitScript); - } catch (IOException e) { - Log.warn("Error deleting temporary Gradle init script: " + e.getMessage()); - } - } - } -} diff --git a/src/main/java/com/ibm/cldk/utils/Log.java b/src/main/java/com/ibm/cldk/utils/Log.java deleted file mode 100644 index d0946ee1..00000000 --- a/src/main/java/com/ibm/cldk/utils/Log.java +++ /dev/null @@ -1,135 +0,0 @@ -/* -Copyright IBM Corporation 2023, 2024 - -Licensed under the Apache Public License 2.0, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package com.ibm.cldk.utils; - -import java.time.LocalDateTime; - -/** - * The type Log. - */ -public class Log { - /** - * The constant ANSI_RESET. - */ - public static final String ANSI_RESET = "\u001B[0m"; - /** - * The constant ANSI_BLACK. - */ - public static final String ANSI_BLACK = "\u001B[30m"; - /** - * The constant ANSI_RED. - */ - public static final String ANSI_RED = "\u001B[31m"; - /** - * The constant ANSI_GREEN. - */ - public static final String ANSI_GREEN = "\u001B[32m"; - /** - * The constant ANSI_YELLOW. - */ - public static final String ANSI_YELLOW = "\u001B[33m"; - /** - * The constant ANSI_BLUE. - */ - public static final String ANSI_BLUE = "\u001B[34m"; - /** - * The constant ANSI_PURPLE. - */ - public static final String ANSI_PURPLE = "\u001B[35m"; - /** - * The constant ANSI_CYAN. - */ - public static final String ANSI_CYAN = "\u001B[36m"; - /** - * The constant ANSI_WHITE. - */ - public static final String ANSI_WHITE = "\u001B[37m"; - private static boolean verbose = true; - - /** - * Set verbose setting to on or off. - * - * @param val True or false. - */ - public static final void setVerbosity(boolean val) { - verbose = val; - } - - /** - * Is verbosity turned on/off - * - * @return Boolean boolean - */ - public static final boolean isVerbose() { - return verbose; - } - - /** - * Info. - * - * @param msg the msg - */ - public static final void info(String msg) { - toConsole(msg, ANSI_PURPLE, "INFO"); - } - - /** - * Done. - * - * @param msg the msg - */ - public static final void done(String msg) { - toConsole(msg, ANSI_GREEN, "DONE"); - } - - /** - * Debug. - * - * @param msg the msg - */ - public static final void debug(String msg) { - toConsole(msg, ANSI_YELLOW, "DEBUG"); - } - - /** - * Warn. - * - * @param msg the msg - */ - public static final void warn(String msg) { - toConsole(msg, ANSI_YELLOW, "WARN"); - } - - /** - * Error. - * - * @param msg the msg - */ - public static final void error(String msg) { - toConsole(msg, ANSI_RED, "ERROR"); - } - - /** - * Print log message to console - * - * @param msg to print to console - */ - private static void toConsole(String msg, String ansi_color, String Level) { - if (isVerbose()) { - LocalDateTime localDateTime = LocalDateTime.now(); - System.out.println( - ANSI_CYAN + localDateTime + ANSI_RESET + ansi_color + "\t[" + Level + "]\t" + ANSI_RESET + msg); - } - } -} diff --git a/src/main/java/com/ibm/cldk/utils/ProjectDirectoryScanner.java b/src/main/java/com/ibm/cldk/utils/ProjectDirectoryScanner.java deleted file mode 100644 index 9a64edf7..00000000 --- a/src/main/java/com/ibm/cldk/utils/ProjectDirectoryScanner.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.ibm.cldk.utils; - -import java.io.IOException; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.util.ArrayList; -import java.util.List; -import java.util.stream.Collectors; -import java.util.stream.Stream; - -public class ProjectDirectoryScanner { - public static List classFilesStream(String projectPath) throws IOException { - Path projectDir = Paths.get(projectPath).toAbsolutePath(); - Log.info("Finding *.class files in " + projectDir); - if (Files.exists(projectDir)) { - try (Stream paths = Files.walk(projectDir)) { - return paths.filter(file -> !Files.isDirectory(file) && file.toString().endsWith(".class")) - .collect(Collectors.toList()); - } - } - return null; - } - - public static List jarFilesStream(String projectPath) throws IOException { - Path projectDir = Paths.get(projectPath); - Log.info("Finding *.jar files in " + projectDir); - if (Files.exists(projectDir)) { - try (Stream paths = Files.walk(projectDir)) { - return paths - .filter(file -> !Files.isDirectory(file) && file.toString().endsWith(".jar")) - .collect(Collectors.toList()); - } - } - return new ArrayList<>(); - } - - public static List sourceFilesStream(String projectPath) throws IOException { - Path projectDir = Paths.get(projectPath); - Log.info("Finding *.java files in " + projectDir); - if (Files.exists(projectDir)) { - try (Stream paths = Files.walk(projectDir)) { - return paths - .filter(file -> !Files.isDirectory(file)) - .filter(file -> file.toString().endsWith(".java")) - .filter(file -> !file.toAbsolutePath().toString().contains("build/")) - .filter(file -> !file.toAbsolutePath().toString().contains("target/")) - .filter(file -> !file.toAbsolutePath().toString().contains("main/resources/")) - .filter(file -> !file.toAbsolutePath().toString().contains("test/resources/")) - .collect(Collectors.toList()); - } - } - return null; - } - -} diff --git a/src/main/java/com/ibm/cldk/utils/ScopeUtils.java b/src/main/java/com/ibm/cldk/utils/ScopeUtils.java deleted file mode 100644 index 25db185c..00000000 --- a/src/main/java/com/ibm/cldk/utils/ScopeUtils.java +++ /dev/null @@ -1,136 +0,0 @@ -/* -Copyright IBM Corporation 2023, 2024 - -Licensed under the Apache Public License 2.0, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package com.ibm.cldk.utils; - -import static com.ibm.cldk.utils.ProjectDirectoryScanner.jarFilesStream; - -import com.ibm.wala.cast.java.ipa.callgraph.JavaSourceAnalysisScope; -import com.ibm.wala.ipa.callgraph.AnalysisScope; -import com.ibm.wala.shrike.shrikeCT.InvalidClassFileException; -import com.ibm.wala.types.ClassLoaderReference; -import com.ibm.wala.util.config.FileOfClasses; -import java.io.ByteArrayInputStream; -import java.io.IOException; -import java.nio.charset.StandardCharsets; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.util.List; -import java.util.Objects; -import java.util.UUID; -import java.util.jar.JarFile; -import org.apache.commons.io.FileUtils; - -public class ScopeUtils { - - private static final String EXCLUSIONS = ""; - - /** - * The Std libs. - */ - public static String[] stdLibs; - - /** - * Create an javaee scope base on the input - * - * @param projectPath The root directory of the project to be analyzed. - * @return scope The created javaee scope - * @throws IOException the io exception - */ - /** - * Create an javaee scope base on the input - * - * @param projectPath The root directory of the project to be analyzed. - * @param applicationDeps the application deps - * @return scope The created javaee scope - * @throws IOException the io exception - */ - public static AnalysisScope createScope(String projectPath, String applicationDeps, String build) - throws IOException { - Log.info("Create javaee scope."); - AnalysisScope scope = new JavaSourceAnalysisScope(); - addDefaultExclusions(scope); - - Log.info("Loading Java SE standard libs."); - - if (System.getenv("JAVA_HOME") == null) { - Log.error("JAVA_HOME is not set."); - throw new RuntimeException("JAVA_HOME is not set."); - } - - String[] stdlibs = Files.walk(Paths.get(System.getenv("JAVA_HOME"), "jmods")) - .filter(path -> path.toString().endsWith(".jmod")) - .map(path -> path.toAbsolutePath().toString()) - .toArray(String[]::new); - - for (String stdlib : stdlibs) { - scope.addToScope(ClassLoaderReference.Primordial, new JarFile(stdlib)); - } - setStdLibs(stdlibs); - - // ------------------------------------- - // Add extra user provided JARS to scope - // ------------------------------------- - if (!(applicationDeps == null)) { - Log.info("Loading user specified extra libs."); - Objects.requireNonNull(jarFilesStream(applicationDeps)).stream() - .forEach( - extraLibJar -> { - Log.info("-> Adding dependency " + extraLibJar + " to javaee scope."); - try { - scope.addToScope(ClassLoaderReference.Extension, new JarFile(extraLibJar.toAbsolutePath().toFile())); - } catch (IOException e) { - throw new RuntimeException(e); - } - }); - } else { - Log.warn("No extra libraries to process."); - } - - Path path = Paths.get(FileUtils.getTempDirectory().getAbsolutePath(), UUID.randomUUID().toString()); - String tmpDirString = Files.createDirectories(path).toFile().getAbsolutePath(); - Path workDir = Paths.get(tmpDirString); - FileUtils.cleanDirectory(workDir.toFile()); - - List applicationClassFiles = BuildProject.buildProjectAndStreamClassFiles(projectPath, build); - Log.debug("Application class files: " + String.valueOf(applicationClassFiles.size())); - if (applicationClassFiles == null) { - Log.error("No application classes found."); - throw new RuntimeException("No application classes found."); - } - Log.info("Adding application classes to scope."); - applicationClassFiles.forEach( - applicationClassFile -> { - try { - scope.addClassFileToScope( - ClassLoaderReference.Application, applicationClassFile.toFile()); - } catch (InvalidClassFileException e) { - throw new RuntimeException(e); - } - }); - - return scope; - } - - private static AnalysisScope addDefaultExclusions(AnalysisScope scope) - throws IOException { - Log.info("Add exclusions to scope."); - scope.setExclusions(new FileOfClasses(new ByteArrayInputStream(EXCLUSIONS.getBytes(StandardCharsets.UTF_8)))); - return scope; - } - - private static void setStdLibs(String[] stdlibs) { - stdLibs = stdlibs; - } -} diff --git a/src/main/java/com/ibm/cldk/utils/annotations/NotImplemented.java b/src/main/java/com/ibm/cldk/utils/annotations/NotImplemented.java deleted file mode 100644 index d2d084f6..00000000 --- a/src/main/java/com/ibm/cldk/utils/annotations/NotImplemented.java +++ /dev/null @@ -1,11 +0,0 @@ -package com.ibm.cldk.utils.annotations; - -import java.lang.annotation.*; - -@Documented -@Target({ElementType.METHOD, ElementType.FIELD, ElementType.TYPE}) -@Retention(RetentionPolicy.RUNTIME) -public @interface NotImplemented { - String value() default ""; - String comment() default ""; -} diff --git a/src/main/java/com/ibm/cldk/utils/annotations/Note.java b/src/main/java/com/ibm/cldk/utils/annotations/Note.java deleted file mode 100644 index cf12e6fa..00000000 --- a/src/main/java/com/ibm/cldk/utils/annotations/Note.java +++ /dev/null @@ -1,10 +0,0 @@ -package com.ibm.cldk.utils.annotations; - -import java.lang.annotation.*; - -@Documented -@Target({ElementType.METHOD, ElementType.FIELD, ElementType.TYPE, ElementType.PARAMETER, ElementType.CONSTRUCTOR, ElementType.LOCAL_VARIABLE, ElementType.PACKAGE, ElementType.TYPE_PARAMETER, ElementType.TYPE_USE, ElementType.MODULE, ElementType.ANNOTATION_TYPE}) -@Retention(RetentionPolicy.RUNTIME) -public @interface Note { - String value() default ""; -} diff --git a/src/main/java/com/ibm/cldk/utils/annotations/Todo.java b/src/main/java/com/ibm/cldk/utils/annotations/Todo.java deleted file mode 100644 index 1cd2f6ad..00000000 --- a/src/main/java/com/ibm/cldk/utils/annotations/Todo.java +++ /dev/null @@ -1,12 +0,0 @@ -package com.ibm.cldk.utils.annotations; - -import java.lang.annotation.*; - -@Documented -@Target({ElementType.METHOD, ElementType.FIELD, ElementType.TYPE}) -@Retention(RetentionPolicy.RUNTIME) -public @interface Todo { - String value() default ""; - String issue() default ""; - String comment() default ""; -} diff --git a/src/main/resources/META-INF/native-image-config/jni-config.json b/src/main/resources/META-INF/native-image-config/jni-config.json deleted file mode 100644 index 8b4e4170..00000000 --- a/src/main/resources/META-INF/native-image-config/jni-config.json +++ /dev/null @@ -1,6 +0,0 @@ -[ -{ - "name":"java.lang.Boolean", - "methods":[{"name":"getBoolean","parameterTypes":["java.lang.String"] }] -} -] diff --git a/src/main/resources/META-INF/native-image-config/predefined-classes-config.json b/src/main/resources/META-INF/native-image-config/predefined-classes-config.json deleted file mode 100644 index 0e79b2c5..00000000 --- a/src/main/resources/META-INF/native-image-config/predefined-classes-config.json +++ /dev/null @@ -1,8 +0,0 @@ -[ - { - "type":"agent-extracted", - "classes":[ - ] - } -] - diff --git a/src/main/resources/META-INF/native-image-config/proxy-config.json b/src/main/resources/META-INF/native-image-config/proxy-config.json deleted file mode 100644 index 0d4f101c..00000000 --- a/src/main/resources/META-INF/native-image-config/proxy-config.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/src/main/resources/META-INF/native-image-config/reflect-config.json b/src/main/resources/META-INF/native-image-config/reflect-config.json deleted file mode 100644 index 2c027f53..00000000 --- a/src/main/resources/META-INF/native-image-config/reflect-config.json +++ /dev/null @@ -1,240 +0,0 @@ -[ -{ - "name":"[B" -}, -{ - "name":"[Ljava.lang.String;" -}, -{ - "name":"[Lsun.security.pkcs.SignerInfo;" -}, -{ - "name":"com.ibm.northstar.CodeAnalyzer", - "allDeclaredFields":true, - "queryAllDeclaredMethods":true, - "queryAllPublicMethods":true -}, -{ - "name":"com.ibm.northstar.entities.Callable", - "allDeclaredFields":true, - "methods":[{"name":"","parameterTypes":[] }] -}, -{ - "name":"com.ibm.northstar.entities.ClassOrInterface", - "allDeclaredFields":true, - "methods":[{"name":"","parameterTypes":[] }] -}, -{ - "name":"com.ibm.northstar.entities.Field", - "allDeclaredFields":true, - "methods":[{"name":"","parameterTypes":[] }] -}, -{ - "name":"com.ibm.northstar.entities.JavaCompilationUnit", - "allDeclaredFields":true, - "methods":[{"name":"","parameterTypes":[] }] -}, -{ - "name":"com.ibm.northstar.entities.ParameterInCallable", - "allDeclaredFields":true, - "methods":[{"name":"","parameterTypes":[] }] -}, -{ - "name":"com.ibm.northstar.entities.Type", - "allDeclaredFields":true, - "methods":[{"name":"","parameterTypes":[] }] -}, -{ - "name":"java.lang.Class", - "methods":[{"name":"getRecordComponents","parameterTypes":[] }, {"name":"isRecord","parameterTypes":[] }] -}, -{ - "name":"java.lang.Object", - "allDeclaredFields":true, - "queryAllDeclaredMethods":true -}, -{ - "name":"java.lang.String" -}, -{ - "name":"java.lang.reflect.RecordComponent", - "methods":[{"name":"getName","parameterTypes":[] }, {"name":"getType","parameterTypes":[] }] -}, -{ - "name":"java.nio.file.Path" -}, -{ - "name":"java.nio.file.Paths", - "methods":[{"name":"get","parameterTypes":["java.lang.String","java.lang.String[]"] }] -}, -{ - "name":"java.security.interfaces.RSAPrivateKey" -}, -{ - "name":"java.security.interfaces.RSAPublicKey" -}, -{ - "name":"java.sql.Connection" -}, -{ - "name":"java.sql.Date" -}, -{ - "name":"java.sql.Driver" -}, -{ - "name":"java.sql.DriverManager", - "methods":[{"name":"getConnection","parameterTypes":["java.lang.String"] }, {"name":"getDriver","parameterTypes":["java.lang.String"] }] -}, -{ - "name":"java.sql.Time", - "methods":[{"name":"","parameterTypes":["long"] }] -}, -{ - "name":"java.sql.Timestamp", - "methods":[{"name":"valueOf","parameterTypes":["java.lang.String"] }] -}, -{ - "name":"java.time.Duration", - "methods":[{"name":"parse","parameterTypes":["java.lang.CharSequence"] }] -}, -{ - "name":"java.time.Instant", - "methods":[{"name":"parse","parameterTypes":["java.lang.CharSequence"] }] -}, -{ - "name":"java.time.LocalDate", - "methods":[{"name":"parse","parameterTypes":["java.lang.CharSequence"] }] -}, -{ - "name":"java.time.LocalDateTime", - "methods":[{"name":"parse","parameterTypes":["java.lang.CharSequence"] }] -}, -{ - "name":"java.time.LocalTime", - "methods":[{"name":"parse","parameterTypes":["java.lang.CharSequence"] }] -}, -{ - "name":"java.time.MonthDay", - "methods":[{"name":"parse","parameterTypes":["java.lang.CharSequence"] }] -}, -{ - "name":"java.time.OffsetDateTime", - "methods":[{"name":"parse","parameterTypes":["java.lang.CharSequence"] }] -}, -{ - "name":"java.time.OffsetTime", - "methods":[{"name":"parse","parameterTypes":["java.lang.CharSequence"] }] -}, -{ - "name":"java.time.Period", - "methods":[{"name":"parse","parameterTypes":["java.lang.CharSequence"] }] -}, -{ - "name":"java.time.Year", - "methods":[{"name":"parse","parameterTypes":["java.lang.CharSequence"] }] -}, -{ - "name":"java.time.YearMonth", - "methods":[{"name":"parse","parameterTypes":["java.lang.CharSequence"] }] -}, -{ - "name":"java.time.ZoneId", - "methods":[{"name":"of","parameterTypes":["java.lang.String"] }] -}, -{ - "name":"java.time.ZoneOffset", - "methods":[{"name":"of","parameterTypes":["java.lang.String"] }] -}, -{ - "name":"java.time.ZonedDateTime", - "methods":[{"name":"parse","parameterTypes":["java.lang.CharSequence"] }] -}, -{ - "name":"java.util.Date" -}, -{ - "name":"java.util.HashMap", - "methods":[{"name":"","parameterTypes":[] }] -}, -{ - "name":"java.util.LinkedHashMap", - "methods":[{"name":"","parameterTypes":[] }] -}, -{ - "name":"java.util.concurrent.atomic.AtomicBoolean", - "fields":[{"name":"value"}] -}, -{ - "name":"javax.security.auth.x500.X500Principal", - "fields":[{"name":"thisX500Name"}], - "methods":[{"name":"","parameterTypes":["sun.security.x509.X500Name"] }] -}, -{ - "name":"picocli.CommandLine$AutoHelpMixin", - "allDeclaredFields":true, - "queryAllDeclaredMethods":true -}, -{ - "name":"sun.security.provider.SHA", - "methods":[{"name":"","parameterTypes":[] }] -}, -{ - "name":"sun.security.provider.SHA2$SHA256", - "methods":[{"name":"","parameterTypes":[] }] -}, -{ - "name":"sun.security.provider.X509Factory", - "methods":[{"name":"","parameterTypes":[] }] -}, -{ - "name":"sun.security.rsa.RSAKeyFactory$Legacy", - "methods":[{"name":"","parameterTypes":[] }] -}, -{ - "name":"sun.security.rsa.RSASignature$SHA256withRSA", - "methods":[{"name":"","parameterTypes":[] }] -}, -{ - "name":"sun.security.util.ObjectIdentifier" -}, -{ - "name":"sun.security.x509.AuthorityInfoAccessExtension", - "methods":[{"name":"","parameterTypes":["java.lang.Boolean","java.lang.Object"] }] -}, -{ - "name":"sun.security.x509.AuthorityKeyIdentifierExtension", - "methods":[{"name":"","parameterTypes":["java.lang.Boolean","java.lang.Object"] }] -}, -{ - "name":"sun.security.x509.BasicConstraintsExtension", - "methods":[{"name":"","parameterTypes":["java.lang.Boolean","java.lang.Object"] }] -}, -{ - "name":"sun.security.x509.CRLDistributionPointsExtension", - "methods":[{"name":"","parameterTypes":["java.lang.Boolean","java.lang.Object"] }] -}, -{ - "name":"sun.security.x509.CertificateExtensions" -}, -{ - "name":"sun.security.x509.CertificatePoliciesExtension", - "methods":[{"name":"","parameterTypes":["java.lang.Boolean","java.lang.Object"] }] -}, -{ - "name":"sun.security.x509.ExtendedKeyUsageExtension", - "methods":[{"name":"","parameterTypes":["java.lang.Boolean","java.lang.Object"] }] -}, -{ - "name":"sun.security.x509.KeyUsageExtension", - "methods":[{"name":"","parameterTypes":["java.lang.Boolean","java.lang.Object"] }] -}, -{ - "name":"sun.security.x509.SubjectAlternativeNameExtension", - "methods":[{"name":"","parameterTypes":["java.lang.Boolean","java.lang.Object"] }] -}, -{ - "name":"sun.security.x509.SubjectKeyIdentifierExtension", - "methods":[{"name":"","parameterTypes":["java.lang.Boolean","java.lang.Object"] }] -} -] diff --git a/src/main/resources/META-INF/native-image-config/resource-config.json b/src/main/resources/META-INF/native-image-config/resource-config.json deleted file mode 100644 index 271f2e65..00000000 --- a/src/main/resources/META-INF/native-image-config/resource-config.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "resources":{ - "includes":[{ - "pattern":"java.base:\\Qjdk/internal/icu/impl/data/icudt67b/nfkc.nrm\\E" - }]}, - "bundles":[] -} diff --git a/src/main/resources/META-INF/native-image-config/serialization-config.json b/src/main/resources/META-INF/native-image-config/serialization-config.json deleted file mode 100644 index f3d7e06e..00000000 --- a/src/main/resources/META-INF/native-image-config/serialization-config.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "types":[ - ], - "lambdaCapturingTypes":[ - ], - "proxies":[ - ] -} diff --git a/src/styles/docs.css b/src/styles/docs.css new file mode 100644 index 00000000..4d4c12b7 --- /dev/null +++ b/src/styles/docs.css @@ -0,0 +1,229 @@ +/* ============================================================================ + CLDK docs theme — "MCP restraint on IBM Carbon". + Near-monochrome neutral surfaces; one IBM-blue accent; code + diagrams carry + the color. Typography is IBM Plex; layout tuned for reference density. + ========================================================================== */ + +:root { + --sl-font: "Space Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; + --sl-font-mono: "Space Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; + + /* Slightly wider content for reference tables / signatures. */ + --sl-content-width: 50rem; + + /* Brand accent (IBM Carbon blue family). */ + --cldk-blue: #0f62fe; +} + +/* ---- Dark theme: Carbon gray-100 surfaces ------------------------------- */ +:root, +:root[data-theme="dark"] { + --sl-color-accent-low: #0a2d6e; + --sl-color-accent: var(--cldk-blue); + --sl-color-accent-high: #a6c8ff; + + --sl-color-bg: #161616; /* Carbon gray-100 */ + --sl-color-bg-nav: #161616; + --sl-color-bg-sidebar: #1a1a1a; + --sl-color-bg-inline-code: #262626; + --sl-color-bg-accent: var(--cldk-blue); + + --sl-color-hairline: #2a2a2a; + --sl-color-hairline-light: #333333; + --sl-color-hairline-shade: #202020; + + --cldk-surface: #1f1f1f; /* card / panel surface */ + --cldk-surface-2: #262626; + --cldk-border: #393939; /* Carbon gray-80 */ +} + +/* ---- Light theme: white / gray-10 --------------------------------------- */ +:root[data-theme="light"] { + --sl-color-accent-low: #d0e2ff; + --sl-color-accent: var(--cldk-blue); + --sl-color-accent-high: #002d6e; + + --sl-color-bg: #ffffff; + --sl-color-bg-nav: #ffffff; + --sl-color-bg-sidebar: #f4f4f4; /* Carbon gray-10 */ + --sl-color-bg-inline-code: #f4f4f4; + + --sl-color-hairline: #e0e0e0; + --sl-color-hairline-light: #d0d0d0; + --sl-color-hairline-shade: #ececec; + + --cldk-surface: #ffffff; + --cldk-surface-2: #f4f4f4; + --cldk-border: #d0d0d0; /* Carbon gray-30 */ +} + +html { + font-family: var(--sl-font); +} + +/* Tighten heading weight for a reference-grade feel. */ +.sl-markdown-content h1, +.sl-markdown-content h2, +.sl-markdown-content h3 { + letter-spacing: -0.01em; +} + +/* ============================================================================ + Landing-page building blocks (splash template) + ========================================================================== */ + +/* Badge row (arXiv / PyPI / license / Discord). */ +.cldk-badges { + display: flex; + flex-wrap: wrap; + gap: 0.5rem; + margin: 0 0 1.75rem; +} +.cldk-badges img { + height: 26px; +} + +/* "First analysis" / inline install one-liner emphasis. */ +.cldk-oneliner { + font-size: var(--sl-text-lg); +} + +/* scikit-learn-style capability grid: definition + thumbnail + examples. */ +.cldk-capabilities { + display: grid; + grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); + gap: 1rem; + margin: 1.5rem 0 2rem; + padding: 0; + list-style: none; +} +.cldk-capability { + display: flex; + flex-direction: column; + gap: 0.5rem; + padding: 1.1rem 1.2rem; + border: 1px solid var(--cldk-border); + border-radius: 0.6rem; + background: var(--cldk-surface); + color: inherit; + text-decoration: none; + transition: border-color 0.18s ease, transform 0.18s ease; +} +.cldk-capability:hover { + border-color: var(--sl-color-accent); + transform: translateY(-2px); +} +.cldk-capability__title { + font-weight: 600; + font-size: var(--sl-text-lg); + margin: 0; +} +.cldk-capability__def { + margin: 0; + color: var(--sl-color-gray-2); + font-size: var(--sl-text-sm); +} +.cldk-capability__thumb { + margin: 0.25rem 0; + padding: 0.6rem 0.7rem; + border-radius: 0.4rem; + background: var(--cldk-surface-2); + border: 1px solid var(--sl-color-hairline); + font-family: var(--sl-font-mono); + font-size: 0.74rem; + line-height: 1.45; + overflow-x: auto; + white-space: pre; + color: var(--sl-color-text); +} +.cldk-capability__examples { + margin: 0; + padding-left: 1.1rem; + font-size: var(--sl-text-xs); + color: var(--sl-color-gray-3); +} + +/* "Agents prefer CLDK" call-out band. */ +.cldk-agent-band { + margin: 2rem 0; + padding: 1.5rem 1.6rem; + border: 1px solid var(--cldk-border); + border-left: 3px solid var(--sl-color-accent); + border-radius: 0.6rem; + background: var(--cldk-surface); +} +.cldk-agent-band h2 { + margin-top: 0 !important; +} + +/* At-a-glance stat strip. */ +.cldk-stats { + display: flex; + flex-wrap: wrap; + gap: 1rem; + margin: 1.5rem 0; + padding: 0; + list-style: none; +} +.cldk-stat { + flex: 1 1 8rem; + padding: 1rem 1.1rem; + border: 1px solid var(--cldk-border); + border-radius: 0.6rem; + background: var(--cldk-surface); + text-align: center; +} +.cldk-stat__num { + display: block; + font-size: 1.7rem; + font-weight: 700; + line-height: 1.2; +} +.cldk-stat__label { + font-size: var(--sl-text-xs); + text-transform: uppercase; + letter-spacing: 0.06em; + color: var(--sl-color-gray-3); +} + +/* Hero wordmark fallbacks (kept for non-splash uses). */ +.cldk-hero { + margin: 0.5rem 0 1.5rem; + text-align: center; +} +.cldk-hero img { + display: block; + width: min(100%, 620px); + height: auto; + margin: 0 auto; +} +:root[data-theme="dark"] .cldk-hero-light { + display: none; +} +:root[data-theme="light"] .cldk-hero-dark { + display: none; +} + +/* Auto-generated API signatures wrap rather than overflow. */ +.sl-markdown-content pre.cldk-signature { + white-space: pre-wrap; +} +/* ---- In-content status/tier badges: subtle pastel pills, not loud blocks -- */ +.sl-markdown-content .sl-badge { + font-family: var(--sl-font); + font-size: 0.75rem; + font-weight: 600; + letter-spacing: 0.01em; + border-radius: 999px; + padding: 0.05rem 0.55rem; + border-width: 1px; + white-space: nowrap; + background: transparent; +} + +.sl-markdown-content .sl-badge.success { color: #57b87e; border-color: rgba(36, 161, 72, 0.28); background: rgba(36, 161, 72, 0.08); } +.sl-markdown-content .sl-badge.tip { color: #44b3b0; border-color: rgba(0, 157, 154, 0.28); background: rgba(0, 157, 154, 0.08); } +.sl-markdown-content .sl-badge.caution { color: #cba43a; border-color: rgba(178, 134, 0, 0.28); background: rgba(178, 134, 0, 0.09); } +.sl-markdown-content .sl-badge.note { color: #5b8def; border-color: rgba(15, 98, 254, 0.28); background: rgba(15, 98, 254, 0.08); } +.sl-markdown-content .sl-badge.default { color: #9a9a9a; border-color: rgba(111, 111, 111, 0.28); background: rgba(111, 111, 111, 0.08); } +.sl-markdown-content .sl-badge.danger { color: #e8737a; border-color: rgba(218, 30, 40, 0.28); background: rgba(218, 30, 40, 0.08); } diff --git a/src/test/java/com/ibm/cldk/CodeAnalyzerIntegrationTest.java b/src/test/java/com/ibm/cldk/CodeAnalyzerIntegrationTest.java deleted file mode 100644 index cd933cc4..00000000 --- a/src/test/java/com/ibm/cldk/CodeAnalyzerIntegrationTest.java +++ /dev/null @@ -1,445 +0,0 @@ -package com.ibm.cldk; - -import com.google.gson.Gson; -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; -import java.nio.file.Paths; -import java.util.Map; -import java.util.Properties; -import java.util.stream.StreamSupport; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.Test; -import org.testcontainers.containers.GenericContainer; -import org.testcontainers.junit.jupiter.Container; -import org.testcontainers.junit.jupiter.Testcontainers; -import org.testcontainers.utility.MountableFile; - - -@Testcontainers -@SuppressWarnings("resource") -public class CodeAnalyzerIntegrationTest { - - /** - * Creates a Java 11 test container that mounts the build/libs folder. - */ - static String codeanalyzerVersion; - static final String javaVersion = "17"; - static String javaHomePath; - - static { - // Build project first - try { - Process process = new ProcessBuilder("./gradlew", "fatJar") - .directory(new File(System.getProperty("user.dir"))) - .start(); - if (process.waitFor() != 0) { - throw new RuntimeException("Build failed"); - } - } catch (IOException | InterruptedException e) { - throw new RuntimeException("Failed to build codeanalyzer", e); - } - } - - @Container - static final GenericContainer container = new GenericContainer<>("ubuntu:latest") - .withCreateContainerCmdModifier(cmd -> cmd.withEntrypoint("sh")) - .withCommand("-c", "while true; do sleep 1; done") - .withCopyFileToContainer(MountableFile.forHostPath(Paths.get(System.getProperty("user.dir")).resolve("build/libs")), "/opt/jars") - .withCopyFileToContainer(MountableFile.forHostPath(Paths.get(System.getProperty("user.dir")).resolve("build/libs")), "/opt/jars") - .withCopyFileToContainer(MountableFile.forHostPath(Paths.get(System.getProperty("user.dir")).resolve("src/test/resources/test-applications/mvnw-corrupt-test")), "/test-applications/mvnw-corrupt-test") - .withCopyFileToContainer(MountableFile.forHostPath(Paths.get(System.getProperty("user.dir")).resolve("src/test/resources/test-applications/plantsbywebsphere")), "/test-applications/plantsbywebsphere") - .withCopyFileToContainer(MountableFile.forHostPath(Paths.get(System.getProperty("user.dir")).resolve("src/test/resources/test-applications/call-graph-test")), "/test-applications/call-graph-test") - .withCopyFileToContainer(MountableFile.forHostPath(Paths.get(System.getProperty("user.dir")).resolve("src/test/resources/test-applications/record-class-test")), "/test-applications/record-class-test") - .withCopyFileToContainer(MountableFile.forHostPath(Paths.get(System.getProperty("user.dir")).resolve("src/test/resources/test-applications/init-blocks-test")), "/test-applications/init-blocks-test") - .withCopyFileToContainer(MountableFile.forHostPath(Paths.get(System.getProperty("user.dir")).resolve("src/test/resources/test-applications/mvnw-working-test")), "/test-applications/mvnw-working-test"); - - @Container - static final GenericContainer mavenContainer = new GenericContainer<>("maven:3.8.3-openjdk-17") - .withCreateContainerCmdModifier(cmd -> cmd.withEntrypoint("sh")) - .withCommand("-c", "while true; do sleep 1; done") - .withCopyFileToContainer(MountableFile.forHostPath(Paths.get(System.getProperty("user.dir")).resolve("build/libs")), "/opt/jars") - .withCopyFileToContainer(MountableFile.forHostPath(Paths.get(System.getProperty("user.dir")).resolve("src/test/resources/test-applications/mvnw-corrupt-test")), "/test-applications/mvnw-corrupt-test") - .withCopyFileToContainer(MountableFile.forHostPath(Paths.get(System.getProperty("user.dir")).resolve("src/test/resources/test-applications/mvnw-working-test")), "/test-applications/mvnw-working-test") - .withCopyFileToContainer(MountableFile.forHostPath(Paths.get(System.getProperty("user.dir")).resolve("src/test/resources/test-applications/daytrader8")), "/test-applications/daytrader8"); - - public CodeAnalyzerIntegrationTest() throws IOException, InterruptedException { - } - - @BeforeAll - static void setUp() { - // Install Java 17 in the base container - try { - container.execInContainer("apt-get", "update"); - container.execInContainer("apt-get", "install", "-y", "openjdk-17-jdk"); - - // Get JAVA_HOME dynamically - var javaHomeResult = container.execInContainer("bash", "-c", - "dirname $(dirname $(readlink -f $(which java)))" - ); - javaHomePath = javaHomeResult.getStdout().trim(); - Assertions.assertFalse(javaHomePath.isEmpty(), "Failed to determine JAVA_HOME"); - - } catch (IOException | InterruptedException e) { - throw new RuntimeException(e); - } - - - // Get the version of the codeanalyzer jar - Properties properties = new Properties(); - try (FileInputStream fis = new FileInputStream( - Paths.get(System.getProperty("user.dir"), "gradle.properties").toFile())) { - properties.load(fis); - } catch (IOException e) { - throw new RuntimeException(e); - } - codeanalyzerVersion = properties.getProperty("version"); - } - - @Test - void shouldHaveCorrectJavaVersionInstalled() throws Exception { - var baseContainerresult = container.execInContainer("java", "-version"); - var mvnContainerresult = mavenContainer.execInContainer("java", "-version"); - Assertions.assertTrue(baseContainerresult.getStderr().contains("openjdk version \"" + javaVersion), "Base container Java version should be " + javaVersion); - Assertions.assertTrue(mvnContainerresult.getStderr().contains("openjdk version \"" + javaVersion), "Maven container Java version should be " + javaVersion); - } - - @Test - void shouldHaveCodeAnalyzerJar() throws Exception { - var dirContents = container.execInContainer("ls", "/opt/jars/"); - Assertions.assertTrue(dirContents.getStdout().length() > 0, "Directory listing should not be empty"); - Assertions.assertTrue(dirContents.getStdout().contains("codeanalyzer"), "Codeanalyzer.jar not found in the container."); - } - - @Test - void shouldBeAbleToRunCodeAnalyzer() throws Exception { - var runCodeAnalyzerJar = container.execInContainer( - "bash", "-c", - String.format("export JAVA_HOME=%s && java -jar /opt/jars/codeanalyzer-%s.jar --help", - javaHomePath, codeanalyzerVersion - )); - - Assertions.assertEquals(0, runCodeAnalyzerJar.getExitCode(), - "Command should execute successfully"); - Assertions.assertTrue(runCodeAnalyzerJar.getStdout().length() > 0, - "Should have some output"); - } - - @Test - void callGraphShouldHaveKnownEdges() throws Exception { - var runCodeAnalyzerOnCallGraphTest = container.execInContainer( - "bash", "-c", - String.format( - "export JAVA_HOME=%s && java -jar /opt/jars/codeanalyzer-%s.jar --input=/test-applications/call-graph-test --analysis-level=2", - javaHomePath, codeanalyzerVersion - ) - ); - - - // Read the output JSON - Gson gson = new Gson(); - JsonObject jsonObject = gson.fromJson(runCodeAnalyzerOnCallGraphTest.getStdout(), JsonObject.class); - JsonArray callGraph = jsonObject.getAsJsonArray("call_graph"); - Assertions.assertTrue(StreamSupport.stream(callGraph.spliterator(), false) - .map(JsonElement::getAsJsonObject) - .anyMatch(entry -> - "CALL_DEP".equals(entry.get("type").getAsString()) && - "1".equals(entry.get("weight").getAsString()) && - entry.getAsJsonObject("source").get("signature").getAsString().equals("helloString()") && - entry.getAsJsonObject("target").get("signature").getAsString().equals("log()") - ), "Expected edge not found in the system dependency graph"); - } - - @Test - void corruptMavenShouldNotBuildWithWrapper() throws IOException, InterruptedException { - // Make executable - mavenContainer.execInContainer("chmod", "+x", "/test-applications/mvnw-corrupt-test/mvnw"); - // Let's start by building the project by itself - var mavenProjectBuildWithWrapper = mavenContainer.withWorkingDirectory("/test-applications/mvnw-corrupt-test").execInContainer("/test-applications/mvnw-corrupt-test/mvnw", "clean", "compile"); - Assertions.assertNotEquals(0, mavenProjectBuildWithWrapper.getExitCode()); - } - - @Test - void corruptMavenShouldProduceAnalysisArtifactsWhenMVNCommandIsInPath() throws IOException, InterruptedException { - // Let's start by building the project by itself - var corruptMavenProjectBuild = mavenContainer.withWorkingDirectory("/test-applications/mvnw-corrupt-test").execInContainer("mvn", "-f", "/test-applications/mvnw-corrupt-test/pom.xml", "clean", "compile"); - Assertions.assertEquals(0, corruptMavenProjectBuild.getExitCode(), "Failed to build the project with system's default Maven."); - // NOw run codeanalyzer and assert if analysis.json is generated. - var runCodeAnalyzer = mavenContainer.execInContainer("java", "-jar", String.format("/opt/jars/codeanalyzer-%s.jar", codeanalyzerVersion), "--input=/test-applications/mvnw-corrupt-test", "--output=/tmp/", "--analysis-level=2", "--verbose", "--no-build"); - var codeAnalyzerOutputDirContents = mavenContainer.execInContainer("ls", "/tmp/analysis.json"); - String codeAnalyzerOutputDirContentsStdOut = codeAnalyzerOutputDirContents.getStdout(); - Assertions.assertTrue(codeAnalyzerOutputDirContentsStdOut.length() > 0, "Could not find 'analysis.json'."); - // mvnw is corrupt, so we should see an error message in the output. - Assertions.assertTrue(runCodeAnalyzer.getStdout().contains("[ERROR]\tCannot run program \"/test-applications/mvnw-corrupt-test/mvnw\"") && runCodeAnalyzer.getStdout().contains("/mvn.")); - // We should correctly identify the build tool used in the mvn command from the system path. - Assertions.assertTrue(runCodeAnalyzer.getStdout().contains("[INFO]\tBuilding the project using /usr/bin/mvn.")); - } - - @Test - void corruptMavenShouldNotTerminateWithErrorWhenMavenIsNotPresentUnlessAnalysisLevel2() throws IOException, InterruptedException { - // When analysis level 2, we should get a Runtime Exception - var runCodeAnalyzer = container.execInContainer( - "bash", "-c", - String.format( - "export JAVA_HOME=%s && java -jar /opt/jars/codeanalyzer-%s.jar --input=/test-applications/mvnw-corrupt-test --output=/tmp/ --analysis-level=2", - javaHomePath, codeanalyzerVersion - ) - ); - - Assertions.assertEquals(1, runCodeAnalyzer.getExitCode()); - Assertions.assertTrue(runCodeAnalyzer.getStderr().contains("java.lang.RuntimeException")); - } - - @Test - void shouldBeAbleToGenerateAnalysisArtifactForDaytrader8() throws Exception { - var runCodeAnalyzerOnDaytrader8 = mavenContainer.execInContainer( - "bash", "-c", - String.format( - "export JAVA_HOME=%s && java -jar /opt/jars/codeanalyzer-%s.jar --input=/test-applications/daytrader8 --analysis-level=1", - javaHomePath, codeanalyzerVersion - ) - ); - - Assertions.assertTrue(runCodeAnalyzerOnDaytrader8.getStdout().contains("\"is_entrypoint_class\": true"), "No entry point classes found"); - Assertions.assertTrue(runCodeAnalyzerOnDaytrader8.getStdout().contains("\"is_entrypoint\": true"), "No entry point methods found"); - } - - - @Test - void shouldBeAbleToDetectCRUDOperationsAndQueriesForPlantByWebsphere() throws Exception { - var runCodeAnalyzerOnPlantsByWebsphere = container.execInContainer( - "bash", "-c", - String.format( - "export JAVA_HOME=%s && java -jar /opt/jars/codeanalyzer-%s.jar --input=/test-applications/plantsbywebsphere --analysis-level=1", - javaHomePath, codeanalyzerVersion - ) - ); - - - Assertions.assertEquals(0, runCodeAnalyzerOnPlantsByWebsphere.getExitCode(), "CodeAnalyzer command should succeed"); - String output = runCodeAnalyzerOnPlantsByWebsphere.getStdout(); - Gson gson = new Gson(); - JsonObject jsonObject = gson.fromJson(output, JsonObject.class); - JsonObject symbolTable = jsonObject.getAsJsonObject("symbol_table"); - Assertions.assertNotNull(symbolTable); - Assertions.assertTrue(symbolTable.size() > 0, "Symbol table should not be empty"); - - boolean hasReadOperation = false; - boolean hasCreateOperation = false; - boolean hasUpdateOperation = false; - boolean hasNamedQuery = false; - int crudOperationCount = 0; - int crudQueryCount = 0; - - for (Map.Entry compilationUnitEntry : symbolTable.entrySet()) { - JsonObject compilationUnit = compilationUnitEntry.getValue().getAsJsonObject(); - if (!compilationUnit.has("type_declarations")) { - continue; - } - JsonObject typeDeclarations = compilationUnit.getAsJsonObject("type_declarations"); - for (Map.Entry typeEntry : typeDeclarations.entrySet()) { - JsonObject typeDeclaration = typeEntry.getValue().getAsJsonObject(); - if (!typeDeclaration.has("callable_declarations")) { - continue; - } - JsonObject callableDeclarations = typeDeclaration.getAsJsonObject("callable_declarations"); - for (Map.Entry callableEntry : callableDeclarations.entrySet()) { - JsonObject callable = callableEntry.getValue().getAsJsonObject(); - JsonArray crudOperations = callable.getAsJsonArray("crud_operations"); - if (crudOperations != null) { - for (JsonElement crudOperationElement : crudOperations) { - JsonObject crudOperation = crudOperationElement.getAsJsonObject(); - crudOperationCount++; - Assertions.assertTrue(crudOperation.has("line_number"), "CRUD operation should have line_number"); - Assertions.assertTrue(crudOperation.has("operation_type"), "CRUD operation should have operation_type"); - Assertions.assertTrue(crudOperation.has("target_table"), "CRUD operation should have target_table"); - Assertions.assertTrue(crudOperation.has("involved_columns"), "CRUD operation should have involved_columns"); - Assertions.assertTrue(crudOperation.has("condition"), "CRUD operation should have condition"); - Assertions.assertTrue(crudOperation.has("joined_tables"), "CRUD operation should have joined_tables"); - String operationType = crudOperation.get("operation_type").getAsString(); - int lineNumber = crudOperation.get("line_number").getAsInt(); - Assertions.assertTrue(lineNumber > 0, "CRUD operation should have positive line_number"); - if ("READ".equals(operationType)) { - hasReadOperation = true; - } - if ("CREATE".equals(operationType)) { - hasCreateOperation = true; - } - if ("UPDATE".equals(operationType)) { - hasUpdateOperation = true; - } - } - } - JsonArray crudQueries = callable.getAsJsonArray("crud_queries"); - if (crudQueries != null) { - for (JsonElement crudQueryElement : crudQueries) { - JsonObject crudQuery = crudQueryElement.getAsJsonObject(); - crudQueryCount++; - Assertions.assertTrue(crudQuery.has("line_number"), "CRUD query should have line_number"); - Assertions.assertTrue(crudQuery.has("query_type"), "CRUD query should have query_type"); - Assertions.assertTrue(crudQuery.has("query_arguments"), "CRUD query should have query_arguments"); - String queryType = crudQuery.get("query_type").getAsString(); - int lineNumber = crudQuery.get("line_number").getAsInt(); - Assertions.assertTrue(lineNumber > 0, "CRUD query should have positive line_number"); - if ("NAMED".equals(queryType)) { - hasNamedQuery = true; - } - } - } - } - } - } - - Assertions.assertTrue(crudOperationCount > 0, "No CRUD operations found"); - Assertions.assertTrue(crudQueryCount > 0, "No CRUD queries found"); - Assertions.assertTrue(hasNamedQuery, "No NAMED CRUD query found"); - Assertions.assertTrue(hasReadOperation, "No READ CRUD operation found"); - Assertions.assertTrue(hasCreateOperation, "No CREATE CRUD operation found"); - Assertions.assertTrue(hasUpdateOperation, "No UPDATE CRUD operation found"); - } - - @Test - void symbolTableShouldHaveRecords() throws IOException, InterruptedException { - var runCodeAnalyzerOnCallGraphTest = container.execInContainer( - "bash", "-c", - String.format( - "export JAVA_HOME=%s && java -jar /opt/jars/codeanalyzer-%s.jar --input=/test-applications/record-class-test --analysis-level=1", - javaHomePath, codeanalyzerVersion - ) - ); - - // Read the output JSON - Gson gson = new Gson(); - JsonObject jsonObject = gson.fromJson(runCodeAnalyzerOnCallGraphTest.getStdout(), JsonObject.class); - JsonObject symbolTable = jsonObject.getAsJsonObject("symbol_table"); - Assertions.assertEquals(4, symbolTable.size(), "Symbol table should have 4 records"); - } - - @Test - void symbolTableShouldHaveDefaultRecordComponents() throws IOException, InterruptedException { - var runCodeAnalyzerOnCallGraphTest = container.execInContainer( - "bash", "-c", - String.format( - "export JAVA_HOME=%s && java -jar /opt/jars/codeanalyzer-%s.jar --input=/test-applications/record-class-test --analysis-level=1", - javaHomePath, codeanalyzerVersion - ) - ); - - // Read the output JSON - Gson gson = new Gson(); - JsonObject jsonObject = gson.fromJson(runCodeAnalyzerOnCallGraphTest.getStdout(), JsonObject.class); - JsonObject symbolTable = jsonObject.getAsJsonObject("symbol_table"); - for (Map.Entry element : symbolTable.entrySet()) { - String key = element.getKey(); - if (!key.endsWith("PersonRecord.java")) { - continue; - } - JsonObject type = element.getValue().getAsJsonObject(); - if (type.has("type_declarations")) { - JsonObject typeDeclarations = type.getAsJsonObject("type_declarations"); - JsonArray recordComponent = typeDeclarations.getAsJsonObject("org.example.PersonRecord").getAsJsonArray("record_components"); - Assertions.assertEquals(2, recordComponent.size(), "Record component should have 2 components"); - JsonObject record = recordComponent.get(1).getAsJsonObject(); - Assertions.assertTrue(record.get("name").getAsString().equals("age") && record.get("default_value").getAsInt() == 18, "Record component should have a name"); - } - } - } - - @Test - void parametersInCallableMustHaveStartAndEndLineAndColumns() throws IOException, InterruptedException { - var runCodeAnalyzerOnCallGraphTest = container.execInContainer( - "bash", "-c", - String.format( - "export JAVA_HOME=%s && java -jar /opt/jars/codeanalyzer-%s.jar --input=/test-applications/record-class-test --analysis-level=1", - javaHomePath, codeanalyzerVersion - ) - ); - - // Read the output JSON - Gson gson = new Gson(); - JsonObject jsonObject = gson.fromJson(runCodeAnalyzerOnCallGraphTest.getStdout(), JsonObject.class); - JsonObject symbolTable = jsonObject.getAsJsonObject("symbol_table"); - for (Map.Entry element : symbolTable.entrySet()) { - String key = element.getKey(); - if (!key.endsWith("App.java")) { - continue; - } - JsonObject type = element.getValue().getAsJsonObject(); - if (type.has("type_declarations")) { - JsonObject typeDeclarations = type.getAsJsonObject("type_declarations"); - JsonObject mainMethod = typeDeclarations.getAsJsonObject("org.example.App") - .getAsJsonObject("callable_declarations") - .getAsJsonObject("main(java.lang.String[])"); - JsonArray parameters = mainMethod.getAsJsonArray("parameters"); - // There should be 1 parameter - Assertions.assertEquals(1, parameters.size(), "Callable should have 1 parameter"); - JsonObject parameter = parameters.get(0).getAsJsonObject(); - // Start and end line and column should not be -1 - Assertions.assertTrue(parameter.get("start_line").getAsInt() == 7 && parameter.get("end_line").getAsInt() == 7 && parameter.get("start_column").getAsInt() == 29 && parameter.get("end_column").getAsInt() == 41, "Parameter should have start and end line and columns"); - } - } - } - - @Test - void mustBeAbleToResolveInitializationBlocks() throws IOException, InterruptedException { - var runCodeAnalyzerOnCallGraphTest = container.execInContainer( - "bash", "-c", - String.format( - "export JAVA_HOME=%s && java -jar /opt/jars/codeanalyzer-%s.jar --input=/test-applications/init-blocks-test --analysis-level=1", - javaHomePath, codeanalyzerVersion - ) - ); - - // Read the output JSON - Gson gson = new Gson(); - JsonObject jsonObject = gson.fromJson(runCodeAnalyzerOnCallGraphTest.getStdout(), JsonObject.class); - JsonObject symbolTable = jsonObject.getAsJsonObject("symbol_table"); - for (Map.Entry element : symbolTable.entrySet()) { - String key = element.getKey(); - if (!key.endsWith("App.java")) { - continue; - } - JsonObject type = element.getValue().getAsJsonObject(); - if (type.has("type_declarations")) { - JsonObject typeDeclarations = type.getAsJsonObject("type_declarations"); - JsonArray initializationBlocks = typeDeclarations.getAsJsonObject("org.example.App").getAsJsonArray("initialization_blocks"); - // There should be 2 blocks - Assertions.assertEquals(2, initializationBlocks.size(), "Callable should have 1 parameter"); - Assertions.assertTrue(initializationBlocks.get(0).getAsJsonObject().get("is_static").getAsBoolean(), "Static block should be marked as static"); - Assertions.assertFalse(initializationBlocks.get(1).getAsJsonObject().get("is_static").getAsBoolean(), "Instance block should be marked as not static"); - } - } - } - - @Test - void mustBeAbleToExtractCommentBlocks() throws IOException, InterruptedException { - var runCodeAnalyzerOnCallGraphTest = container.execInContainer( - "bash", "-c", - String.format( - "export JAVA_HOME=%s && java -jar /opt/jars/codeanalyzer-%s.jar --input=/test-applications/init-blocks-test --analysis-level=1", - javaHomePath, codeanalyzerVersion - ) - ); - - // Read the output JSON - Gson gson = new Gson(); - JsonObject jsonObject = gson.fromJson(runCodeAnalyzerOnCallGraphTest.getStdout(), JsonObject.class); - JsonObject symbolTable = jsonObject.getAsJsonObject("symbol_table"); - for (Map.Entry element : symbolTable.entrySet()) { - String key = element.getKey(); - if (!key.endsWith("App.java")) { - continue; - } - JsonObject type = element.getValue().getAsJsonObject(); - JsonArray comments = type.getAsJsonArray("comments"); - Assertions.assertEquals(16, comments.size(), "Should have 15 comments"); - Assertions.assertTrue(StreamSupport.stream(comments.spliterator(), false) - .map(JsonElement::getAsJsonObject) - .anyMatch(comment -> comment.get("is_javadoc").getAsBoolean()), "Single line comment not found"); - } - } -} diff --git a/src/test/java/com/ibm/cldk/CodeAnalyzerTest.java b/src/test/java/com/ibm/cldk/CodeAnalyzerTest.java deleted file mode 100644 index d3aed26c..00000000 --- a/src/test/java/com/ibm/cldk/CodeAnalyzerTest.java +++ /dev/null @@ -1,117 +0,0 @@ -package com.ibm.cldk; - -import com.ibm.cldk.entities.Import; -import com.ibm.cldk.entities.JavaCompilationUnit; -import java.io.File; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.nio.charset.StandardCharsets; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.List; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.io.TempDir; - -public class CodeAnalyzerTest { - - @TempDir - Path tempDir; - - @SuppressWarnings("unchecked") - private Map invokeReadSymbolTableFromFile(Path analysisFilePath) throws Exception { - Method readSymbolTableMethod = CodeAnalyzer.class.getDeclaredMethod("readSymbolTableFromFile", File.class); - readSymbolTableMethod.setAccessible(true); - try { - return (Map) readSymbolTableMethod.invoke(null, analysisFilePath.toFile()); - } catch (InvocationTargetException invocationTargetException) { - Throwable targetException = invocationTargetException.getTargetException(); - if (targetException instanceof Exception) { - throw (Exception) targetException; - } - throw new RuntimeException(targetException); - } - } - - private Path writeAnalysisFile(String jsonContent) throws Exception { - Path analysisFilePath = tempDir.resolve("analysis.json"); - Files.writeString(analysisFilePath, jsonContent, StandardCharsets.UTF_8); - return analysisFilePath; - } - - @Test - public void testReadSymbolTableFromFileRejectsLegacyImportSchema() throws Exception { - String jsonContent = "{\n" - + " \"symbol_table\": {\n" - + " \"/tmp/T.java\": {\n" - + " \"file_path\": \"/tmp/T.java\",\n" - + " \"package_name\": \"\",\n" - + " \"comments\": [],\n" - + " \"imports\": [\"java.util.List\"],\n" - + " \"type_declarations\": {},\n" - + " \"is_modified\": false\n" - + " }\n" - + " }\n" - + "}\n"; - Path analysisFilePath = writeAnalysisFile(jsonContent); - - IllegalStateException exception = Assertions.assertThrows(IllegalStateException.class, - () -> invokeReadSymbolTableFromFile(analysisFilePath)); - Assertions.assertTrue(exception.getMessage().contains("legacy import schema")); - } - - @Test - public void testReadSymbolTableFromFileParsesExplicitImportSchema() throws Exception { - String jsonContent = "{\n" - + " \"symbol_table\": {\n" - + " \"/tmp/T.java\": {\n" - + " \"file_path\": \"/tmp/T.java\",\n" - + " \"package_name\": \"\",\n" - + " \"comments\": [],\n" - + " \"imports\": [\n" - + " {\n" - + " \"path\": \"java.util.List\",\n" - + " \"is_static\": false,\n" - + " \"is_wildcard\": false\n" - + " },\n" - + " {\n" - + " \"path\": \"java.util.Collections\",\n" - + " \"is_static\": true,\n" - + " \"is_wildcard\": true\n" - + " }\n" - + " ],\n" - + " \"type_declarations\": {},\n" - + " \"is_modified\": false\n" - + " }\n" - + " }\n" - + "}\n"; - Path analysisFilePath = writeAnalysisFile(jsonContent); - - Map symbolTable = invokeReadSymbolTableFromFile(analysisFilePath); - Assertions.assertNotNull(symbolTable); - Assertions.assertEquals(1, symbolTable.size()); - - JavaCompilationUnit compilationUnit = symbolTable.get("/tmp/T.java"); - Assertions.assertNotNull(compilationUnit); - List imports = compilationUnit.getImports(); - Assertions.assertNotNull(imports); - Assertions.assertEquals(2, imports.size()); - - Import defaultImport = imports.stream() - .filter(imp -> "java.util.List".equals(imp.getPath())) - .findFirst() - .orElse(null); - Assertions.assertNotNull(defaultImport); - Assertions.assertFalse(defaultImport.isStatic()); - Assertions.assertFalse(defaultImport.isWildcard()); - - Import staticWildcardImport = imports.stream() - .filter(imp -> "java.util.Collections".equals(imp.getPath())) - .findFirst() - .orElse(null); - Assertions.assertNotNull(staticWildcardImport); - Assertions.assertTrue(staticWildcardImport.isStatic()); - Assertions.assertTrue(staticWildcardImport.isWildcard()); - } -} diff --git a/src/test/java/com/ibm/cldk/SymbolTableTest.java b/src/test/java/com/ibm/cldk/SymbolTableTest.java deleted file mode 100644 index 2dcc6697..00000000 --- a/src/test/java/com/ibm/cldk/SymbolTableTest.java +++ /dev/null @@ -1,134 +0,0 @@ -package com.ibm.cldk; - -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParser; -import com.ibm.cldk.entities.CallSite; -import com.ibm.cldk.entities.Callable; -import com.ibm.cldk.entities.Import; -import com.ibm.cldk.entities.JavaCompilationUnit; -import com.ibm.cldk.entities.Type; -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.nio.charset.StandardCharsets; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public class SymbolTableTest { - - private String getJavaCodeForTestResource(String resourcePath) { - InputStream inputStream = getClass().getClassLoader().getResourceAsStream(resourcePath); - assert inputStream != null; - return new BufferedReader(new InputStreamReader(inputStream, StandardCharsets.UTF_8)) - .lines() - .collect(Collectors.joining("\n")); - } - - @Test - public void testExtractSingleGenricsDuplicateSignature_Validate() throws IOException { - String javaCode = getJavaCodeForTestResource("test-applications/generics-varargs-duplicate-signature-test/Validate.java"); - Map symbolTable = SymbolTable.extractSingle(javaCode).getLeft(); - Assertions.assertEquals(1, symbolTable.size()); - Map typeDeclaration = symbolTable.values().iterator().next().getTypeDeclarations(); - Assertions.assertEquals(1, typeDeclaration.size()); - Map callables = typeDeclaration.values().iterator().next().getCallableDeclarations(); - Assertions.assertEquals(17, callables.size()); - } - - @Test - public void testExtractSingleGenricsDuplicateSignature_FunctorUtils() throws IOException { - String javaCode = getJavaCodeForTestResource("test-applications/generics-varargs-duplicate-signature-test/FunctorUtils.java"); - Map symbolTable = SymbolTable.extractSingle(javaCode).getLeft(); - Assertions.assertEquals(1, symbolTable.size()); - Map typeDeclaration = symbolTable.values().iterator().next().getTypeDeclarations(); - Assertions.assertEquals(1, typeDeclaration.size()); - Map callables = typeDeclaration.values().iterator().next().getCallableDeclarations(); - Assertions.assertEquals(10, callables.size()); - } - - @Test - public void testExtractSingleMissingNodeRange() throws IOException { - String javaCode = getJavaCodeForTestResource("test-applications/missing-node-range-test/WeakHashtableTestCase.java"); - Map symbolTable = SymbolTable.extractSingle(javaCode).getLeft(); - Assertions.assertEquals(1, symbolTable.size()); - Map typeDeclaration = symbolTable.values().iterator().next().getTypeDeclarations(); - Assertions.assertEquals(2, typeDeclaration.size()); - } - - @Test - public void testExtractSingleDefaultKeywordMethodDecl() throws IOException { - String javaCode = getJavaCodeForTestResource("test-applications/default-keyword-method-decl/IndexExtractor.java"); - Map symbolTable = SymbolTable.extractSingle(javaCode).getLeft(); - Assertions.assertEquals(1, symbolTable.size()); - Map typeDeclaration = symbolTable.values().iterator().next().getTypeDeclarations(); - Assertions.assertEquals(1, typeDeclaration.size()); - Map callables = typeDeclaration.values().iterator().next().getCallableDeclarations(); - Assertions.assertEquals(5, callables.size()); - } - - @Test - public void testCallSiteArgumentExpression() throws IOException { - String javaCode = getJavaCodeForTestResource("test-applications/generics-varargs-duplicate-signature-test/Validate.java"); - Map typeDeclaration = SymbolTable.extractSingle(javaCode).getLeft() - .values().iterator().next().getTypeDeclarations(); - Callable callable = typeDeclaration.values().iterator().next().getCallableDeclarations() - .get("notEmpty(java.util.Collection, java.lang.String, java.lang.Object[])"); - Assertions.assertNotNull(callable); - for (CallSite callSite : callable.getCallSites()) { - if (callSite.getMethodName().equals("requireNonNull")) { - String[] expectedArgumentExpr = {"collection", "toSupplier(message, values)"}; - List argumentExpr = callSite.getArgumentExpr(); - Assertions.assertArrayEquals(expectedArgumentExpr, argumentExpr.toArray(new String[0])); - break; - } - } - } - - @Test - public void testExtractSingleImportMetadata() throws IOException { - String javaCode = String.join("\n", - "import java.util.List;", - "import java.util.Map.*;", - "import static java.util.Collections.emptyList;", - "import static java.util.Collections.*;", - "class T {}"); - Map symbolTable = SymbolTable.extractSingle(javaCode).getLeft(); - Assertions.assertEquals(1, symbolTable.size()); - List imports = symbolTable.values().iterator().next().getImports(); - Assertions.assertNotNull(imports); - Assertions.assertEquals(4, imports.size()); - - assertImport(imports, "java.util.List", false, false); - assertImport(imports, "java.util.Map", false, true); - assertImport(imports, "java.util.Collections.emptyList", true, false); - assertImport(imports, "java.util.Collections", true, true); - - JsonArray serializedImports = JsonParser.parseString(CodeAnalyzer.gson.toJson(imports)).getAsJsonArray(); - Assertions.assertEquals(4, serializedImports.size()); - for (JsonElement serializedImport : serializedImports) { - Assertions.assertTrue(serializedImport.isJsonObject()); - JsonObject serializedImportObject = serializedImport.getAsJsonObject(); - Assertions.assertTrue(serializedImportObject.has("path")); - Assertions.assertTrue(serializedImportObject.has("is_static")); - Assertions.assertTrue(serializedImportObject.has("is_wildcard")); - } - } - - private static void assertImport(List imports, String path, boolean isStatic, boolean isWildcard) { - Import matchingImport = imports.stream() - .filter(imp -> path.equals(imp.getPath()) - && imp.isStatic() == isStatic - && imp.isWildcard() == isWildcard) - .findFirst() - .orElse(null); - Assertions.assertNotNull(matchingImport, - String.format("Expected import '%s' with isStatic=%s and isWildcard=%s", path, isStatic, isWildcard)); - } - -} diff --git a/src/test/java/com/ibm/cldk/utils/BuildProjectTest.java b/src/test/java/com/ibm/cldk/utils/BuildProjectTest.java deleted file mode 100644 index 48e3aae0..00000000 --- a/src/test/java/com/ibm/cldk/utils/BuildProjectTest.java +++ /dev/null @@ -1,4 +0,0 @@ -package com.ibm.cldk.utils; - -public class BuildProjectTest { -} diff --git a/src/test/resources/generated/.gitignore b/src/test/resources/generated/.gitignore deleted file mode 100644 index 94a2dd14..00000000 --- a/src/test/resources/generated/.gitignore +++ /dev/null @@ -1 +0,0 @@ -*.json \ No newline at end of file diff --git a/src/test/resources/test-applications/.gitignore b/src/test/resources/test-applications/.gitignore deleted file mode 100644 index 11609223..00000000 --- a/src/test/resources/test-applications/.gitignore +++ /dev/null @@ -1,57 +0,0 @@ -# Compiled class file -*.class - -# Log file -*.log - -# BlueJ files -*.ctxt - -# Mobile Tools for Java (J2ME) -.mtj.tmp/ - -# Package Files # -*.jar -*.war -*.ear -*.zip -*.tar.gz -*.rar - -# Don't ignore jar files in any level of binary and dependencies -!**/binaries/**/*.jar -!**/libs/**/*.jar - -# virtual machine crash logs -hs_err_pid* - -# Ignore Gradle files -.gradle/ -build/ - -# Don't ignore Gradle wrapper jar file -!gradle-wrapper.jar - -# Ignore Maven target folder -target/ - -# Ignore IntelliJ IDEA files -.idea/ -*.iml -*.iws -*.ipr - -# Ignore Eclipse files -.settings/ -*.classpath -*.project - -# Ignore VS Code files -.vscode/ - -# Ignore everything in codeql-db except the directory itself -codeql-db/* -!codeql-db/.keep - -# Ignore hidden apps -hidden-apps/ \ No newline at end of file diff --git a/src/test/resources/test-applications/call-graph-test/.gitattributes b/src/test/resources/test-applications/call-graph-test/.gitattributes deleted file mode 100644 index 097f9f98..00000000 --- a/src/test/resources/test-applications/call-graph-test/.gitattributes +++ /dev/null @@ -1,9 +0,0 @@ -# -# https://help.github.com/articles/dealing-with-line-endings/ -# -# Linux start script should use lf -/gradlew text eol=lf - -# These are Windows script files and should use crlf -*.bat text eol=crlf - diff --git a/src/test/resources/test-applications/call-graph-test/.gitignore b/src/test/resources/test-applications/call-graph-test/.gitignore deleted file mode 100644 index 1b6985c0..00000000 --- a/src/test/resources/test-applications/call-graph-test/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -# Ignore Gradle project-specific cache directory -.gradle - -# Ignore Gradle build output directory -build diff --git a/src/test/resources/test-applications/call-graph-test/build.gradle b/src/test/resources/test-applications/call-graph-test/build.gradle deleted file mode 100644 index 709e182c..00000000 --- a/src/test/resources/test-applications/call-graph-test/build.gradle +++ /dev/null @@ -1,30 +0,0 @@ -plugins { - id 'application' -} - -repositories { - mavenCentral() -} - -java { - sourceCompatibility = JavaVersion.VERSION_11 - targetCompatibility = JavaVersion.VERSION_11 -} - -if (project.hasProperty('mainClass')) { - mainClassName = project.getProperty('mainClass') -} else { - // use a default - mainClassName =("org.example.User") -} - -sourceSets { - main { - java { - srcDirs = ["src/main/java"] - } - resources { - srcDirs = ["src/main/resources"] - } - } -} \ No newline at end of file diff --git a/src/test/resources/test-applications/call-graph-test/gradle/wrapper/gradle-wrapper.jar b/src/test/resources/test-applications/call-graph-test/gradle/wrapper/gradle-wrapper.jar deleted file mode 100644 index a4b76b95..00000000 Binary files a/src/test/resources/test-applications/call-graph-test/gradle/wrapper/gradle-wrapper.jar and /dev/null differ diff --git a/src/test/resources/test-applications/call-graph-test/gradle/wrapper/gradle-wrapper.properties b/src/test/resources/test-applications/call-graph-test/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index e18bc253..00000000 --- a/src/test/resources/test-applications/call-graph-test/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,7 +0,0 @@ -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.12.1-bin.zip -networkTimeout=10000 -validateDistributionUrl=true -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists diff --git a/src/test/resources/test-applications/call-graph-test/gradlew b/src/test/resources/test-applications/call-graph-test/gradlew deleted file mode 100755 index f3b75f3b..00000000 --- a/src/test/resources/test-applications/call-graph-test/gradlew +++ /dev/null @@ -1,251 +0,0 @@ -#!/bin/sh - -# -# Copyright © 2015-2021 the original authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# SPDX-License-Identifier: Apache-2.0 -# - -############################################################################## -# -# Gradle start up script for POSIX generated by Gradle. -# -# Important for running: -# -# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is -# noncompliant, but you have some other compliant shell such as ksh or -# bash, then to run this script, type that shell name before the whole -# command line, like: -# -# ksh Gradle -# -# Busybox and similar reduced shells will NOT work, because this script -# requires all of these POSIX shell features: -# * functions; -# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», -# «${var#prefix}», «${var%suffix}», and «$( cmd )»; -# * compound commands having a testable exit status, especially «case»; -# * various built-in commands including «command», «set», and «ulimit». -# -# Important for patching: -# -# (2) This script targets any POSIX shell, so it avoids extensions provided -# by Bash, Ksh, etc; in particular arrays are avoided. -# -# The "traditional" practice of packing multiple parameters into a -# space-separated string is a well documented source of bugs and security -# problems, so this is (mostly) avoided, by progressively accumulating -# options in "$@", and eventually passing that to Java. -# -# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, -# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; -# see the in-line comments for details. -# -# There are tweaks for specific operating systems such as AIX, CygWin, -# Darwin, MinGW, and NonStop. -# -# (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt -# within the Gradle project. -# -# You can find Gradle at https://github.com/gradle/gradle/. -# -############################################################################## - -# Attempt to set APP_HOME - -# Resolve links: $0 may be a link -app_path=$0 - -# Need this for daisy-chained symlinks. -while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] -do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac -done - -# This is normally unused -# shellcheck disable=SC2034 -APP_BASE_NAME=${0##*/} -# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) -APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit - -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD=maximum - -warn () { - echo "$*" -} >&2 - -die () { - echo - echo "$*" - echo - exit 1 -} >&2 - -# OS specific support (must be 'true' or 'false'). -cygwin=false -msys=false -darwin=false -nonstop=false -case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; -esac - -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar - - -# Determine the Java command to use to start the JVM. -if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -else - JAVACMD=java - if ! command -v java >/dev/null 2>&1 - then - die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -fi - -# Increase the maximum file descriptors if we can. -if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC2039,SC3045 - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC2039,SC3045 - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac -fi - -# Collect all arguments for the java command, stacking in reverse order: -# * args from the command line -# * the main class name -# * -classpath -# * -D...appname settings -# * --module-path (only if needed) -# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. - -# For Cygwin or MSYS, switch paths to Windows format before running java -if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - - JAVACMD=$( cygpath --unix "$JAVACMD" ) - - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done -fi - - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' - -# Collect all arguments for the java command: -# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, -# and any embedded shellness will be escaped. -# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be -# treated as '${Hostname}' itself on the command line. - -set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" - -# Stop when "xargs" is not available. -if ! command -v xargs >/dev/null 2>&1 -then - die "xargs is not available" -fi - -# Use "xargs" to parse quoted args. -# -# With -n1 it outputs one arg per line, with the quotes and backslashes removed. -# -# In Bash we could simply go: -# -# readarray ARGS < <( xargs -n1 <<<"$var" ) && -# set -- "${ARGS[@]}" "$@" -# -# but POSIX shell has neither arrays nor command substitution, so instead we -# post-process each arg (as a line of input to sed) to backslash-escape any -# character that might be a shell metacharacter, then use eval to reverse -# that process (while maintaining the separation between arguments), and wrap -# the whole thing up as a single "set" statement. -# -# This will of course break if any of these variables contains a newline or -# an unmatched quote. -# - -eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' - -exec "$JAVACMD" "$@" diff --git a/src/test/resources/test-applications/call-graph-test/gradlew.bat b/src/test/resources/test-applications/call-graph-test/gradlew.bat deleted file mode 100644 index 9d21a218..00000000 --- a/src/test/resources/test-applications/call-graph-test/gradlew.bat +++ /dev/null @@ -1,94 +0,0 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem -@rem SPDX-License-Identifier: Apache-2.0 -@rem - -@if "%DEBUG%"=="" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -set DIRNAME=%~dp0 -if "%DIRNAME%"=="" set DIRNAME=. -@rem This is normally unused -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if %ERRORLEVEL% equ 0 goto execute - -echo. 1>&2 -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 -echo. 1>&2 -echo Please set the JAVA_HOME variable in your environment to match the 1>&2 -echo location of your Java installation. 1>&2 - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto execute - -echo. 1>&2 -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 -echo. 1>&2 -echo Please set the JAVA_HOME variable in your environment to match the 1>&2 -echo location of your Java installation. 1>&2 - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* - -:end -@rem End local scope for the variables with windows NT shell -if %ERRORLEVEL% equ 0 goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -set EXIT_CODE=%ERRORLEVEL% -if %EXIT_CODE% equ 0 set EXIT_CODE=1 -if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% -exit /b %EXIT_CODE% - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega diff --git a/src/test/resources/test-applications/call-graph-test/settings.gradle b/src/test/resources/test-applications/call-graph-test/settings.gradle deleted file mode 100644 index 8a57a6e2..00000000 --- a/src/test/resources/test-applications/call-graph-test/settings.gradle +++ /dev/null @@ -1,11 +0,0 @@ -/* - * This file was generated by the Gradle 'init' task. - * - * The settings file is used to specify which projects to include in your build. - * - * Detailed information about configuring a multi-project build in Gradle can be found - * in the user manual at https://docs.gradle.org/7.6.4/userguide/multi_project_builds.html - * This project uses @Incubating APIs which are subject to change. - */ - -rootProject.name = 'call-graph-test' diff --git a/src/test/resources/test-applications/call-graph-test/src/main/java/org/example/User.java b/src/test/resources/test-applications/call-graph-test/src/main/java/org/example/User.java deleted file mode 100644 index ff1e1a6b..00000000 --- a/src/test/resources/test-applications/call-graph-test/src/main/java/org/example/User.java +++ /dev/null @@ -1,32 +0,0 @@ -package org.example; - -public class User { - - private String name; - public User(String name) - { - this.name = name; - } - - private void loglog() - { - this.name += " (logged in x2)"; - } - - private void log() - { - this.name += " (logged in)"; - loglog(); - } - - public String getName() - { - return this.name; - } - - String helloString() - { - log(); - return "Hello, " + this.getName(); - } -} diff --git a/src/test/resources/test-applications/daytrader8/.gitignore b/src/test/resources/test-applications/daytrader8/.gitignore deleted file mode 100644 index cd2aeaff..00000000 --- a/src/test/resources/test-applications/daytrader8/.gitignore +++ /dev/null @@ -1,11 +0,0 @@ -/.apt_generated/ -/target/ -/build/ -/bin/ -.classpath -.project -/.settings/ -/wlp/ -/openliberty/ -.factorypath -.DS_Store \ No newline at end of file diff --git a/src/test/resources/test-applications/daytrader8/Dockerfile b/src/test/resources/test-applications/daytrader8/Dockerfile deleted file mode 100644 index bce5ad82..00000000 --- a/src/test/resources/test-applications/daytrader8/Dockerfile +++ /dev/null @@ -1,14 +0,0 @@ -FROM open-liberty:full - -COPY --chown=1001:0 src/main/liberty/config/server.xml /config/server.xml -COPY --chown=1001:0 src/main/liberty/config/bootstrap.properties /config/bootstrap.properties -COPY --chown=1001:0 target/io.openliberty.sample.daytrader8.war /config/apps/ - -#Derby -COPY --chown=1001:0 target/liberty/wlp/usr/shared/resources/DerbyLibs/derby-10.14.2.0.jar /opt/ol/wlp/usr/shared/resources/DerbyLibs/derby-10.14.2.0.jar -COPY --chown=1001:0 target/liberty/wlp/usr/shared/resources/data /opt/ol/wlp/usr/shared/resources/data - -ENV MAX_USERS=1000 -ENV MAX_QUOTES=500 - -#RUN configure.sh diff --git a/src/test/resources/test-applications/daytrader8/Dockerfile-db2 b/src/test/resources/test-applications/daytrader8/Dockerfile-db2 deleted file mode 100644 index c32a54e8..00000000 --- a/src/test/resources/test-applications/daytrader8/Dockerfile-db2 +++ /dev/null @@ -1,21 +0,0 @@ -# Create folder db2jars/ and copy db2jcc4.jar and db2jcc_license_cu.jar to it. -# Set Env below - -FROM open-liberty:full - -COPY --chown=1001:0 src/main/liberty/config/server.xml_db2 /config/server.xml -COPY --chown=1001:0 src/main/liberty/config/bootstrap.properties /config/bootstrap.properties -COPY --chown=1001:0 target/io.openliberty.sample.daytrader8.war /config/apps/ - -# DB2 JARS -COPY --chown=1001:0 /db2jars /opt/ol/wlp/usr/shared/resources/db2jars - -ENV contextRoot=daytrader -ENV dbUser= -ENV dbPass= -ENV tradeDbHost= -ENV tradeDbPort= -ENV tradeDbName= - - -#RUN configure.sh diff --git a/src/test/resources/test-applications/daytrader8/LICENSE b/src/test/resources/test-applications/daytrader8/LICENSE deleted file mode 100644 index 8f71f43f..00000000 --- a/src/test/resources/test-applications/daytrader8/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "{}" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright {yyyy} {name of copyright owner} - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - diff --git a/src/test/resources/test-applications/daytrader8/README.md b/src/test/resources/test-applications/daytrader8/README.md deleted file mode 100644 index 595a96da..00000000 --- a/src/test/resources/test-applications/daytrader8/README.md +++ /dev/null @@ -1,45 +0,0 @@ -# Java EE8: DayTrader8 Sample - -This sample contains the DayTrader 8 benchmark, which is an application built around the paradigm of an online stock trading system. The application allows users to login, view their portfolio, lookup stock quotes, and buy or sell stock shares. With the aid of a Web-based load driver such as Apache JMeter, the real-world workload provided by DayTrader can be used to measure and compare the performance of Java Platform, Enterprise Edition (Java EE) application servers offered by a variety of vendors. In addition to the full workload, the application also contains a set of primitives used for functional and performance testing of various Java EE components and common design patterns. - -DayTrader is an end-to-end benchmark and performance sample application. It provides a real world Java EE workload. DayTrader's new design spans Java EE 8. - -This sample can be installed onto Liberty runtime versions 18.0.0.2 and later. A prebuilt derby database is provided in resources/data - - -To run this sample, first [download](https://github.com/OpenLiberty/sample.daytrader8/archive/master.zip) or clone this repo - to clone: -``` -git clone git@github.com:OpenLiberty/sample.daytrader8.git -``` - -From inside the sample.daytrader8 directory, build and start the application in Open Liberty with the following command: -``` -mvn clean package liberty:run -``` - -The server will listen on port 9080 by default. You can change the port (for example, to port 9081) by adding `mvn clean package liberty:run -DtestServerHttpPort=9081` to the end of the Maven command. - -Once the server is started, you should be able to access the application at: -http://localhost:9080/daytrader - - - -## Notice - -© Copyright IBM Corporation 2019. - -## License - -```text -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -```` diff --git a/src/test/resources/test-applications/daytrader8/README_LOAD_TEST.md b/src/test/resources/test-applications/daytrader8/README_LOAD_TEST.md deleted file mode 100644 index 23d468e1..00000000 --- a/src/test/resources/test-applications/daytrader8/README_LOAD_TEST.md +++ /dev/null @@ -1,151 +0,0 @@ -# Daytrader8: Load Testing -This readme explains how to setup DB2 and load test the Daytrader 8 application with Open Liberty. - -## Prerequisites - -1. Open Liberty Machine (Server with Open Liberty unzipped at , and a default profile created) -2. DB2 Machine (Server running DB2) -3. Driver Machine (Server running JMeter with jmeter files copied to /bin, and the WebSocket plugin copied to /lib/ext, see jmeter_files) - -## Setup Open Liberty - -Build Daytrader8; -[Download](https://github.com/OpenLiberty/sample.daytrader8/archive/master.zip) or clone this repo - to clone: -``` -git clone git@github.com:OpenLiberty/sample.daytrader8.git -``` - -From inside the sample.daytrader8 directory, build the application: -``` -mvn clean package -``` -* Copy target/io.openliberty.sample.daytrader8.war to /usr/servers/defaultServer/apps -* Copy src/main/liberty/config/server.xml_db2 to /usr/servers/defaultServer/server.xml (overwrite) -* Copy db2 jars from the DB2 Machine to /usr/shared/db2jars -``` -db2jcc4.jar -db2jcc_license_cu.jar -``` - -Create /usr/servers/defaultServer/jvm.options and add any JVM Arguments desired. -``` --Xms1024m --Xmx1024m -``` - -Set these environment variables. matching your environment (or hard code them in the server.xml): -``` -contextRoot=daytrader -dbUser -dbPass -tradeDbHost -tradeDbPort -tradeDbName -``` - -## Set up DB2 -Sign in to DB2 machine as db2 user and create tradedb database -``` -db2 create db tradedb -``` - -Note: When creating the database, DB2_APM_PERFORMANCE needs to be off, or you'll get: SQL1803N The requested operation cannot be executed in "No Package Lock" -``` -db2set DB2_APM_PERFORMANCE= -db2stop -db2start -``` - -## Load Database - -Start OpenLiberty: -``` -/bin/server start --clean -``` - -With a web browser go to http://openliberty-hostname:9080/daytrader/configure.html -``` -Click (Re)-create DayTrader Database Tables and Indexes -Click (Re)-populate DayTrader Database -``` - -Stop Liberty Server -``` -/bin/server stop -``` - -On the DB2 Server, Put the following into a script (backupTradeDB.sh) and run as the db2 user -``` -DB=tradedb -mkdir -p ~/backups/${DB} -db2 update dbm cfg using notifylevel 0 -db2 update dbm cfg using diaglevel 1 -db2 update dbm cfg using NUM_POOLAGENTS 500 automatic MAX_COORDAGENTS 500 automatic MAX_CONNECTIONS 500 automatic - -db2 -v update db cfg for ${DB} using MAXLOCKS 100 LOCKLIST 100000 - -db2 connect to ${DB} -db2 update db cfg for ${DB} using maxappls 500 automatic -db2 update db cfg for ${DB} using logfilsiz 8000 -db2 update db cfg for ${DB} using logprimary 32 -db2 update db cfg for ${DB} using dft_queryopt 0 - -db2 update db cfg for ${DB} using softmax 3000 -db2 update db cfg for ${DB} using chngpgs_thresh 99 - -db2 -v alter bufferpool IBMDEFAULTBP size -1 -db2 -v connect reset -db2 -v update db cfg for ${DB} using BUFFPAGE 262144 - -db2set DB2_APM_PERFORMANCE=ON -db2set DB2_KEEPTABLELOCK=CONNECTION -db2set DB2_USE_ALTERNATE_PAGE_CLEANING=ON -db2set DB2_MINIMIZE_LISTPREFETCH=YES -db2set DB2_LOGGER_NON_BUFFERED_IO=OFF - -db2 connect reset -db2 terminate - -db2stop force -db2start - -db2 connect to ${DB} -db2 reorgchk update statistics -db2 connect reset - -db2 terminate -db2 backup db tradedb to ~/backups/${DB} -``` - -Put the following into a script (restoreTradeDB.sh) to run before each server restart. (To make sure the database is in the same state every time) -``` -db2stop force -db2start -db2 restore db tradedb from ~/backups/tradedb replace existing -``` - -Note: If disk writing/reading becomes a bottleneck, you may need to create a ramdisk and restore the database to the ramdisk. - -## Apply Load -On the DB2 Server, restore the database (as db2 user) -``` -restoreTradeDB.sh -``` - -Start Liberty -``` -/bin/server start -``` - -On the JMETER Server, Start JMeter: -``` -cd /bin -./jmeter -n -t daytrader8.jmx -JHOST=openliberty-hostname -JDURATION=180 -``` - -Preferably, do three 180 second warm up runs and then three 180 second measurement runs with a 30 second break in between each. - -Also, a best practice is to reset the database between each run, which can be done on the configuration tab of the application. -``` -http://openliberty-hostname:9080/daytrader/config?action=resetTrade -``` diff --git a/src/test/resources/test-applications/daytrader8/jmeter_files/README.txt b/src/test/resources/test-applications/daytrader8/jmeter_files/README.txt deleted file mode 100644 index 50566ce0..00000000 --- a/src/test/resources/test-applications/daytrader8/jmeter_files/README.txt +++ /dev/null @@ -1,54 +0,0 @@ -# (C) Copyright IBM Corporation 2019, 2021. - # - # Licensed under the Apache License, Version 2.0 (the "License"); - # you may not use this file except in compliance with the License. - # You may obtain a copy of the License at - # - # http://www.apache.org/licenses/LICENSE-2.0 - # - # Unless required by applicable law or agreed to in writing, software - # distributed under the License is distributed on an "AS IS" BASIS, - # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - # See the License for the specific language governing permissions and - # limitations under the License. - - -daytrader8.jmx is an Apache JMeter script that may be used for running the DayTrader8 benchmark. - -Jmeter version 3.3 or later is highly recommended. -To use the script, you will need to put the the WebSocket Sampler (and dependencies) from WebSocket Samplers by Peter Doornbosch into lib/ext. -Use the Jmeter plugin manager or download via https://bitbucket.org/pjtr/jmeter-websocket-samplers. - - -The script has the following options: - -JHOST The name of the machine running the DayTrader Application. The default is localhost. - -JPORT The HTTP port of the server running the DayTrader Application. The default is 9080. - -JPROTOCOL The transport either http or https - -JTHREADS The number of jmeter threads to start. The default is 50. - -JRAMP The ramp up time for starting the threads. Set this to the same value as -JTHREADS for a smoother startup. The default is 0. - -JDURATION The time (in seconds) to run jmeter. - -JMAXTHINKTIME The time in milliseconds to wait between each call. The default is 0 ms - -JSTOCKS The total amount of stocks/quotes in the database, minus one. The default is 9999, which assumes there are 10,000 stocks in the database. - -JBOTUID The lowest user id. The default is 0. - -JTOPUID The highest user id. The default is 14999, which assumes there are 15,000 users in the database. - -Example: ./jmeter -n -t daytrader8.jmx -JHOST=myserver -JPORT=9080 -JPROTOCOL=http -JMAXTHINKTIME=100 -JDURATION=300 - -To see output every five seconds from JMeter, edit the following section in /bin/jmeter.properties - -#--------------------------------------------------------------------------- -# Summariser - Generate Summary Results - configuration (mainly applies to non-GUI mode) -#--------------------------------------------------------------------------- -# -# Define the following property to automatically start a summariser with that name -# (applies to non-GUI mode only) -summariser.name=summary -# -# interval between summaries (in seconds) default 30 seconds -summariser.interval=5 -# -# Write messages to log file -summariser.log=true -# -# Write messages to System.out -summariser.out=true diff --git a/src/test/resources/test-applications/daytrader8/jmeter_files/daytrader8.jmx b/src/test/resources/test-applications/daytrader8/jmeter_files/daytrader8.jmx deleted file mode 100644 index cfe98684..00000000 --- a/src/test/resources/test-applications/daytrader8/jmeter_files/daytrader8.jmx +++ /dev/null @@ -1,2607 +0,0 @@ - - - - - - false - false - - - - - - - - - false - -1 - - ${__P(THREADS,50)} - ${__P(RAMP,0)} - 1355173676000 - 1355173676000 - true - continue - ${__P(DURATION, 180)} - - true - - - - - false - false - rfc2109 - - - - - - User-Agent - Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; SV1; .NET CLR 1.1.4322) - - - Accept - image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */* - - - Accept-Language - en-us - - - - - - - - minimumuid - ${__P(BOTUID,0)} - = - - - maximumuid - ${__P(TOPUID,14999)} - = - - - hostname - ${__P(HOST,localhost)} - = - - - port - ${__P(PORT,9080)} - = - - - maxthinkingtime - ${__P(MAXTHINKTIME,0)} - = - - - maximumsid - ${__P(STOCKS,9999)} - = - - - protocol - ${__P(PROTOCOL,http)} - = - http | https - - - - - - ${minimumuid} - ${maximumuid} - 1 - logincounter - - false - - - - 1 - - - - 1 - true - 50 - - ThroughputController.percentThroughput - 10.0 - 0.0 - - - - - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/welcome.faces - POST - false - true - true - false - - HttpClient4 - - - - - - - - - true - ${jsfViewState} - = - true - javax.faces.ViewState - - - false - xxx - = - true - login:password - - - false - Log in - = - true - login:submit - - - false - uid:${logincounter} - = - true - login:uid - - - false - 1 - = - true - login_SUBMIT - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/welcome.faces - POST - false - true - true - false - - HttpClient4 - - - - - - - loop - - - - true - - - true - - - - - Ready to Trade - - Assertion.response_data - false - 2 - - - - - ${maxthinkingtime} - - - - - ${loop} - - - - 1 - - - - 1 - true - 1 - - ThroughputController.percentThroughput - 36.0 - 0.0 - - - - - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/quote.faces - GET - false - true - true - false - - HttpClient4 - - - - - - - - - true - ${jsfViewState} - = - true - javax.faces.ViewState - - - false - s:${__Random(0,${maximumsid},)} - = - true - quotes:symbols - - - false - quotes - = - true - quotes:submit2 - - - false - 1 - = - true - quotes_SUBMIT - - - false - 100 - = - true - quotes:quotes:0:quantity - - - false - 100 - = - true - quotes:quotes:1:quantity - - - false - 100 - = - true - quotes:quotes:2:quantity - - - false - 100 - = - true - quotes:quotes:3:quantity - - - false - 100 - = - true - quotes:quotes:4:quantity - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/quote.faces - POST - false - true - true - false - - HttpClient4 - - - - - - - DayTrader Quotes - - Assertion.response_data - false - 2 - - - - - ${maxthinkingtime} - - - - - - 1 - true - 1 - - ThroughputController.percentThroughput - 16.0 - 0.0 - - - - - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/tradehome.faces - GET - false - true - true - false - - HttpClient4 - - - - - - ${maxthinkingtime} - - - - - - 1 - true - 1 - - ThroughputController.percentThroughput - 15.0 - 0.0 - - - - - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/portfolio.faces - GET - false - true - true - false - - HttpClient4 - - - - - - ${maxthinkingtime} - - - - - - 1 - true - 1 - - ThroughputController.percentThroughput - 10.0 - 0.0 - - - - - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/account.faces - GET - false - true - true - false - - HttpClient4 - - - - - - ${maxthinkingtime} - - - - - - 1 - true - 1 - - ThroughputController.percentThroughput - 8.0 - 0.0 - - - - - ${__jexl3("${protocol}"== "http",)} - false - true - - - - true - false - ${hostname} - ${port} - /daytrader/marketsummary - false - {"action":"updateMarketSummary"} - 20000 - open and close - 20000 - false - - - - - ${maxthinkingtime} - - - - - - ${__jexl3("${protocol}"== "https",)} - false - true - - - - true - true - ${hostname} - ${port} - /daytrader/marketsummary - false - {"action":"updateMarketSummary"} - 20000 - open and close - 20000 - false - - - - - ${maxthinkingtime} - - - - - - - 1 - true - 1 - - ThroughputController.percentThroughput - 4.0 - 0.0 - - - - - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/quote.faces - GET - false - true - true - false - - HttpClient4 - - - - - - ${maxthinkingtime} - - - - - - - - true - ${jsfViewState} - = - true - javax.faces.ViewState - - - false - s:${__Random(0,${maximumsid},)} - = - true - quotes:symbols - - - false - quotes - = - true - quotes:submit2 - - - false - 1 - = - true - quotes_SUBMIT - - - false - 100 - = - true - quotes:quotes:0:quantity - - - false - 100 - = - true - quotes:quotes:1:quantity - - - false - 100 - = - true - quotes:quotes:2:quantity - - - false - 100 - = - true - quotes:quotes:3:quantity - - - false - 100 - = - true - quotes:quotes:4:quantity - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/quote.faces - POST - false - true - true - false - - HttpClient4 - - - - - - - DayTrader Quotes - - Assertion.response_data - false - 2 - - - - - ${maxthinkingtime} - - - - false - tobuy - s:([0-9]+) - $1$ - 0 - 1 - all - - - - - - - - true - ${jsfViewState} - = - true - javax.faces.ViewState - - - false - s:${tobuy} - = - true - quotes:symbols - - - false - ${__Random(1,200)} - = - true - quotes:quotes:0:quantity - - - false - buy - = - true - quotes:quotes:0:buy - - - false - 1 - = - true - quotes_SUBMIT - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/quote.faces - POST - false - true - true - false - - HttpClient4 - - - - - - - been submitted - - Assertion.response_data - false - 2 - - - - - ${maxthinkingtime} - - - - - - 1 - true - 1 - - ThroughputController.percentThroughput - 4.0 - 0.0 - - - - - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/portfolio.faces - GET - false - true - true - false - - HttpClient4 - - - - - - false - numHoldings - of Holdings: </b>([1-9][0-9]*)</td> - $1$ - 0 - 0 - all - - - - ${maxthinkingtime} - - - - - ${__jexl("${numHoldings}" != "0")} - false - true - - - - - - - true - ${jsfViewState} - = - true - javax.faces.ViewState - - - false - portfolio:holdings:0:sell - = - true - portfolio:_idcl - - - false - 1 - = - true - portfolio_SUBMIT - - - false - s:0,s:1,s:2,s:3,s:4 - = - true - portfolio:symbols - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/portfolio.faces - POST - false - true - true - false - - HttpClient4 - - - - - - - been submitted - - Assertion.response_data - false - 2 - - - - - ${maxthinkingtime} - - - - - - - 1 - true - 1 - - ThroughputController.percentThroughput - 2.0 - 0.0 - - - - - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/account.faces - GET - false - true - true - false - - HttpClient4 - - - - - - ${maxthinkingtime} - - - - - - - - true - ${jsfViewState} - = - true - javax.faces.ViewState - - - false - uid:${logincounter} - = - true - updateProfile:uid - - - false - rnd${__threadNum}${logincounter} - = - true - updateProfile:fullname - - - false - xxx - = - true - updateProfile:password - - - false - rndAddress - = - true - updateProfile:address - - - false - xxx - = - true - updateProfile:cpassword - - - false - rndCC - = - true - updateProfile:ccn - - - false - rndEmail@email.com - = - true - updateProfile:email - - - false - 1 - = - true - updateProfile_SUBMIT - - - false - Update Profile - = - true - updateProfile:submit - - - false - s:0,s:1,s:2,s:3,s:4 - = - true - updateProfile:symbols - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/account.faces - POST - false - true - true - false - - HttpClient4 - - - - - - ${maxthinkingtime} - - - - - - 1 - true - 1 - - ThroughputController.percentThroughput - 1.0 - 0.0 - - - - - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/tradehome.faces - GET - false - true - true - false - - HttpClient4 - - - - - - - - - true - ${jsfViewState} - = - true - javax.faces.ViewState - - - false - tradeHome:logoff - = - true - tradeHome:_idcl - - - false - s:0,s:1,s:2,s:3,s:4 - = - true - tradeHome:symbols - - - false - 1 - = - true - tradeHome_SUBMIT - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/tradehome.faces - POST - false - true - true - false - - HttpClient4 - - - - - - ${maxthinkingtime} - - - - - DayTrader Login - - Assertion.response_data - false - 2 - - - - - - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/register.faces - GET - false - true - true - false - - HttpClient4 - - - - - - - - - true - ${jsfViewState} - = - true - javax.faces.ViewState - - - false - first:${__Random(0,999,)} last:${__Random(0,4999,)} - = - true - register:fullname - - - false - first:${__Random(0,999,)} last:${__Random(0,4999,)} - = - true - register:address - - - false - uid${logincounter}@${__Random(0,100,)}.com - = - true - register:email - - - false - ru:${logincounter}${__threadNum}:${__time(HMS)}${__Random(0,999,)} - = - true - register:uid - - - false - yyy - = - true - register:password - - - false - yyy - = - true - register:cpassword - - - false - 1000000 - = - true - register:money - - - false - 123-fake-ccnum-456 - = - true - register:ccn - - - false - 1 - = - true - register_SUBMIT - - - false - Register - = - true - register:submit - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/register.faces - POST - false - true - true - false - - HttpClient4 - - - - - - ${maxthinkingtime} - - - - - Registration operation succeeded - - Assertion.response_data - false - 2 - - - - - - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/tradehome.faces - GET - false - true - true - false - - HttpClient4 - - - - - - - - - true - ${jsfViewState} - = - true - javax.faces.ViewState - - - false - tradeHome:logoff - = - true - tradeHome:_idcl - - - false - s:0,s:1,s:2,s:3,s:4 - = - true - tradeHome:symbols - - - false - 1 - = - true - tradeHome_SUBMIT - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/tradehome.faces - POST - false - true - true - false - - HttpClient4 - - - - - - ${maxthinkingtime} - - - - - DayTrader Login - - Assertion.response_data - false - 2 - - - - - - - loop - - - - false - - - false - - - - - 1 - true - 1 - - ThroughputController.percentThroughput - 4.0 - 0.0 - - - - - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/tradehome.faces - GET - false - true - true - false - - HttpClient4 - - - - - - - - - true - ${jsfViewState} - = - true - javax.faces.ViewState - - - false - tradeHome:logoff - = - true - tradeHome:_idcl - - - false - s:0,s:1,s:2,s:3,s:4 - = - true - tradeHome:symbols - - - false - 1 - = - true - tradeHome_SUBMIT - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/tradehome.faces - POST - false - true - true - false - - HttpClient4 - - - - - - ${maxthinkingtime} - - - - - DayTrader Login - - Assertion.response_data - false - 2 - - - - - - - loop - - - - false - - - false - - - - - - - false - jsfViewState - <input type="hidden" name="javax\.faces\.ViewState" id="j_id__v_0:javax\.faces\.ViewState:1" value="([^"]+)".*/> - $1$ - - 0 - - - - - 1 - true - 1 - - ThroughputController.percentThroughput - 70.0 - 0.0 - - - - - - - - true - uid:${logincounter} - = - true - uid - - - true - xxx - = - true - passwd - - - true - login - = - true - action - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/app - POST - false - true - true - false - - HttpClient4 - - - - - - - loop - - - - true - - - true - - - - - Welcome to DayTrader - - Assertion.response_data - false - 2 - - - - - ${maxthinkingtime} - - - - - ${__jexl3("${protocol}"== "http",)} - false - true - - - - false - ${hostname} - ${port} - /daytrader/marketsummary - 20000 - 20000 - - - - - ${__jexl3("${protocol}"== "https",)} - false - true - - - - true - ${hostname} - ${port} - /daytrader/marketsummary - 20000 - 20000 - - - - - ${loop} - - - - 1 - - - - 1 - true - 1 - - ThroughputController.percentThroughput - 36.0 - 0.0 - - - - - - - - true - quotes - = - true - action - - - true - s:${__Random(0,${maximumsid},)} - = - true - symbols - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/app - GET - false - true - true - false - - HttpClient4 - - - - - - - DayTrader: Quotes and Trading - - Assertion.response_data - false - 2 - - - - - ${maxthinkingtime} - - - - - - 1 - true - 1 - - ThroughputController.percentThroughput - 16.0 - 0.0 - - - - - - - - true - home - = - true - action - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/app - GET - false - true - true - false - - HttpClient4 - - - - - - ${maxthinkingtime} - - - - - - 1 - true - 1 - - ThroughputController.percentThroughput - 15.0 - 0.0 - - - - - - - - true - portfolio - = - true - action - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/app - GET - false - true - true - false - - HttpClient4 - - - - - - ${maxthinkingtime} - - - - - - 1 - true - 1 - - ThroughputController.percentThroughput - 10.0 - 0.0 - - - - - - - - true - account - = - true - action - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/app - GET - false - true - true - false - - HttpClient4 - - - - - - ${maxthinkingtime} - - - - - - 1 - true - 1 - - ThroughputController.percentThroughput - 8.0 - 0.0 - - - - - false - false - ${hostname} - ${port} - /daytrader/marketsummary - false - {"action":"updateMarketSummary"} - 20000 - use existing open connection - 20000 - false - - - - - ${maxthinkingtime} - - - - - - 1 - true - 1 - - ThroughputController.percentThroughput - 4.0 - 0.0 - - - - - - - - true - quotes - = - true - action - - - true - s:${__Random(0,${maximumsid},tobuy)} - = - true - symbols - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/app - GET - false - true - true - false - - HttpClient4 - - - - - - ${maxthinkingtime} - - - - - - - - true - buy - = - true - action - - - true - s:${tobuy} - = - true - symbol - - - true - ${__Random(1,200)} - = - true - quantity - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/app - GET - false - true - true - false - - HttpClient4 - - - - - - - has been submitted - - Assertion.response_data - false - 2 - - - - - ${maxthinkingtime} - - - - - - 1 - true - 1 - - ThroughputController.percentThroughput - 4.0 - 0.0 - - - - - - - - true - portfolio - = - true - action - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/app - GET - false - true - true - false - - HttpClient4 - - - - - - false - firstHoldingID - holdingID=([0-9]+) - $1$ - NotFound - 0 - all - - - - false - firstHoldingIDBool - holdingID=([0-9]+) - true - false - 1 - all - - - - ${maxthinkingtime} - - - - - ${firstHoldingIDBool} - false - true - - - - - - - true - sell - = - true - action - - - true - ${firstHoldingID} - = - true - holdingID - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/app - GET - false - true - true - false - - HttpClient4 - - - - - - - has been submitted - - Assertion.response_data - false - 2 - - - - - ${maxthinkingtime} - - - - - - - 1 - true - 1 - - ThroughputController.percentThroughput - 2.0 - 0.0 - - - - - - - - true - account - = - true - action - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/app - GET - false - true - true - false - - HttpClient4 - - - - - - ${maxthinkingtime} - - - - - - - - true - update_profile - = - true - action - - - true - uid:${logincounter} - = - true - userID - - - true - rnd${__threadNum}${logincounter} - = - true - fullname - - - true - xxx - = - true - password - - - true - rndAddress - = - true - address - - - true - xxx - = - true - cpassword - - - true - rndCC - = - true - creditcard - - - true - rndEmail@email.com - = - true - email - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/app - GET - false - true - true - false - - HttpClient4 - - - - - - ${maxthinkingtime} - - - - - - 1 - true - 1 - - ThroughputController.percentThroughput - 1.0 - 0.0 - - - - - - - - true - logout - = - true - action - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/app - GET - false - true - true - false - - HttpClient4 - - - - - - ${maxthinkingtime} - - - - - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/register.jsp - GET - false - true - true - false - - HttpClient4 - - - - - - ${maxthinkingtime} - - - - - - - - true - register - = - true - action - - - true - first:${__Random(0,999,)} last:${__Random(0,4999,)} - = - true - Full Name - - - true - first:${__Random(0,999,)} last:${__Random(0,4999,)} - = - true - snail mail - - - true - uid${logincounter}@${__Random(0,100,)}.com - = - true - email - - - true - ru:${logincounter}${__threadNum}:${__time(HMS)}${__Random(0,999,)} - = - true - user id - - - true - yyy - = - true - passwd - - - true - yyy - = - true - confirm passwd - - - true - 1000000 - = - true - money - - - true - 123-fake-ccnum-456 - = - true - Credit Card Number - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/app - GET - false - true - true - false - - HttpClient4 - - - - - - ${maxthinkingtime} - - - - - - - - true - logout - = - true - action - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/app - GET - false - true - true - false - - HttpClient4 - - - - - - ${maxthinkingtime} - - - - - - loop - - - - false - - - false - - - - - 1 - true - 1 - - ThroughputController.percentThroughput - 4.0 - 0.0 - - - - - - - - true - logout - = - true - action - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/app - GET - false - true - true - false - - HttpClient4 - - - - - - ${maxthinkingtime} - - - - - DayTrader Login - - Assertion.response_data - false - 2 - - - - - - - loop - - - - false - - - false - - - - - - - 4000 - 6000 - - - - - 1 - true - 1 - - ThroughputController.percentThroughput - 20.0 - 0.0 - - - - - - - - true - s:${__Random(0,${maximumsid},)} - = - true - symbols - - - - ${hostname} - ${port} - ${protocol} - - daytrader/rest/quotes - POST - false - true - true - false - - - - - - - - 200 - - Assertion.response_code - false - 2 - - - - - ${maxthinkingtime} - - - - - - - - false - - saveConfig - - - true - true - true - - true - true - true - true - false - true - true - false - false - true - false - false - false - false - false - 0 - true - true - true - true - - - daytrader8.aggregateReport.csv - - - - true - - saveConfig - - - true - true - true - - true - true - true - true - false - true - true - false - false - false - false - false - false - false - false - 0 - true - true - true - true - - - daytrader8.resultsTree.csv - - - - false - - saveConfig - - - true - true - true - - true - true - true - true - false - true - true - false - false - true - false - false - false - false - false - 0 - true - true - true - true - - - daytrader8.resultsTable.csv - - - - - diff --git a/src/test/resources/test-applications/daytrader8/jmeter_files/daytrader8_mojarra.jmx b/src/test/resources/test-applications/daytrader8/jmeter_files/daytrader8_mojarra.jmx deleted file mode 100755 index bcb3d4fa..00000000 --- a/src/test/resources/test-applications/daytrader8/jmeter_files/daytrader8_mojarra.jmx +++ /dev/null @@ -1,2600 +0,0 @@ - - - - - - false - false - - - - - - - - - false - -1 - - ${__P(THREADS,50)} - ${__P(RAMP,0)} - 1355173676000 - 1355173676000 - true - continue - ${__P(DURATION, 180)} - - true - - - - - false - false - rfc2109 - - - - - - User-Agent - Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; SV1; .NET CLR 1.1.4322) - - - Accept - image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */* - - - Accept-Language - en-us - - - - - - - - minimumuid - ${__P(BOTUID,0)} - = - - - maximumuid - ${__P(TOPUID,14999)} - = - - - hostname - ${__P(HOST,localhost)} - = - - - port - ${__P(PORT,9080)} - = - - - maxthinkingtime - ${__P(MAXTHINKTIME,0)} - = - - - maximumsid - ${__P(STOCKS,9999)} - = - - - protocol - ${__P(PROTOCOL,http)} - = - http | https - - - - - - ${minimumuid} - ${maximumuid} - 1 - logincounter - - false - - - - 1 - - - - 1 - true - 50 - - ThroughputController.percentThroughput - 10.0 - 0.0 - - - - - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/welcome.faces - POST - false - true - true - false - - HttpClient4 - - - - - - - - - false - ${jsfViewState} - = - true - javax.faces.ViewState - - - false - xxx - = - true - login:password - - - false - Log in - = - true - login:submit - - - false - uid:${logincounter} - = - true - login:uid - - - false - login - = - true - login - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/welcome.faces - POST - false - true - true - false - - HttpClient4 - - - - - - - loop - - - - true - - - true - - - - - Ready to Trade - - Assertion.response_data - false - 2 - - - - - ${maxthinkingtime} - - - - - ${loop} - - - - 1 - - - - 1 - true - 1 - - ThroughputController.percentThroughput - 36.0 - 0.0 - - - - - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/quote.faces - GET - false - true - true - false - - HttpClient4 - - - - - - - - - true - ${jsfViewState} - = - true - javax.faces.ViewState - - - false - s:${__Random(0,${maximumsid},)} - = - true - quotes:symbols - - - false - quotes - = - true - quotes:submit - - - false - quotes - = - true - quotes - - - false - 100 - = - true - quotes:quotes:0:quantity - - - false - 100 - = - true - quotes:quotes:1:quantity - - - false - 100 - = - true - quotes:quotes:2:quantity - - - false - 100 - = - true - quotes:quotes:3:quantity - - - false - 100 - = - true - quotes:quotes:4:quantity - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/quote.faces - POST - false - true - true - false - - HttpClient4 - - - - - - - DayTrader Quotes - - Assertion.response_data - false - 2 - - - - - ${maxthinkingtime} - - - - - - 1 - true - 1 - - ThroughputController.percentThroughput - 16.0 - 0.0 - - - - - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/tradehome.faces - GET - false - true - true - false - - HttpClient4 - - - - - - ${maxthinkingtime} - - - - - - 1 - true - 1 - - ThroughputController.percentThroughput - 15.0 - 0.0 - - - - - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/portfolio.faces - GET - false - true - true - false - - HttpClient4 - - - - - - ${maxthinkingtime} - - - - - - 1 - true - 1 - - ThroughputController.percentThroughput - 10.0 - 0.0 - - - - - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/account.faces - GET - false - true - true - false - - HttpClient4 - - - - - - ${maxthinkingtime} - - - - - - 1 - true - 1 - - ThroughputController.percentThroughput - 8.0 - 0.0 - - - - - ${__jexl3("${protocol}"== "http",)} - false - true - - - - true - false - ${hostname} - ${port} - /daytrader/marketsummary - false - {"action":"updateMarketSummary"} - 20000 - open and close - 20000 - false - - - - - ${maxthinkingtime} - - - - - - ${__jexl3("${protocol}"== "https",)} - false - true - - - - true - true - ${hostname} - ${port} - /daytrader/marketsummary - false - {"action":"updateMarketSummary"} - 20000 - open and close - 20000 - false - - - - - ${maxthinkingtime} - - - - - - - 1 - true - 1 - - ThroughputController.percentThroughput - 4.0 - 0.0 - - - - - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/quote.faces - GET - false - true - true - false - - HttpClient4 - - - - - - ${maxthinkingtime} - - - - - - - - true - ${jsfViewState} - = - true - javax.faces.ViewState - - - false - s:${__Random(0,${maximumsid},)} - = - true - quotes:symbols - - - false - quotes - = - true - quotes:submit - - - false - quotes - = - true - quotes - - - false - 100 - = - true - quotes:quotes:0:quantity - - - false - 100 - = - true - quotes:quotes:1:quantity - - - false - 100 - = - true - quotes:quotes:2:quantity - - - false - 100 - = - true - quotes:quotes:3:quantity - - - false - 100 - = - true - quotes:quotes:4:quantity - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/quote.faces - POST - false - true - true - false - - HttpClient4 - - - - - - - DayTrader Quotes - - Assertion.response_data - false - 2 - - - - - ${maxthinkingtime} - - - - false - tobuy - s:([0-9]+) - $1$ - 0 - 1 - all - - - - - - - - true - ${jsfViewState} - = - true - javax.faces.ViewState - - - false - s:${tobuy} - = - true - quotes:symbols - - - false - ${__Random(1,200)} - = - true - quotes:quotes:0:quantity - - - false - buy - = - true - quotes:quotes:0:buy - - - false - quotes - = - true - quotes - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/quote.faces - POST - false - true - true - false - - HttpClient4 - - - - - - - been submitted - - Assertion.response_data - false - 2 - - - - - ${maxthinkingtime} - - - - - - 1 - true - 1 - - ThroughputController.percentThroughput - 4.0 - 0.0 - - - - - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/portfolio.faces - GET - false - true - true - false - - HttpClient4 - - - - - - false - numHoldings - of Holdings: </b>([1-9][0-9]*)</td> - $1$ - 0 - 0 - all - - - - ${maxthinkingtime} - - - - - ${__jexl("${numHoldings}" != "0")} - false - true - - - - - - - true - ${jsfViewState} - = - true - javax.faces.ViewState - - - false - portfolio:holdings:0:sell - = - true - portfolio:holdings:0:sell - - - false - portfolio - = - true - portfolio - - - false - s:0,s:1,s:2,s:3,s:4 - = - true - portfolio:symbols - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/portfolio.faces - POST - false - true - true - false - - HttpClient4 - - - - - - - been submitted - - Assertion.response_data - false - 2 - - - - - ${maxthinkingtime} - - - - - - - 1 - true - 1 - - ThroughputController.percentThroughput - 2.0 - 0.0 - - - - - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/account.faces - GET - false - true - true - false - - HttpClient4 - - - - - - ${maxthinkingtime} - - - - - - - - true - ${jsfViewState} - = - true - javax.faces.ViewState - - - false - uid:${logincounter} - = - true - updateProfile:uid - - - false - rnd${__threadNum}${logincounter} - = - true - updateProfile:fullname - - - false - xxx - = - true - updateProfile:password - - - false - rndAddress - = - true - updateProfile:address - - - false - xxx - = - true - updateProfile:cpassword - - - false - rndCC - = - true - updateProfile:ccn - - - false - rndEmail@email.com - = - true - updateProfile:email - - - false - updateProfile - = - true - updateProfile - - - false - Update Profile - = - true - updateProfile:submit - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/account.faces - POST - false - true - true - false - - HttpClient4 - - - - - - ${maxthinkingtime} - - - - - - 1 - true - 1 - - ThroughputController.percentThroughput - 1.0 - 0.0 - - - - - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/tradehome.faces - GET - false - true - true - false - - HttpClient4 - - - - - - - - - true - ${jsfViewState} - = - true - javax.faces.ViewState - - - false - tradeHome:logoff - = - true - tradeHome:logoff - - - false - s:1,s:2,s:3,s:4 - = - true - tradeHome:symbols - - - false - tradeHome - = - true - tradeHome - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/tradehome.faces - POST - false - true - true - false - - HttpClient4 - - - - - - ${maxthinkingtime} - - - - - DayTrader Login - - Assertion.response_data - false - 2 - - - - - - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/register.faces - GET - false - true - true - false - - HttpClient4 - - - - - - - - - true - ${jsfViewState} - = - true - javax.faces.ViewState - - - false - first:${__Random(0,999,)} last:${__Random(0,4999,)} - = - true - register:fullname - - - false - first:${__Random(0,999,)} last:${__Random(0,4999,)} - = - true - register:address - - - false - uid${logincounter}@${__Random(0,100,)}.com - = - true - register:email - - - false - ru:${logincounter}${__threadNum}:${__time(HMS)}${__Random(0,999,)} - = - true - register:uid - - - false - yyy - = - true - register:password - - - false - yyy - = - true - register:cpassword - - - false - 1000000 - = - true - register:money - - - false - 123-fake-ccnum-456 - = - true - register:ccn - - - false - register - = - true - register - - - false - Register - = - true - register:submit - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/register.faces - POST - false - true - true - false - - HttpClient4 - - - - - - ${maxthinkingtime} - - - - - Registration operation succeeded - - Assertion.response_data - false - 2 - - - - - - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/tradehome.faces - GET - false - true - true - false - - HttpClient4 - - - - - - - - - true - ${jsfViewState} - = - true - javax.faces.ViewState - - - false - tradeHome:logoff - = - true - tradeHome:logoff - - - false - s:1,s:2,s:3,s:4 - = - true - tradeHome:symbols - - - false - tradeHome - = - true - tradeHome - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/tradehome.faces - POST - false - true - true - false - - HttpClient4 - - - - - - ${maxthinkingtime} - - - - - DayTrader Login - - Assertion.response_data - false - 2 - - - - - - - loop - - - - false - - - false - - - - - 1 - true - 1 - - ThroughputController.percentThroughput - 4.0 - 0.0 - - - - - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/tradehome.faces - GET - false - true - true - false - - HttpClient4 - - - - - - - - - true - ${jsfViewState} - = - true - javax.faces.ViewState - - - false - tradeHome:logoff - = - true - tradeHome:logoff - - - false - s:0,s:1,s:2,s:3,s:4 - = - true - tradeHome:symbols - - - false - tradeHome - = - true - tradeHome - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/tradehome.faces - POST - false - true - true - false - - HttpClient4 - - - - - - ${maxthinkingtime} - - - - - DayTrader Login - - Assertion.response_data - false - 2 - - - - - - - loop - - - - false - - - false - - - - - - - false - jsfViewState - <input type="hidden" name="javax\.faces\.ViewState" .* value="([^"]+)".*/> - $1$ - - 0 - - - - - 1 - true - 1 - - ThroughputController.percentThroughput - 70.0 - 0.0 - - - - - - - - true - uid:${logincounter} - = - true - uid - - - true - xxx - = - true - passwd - - - true - login - = - true - action - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/app - POST - false - true - true - false - - HttpClient4 - - - - - - - loop - - - - true - - - true - - - - - Welcome to DayTrader - - Assertion.response_data - false - 2 - - - - - ${maxthinkingtime} - - - - - ${__jexl3("${protocol}"== "http",)} - false - true - - - - false - ${hostname} - ${port} - /daytrader/marketsummary - 20000 - 20000 - - - - - ${__jexl3("${protocol}"== "https",)} - false - true - - - - true - ${hostname} - ${port} - /daytrader/marketsummary - 20000 - 20000 - - - - - ${loop} - - - - 1 - - - - 1 - true - 1 - - ThroughputController.percentThroughput - 36.0 - 0.0 - - - - - - - - true - quotes - = - true - action - - - true - s:${__Random(0,${maximumsid},)} - = - true - symbols - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/app - GET - false - true - true - false - - HttpClient4 - - - - - - - DayTrader: Quotes and Trading - - Assertion.response_data - false - 2 - - - - - ${maxthinkingtime} - - - - - - 1 - true - 1 - - ThroughputController.percentThroughput - 16.0 - 0.0 - - - - - - - - true - home - = - true - action - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/app - GET - false - true - true - false - - HttpClient4 - - - - - - ${maxthinkingtime} - - - - - - 1 - true - 1 - - ThroughputController.percentThroughput - 15.0 - 0.0 - - - - - - - - true - portfolio - = - true - action - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/app - GET - false - true - true - false - - HttpClient4 - - - - - - ${maxthinkingtime} - - - - - - 1 - true - 1 - - ThroughputController.percentThroughput - 10.0 - 0.0 - - - - - - - - true - account - = - true - action - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/app - GET - false - true - true - false - - HttpClient4 - - - - - - ${maxthinkingtime} - - - - - - 1 - true - 1 - - ThroughputController.percentThroughput - 8.0 - 0.0 - - - - - false - false - ${hostname} - ${port} - /daytrader/marketsummary - false - {"action":"updateMarketSummary"} - 20000 - use existing open connection - 20000 - false - - - - - ${maxthinkingtime} - - - - - - 1 - true - 1 - - ThroughputController.percentThroughput - 4.0 - 0.0 - - - - - - - - true - quotes - = - true - action - - - true - s:${__Random(0,${maximumsid},tobuy)} - = - true - symbols - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/app - GET - false - true - true - false - - HttpClient4 - - - - - - ${maxthinkingtime} - - - - - - - - true - buy - = - true - action - - - true - s:${tobuy} - = - true - symbol - - - true - ${__Random(1,200)} - = - true - quantity - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/app - GET - false - true - true - false - - HttpClient4 - - - - - - - has been submitted - - Assertion.response_data - false - 2 - - - - - ${maxthinkingtime} - - - - - - 1 - true - 1 - - ThroughputController.percentThroughput - 4.0 - 0.0 - - - - - - - - true - portfolio - = - true - action - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/app - GET - false - true - true - false - - HttpClient4 - - - - - - false - firstHoldingID - holdingID=([0-9]+) - $1$ - NotFound - 0 - all - - - - false - firstHoldingIDBool - holdingID=([0-9]+) - true - false - 1 - all - - - - ${maxthinkingtime} - - - - - ${firstHoldingIDBool} - false - true - - - - - - - true - sell - = - true - action - - - true - ${firstHoldingID} - = - true - holdingID - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/app - GET - false - true - true - false - - HttpClient4 - - - - - - - has been submitted - - Assertion.response_data - false - 2 - - - - - ${maxthinkingtime} - - - - - - - 1 - true - 1 - - ThroughputController.percentThroughput - 2.0 - 0.0 - - - - - - - - true - account - = - true - action - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/app - GET - false - true - true - false - - HttpClient4 - - - - - - ${maxthinkingtime} - - - - - - - - true - update_profile - = - true - action - - - true - uid:${logincounter} - = - true - userID - - - true - rnd${__threadNum}${logincounter} - = - true - fullname - - - true - xxx - = - true - password - - - true - rndAddress - = - true - address - - - true - xxx - = - true - cpassword - - - true - rndCC - = - true - creditcard - - - true - rndEmail@email.com - = - true - email - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/app - GET - false - true - true - false - - HttpClient4 - - - - - - ${maxthinkingtime} - - - - - - 1 - true - 1 - - ThroughputController.percentThroughput - 1.0 - 0.0 - - - - - - - - true - logout - = - true - action - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/app - GET - false - true - true - false - - HttpClient4 - - - - - - ${maxthinkingtime} - - - - - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/register.jsp - GET - false - true - true - false - - HttpClient4 - - - - - - ${maxthinkingtime} - - - - - - - - true - register - = - true - action - - - true - first:${__Random(0,999,)} last:${__Random(0,4999,)} - = - true - Full Name - - - true - first:${__Random(0,999,)} last:${__Random(0,4999,)} - = - true - snail mail - - - true - uid${logincounter}@${__Random(0,100,)}.com - = - true - email - - - true - ru:${logincounter}${__threadNum}:${__time(HMS)}${__Random(0,999,)} - = - true - user id - - - true - yyy - = - true - passwd - - - true - yyy - = - true - confirm passwd - - - true - 1000000 - = - true - money - - - true - 123-fake-ccnum-456 - = - true - Credit Card Number - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/app - GET - false - true - true - false - - HttpClient4 - - - - - - ${maxthinkingtime} - - - - - - - - true - logout - = - true - action - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/app - GET - false - true - true - false - - HttpClient4 - - - - - - ${maxthinkingtime} - - - - - - loop - - - - false - - - false - - - - - 1 - true - 1 - - ThroughputController.percentThroughput - 4.0 - 0.0 - - - - - - - - true - logout - = - true - action - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/app - GET - false - true - true - false - - HttpClient4 - - - - - - ${maxthinkingtime} - - - - - DayTrader Login - - Assertion.response_data - false - 2 - - - - - - - loop - - - - false - - - false - - - - - - - 4000 - 6000 - - - - - 1 - true - 1 - - ThroughputController.percentThroughput - 20.0 - 0.0 - - - - - - - - true - s:${__Random(0,${maximumsid},)} - = - true - symbols - - - - ${hostname} - ${port} - ${protocol} - - daytrader/rest/quotes - POST - false - true - true - false - - - - - - - - 200 - - Assertion.response_code - false - 2 - - - - - ${maxthinkingtime} - - - - - - - - false - - saveConfig - - - true - true - true - - true - true - true - true - false - true - true - false - false - true - false - false - false - false - false - 0 - true - true - true - true - - - daytrader8.aggregateReport.csv - - - - true - - saveConfig - - - true - true - true - - true - true - true - true - false - true - true - false - false - false - false - false - false - false - false - 0 - true - true - true - true - - - daytrader8.resultsTree.csv - - - - false - - saveConfig - - - true - true - true - - true - true - true - true - false - true - true - false - false - true - false - false - false - false - false - 0 - true - true - true - true - - - daytrader8.resultsTable.csv - - - - - diff --git a/src/test/resources/test-applications/daytrader8/jmeter_files/daytrader8_mojarra_no_ws.jmx b/src/test/resources/test-applications/daytrader8/jmeter_files/daytrader8_mojarra_no_ws.jmx deleted file mode 100644 index d294427d..00000000 --- a/src/test/resources/test-applications/daytrader8/jmeter_files/daytrader8_mojarra_no_ws.jmx +++ /dev/null @@ -1,2600 +0,0 @@ - - - - - - false - false - - - - - - - - - false - -1 - - ${__P(THREADS,50)} - ${__P(RAMP,0)} - 1355173676000 - 1355173676000 - true - continue - ${__P(DURATION, 180)} - - true - - - - - false - false - rfc2109 - - - - - - User-Agent - Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; SV1; .NET CLR 1.1.4322) - - - Accept - image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */* - - - Accept-Language - en-us - - - - - - - - minimumuid - ${__P(BOTUID,0)} - = - - - maximumuid - ${__P(TOPUID,14999)} - = - - - hostname - ${__P(HOST,localhost)} - = - - - port - ${__P(PORT,9080)} - = - - - maxthinkingtime - ${__P(MAXTHINKTIME,0)} - = - - - maximumsid - ${__P(STOCKS,9999)} - = - - - protocol - ${__P(PROTOCOL,http)} - = - http | https - - - - - - ${minimumuid} - ${maximumuid} - 1 - logincounter - - false - - - - 1 - - - - 1 - true - 50 - - ThroughputController.percentThroughput - 10.0 - 0.0 - - - - - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/welcome.faces - POST - false - true - true - false - - HttpClient4 - - - - - - - - - false - ${jsfViewState} - = - true - javax.faces.ViewState - - - false - xxx - = - true - login:password - - - false - Log in - = - true - login:submit - - - false - uid:${logincounter} - = - true - login:uid - - - false - login - = - true - login - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/welcome.faces - POST - false - true - true - false - - HttpClient4 - - - - - - - loop - - - - true - - - true - - - - - Ready to Trade - - Assertion.response_data - false - 2 - - - - - ${maxthinkingtime} - - - - - ${loop} - - - - 1 - - - - 1 - true - 1 - - ThroughputController.percentThroughput - 36.0 - 0.0 - - - - - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/quote.faces - GET - false - true - true - false - - HttpClient4 - - - - - - - - - true - ${jsfViewState} - = - true - javax.faces.ViewState - - - false - s:${__Random(0,${maximumsid},)} - = - true - quotes:symbols - - - false - quotes - = - true - quotes:submit - - - false - quotes - = - true - quotes - - - false - 100 - = - true - quotes:quotes:0:quantity - - - false - 100 - = - true - quotes:quotes:1:quantity - - - false - 100 - = - true - quotes:quotes:2:quantity - - - false - 100 - = - true - quotes:quotes:3:quantity - - - false - 100 - = - true - quotes:quotes:4:quantity - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/quote.faces - POST - false - true - true - false - - HttpClient4 - - - - - - - DayTrader Quotes - - Assertion.response_data - false - 2 - - - - - ${maxthinkingtime} - - - - - - 1 - true - 1 - - ThroughputController.percentThroughput - 16.0 - 0.0 - - - - - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/tradehome.faces - GET - false - true - true - false - - HttpClient4 - - - - - - ${maxthinkingtime} - - - - - - 1 - true - 1 - - ThroughputController.percentThroughput - 15.0 - 0.0 - - - - - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/portfolio.faces - GET - false - true - true - false - - HttpClient4 - - - - - - ${maxthinkingtime} - - - - - - 1 - true - 1 - - ThroughputController.percentThroughput - 10.0 - 0.0 - - - - - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/account.faces - GET - false - true - true - false - - HttpClient4 - - - - - - ${maxthinkingtime} - - - - - - 1 - true - 1 - - ThroughputController.percentThroughput - 8.0 - 0.0 - - - - - ${__jexl3("${protocol}"== "http",)} - false - true - - - - true - false - ${hostname} - ${port} - /daytrader/marketsummary - false - {"action":"updateMarketSummary"} - 20000 - open and close - 20000 - false - - - - - ${maxthinkingtime} - - - - - - ${__jexl3("${protocol}"== "https",)} - false - true - - - - true - true - ${hostname} - ${port} - /daytrader/marketsummary - false - {"action":"updateMarketSummary"} - 20000 - open and close - 20000 - false - - - - - ${maxthinkingtime} - - - - - - - 1 - true - 1 - - ThroughputController.percentThroughput - 4.0 - 0.0 - - - - - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/quote.faces - GET - false - true - true - false - - HttpClient4 - - - - - - ${maxthinkingtime} - - - - - - - - true - ${jsfViewState} - = - true - javax.faces.ViewState - - - false - s:${__Random(0,${maximumsid},)} - = - true - quotes:symbols - - - false - quotes - = - true - quotes:submit - - - false - quotes - = - true - quotes - - - false - 100 - = - true - quotes:quotes:0:quantity - - - false - 100 - = - true - quotes:quotes:1:quantity - - - false - 100 - = - true - quotes:quotes:2:quantity - - - false - 100 - = - true - quotes:quotes:3:quantity - - - false - 100 - = - true - quotes:quotes:4:quantity - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/quote.faces - POST - false - true - true - false - - HttpClient4 - - - - - - - DayTrader Quotes - - Assertion.response_data - false - 2 - - - - - ${maxthinkingtime} - - - - false - tobuy - s:([0-9]+) - $1$ - 0 - 1 - all - - - - - - - - true - ${jsfViewState} - = - true - javax.faces.ViewState - - - false - s:${tobuy} - = - true - quotes:symbols - - - false - ${__Random(1,200)} - = - true - quotes:quotes:0:quantity - - - false - buy - = - true - quotes:quotes:0:buy - - - false - quotes - = - true - quotes - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/quote.faces - POST - false - true - true - false - - HttpClient4 - - - - - - - been submitted - - Assertion.response_data - false - 2 - - - - - ${maxthinkingtime} - - - - - - 1 - true - 1 - - ThroughputController.percentThroughput - 4.0 - 0.0 - - - - - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/portfolio.faces - GET - false - true - true - false - - HttpClient4 - - - - - - false - numHoldings - of Holdings: </b>([1-9][0-9]*)</td> - $1$ - 0 - 0 - all - - - - ${maxthinkingtime} - - - - - ${__jexl("${numHoldings}" != "0")} - false - true - - - - - - - true - ${jsfViewState} - = - true - javax.faces.ViewState - - - false - portfolio:holdings:0:sell - = - true - portfolio:holdings:0:sell - - - false - portfolio - = - true - portfolio - - - false - s:0,s:1,s:2,s:3,s:4 - = - true - portfolio:symbols - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/portfolio.faces - POST - false - true - true - false - - HttpClient4 - - - - - - - been submitted - - Assertion.response_data - false - 2 - - - - - ${maxthinkingtime} - - - - - - - 1 - true - 1 - - ThroughputController.percentThroughput - 2.0 - 0.0 - - - - - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/account.faces - GET - false - true - true - false - - HttpClient4 - - - - - - ${maxthinkingtime} - - - - - - - - true - ${jsfViewState} - = - true - javax.faces.ViewState - - - false - uid:${logincounter} - = - true - updateProfile:uid - - - false - rnd${__threadNum}${logincounter} - = - true - updateProfile:fullname - - - false - xxx - = - true - updateProfile:password - - - false - rndAddress - = - true - updateProfile:address - - - false - xxx - = - true - updateProfile:cpassword - - - false - rndCC - = - true - updateProfile:ccn - - - false - rndEmail@email.com - = - true - updateProfile:email - - - false - updateProfile - = - true - updateProfile - - - false - Update Profile - = - true - updateProfile:submit - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/account.faces - POST - false - true - true - false - - HttpClient4 - - - - - - ${maxthinkingtime} - - - - - - 1 - true - 1 - - ThroughputController.percentThroughput - 1.0 - 0.0 - - - - - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/tradehome.faces - GET - false - true - true - false - - HttpClient4 - - - - - - - - - true - ${jsfViewState} - = - true - javax.faces.ViewState - - - false - tradeHome:logoff - = - true - tradeHome:logoff - - - false - s:1,s:2,s:3,s:4 - = - true - tradeHome:symbols - - - false - tradeHome - = - true - tradeHome - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/tradehome.faces - POST - false - true - true - false - - HttpClient4 - - - - - - ${maxthinkingtime} - - - - - DayTrader Login - - Assertion.response_data - false - 2 - - - - - - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/register.faces - GET - false - true - true - false - - HttpClient4 - - - - - - - - - true - ${jsfViewState} - = - true - javax.faces.ViewState - - - false - first:${__Random(0,999,)} last:${__Random(0,4999,)} - = - true - register:fullname - - - false - first:${__Random(0,999,)} last:${__Random(0,4999,)} - = - true - register:address - - - false - uid${logincounter}@${__Random(0,100,)}.com - = - true - register:email - - - false - ru:${logincounter}${__threadNum}:${__time(HMS)}${__Random(0,999,)} - = - true - register:uid - - - false - yyy - = - true - register:password - - - false - yyy - = - true - register:cpassword - - - false - 1000000 - = - true - register:money - - - false - 123-fake-ccnum-456 - = - true - register:ccn - - - false - register - = - true - register - - - false - Register - = - true - register:submit - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/register.faces - POST - false - true - true - false - - HttpClient4 - - - - - - ${maxthinkingtime} - - - - - Registration operation succeeded - - Assertion.response_data - false - 2 - - - - - - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/tradehome.faces - GET - false - true - true - false - - HttpClient4 - - - - - - - - - true - ${jsfViewState} - = - true - javax.faces.ViewState - - - false - tradeHome:logoff - = - true - tradeHome:logoff - - - false - s:1,s:2,s:3,s:4 - = - true - tradeHome:symbols - - - false - tradeHome - = - true - tradeHome - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/tradehome.faces - POST - false - true - true - false - - HttpClient4 - - - - - - ${maxthinkingtime} - - - - - DayTrader Login - - Assertion.response_data - false - 2 - - - - - - - loop - - - - false - - - false - - - - - 1 - true - 1 - - ThroughputController.percentThroughput - 4.0 - 0.0 - - - - - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/tradehome.faces - GET - false - true - true - false - - HttpClient4 - - - - - - - - - true - ${jsfViewState} - = - true - javax.faces.ViewState - - - false - tradeHome:logoff - = - true - tradeHome:logoff - - - false - s:0,s:1,s:2,s:3,s:4 - = - true - tradeHome:symbols - - - false - tradeHome - = - true - tradeHome - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/tradehome.faces - POST - false - true - true - false - - HttpClient4 - - - - - - ${maxthinkingtime} - - - - - DayTrader Login - - Assertion.response_data - false - 2 - - - - - - - loop - - - - false - - - false - - - - - - - false - jsfViewState - <input type="hidden" name="javax\.faces\.ViewState" .* value="([^"]+)".*/> - $1$ - - 0 - - - - - 1 - true - 1 - - ThroughputController.percentThroughput - 70.0 - 0.0 - - - - - - - - true - uid:${logincounter} - = - true - uid - - - true - xxx - = - true - passwd - - - true - login - = - true - action - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/app - POST - false - true - true - false - - HttpClient4 - - - - - - - loop - - - - true - - - true - - - - - Welcome to DayTrader - - Assertion.response_data - false - 2 - - - - - ${maxthinkingtime} - - - - - ${__jexl3("${protocol}"== "http",)} - false - true - - - - false - ${hostname} - ${port} - /daytrader/marketsummary - 20000 - 20000 - - - - - ${__jexl3("${protocol}"== "https",)} - false - true - - - - true - ${hostname} - ${port} - /daytrader/marketsummary - 20000 - 20000 - - - - - ${loop} - - - - 1 - - - - 1 - true - 1 - - ThroughputController.percentThroughput - 36.0 - 0.0 - - - - - - - - true - quotes - = - true - action - - - true - s:${__Random(0,${maximumsid},)} - = - true - symbols - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/app - GET - false - true - true - false - - HttpClient4 - - - - - - - DayTrader: Quotes and Trading - - Assertion.response_data - false - 2 - - - - - ${maxthinkingtime} - - - - - - 1 - true - 1 - - ThroughputController.percentThroughput - 16.0 - 0.0 - - - - - - - - true - home - = - true - action - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/app - GET - false - true - true - false - - HttpClient4 - - - - - - ${maxthinkingtime} - - - - - - 1 - true - 1 - - ThroughputController.percentThroughput - 15.0 - 0.0 - - - - - - - - true - portfolio - = - true - action - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/app - GET - false - true - true - false - - HttpClient4 - - - - - - ${maxthinkingtime} - - - - - - 1 - true - 1 - - ThroughputController.percentThroughput - 10.0 - 0.0 - - - - - - - - true - account - = - true - action - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/app - GET - false - true - true - false - - HttpClient4 - - - - - - ${maxthinkingtime} - - - - - - 1 - true - 1 - - ThroughputController.percentThroughput - 8.0 - 0.0 - - - - - false - false - ${hostname} - ${port} - /daytrader/marketsummary - false - {"action":"updateMarketSummary"} - 20000 - use existing open connection - 20000 - false - - - - - ${maxthinkingtime} - - - - - - 1 - true - 1 - - ThroughputController.percentThroughput - 4.0 - 0.0 - - - - - - - - true - quotes - = - true - action - - - true - s:${__Random(0,${maximumsid},tobuy)} - = - true - symbols - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/app - GET - false - true - true - false - - HttpClient4 - - - - - - ${maxthinkingtime} - - - - - - - - true - buy - = - true - action - - - true - s:${tobuy} - = - true - symbol - - - true - ${__Random(1,200)} - = - true - quantity - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/app - GET - false - true - true - false - - HttpClient4 - - - - - - - has been submitted - - Assertion.response_data - false - 2 - - - - - ${maxthinkingtime} - - - - - - 1 - true - 1 - - ThroughputController.percentThroughput - 4.0 - 0.0 - - - - - - - - true - portfolio - = - true - action - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/app - GET - false - true - true - false - - HttpClient4 - - - - - - false - firstHoldingID - holdingID=([0-9]+) - $1$ - NotFound - 0 - all - - - - false - firstHoldingIDBool - holdingID=([0-9]+) - true - false - 1 - all - - - - ${maxthinkingtime} - - - - - ${firstHoldingIDBool} - false - true - - - - - - - true - sell - = - true - action - - - true - ${firstHoldingID} - = - true - holdingID - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/app - GET - false - true - true - false - - HttpClient4 - - - - - - - has been submitted - - Assertion.response_data - false - 2 - - - - - ${maxthinkingtime} - - - - - - - 1 - true - 1 - - ThroughputController.percentThroughput - 2.0 - 0.0 - - - - - - - - true - account - = - true - action - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/app - GET - false - true - true - false - - HttpClient4 - - - - - - ${maxthinkingtime} - - - - - - - - true - update_profile - = - true - action - - - true - uid:${logincounter} - = - true - userID - - - true - rnd${__threadNum}${logincounter} - = - true - fullname - - - true - xxx - = - true - password - - - true - rndAddress - = - true - address - - - true - xxx - = - true - cpassword - - - true - rndCC - = - true - creditcard - - - true - rndEmail@email.com - = - true - email - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/app - GET - false - true - true - false - - HttpClient4 - - - - - - ${maxthinkingtime} - - - - - - 1 - true - 1 - - ThroughputController.percentThroughput - 1.0 - 0.0 - - - - - - - - true - logout - = - true - action - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/app - GET - false - true - true - false - - HttpClient4 - - - - - - ${maxthinkingtime} - - - - - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/register.jsp - GET - false - true - true - false - - HttpClient4 - - - - - - ${maxthinkingtime} - - - - - - - - true - register - = - true - action - - - true - first:${__Random(0,999,)} last:${__Random(0,4999,)} - = - true - Full Name - - - true - first:${__Random(0,999,)} last:${__Random(0,4999,)} - = - true - snail mail - - - true - uid${logincounter}@${__Random(0,100,)}.com - = - true - email - - - true - ru:${logincounter}${__threadNum}:${__time(HMS)}${__Random(0,999,)} - = - true - user id - - - true - yyy - = - true - passwd - - - true - yyy - = - true - confirm passwd - - - true - 1000000 - = - true - money - - - true - 123-fake-ccnum-456 - = - true - Credit Card Number - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/app - GET - false - true - true - false - - HttpClient4 - - - - - - ${maxthinkingtime} - - - - - - - - true - logout - = - true - action - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/app - GET - false - true - true - false - - HttpClient4 - - - - - - ${maxthinkingtime} - - - - - - loop - - - - false - - - false - - - - - 1 - true - 1 - - ThroughputController.percentThroughput - 4.0 - 0.0 - - - - - - - - true - logout - = - true - action - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/app - GET - false - true - true - false - - HttpClient4 - - - - - - ${maxthinkingtime} - - - - - DayTrader Login - - Assertion.response_data - false - 2 - - - - - - - loop - - - - false - - - false - - - - - - - 4000 - 6000 - - - - - 1 - true - 1 - - ThroughputController.percentThroughput - 20.0 - 0.0 - - - - - - - - true - s:${__Random(0,${maximumsid},)} - = - true - symbols - - - - ${hostname} - ${port} - ${protocol} - - daytrader/rest/quotes - POST - false - true - true - false - - - - - - - - 200 - - Assertion.response_code - false - 2 - - - - - ${maxthinkingtime} - - - - - - - - false - - saveConfig - - - true - true - true - - true - true - true - true - false - true - true - false - false - true - false - false - false - false - false - 0 - true - true - true - true - - - daytrader8.aggregateReport.csv - - - - true - - saveConfig - - - true - true - true - - true - true - true - true - false - true - true - false - false - false - false - false - false - false - false - 0 - true - true - true - true - - - daytrader8.resultsTree.csv - - - - false - - saveConfig - - - true - true - true - - true - true - true - true - false - true - true - false - false - true - false - false - false - false - false - 0 - true - true - true - true - - - daytrader8.resultsTable.csv - - - - - diff --git a/src/test/resources/test-applications/daytrader8/jmeter_files/daytrader8_no_ws.jmx b/src/test/resources/test-applications/daytrader8/jmeter_files/daytrader8_no_ws.jmx deleted file mode 100644 index 026ca71e..00000000 --- a/src/test/resources/test-applications/daytrader8/jmeter_files/daytrader8_no_ws.jmx +++ /dev/null @@ -1,2607 +0,0 @@ - - - - - - false - false - - - - - - - - - false - -1 - - ${__P(THREADS,50)} - ${__P(RAMP,0)} - 1355173676000 - 1355173676000 - true - continue - ${__P(DURATION, 180)} - - true - - - - - false - false - rfc2109 - - - - - - User-Agent - Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; SV1; .NET CLR 1.1.4322) - - - Accept - image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */* - - - Accept-Language - en-us - - - - - - - - minimumuid - ${__P(BOTUID,0)} - = - - - maximumuid - ${__P(TOPUID,14999)} - = - - - hostname - ${__P(HOST,localhost)} - = - - - port - ${__P(PORT,9080)} - = - - - maxthinkingtime - ${__P(MAXTHINKTIME,0)} - = - - - maximumsid - ${__P(STOCKS,9999)} - = - - - protocol - ${__P(PROTOCOL,http)} - = - http | https - - - - - - ${minimumuid} - ${maximumuid} - 1 - logincounter - - false - - - - 1 - - - - 1 - true - 50 - - ThroughputController.percentThroughput - 10.0 - 0.0 - - - - - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/welcome.faces - POST - false - true - true - false - - HttpClient4 - - - - - - - - - true - ${jsfViewState} - = - true - javax.faces.ViewState - - - false - xxx - = - true - login:password - - - false - Log in - = - true - login:submit - - - false - uid:${logincounter} - = - true - login:uid - - - false - 1 - = - true - login_SUBMIT - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/welcome.faces - POST - false - true - true - false - - HttpClient4 - - - - - - - loop - - - - true - - - true - - - - - Ready to Trade - - Assertion.response_data - false - 2 - - - - - ${maxthinkingtime} - - - - - ${loop} - - - - 1 - - - - 1 - true - 1 - - ThroughputController.percentThroughput - 36.0 - 0.0 - - - - - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/quote.faces - GET - false - true - true - false - - HttpClient4 - - - - - - - - - true - ${jsfViewState} - = - true - javax.faces.ViewState - - - false - s:${__Random(0,${maximumsid},)} - = - true - quotes:symbols - - - false - quotes - = - true - quotes:submit2 - - - false - 1 - = - true - quotes_SUBMIT - - - false - 100 - = - true - quotes:quotes:0:quantity - - - false - 100 - = - true - quotes:quotes:1:quantity - - - false - 100 - = - true - quotes:quotes:2:quantity - - - false - 100 - = - true - quotes:quotes:3:quantity - - - false - 100 - = - true - quotes:quotes:4:quantity - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/quote.faces - POST - false - true - true - false - - HttpClient4 - - - - - - - DayTrader Quotes - - Assertion.response_data - false - 2 - - - - - ${maxthinkingtime} - - - - - - 1 - true - 1 - - ThroughputController.percentThroughput - 16.0 - 0.0 - - - - - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/tradehome.faces - GET - false - true - true - false - - HttpClient4 - - - - - - ${maxthinkingtime} - - - - - - 1 - true - 1 - - ThroughputController.percentThroughput - 15.0 - 0.0 - - - - - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/portfolio.faces - GET - false - true - true - false - - HttpClient4 - - - - - - ${maxthinkingtime} - - - - - - 1 - true - 1 - - ThroughputController.percentThroughput - 10.0 - 0.0 - - - - - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/account.faces - GET - false - true - true - false - - HttpClient4 - - - - - - ${maxthinkingtime} - - - - - - 1 - true - 1 - - ThroughputController.percentThroughput - 8.0 - 0.0 - - - - - ${__jexl3("${protocol}"== "http",)} - false - true - - - - true - false - ${hostname} - ${port} - /daytrader/marketsummary - false - {"action":"updateMarketSummary"} - 20000 - open and close - 20000 - false - - - - - ${maxthinkingtime} - - - - - - ${__jexl3("${protocol}"== "https",)} - false - true - - - - true - true - ${hostname} - ${port} - /daytrader/marketsummary - false - {"action":"updateMarketSummary"} - 20000 - open and close - 20000 - false - - - - - ${maxthinkingtime} - - - - - - - 1 - true - 1 - - ThroughputController.percentThroughput - 4.0 - 0.0 - - - - - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/quote.faces - GET - false - true - true - false - - HttpClient4 - - - - - - ${maxthinkingtime} - - - - - - - - true - ${jsfViewState} - = - true - javax.faces.ViewState - - - false - s:${__Random(0,${maximumsid},)} - = - true - quotes:symbols - - - false - quotes - = - true - quotes:submit2 - - - false - 1 - = - true - quotes_SUBMIT - - - false - 100 - = - true - quotes:quotes:0:quantity - - - false - 100 - = - true - quotes:quotes:1:quantity - - - false - 100 - = - true - quotes:quotes:2:quantity - - - false - 100 - = - true - quotes:quotes:3:quantity - - - false - 100 - = - true - quotes:quotes:4:quantity - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/quote.faces - POST - false - true - true - false - - HttpClient4 - - - - - - - DayTrader Quotes - - Assertion.response_data - false - 2 - - - - - ${maxthinkingtime} - - - - false - tobuy - s:([0-9]+) - $1$ - 0 - 1 - all - - - - - - - - true - ${jsfViewState} - = - true - javax.faces.ViewState - - - false - s:${tobuy} - = - true - quotes:symbols - - - false - ${__Random(1,200)} - = - true - quotes:quotes:0:quantity - - - false - buy - = - true - quotes:quotes:0:buy - - - false - 1 - = - true - quotes_SUBMIT - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/quote.faces - POST - false - true - true - false - - HttpClient4 - - - - - - - been submitted - - Assertion.response_data - false - 2 - - - - - ${maxthinkingtime} - - - - - - 1 - true - 1 - - ThroughputController.percentThroughput - 4.0 - 0.0 - - - - - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/portfolio.faces - GET - false - true - true - false - - HttpClient4 - - - - - - false - numHoldings - of Holdings: </b>([1-9][0-9]*)</td> - $1$ - 0 - 0 - all - - - - ${maxthinkingtime} - - - - - ${__jexl("${numHoldings}" != "0")} - false - true - - - - - - - true - ${jsfViewState} - = - true - javax.faces.ViewState - - - false - portfolio:holdings:0:sell - = - true - portfolio:_idcl - - - false - 1 - = - true - portfolio_SUBMIT - - - false - s:0,s:1,s:2,s:3,s:4 - = - true - portfolio:symbols - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/portfolio.faces - POST - false - true - true - false - - HttpClient4 - - - - - - - been submitted - - Assertion.response_data - false - 2 - - - - - ${maxthinkingtime} - - - - - - - 1 - true - 1 - - ThroughputController.percentThroughput - 2.0 - 0.0 - - - - - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/account.faces - GET - false - true - true - false - - HttpClient4 - - - - - - ${maxthinkingtime} - - - - - - - - true - ${jsfViewState} - = - true - javax.faces.ViewState - - - false - uid:${logincounter} - = - true - updateProfile:uid - - - false - rnd${__threadNum}${logincounter} - = - true - updateProfile:fullname - - - false - xxx - = - true - updateProfile:password - - - false - rndAddress - = - true - updateProfile:address - - - false - xxx - = - true - updateProfile:cpassword - - - false - rndCC - = - true - updateProfile:ccn - - - false - rndEmail@email.com - = - true - updateProfile:email - - - false - 1 - = - true - updateProfile_SUBMIT - - - false - Update Profile - = - true - updateProfile:submit - - - false - s:0,s:1,s:2,s:3,s:4 - = - true - updateProfile:symbols - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/account.faces - POST - false - true - true - false - - HttpClient4 - - - - - - ${maxthinkingtime} - - - - - - 1 - true - 1 - - ThroughputController.percentThroughput - 1.0 - 0.0 - - - - - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/tradehome.faces - GET - false - true - true - false - - HttpClient4 - - - - - - - - - true - ${jsfViewState} - = - true - javax.faces.ViewState - - - false - tradeHome:logoff - = - true - tradeHome:_idcl - - - false - s:0,s:1,s:2,s:3,s:4 - = - true - tradeHome:symbols - - - false - 1 - = - true - tradeHome_SUBMIT - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/tradehome.faces - POST - false - true - true - false - - HttpClient4 - - - - - - ${maxthinkingtime} - - - - - DayTrader Login - - Assertion.response_data - false - 2 - - - - - - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/register.faces - GET - false - true - true - false - - HttpClient4 - - - - - - - - - true - ${jsfViewState} - = - true - javax.faces.ViewState - - - false - first:${__Random(0,999,)} last:${__Random(0,4999,)} - = - true - register:fullname - - - false - first:${__Random(0,999,)} last:${__Random(0,4999,)} - = - true - register:address - - - false - uid${logincounter}@${__Random(0,100,)}.com - = - true - register:email - - - false - ru:${logincounter}${__threadNum}:${__time(HMS)}${__Random(0,999,)} - = - true - register:uid - - - false - yyy - = - true - register:password - - - false - yyy - = - true - register:cpassword - - - false - 1000000 - = - true - register:money - - - false - 123-fake-ccnum-456 - = - true - register:ccn - - - false - 1 - = - true - register_SUBMIT - - - false - Register - = - true - register:submit - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/register.faces - POST - false - true - true - false - - HttpClient4 - - - - - - ${maxthinkingtime} - - - - - Registration operation succeeded - - Assertion.response_data - false - 2 - - - - - - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/tradehome.faces - GET - false - true - true - false - - HttpClient4 - - - - - - - - - true - ${jsfViewState} - = - true - javax.faces.ViewState - - - false - tradeHome:logoff - = - true - tradeHome:_idcl - - - false - s:0,s:1,s:2,s:3,s:4 - = - true - tradeHome:symbols - - - false - 1 - = - true - tradeHome_SUBMIT - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/tradehome.faces - POST - false - true - true - false - - HttpClient4 - - - - - - ${maxthinkingtime} - - - - - DayTrader Login - - Assertion.response_data - false - 2 - - - - - - - loop - - - - false - - - false - - - - - 1 - true - 1 - - ThroughputController.percentThroughput - 4.0 - 0.0 - - - - - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/tradehome.faces - GET - false - true - true - false - - HttpClient4 - - - - - - - - - true - ${jsfViewState} - = - true - javax.faces.ViewState - - - false - tradeHome:logoff - = - true - tradeHome:_idcl - - - false - s:0,s:1,s:2,s:3,s:4 - = - true - tradeHome:symbols - - - false - 1 - = - true - tradeHome_SUBMIT - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/tradehome.faces - POST - false - true - true - false - - HttpClient4 - - - - - - ${maxthinkingtime} - - - - - DayTrader Login - - Assertion.response_data - false - 2 - - - - - - - loop - - - - false - - - false - - - - - - - false - jsfViewState - <input type="hidden" name="javax\.faces\.ViewState" id="j_id__v_0:javax\.faces\.ViewState:1" value="([^"]+)".*/> - $1$ - - 0 - - - - - 1 - true - 1 - - ThroughputController.percentThroughput - 70.0 - 0.0 - - - - - - - - true - uid:${logincounter} - = - true - uid - - - true - xxx - = - true - passwd - - - true - login - = - true - action - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/app - POST - false - true - true - false - - HttpClient4 - - - - - - - loop - - - - true - - - true - - - - - Welcome to DayTrader - - Assertion.response_data - false - 2 - - - - - ${maxthinkingtime} - - - - - ${__jexl3("${protocol}"== "http",)} - false - true - - - - false - ${hostname} - ${port} - /daytrader/marketsummary - 20000 - 20000 - - - - - ${__jexl3("${protocol}"== "https",)} - false - true - - - - true - ${hostname} - ${port} - /daytrader/marketsummary - 20000 - 20000 - - - - - ${loop} - - - - 1 - - - - 1 - true - 1 - - ThroughputController.percentThroughput - 36.0 - 0.0 - - - - - - - - true - quotes - = - true - action - - - true - s:${__Random(0,${maximumsid},)} - = - true - symbols - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/app - GET - false - true - true - false - - HttpClient4 - - - - - - - DayTrader: Quotes and Trading - - Assertion.response_data - false - 2 - - - - - ${maxthinkingtime} - - - - - - 1 - true - 1 - - ThroughputController.percentThroughput - 16.0 - 0.0 - - - - - - - - true - home - = - true - action - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/app - GET - false - true - true - false - - HttpClient4 - - - - - - ${maxthinkingtime} - - - - - - 1 - true - 1 - - ThroughputController.percentThroughput - 15.0 - 0.0 - - - - - - - - true - portfolio - = - true - action - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/app - GET - false - true - true - false - - HttpClient4 - - - - - - ${maxthinkingtime} - - - - - - 1 - true - 1 - - ThroughputController.percentThroughput - 10.0 - 0.0 - - - - - - - - true - account - = - true - action - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/app - GET - false - true - true - false - - HttpClient4 - - - - - - ${maxthinkingtime} - - - - - - 1 - true - 1 - - ThroughputController.percentThroughput - 8.0 - 0.0 - - - - - false - false - ${hostname} - ${port} - /daytrader/marketsummary - false - {"action":"updateMarketSummary"} - 20000 - use existing open connection - 20000 - false - - - - - ${maxthinkingtime} - - - - - - 1 - true - 1 - - ThroughputController.percentThroughput - 4.0 - 0.0 - - - - - - - - true - quotes - = - true - action - - - true - s:${__Random(0,${maximumsid},tobuy)} - = - true - symbols - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/app - GET - false - true - true - false - - HttpClient4 - - - - - - ${maxthinkingtime} - - - - - - - - true - buy - = - true - action - - - true - s:${tobuy} - = - true - symbol - - - true - ${__Random(1,200)} - = - true - quantity - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/app - GET - false - true - true - false - - HttpClient4 - - - - - - - has been submitted - - Assertion.response_data - false - 2 - - - - - ${maxthinkingtime} - - - - - - 1 - true - 1 - - ThroughputController.percentThroughput - 4.0 - 0.0 - - - - - - - - true - portfolio - = - true - action - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/app - GET - false - true - true - false - - HttpClient4 - - - - - - false - firstHoldingID - holdingID=([0-9]+) - $1$ - NotFound - 0 - all - - - - false - firstHoldingIDBool - holdingID=([0-9]+) - true - false - 1 - all - - - - ${maxthinkingtime} - - - - - ${firstHoldingIDBool} - false - true - - - - - - - true - sell - = - true - action - - - true - ${firstHoldingID} - = - true - holdingID - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/app - GET - false - true - true - false - - HttpClient4 - - - - - - - has been submitted - - Assertion.response_data - false - 2 - - - - - ${maxthinkingtime} - - - - - - - 1 - true - 1 - - ThroughputController.percentThroughput - 2.0 - 0.0 - - - - - - - - true - account - = - true - action - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/app - GET - false - true - true - false - - HttpClient4 - - - - - - ${maxthinkingtime} - - - - - - - - true - update_profile - = - true - action - - - true - uid:${logincounter} - = - true - userID - - - true - rnd${__threadNum}${logincounter} - = - true - fullname - - - true - xxx - = - true - password - - - true - rndAddress - = - true - address - - - true - xxx - = - true - cpassword - - - true - rndCC - = - true - creditcard - - - true - rndEmail@email.com - = - true - email - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/app - GET - false - true - true - false - - HttpClient4 - - - - - - ${maxthinkingtime} - - - - - - 1 - true - 1 - - ThroughputController.percentThroughput - 1.0 - 0.0 - - - - - - - - true - logout - = - true - action - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/app - GET - false - true - true - false - - HttpClient4 - - - - - - ${maxthinkingtime} - - - - - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/register.jsp - GET - false - true - true - false - - HttpClient4 - - - - - - ${maxthinkingtime} - - - - - - - - true - register - = - true - action - - - true - first:${__Random(0,999,)} last:${__Random(0,4999,)} - = - true - Full Name - - - true - first:${__Random(0,999,)} last:${__Random(0,4999,)} - = - true - snail mail - - - true - uid${logincounter}@${__Random(0,100,)}.com - = - true - email - - - true - ru:${logincounter}${__threadNum}:${__time(HMS)}${__Random(0,999,)} - = - true - user id - - - true - yyy - = - true - passwd - - - true - yyy - = - true - confirm passwd - - - true - 1000000 - = - true - money - - - true - 123-fake-ccnum-456 - = - true - Credit Card Number - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/app - GET - false - true - true - false - - HttpClient4 - - - - - - ${maxthinkingtime} - - - - - - - - true - logout - = - true - action - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/app - GET - false - true - true - false - - HttpClient4 - - - - - - ${maxthinkingtime} - - - - - - loop - - - - false - - - false - - - - - 1 - true - 1 - - ThroughputController.percentThroughput - 4.0 - 0.0 - - - - - - - - true - logout - = - true - action - - - - ${hostname} - ${port} - ${protocol} - - /daytrader/app - GET - false - true - true - false - - HttpClient4 - - - - - - ${maxthinkingtime} - - - - - DayTrader Login - - Assertion.response_data - false - 2 - - - - - - - loop - - - - false - - - false - - - - - - - 4000 - 6000 - - - - - 1 - true - 1 - - ThroughputController.percentThroughput - 20.0 - 0.0 - - - - - - - - true - s:${__Random(0,${maximumsid},)} - = - true - symbols - - - - ${hostname} - ${port} - ${protocol} - - daytrader/rest/quotes - POST - false - true - true - false - - - - - - - - 200 - - Assertion.response_code - false - 2 - - - - - ${maxthinkingtime} - - - - - - - - false - - saveConfig - - - true - true - true - - true - true - true - true - false - true - true - false - false - true - false - false - false - false - false - 0 - true - true - true - true - - - daytrader8.aggregateReport.csv - - - - true - - saveConfig - - - true - true - true - - true - true - true - true - false - true - true - false - false - false - false - false - false - false - false - 0 - true - true - true - true - - - daytrader8.resultsTree.csv - - - - false - - saveConfig - - - true - true - true - - true - true - true - true - false - true - true - false - false - true - false - false - false - false - false - 0 - true - true - true - true - - - daytrader7.resultsTable.csv - - - - - diff --git a/src/test/resources/test-applications/daytrader8/jmeter_files/daytrader_primitive.jmx b/src/test/resources/test-applications/daytrader8/jmeter_files/daytrader_primitive.jmx deleted file mode 100644 index 29ccdf4c..00000000 --- a/src/test/resources/test-applications/daytrader8/jmeter_files/daytrader_primitive.jmx +++ /dev/null @@ -1,203 +0,0 @@ - - - - - - false - false - - - - - - - - - false - -1 - - ${__P(THREADS, 50)} - 0 - 1355173676000 - 1355173676000 - true - continue - ${__P(DURATION, 180)} - - true - - - - - false - false - rfc2109 - - - - - - User-Agent - Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; SV1; .NET CLR 1.1.4322) - - - Accept - image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */* - - - Accept-Language - en-us - - - - - - - - VIEWSTATE - - = - - - jsessionid - - = - - - minimumuid - ${__P(BOTUID,0)} - = - - - maximumuid - ${__P(TOPUID,14999)} - = - - - hostname - ${__P(HOST,)} - = - - - maxthinkingtime - 0 - = - - - maximumsid - ${__P(STOCKS,9999)} - = - - - url - ${__P(PRIMITIVE_URL,servlet/PingServlet)} - = - - - - - - true - -1 - - - - - - - ${hostname} - 9080 - http - - /daytrader/${url} - GET - false - true - true - false - - HttpClient4 - - - - - - ${maxthinkingtime} - - - - - - - false - - saveConfig - - - true - true - true - - true - true - true - true - false - true - true - false - false - true - false - false - false - false - false - 0 - true - true - true - true - - - - - - - true - - saveConfig - - - true - true - true - - true - true - true - true - false - true - true - false - false - true - false - false - false - false - false - 0 - true - true - true - true - - - C:\jmeter\jmeter_script\report.csv - - - - - diff --git a/src/test/resources/test-applications/daytrader8/pom.xml b/src/test/resources/test-applications/daytrader8/pom.xml deleted file mode 100644 index cd631847..00000000 --- a/src/test/resources/test-applications/daytrader8/pom.xml +++ /dev/null @@ -1,104 +0,0 @@ - - - 4.0.0 - io.openliberty.samples - io.openliberty.sample.daytrader8 - 1.0-SNAPSHOT - war - - UTF-8 - UTF-8 - 1.8 - 1.8 - - 10.14.2.0 - ${user.home}/.m2/repository/org/apache/derby/derby - - 9080 - 9443 - - - - javax - javaee-api - 8.0 - provided - - - taglibs - standard - 1.1.1 - compile - - - javax.xml.bind - jaxb-api - 2.3.0 - provided - - - - org.apache.derby - derby - ${version.derby} - test - - - - ${project.artifactId} - - - - io.openliberty.tools - liberty-maven-plugin - 3.3-M4 - - - ${testServerHttpPort} - ${testServerHttpsPort} - - - - - org.apache.maven.plugins - maven-dependency-plugin - 3.1.2 - - - copy-derby-dependency - package - - copy-dependencies - - - derby - ${project.build.directory}/liberty/wlp/usr/shared/resources/DerbyLibs/ - - - - - - maven-resources-plugin - 2.6 - - - copy-resources - package - - copy-resources - - - ${project.build.directory}/liberty/wlp/usr/shared/resources/data - - - resources/data - false - - - - - - - - - diff --git a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/README_DO_NOT_TOUCH_FILES.txt b/src/test/resources/test-applications/daytrader8/resources/data/tradedb/README_DO_NOT_TOUCH_FILES.txt deleted file mode 100644 index a4bc1452..00000000 --- a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/README_DO_NOT_TOUCH_FILES.txt +++ /dev/null @@ -1,9 +0,0 @@ - -# ************************************************************************* -# *** DO NOT TOUCH FILES IN THIS DIRECTORY! *** -# *** FILES IN THIS DIRECTORY AND SUBDIRECTORIES CONSTITUTE A DERBY *** -# *** DATABASE, WHICH INCLUDES THE DATA (USER AND SYSTEM) AND THE *** -# *** FILES NECESSARY FOR DATABASE RECOVERY. *** -# *** EDITING, ADDING, OR DELETING ANY OF THESE FILES MAY CAUSE DATA *** -# *** CORRUPTION AND LEAVE THE DATABASE IN A NON-RECOVERABLE STATE. *** -# ************************************************************************* \ No newline at end of file diff --git a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/log/README_DO_NOT_TOUCH_FILES.txt b/src/test/resources/test-applications/daytrader8/resources/data/tradedb/log/README_DO_NOT_TOUCH_FILES.txt deleted file mode 100644 index 56df292f..00000000 --- a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/log/README_DO_NOT_TOUCH_FILES.txt +++ /dev/null @@ -1,8 +0,0 @@ - -# ************************************************************************* -# *** DO NOT TOUCH FILES IN THIS DIRECTORY! *** -# *** FILES IN THIS DIRECTORY ARE USED BY THE DERBY DATABASE RECOVERY *** -# *** SYSTEM. EDITING, ADDING, OR DELETING FILES IN THIS DIRECTORY *** -# *** WILL CAUSE THE DERBY RECOVERY SYSTEM TO FAIL, LEADING TO *** -# *** NON-RECOVERABLE CORRUPT DATABASES. *** -# ************************************************************************* \ No newline at end of file diff --git a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/log/log.ctrl b/src/test/resources/test-applications/daytrader8/resources/data/tradedb/log/log.ctrl deleted file mode 100644 index 5ae5e491..00000000 Binary files a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/log/log.ctrl and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/log/log286.dat b/src/test/resources/test-applications/daytrader8/resources/data/tradedb/log/log286.dat deleted file mode 100644 index 114bef65..00000000 Binary files a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/log/log286.dat and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/log/logmirror.ctrl b/src/test/resources/test-applications/daytrader8/resources/data/tradedb/log/logmirror.ctrl deleted file mode 100644 index 5ae5e491..00000000 Binary files a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/log/logmirror.ctrl and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/README_DO_NOT_TOUCH_FILES.txt b/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/README_DO_NOT_TOUCH_FILES.txt deleted file mode 100644 index 2bdad061..00000000 --- a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/README_DO_NOT_TOUCH_FILES.txt +++ /dev/null @@ -1,8 +0,0 @@ - -# ************************************************************************* -# *** DO NOT TOUCH FILES IN THIS DIRECTORY! *** -# *** FILES IN THIS DIRECTORY ARE USED BY THE DERBY DATABASE TO STORE *** -# *** USER AND SYSTEM DATA. EDITING, ADDING, OR DELETING FILES IN THIS *** -# *** DIRECTORY WILL CORRUPT THE ASSOCIATED DERBY DATABASE AND MAKE *** -# *** IT NON-RECOVERABLE. *** -# ************************************************************************* \ No newline at end of file diff --git a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c10.dat b/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c10.dat deleted file mode 100644 index ca061266..00000000 Binary files a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c10.dat and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c101.dat b/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c101.dat deleted file mode 100644 index 7c9fc8a0..00000000 Binary files a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c101.dat and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c111.dat b/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c111.dat deleted file mode 100644 index 8e4371b3..00000000 Binary files a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c111.dat and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c121.dat b/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c121.dat deleted file mode 100644 index 5f7789fe..00000000 Binary files a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c121.dat and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c130.dat b/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c130.dat deleted file mode 100644 index f9de0051..00000000 Binary files a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c130.dat and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c141.dat b/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c141.dat deleted file mode 100644 index 2b9408a3..00000000 Binary files a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c141.dat and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c150.dat b/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c150.dat deleted file mode 100644 index db2ff892..00000000 Binary files a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c150.dat and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c161.dat b/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c161.dat deleted file mode 100644 index a2af9876..00000000 Binary files a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c161.dat and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c171.dat b/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c171.dat deleted file mode 100644 index b3e1217b..00000000 Binary files a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c171.dat and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c180.dat b/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c180.dat deleted file mode 100644 index e7b80ed0..00000000 Binary files a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c180.dat and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c191.dat b/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c191.dat deleted file mode 100644 index 5e31e3be..00000000 Binary files a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c191.dat and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c1a1.dat b/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c1a1.dat deleted file mode 100644 index e578b73b..00000000 Binary files a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c1a1.dat and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c1b1.dat b/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c1b1.dat deleted file mode 100644 index 2e068140..00000000 Binary files a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c1b1.dat and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c1c0.dat b/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c1c0.dat deleted file mode 100644 index c5b91e2c..00000000 Binary files a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c1c0.dat and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c1d1.dat b/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c1d1.dat deleted file mode 100644 index 451f02f4..00000000 Binary files a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c1d1.dat and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c1e0.dat b/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c1e0.dat deleted file mode 100644 index 761408d3..00000000 Binary files a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c1e0.dat and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c1f1.dat b/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c1f1.dat deleted file mode 100644 index 78d701f4..00000000 Binary files a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c1f1.dat and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c20.dat b/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c20.dat deleted file mode 100644 index 81d623f2..00000000 Binary files a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c20.dat and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c200.dat b/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c200.dat deleted file mode 100644 index c3a7808d..00000000 Binary files a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c200.dat and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c211.dat b/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c211.dat deleted file mode 100644 index 54e15869..00000000 Binary files a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c211.dat and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c221.dat b/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c221.dat deleted file mode 100644 index 59900bc0..00000000 Binary files a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c221.dat and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c230.dat b/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c230.dat deleted file mode 100644 index 207264a3..00000000 Binary files a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c230.dat and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c241.dat b/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c241.dat deleted file mode 100644 index 4433404a..00000000 Binary files a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c241.dat and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c251.dat b/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c251.dat deleted file mode 100644 index c6fab1e7..00000000 Binary files a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c251.dat and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c260.dat b/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c260.dat deleted file mode 100644 index 25f81fde..00000000 Binary files a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c260.dat and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c271.dat b/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c271.dat deleted file mode 100644 index 51cde573..00000000 Binary files a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c271.dat and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c281.dat b/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c281.dat deleted file mode 100644 index cfed875d..00000000 Binary files a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c281.dat and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c290.dat b/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c290.dat deleted file mode 100644 index a85589e5..00000000 Binary files a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c290.dat and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c2a1.dat b/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c2a1.dat deleted file mode 100644 index 8e2ed6af..00000000 Binary files a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c2a1.dat and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c2b1.dat b/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c2b1.dat deleted file mode 100644 index 2a296924..00000000 Binary files a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c2b1.dat and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c2c1.dat b/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c2c1.dat deleted file mode 100644 index 5511575f..00000000 Binary files a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c2c1.dat and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c2d0.dat b/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c2d0.dat deleted file mode 100644 index c9063637..00000000 Binary files a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c2d0.dat and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c2e1.dat b/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c2e1.dat deleted file mode 100644 index fccdbd67..00000000 Binary files a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c2e1.dat and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c2f0.dat b/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c2f0.dat deleted file mode 100644 index d854b4b4..00000000 Binary files a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c2f0.dat and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c300.dat b/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c300.dat deleted file mode 100644 index 2053e010..00000000 Binary files a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c300.dat and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c31.dat b/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c31.dat deleted file mode 100644 index ec081434..00000000 Binary files a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c31.dat and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c311.dat b/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c311.dat deleted file mode 100644 index f60c260f..00000000 Binary files a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c311.dat and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c321.dat b/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c321.dat deleted file mode 100644 index a9d74536..00000000 Binary files a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c321.dat and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c331.dat b/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c331.dat deleted file mode 100644 index 85ee72b3..00000000 Binary files a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c331.dat and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c340.dat b/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c340.dat deleted file mode 100644 index d99b11a3..00000000 Binary files a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c340.dat and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c351.dat b/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c351.dat deleted file mode 100644 index f822f4cb..00000000 Binary files a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c351.dat and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c361.dat b/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c361.dat deleted file mode 100644 index b5c8f259..00000000 Binary files a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c361.dat and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c371.dat b/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c371.dat deleted file mode 100644 index ad11f01b..00000000 Binary files a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c371.dat and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c380.dat b/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c380.dat deleted file mode 100644 index 26b6dd66..00000000 Binary files a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c380.dat and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c391.dat b/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c391.dat deleted file mode 100644 index 38ea5620..00000000 Binary files a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c391.dat and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c3a1.dat b/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c3a1.dat deleted file mode 100644 index fe7a67b1..00000000 Binary files a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c3a1.dat and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c3b1.dat b/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c3b1.dat deleted file mode 100644 index 3a73f40c..00000000 Binary files a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c3b1.dat and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c3c0.dat b/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c3c0.dat deleted file mode 100644 index 4d061cf0..00000000 Binary files a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c3c0.dat and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c3d1.dat b/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c3d1.dat deleted file mode 100644 index 45c9fa24..00000000 Binary files a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c3d1.dat and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c3e1.dat b/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c3e1.dat deleted file mode 100644 index 48f53e68..00000000 Binary files a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c3e1.dat and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c3f1.dat b/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c3f1.dat deleted file mode 100644 index 08acdcee..00000000 Binary files a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c3f1.dat and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c400.dat b/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c400.dat deleted file mode 100644 index a23e287b..00000000 Binary files a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c400.dat and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c41.dat b/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c41.dat deleted file mode 100644 index 6889bcb3..00000000 Binary files a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c41.dat and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c411.dat b/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c411.dat deleted file mode 100644 index 22d5ab93..00000000 Binary files a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c411.dat and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c421.dat b/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c421.dat deleted file mode 100644 index c5274a22..00000000 Binary files a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c421.dat and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c430.dat b/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c430.dat deleted file mode 100644 index 55c948db..00000000 Binary files a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c430.dat and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c441.dat b/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c441.dat deleted file mode 100644 index 3948b2a3..00000000 Binary files a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c441.dat and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c451.dat b/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c451.dat deleted file mode 100644 index fe1ab73e..00000000 Binary files a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c451.dat and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c461.dat b/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c461.dat deleted file mode 100644 index e6d98541..00000000 Binary files a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c461.dat and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c470.dat b/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c470.dat deleted file mode 100644 index c9f2eb1c..00000000 Binary files a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c470.dat and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c481.dat b/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c481.dat deleted file mode 100644 index 397b2917..00000000 Binary files a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c481.dat and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c490.dat b/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c490.dat deleted file mode 100644 index 63e4bc67..00000000 Binary files a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c490.dat and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c4a1.dat b/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c4a1.dat deleted file mode 100644 index f0f0ecf8..00000000 Binary files a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c4a1.dat and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c4b0.dat b/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c4b0.dat deleted file mode 100644 index a8fed1f8..00000000 Binary files a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c4b0.dat and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c4c1.dat b/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c4c1.dat deleted file mode 100644 index 6e1de5e6..00000000 Binary files a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c4c1.dat and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c4d0.dat b/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c4d0.dat deleted file mode 100644 index f33c61a9..00000000 Binary files a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c4d0.dat and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c4e1.dat b/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c4e1.dat deleted file mode 100644 index 02b55f6d..00000000 Binary files a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c4e1.dat and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c4f1.dat b/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c4f1.dat deleted file mode 100644 index 5be3e313..00000000 Binary files a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c4f1.dat and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c51.dat b/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c51.dat deleted file mode 100644 index 0c3b53eb..00000000 Binary files a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c51.dat and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c60.dat b/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c60.dat deleted file mode 100644 index 4896921f..00000000 Binary files a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c60.dat and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c71.dat b/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c71.dat deleted file mode 100644 index 9df02c15..00000000 Binary files a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c71.dat and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c720.dat b/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c720.dat deleted file mode 100644 index c3794777..00000000 Binary files a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c720.dat and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c731.dat b/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c731.dat deleted file mode 100644 index 756b908f..00000000 Binary files a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c731.dat and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c740.dat b/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c740.dat deleted file mode 100644 index 3f2ad6e6..00000000 Binary files a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c740.dat and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c751.dat b/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c751.dat deleted file mode 100644 index fe2bb77c..00000000 Binary files a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c751.dat and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c760.dat b/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c760.dat deleted file mode 100644 index 98b96abf..00000000 Binary files a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c760.dat and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c771.dat b/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c771.dat deleted file mode 100644 index 789d9ae4..00000000 Binary files a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c771.dat and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c780.dat b/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c780.dat deleted file mode 100644 index c24c67e9..00000000 Binary files a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c780.dat and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c791.dat b/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c791.dat deleted file mode 100644 index ff867857..00000000 Binary files a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c791.dat and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c7a0.dat b/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c7a0.dat deleted file mode 100644 index 0593ae3e..00000000 Binary files a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c7a0.dat and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c7b1.dat b/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c7b1.dat deleted file mode 100644 index 7354db2e..00000000 Binary files a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c7b1.dat and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c7c0.dat b/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c7c0.dat deleted file mode 100644 index 907f038f..00000000 Binary files a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c7c0.dat and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c7d1.dat b/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c7d1.dat deleted file mode 100644 index 40100e61..00000000 Binary files a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c7d1.dat and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c7e1.dat b/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c7e1.dat deleted file mode 100644 index 85a139e4..00000000 Binary files a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c7e1.dat and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c7f1.dat b/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c7f1.dat deleted file mode 100644 index 2e558d6e..00000000 Binary files a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c7f1.dat and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c801.dat b/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c801.dat deleted file mode 100644 index eb06862f..00000000 Binary files a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c801.dat and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c81.dat b/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c81.dat deleted file mode 100644 index ab21c74c..00000000 Binary files a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c81.dat and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c811.dat b/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c811.dat deleted file mode 100644 index e502c064..00000000 Binary files a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c811.dat and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c821.dat b/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c821.dat deleted file mode 100644 index f426d4f7..00000000 Binary files a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c821.dat and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c90.dat b/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c90.dat deleted file mode 100644 index 72619ed7..00000000 Binary files a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/c90.dat and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/ca1.dat b/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/ca1.dat deleted file mode 100644 index 981a2c58..00000000 Binary files a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/ca1.dat and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/cb1.dat b/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/cb1.dat deleted file mode 100644 index a4fb8f44..00000000 Binary files a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/cb1.dat and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/cc0.dat b/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/cc0.dat deleted file mode 100644 index d6b3b0f4..00000000 Binary files a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/cc0.dat and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/cd1.dat b/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/cd1.dat deleted file mode 100644 index 3002ab5d..00000000 Binary files a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/cd1.dat and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/ce1.dat b/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/ce1.dat deleted file mode 100644 index 24edcc74..00000000 Binary files a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/ce1.dat and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/cf0.dat b/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/cf0.dat deleted file mode 100644 index b943f01d..00000000 Binary files a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/seg0/cf0.dat and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/service.properties b/src/test/resources/test-applications/daytrader8/resources/data/tradedb/service.properties deleted file mode 100644 index 420cab1f..00000000 --- a/src/test/resources/test-applications/daytrader8/resources/data/tradedb/service.properties +++ /dev/null @@ -1,23 +0,0 @@ -#/Users/jdmcclur/git/sample.daytrader8/target/liberty/wlp/usr/shared/resources/data/tradedb -# ******************************************************************** -# *** Please do NOT edit this file. *** -# *** CHANGING THE CONTENT OF THIS FILE MAY CAUSE DATA CORRUPTION. *** -# ******************************************************************** -#Fri Jan 11 09:46:30 CST 2019 -SysschemasIndex2Identifier=225 -SyscolumnsIdentifier=144 -SysconglomeratesIndex1Identifier=49 -SysconglomeratesIdentifier=32 -SyscolumnsIndex2Identifier=177 -SysschemasIndex1Identifier=209 -SysconglomeratesIndex3Identifier=81 -SystablesIndex2Identifier=129 -SyscolumnsIndex1Identifier=161 -derby.serviceProtocol=org.apache.derby.database.Database -SysschemasIdentifier=192 -derby.storage.propertiesId=16 -SysconglomeratesIndex2Identifier=65 -derby.serviceLocale=en_US -SystablesIdentifier=96 -SystablesIndex1Identifier=113 -#--- last line, don't put anything after this line --- diff --git a/src/test/resources/test-applications/daytrader8/scripts/buildAll.sh b/src/test/resources/test-applications/daytrader8/scripts/buildAll.sh deleted file mode 100755 index f57b6890..00000000 --- a/src/test/resources/test-applications/daytrader8/scripts/buildAll.sh +++ /dev/null @@ -1,20 +0,0 @@ -cd "$(dirname "$0")" -cd .. - -mvn clean package -cp target/io.openliberty.sample.daytrader8.war scripts/io.openliberty.sample.daytrader8.war - -cd scripts -./switchToWF.sh -cd .. -mvn clean package -cp target/io.openliberty.sample.daytrader8.war scripts/io.openliberty.sample.daytrader8-WF.war -cd scripts -./switchFromWF.sh - -./switchToPayara.sh -cd .. -mvn clean package -cp target/io.openliberty.sample.daytrader8.war scripts/io.openliberty.sample.daytrader8-Payara.war -cd scripts -./switchFromPayara.sh diff --git a/src/test/resources/test-applications/daytrader8/scripts/switchFromPayara.sh b/src/test/resources/test-applications/daytrader8/scripts/switchFromPayara.sh deleted file mode 100755 index 870c5695..00000000 --- a/src/test/resources/test-applications/daytrader8/scripts/switchFromPayara.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash -cd "$(dirname "$0")" - -transform () { - sed -i.bak "s#@ActivationConfigProperty(propertyName = \"destination\", propertyValue = \"T#//@ActivationConfigProperty(propertyName = \"destination\", propertyValue = \"T#" $1 - sed -i.bak "s#//@ActivationConfigProperty(propertyName = \"destination\", propertyValue = \"j#@ActivationConfigProperty(propertyName = \"destination\", propertyValue = \"j#" $1 - rm $1.bak -} - -transform "../src/main/java/com/ibm/websphere/samples/daytrader/mdb/DTBroker3MDB.java" -transform "../src/main/java/com/ibm/websphere/samples/daytrader/mdb/DTStreamer3MDB.java" - -mv ../src/main/java/com/ibm/websphere/samples/daytrader/web/prims/ejb3/PingServlet2MDBQueue.java_bak ../src/main/java/com/ibm/websphere/samples/daytrader/web/prims/ejb3/PingServlet2MDBQueue.java -mv ../src/main/java/com/ibm/websphere/samples/daytrader/web/prims/ejb3/PingServlet2MDBTopic.java_bak ../src/main/java/com/ibm/websphere/samples/daytrader/web/prims/ejb3/PingServlet2MDBTopic.java - - diff --git a/src/test/resources/test-applications/daytrader8/scripts/switchFromWF.sh b/src/test/resources/test-applications/daytrader8/scripts/switchFromWF.sh deleted file mode 100755 index 4215abe3..00000000 --- a/src/test/resources/test-applications/daytrader8/scripts/switchFromWF.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash -cd "$(dirname "$0")" - -transform () { - sed -i.bak "s#@Resource(name = \"java#//@Resource(name = \"java#" $1 - sed -i.bak "s#@Resource(lookup = \"java#//@Resource(lookup = \"java#" $1 - sed -i.bak "s#//@Resource(name = \"jm#@Resource(name = \"jm#" $1 - sed -i.bak "s#//@Resource(lookup = \"jm#@Resource(lookup = \"jm#" $1 - sed -i.bak "s#//@Resource(lookup = \"jd#@Resource(lookup = \"jd#" $1 - rm $1.bak -} - -transform "../src/main/java/com/ibm/websphere/samples/daytrader/impl/ejb3/TradeSLSBBean.java" -transform "../src/main/java/com/ibm/websphere/samples/daytrader/impl/direct/TradeDirect.java" -transform "../src/main/java/com/ibm/websphere/samples/daytrader/impl/direct/TradeDirectDBUtils.java" - - diff --git a/src/test/resources/test-applications/daytrader8/scripts/switchToPayara.sh b/src/test/resources/test-applications/daytrader8/scripts/switchToPayara.sh deleted file mode 100755 index c8b7f34b..00000000 --- a/src/test/resources/test-applications/daytrader8/scripts/switchToPayara.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash -cd "$(dirname "$0")" - -transform () { - sed -i.bak "s#//@ActivationConfigProperty(propertyName = \"destination\", propertyValue = \"T#@ActivationConfigProperty(propertyName = \"destination\", propertyValue = \"T#" $1 - sed -i.bak "s#@ActivationConfigProperty(propertyName = \"destination\", propertyValue = \"j#//@ActivationConfigProperty(propertyName = \"destination\", propertyValue = \"j#" $1 - rm $1.bak -} - -transform "../src/main/java/com/ibm/websphere/samples/daytrader/mdb/DTBroker3MDB.java" -transform "../src/main/java/com/ibm/websphere/samples/daytrader/mdb/DTStreamer3MDB.java" - -mv ../src/main/java/com/ibm/websphere/samples/daytrader/web/prims/ejb3/PingServlet2MDBQueue.java ../src/main/java/com/ibm/websphere/samples/daytrader/web/prims/ejb3/PingServlet2MDBQueue.java_bak -mv ../src/main/java/com/ibm/websphere/samples/daytrader/web/prims/ejb3/PingServlet2MDBTopic.java ../src/main/java/com/ibm/websphere/samples/daytrader/web/prims/ejb3/PingServlet2MDBTopic.java_bak - - diff --git a/src/test/resources/test-applications/daytrader8/scripts/switchToWF.sh b/src/test/resources/test-applications/daytrader8/scripts/switchToWF.sh deleted file mode 100755 index 79415a57..00000000 --- a/src/test/resources/test-applications/daytrader8/scripts/switchToWF.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash -cd "$(dirname "$0")" - -transform () { - sed -i.bak "s#//@Resource(name = \"java#@Resource(name = \"java#" $1 - sed -i.bak "s#//@Resource(lookup = \"java#@Resource(lookup = \"java#" $1 - sed -i.bak "s#@Resource(name = \"jm#//@Resource(name = \"jm#" $1 - sed -i.bak "s#@Resource(lookup = \"jm#//@Resource(lookup = \"jm#" $1 - sed -i.bak "s#@Resource(lookup = \"jd#//@Resource(lookup = \"jd#" $1 - rm $1.bak -} - -transform "../src/main/java/com/ibm/websphere/samples/daytrader/impl/ejb3/TradeSLSBBean.java" -transform "../src/main/java/com/ibm/websphere/samples/daytrader/impl/direct/TradeDirect.java" -transform "../src/main/java/com/ibm/websphere/samples/daytrader/impl/direct/TradeDirectDBUtils.java" - - diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/META-INF/DEPENDENCIES b/src/test/resources/test-applications/daytrader8/src/main/java/META-INF/DEPENDENCIES deleted file mode 100644 index cb8878a9..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/META-INF/DEPENDENCIES +++ /dev/null @@ -1,15 +0,0 @@ -// ------------------------------------------------------------------ -// Transitive dependencies of this project determined from the -// maven pom organized by organization. -// ------------------------------------------------------------------ - -DayTrader :: Web Application - - -From: 'an unknown organization' - - Unnamed - taglibs:standard:jar:1.1.1 taglibs:standard:jar:1.1.1 - - - - - diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/META-INF/LICENSE b/src/test/resources/test-applications/daytrader8/src/main/java/META-INF/LICENSE deleted file mode 100644 index d6456956..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/META-INF/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/build.properties b/src/test/resources/test-applications/daytrader8/src/main/java/build.properties deleted file mode 100644 index de47f1c7..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/build.properties +++ /dev/null @@ -1,17 +0,0 @@ -## -## (C) Copyright IBM Corporation 2015. -## -## Licensed under the Apache License, Version 2.0 (the "License"); -## you may not use this file except in compliance with the License. -## You may obtain a copy of the License at -## -## http://www.apache.org/licenses/LICENSE-2.0 -## -## Unless required by applicable law or agreed to in writing, software -## distributed under the License is distributed on an "AS IS" BASIS, -## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -## See the License for the specific language governing permissions and -## limitations under the License. -## - -ejb_version=${pom.version} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/beans/MarketSummaryDataBean.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/beans/MarketSummaryDataBean.java deleted file mode 100644 index f96b34c9..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/beans/MarketSummaryDataBean.java +++ /dev/null @@ -1,285 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2015. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.beans; - -import com.ibm.websphere.samples.daytrader.entities.QuoteDataBean; -import com.ibm.websphere.samples.daytrader.util.FinancialUtils; -import com.ibm.websphere.samples.daytrader.util.Log; -import com.ibm.websphere.samples.daytrader.util.TradeConfig; -import java.io.Serializable; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Date; -import java.util.Iterator; -import javax.json.Json; -import javax.json.JsonObject; -import javax.json.JsonObjectBuilder; - -public class MarketSummaryDataBean implements Serializable { - - private static final long serialVersionUID = 650652242288745600L; - private BigDecimal TSIA; /* Trade Stock Index Average */ - private BigDecimal openTSIA; /* Trade Stock Index Average at the open */ - private double volume; /* volume of shares traded */ - private Collection topGainers; /* - * Collection of top gaining - * stocks - */ - private Collection topLosers; /* - * Collection of top losing - * stocks - */ - // FUTURE private Collection topVolume; /* Collection of top stocks by - // volume */ - private Date summaryDate; /* Date this summary was taken */ - - // cache the gainPercent once computed for this bean - private BigDecimal gainPercent = null; - - public MarketSummaryDataBean() { - } - - public MarketSummaryDataBean(BigDecimal TSIA, BigDecimal openTSIA, double volume, Collection topGainers, Collection topLosers// , Collection topVolume - ) { - setTSIA(TSIA); - setOpenTSIA(openTSIA); - setVolume(volume); - setTopGainers(topGainers); - setTopLosers(topLosers); - setSummaryDate(new java.sql.Date(System.currentTimeMillis())); - gainPercent = FinancialUtils.computeGainPercent(getTSIA(), getOpenTSIA()); - - } - - public static MarketSummaryDataBean getRandomInstance() { - Collection gain = new ArrayList(); - Collection lose = new ArrayList(); - - for (int ii = 0; ii < 5; ii++) { - QuoteDataBean quote1 = QuoteDataBean.getRandomInstance(); - QuoteDataBean quote2 = QuoteDataBean.getRandomInstance(); - - gain.add(quote1); - lose.add(quote2); - } - - return new MarketSummaryDataBean(TradeConfig.rndBigDecimal(1000000.0f), TradeConfig.rndBigDecimal(1000000.0f), TradeConfig.rndQuantity(), gain, lose); - } - - @Override - public String toString() { - String ret = "\n\tMarket Summary at: " + getSummaryDate() + "\n\t\t TSIA:" + getTSIA() + "\n\t\t openTSIA:" + getOpenTSIA() - + "\n\t\t gain:" + getGainPercent() + "\n\t\t volume:" + getVolume(); - - if ((getTopGainers() == null) || (getTopLosers() == null)) { - return ret; - } - ret += "\n\t\t Current Top Gainers:"; - Iterator it = getTopGainers().iterator(); - while (it.hasNext()) { - QuoteDataBean quoteData = it.next(); - ret += ("\n\t\t\t" + quoteData.toString()); - } - ret += "\n\t\t Current Top Losers:"; - it = getTopLosers().iterator(); - while (it.hasNext()) { - QuoteDataBean quoteData = it.next(); - ret += ("\n\t\t\t" + quoteData.toString()); - } - return ret; - } - - public String toHTML() { - String ret = "
Market Summary at: " + getSummaryDate() + "
  • TSIA:" + getTSIA() + "
  • " + "
  • openTSIA:" + getOpenTSIA() + "
  • " - + "
  • volume:" + getVolume() + "
  • "; - if ((getTopGainers() == null) || (getTopLosers() == null)) { - return ret; - } - ret += "
    Current Top Gainers:"; - Iterator it = getTopGainers().iterator(); - - while (it.hasNext()) { - QuoteDataBean quoteData = it.next(); - ret += ("
  • " + quoteData.toString() + "
  • "); - } - ret += "
    Current Top Losers:"; - it = getTopLosers().iterator(); - while (it.hasNext()) { - QuoteDataBean quoteData = it.next(); - ret += ("
  • " + quoteData.toString() + "
  • "); - } - return ret; - } - - public JsonObject toJSON() { - - JsonObjectBuilder jObjectBuilder = Json.createObjectBuilder(); - - int i = 1; - for (Iterator iterator = topGainers.iterator(); iterator.hasNext();) { - QuoteDataBean quote = iterator.next(); - - jObjectBuilder.add("gainer" + i + "_stock",quote.getSymbol()); - jObjectBuilder.add("gainer" + i + "_price","$" + quote.getPrice()); - jObjectBuilder.add("gainer" + i + "_change",quote.getChange()); - i++; - } - - i = 1; - for (Iterator iterator = topLosers.iterator(); iterator.hasNext();) { - QuoteDataBean quote = iterator.next(); - - jObjectBuilder.add("loser" + i + "_stock",quote.getSymbol()); - jObjectBuilder.add("loser" + i + "_price","$" + quote.getPrice()); - jObjectBuilder.add("loser" + i + "_change",quote.getChange()); - i++; - } - - jObjectBuilder.add("tsia", TSIA); - jObjectBuilder.add("volume",volume); - jObjectBuilder.add("date", summaryDate.toString()); - - return jObjectBuilder.build(); - - } - - public void print() { - Log.log(this.toString()); - } - - public BigDecimal getGainPercent() { - if (gainPercent == null) { - gainPercent = FinancialUtils.computeGainPercent(getTSIA(), getOpenTSIA()); - } - return gainPercent; - } - - /** - * Gets the tSIA - * - * @return Returns a BigDecimal - */ - public BigDecimal getTSIA() { - return TSIA; - } - - /** - * Sets the tSIA - * - * @param tSIA - * The tSIA to set - */ - public void setTSIA(BigDecimal tSIA) { - TSIA = tSIA; - } - - /** - * Gets the openTSIA - * - * @return Returns a BigDecimal - */ - public BigDecimal getOpenTSIA() { - return openTSIA; - } - - /** - * Sets the openTSIA - * - * @param openTSIA - * The openTSIA to set - */ - public void setOpenTSIA(BigDecimal openTSIA) { - this.openTSIA = openTSIA; - } - - /** - * Gets the volume - * - * @return Returns a BigDecimal - */ - public double getVolume() { - return volume; - } - - /** - * Sets the volume - * - * @param volume - * The volume to set - */ - public void setVolume(double volume) { - this.volume = volume; - } - - /** - * Gets the topGainers - * - * @return Returns a Collection - */ - public Collection getTopGainers() { - return topGainers; - } - - /** - * Sets the topGainers - * - * @param topGainers - * The topGainers to set - */ - public void setTopGainers(Collection topGainers) { - this.topGainers = topGainers; - } - - /** - * Gets the topLosers - * - * @return Returns a Collection - */ - public Collection getTopLosers() { - return topLosers; - } - - /** - * Sets the topLosers - * - * @param topLosers - * The topLosers to set - */ - public void setTopLosers(Collection topLosers) { - this.topLosers = topLosers; - } - - /** - * Gets the summaryDate - * - * @return Returns a Date - */ - public Date getSummaryDate() { - return summaryDate; - } - - /** - * Sets the summaryDate - * - * @param summaryDate - * The summaryDate to set - */ - public void setSummaryDate(Date summaryDate) { - this.summaryDate = summaryDate; - } - -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/beans/RunStatsDataBean.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/beans/RunStatsDataBean.java deleted file mode 100644 index 1016b6cf..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/beans/RunStatsDataBean.java +++ /dev/null @@ -1,294 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2015. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.beans; - -import java.io.Serializable; - -public class RunStatsDataBean implements Serializable { - private static final long serialVersionUID = 4017778674103242167L; - - // Constructors - public RunStatsDataBean() { - } - - // count of trade users in the database (users w/ userID like 'uid:%') - private int tradeUserCount; - // count of trade stocks in the database (stocks w/ symbol like 's:%') - private int tradeStockCount; - - // count of new registered users in this run (users w/ userID like 'ru:%') - // -- random user - private int newUserCount; - - // sum of logins by trade users - private int sumLoginCount; - // sum of logouts by trade users - private int sumLogoutCount; - - // count of holdings of trade users - private int holdingCount; - - // count of orders of trade users - private int orderCount; - // count of buy orders of trade users - private int buyOrderCount; - // count of sell orders of trade users - private int sellOrderCount; - // count of cancelled orders of trade users - private int cancelledOrderCount; - // count of open orders of trade users - private int openOrderCount; - // count of orders deleted during this trade Reset - private int deletedOrderCount; - - @Override - public String toString() { - return "\n\tRunStatsData for reset at " + new java.util.Date() + "\n\t\t tradeUserCount: " + getTradeUserCount() + "\n\t\t newUserCount: " - + getNewUserCount() + "\n\t\t sumLoginCount: " + getSumLoginCount() + "\n\t\t sumLogoutCount: " + getSumLogoutCount() - + "\n\t\t holdingCount: " + getHoldingCount() + "\n\t\t orderCount: " + getOrderCount() + "\n\t\t buyOrderCount: " - + getBuyOrderCount() + "\n\t\t sellOrderCount: " + getSellOrderCount() + "\n\t\t cancelledOrderCount: " + getCancelledOrderCount() - + "\n\t\t openOrderCount: " + getOpenOrderCount() + "\n\t\t deletedOrderCount: " + getDeletedOrderCount(); - } - - /** - * Gets the tradeUserCount - * - * @return Returns a int - */ - public int getTradeUserCount() { - return tradeUserCount; - } - - /** - * Sets the tradeUserCount - * - * @param tradeUserCount - * The tradeUserCount to set - */ - public void setTradeUserCount(int tradeUserCount) { - this.tradeUserCount = tradeUserCount; - } - - /** - * Gets the newUserCount - * - * @return Returns a int - */ - public int getNewUserCount() { - return newUserCount; - } - - /** - * Sets the newUserCount - * - * @param newUserCount - * The newUserCount to set - */ - public void setNewUserCount(int newUserCount) { - this.newUserCount = newUserCount; - } - - /** - * Gets the sumLoginCount - * - * @return Returns a int - */ - public int getSumLoginCount() { - return sumLoginCount; - } - - /** - * Sets the sumLoginCount - * - * @param sumLoginCount - * The sumLoginCount to set - */ - public void setSumLoginCount(int sumLoginCount) { - this.sumLoginCount = sumLoginCount; - } - - /** - * Gets the sumLogoutCount - * - * @return Returns a int - */ - public int getSumLogoutCount() { - return sumLogoutCount; - } - - /** - * Sets the sumLogoutCount - * - * @param sumLogoutCount - * The sumLogoutCount to set - */ - public void setSumLogoutCount(int sumLogoutCount) { - this.sumLogoutCount = sumLogoutCount; - } - - /** - * Gets the holdingCount - * - * @return Returns a int - */ - public int getHoldingCount() { - return holdingCount; - } - - /** - * Sets the holdingCount - * - * @param holdingCount - * The holdingCount to set - */ - public void setHoldingCount(int holdingCount) { - this.holdingCount = holdingCount; - } - - /** - * Gets the buyOrderCount - * - * @return Returns a int - */ - public int getBuyOrderCount() { - return buyOrderCount; - } - - /** - * Sets the buyOrderCount - * - * @param buyOrderCount - * The buyOrderCount to set - */ - public void setBuyOrderCount(int buyOrderCount) { - this.buyOrderCount = buyOrderCount; - } - - /** - * Gets the sellOrderCount - * - * @return Returns a int - */ - public int getSellOrderCount() { - return sellOrderCount; - } - - /** - * Sets the sellOrderCount - * - * @param sellOrderCount - * The sellOrderCount to set - */ - public void setSellOrderCount(int sellOrderCount) { - this.sellOrderCount = sellOrderCount; - } - - /** - * Gets the cancelledOrderCount - * - * @return Returns a int - */ - public int getCancelledOrderCount() { - return cancelledOrderCount; - } - - /** - * Sets the cancelledOrderCount - * - * @param cancelledOrderCount - * The cancelledOrderCount to set - */ - public void setCancelledOrderCount(int cancelledOrderCount) { - this.cancelledOrderCount = cancelledOrderCount; - } - - /** - * Gets the openOrderCount - * - * @return Returns a int - */ - public int getOpenOrderCount() { - return openOrderCount; - } - - /** - * Sets the openOrderCount - * - * @param openOrderCount - * The openOrderCount to set - */ - public void setOpenOrderCount(int openOrderCount) { - this.openOrderCount = openOrderCount; - } - - /** - * Gets the deletedOrderCount - * - * @return Returns a int - */ - public int getDeletedOrderCount() { - return deletedOrderCount; - } - - /** - * Sets the deletedOrderCount - * - * @param deletedOrderCount - * The deletedOrderCount to set - */ - public void setDeletedOrderCount(int deletedOrderCount) { - this.deletedOrderCount = deletedOrderCount; - } - - /** - * Gets the orderCount - * - * @return Returns a int - */ - public int getOrderCount() { - return orderCount; - } - - /** - * Sets the orderCount - * - * @param orderCount - * The orderCount to set - */ - public void setOrderCount(int orderCount) { - this.orderCount = orderCount; - } - - /** - * Gets the tradeStockCount - * - * @return Returns a int - */ - public int getTradeStockCount() { - return tradeStockCount; - } - - /** - * Sets the tradeStockCount - * - * @param tradeStockCount - * The tradeStockCount to set - */ - public void setTradeStockCount(int tradeStockCount) { - this.tradeStockCount = tradeStockCount; - } - -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/entities/AccountDataBean.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/entities/AccountDataBean.java deleted file mode 100644 index 00c96fd3..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/entities/AccountDataBean.java +++ /dev/null @@ -1,284 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2015. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.entities; - -import com.ibm.websphere.samples.daytrader.util.Log; -import com.ibm.websphere.samples.daytrader.util.TradeConfig; -import java.io.Serializable; -import java.math.BigDecimal; -import java.sql.Timestamp; -import java.util.Collection; -import java.util.Date; -import javax.ejb.EJBException; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.FetchType; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.JoinColumn; -import javax.persistence.OneToMany; -import javax.persistence.OneToOne; -import javax.persistence.Table; -import javax.persistence.TableGenerator; -import javax.persistence.Temporal; -import javax.persistence.TemporalType; -import javax.persistence.Transient; -import javax.validation.constraints.NotNull; -import javax.validation.constraints.PastOrPresent; -import javax.validation.constraints.PositiveOrZero; - -@Entity(name = "accountejb") -@Table(name = "accountejb") -public class AccountDataBean implements Serializable { - - private static final long serialVersionUID = 8437841265136840545L; - - /* Accessor methods for persistent fields */ - @TableGenerator(name = "accountIdGen", table = "KEYGENEJB", pkColumnName = "KEYNAME", valueColumnName = "KEYVAL", pkColumnValue = "account", allocationSize = 1000) - @Id - @GeneratedValue(strategy = GenerationType.TABLE, generator = "accountIdGen") - @Column(name = "ACCOUNTID", nullable = false) - private Integer accountID; /* accountID */ - - @NotNull - @PositiveOrZero - @Column(name = "LOGINCOUNT", nullable = false) - private int loginCount; /* loginCount */ - - @NotNull - @PositiveOrZero - @Column(name = "LOGOUTCOUNT", nullable = false) - private int logoutCount; /* logoutCount */ - - @Column(name = "LASTLOGIN") - @Temporal(TemporalType.TIMESTAMP) - @PastOrPresent - private Date lastLogin; /* lastLogin Date */ - - @Column(name = "CREATIONDATE") - @Temporal(TemporalType.TIMESTAMP) - @PastOrPresent - private Date creationDate; /* creationDate */ - - @Column(name = "BALANCE") - private BigDecimal balance; /* balance */ - - @Column(name = "OPENBALANCE") - private BigDecimal openBalance; /* open balance */ - - @OneToMany(mappedBy = "account", fetch = FetchType.LAZY) - private Collection orders; - - @OneToMany(mappedBy = "account", fetch = FetchType.LAZY) - private Collection holdings; - - @OneToOne(fetch = FetchType.LAZY) - @JoinColumn(name = "PROFILE_USERID") - private AccountProfileDataBean profile; - - /* - * Accessor methods for relationship fields are only included for the - * AccountProfile profileID - */ - @Transient - private String profileID; - - public AccountDataBean() { - } - - public AccountDataBean(Integer accountID, int loginCount, int logoutCount, Date lastLogin, Date creationDate, BigDecimal balance, BigDecimal openBalance, - String profileID) { - setAccountID(accountID); - setLoginCount(loginCount); - setLogoutCount(logoutCount); - setLastLogin(lastLogin); - setCreationDate(creationDate); - setBalance(balance); - setOpenBalance(openBalance); - setProfileID(profileID); - } - - public AccountDataBean(int loginCount, int logoutCount, Date lastLogin, Date creationDate, BigDecimal balance, BigDecimal openBalance, String profileID) { - setLoginCount(loginCount); - setLogoutCount(logoutCount); - setLastLogin(lastLogin); - setCreationDate(creationDate); - setBalance(balance); - setOpenBalance(openBalance); - setProfileID(profileID); - } - - public static AccountDataBean getRandomInstance() { - return new AccountDataBean(new Integer(TradeConfig.rndInt(100000)), // accountID - TradeConfig.rndInt(10000), // loginCount - TradeConfig.rndInt(10000), // logoutCount - new java.util.Date(), // lastLogin - new java.util.Date(TradeConfig.rndInt(Integer.MAX_VALUE)), // creationDate - TradeConfig.rndBigDecimal(1000000.0f), // balance - TradeConfig.rndBigDecimal(1000000.0f), // openBalance - TradeConfig.rndUserID() // profileID - ); - } - - @Override - public String toString() { - return "\n\tAccount Data for account: " + getAccountID() + "\n\t\t loginCount:" + getLoginCount() + "\n\t\t logoutCount:" + getLogoutCount() - + "\n\t\t lastLogin:" + getLastLogin() + "\n\t\t creationDate:" + getCreationDate() + "\n\t\t balance:" + getBalance() - + "\n\t\t openBalance:" + getOpenBalance() + "\n\t\t profileID:" + getProfileID(); - } - - public String toHTML() { - return "
    Account Data for account: " + getAccountID() + "" + "
  • loginCount:" + getLoginCount() + "
  • " + "
  • logoutCount:" - + getLogoutCount() + "
  • " + "
  • lastLogin:" + getLastLogin() + "
  • " + "
  • creationDate:" + getCreationDate() + "
  • " - + "
  • balance:" + getBalance() + "
  • " + "
  • openBalance:" + getOpenBalance() + "
  • " + "
  • profileID:" + getProfileID() - + "
  • "; - } - - public void print() { - Log.log(this.toString()); - } - - public Integer getAccountID() { - return accountID; - } - - public void setAccountID(Integer accountID) { - this.accountID = accountID; - } - - public int getLoginCount() { - return loginCount; - } - - public void setLoginCount(int loginCount) { - this.loginCount = loginCount; - } - - public int getLogoutCount() { - return logoutCount; - } - - public void setLogoutCount(int logoutCount) { - this.logoutCount = logoutCount; - } - - public Date getLastLogin() { - return lastLogin; - } - - public void setLastLogin(Date lastLogin) { - this.lastLogin = lastLogin; - } - - public Date getCreationDate() { - return creationDate; - } - - public void setCreationDate(Date creationDate) { - this.creationDate = creationDate; - } - - public BigDecimal getBalance() { - return balance; - } - - public void setBalance(BigDecimal balance) { - this.balance = balance; - } - - public BigDecimal getOpenBalance() { - return openBalance; - } - - public void setOpenBalance(BigDecimal openBalance) { - this.openBalance = openBalance; - } - - public String getProfileID() { - return profileID; - } - - public void setProfileID(String profileID) { - this.profileID = profileID; - } - - /* - * Disabled for D185273 public String getUserID() { return getProfileID(); } - */ - - public Collection getOrders() { - return orders; - } - - public void setOrders(Collection orders) { - this.orders = orders; - } - - public Collection getHoldings() { - return holdings; - } - - public void setHoldings(Collection holdings) { - this.holdings = holdings; - } - - public AccountProfileDataBean getProfile() { - return profile; - } - - public void setProfile(AccountProfileDataBean profile) { - this.profile = profile; - } - - public void login(String password) { - AccountProfileDataBean profile = getProfile(); - if ((profile == null) || (profile.getPassword().equals(password) == false)) { - String error = "AccountBean:Login failure for account: " + getAccountID() - + ((profile == null) ? "null AccountProfile" : "\n\tIncorrect password-->" + profile.getUserID() + ":" + profile.getPassword()); - throw new EJBException(error); - } - - setLastLogin(new Timestamp(System.currentTimeMillis())); - setLoginCount(getLoginCount() + 1); - } - - public void logout() { - setLogoutCount(getLogoutCount() + 1); - } - - @Override - public int hashCode() { - int hash = 0; - hash += (this.accountID != null ? this.accountID.hashCode() : 0); - return hash; - } - - @Override - public boolean equals(Object object) { - - if (!(object instanceof AccountDataBean)) { - return false; - } - AccountDataBean other = (AccountDataBean) object; - - if (this.accountID != other.accountID && (this.accountID == null || !this.accountID.equals(other.accountID))) { - return false; - } - - return true; - } -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/entities/AccountProfileDataBean.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/entities/AccountProfileDataBean.java deleted file mode 100644 index 9da49780..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/entities/AccountProfileDataBean.java +++ /dev/null @@ -1,183 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2015. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.entities; - -//import java.sql.Timestamp; - -import com.ibm.websphere.samples.daytrader.util.Log; -import com.ibm.websphere.samples.daytrader.util.TradeConfig; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.FetchType; -import javax.persistence.Id; -import javax.persistence.OneToOne; -import javax.persistence.Table; -import javax.validation.constraints.Email; -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotNull; - -@Entity(name = "accountprofileejb") -@Table(name = "accountprofileejb") -public class AccountProfileDataBean implements java.io.Serializable { - - /* Accessor methods for persistent fields */ - - private static final long serialVersionUID = 2794584136675420624L; - - @Id - @NotNull - @Column(name = "USERID", nullable = false) - private String userID; /* userID */ - - @Column(name = "PASSWD") - @NotBlank - private String passwd; /* password */ - - @Column(name = "FULLNAME") - @NotBlank - private String fullName; /* fullName */ - - @Column(name = "ADDRESS") - @NotBlank - private String address; /* address */ - - @Column(name = "EMAIL") - @Email(message = "Email should be valid") - private String email; /* email */ - - @Column(name = "CREDITCARD") - @NotBlank - private String creditCard; /* creditCard */ - - @OneToOne(mappedBy = "profile", fetch = FetchType.LAZY) - private AccountDataBean account; - - public AccountProfileDataBean() { - } - - public AccountProfileDataBean(String userID, String password, String fullName, String address, String email, String creditCard) { - setUserID(userID); - setPassword(password); - setFullName(fullName); - setAddress(address); - setEmail(email); - setCreditCard(creditCard); - } - - public static AccountProfileDataBean getRandomInstance() { - return new AccountProfileDataBean(TradeConfig.rndUserID(), // userID - TradeConfig.rndUserID(), // passwd - TradeConfig.rndFullName(), // fullname - TradeConfig.rndAddress(), // address - TradeConfig.rndEmail(TradeConfig.rndUserID()), // email - TradeConfig.rndCreditCard() // creditCard - ); - } - - @Override - public String toString() { - return "\n\tAccount Profile Data for userID:" + getUserID() + "\n\t\t passwd:" + getPassword() + "\n\t\t fullName:" + getFullName() - + "\n\t\t address:" + getAddress() + "\n\t\t email:" + getEmail() + "\n\t\t creditCard:" + getCreditCard(); - } - - public String toHTML() { - return "
    Account Profile Data for userID: " + getUserID() + "" + "
  • passwd:" + getPassword() + "
  • " + "
  • fullName:" - + getFullName() + "
  • " + "
  • address:" + getAddress() + "
  • " + "
  • email:" + getEmail() + "
  • " + "
  • creditCard:" - + getCreditCard() + "
  • "; - } - - public void print() { - Log.log(this.toString()); - } - - public String getUserID() { - return userID; - } - - public void setUserID(String userID) { - this.userID = userID; - } - - public String getPassword() { - return passwd; - } - - public void setPassword(String password) { - this.passwd = password; - } - - public String getFullName() { - return fullName; - } - - public void setFullName(String fullName) { - this.fullName = fullName; - } - - public String getAddress() { - return address; - } - - public void setAddress(String address) { - this.address = address; - } - - public String getEmail() { - return email; - } - - public void setEmail(String email) { - this.email = email; - } - - public String getCreditCard() { - return creditCard; - } - - public void setCreditCard(String creditCard) { - this.creditCard = creditCard; - } - - public AccountDataBean getAccount() { - return account; - } - - public void setAccount(AccountDataBean account) { - this.account = account; - } - - @Override - public int hashCode() { - int hash = 0; - hash += (this.userID != null ? this.userID.hashCode() : 0); - return hash; - } - - @Override - public boolean equals(Object object) { - - if (!(object instanceof AccountProfileDataBean)) { - return false; - } - AccountProfileDataBean other = (AccountProfileDataBean) object; - - if (this.userID != other.userID && (this.userID == null || !this.userID.equals(other.userID))) { - return false; - } - - return true; - } -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/entities/HoldingDataBean.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/entities/HoldingDataBean.java deleted file mode 100644 index 703da644..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/entities/HoldingDataBean.java +++ /dev/null @@ -1,202 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2015. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.entities; - -import com.ibm.websphere.samples.daytrader.util.Log; -import com.ibm.websphere.samples.daytrader.util.TradeConfig; -import java.io.Serializable; -import java.math.BigDecimal; -import java.util.Date; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.FetchType; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToOne; -import javax.persistence.Table; -import javax.persistence.TableGenerator; -import javax.persistence.Temporal; -import javax.persistence.TemporalType; -import javax.persistence.Transient; -import javax.validation.constraints.NotNull; -import javax.validation.constraints.PastOrPresent; -import javax.validation.constraints.Positive; - -@Entity(name = "holdingejb") -@Table(name = "holdingejb") -public class HoldingDataBean implements Serializable { - - /* persistent/relationship fields */ - - private static final long serialVersionUID = -2338411656251935480L; - - @Id - @TableGenerator(name = "holdingIdGen", table = "KEYGENEJB", pkColumnName = "KEYNAME", valueColumnName = "KEYVAL", pkColumnValue = "holding", allocationSize = 1000) - @GeneratedValue(strategy = GenerationType.TABLE, generator = "holdingIdGen") - @Column(name = "HOLDINGID", nullable = false) - private Integer holdingID; /* holdingID */ - - @NotNull - @Positive - @Column(name = "QUANTITY", nullable = false) - private double quantity; /* quantity */ - - @Column(name = "PURCHASEPRICE") - @Positive - private BigDecimal purchasePrice; /* purchasePrice */ - - @Column(name = "PURCHASEDATE") - @Temporal(TemporalType.TIMESTAMP) - @PastOrPresent - private Date purchaseDate; /* purchaseDate */ - - @Transient - private String quoteID; /* Holding(*) ---> Quote(1) */ - - @ManyToOne(fetch = FetchType.LAZY) - @JoinColumn(name = "ACCOUNT_ACCOUNTID") - private AccountDataBean account; - - @ManyToOne(fetch = FetchType.EAGER) - @JoinColumn(name = "QUOTE_SYMBOL") - private QuoteDataBean quote; - - public HoldingDataBean() { - } - - public HoldingDataBean(Integer holdingID, double quantity, BigDecimal purchasePrice, Date purchaseDate, String quoteID) { - setHoldingID(holdingID); - setQuantity(quantity); - setPurchasePrice(purchasePrice); - setPurchaseDate(purchaseDate); - setQuoteID(quoteID); - } - - public HoldingDataBean(double quantity, BigDecimal purchasePrice, Date purchaseDate, AccountDataBean account, QuoteDataBean quote) { - setQuantity(quantity); - setPurchasePrice(purchasePrice); - setPurchaseDate(purchaseDate); - setAccount(account); - setQuote(quote); - } - - public static HoldingDataBean getRandomInstance() { - return new HoldingDataBean(new Integer(TradeConfig.rndInt(100000)), // holdingID - TradeConfig.rndQuantity(), // quantity - TradeConfig.rndBigDecimal(1000.0f), // purchasePrice - new java.util.Date(TradeConfig.rndInt(Integer.MAX_VALUE)), // purchaseDate - TradeConfig.rndSymbol() // symbol - ); - } - - @Override - public String toString() { - return "\n\tHolding Data for holding: " + getHoldingID() + "\n\t\t quantity:" + getQuantity() + "\n\t\t purchasePrice:" + getPurchasePrice() - + "\n\t\t purchaseDate:" + getPurchaseDate() + "\n\t\t quoteID:" + getQuoteID(); - } - - public String toHTML() { - return "
    Holding Data for holding: " + getHoldingID() + "" + "
  • quantity:" + getQuantity() + "
  • " + "
  • purchasePrice:" - + getPurchasePrice() + "
  • " + "
  • purchaseDate:" + getPurchaseDate() + "
  • " + "
  • quoteID:" + getQuoteID() + "
  • "; - } - - public void print() { - Log.log(this.toString()); - } - - public Integer getHoldingID() { - return holdingID; - } - - public void setHoldingID(Integer holdingID) { - this.holdingID = holdingID; - } - - public double getQuantity() { - return quantity; - } - - public void setQuantity(double quantity) { - this.quantity = quantity; - } - - public BigDecimal getPurchasePrice() { - return purchasePrice; - } - - public void setPurchasePrice(BigDecimal purchasePrice) { - this.purchasePrice = purchasePrice; - } - - public Date getPurchaseDate() { - return purchaseDate; - } - - public void setPurchaseDate(Date purchaseDate) { - this.purchaseDate = purchaseDate; - } - - public String getQuoteID() { - if (quote != null) { - return quote.getSymbol(); - } - return quoteID; - } - - public void setQuoteID(String quoteID) { - this.quoteID = quoteID; - } - - public AccountDataBean getAccount() { - return account; - } - - public void setAccount(AccountDataBean account) { - this.account = account; - } - - public QuoteDataBean getQuote() { - return quote; - } - - public void setQuote(QuoteDataBean quote) { - this.quote = quote; - } - - @Override - public int hashCode() { - int hash = 0; - hash += (this.holdingID != null ? this.holdingID.hashCode() : 0); - return hash; - } - - @Override - public boolean equals(Object object) { - - if (!(object instanceof HoldingDataBean)) { - return false; - } - HoldingDataBean other = (HoldingDataBean) object; - - if (this.holdingID != other.holdingID && (this.holdingID == null || !this.holdingID.equals(other.holdingID))) { - return false; - } - - return true; - } -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/entities/OrderDataBean.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/entities/OrderDataBean.java deleted file mode 100644 index 040ca66a..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/entities/OrderDataBean.java +++ /dev/null @@ -1,336 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2015. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.entities; - -import com.ibm.websphere.samples.daytrader.util.Log; -import com.ibm.websphere.samples.daytrader.util.TradeConfig; -import java.io.Serializable; -import java.math.BigDecimal; -import java.util.Date; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.FetchType; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToOne; -import javax.persistence.NamedQueries; -import javax.persistence.NamedQuery; -import javax.persistence.OneToOne; -import javax.persistence.Table; -import javax.persistence.TableGenerator; -import javax.persistence.Temporal; -import javax.persistence.TemporalType; -import javax.persistence.Transient; -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotNull; -import javax.validation.constraints.PastOrPresent; -import javax.validation.constraints.Positive; - -@Entity(name = "orderejb") -@Table(name = "orderejb") -@NamedQueries({ - @NamedQuery(name = "orderejb.findByOrderfee", query = "SELECT o FROM orderejb o WHERE o.orderFee = :orderfee"), - @NamedQuery(name = "orderejb.findByCompletiondate", query = "SELECT o FROM orderejb o WHERE o.completionDate = :completiondate"), - @NamedQuery(name = "orderejb.findByOrdertype", query = "SELECT o FROM orderejb o WHERE o.orderType = :ordertype"), - @NamedQuery(name = "orderejb.findByOrderstatus", query = "SELECT o FROM orderejb o WHERE o.orderStatus = :orderstatus"), - @NamedQuery(name = "orderejb.findByPrice", query = "SELECT o FROM orderejb o WHERE o.price = :price"), - @NamedQuery(name = "orderejb.findByQuantity", query = "SELECT o FROM orderejb o WHERE o.quantity = :quantity"), - @NamedQuery(name = "orderejb.findByOpendate", query = "SELECT o FROM orderejb o WHERE o.openDate = :opendate"), - @NamedQuery(name = "orderejb.findByOrderid", query = "SELECT o FROM orderejb o WHERE o.orderID = :orderid"), - @NamedQuery(name = "orderejb.findByAccountAccountid", query = "SELECT o FROM orderejb o WHERE o.account.accountID = :accountAccountid"), - @NamedQuery(name = "orderejb.findByQuoteSymbol", query = "SELECT o FROM orderejb o WHERE o.quote.symbol = :quoteSymbol"), - @NamedQuery(name = "orderejb.findByHoldingHoldingid", query = "SELECT o FROM orderejb o WHERE o.holding.holdingID = :holdingHoldingid"), - @NamedQuery(name = "orderejb.closedOrders", query = "SELECT o FROM orderejb o WHERE o.orderStatus = 'closed' AND o.account.profile.userID = :userID"), - @NamedQuery(name = "orderejb.completeClosedOrders", query = "UPDATE orderejb o SET o.orderStatus = 'completed' WHERE o.orderStatus = 'closed' AND o.account.profile.userID = :userID") }) -public class OrderDataBean implements Serializable { - - private static final long serialVersionUID = 120650490200739057L; - - @Id - @TableGenerator(name = "orderIdGen", table = "KEYGENEJB", pkColumnName = "KEYNAME", valueColumnName = "KEYVAL", pkColumnValue = "order", allocationSize = 1000) - @GeneratedValue(strategy = GenerationType.TABLE, generator = "orderIdGen") - @Column(name = "ORDERID", nullable = false) - private Integer orderID; /* orderID */ - - @Column(name = "ORDERTYPE") - @NotBlank - private String orderType; /* orderType (buy, sell, etc.) */ - - @Column(name = "ORDERSTATUS") - @NotBlank - private String orderStatus; /* - * orderStatus (open, processing, completed, - * closed, cancelled) - */ - - @Column(name = "OPENDATE") - @Temporal(TemporalType.TIMESTAMP) - @PastOrPresent - private Date openDate; /* openDate (when the order was entered) */ - - @Column(name = "COMPLETIONDATE") - @PastOrPresent - @Temporal(TemporalType.TIMESTAMP) - private Date completionDate; /* completionDate */ - - @NotNull - @Column(name = "QUANTITY", nullable = false) - private double quantity; /* quantity */ - - @Column(name = "PRICE") - @Positive - private BigDecimal price; /* price */ - - @Column(name = "ORDERFEE") - @Positive - private BigDecimal orderFee; /* price */ - - @ManyToOne(fetch = FetchType.LAZY) - @JoinColumn(name = "ACCOUNT_ACCOUNTID") - private AccountDataBean account; - - @ManyToOne(fetch = FetchType.EAGER) - @JoinColumn(name = "QUOTE_SYMBOL") - private QuoteDataBean quote; - - @OneToOne(fetch = FetchType.LAZY) - @JoinColumn(name = "HOLDING_HOLDINGID") - private HoldingDataBean holding; - - /* Fields for relationship fields are not kept in the Data Bean */ - @Transient - private String symbol; - - public OrderDataBean() { - } - - public OrderDataBean(Integer orderID, String orderType, String orderStatus, Date openDate, Date completionDate, double quantity, BigDecimal price, - BigDecimal orderFee, String symbol) { - setOrderID(orderID); - setOrderType(orderType); - setOrderStatus(orderStatus); - setOpenDate(openDate); - setCompletionDate(completionDate); - setQuantity(quantity); - setPrice(price); - setOrderFee(orderFee); - setSymbol(symbol); - } - - public OrderDataBean(String orderType, String orderStatus, Date openDate, Date completionDate, double quantity, BigDecimal price, BigDecimal orderFee, - AccountDataBean account, QuoteDataBean quote, HoldingDataBean holding) { - setOrderType(orderType); - setOrderStatus(orderStatus); - setOpenDate(openDate); - setCompletionDate(completionDate); - setQuantity(quantity); - setPrice(price); - setOrderFee(orderFee); - setAccount(account); - setQuote(quote); - setHolding(holding); - } - - public static OrderDataBean getRandomInstance() { - return new OrderDataBean(new Integer(TradeConfig.rndInt(100000)), TradeConfig.rndBoolean() ? "buy" : "sell", "open", new java.util.Date( - TradeConfig.rndInt(Integer.MAX_VALUE)), new java.util.Date(TradeConfig.rndInt(Integer.MAX_VALUE)), TradeConfig.rndQuantity(), - TradeConfig.rndBigDecimal(1000.0f), TradeConfig.rndBigDecimal(1000.0f), TradeConfig.rndSymbol()); - } - - @Override - public String toString() { - return "Order " + getOrderID() + "\n\t orderType: " + getOrderType() + "\n\t orderStatus: " + getOrderStatus() + "\n\t openDate: " - + getOpenDate() + "\n\t completionDate: " + getCompletionDate() + "\n\t quantity: " + getQuantity() + "\n\t price: " - + getPrice() + "\n\t orderFee: " + getOrderFee() + "\n\t symbol: " + getSymbol(); - } - - public String toHTML() { - return "
    Order " + getOrderID() + "" + "
  • orderType: " + getOrderType() + "
  • " + "
  • orderStatus: " + getOrderStatus() - + "
  • " + "
  • openDate: " + getOpenDate() + "
  • " + "
  • completionDate: " + getCompletionDate() + "
  • " - + "
  • quantity: " + getQuantity() + "
  • " + "
  • price: " + getPrice() + "
  • " + "
  • orderFee: " + getOrderFee() - + "
  • " + "
  • symbol: " + getSymbol() + "
  • "; - } - - public void print() { - Log.log(this.toString()); - } - - public Integer getOrderID() { - return orderID; - } - - public void setOrderID(Integer orderID) { - this.orderID = orderID; - } - - public String getOrderType() { - return orderType; - } - - public void setOrderType(String orderType) { - this.orderType = orderType; - } - - public String getOrderStatus() { - return orderStatus; - } - - public void setOrderStatus(String orderStatus) { - this.orderStatus = orderStatus; - } - - public Date getOpenDate() { - return openDate; - } - - public void setOpenDate(Date openDate) { - this.openDate = openDate; - } - - public Date getCompletionDate() { - return completionDate; - } - - public void setCompletionDate(Date completionDate) { - this.completionDate = completionDate; - } - - public double getQuantity() { - return quantity; - } - - public void setQuantity(double quantity) { - this.quantity = quantity; - } - - public BigDecimal getPrice() { - return price; - } - - public void setPrice(BigDecimal price) { - this.price = price; - } - - public BigDecimal getOrderFee() { - return orderFee; - } - - public void setOrderFee(BigDecimal orderFee) { - this.orderFee = orderFee; - } - - public String getSymbol() { - if (quote != null) { - return quote.getSymbol(); - } - return symbol; - } - - public void setSymbol(String symbol) { - this.symbol = symbol; - } - - public AccountDataBean getAccount() { - return account; - } - - public void setAccount(AccountDataBean account) { - this.account = account; - } - - public QuoteDataBean getQuote() { - return quote; - } - - public void setQuote(QuoteDataBean quote) { - this.quote = quote; - } - - public HoldingDataBean getHolding() { - return holding; - } - - public void setHolding(HoldingDataBean holding) { - this.holding = holding; - } - - public boolean isBuy() { - String orderType = getOrderType(); - if (orderType.compareToIgnoreCase("buy") == 0) { - return true; - } - return false; - } - - public boolean isSell() { - String orderType = getOrderType(); - if (orderType.compareToIgnoreCase("sell") == 0) { - return true; - } - return false; - } - - public boolean isOpen() { - String orderStatus = getOrderStatus(); - if ((orderStatus.compareToIgnoreCase("open") == 0) || (orderStatus.compareToIgnoreCase("processing") == 0)) { - return true; - } - return false; - } - - public boolean isCompleted() { - String orderStatus = getOrderStatus(); - if ((orderStatus.compareToIgnoreCase("completed") == 0) || (orderStatus.compareToIgnoreCase("alertcompleted") == 0) - || (orderStatus.compareToIgnoreCase("cancelled") == 0)) { - return true; - } - return false; - } - - public boolean isCancelled() { - String orderStatus = getOrderStatus(); - if (orderStatus.compareToIgnoreCase("cancelled") == 0) { - return true; - } - return false; - } - - public void cancel() { - setOrderStatus("cancelled"); - } - - @Override - public int hashCode() { - int hash = 0; - hash += (this.orderID != null ? this.orderID.hashCode() : 0); - return hash; - } - - @Override - public boolean equals(Object object) { - - if (!(object instanceof OrderDataBean)) { - return false; - } - OrderDataBean other = (OrderDataBean) object; - if (this.orderID != other.orderID && (this.orderID == null || !this.orderID.equals(other.orderID))) { - return false; - } - return true; - } -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/entities/QuoteDataBean.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/entities/QuoteDataBean.java deleted file mode 100644 index 6db26713..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/entities/QuoteDataBean.java +++ /dev/null @@ -1,211 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2015. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.entities; - -import com.ibm.websphere.samples.daytrader.util.Log; -import com.ibm.websphere.samples.daytrader.util.TradeConfig; -import java.io.Serializable; -import java.math.BigDecimal; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.Id; -import javax.persistence.NamedNativeQueries; -import javax.persistence.NamedNativeQuery; -import javax.persistence.NamedQueries; -import javax.persistence.NamedQuery; -import javax.persistence.Table; -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Positive; - -@Entity(name = "quoteejb") -@Table(name = "quoteejb") -@NamedQueries({ - @NamedQuery(name = "quoteejb.allQuotes", query = "SELECT q FROM quoteejb q")}) -@NamedNativeQueries({ @NamedNativeQuery(name = "quoteejb.quoteForUpdate", query = "select * from quoteejb q where q.symbol=? for update", resultClass = com.ibm.websphere.samples.daytrader.entities.QuoteDataBean.class) }) -public class QuoteDataBean implements Serializable { - - /* Accessor methods for persistent fields */ - - private static final long serialVersionUID = 1847932261895838791L; - - @Id - @NotNull - @Column(name = "SYMBOL", nullable = false) - private String symbol; /* symbol */ - - @Column(name = "COMPANYNAME") - @NotBlank - private String companyName; /* companyName */ - - @NotNull - @Column(name = "VOLUME", nullable = false) - private double volume; /* volume */ - - @Column(name = "PRICE") - @Positive - private BigDecimal price; /* price */ - - @Column(name = "OPEN1") - @Positive - private BigDecimal open1; /* open1 price */ - - @Column(name = "LOW") - @Positive - private BigDecimal low; /* low price */ - - @Column(name = "HIGH") - @Positive - private BigDecimal high; /* high price */ - - @NotNull - @Column(name = "CHANGE1", nullable = false) - private double change1; /* price change */ - - /* Accessor methods for relationship fields are not kept in the DataBean */ - - public QuoteDataBean() { - } - - public QuoteDataBean(String symbol, String companyName, double volume, BigDecimal price, BigDecimal open, BigDecimal low, BigDecimal high, double change) { - setSymbol(symbol); - setCompanyName(companyName); - setVolume(volume); - setPrice(price); - setOpen(open); - setLow(low); - setHigh(high); - setChange(change); - } - - public static QuoteDataBean getRandomInstance() { - return new QuoteDataBean(TradeConfig.rndSymbol(), // symbol - TradeConfig.rndSymbol() + " Incorporated", // Company Name - TradeConfig.rndFloat(100000), // volume - TradeConfig.rndBigDecimal(1000.0f), // price - TradeConfig.rndBigDecimal(1000.0f), // open1 - TradeConfig.rndBigDecimal(1000.0f), // low - TradeConfig.rndBigDecimal(1000.0f), // high - TradeConfig.rndFloat(100000) // volume - ); - } - - // Create a "zero" value quoteDataBean for the given symbol - public QuoteDataBean(String symbol) { - setSymbol(symbol); - } - - @Override - public String toString() { - return "\n\tQuote Data for: " + getSymbol() + "\n\t\t companyName: " + getCompanyName() + "\n\t\t volume: " + getVolume() + "\n\t\t price: " - + getPrice() + "\n\t\t open1: " + getOpen() + "\n\t\t low: " + getLow() + "\n\t\t high: " + getHigh() - + "\n\t\t change1: " + getChange(); - } - - public String toHTML() { - return "
    Quote Data for: " + getSymbol() + "
  • companyName: " + getCompanyName() + "
  • " + "
  • volume: " + getVolume() + "
  • " - + "
  • price: " + getPrice() + "
  • " + "
  • open1: " + getOpen() + "
  • " + "
  • low: " + getLow() + "
  • " - + "
  • high: " + getHigh() + "
  • " + "
  • change1: " + getChange() + "
  • "; - } - - public void print() { - Log.log(this.toString()); - } - - public String getSymbol() { - return symbol; - } - - public void setSymbol(String symbol) { - this.symbol = symbol; - } - - public String getCompanyName() { - return companyName; - } - - public void setCompanyName(String companyName) { - this.companyName = companyName; - } - - public BigDecimal getPrice() { - return price; - } - - public void setPrice(BigDecimal price) { - this.price = price; - } - - public BigDecimal getOpen() { - return open1; - } - - public void setOpen(BigDecimal open) { - this.open1 = open; - } - - public BigDecimal getLow() { - return low; - } - - public void setLow(BigDecimal low) { - this.low = low; - } - - public BigDecimal getHigh() { - return high; - } - - public void setHigh(BigDecimal high) { - this.high = high; - } - - public double getChange() { - return change1; - } - - public void setChange(double change) { - this.change1 = change; - } - - public double getVolume() { - return volume; - } - - public void setVolume(double volume) { - this.volume = volume; - } - - @Override - public int hashCode() { - int hash = 0; - hash += (this.symbol != null ? this.symbol.hashCode() : 0); - return hash; - } - - @Override - public boolean equals(Object object) { - - if (!(object instanceof QuoteDataBean)) { - return false; - } - QuoteDataBean other = (QuoteDataBean) object; - if (this.symbol != other.symbol && (this.symbol == null || !this.symbol.equals(other.symbol))) { - return false; - } - return true; - } -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/impl/direct/AsyncOrder.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/impl/direct/AsyncOrder.java deleted file mode 100644 index 1309d4ba..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/impl/direct/AsyncOrder.java +++ /dev/null @@ -1,70 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2019. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.impl.direct; - -import com.ibm.websphere.samples.daytrader.interfaces.TradeJDBC; -import com.ibm.websphere.samples.daytrader.interfaces.TradeServices; -import javax.annotation.Resource; -import javax.enterprise.context.Dependent; -import javax.inject.Inject; -import javax.transaction.UserTransaction; - -@Dependent -public class AsyncOrder implements Runnable { - - @Inject - @TradeJDBC - TradeServices tradeService; - - @Resource - UserTransaction ut; - - Integer orderID; - boolean twoPhase; - - public void setProperties(Integer orderID, boolean twoPhase) { - this.orderID = orderID; - this.twoPhase = twoPhase; - } - - @Override - public void run() { - - - try { - ut.begin(); - tradeService.completeOrder(orderID, twoPhase); - ut.commit(); - } catch (Exception e) { - - try { - ut.rollback(); - } catch (Exception e1) { - try { - throw new Exception(e1); - } catch (Exception e2) { - e2.printStackTrace(); - } - } - try { - throw new Exception(e); - } catch (Exception e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - } - } - } -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/impl/direct/AsyncOrderSubmitter.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/impl/direct/AsyncOrderSubmitter.java deleted file mode 100644 index ccb8051e..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/impl/direct/AsyncOrderSubmitter.java +++ /dev/null @@ -1,39 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2019. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.impl.direct; - -import java.util.concurrent.Future; -import javax.annotation.Resource; -import javax.enterprise.concurrent.ManagedExecutorService; -import javax.enterprise.context.RequestScoped; -import javax.inject.Inject; - -@RequestScoped -public class AsyncOrderSubmitter { - - - @Resource - private ManagedExecutorService mes; - - @Inject - private AsyncOrder asyncOrder; - - - public Future submitOrder(Integer orderID, boolean twoPhase) { - asyncOrder.setProperties(orderID,twoPhase); - return mes.submit(asyncOrder); - } -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/impl/direct/KeySequenceDirect.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/impl/direct/KeySequenceDirect.java deleted file mode 100644 index 4165da0e..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/impl/direct/KeySequenceDirect.java +++ /dev/null @@ -1,113 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2015. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.impl.direct; - -import com.ibm.websphere.samples.daytrader.util.KeyBlock; -import com.ibm.websphere.samples.daytrader.util.Log; -import com.ibm.websphere.samples.daytrader.util.TradeConfig; -import java.sql.Connection; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.util.Collection; -import java.util.HashMap; -import java.util.Iterator; - -public class KeySequenceDirect { - - private static HashMap> keyMap = new HashMap>(); - - public static synchronized Integer getNextID(Connection conn, String keyName, boolean inSession, boolean inGlobalTxn) throws Exception { - Integer nextID = null; - // First verify we have allocated a block of keys - // for this key name - // Then verify the allocated block has not been depleted - // allocate a new block if necessary - if (keyMap.containsKey(keyName) == false) { - allocNewBlock(conn, keyName, inSession, inGlobalTxn); - } - Collection block = keyMap.get(keyName); - - Iterator ids = block.iterator(); - if (ids.hasNext() == false) { - ids = allocNewBlock(conn, keyName, inSession, inGlobalTxn).iterator(); - } - // get and return a new unique key - nextID = (Integer) ids.next(); - - - Log.trace("KeySequenceDirect:getNextID inSession(" + inSession + ") - return new PK ID for Entity type: " + keyName + " ID=" + nextID); - - return nextID; - } - - private static Collection allocNewBlock(Connection conn, String keyName, boolean inSession, boolean inGlobalTxn) throws Exception { - try { - - if (inGlobalTxn == false && !inSession) { - conn.commit(); // commit any pending txns - } - - PreparedStatement stmt = conn.prepareStatement(getKeyForUpdateSQL); - stmt.setString(1, keyName); - ResultSet rs = stmt.executeQuery(); - - if (!rs.next()) { - // No keys found for this name - create a new one - PreparedStatement stmt2 = conn.prepareStatement(createKeySQL); - int keyVal = 0; - stmt2.setString(1, keyName); - stmt2.setInt(2, keyVal); - stmt2.executeUpdate(); - stmt2.close(); - stmt.close(); - stmt = conn.prepareStatement(getKeyForUpdateSQL); - stmt.setString(1, keyName); - rs = stmt.executeQuery(); - rs.next(); - } - - int keyVal = rs.getInt("keyval"); - - stmt.close(); - - stmt = conn.prepareStatement(updateKeyValueSQL); - stmt.setInt(1, keyVal + TradeConfig.KEYBLOCKSIZE); - stmt.setString(2, keyName); - stmt.executeUpdate(); - stmt.close(); - - Collection block = new KeyBlock(keyVal, keyVal + TradeConfig.KEYBLOCKSIZE - 1); - keyMap.put(keyName, block); - - if (inGlobalTxn == false && !inSession) { - conn.commit(); - } - - return block; - } catch (Exception e) { - String error = "KeySequenceDirect:allocNewBlock - failure to allocate new block of keys for Entity type: " + keyName; - Log.error(e, error); - throw new Exception(error + e.toString()); - } - } - - private static final String getKeyForUpdateSQL = "select * from keygenejb kg where kg.keyname = ? for update"; - - private static final String createKeySQL = "insert into keygenejb " + "( keyname, keyval ) " + "VALUES ( ? , ? )"; - - private static final String updateKeyValueSQL = "update keygenejb set keyval = ? " + "where keyname = ?"; - -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/impl/direct/TradeDirect.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/impl/direct/TradeDirect.java deleted file mode 100644 index 94d3d3b4..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/impl/direct/TradeDirect.java +++ /dev/null @@ -1,1835 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2015. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.impl.direct; - -import com.ibm.websphere.samples.daytrader.beans.MarketSummaryDataBean; -import com.ibm.websphere.samples.daytrader.entities.AccountDataBean; -import com.ibm.websphere.samples.daytrader.entities.AccountProfileDataBean; -import com.ibm.websphere.samples.daytrader.entities.HoldingDataBean; -import com.ibm.websphere.samples.daytrader.entities.OrderDataBean; -import com.ibm.websphere.samples.daytrader.entities.QuoteDataBean; -import com.ibm.websphere.samples.daytrader.interfaces.MarketSummaryUpdate; -import com.ibm.websphere.samples.daytrader.interfaces.RuntimeMode; -import com.ibm.websphere.samples.daytrader.interfaces.Trace; -import com.ibm.websphere.samples.daytrader.interfaces.TradeJDBC; -import com.ibm.websphere.samples.daytrader.interfaces.TradeServices; -import com.ibm.websphere.samples.daytrader.util.FinancialUtils; -import com.ibm.websphere.samples.daytrader.util.Log; -import com.ibm.websphere.samples.daytrader.util.MDBStats; -import com.ibm.websphere.samples.daytrader.util.RecentQuotePriceChangeList; -import com.ibm.websphere.samples.daytrader.util.TradeConfig; -import java.io.Serializable; -import java.math.BigDecimal; -import java.sql.Connection; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Statement; -import java.sql.Timestamp; -import java.util.ArrayList; -import java.util.Collection; -import java.util.concurrent.Future; -import javax.annotation.Resource; -import javax.enterprise.concurrent.ManagedExecutorService; -import javax.enterprise.context.Dependent; -import javax.enterprise.event.Event; -import javax.enterprise.event.NotificationOptions; -import javax.inject.Inject; -import javax.jms.JMSContext; -import javax.jms.JMSException; -import javax.jms.Queue; -import javax.jms.QueueConnectionFactory; -import javax.jms.TextMessage; -import javax.jms.Topic; -import javax.jms.TopicConnectionFactory; -import javax.sql.DataSource; -import javax.transaction.UserTransaction; -import javax.validation.constraints.NotNull; - -/** - * TradeDirect uses direct JDBC and JMS access to a - * javax.sql.DataSource to implement the business methods of the - * Trade online broker application. These business methods represent the - * features and operations that can be performed by customers of the brokerage - * such as login, logout, get a stock quote, buy or sell a stock, etc. and are - * specified in the {@link com.ibm.websphere.samples.daytrader.TradeServices} - * interface - * - * Note: In order for this class to be thread-safe, a new TradeJDBC must be - * created for each call to a method from the TradeInterface interface. - * Otherwise, pooled connections may not be released. - * - * @see com.ibm.websphere.samples.daytrader.TradeServices - * - */ - -@Dependent -@TradeJDBC -@RuntimeMode("Direct (JDBC)") -@Trace -public class TradeDirect implements TradeServices, Serializable { - /** - * - */ - private static final long serialVersionUID = -8089049090952927985L; - - //This lock is used to serialize market summary operations. - private static final Integer marketSummaryLock = new Integer(0); - private static long nextMarketSummary = System.currentTimeMillis(); - private static MarketSummaryDataBean cachedMSDB = MarketSummaryDataBean.getRandomInstance(); - - private static BigDecimal ZERO = new BigDecimal(0.0); - private boolean inGlobalTxn = false; - private boolean inSession = false; - - // For Wildfly - add java:/ to these resource names. - - @Resource(name = "jms/QueueConnectionFactory", authenticationType = javax.annotation.Resource.AuthenticationType.APPLICATION) - //@Resource(name = "java:/jms/QueueConnectionFactory", authenticationType = javax.annotation.Resource.AuthenticationType.APPLICATION) - private QueueConnectionFactory queueConnectionFactory; - - @Resource(name = "jms/TopicConnectionFactory", authenticationType = javax.annotation.Resource.AuthenticationType.APPLICATION) - //@Resource(name = "java:/jms/TopicConnectionFactory", authenticationType = javax.annotation.Resource.AuthenticationType.APPLICATION) - private TopicConnectionFactory topicConnectionFactory; - - @Resource(lookup = "jms/TradeStreamerTopic") - //@Resource(lookup = "java:/jms/TradeStreamerTopic") - private Topic tradeStreamerTopic; - - @Resource(lookup = "jms/TradeBrokerQueue") - //@Resource(lookup = "java:/jms/TradeBrokerQueue") - private Queue tradeBrokerQueue; - - @Resource(lookup = "jdbc/TradeDataSource") - //@Resource(lookup = "java:/jdbc/TradeDataSource") - private DataSource datasource; - - @Resource - private UserTransaction txn; - - @Inject - RecentQuotePriceChangeList recentQuotePriceChangeList; - - @Inject - AsyncOrderSubmitter asyncOrderSubmitter; - - @Inject - @MarketSummaryUpdate - Event mkSummaryUpdateEvent; - - @Resource - private ManagedExecutorService mes; - - - @Override - public MarketSummaryDataBean getMarketSummary() throws Exception { - - if (TradeConfig.getMarketSummaryInterval() == 0) { - return getMarketSummaryInternal(); - } - if (TradeConfig.getMarketSummaryInterval() < 0) { - return cachedMSDB; - } - - /** - * This is a little funky. If its time to fetch a new Market summary - * then we'll synchronize access to make sure only one requester does - * it. Others will merely return the old copy until the new - * MarketSummary has been executed. - */ - - long currentTime = System.currentTimeMillis(); - - if (currentTime > nextMarketSummary) { - long oldNextMarketSummary = nextMarketSummary; - boolean fetch = false; - - synchronized (marketSummaryLock) { - /** - * Is it still ahead or did we miss lose the race? If we lost - * then let's get out of here as the work has already been done. - */ - if (oldNextMarketSummary == nextMarketSummary) { - fetch = true; - nextMarketSummary += TradeConfig.getMarketSummaryInterval() * 1000; - - /** - * If the server has been idle for a while then its possible - * that nextMarketSummary could be way off. Rather than try - * and play catch up we'll simply get in sync with the - * current time + the interval. - */ - if (nextMarketSummary < currentTime) { - nextMarketSummary = currentTime + TradeConfig.getMarketSummaryInterval() * 1000; - } - } - } - - /** - * If we're the lucky one then let's update the MarketSummary - */ - if (fetch) { - cachedMSDB = getMarketSummaryInternal(); - - } - } - - return cachedMSDB; - } - - - - /** - * @see TradeServices#getMarketSummary() - */ - - public MarketSummaryDataBean getMarketSummaryInternal() throws Exception { - - MarketSummaryDataBean marketSummaryData = null; - Connection conn = null; - try { - - Log.trace("TradeDirect:getMarketSummary - inSession(" + this.inSession + ")"); - - conn = getConn(); - PreparedStatement stmt = getStatement(conn, getTSIAQuotesOrderByChangeSQL, ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY); - - ArrayList topGainersData = new ArrayList(5); - ArrayList topLosersData = new ArrayList(5); - - ResultSet rs = stmt.executeQuery(); - - int count = 0; - while (rs.next() && (count++ < 5)) { - QuoteDataBean quoteData = getQuoteDataFromResultSet(rs); - topLosersData.add(quoteData); - } - - stmt.close(); - stmt = getStatement(conn, "select * from quoteejb q order by q.change1 DESC", ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY); - rs = stmt.executeQuery(); - - count = 0; - while (rs.next() && (count++ < 5)) { - QuoteDataBean quoteData = getQuoteDataFromResultSet(rs); - topGainersData.add(quoteData); - } - - /* - * rs.last(); count = 0; while (rs.previous() && (count++ < 5) ) { - * QuoteDataBean quoteData = getQuoteDataFromResultSet(rs); - * topGainersData.add(quoteData); } - */ - - stmt.close(); - - BigDecimal TSIA = ZERO; - BigDecimal openTSIA = ZERO; - double volume = 0.0; - - if ((topGainersData.size() > 0) || (topLosersData.size() > 0)) { - - stmt = getStatement(conn, getTSIASQL); - rs = stmt.executeQuery(); - - if (!rs.next()) { - Log.error("TradeDirect:getMarketSummary -- error w/ getTSIASQL -- no results"); - } else { - TSIA = rs.getBigDecimal("TSIA"); - } - stmt.close(); - - stmt = getStatement(conn, getOpenTSIASQL); - rs = stmt.executeQuery(); - - if (!rs.next()) { - Log.error("TradeDirect:getMarketSummary -- error w/ getOpenTSIASQL -- no results"); - } else { - openTSIA = rs.getBigDecimal("openTSIA"); - } - stmt.close(); - - stmt = getStatement(conn, getTSIATotalVolumeSQL); - rs = stmt.executeQuery(); - - if (!rs.next()) { - Log.error("TradeDirect:getMarketSummary -- error w/ getTSIATotalVolumeSQL -- no results"); - } else { - volume = rs.getDouble("totalVolume"); - } - stmt.close(); - } - commit(conn); - - marketSummaryData = new MarketSummaryDataBean(TSIA, openTSIA, volume, topGainersData, topLosersData); - mkSummaryUpdateEvent.fireAsync("MarketSummaryUpdate", NotificationOptions.builder().setExecutor(mes).build()); - - } - - catch (Exception e) { - Log.error("TradeDirect:login -- error logging in user", e); - rollBack(conn, e); - } finally { - releaseConn(conn); - } - return marketSummaryData; - - } - - /** - * @see TradeServices#buy(String, String, double) - */ - @Override - @NotNull - public OrderDataBean buy(String userID, String symbol, double quantity, int orderProcessingMode) throws Exception { - - final Connection conn = getConn(); - OrderDataBean orderData = null; - - BigDecimal total; - - try { - - Log.trace("TradeDirect:buy - inSession(" + this.inSession + ")");//, userID, symbol, new Double(quantity)); - - - if (!inSession && orderProcessingMode == TradeConfig.ASYNCH_2PHASE) { - - Log.trace("TradeDirect:buy create/begin global transaction"); - - - txn.begin(); - setInGlobalTxn(true); - } - - //conn = getConn(); - - AccountDataBean accountData = getAccountData(conn, userID); - QuoteDataBean quoteData = getQuoteData(conn, symbol); - HoldingDataBean holdingData = null; // the buy operation will create - // the holding - - orderData = createOrder(accountData, quoteData, holdingData, "buy", quantity); - - // Update -- account should be credited during completeOrder - BigDecimal price = quoteData.getPrice(); - BigDecimal orderFee = orderData.getOrderFee(); - total = (new BigDecimal(quantity).multiply(price)).add(orderFee); - // subtract total from account balance - creditAccountBalance(conn, accountData, total.negate()); - final Integer orderID = orderData.getOrderID(); - - try { - - if (orderProcessingMode == TradeConfig.SYNCH) { - completeOrder(conn, orderData.getOrderID()); - } else if (orderProcessingMode == TradeConfig.ASYNCH) { - completeOrderAsync(orderID, true); - } else if (orderProcessingMode == TradeConfig.ASYNCH_2PHASE) { - queueOrder(orderID, true); // 2-phase - } - } catch (JMSException je) { - Log.error("TradeBean:buy(" + userID + "," + symbol + "," + quantity + ") --> failed to queueOrder", je); - - - cancelOrder(conn, orderData.getOrderID()); - } - - orderData = getOrderData(conn, orderData.getOrderID().intValue()); - - if (getInGlobalTxn()) { - - Log.trace("TradeDirect:buy committing global transaction"); - - if (!inSession && orderProcessingMode == TradeConfig.ASYNCH_2PHASE) { - txn.commit(); - setInGlobalTxn(false); - } - } else { - commit(conn); - } - } catch (Exception e) { - Log.error("TradeDirect:buy error - rolling back", e); - if (getInGlobalTxn()) { - txn.rollback(); - } else { - rollBack(conn, e); - } - } finally { - releaseConn(conn); - } - - return orderData; - } - - /** - * @see TradeServices#sell(String, Integer) - */ - @Override - @NotNull - public OrderDataBean sell(String userID, Integer holdingID, int orderProcessingMode) throws Exception { - Connection conn = null; - OrderDataBean orderData = null; - //UserTransaction txn = null; - - /* - * total = (quantity * purchasePrice) + orderFee - */ - BigDecimal total; - - try { - - Log.trace("TradeDirect:sell - inSession(" + this.inSession + ")", userID, holdingID); - - - if (!inSession && orderProcessingMode == TradeConfig.ASYNCH_2PHASE) { - - Log.trace("TradeDirect:sell create/begin global transaction"); - - txn.begin(); - setInGlobalTxn(true); - } - - conn = getConn(); - - AccountDataBean accountData = getAccountData(conn, userID); - HoldingDataBean holdingData = getHoldingData(conn, holdingID.intValue()); - QuoteDataBean quoteData = null; - if (holdingData != null) { - quoteData = getQuoteData(conn, holdingData.getQuoteID()); - } - - if ((accountData == null) || (holdingData == null) || (quoteData == null)) { - String error = "TradeDirect:sell -- error selling stock -- unable to find: \n\taccount=" + accountData + "\n\tholding=" + holdingData - + "\n\tquote=" + quoteData + "\nfor user: " + userID + " and holdingID: " + holdingID; - Log.debug(error); - if (getInGlobalTxn()) { - txn.rollback(); - } else { - rollBack(conn, new Exception(error)); - } - orderData = new OrderDataBean(); - orderData.setOrderStatus("cancelled"); - return orderData; - } - - double quantity = holdingData.getQuantity(); - - orderData = createOrder(accountData, quoteData, holdingData, "sell", quantity); - - // Set the holdingSymbol purchaseDate to selling to signify the sell - // is "inflight" - updateHoldingStatus(conn, holdingData.getHoldingID(), holdingData.getQuoteID()); - - // UPDATE -- account should be credited during completeOrder - BigDecimal price = quoteData.getPrice(); - BigDecimal orderFee = orderData.getOrderFee(); - total = (new BigDecimal(quantity).multiply(price)).subtract(orderFee); - creditAccountBalance(conn, accountData, total); - - try { - if (orderProcessingMode == TradeConfig.SYNCH) { - completeOrder(conn, orderData.getOrderID()); - } else if (orderProcessingMode == TradeConfig.ASYNCH) { - this.completeOrderAsync(orderData.getOrderID(), true); - } else if (orderProcessingMode == TradeConfig.ASYNCH_2PHASE) { - queueOrder(orderData.getOrderID(), true); - } - } catch (JMSException je) { - Log.error("TradeBean:sell(" + userID + "," + holdingID + ") --> failed to queueOrder", je); - - cancelOrder(conn, orderData.getOrderID()); - } - - orderData = getOrderData(conn, orderData.getOrderID().intValue()); - - if (!inSession && orderProcessingMode == TradeConfig.ASYNCH_2PHASE) { - - Log.trace("TradeDirect:sell committing global transaction"); - - txn.commit(); - setInGlobalTxn(false); - } else { - commit(conn); - } - } catch (Exception e) { - Log.error("TradeDirect:sell error", e); - if (getInGlobalTxn()) { - txn.rollback(); - } else { - rollBack(conn, e); - } - } finally { - releaseConn(conn); - } - - return orderData; - } - - /** - * @see TradeServices#queueOrder(Integer) - */ - @Override - public void queueOrder(Integer orderID, boolean twoPhase) throws Exception { - - - Log.trace("TradeDirect:queueOrder - inSession(" + this.inSession + ")", orderID); - - - try (JMSContext context = queueConnectionFactory.createContext();){ - TextMessage message = context.createTextMessage(); - - message.setStringProperty("command", "neworder"); - message.setIntProperty("orderID", orderID.intValue()); - message.setBooleanProperty("twoPhase", twoPhase); - message.setBooleanProperty("direct", true); - message.setLongProperty("publishTime", System.currentTimeMillis()); - message.setText("neworder: orderID=" + orderID + " runtimeMode=Direct twoPhase=" + twoPhase); - - context.createProducer().send(tradeBrokerQueue, message); - } catch (Exception e) { - throw e; // pass the exception - } - } - - /** - * @see TradeServices#completeOrder(Integer) - */ - @Override - public OrderDataBean completeOrder(Integer orderID, boolean twoPhase) throws Exception { - OrderDataBean orderData = null; - Connection conn = null; - - try { // twoPhase - - - Log.trace("TradeDirect:completeOrder - inSession(" + this.inSession + ")", orderID); - - setInGlobalTxn(!inSession && twoPhase); - conn = getConn(); - - orderData = completeOrder(conn, orderID); - - commit(conn); - - } catch (Exception e) { - Log.error("TradeDirect:completeOrder -- error completing order", e); - rollBack(conn, e); - cancelOrder(orderID, twoPhase); - } finally { - releaseConn(conn); - } - - return orderData; - - } - - @Override - public Future completeOrderAsync(Integer orderID, boolean twoPhase) throws Exception { - if (!inSession) { - asyncOrderSubmitter.submitOrder(orderID, twoPhase); - } - return null; - } - - - private OrderDataBean completeOrder(Connection conn, Integer orderID) throws Exception { - //conn = getConn(); - OrderDataBean orderData = null; - - Log.trace("TradeDirect:completeOrderInternal - inSession(" + this.inSession + ")", orderID); - - - PreparedStatement stmt = getStatement(conn, getOrderSQL); - stmt.setInt(1, orderID.intValue()); - - ResultSet rs = stmt.executeQuery(); - - if (!rs.next()) { - Log.error("TradeDirect:completeOrder -- unable to find order: " + orderID); - stmt.close(); - return orderData; - } - orderData = getOrderDataFromResultSet(rs); - - String orderType = orderData.getOrderType(); - String orderStatus = orderData.getOrderStatus(); - - // if (order.isCompleted()) - if ((orderStatus.compareToIgnoreCase("completed") == 0) || (orderStatus.compareToIgnoreCase("alertcompleted") == 0) - || (orderStatus.compareToIgnoreCase("cancelled") == 0)) { - throw new Exception("TradeDirect:completeOrder -- attempt to complete Order that is already completed"); - } - - int accountID = rs.getInt("account_accountID"); - String quoteID = rs.getString("quote_symbol"); - int holdingID = rs.getInt("holding_holdingID"); - - BigDecimal price = orderData.getPrice(); - double quantity = orderData.getQuantity(); - - // get the data for the account and quote - // the holding will be created for a buy or extracted for a sell - - /* - * Use the AccountID and Quote Symbol from the Order AccountDataBean - * accountData = getAccountData(accountID, conn); QuoteDataBean - * quoteData = getQuoteData(conn, quoteID); - */ - String userID = getAccountProfileData(conn, new Integer(accountID)).getUserID(); - - HoldingDataBean holdingData = null; - - - Log.trace("TradeDirect:completeOrder--> Completing Order " + orderData.getOrderID() + "\n\t Order info: " + orderData + "\n\t Account info: " - + accountID + "\n\t Quote info: " + quoteID); - - - // if (order.isBuy()) - if (orderType.compareToIgnoreCase("buy") == 0) { - /* - * Complete a Buy operation - create a new Holding for the Account - - * deduct the Order cost from the Account balance - */ - - holdingData = createHolding(conn, accountID, quoteID, quantity, price); - updateOrderHolding(conn, orderID.intValue(), holdingData.getHoldingID().intValue()); - updateOrderStatus(conn, orderData.getOrderID(), "closed"); - updateQuotePriceVolume(orderData.getSymbol(), TradeConfig.getRandomPriceChangeFactor(), orderData.getQuantity()); - } - - // if (order.isSell()) { - if (orderType.compareToIgnoreCase("sell") == 0) { - /* - * Complete a Sell operation - remove the Holding from the Account - - * deposit the Order proceeds to the Account balance - */ - holdingData = getHoldingData(conn, holdingID); - if (holdingData == null) { - Log.debug("TradeDirect:completeOrder:sell -- user: " + userID + " already sold holding: " + holdingID); - updateOrderStatus(conn, orderData.getOrderID(), "cancelled"); - } else { - removeHolding(conn, holdingID, orderID.intValue()); - updateOrderStatus(conn, orderData.getOrderID(), "closed"); - updateQuotePriceVolume(orderData.getSymbol(), TradeConfig.getRandomPriceChangeFactor(), orderData.getQuantity()); - } - - } - - - - Log.trace("TradeDirect:completeOrder--> Completed Order " + orderData.getOrderID() + "\n\t Order info: " + orderData + "\n\t Account info: " - + accountID + "\n\t Quote info: " + quoteID + "\n\t Holding info: " + holdingData); - - stmt.close(); - - commit(conn); - - - - return orderData; - } - - /** - * @see TradeServices#cancelOrder(Integer, boolean) - */ - @Override - public void cancelOrder(Integer orderID, boolean twoPhase) throws Exception { - - Connection conn = null; - try { - - Log.trace("TradeDirect:cancelOrder - inSession(" + this.inSession + ")", orderID); - - setInGlobalTxn(!inSession && twoPhase); - conn = getConn(); - cancelOrder(conn, orderID); - commit(conn); - - } catch (Exception e) { - Log.error("TradeDirect:cancelOrder -- error cancelling order: " + orderID, e); - rollBack(conn, e); - } finally { - releaseConn(conn); - } - } - - private void cancelOrder(Connection conn, Integer orderID) throws Exception { - updateOrderStatus(conn, orderID, "cancelled"); - } - - @Override - public void orderCompleted(String userID, Integer orderID) throws Exception { - throw new UnsupportedOperationException("TradeDirect:orderCompleted method not supported"); - } - - private HoldingDataBean createHolding(Connection conn, int accountID, String symbol, double quantity, BigDecimal purchasePrice) throws Exception { - - Timestamp purchaseDate = new Timestamp(System.currentTimeMillis()); - PreparedStatement stmt = getStatement(conn, createHoldingSQL); - - Integer holdingID = KeySequenceDirect.getNextID(conn, "holding", inSession, getInGlobalTxn()); - stmt.setInt(1, holdingID.intValue()); - stmt.setTimestamp(2, purchaseDate); - stmt.setBigDecimal(3, purchasePrice); - stmt.setDouble(4, quantity); - stmt.setString(5, symbol); - stmt.setInt(6, accountID); - stmt.executeUpdate(); - - stmt.close(); - - return getHoldingData(conn, holdingID.intValue()); - } - - private void removeHolding(Connection conn, int holdingID, int orderID) throws Exception { - PreparedStatement stmt = getStatement(conn, removeHoldingSQL); - - stmt.setInt(1, holdingID); - stmt.executeUpdate(); - stmt.close(); - - // set the HoldingID to NULL for the purchase and sell order now that - // the holding as been removed - stmt = getStatement(conn, removeHoldingFromOrderSQL); - - stmt.setInt(1, holdingID); - stmt.executeUpdate(); - stmt.close(); - - } - - public OrderDataBean createOrder(AccountDataBean accountData, QuoteDataBean quoteData, HoldingDataBean holdingData, String orderType, - double quantity) throws Exception { - OrderDataBean orderData = null; - Connection conn = null; - try { - - conn = getConn(); - Timestamp currentDate = new Timestamp(System.currentTimeMillis()); - - PreparedStatement stmt = getStatement(conn, createOrderSQL); - - Integer orderID = KeySequenceDirect.getNextID(conn, "order", inSession, getInGlobalTxn()); - stmt.setInt(1, orderID.intValue()); - stmt.setString(2, orderType); - stmt.setString(3, "open"); - stmt.setTimestamp(4, currentDate); - stmt.setDouble(5, quantity); - stmt.setBigDecimal(6, quoteData.getPrice().setScale(FinancialUtils.SCALE, FinancialUtils.ROUND)); - stmt.setBigDecimal(7, TradeConfig.getOrderFee(orderType)); - stmt.setInt(8, accountData.getAccountID().intValue()); - if (holdingData == null) { - stmt.setNull(9, java.sql.Types.INTEGER); - } else { - stmt.setInt(9, holdingData.getHoldingID().intValue()); - } - stmt.setString(10, quoteData.getSymbol()); - stmt.executeUpdate(); - - orderData = getOrderData(conn, orderID.intValue()); - - stmt.close(); - - commit(conn); - } catch (Exception e) { - Log.error("TradeDirect:createOrder -- error getting user orders", e); - rollBack(conn, e); - } finally { - releaseConn(conn); - } - - return orderData; - } - - /** - * @see TradeServices#getOrders(String) - */ - @Override - public Collection getOrders(String userID) throws Exception { - Collection orderDataBeans = new ArrayList(); - Connection conn = null; - try { - Log.trace("TradeDirect:getOrders - inSession(" + this.inSession + ")", userID); - - - conn = getConn(); - PreparedStatement stmt = getStatement(conn, getOrdersByUserSQL); - stmt.setString(1, userID); - - ResultSet rs = stmt.executeQuery(); - - // TODO: return top 5 orders for now -- next version will add a - // getAllOrders method - // also need to get orders sorted by order id descending - int i = 0; - while ((rs.next()) && (i++ < 5)) { - OrderDataBean orderData = getOrderDataFromResultSet(rs); - orderDataBeans.add(orderData); - } - - stmt.close(); - commit(conn); - - } catch (Exception e) { - Log.error("TradeDirect:getOrders -- error getting user orders", e); - rollBack(conn, e); - } finally { - releaseConn(conn); - } - return orderDataBeans; - } - - /** - * @see TradeServices#getClosedOrders(String) - */ - @Override - public Collection getClosedOrders(String userID) throws Exception { - Collection orderDataBeans = new ArrayList(); - Connection conn = null; - try { - - Log.trace("TradeDirect:getClosedOrders - inSession(" + this.inSession + ")", userID); - - - conn = getConn(); - PreparedStatement stmt = getStatement(conn, getClosedOrdersSQL); - stmt.setString(1, userID); - - ResultSet rs = stmt.executeQuery(); - - while (rs.next()) { - OrderDataBean orderData = getOrderDataFromResultSet(rs); - orderData.setOrderStatus("completed"); - updateOrderStatus(conn, orderData.getOrderID(), orderData.getOrderStatus()); - orderDataBeans.add(orderData); - - } - - stmt.close(); - commit(conn); - } catch (Exception e) { - Log.error("TradeDirect:getOrders -- error getting user orders", e); - rollBack(conn, e); - } finally { - releaseConn(conn); - } - return orderDataBeans; - } - - /** - * @see TradeServices#createQuote(String, String, BigDecimal) - */ - @Override - public QuoteDataBean createQuote(String symbol, String companyName, BigDecimal price) throws Exception { - - QuoteDataBean quoteData = null; - Connection conn = null; - try { - - Log.trace("TradeDirect:createQuote - inSession(" + this.inSession + ")"); - - - price = price.setScale(FinancialUtils.SCALE, FinancialUtils.ROUND); - double volume = 0.0, change = 0.0; - - conn = getConn(); - PreparedStatement stmt = getStatement(conn, createQuoteSQL); - stmt.setString(1, symbol); // symbol - stmt.setString(2, companyName); // companyName - stmt.setDouble(3, volume); // volume - stmt.setBigDecimal(4, price); // price - stmt.setBigDecimal(5, price); // open - stmt.setBigDecimal(6, price); // low - stmt.setBigDecimal(7, price); // high - stmt.setDouble(8, change); // change - - stmt.executeUpdate(); - stmt.close(); - commit(conn); - - quoteData = new QuoteDataBean(symbol, companyName, volume, price, price, price, price, change); - } catch (Exception e) { - Log.error("TradeDirect:createQuote -- error creating quote", e); - } finally { - releaseConn(conn); - } - return quoteData; - } - - /** - * @see TradeServices#getQuote(String) - */ - - @Override - public QuoteDataBean getQuote(String symbol) throws Exception { - QuoteDataBean quoteData = null; - Connection conn = null; - - try { - - Log.trace("TradeDirect:getQuote - inSession(" + this.inSession + ")", symbol); - - - conn = getConn(); - quoteData = getQuote(conn, symbol); - commit(conn); - } catch (Exception e) { - Log.error("TradeDirect:getQuote -- error getting quote", e); - rollBack(conn, e); - } finally { - releaseConn(conn); - } - return quoteData; - } - - private QuoteDataBean getQuote(Connection conn, String symbol) throws Exception { - QuoteDataBean quoteData = null; - PreparedStatement stmt = getStatement(conn, getQuoteSQL); - stmt.setString(1, symbol); // symbol - - ResultSet rs = stmt.executeQuery(); - - if (!rs.next()) { - Log.error("TradeDirect:getQuote -- failure no result.next() for symbol: " + symbol); - } else { - quoteData = getQuoteDataFromResultSet(rs); - } - - stmt.close(); - - return quoteData; - } - - private QuoteDataBean getQuoteForUpdate(Connection conn, String symbol) throws Exception { - QuoteDataBean quoteData = null; - PreparedStatement stmt = getStatement(conn, getQuoteForUpdateSQL); - stmt.setString(1, symbol); // symbol - - ResultSet rs = stmt.executeQuery(); - - if (!rs.next()) { - Log.error("TradeDirect:getQuote -- failure no result.next()"); - } else { - quoteData = getQuoteDataFromResultSet(rs); - } - - stmt.close(); - - return quoteData; - } - - /** - * @see TradeServices#getAllQuotes(String) - */ - @Override - public Collection getAllQuotes() throws Exception { - Collection quotes = new ArrayList(); - QuoteDataBean quoteData = null; - - Connection conn = null; - try { - conn = getConn(); - - PreparedStatement stmt = getStatement(conn, getAllQuotesSQL); - - ResultSet rs = stmt.executeQuery(); - - while (!rs.next()) { - quoteData = getQuoteDataFromResultSet(rs); - quotes.add(quoteData); - } - - stmt.close(); - } catch (Exception e) { - Log.error("TradeDirect:getAllQuotes", e); - rollBack(conn, e); - } finally { - releaseConn(conn); - } - - return quotes; - } - - /** - * @see TradeServices#getHoldings(String) - */ - @Override - public Collection getHoldings(String userID) throws Exception { - Collection holdingDataBeans = new ArrayList(); - Connection conn = null; - try { - - Log.trace("TradeDirect:getHoldings - inSession(" + this.inSession + ")", userID); - - - conn = getConn(); - PreparedStatement stmt = getStatement(conn, getHoldingsForUserSQL); - stmt.setString(1, userID); - - ResultSet rs = stmt.executeQuery(); - - while (rs.next()) { - HoldingDataBean holdingData = getHoldingDataFromResultSet(rs); - holdingDataBeans.add(holdingData); - } - - stmt.close(); - commit(conn); - - } catch (Exception e) { - Log.error("TradeDirect:getHoldings -- error getting user holings", e); - rollBack(conn, e); - } finally { - releaseConn(conn); - } - return holdingDataBeans; - } - - /** - * @see TradeServices#getHolding(Integer) - */ - @Override - public HoldingDataBean getHolding(Integer holdingID) throws Exception { - HoldingDataBean holdingData = null; - Connection conn = null; - try { - - Log.trace("TradeDirect:getHolding - inSession(" + this.inSession + ")", holdingID); - - - conn = getConn(); - holdingData = getHoldingData(holdingID.intValue()); - - commit(conn); - - } catch (Exception e) { - Log.error("TradeDirect:getHolding -- error getting holding " + holdingID + "", e); - rollBack(conn, e); - } finally { - releaseConn(conn); - } - return holdingData; - } - - /** - * @see TradeServices#getAccountData(String) - */ - @Override - public AccountDataBean getAccountData(String userID) throws Exception { - try { - AccountDataBean accountData = null; - Connection conn = null; - try { - - Log.trace("TradeDirect:getAccountData - inSession(" + this.inSession + ")", userID); - - - conn = getConn(); - accountData = getAccountData(conn, userID); - commit(conn); - - } catch (Exception e) { - Log.error("TradeDirect:getAccountData -- error getting account data", e); - rollBack(conn, e); - } finally { - releaseConn(conn); - } - return accountData; - } catch (Exception e) { - throw new Exception(e.getMessage(), e); - } - } - - private AccountDataBean getAccountData(Connection conn, String userID) throws Exception { - PreparedStatement stmt = getStatement(conn, getAccountForUserSQL); - stmt.setString(1, userID); - ResultSet rs = stmt.executeQuery(); - AccountDataBean accountData = getAccountDataFromResultSet(rs); - stmt.close(); - return accountData; - } - - /** - * @see TradeServices#getAccountData(String) - */ - public AccountDataBean getAccountData(int accountID) throws Exception { - AccountDataBean accountData = null; - Connection conn = null; - try { - - Log.trace("TradeDirect:getAccountData - inSession(" + this.inSession + ")", new Integer(accountID)); - - conn = getConn(); - accountData = getAccountData(accountID, conn); - commit(conn); - - } catch (Exception e) { - Log.error("TradeDirect:getAccountData -- error getting account data", e); - rollBack(conn, e); - } finally { - releaseConn(conn); - } - return accountData; - } - - private AccountDataBean getAccountData(int accountID, Connection conn) throws Exception { - PreparedStatement stmt = getStatement(conn, getAccountSQL); - stmt.setInt(1, accountID); - ResultSet rs = stmt.executeQuery(); - AccountDataBean accountData = getAccountDataFromResultSet(rs); - stmt.close(); - return accountData; - } - - private QuoteDataBean getQuoteData(Connection conn, String symbol) throws Exception { - QuoteDataBean quoteData = null; - PreparedStatement stmt = getStatement(conn, getQuoteSQL); - stmt.setString(1, symbol); - ResultSet rs = stmt.executeQuery(); - if (!rs.next()) { - Log.error("TradeDirect:getQuoteData -- could not find quote for symbol=" + symbol); - } else { - quoteData = getQuoteDataFromResultSet(rs); - } - stmt.close(); - return quoteData; - } - - private HoldingDataBean getHoldingData(int holdingID) throws Exception { - HoldingDataBean holdingData = null; - Connection conn = null; - try { - conn = getConn(); - holdingData = getHoldingData(conn, holdingID); - commit(conn); - } catch (Exception e) { - Log.error("TradeDirect:getHoldingData -- error getting data", e); - rollBack(conn, e); - } finally { - releaseConn(conn); - } - return holdingData; - } - - private HoldingDataBean getHoldingData(Connection conn, int holdingID) throws Exception { - HoldingDataBean holdingData = null; - PreparedStatement stmt = getStatement(conn, getHoldingSQL); - stmt.setInt(1, holdingID); - ResultSet rs = stmt.executeQuery(); - if (!rs.next()) { - // already sold - Log.debug("TradeDirect:getHoldingData -- no results -- holdingID=" + holdingID); - } else { - holdingData = getHoldingDataFromResultSet(rs); - } - - stmt.close(); - return holdingData; - } - - private OrderDataBean getOrderData(Connection conn, int orderID) throws Exception { - OrderDataBean orderData = null; - - Log.trace("TradeDirect:getOrderData(conn, " + orderID + ")"); - - PreparedStatement stmt = getStatement(conn, getOrderSQL); - stmt.setInt(1, orderID); - ResultSet rs = stmt.executeQuery(); - if (!rs.next()) { - // already sold - Log.error("TradeDirect:getOrderData -- no results for orderID:" + orderID); - } else { - orderData = getOrderDataFromResultSet(rs); - } - stmt.close(); - return orderData; - } - - /** - * @see TradeServices#getAccountProfileData(String) - */ - @Override - public AccountProfileDataBean getAccountProfileData(String userID) throws Exception { - AccountProfileDataBean accountProfileData = null; - Connection conn = null; - - try { - - Log.trace("TradeDirect:getAccountProfileData - inSession(" + this.inSession + ")", userID); - - - conn = getConn(); - accountProfileData = getAccountProfileData(conn, userID); - commit(conn); - } catch (Exception e) { - Log.error("TradeDirect:getAccountProfileData -- error getting profile data", e); - rollBack(conn, e); - } finally { - releaseConn(conn); - } - return accountProfileData; - } - - private AccountProfileDataBean getAccountProfileData(Connection conn, String userID) throws Exception { - PreparedStatement stmt = getStatement(conn, getAccountProfileSQL); - stmt.setString(1, userID); - - ResultSet rs = stmt.executeQuery(); - - AccountProfileDataBean accountProfileData = getAccountProfileDataFromResultSet(rs); - stmt.close(); - return accountProfileData; - } - - private AccountProfileDataBean getAccountProfileData(Connection conn, Integer accountID) throws Exception { - PreparedStatement stmt = getStatement(conn, getAccountProfileForAccountSQL); - stmt.setInt(1, accountID.intValue()); - - ResultSet rs = stmt.executeQuery(); - - AccountProfileDataBean accountProfileData = getAccountProfileDataFromResultSet(rs); - stmt.close(); - return accountProfileData; - } - - /** - * @see TradeServices#updateAccountProfile(AccountProfileDataBean) - */ - @Override - public AccountProfileDataBean updateAccountProfile(AccountProfileDataBean profileData) throws Exception { - AccountProfileDataBean accountProfileData = null; - Connection conn = null; - - try { - - Log.trace("TradeDirect:updateAccountProfileData - inSession(" + this.inSession + ")", profileData.getUserID()); - - conn = getConn(); - updateAccountProfile(conn, profileData); - - accountProfileData = getAccountProfileData(conn, profileData.getUserID()); - commit(conn); - } catch (Exception e) { - Log.error("TradeDirect:getAccountProfileData -- error getting profile data", e); - rollBack(conn, e); - } finally { - releaseConn(conn); - } - return accountProfileData; - } - - private void creditAccountBalance(Connection conn, AccountDataBean accountData, BigDecimal credit) throws Exception { - PreparedStatement stmt = getStatement(conn, creditAccountBalanceSQL); - - stmt.setBigDecimal(1, credit); - stmt.setInt(2, accountData.getAccountID().intValue()); - - stmt.executeUpdate(); - stmt.close(); - - } - - // Set Timestamp to zero to denote sell is inflight - // UPDATE -- could add a "status" attribute to holding - private void updateHoldingStatus(Connection conn, Integer holdingID, String symbol) throws Exception { - Timestamp ts = new Timestamp(0); - PreparedStatement stmt = getStatement(conn, "update holdingejb set purchasedate= ? where holdingid = ?"); - - stmt.setTimestamp(1, ts); - stmt.setInt(2, holdingID.intValue()); - stmt.executeUpdate(); - stmt.close(); - } - - private void updateOrderStatus(Connection conn, Integer orderID, String status) throws Exception { - PreparedStatement stmt = getStatement(conn, updateOrderStatusSQL); - - stmt.setString(1, status); - stmt.setTimestamp(2, new Timestamp(System.currentTimeMillis())); - stmt.setInt(3, orderID.intValue()); - stmt.executeUpdate(); - stmt.close(); - } - - private void updateOrderHolding(Connection conn, int orderID, int holdingID) throws Exception { - PreparedStatement stmt = getStatement(conn, updateOrderHoldingSQL); - - stmt.setInt(1, holdingID); - stmt.setInt(2, orderID); - stmt.executeUpdate(); - stmt.close(); - } - - private void updateAccountProfile(Connection conn, AccountProfileDataBean profileData) throws Exception { - PreparedStatement stmt = getStatement(conn, updateAccountProfileSQL); - - stmt.setString(1, profileData.getPassword()); - stmt.setString(2, profileData.getFullName()); - stmt.setString(3, profileData.getAddress()); - stmt.setString(4, profileData.getEmail()); - stmt.setString(5, profileData.getCreditCard()); - stmt.setString(6, profileData.getUserID()); - - stmt.executeUpdate(); - stmt.close(); - } - - @Override - public QuoteDataBean updateQuotePriceVolume(String symbol, BigDecimal changeFactor, double sharesTraded) throws Exception { - return updateQuotePriceVolumeInt(symbol, changeFactor, sharesTraded, TradeConfig.getPublishQuotePriceChange()); - } - - /** - * Update a quote's price and volume - * - * @param symbol - * The PK of the quote - * @param changeFactor - * the percent to change the old price by (between 50% and 150%) - * @param sharedTraded - * the ammount to add to the current volume - * @param publishQuotePriceChange - * used by the PingJDBCWrite Primitive to ensure no JMS is used, - * should be true for all normal calls to this API - */ - public QuoteDataBean updateQuotePriceVolumeInt(String symbol, BigDecimal changeFactor, double sharesTraded, boolean publishQuotePriceChange) - throws Exception { - - if (TradeConfig.getUpdateQuotePrices() == false) { - return new QuoteDataBean(); - } - - QuoteDataBean quoteData = null; - Connection conn = null; - - try { - Log.trace("TradeDirect:updateQuotePriceVolume - inSession(" + this.inSession + ")", symbol, changeFactor, new Double(sharesTraded)); - - conn = getConn(); - - quoteData = getQuoteForUpdate(conn, symbol); - BigDecimal oldPrice = quoteData.getPrice(); - BigDecimal openPrice = quoteData.getOpen(); - - double newVolume = quoteData.getVolume() + sharesTraded; - - if (oldPrice.equals(TradeConfig.PENNY_STOCK_PRICE)) { - changeFactor = TradeConfig.PENNY_STOCK_RECOVERY_MIRACLE_MULTIPLIER; - } else if (oldPrice.compareTo(TradeConfig.MAXIMUM_STOCK_PRICE) > 0) { - changeFactor = TradeConfig.MAXIMUM_STOCK_SPLIT_MULTIPLIER; - } - - BigDecimal newPrice = changeFactor.multiply(oldPrice).setScale(2, BigDecimal.ROUND_HALF_UP); - double change = newPrice.subtract(openPrice).doubleValue(); - - updateQuotePriceVolume(conn, quoteData.getSymbol(), newPrice, newVolume, change); - quoteData = getQuote(conn, symbol); - - commit(conn); - - if (publishQuotePriceChange) { - publishQuotePriceChange(quoteData, oldPrice, changeFactor, sharesTraded); - } - - recentQuotePriceChangeList.add(quoteData); - - } catch (Exception e) { - Log.error("TradeDirect:updateQuotePriceVolume -- error updating quote price/volume for symbol:" + symbol); - rollBack(conn, e); - throw e; - } finally { - releaseConn(conn); - } - return quoteData; - } - - private void updateQuotePriceVolume(Connection conn, String symbol, BigDecimal newPrice, double newVolume, double change) throws Exception { - - PreparedStatement stmt = getStatement(conn, updateQuotePriceVolumeSQL); - - stmt.setBigDecimal(1, newPrice); - stmt.setDouble(2, change); - stmt.setDouble(3, newVolume); - stmt.setString(4, symbol); - - stmt.executeUpdate(); - stmt.close(); - } - - private void publishQuotePriceChange(QuoteDataBean quoteData, BigDecimal oldPrice, BigDecimal changeFactor, double sharesTraded) throws Exception { - - Log.trace("TradeDirect:publishQuotePrice PUBLISHING to MDB quoteData = " + quoteData); - - try (JMSContext context = topicConnectionFactory.createContext();){ - TextMessage message = context.createTextMessage(); - - message.setStringProperty("command", "updateQuote"); - message.setStringProperty("symbol", quoteData.getSymbol()); - message.setStringProperty("company", quoteData.getCompanyName()); - message.setStringProperty("price", quoteData.getPrice().toString()); - message.setStringProperty("oldPrice", oldPrice.toString()); - message.setStringProperty("open", quoteData.getOpen().toString()); - message.setStringProperty("low", quoteData.getLow().toString()); - message.setStringProperty("high", quoteData.getHigh().toString()); - message.setDoubleProperty("volume", quoteData.getVolume()); - - message.setStringProperty("changeFactor", changeFactor.toString()); - message.setDoubleProperty("sharesTraded", sharesTraded); - message.setLongProperty("publishTime", System.currentTimeMillis()); - message.setText("Update Stock price for " + quoteData.getSymbol() + " old price = " + oldPrice + " new price = " + quoteData.getPrice()); - - - context.createProducer().send(tradeStreamerTopic, message); - - } catch (Exception e) { - throw e; // pass exception back - - } - } - - /** - * @see TradeServices#login(String, String) - */ - - @Override - public AccountDataBean login(String userID, String password) throws Exception { - - AccountDataBean accountData = null; - Connection conn = null; - try { - Log.trace("TradeDirect:login - inSession(" + this.inSession + ")", userID, password); - - conn = getConn(); - PreparedStatement stmt = getStatement(conn, getAccountProfileSQL); - stmt.setString(1, userID); - - ResultSet rs = stmt.executeQuery(); - if (!rs.next()) { - Log.error("TradeDirect:login -- failure to find account for" + userID); - throw new javax.ejb.FinderException("Cannot find account for" + userID); - } - - String pw = rs.getString("passwd"); - stmt.close(); - if ((pw == null) || (pw.equals(password) == false)) { - String error = "TradeDirect:Login failure for user: " + userID + "\n\tIncorrect password-->" + userID + ":" + password; - Log.error(error); - throw new Exception(error); - } - - stmt = getStatement(conn, loginSQL); - stmt.setTimestamp(1, new Timestamp(System.currentTimeMillis())); - stmt.setString(2, userID); - - stmt.executeUpdate(); - stmt.close(); - - stmt = getStatement(conn, getAccountForUserSQL); - stmt.setString(1, userID); - rs = stmt.executeQuery(); - - accountData = getAccountDataFromResultSet(rs); - - stmt.close(); - - commit(conn); - } catch (Exception e) { - Log.error("TradeDirect:login -- error logging in user", e); - rollBack(conn, e); - } finally { - releaseConn(conn); - } - return accountData; - - /* - * setLastLogin( new Timestamp(System.currentTimeMillis()) ); - * setLoginCount( getLoginCount() + 1 ); - */ - } - - /** - * @see TradeServices#logout(String) - */ - @Override - public void logout(String userID) throws Exception { - Log.trace("TradeDirect:logout - inSession(" + this.inSession + ")", userID); - - Connection conn = null; - try { - conn = getConn(); - PreparedStatement stmt = getStatement(conn, logoutSQL); - stmt.setString(1, userID); - stmt.executeUpdate(); - stmt.close(); - - commit(conn); - } catch (Exception e) { - Log.error("TradeDirect:logout -- error logging out user", e); - rollBack(conn, e); - } finally { - releaseConn(conn); - } - } - - /** - * @see TradeServices#register(String, String, String, String, String, - * String, BigDecimal, boolean) - */ - - @Override - public AccountDataBean register(String userID, String password, String fullname, String address, String email, String creditcard, BigDecimal openBalance) - throws Exception { - - AccountDataBean accountData = null; - Connection conn = null; - try { - Log.trace("TradeDirect:register - inSession(" + this.inSession + ")"); - - conn = getConn(); - PreparedStatement stmt = getStatement(conn, createAccountSQL); - - Integer accountID = KeySequenceDirect.getNextID(conn, "account", inSession, getInGlobalTxn()); - BigDecimal balance = openBalance; - Timestamp creationDate = new Timestamp(System.currentTimeMillis()); - Timestamp lastLogin = creationDate; - int loginCount = 0; - int logoutCount = 0; - - stmt.setInt(1, accountID.intValue()); - stmt.setTimestamp(2, creationDate); - stmt.setBigDecimal(3, openBalance); - stmt.setBigDecimal(4, balance); - stmt.setTimestamp(5, lastLogin); - stmt.setInt(6, loginCount); - stmt.setInt(7, logoutCount); - stmt.setString(8, userID); - stmt.executeUpdate(); - stmt.close(); - - stmt = getStatement(conn, createAccountProfileSQL); - stmt.setString(1, userID); - stmt.setString(2, password); - stmt.setString(3, fullname); - stmt.setString(4, address); - stmt.setString(5, email); - stmt.setString(6, creditcard); - stmt.executeUpdate(); - stmt.close(); - - commit(conn); - - accountData = new AccountDataBean(accountID, loginCount, logoutCount, lastLogin, creationDate, balance, openBalance, userID); - - } catch (Exception e) { - Log.error("TradeDirect:register -- error registering new user", e); - } finally { - releaseConn(conn); - } - return accountData; - } - - private AccountDataBean getAccountDataFromResultSet(ResultSet rs) throws Exception { - AccountDataBean accountData = null; - - if (!rs.next()) { - Log.error("TradeDirect:getAccountDataFromResultSet -- cannot find account data"); - } else { - accountData = new AccountDataBean(new Integer(rs.getInt("accountID")), rs.getInt("loginCount"), rs.getInt("logoutCount"), - rs.getTimestamp("lastLogin"), rs.getTimestamp("creationDate"), rs.getBigDecimal("balance"), rs.getBigDecimal("openBalance"), - rs.getString("profile_userID")); - } - return accountData; - } - - private AccountProfileDataBean getAccountProfileDataFromResultSet(ResultSet rs) throws Exception { - AccountProfileDataBean accountProfileData = null; - - if (!rs.next()) { - Log.error("TradeDirect:getAccountProfileDataFromResultSet -- cannot find accountprofile data"); - } else { - accountProfileData = new AccountProfileDataBean(rs.getString("userID"), rs.getString("passwd"), rs.getString("fullName"), rs.getString("address"), - rs.getString("email"), rs.getString("creditCard")); - } - - return accountProfileData; - } - - private HoldingDataBean getHoldingDataFromResultSet(ResultSet rs) throws Exception { - HoldingDataBean holdingData = null; - - holdingData = new HoldingDataBean(new Integer(rs.getInt("holdingID")), rs.getDouble("quantity"), rs.getBigDecimal("purchasePrice"), - rs.getTimestamp("purchaseDate"), rs.getString("quote_symbol")); - return holdingData; - } - - private QuoteDataBean getQuoteDataFromResultSet(ResultSet rs) throws Exception { - QuoteDataBean quoteData = null; - - quoteData = new QuoteDataBean(rs.getString("symbol"), rs.getString("companyName"), rs.getDouble("volume"), rs.getBigDecimal("price"), - rs.getBigDecimal("open1"), rs.getBigDecimal("low"), rs.getBigDecimal("high"), rs.getDouble("change1")); - return quoteData; - } - - private OrderDataBean getOrderDataFromResultSet(ResultSet rs) throws Exception { - OrderDataBean orderData = null; - - orderData = new OrderDataBean(new Integer(rs.getInt("orderID")), rs.getString("orderType"), rs.getString("orderStatus"), rs.getTimestamp("openDate"), - rs.getTimestamp("completionDate"), rs.getDouble("quantity"), rs.getBigDecimal("price"), rs.getBigDecimal("orderFee"), - rs.getString("quote_symbol")); - return orderData; - } - - public boolean recreateDBTables(Object[] sqlBuffer, java.io.PrintWriter out) throws Exception { - // Clear MDB Statistics - MDBStats.getInstance().reset(); - - Connection conn = null; - boolean success = false; - try { - - Log.trace("TradeDirect:recreateDBTables"); - - conn = getConn(); - Statement stmt = conn.createStatement(); - int bufferLength = sqlBuffer.length; - for (int i = 0; i < bufferLength; i++) { - try { - stmt.executeUpdate((String) sqlBuffer[i]); - // commit(conn); - } catch (SQLException ex) { - // Ignore DROP statements as tables won't always exist. - if (((String) sqlBuffer[i]).indexOf("DROP ") < 0) { - Log.error("TradeDirect:recreateDBTables SQL Exception thrown on executing the foll sql command: " + sqlBuffer[i], ex); - out.println("
    SQL Exception thrown on executing the foll sql command: " + sqlBuffer[i] + " . Check log for details.
    "); - } - } - } - stmt.close(); - commit(conn); - success = true; - } catch (Exception e) { - Log.error(e, "TradeDirect:recreateDBTables() -- Error dropping and recreating the database tables"); - } finally { - releaseConn(conn); - } - return success; - } - - ; - - - - private void releaseConn(Connection conn) throws Exception { - try { - if (conn != null) { - conn.close(); - if (Log.doTrace()) { - synchronized (lock) { - connCount--; - } - Log.trace("TradeDirect:releaseConn -- connection closed, connCount=" + connCount); - } - } - } catch (Exception e) { - Log.error("TradeDirect:releaseConnection -- failed to close connection", e); - } - } - - - /* - * Allocate a new connection to the datasource - */ - private static int connCount = 0; - - private static Integer lock = new Integer(0); - - private Connection getConn() throws Exception { - - Connection conn = datasource.getConnection(); - - if (!this.inGlobalTxn) { - conn.setAutoCommit(false); - } - if (Log.doTrace()) { - synchronized (lock) { - connCount++; - } - Log.trace("TradeDirect:getConn -- new connection allocated, IsolationLevel=" + conn.getTransactionIsolation() + " connectionCount = " + connCount); - } - - return conn; - } - - public Connection getConnPublic() throws Exception { - return getConn(); - } - - /* - * Commit the provided connection if not under Global Transaction scope - - * conn.commit() is not allowed in a global transaction. the txn manager - * will perform the commit - */ - private void commit(Connection conn) throws Exception { - if (!inSession) { - if ((getInGlobalTxn() == false) && (conn != null)) { - conn.commit(); - } - } - } - - /* - * Rollback the statement for the given connection - */ - private void rollBack(Connection conn, Exception e) throws Exception { - if (!inSession) { - Log.log("TradeDirect:rollBack -- rolling back conn due to previously caught exception -- inGlobalTxn=" + getInGlobalTxn()); - if ((getInGlobalTxn() == false) && (conn != null)) { - conn.rollback(); - } else { - throw e; // Throw the exception - // so the Global txn manager will rollBack - } - } - } - - /* - * Allocate a new prepared statment for this connection - */ - private PreparedStatement getStatement(Connection conn, String sql) throws Exception { - return conn.prepareStatement(sql); - } - - private PreparedStatement getStatement(Connection conn, String sql, int type, int concurrency) throws Exception { - return conn.prepareStatement(sql, type, concurrency); - } - - private static final String createQuoteSQL = "insert into quoteejb " + "( symbol, companyName, volume, price, open1, low, high, change1 ) " - + "VALUES ( ? , ? , ? , ? , ? , ? , ? , ? )"; - - private static final String createAccountSQL = "insert into accountejb " - + "( accountid, creationDate, openBalance, balance, lastLogin, loginCount, logoutCount, profile_userid) " - + "VALUES ( ? , ? , ? , ? , ? , ? , ? , ? )"; - - private static final String createAccountProfileSQL = "insert into accountprofileejb " + "( userid, passwd, fullname, address, email, creditcard ) " - + "VALUES ( ? , ? , ? , ? , ? , ? )"; - - private static final String createHoldingSQL = "insert into holdingejb " - + "( holdingid, purchaseDate, purchasePrice, quantity, quote_symbol, account_accountid ) " + "VALUES ( ? , ? , ? , ? , ? , ? )"; - - private static final String createOrderSQL = "insert into orderejb " - + "( orderid, ordertype, orderstatus, opendate, quantity, price, orderfee, account_accountid, holding_holdingid, quote_symbol) " - + "VALUES ( ? , ? , ? , ? , ? , ? , ? , ? , ? , ?)"; - - private static final String removeHoldingSQL = "delete from holdingejb where holdingid = ?"; - - private static final String removeHoldingFromOrderSQL = "update orderejb set holding_holdingid=null where holding_holdingid = ?"; - - private static final String updateAccountProfileSQL = "update accountprofileejb set " + "passwd = ?, fullname = ?, address = ?, email = ?, creditcard = ? " - + "where userid = (select profile_userid from accountejb a " + "where a.profile_userid=?)"; - - private static final String loginSQL = "update accountejb set lastLogin=?, logincount=logincount+1 " + "where profile_userid=?"; - - private static final String logoutSQL = "update accountejb set logoutcount=logoutcount+1 " + "where profile_userid=?"; - - private static final String getAccountSQL = "select * from accountejb a where a.accountid = ?"; - - private static final String getAccountProfileSQL = "select * from accountprofileejb ap where ap.userid = " - + "(select profile_userid from accountejb a where a.profile_userid=?)"; - - private static final String getAccountProfileForAccountSQL = "select * from accountprofileejb ap where ap.userid = " - + "(select profile_userid from accountejb a where a.accountid=?)"; - - private static final String getAccountForUserSQL = "select * from accountejb a where a.profile_userid = " - + "( select userid from accountprofileejb ap where ap.userid = ?)"; - - private static final String getHoldingSQL = "select * from holdingejb h where h.holdingid = ?"; - - private static final String getHoldingsForUserSQL = "select * from holdingejb h where h.account_accountid = " - + "(select a.accountid from accountejb a where a.profile_userid = ?)"; - - private static final String getOrderSQL = "select * from orderejb o where o.orderid = ?"; - - private static final String getOrdersByUserSQL = "select * from orderejb o where o.account_accountid = " - + "(select a.accountid from accountejb a where a.profile_userid = ?)"; - - private static final String getClosedOrdersSQL = "select * from orderejb o " + "where o.orderstatus = 'closed' AND o.account_accountid = " - + "(select a.accountid from accountejb a where a.profile_userid = ?)"; - - private static final String getQuoteSQL = "select * from quoteejb q where q.symbol=?"; - - private static final String getAllQuotesSQL = "select * from quoteejb q"; - - private static final String getQuoteForUpdateSQL = "select * from quoteejb q where q.symbol=? For Update"; - - private static final String getTSIAQuotesOrderByChangeSQL = "select * from quoteejb q order by q.change1"; - - private static final String getTSIASQL = "select SUM(price)/count(*) as TSIA from quoteejb q "; - - private static final String getOpenTSIASQL = "select SUM(open1)/count(*) as openTSIA from quoteejb q "; - - private static final String getTSIATotalVolumeSQL = "select SUM(volume) as totalVolume from quoteejb q "; - - private static final String creditAccountBalanceSQL = "update accountejb set " + "balance = balance + ? " + "where accountid = ?"; - - private static final String updateOrderStatusSQL = "update orderejb set " + "orderstatus = ?, completiondate = ? " + "where orderid = ?"; - - private static final String updateOrderHoldingSQL = "update orderejb set " + "holding_holdingID = ? " + "where orderid = ?"; - - private static final String updateQuotePriceVolumeSQL = "update quoteejb set " + "price = ?, change1 = ?, volume = ? " + "where symbol = ?"; - - /** - * Gets the inGlobalTxn - * - * @return Returns a boolean - */ - private boolean getInGlobalTxn() { - return inGlobalTxn; - } - - /** - * Sets the inGlobalTxn - * - * @param inGlobalTxn - * The inGlobalTxn to set - */ - private void setInGlobalTxn(boolean inGlobalTxn) { - this.inGlobalTxn = inGlobalTxn; - } - - public void setInSession(boolean inSession) { - this.inSession = inSession; - } - - @Override - public int getImpl() { - return TradeConfig.DIRECT; - } - - - - @Override - public QuoteDataBean pingTwoPhase(String symbol) { - throw new UnsupportedOperationException(); - } - - - - @Override - public double investmentReturn(double rnd1, double rnd2) { - throw new UnsupportedOperationException(); - } -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/impl/direct/TradeDirectDBUtils.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/impl/direct/TradeDirectDBUtils.java deleted file mode 100644 index 8511c6b7..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/impl/direct/TradeDirectDBUtils.java +++ /dev/null @@ -1,470 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2019. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.impl.direct; - -import com.ibm.websphere.samples.daytrader.beans.RunStatsDataBean; -import com.ibm.websphere.samples.daytrader.entities.AccountDataBean; -import com.ibm.websphere.samples.daytrader.interfaces.TradeDB; -import com.ibm.websphere.samples.daytrader.interfaces.TradeJDBC; -import com.ibm.websphere.samples.daytrader.interfaces.TradeServices; -import com.ibm.websphere.samples.daytrader.util.Log; -import com.ibm.websphere.samples.daytrader.util.MDBStats; -import com.ibm.websphere.samples.daytrader.util.TradeConfig; -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.math.BigDecimal; -import java.sql.Connection; -import java.sql.DatabaseMetaData; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Statement; -import java.util.ArrayList; -import javax.annotation.Resource; -import javax.enterprise.context.ApplicationScoped; -import javax.inject.Inject; -import javax.sql.DataSource; - -/** - * TradeBuildDB uses operations provided by the TradeApplication to (a) create the Database tables - * (b)populate a DayTrader database without creating the tables. Specifically, a - * new DayTrader User population is created using UserIDs of the form "uid:xxx" - * where xxx is a sequential number (e.g. uid:0, uid:1, etc.). New stocks are also created of the - * form "s:xxx", again where xxx represents sequential numbers (e.g. s:1, s:2, etc.) - */ -@ApplicationScoped -public class TradeDirectDBUtils implements TradeDB { - - // For Wildfly - add java:/ to this resource. - - @Resource(lookup = "jdbc/TradeDataSource") - //@Resource(lookup = "java:/jdbc/TradeDataSource") - private DataSource datasource; - - @Inject - @TradeJDBC - TradeServices ts; - - public String checkDBProductName() throws Exception { - Connection conn = null; - String dbProductName = null; - - try { - - conn = datasource.getConnection(); - DatabaseMetaData dbmd = conn.getMetaData(); - dbProductName = dbmd.getDatabaseProductName(); - } catch (SQLException e) { - Log.error(e, "TradeDirect:checkDBProductName() -- Error checking the Daytrader Database Product Name"); - } finally { - conn.close(); - } - return dbProductName; - } - - - /** - * Re-create the DayTrader db tables and populate them OR just populate a DayTrader DB, logging to the provided output stream - */ - public void buildDB(java.io.PrintWriter out, InputStream ddlFile) throws Exception { - String symbol, companyName; - int errorCount = 0; // Give up gracefully after 10 errors - - // TradeStatistics.statisticsEnabled=false; // disable statistics - out.println("
    TradeBuildDB: Building DayTrader Database...
    This operation will take several minutes. Please wait..."); - out.println(""); - - if (ddlFile != null) { - //out.println("
    TradeBuildDB: **** warPath= "+warPath+" ****
    "); - - boolean success = false; - - Object[] sqlBuffer = null; - - //parse the DDL file and fill the SQL commands into a buffer - try { - sqlBuffer = parseDDLToBuffer(ddlFile); - } catch (Exception e) { - Log.error(e, "TradeBuildDB: Unable to parse DDL file"); - out.println("
    TradeBuildDB: **** Unable to parse DDL file for the specified database ****
    "); - return; - } - if ((sqlBuffer == null) || (sqlBuffer.length == 0)) { - out.println("
    TradeBuildDB: **** Parsing DDL file returned empty buffer, please check that a valid DB specific DDL file is available and retry ****
    "); - return; - } - - // send the sql commands buffer to drop and recreate the Daytrader tables - out.println("
    TradeBuildDB: **** Dropping and Recreating the DayTrader tables... ****
    "); - try { - success = recreateDBTables(sqlBuffer, out); - } catch (Exception e) { - Log.error(e, "TradeBuildDB: Unable to drop and recreate DayTrader Db Tables, please check for database consistency before continuing"); - out.println("TradeBuildDB: Unable to drop and recreate DayTrader Db Tables, please check for database consistency before continuing"); - return; - } - if (!success) { - out.println("
    TradeBuildDB: **** Unable to drop and recreate DayTrader Db Tables, please check for database consistency before continuing ****
    "); - return; - } - out.println("
    TradeBuildDB: **** DayTrader tables successfully created! ****

    Please Stop and Re-start your Daytrader application (or your application server) and then use the \"Repopulate Daytrader Database\" link to populate your database.


    "); - return; - } // end of createDBTables - - out.println("
    TradeBuildDB: **** Creating " + TradeConfig.getMAX_QUOTES() + " Quotes ****
    "); - //Attempt to delete all of the Trade users and Trade Quotes first - try { - resetTrade(true); - } catch (Exception e) { - Log.error(e, "TradeBuildDB: Unable to delete Trade users (uid:0, uid:1, ...) and Trade Quotes (s:0, s:1, ...)"); - } - for (int i = 0; i < TradeConfig.getMAX_QUOTES(); i++) { - symbol = "s:" + i; - companyName = "S" + i + " Incorporated"; - try { - ts.createQuote(symbol, companyName, new java.math.BigDecimal(TradeConfig.rndPrice())); - if (i % 10 == 0) { - out.print("....." + symbol); - if (i % 100 == 0) { - out.println(" -
    "); - out.flush(); - } - } - } catch (Exception e) { - if (errorCount++ >= 10) { - String error = "Populate Trade DB aborting after 10 create quote errors. Check the EJB datasource configuration. Check the log for details

    Exception is:
    " - + e.toString(); - Log.error(e, error); - throw e; - } - } - } - out.println("
    "); - out.println("
    **** Registering " + TradeConfig.getMAX_USERS() + " Users **** "); - errorCount = 0; //reset for user registrations - - // Registration is a formal operation in Trade 2. - for (int i = 0; i < TradeConfig.getMAX_USERS(); i++) { - String userID = "uid:" + i; - String fullname = TradeConfig.rndFullName(); - String email = TradeConfig.rndEmail(userID); - String address = TradeConfig.rndAddress(); - String creditcard = TradeConfig.rndCreditCard(); - double initialBalance = (double) (TradeConfig.rndInt(100000)) + 200000; - if (i == 0) { - initialBalance = 1000000; // uid:0 starts with a cool million. - } - try { - AccountDataBean accountData = ts.register(userID, "xxx", fullname, address, email, creditcard, new BigDecimal(initialBalance)); - - if (accountData != null) { - if (i % 50 == 0) { - out.print("
    Account# " + accountData.getAccountID() + " userID=" + userID); - } // end-if - - int holdings = TradeConfig.rndInt(TradeConfig.getMAX_HOLDINGS() + 1); // 0-MAX_HOLDING (inclusive), avg holdings per user = (MAX-0)/2 - double quantity = 0; - - for (int j = 0; j < holdings; j++) { - symbol = TradeConfig.rndSymbol(); - quantity = TradeConfig.rndQuantity(); - ts.buy(userID, symbol, quantity, TradeConfig.getOrderProcessingMode()); - } // end-for - if (i % 50 == 0) { - out.println(" has " + holdings + " holdings."); - out.flush(); - } // end-if - } else { - out.println("
    UID " + userID + " already registered.
    "); - out.flush(); - } // end-if - - } catch (Exception e) { - if (errorCount++ >= 10) { - String error = "Populate Trade DB aborting after 10 user registration errors. Check the log for details.

    Exception is:
    " - + e.toString(); - Log.error(e, error); - throw e; - } - } - } // end-for - out.println(""); - } - - private boolean recreateDBTables(Object[] sqlBuffer, java.io.PrintWriter out) throws Exception { - // Clear MDB Statistics - MDBStats.getInstance().reset(); - - Connection conn = null; - boolean success = false; - try { - conn = datasource.getConnection(); - Statement stmt = conn.createStatement(); - int bufferLength = sqlBuffer.length; - for (int i = 0; i < bufferLength; i++) { - try { - stmt.executeUpdate((String) sqlBuffer[i]); - // commit(conn); - } catch (SQLException ex) { - // Ignore DROP statements as tables won't always exist. - if (((String) sqlBuffer[i]).indexOf("DROP ") < 0) { - Log.error("TradeDirect:recreateDBTables SQL Exception thrown on executing the foll sql command: " + sqlBuffer[i], ex); - out.println("
    SQL Exception thrown on executing the foll sql command: " + sqlBuffer[i] + " . Check log for details.
    "); - } - } - } - stmt.close(); - conn.commit(); - success = true; - } catch (Exception e) { - Log.error(e, "TradeDirect:recreateDBTables() -- Error dropping and recreating the database tables"); - } finally { - conn.close(); - } - return success; - } - - - public RunStatsDataBean resetTrade(boolean deleteAll) throws Exception { - // Clear MDB Statistics - MDBStats.getInstance().reset(); - // Reset Trade - - RunStatsDataBean runStatsData = new RunStatsDataBean(); - Connection conn = null; - try { - - conn = datasource.getConnection(); - conn.setAutoCommit(false); - PreparedStatement stmt = null; - ResultSet rs = null; - - if (deleteAll) { - try { - stmt = getStatement(conn, "delete from quoteejb"); - stmt.executeUpdate(); - stmt.close(); - stmt = getStatement(conn, "delete from accountejb"); - stmt.executeUpdate(); - stmt.close(); - stmt = getStatement(conn, "delete from accountprofileejb"); - stmt.executeUpdate(); - stmt.close(); - stmt = getStatement(conn, "delete from holdingejb"); - stmt.executeUpdate(); - stmt.close(); - stmt = getStatement(conn, "delete from orderejb"); - stmt.executeUpdate(); - stmt.close(); - // FUTURE: - DuplicateKeyException - For now, don't start at - // zero as KeySequenceDirect and KeySequenceBean will still - // give out - // the cached Block and then notice this change. Better - // solution is - // to signal both classes to drop their cached blocks - // stmt = getStatement(conn, "delete from keygenejb"); - // stmt.executeUpdate(); - // stmt.close(); - conn.commit(); - } catch (Exception e) { - Log.error(e, "TradeDirect:resetTrade(deleteAll) -- Error deleting Trade users and stock from the Trade database"); - } - return runStatsData; - } - - stmt = getStatement(conn, "delete from holdingejb where holdingejb.account_accountid is null"); - stmt.executeUpdate(); - stmt.close(); - - // Count and Delete newly registered users (users w/ id that start - // "ru:%": - stmt = getStatement(conn, "delete from accountprofileejb where userid like 'ru:%'"); - stmt.executeUpdate(); - stmt.close(); - - stmt = getStatement(conn, "delete from orderejb where account_accountid in (select accountid from accountejb a where a.profile_userid like 'ru:%')"); - stmt.executeUpdate(); - stmt.close(); - - stmt = getStatement(conn, - "delete from holdingejb where account_accountid in (select accountid from accountejb a where a.profile_userid like 'ru:%')"); - stmt.executeUpdate(); - stmt.close(); - - stmt = getStatement(conn, "delete from accountejb where profile_userid like 'ru:%'"); - int newUserCount = stmt.executeUpdate(); - runStatsData.setNewUserCount(newUserCount); - stmt.close(); - - // Count of trade users - stmt = getStatement(conn, "select count(accountid) as \"tradeUserCount\" from accountejb a where a.profile_userid like 'uid:%'"); - rs = stmt.executeQuery(); - rs.next(); - int tradeUserCount = rs.getInt("tradeUserCount"); - runStatsData.setTradeUserCount(tradeUserCount); - stmt.close(); - - rs.close(); - // Count of trade stocks - stmt = getStatement(conn, "select count(symbol) as \"tradeStockCount\" from quoteejb a where a.symbol like 's:%'"); - rs = stmt.executeQuery(); - rs.next(); - int tradeStockCount = rs.getInt("tradeStockCount"); - runStatsData.setTradeStockCount(tradeStockCount); - stmt.close(); - - // Count of trade users login, logout - stmt = getStatement(conn, - "select sum(loginCount) as \"sumLoginCount\", sum(logoutCount) as \"sumLogoutCount\" from accountejb a where a.profile_userID like 'uid:%'"); - rs = stmt.executeQuery(); - rs.next(); - int sumLoginCount = rs.getInt("sumLoginCount"); - int sumLogoutCount = rs.getInt("sumLogoutCount"); - runStatsData.setSumLoginCount(sumLoginCount); - runStatsData.setSumLogoutCount(sumLogoutCount); - stmt.close(); - - rs.close(); - // Update logoutcount and loginCount back to zero - - stmt = getStatement(conn, "update accountejb set logoutCount=0,loginCount=0 where profile_userID like 'uid:%'"); - stmt.executeUpdate(); - stmt.close(); - - // count holdings for trade users - stmt = getStatement(conn, "select count(holdingid) as \"holdingCount\" from holdingejb h where h.account_accountid in " - + "(select accountid from accountejb a where a.profile_userid like 'uid:%')"); - - rs = stmt.executeQuery(); - rs.next(); - int holdingCount = rs.getInt("holdingCount"); - runStatsData.setHoldingCount(holdingCount); - stmt.close(); - rs.close(); - - // count orders for trade users - stmt = getStatement(conn, "select count(orderid) as \"orderCount\" from orderejb o where o.account_accountid in " - + "(select accountid from accountejb a where a.profile_userid like 'uid:%')"); - - rs = stmt.executeQuery(); - rs.next(); - int orderCount = rs.getInt("orderCount"); - runStatsData.setOrderCount(orderCount); - stmt.close(); - rs.close(); - - // count orders by type for trade users - stmt = getStatement(conn, "select count(orderid) \"buyOrderCount\"from orderejb o where (o.account_accountid in " - + "(select accountid from accountejb a where a.profile_userid like 'uid:%')) AND " + " (o.orderType='buy')"); - - rs = stmt.executeQuery(); - rs.next(); - int buyOrderCount = rs.getInt("buyOrderCount"); - runStatsData.setBuyOrderCount(buyOrderCount); - stmt.close(); - rs.close(); - - // count orders by type for trade users - stmt = getStatement(conn, "select count(orderid) \"sellOrderCount\"from orderejb o where (o.account_accountid in " - + "(select accountid from accountejb a where a.profile_userid like 'uid:%')) AND " + " (o.orderType='sell')"); - - rs = stmt.executeQuery(); - rs.next(); - int sellOrderCount = rs.getInt("sellOrderCount"); - runStatsData.setSellOrderCount(sellOrderCount); - stmt.close(); - rs.close(); - - // Delete cancelled orders - stmt = getStatement(conn, "delete from orderejb where orderStatus='cancelled'"); - int cancelledOrderCount = stmt.executeUpdate(); - runStatsData.setCancelledOrderCount(cancelledOrderCount); - stmt.close(); - rs.close(); - - // count open orders by type for trade users - stmt = getStatement(conn, "select count(orderid) \"openOrderCount\"from orderejb o where (o.account_accountid in " - + "(select accountid from accountejb a where a.profile_userid like 'uid:%')) AND " + " (o.orderStatus='open')"); - - rs = stmt.executeQuery(); - rs.next(); - int openOrderCount = rs.getInt("openOrderCount"); - runStatsData.setOpenOrderCount(openOrderCount); - - stmt.close(); - rs.close(); - // Delete orders for holding which have been purchased and sold - stmt = getStatement(conn, "delete from orderejb where holding_holdingid is null"); - int deletedOrderCount = stmt.executeUpdate(); - runStatsData.setDeletedOrderCount(deletedOrderCount); - stmt.close(); - rs.close(); - - conn.commit(); - - System.out.println("TradeDirect:reset Run stats data\n\n" + runStatsData); - } catch (Exception e) { - Log.error(e, "Failed to reset Trade"); - conn.rollback(); - throw e; - } finally { - conn.close(); - } - return runStatsData; - - } - - private PreparedStatement getStatement(Connection conn, String sql) throws Exception { - return conn.prepareStatement(sql); - } - - public Object[] parseDDLToBuffer(InputStream ddlFile) throws Exception { - BufferedReader br = null; - ArrayList sqlBuffer = new ArrayList(30); //initial capacity 30 assuming we have 30 ddl-sql statements to read - - try { - br = new BufferedReader(new InputStreamReader(ddlFile)); - String s; - String sql = new String(); - while ((s = br.readLine()) != null) { - s = s.trim(); - if ((s.length() != 0) && (s.charAt(0) != '#')) // Empty lines or lines starting with "#" are ignored - { - sql = sql + " " + s; - if (s.endsWith(";")) { // reached end of sql statement - sql = sql.replace(';', ' '); //remove the semicolon - sqlBuffer.add(sql); - sql = ""; - } - } - } - } catch (IOException ex) { - Log.error("TradeBuildDB:parseDDLToBuffer Exeception during open/read of File: " + ddlFile, ex); - throw ex; - } finally { - if (br != null) { - try { - br.close(); - } catch (IOException ex) { - Log.error("TradeBuildDB:parseDDLToBuffer Failed to close BufferedReader", ex); - } - } - } - return sqlBuffer.toArray(); - } -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/impl/ejb3/AsyncScheduledOrder.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/impl/ejb3/AsyncScheduledOrder.java deleted file mode 100644 index d72ed31f..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/impl/ejb3/AsyncScheduledOrder.java +++ /dev/null @@ -1,58 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2019. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.impl.ejb3; - - -import com.ibm.websphere.samples.daytrader.interfaces.TradeServices; -import com.ibm.websphere.samples.daytrader.util.TradeConfig; -import com.ibm.websphere.samples.daytrader.util.TradeRunTimeModeLiteral; -import javax.enterprise.context.Dependent; -import javax.enterprise.inject.Any; -import javax.enterprise.inject.Instance; -import javax.inject.Inject; - - -@Dependent -public class AsyncScheduledOrder implements Runnable { - - TradeServices tradeService; - - Integer orderID; - boolean twoPhase; - - @Inject - public AsyncScheduledOrder(@Any Instance services) { - tradeService = services.select(new TradeRunTimeModeLiteral(TradeConfig.getRunTimeModeNames()[TradeConfig.getRunTimeMode()])).get(); - } - - public void setProperties(Integer orderID, boolean twoPhase) { - this.orderID = orderID; - this.twoPhase = twoPhase; - } - - @Override - public void run() { - - - try { - tradeService.completeOrder(orderID, twoPhase); - - } catch (Exception e) { - - e.printStackTrace(); - } - } -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/impl/ejb3/AsyncScheduledOrderSubmitter.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/impl/ejb3/AsyncScheduledOrderSubmitter.java deleted file mode 100644 index c8b3391a..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/impl/ejb3/AsyncScheduledOrderSubmitter.java +++ /dev/null @@ -1,40 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2019. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.impl.ejb3; - -import java.util.concurrent.Future; -import java.util.concurrent.TimeUnit; -import javax.annotation.Resource; -import javax.enterprise.concurrent.ManagedScheduledExecutorService; -import javax.enterprise.context.RequestScoped; -import javax.inject.Inject; - -@RequestScoped -public class AsyncScheduledOrderSubmitter { - - - @Resource - private ManagedScheduledExecutorService mes; - - @Inject - private AsyncScheduledOrder asyncOrder; - - - public Future submitOrder(Integer orderID, boolean twoPhase) { - asyncOrder.setProperties(orderID,twoPhase); - return mes.schedule(asyncOrder,500,TimeUnit.MILLISECONDS); - } -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/impl/ejb3/MarketSummarySingleton.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/impl/ejb3/MarketSummarySingleton.java deleted file mode 100644 index f15ddfc0..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/impl/ejb3/MarketSummarySingleton.java +++ /dev/null @@ -1,136 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2015. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.impl.ejb3; - -import com.ibm.websphere.samples.daytrader.beans.MarketSummaryDataBean; -import com.ibm.websphere.samples.daytrader.entities.QuoteDataBean; -import com.ibm.websphere.samples.daytrader.interfaces.MarketSummaryUpdate; -import com.ibm.websphere.samples.daytrader.util.FinancialUtils; -import com.ibm.websphere.samples.daytrader.util.Log; -import com.ibm.websphere.samples.daytrader.util.TradeConfig; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.List; -import javax.annotation.Resource; -import javax.ejb.Lock; -import javax.ejb.LockType; -import javax.ejb.Schedule; -import javax.ejb.Singleton; -import javax.enterprise.concurrent.ManagedExecutorService; -import javax.enterprise.event.Event; -import javax.enterprise.event.NotificationOptions; -import javax.inject.Inject; -import javax.json.JsonObject; -import javax.persistence.EntityManager; -import javax.persistence.PersistenceContext; -import javax.persistence.TypedQuery; -import javax.persistence.criteria.CriteriaBuilder; -import javax.persistence.criteria.CriteriaQuery; -import javax.persistence.criteria.Root; - -@Singleton -public class MarketSummarySingleton { - - private MarketSummaryDataBean marketSummaryDataBean; - - @PersistenceContext - private EntityManager entityManager; - - @Inject - @MarketSummaryUpdate - Event mkSummaryUpdateEvent; - - @Resource - private ManagedExecutorService mes; - - - /* Update Market Summary every 20 seconds */ - @Schedule(second = "*/20",minute = "*", hour = "*", persistent = false) - private void updateMarketSummary() { - - - Log.trace("MarketSummarySingleton:updateMarketSummary -- updating market summary"); - - - if (TradeConfig.getRunTimeMode() != TradeConfig.EJB3) - { - Log.trace("MarketSummarySingleton:updateMarketSummary -- Not EJB3 Mode, so not updating"); - return; // Only do the actual work if in EJB3 Mode - } - - List quotes; - - try { - // Find Trade Stock Index Quotes (Top 100 quotes) ordered by their change in value - CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder(); - CriteriaQuery criteriaQuery = criteriaBuilder.createQuery(QuoteDataBean.class); - Root quoteRoot = criteriaQuery.from(QuoteDataBean.class); - criteriaQuery.orderBy(criteriaBuilder.desc(quoteRoot.get("change1"))); - criteriaQuery.select(quoteRoot); - TypedQuery q = entityManager.createQuery(criteriaQuery); - quotes = q.getResultList(); - } catch (Exception e) { - Log.debug("Warning: The database has not been configured. If this is the first time the application has been started, please create and populate the database tables. Then restart the server."); - return; - } - - /* TODO: Make this cleaner? */ - QuoteDataBean[] quoteArray = quotes.toArray(new QuoteDataBean[quotes.size()]); - ArrayList topGainers = new ArrayList(5); - ArrayList topLosers = new ArrayList(5); - BigDecimal TSIA = FinancialUtils.ZERO; - BigDecimal openTSIA = FinancialUtils.ZERO; - double totalVolume = 0.0; - - if (quoteArray.length > 5) { - for (int i = 0; i < 5; i++) { - topGainers.add(quoteArray[i]); - } - for (int i = quoteArray.length - 1; i >= quoteArray.length - 5; i--) { - topLosers.add(quoteArray[i]); - } - - for (QuoteDataBean quote : quoteArray) { - BigDecimal price = quote.getPrice(); - BigDecimal open = quote.getOpen(); - double volume = quote.getVolume(); - TSIA = TSIA.add(price); - openTSIA = openTSIA.add(open); - totalVolume += volume; - } - TSIA = TSIA.divide(new BigDecimal(quoteArray.length), FinancialUtils.ROUND); - openTSIA = openTSIA.divide(new BigDecimal(quoteArray.length), FinancialUtils.ROUND); - } - - setMarketSummaryDataBean(new MarketSummaryDataBean(TSIA, openTSIA, totalVolume, topGainers, topLosers)); - mkSummaryUpdateEvent.fireAsync("MarketSummaryUpdate", NotificationOptions.builder().setExecutor(mes).build()); - } - - @Lock(LockType.READ) - public MarketSummaryDataBean getMarketSummaryDataBean() { - if (marketSummaryDataBean == null){ - updateMarketSummary(); - } - - return marketSummaryDataBean; - } - - @Lock(LockType.WRITE) - public void setMarketSummaryDataBean(MarketSummaryDataBean marketSummaryDataBean) { - this.marketSummaryDataBean = marketSummaryDataBean; - } - -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/impl/ejb3/TradeSLSBBean.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/impl/ejb3/TradeSLSBBean.java deleted file mode 100644 index 2093e940..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/impl/ejb3/TradeSLSBBean.java +++ /dev/null @@ -1,616 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2015. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.impl.ejb3; - -import com.ibm.websphere.samples.daytrader.beans.MarketSummaryDataBean; -import com.ibm.websphere.samples.daytrader.entities.AccountDataBean; -import com.ibm.websphere.samples.daytrader.entities.AccountProfileDataBean; -import com.ibm.websphere.samples.daytrader.entities.HoldingDataBean; -import com.ibm.websphere.samples.daytrader.entities.OrderDataBean; -import com.ibm.websphere.samples.daytrader.entities.QuoteDataBean; -import com.ibm.websphere.samples.daytrader.interfaces.RuntimeMode; -import com.ibm.websphere.samples.daytrader.interfaces.Trace; -import com.ibm.websphere.samples.daytrader.interfaces.TradeEJB; -import com.ibm.websphere.samples.daytrader.interfaces.TradeServices; -import com.ibm.websphere.samples.daytrader.util.FinancialUtils; -import com.ibm.websphere.samples.daytrader.util.Log; -import com.ibm.websphere.samples.daytrader.util.RecentQuotePriceChangeList; -import com.ibm.websphere.samples.daytrader.util.TradeConfig; -import java.math.BigDecimal; -import java.sql.Timestamp; -import java.util.Collection; -import java.util.Comparator; -import java.util.Iterator; -import java.util.List; -import java.util.concurrent.Future; -import javax.annotation.Resource; -import javax.ejb.EJB; -import javax.ejb.EJBException; -import javax.ejb.SessionContext; -import javax.ejb.Stateless; -import javax.ejb.TransactionAttribute; -import javax.ejb.TransactionAttributeType; -import javax.ejb.TransactionManagement; -import javax.ejb.TransactionManagementType; -import javax.inject.Inject; -import javax.jms.JMSContext; -import javax.jms.Queue; -import javax.jms.QueueConnectionFactory; -import javax.jms.TextMessage; -import javax.jms.Topic; -import javax.jms.TopicConnectionFactory; -import javax.persistence.EntityManager; -import javax.persistence.PersistenceContext; -import javax.persistence.TypedQuery; -import javax.persistence.criteria.CriteriaBuilder; -import javax.persistence.criteria.CriteriaQuery; -import javax.persistence.criteria.Root; -import javax.transaction.RollbackException; -import javax.validation.constraints.NotNull; - -@Stateless -@TradeEJB -@RuntimeMode("Full EJB3") -@Trace -@TransactionAttribute(TransactionAttributeType.REQUIRED) -@TransactionManagement(TransactionManagementType.CONTAINER) -public class TradeSLSBBean implements TradeServices { - - // For Wildfly - add java:/ to these resource names. - @Resource(name = "jms/QueueConnectionFactory", authenticationType = javax.annotation.Resource.AuthenticationType.APPLICATION) - //@Resource(name = "java:/jms/QueueConnectionFactory", authenticationType = javax.annotation.Resource.AuthenticationType.APPLICATION) - private QueueConnectionFactory queueConnectionFactory; - - @Resource(name = "jms/TopicConnectionFactory", authenticationType = javax.annotation.Resource.AuthenticationType.APPLICATION) - //@Resource(name = "java:/jms/TopicConnectionFactory", authenticationType = javax.annotation.Resource.AuthenticationType.APPLICATION) - private TopicConnectionFactory topicConnectionFactory; - - @Resource(lookup = "jms/TradeStreamerTopic") - //@Resource(lookup = "java:/jms/TradeStreamerTopic") - private Topic tradeStreamerTopic; - - @Resource(lookup = "jms/TradeBrokerQueue") - //@Resource(lookup = "java:/jms/TradeBrokerQueue") - private Queue tradeBrokerQueue; - - @PersistenceContext - private EntityManager entityManager; - - @Resource - private SessionContext context; - - @EJB - MarketSummarySingleton marketSummarySingleton; - - @Inject - AsyncScheduledOrderSubmitter asyncEJBOrderSubmitter; - - @Inject - RecentQuotePriceChangeList recentQuotePriceChangeList; - - @Override - public MarketSummaryDataBean getMarketSummary() { - return marketSummarySingleton.getMarketSummaryDataBean(); - } - - @Override - @NotNull - public OrderDataBean buy(String userID, String symbol, double quantity, int orderProcessingMode) { - OrderDataBean order = null; - BigDecimal total; - try { - - AccountProfileDataBean profile = entityManager.find(AccountProfileDataBean.class, userID); - AccountDataBean account = profile.getAccount(); - QuoteDataBean quote = entityManager.find(QuoteDataBean.class, symbol); - HoldingDataBean holding = null; // The holding will be created by - // this buy order - - order = createOrder(account, quote, holding, "buy", quantity); - - // UPDATE - account should be credited during completeOrder - BigDecimal price = quote.getPrice(); - BigDecimal orderFee = order.getOrderFee(); - BigDecimal balance = account.getBalance(); - total = (new BigDecimal(quantity).multiply(price)).add(orderFee); - account.setBalance(balance.subtract(total)); - final Integer orderID=order.getOrderID(); - - if (orderProcessingMode == TradeConfig.SYNCH) { - completeOrder(orderID, false); - } else if (orderProcessingMode == TradeConfig.ASYNCH) { - completeOrderAsync(orderID, false); - } else if (orderProcessingMode == TradeConfig.ASYNCH_2PHASE) { - queueOrder(orderID, true); - } - } catch (Exception e) { - Log.error("TradeSLSBBean:buy(" + userID + "," + symbol + "," + quantity + ") --> failed", e); - /* On exception - cancel the order */ - // TODO figure out how to do this with JPA - // if (order != null) order.cancel(); - throw new EJBException(e); - } - return order; - } - - @Override - @NotNull - public OrderDataBean sell(final String userID, final Integer holdingID, int orderProcessingMode) { - OrderDataBean order=null; - BigDecimal total; - try { - AccountProfileDataBean profile = entityManager.find(AccountProfileDataBean.class, userID); - AccountDataBean account = profile.getAccount(); - - HoldingDataBean holding = entityManager.find(HoldingDataBean.class, holdingID); - - if (holding == null) { - Log.debug("TradeSLSBBean:sell User " + userID + " attempted to sell holding " + holdingID + " which has already been sold"); - - OrderDataBean orderData = new OrderDataBean(); - orderData.setOrderStatus("cancelled"); - entityManager.persist(orderData); - - return orderData; - } - - QuoteDataBean quote = holding.getQuote(); - double quantity = holding.getQuantity(); - - order = createOrder(account, quote, holding, "sell", quantity); - - // UPDATE the holding purchase data to signify this holding is - // "inflight" to be sold - // -- could add a new holdingStatus attribute to holdingEJB - holding.setPurchaseDate(new java.sql.Timestamp(0)); - - // UPDATE - account should be credited during completeOrder - BigDecimal price = quote.getPrice(); - BigDecimal orderFee = order.getOrderFee(); - BigDecimal balance = account.getBalance(); - total = (new BigDecimal(quantity).multiply(price)).subtract(orderFee); - account.setBalance(balance.add(total)); - final Integer orderID=order.getOrderID(); - - if (orderProcessingMode == TradeConfig.SYNCH) { - completeOrder(orderID, false); - } else if (orderProcessingMode == TradeConfig.ASYNCH) { - completeOrderAsync(orderID, false); - } else if (orderProcessingMode == TradeConfig.ASYNCH_2PHASE) { - queueOrder(orderID, true); - } - - } catch (Exception e) { - Log.error("TradeSLSBBean:sell(" + userID + "," + holdingID + ") --> failed", e); - // if (order != null) order.cancel(); - // UPDATE - handle all exceptions like: - throw new EJBException("TradeSLSBBean:sell(" + userID + "," + holdingID + ")", e); - } - return order; - } - - public void queueOrder(Integer orderID, boolean twoPhase) { - - // 2 phase - try (JMSContext queueContext = queueConnectionFactory.createContext();) { - TextMessage message = queueContext.createTextMessage(); - - message.setStringProperty("command", "neworder"); - message.setIntProperty("orderID", orderID); - message.setBooleanProperty("twoPhase", twoPhase); - message.setText("neworder: orderID=" + orderID + " runtimeMode=EJB twoPhase=" + twoPhase); - message.setLongProperty("publishTime", System.currentTimeMillis()); - - queueContext.createProducer().send(tradeBrokerQueue, message); - - } catch (Exception e) { - throw new EJBException(e.getMessage(), e); // pass the exception - } - } - - @Override - public OrderDataBean completeOrder(Integer orderID, boolean twoPhase) throws Exception { - OrderDataBean order = entityManager.find(OrderDataBean.class, orderID); - - if (order == null) { - System.out.println("error"); - throw new EJBException("Error: attempt to complete Order that is null\n" + order); - } - - order.getQuote(); - - if (order.isCompleted()) { - throw new EJBException("Error: attempt to complete Order that is already completed\n" + order); - } - - AccountDataBean account = order.getAccount(); - QuoteDataBean quote = order.getQuote(); - HoldingDataBean holding = order.getHolding(); - BigDecimal price = order.getPrice(); - double quantity = order.getQuantity(); - - if (order.isBuy()) { - /* - * Complete a Buy operation - create a new Holding for the Account - - * deduct the Order cost from the Account balance - */ - - HoldingDataBean newHolding = createHolding(account, quote, quantity, price); - order.setHolding(newHolding); - order.setOrderStatus("closed"); - order.setCompletionDate(new java.sql.Timestamp(System.currentTimeMillis())); - updateQuotePriceVolume(quote.getSymbol(), TradeConfig.getRandomPriceChangeFactor(), quantity); - } - - if (order.isSell()) { - /* - * Complete a Sell operation - remove the Holding from the Account - - * deposit the Order proceeds to the Account balance - */ - if (holding == null) { - Log.debug("TradeSLSBBean:completeOrder -- Unable to sell order " + order.getOrderID() + " holding already sold"); - order.cancel(); - //throw new EJBException("TradeSLSBBean:completeOrder -- Unable to sell order " + order.getOrderID() + " holding already sold"); - } else { - entityManager.remove(holding); - order.setHolding(null); - order.setOrderStatus("closed"); - order.setCompletionDate(new java.sql.Timestamp(System.currentTimeMillis())); - updateQuotePriceVolume(quote.getSymbol(), TradeConfig.getRandomPriceChangeFactor(), quantity); - } - } - - Log.trace("TradeSLSBBean:completeOrder--> Completed Order " + order.getOrderID() + "\n\t Order info: " + order + "\n\t Account info: " + account - + "\n\t Quote info: " + quote + "\n\t Holding info: " + holding); - - return order; - } - - @Override - public Future completeOrderAsync(Integer orderID, boolean twoPhase) throws Exception { - asyncEJBOrderSubmitter.submitOrder(orderID, twoPhase); - return null; - } - - @Override - public void cancelOrder(Integer orderID, boolean twoPhase) { - OrderDataBean order = entityManager.find(OrderDataBean.class, orderID); - order.cancel(); - } - - @Override - public void orderCompleted(String userID, Integer orderID) { - throw new UnsupportedOperationException("TradeSLSBBean:orderCompleted method not supported"); - } - - @Override - public Collection getOrders(String userID) { - AccountProfileDataBean profile = entityManager.find(AccountProfileDataBean.class, userID); - AccountDataBean account = profile.getAccount(); - return account.getOrders(); - } - - @Override - public Collection getClosedOrders(String userID) { - - try { - /* I want to do a CriteriaUpdate here, but there are issues with JBoss/Hibernate */ - CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder(); - CriteriaQuery criteriaQuery = criteriaBuilder.createQuery(OrderDataBean.class); - Root orders = criteriaQuery.from(OrderDataBean.class); - criteriaQuery.select(orders); - criteriaQuery.where( - criteriaBuilder.equal(orders.get("orderStatus"), - criteriaBuilder.parameter(String.class, "p_status")), - criteriaBuilder.equal(orders.get("account").get("profile").get("userID"), - criteriaBuilder.parameter(String.class, "p_userid"))); - - TypedQuery q = entityManager.createQuery(criteriaQuery); - q.setParameter("p_status", "closed"); - q.setParameter("p_userid", userID); - List results = q.getResultList(); - - Iterator itr = results.iterator(); - // Spin through the orders to remove or mark completed - while (itr.hasNext()) { - OrderDataBean order = itr.next(); - // TODO: Investigate ConncurrentModification Exceptions - if (TradeConfig.getLongRun()) { - //Added this for Longruns (to prevent orderejb growth) - entityManager.remove(order); - } - else { - order.setOrderStatus("completed"); - } - } - - return results; - } catch (Exception e) { - Log.error("TradeSLSBBean.getClosedOrders", e); - throw new EJBException("TradeSLSBBean.getClosedOrders - error", e); - } - } - - @Override - public QuoteDataBean createQuote(String symbol, String companyName, BigDecimal price) { - try { - QuoteDataBean quote = new QuoteDataBean(symbol, companyName, 0, price, price, price, price, 0); - entityManager.persist(quote); - - Log.trace("TradeSLSBBean:createQuote-->" + quote); - - return quote; - } catch (Exception e) { - Log.error("TradeSLSBBean:createQuote -- exception creating Quote", e); - throw new EJBException(e); - } - } - - @Override - public QuoteDataBean getQuote(String symbol) { - return entityManager.find(QuoteDataBean.class, symbol); - } - - @Override - public Collection getAllQuotes() { - TypedQuery query = entityManager.createNamedQuery("quoteejb.allQuotes", QuoteDataBean.class); - return query.getResultList(); - } - - @Override - public QuoteDataBean updateQuotePriceVolume(String symbol, BigDecimal changeFactor, double sharesTraded) { - if (!TradeConfig.getUpdateQuotePrices()) { - return new QuoteDataBean(); - } - - Log.trace("TradeSLSBBean:updateQuote", symbol, changeFactor); - - TypedQuery q = entityManager.createNamedQuery("quoteejb.quoteForUpdate", QuoteDataBean.class); - q.setParameter(1, symbol); - QuoteDataBean quote = q.getSingleResult(); - - BigDecimal oldPrice = quote.getPrice(); - BigDecimal openPrice = quote.getOpen(); - - if (oldPrice.equals(TradeConfig.PENNY_STOCK_PRICE)) { - changeFactor = TradeConfig.PENNY_STOCK_RECOVERY_MIRACLE_MULTIPLIER; - } else if (oldPrice.compareTo(TradeConfig.MAXIMUM_STOCK_PRICE) > 0) { - changeFactor = TradeConfig.MAXIMUM_STOCK_SPLIT_MULTIPLIER; - } - - BigDecimal newPrice = changeFactor.multiply(oldPrice).setScale(2, BigDecimal.ROUND_HALF_UP); - - quote.setPrice(newPrice); - quote.setChange(newPrice.subtract(openPrice).doubleValue()); - quote.setVolume(quote.getVolume() + sharesTraded); - entityManager.merge(quote); - - if (TradeConfig.getPublishQuotePriceChange()) { - publishQuotePriceChange(quote, oldPrice, changeFactor, sharesTraded); - } - - recentQuotePriceChangeList.add(quote); - - return quote; - } - - @Override - public Collection<@NotNull HoldingDataBean> getHoldings(String userID) { - CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder(); - CriteriaQuery criteriaQuery = criteriaBuilder.createQuery(HoldingDataBean.class); - Root holdings = criteriaQuery.from(HoldingDataBean.class); - criteriaQuery.where( - criteriaBuilder.equal(holdings.get("account").get("profile").get("userID"), - criteriaBuilder.parameter(String.class, "p_userid"))); - criteriaQuery.select(holdings); - - TypedQuery typedQuery = entityManager.createQuery(criteriaQuery); - typedQuery.setParameter("p_userid", userID); - return typedQuery.getResultList(); - } - - @Override - public HoldingDataBean getHolding(Integer holdingID) { - return entityManager.find(HoldingDataBean.class, holdingID); - } - - @Override - public AccountDataBean getAccountData(String userID) { - AccountProfileDataBean profile = entityManager.find(AccountProfileDataBean.class, userID); - AccountDataBean account = profile.getAccount(); - - // Added to populate transient field for account - account.setProfileID(profile.getUserID()); - - return account; - } - - @Override - public AccountProfileDataBean getAccountProfileData(String userID) { - return entityManager.find(AccountProfileDataBean.class, userID); - } - - @Override - public AccountProfileDataBean updateAccountProfile(AccountProfileDataBean profileData) { - AccountProfileDataBean temp = entityManager.find(AccountProfileDataBean.class, profileData.getUserID()); - temp.setAddress(profileData.getAddress()); - temp.setPassword(profileData.getPassword()); - temp.setFullName(profileData.getFullName()); - temp.setCreditCard(profileData.getCreditCard()); - temp.setEmail(profileData.getEmail()); - - entityManager.merge(temp); - - return temp; - } - - @Override - public AccountDataBean login(String userID, String password) throws RollbackException { - AccountProfileDataBean profile = entityManager.find(AccountProfileDataBean.class, userID); - if (profile == null) { - throw new EJBException("No such user: " + userID); - } - - AccountDataBean account = profile.getAccount(); - account.login(password); - - Log.trace("TradeSLSBBean:login(" + userID + "," + password + ") success" + account); - - return account; - } - - @Override - public void logout(String userID) { - AccountProfileDataBean profile = entityManager.find(AccountProfileDataBean.class, userID); - AccountDataBean account = profile.getAccount(); - account.logout(); - - Log.trace("TradeSLSBBean:logout(" + userID + ") success"); - } - - @Override - public AccountDataBean register(String userID, String password, String fullname, String address, String email, String creditcard, BigDecimal openBalance) { - AccountDataBean account = null; - AccountProfileDataBean profile = null; - - // Check to see if a profile with the desired userID already exists - profile = entityManager.find(AccountProfileDataBean.class, userID); - - if (profile != null) { - Log.error("Failed to register new Account - AccountProfile with userID(" + userID + ") already exists"); - return null; - } else { - profile = new AccountProfileDataBean(userID, password, fullname, address, email, creditcard); - account = new AccountDataBean(0, 0, null, new Timestamp(System.currentTimeMillis()), openBalance, openBalance, userID); - - profile.setAccount(account); - account.setProfile(profile); - - entityManager.persist(profile); - entityManager.persist(account); - } - - return account; - } - - @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW) - public void publishQuotePriceChange(QuoteDataBean quote, BigDecimal oldPrice, BigDecimal changeFactor, double sharesTraded) { - if (!TradeConfig.getPublishQuotePriceChange()) { - return; - } - - try (JMSContext topicContext = topicConnectionFactory.createContext();) { - TextMessage message = topicContext.createTextMessage(); - - message.setStringProperty("command", "updateQuote"); - message.setStringProperty("symbol", quote.getSymbol()); - message.setStringProperty("company", quote.getCompanyName()); - message.setStringProperty("price", quote.getPrice().toString()); - message.setStringProperty("oldPrice", oldPrice.toString()); - message.setStringProperty("open", quote.getOpen().toString()); - message.setStringProperty("low", quote.getLow().toString()); - message.setStringProperty("high", quote.getHigh().toString()); - message.setDoubleProperty("volume", quote.getVolume()); - message.setStringProperty("changeFactor", changeFactor.toString()); - message.setDoubleProperty("sharesTraded", sharesTraded); - message.setLongProperty("publishTime", System.currentTimeMillis()); - message.setText("Update Stock price for " + quote.getSymbol() + " old price = " + oldPrice + " new price = " + quote.getPrice()); - - topicContext.createProducer().send(tradeStreamerTopic, message); - } catch (Exception e) { - throw new EJBException(e.getMessage(), e); // pass the exception - } - } - - public OrderDataBean createOrder(AccountDataBean account, QuoteDataBean quote, HoldingDataBean holding, String orderType, double quantity) { - OrderDataBean order; - - try { - order = new OrderDataBean(orderType, "open", new Timestamp(System.currentTimeMillis()), null, quantity, quote.getPrice().setScale( - FinancialUtils.SCALE, FinancialUtils.ROUND), TradeConfig.getOrderFee(orderType), account, quote, holding); - entityManager.persist(order); - } catch (Exception e) { - Log.error("TradeSLSBBean:createOrder -- failed to create Order. The stock/quote may not exist in the database.", e); - throw new EJBException("TradeSLSBBean:createOrder -- failed to create Order. Check that the symbol exists in the database.", e); - } - return order; - } - - private HoldingDataBean createHolding(AccountDataBean account, QuoteDataBean quote, double quantity, BigDecimal purchasePrice) throws Exception { - HoldingDataBean newHolding = new HoldingDataBean(quantity, purchasePrice, new Timestamp(System.currentTimeMillis()), account, quote); - entityManager.persist(newHolding); - return newHolding; - } - - @Override - public double investmentReturn(double investment, double NetValue) throws Exception { - double diff = NetValue - investment; - double ir = diff / investment; - return ir; - } - - @Override - public QuoteDataBean pingTwoPhase(String symbol) throws Exception { - QuoteDataBean quoteData = null; - - try (JMSContext queueContext = queueConnectionFactory.createContext();) { - // Get a Quote and send a JMS message in a 2-phase commit - quoteData = entityManager.find(QuoteDataBean.class, symbol); - - double sharesTraded = (Math.random() * 100) + 1 ; - BigDecimal oldPrice = quoteData.getPrice(); - BigDecimal openPrice = quoteData.getOpen(); - BigDecimal changeFactor = new BigDecimal (Math.random() * 100); - - BigDecimal newPrice = changeFactor.multiply(oldPrice).setScale(2, BigDecimal.ROUND_HALF_UP); - - quoteData.setPrice(newPrice); - quoteData.setChange(newPrice.subtract(openPrice).doubleValue()); - quoteData.setVolume(quoteData.getVolume() + sharesTraded); - entityManager.merge(quoteData); - - TextMessage message = queueContext.createTextMessage(); - - message.setStringProperty("command", "ping"); - message.setLongProperty("publishTime", System.currentTimeMillis()); - message.setText("Ping message for queue java:comp/env/jms/TradeBrokerQueue sent from TradeSLSBBean:pingTwoPhase at " + new java.util.Date()); - queueContext.createProducer().send(tradeBrokerQueue, message); - } catch (Exception e) { - Log.error("TradeSLSBBean:pingTwoPhase -- exception caught", e); - } - - return quoteData; - } - - class quotePriceComparator implements Comparator { - @Override - public int compare(QuoteDataBean quote1, QuoteDataBean quote2) { - double change1 = quote1.getChange(); - double change2 = quote2.getChange(); - return new Double(change2).compareTo(change1); - } - } - - @Override - public int getImpl() { - return TradeConfig.EJB3; - } - - @Override - public void setInSession(boolean inSession) { - throw new UnsupportedOperationException("TradeSLSBBean::setInGlobalTxn not supported"); - } -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/impl/session2direct/DirectSLSBBean.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/impl/session2direct/DirectSLSBBean.java deleted file mode 100644 index 5ac261c4..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/impl/session2direct/DirectSLSBBean.java +++ /dev/null @@ -1,235 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2015. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.impl.session2direct; - -import com.ibm.websphere.samples.daytrader.beans.MarketSummaryDataBean; -import com.ibm.websphere.samples.daytrader.entities.AccountDataBean; -import com.ibm.websphere.samples.daytrader.entities.AccountProfileDataBean; -import com.ibm.websphere.samples.daytrader.entities.HoldingDataBean; -import com.ibm.websphere.samples.daytrader.entities.OrderDataBean; -import com.ibm.websphere.samples.daytrader.entities.QuoteDataBean; -import com.ibm.websphere.samples.daytrader.impl.ejb3.AsyncScheduledOrderSubmitter; -import com.ibm.websphere.samples.daytrader.interfaces.RuntimeMode; -import com.ibm.websphere.samples.daytrader.interfaces.Trace; -import com.ibm.websphere.samples.daytrader.interfaces.TradeJDBC; -import com.ibm.websphere.samples.daytrader.interfaces.TradeServices; -import com.ibm.websphere.samples.daytrader.interfaces.TradeSession2Direct; -import com.ibm.websphere.samples.daytrader.util.TradeConfig; -import java.math.BigDecimal; -import java.util.Collection; -import java.util.concurrent.Future; -import javax.ejb.Stateless; -import javax.ejb.TransactionAttribute; -import javax.ejb.TransactionAttributeType; -import javax.ejb.TransactionManagement; -import javax.ejb.TransactionManagementType; -import javax.inject.Inject; -import javax.validation.constraints.NotNull; - -@Stateless -@TradeSession2Direct -@RuntimeMode("Session to Direct") -@Trace -@TransactionAttribute(TransactionAttributeType.REQUIRED) -@TransactionManagement(TransactionManagementType.CONTAINER) -public class DirectSLSBBean implements TradeServices { - - @Inject - @TradeJDBC - TradeServices tradeDirect; - - @Inject - AsyncScheduledOrderSubmitter asyncEJBOrderSubmitter; - - @Override - public int getImpl() { - return TradeConfig.SESSION_TO_DIRECT; - } - - @Override - public MarketSummaryDataBean getMarketSummary() throws Exception { - tradeDirect.setInSession(true); - return tradeDirect.getMarketSummary(); - } - - @Override - public OrderDataBean createOrder(AccountDataBean account, QuoteDataBean quote, HoldingDataBean holding, - String orderType, double quantity) throws Exception { - tradeDirect.setInSession(true); - return tradeDirect.createOrder(account, quote, holding, orderType, quantity); - } - - @Override - @NotNull - public OrderDataBean buy(String userID, String symbol, double quantity, int orderProcessingMode) throws Exception { - tradeDirect.setInSession(true); - OrderDataBean orderdata = tradeDirect.buy(userID, symbol, quantity, orderProcessingMode); - - if (orderProcessingMode == TradeConfig.ASYNCH) { - this.completeOrderAsync(orderdata.getOrderID(), false); - } - - return orderdata; - } - - @Override - @NotNull - public OrderDataBean sell(String userID, Integer holdingID, int orderProcessingMode) throws Exception { - tradeDirect.setInSession(true); - OrderDataBean orderdata = tradeDirect.sell(userID, holdingID, orderProcessingMode); - - if (orderProcessingMode == TradeConfig.ASYNCH) { - this.completeOrderAsync(orderdata.getOrderID(), false); - } - return orderdata; - - } - - @Override - public void queueOrder(Integer orderID, boolean twoPhase) throws Exception { - tradeDirect.setInSession(true); - tradeDirect.queueOrder(orderID, twoPhase); - - } - - @Override - public OrderDataBean completeOrder(Integer orderID, boolean twoPhase) throws Exception { - tradeDirect.setInSession(true); - return tradeDirect.completeOrder(orderID, twoPhase); - } - - @Override - public Future completeOrderAsync(Integer orderID, boolean twoPhase) throws Exception { - asyncEJBOrderSubmitter.submitOrder(orderID, twoPhase); - return null; - } - - @Override - public void cancelOrder(Integer orderID, boolean twoPhase) throws Exception { - tradeDirect.setInSession(true); - tradeDirect.cancelOrder(orderID, twoPhase); - - } - - @Override - public void orderCompleted(String userID, Integer orderID) throws Exception { - tradeDirect.setInSession(true); - tradeDirect.orderCompleted(userID, orderID); - - } - - @Override - public Collection getOrders(String userID) throws Exception { - tradeDirect.setInSession(true); - return tradeDirect.getOrders(userID); - } - - @Override - public Collection getClosedOrders(String userID) throws Exception { - tradeDirect.setInSession(true); - return tradeDirect.getClosedOrders(userID); - } - - @Override - public QuoteDataBean createQuote(String symbol, String companyName, BigDecimal price) throws Exception { - tradeDirect.setInSession(true); - return tradeDirect.createQuote(symbol, companyName, price); - } - - @Override - public QuoteDataBean getQuote(String symbol) throws Exception { - tradeDirect.setInSession(true); - return tradeDirect.getQuote(symbol); - } - - @Override - public Collection getAllQuotes() throws Exception { - tradeDirect.setInSession(true); - return tradeDirect.getAllQuotes(); - } - - @Override - public QuoteDataBean updateQuotePriceVolume(String symbol, BigDecimal newPrice, double sharesTraded) - throws Exception { - tradeDirect.setInSession(true); - return tradeDirect.updateQuotePriceVolume(symbol, newPrice, sharesTraded); - } - - @Override - public Collection getHoldings(String userID) throws Exception { - tradeDirect.setInSession(true); - return tradeDirect.getHoldings(userID); - } - - @Override - public HoldingDataBean getHolding(Integer holdingID) throws Exception { - tradeDirect.setInSession(true); - return tradeDirect.getHolding(holdingID); - } - - @Override - public AccountDataBean getAccountData(String userID) throws Exception { - tradeDirect.setInSession(true); - return tradeDirect.getAccountData(userID); - } - - @Override - public AccountProfileDataBean getAccountProfileData(String userID) throws Exception { - tradeDirect.setInSession(true); - return tradeDirect.getAccountProfileData(userID); - } - - @Override - public AccountProfileDataBean updateAccountProfile(AccountProfileDataBean profileData) throws Exception { - tradeDirect.setInSession(true); - return tradeDirect.updateAccountProfile(profileData); - } - - @Override - public AccountDataBean login(String userID, String password) throws Exception { - tradeDirect.setInSession(true); - return tradeDirect.login(userID, password); - } - - @Override - public void logout(String userID) throws Exception { - tradeDirect.setInSession(true); - tradeDirect.logout(userID); - } - - @Override - public AccountDataBean register(String userID, String password, String fullname, String address, String email, - String creditcard, BigDecimal openBalance) throws Exception { - tradeDirect.setInSession(true); - return tradeDirect.register(userID, password, fullname, address, email, creditcard, openBalance); - } - - @Override - public QuoteDataBean pingTwoPhase(String symbol) throws Exception { - throw new UnsupportedOperationException(); - } - - @Override - public double investmentReturn(double rnd1, double rnd2) throws Exception { - throw new UnsupportedOperationException(); - } - - - @Override - public void setInSession(boolean inSession) { - throw new UnsupportedOperationException("DirectSLSBBean::setInGlobalTxn not supported"); - } -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/interfaces/MarketSummaryUpdate.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/interfaces/MarketSummaryUpdate.java deleted file mode 100644 index 11078e25..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/interfaces/MarketSummaryUpdate.java +++ /dev/null @@ -1,27 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2015. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.interfaces; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; -import javax.inject.Qualifier; - -@Qualifier -@Retention(RetentionPolicy.RUNTIME) -@Target({ElementType.METHOD, ElementType.FIELD, ElementType.PARAMETER, ElementType.TYPE}) -public @interface MarketSummaryUpdate {} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/interfaces/QuotePriceChange.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/interfaces/QuotePriceChange.java deleted file mode 100644 index ea95b220..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/interfaces/QuotePriceChange.java +++ /dev/null @@ -1,28 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2015. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.interfaces; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; -import javax.inject.Qualifier; - -@Qualifier -@Retention(RetentionPolicy.RUNTIME) -@Target({ElementType.METHOD, ElementType.FIELD, ElementType.PARAMETER, ElementType.TYPE}) -public @interface QuotePriceChange { -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/interfaces/RuntimeMode.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/interfaces/RuntimeMode.java deleted file mode 100644 index a7577e8c..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/interfaces/RuntimeMode.java +++ /dev/null @@ -1,33 +0,0 @@ -/******************************************************************************* -* Copyright (c) 2017 IBM Corp. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*******************************************************************************/ -package com.ibm.websphere.samples.daytrader.interfaces; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; -import javax.inject.Qualifier; - -@Qualifier -@Retention(RetentionPolicy.RUNTIME) -@Target({ElementType.TYPE, ElementType.METHOD, - ElementType.FIELD, ElementType.PARAMETER}) -public @interface RuntimeMode { - /** - * Default to jaxrs client impl - */ - String value() default "Full EJB3"; -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/interfaces/Trace.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/interfaces/Trace.java deleted file mode 100644 index c53b6edd..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/interfaces/Trace.java +++ /dev/null @@ -1,32 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2019. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.interfaces; - -import static java.lang.annotation.ElementType.METHOD; -import static java.lang.annotation.ElementType.TYPE; -import static java.lang.annotation.RetentionPolicy.RUNTIME; - -import java.lang.annotation.Inherited; -import java.lang.annotation.Retention; -import java.lang.annotation.Target; -import javax.interceptor.InterceptorBinding; - -@Inherited -@InterceptorBinding -@Target({ TYPE, METHOD }) -@Retention(RUNTIME) -public @interface Trace { -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/interfaces/TradeDB.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/interfaces/TradeDB.java deleted file mode 100644 index 23b5efc3..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/interfaces/TradeDB.java +++ /dev/null @@ -1,44 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2019. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.interfaces; - -import com.ibm.websphere.samples.daytrader.beans.RunStatsDataBean; - -public interface TradeDB { - - /** - * Reset the TradeData by - removing all newly registered users by scenario - * servlet (i.e. users with userID's beginning with "ru:") * - removing all - * buy/sell order pairs - setting logoutCount = loginCount - * - * return statistics for this benchmark run - */ - RunStatsDataBean resetTrade(boolean deleteAll) throws Exception; - - /** - * Get the Database Product Name - * - * return DB Product Name String - */ - String checkDBProductName() throws Exception; - - /** - * Get the impl for the TradeService - * - * return int matching the implementation - */ - -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/interfaces/TradeEJB.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/interfaces/TradeEJB.java deleted file mode 100644 index d7ced1b2..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/interfaces/TradeEJB.java +++ /dev/null @@ -1,31 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2019. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.interfaces; - -import static java.lang.annotation.ElementType.FIELD; -import static java.lang.annotation.ElementType.METHOD; -import static java.lang.annotation.ElementType.PARAMETER; -import static java.lang.annotation.ElementType.TYPE; -import static java.lang.annotation.RetentionPolicy.RUNTIME; - -import java.lang.annotation.Retention; -import java.lang.annotation.Target; -import javax.inject.Qualifier; - -@Qualifier -@Retention(RUNTIME) -@Target({TYPE, METHOD, FIELD, PARAMETER}) -public @interface TradeEJB {} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/interfaces/TradeJDBC.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/interfaces/TradeJDBC.java deleted file mode 100644 index b420a649..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/interfaces/TradeJDBC.java +++ /dev/null @@ -1,31 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2019. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.interfaces; - -import static java.lang.annotation.ElementType.FIELD; -import static java.lang.annotation.ElementType.METHOD; -import static java.lang.annotation.ElementType.PARAMETER; -import static java.lang.annotation.ElementType.TYPE; -import static java.lang.annotation.RetentionPolicy.RUNTIME; - -import java.lang.annotation.Retention; -import java.lang.annotation.Target; -import javax.inject.Qualifier; - -@Qualifier -@Retention(RUNTIME) -@Target({TYPE, METHOD, FIELD, PARAMETER}) -public @interface TradeJDBC {} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/interfaces/TradeServices.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/interfaces/TradeServices.java deleted file mode 100644 index f683aaf2..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/interfaces/TradeServices.java +++ /dev/null @@ -1,337 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2015. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.interfaces; - -import com.ibm.websphere.samples.daytrader.beans.MarketSummaryDataBean; -import com.ibm.websphere.samples.daytrader.entities.AccountDataBean; -import com.ibm.websphere.samples.daytrader.entities.AccountProfileDataBean; -import com.ibm.websphere.samples.daytrader.entities.HoldingDataBean; -import com.ibm.websphere.samples.daytrader.entities.OrderDataBean; -import com.ibm.websphere.samples.daytrader.entities.QuoteDataBean; -import java.math.BigDecimal; -import java.util.Collection; -import java.util.concurrent.Future; - -/** - * TradeServices interface specifies the business methods provided by the Trade - * online broker application. These business methods represent the features and - * operations that can be performed by customers of the brokerage such as login, - * logout, get a stock quote, buy or sell a stock, etc. This interface is - * implemented by {@link Trade} providing an EJB implementation of these - * business methods and also by {@link TradeDirect} providing a JDBC - * implementation. - * - * @see TradeDirect - * @see TradeSLSB - * - */ - -public interface TradeServices { - - /** - * Compute and return a snapshot of the current market conditions This - * includes the TSIA - an index of the price of the top 100 Trade stock - * quotes The openTSIA ( the index at the open) The volume of shares traded, - * Top Stocks gain and loss - * - * @return A snapshot of the current market summary - */ - MarketSummaryDataBean getMarketSummary() throws Exception; - - /** - * Create an order (buy or sell) - * - * @param accoount - * the accountdatabean - * @param quote - * the quptedatabean - * @param holding - * the holdingdatabean - * @param orderType - * buy or sell - * @param quantity - * quantity - * @return Collection OrderDataBeans providing detailed order information - */ - OrderDataBean createOrder(AccountDataBean account, QuoteDataBean quote, HoldingDataBean holding, String orderType, - double quantity) throws Exception; - - /** - * Purchase a stock and create a new holding for the given user. Given a - * stock symbol and quantity to purchase, retrieve the current quote price, - * debit the user's account balance, and add holdings to user's portfolio. - * buy/sell are asynchronous, using J2EE messaging, A new order is created - * and submitted for processing to the TradeBroker - * - * @param userID - * the customer requesting the stock purchase - * @param symbol - * the symbol of the stock being purchased - * @param quantity - * the quantity of shares to purchase - * @return OrderDataBean providing the status of the newly created buy order - */ - - OrderDataBean buy(String userID, String symbol, double quantity, int orderProcessingMode) throws Exception; - - /** - * Sell a stock holding and removed the holding for the given user. Given a - * Holding, retrieve current quote, credit user's account, and reduce - * holdings in user's portfolio. - * - * @param userID - * the customer requesting the sell - * @param holdingID - * the users holding to be sold - * @return OrderDataBean providing the status of the newly created sell - * order - */ - OrderDataBean sell(String userID, Integer holdingID, int orderProcessingMode) throws Exception; - - /** - * Queue the Order identified by orderID to be processed - * - * Orders are submitted through JMS to a Trading Broker and completed - * asynchronously. This method queues the order for processing - * - * The boolean twoPhase specifies to the server implementation whether or - * not the method is to participate in a global transaction - * - * @param orderID - * the Order being queued for processing - * @return OrderDataBean providing the status of the completed order - */ - void queueOrder(Integer orderID, boolean twoPhase) throws Exception; - - /** - * Complete the Order identified by orderID. This method completes - * the order For a buy, the stock is purchased creating a holding and the - * users account is debited For a sell, the stock holding is removed and the - * users account is credited with the proceeds - * - * The boolean twoPhase specifies to the server implementation whether or - * not the method is to participate in a global transaction - * - * @param orderID - * the Order to complete - * @return OrderDataBean providing the status of the completed order - */ - OrderDataBean completeOrder(Integer orderID, boolean twoPhase) throws Exception; - - /** - * Complete the Order identefied by orderID Orders are completed - * asynchronously. This method completes - * the order For a buy, the stock is purchased creating a holding and the - * users account is debited For a sell, the stock holding is removed and the - * users account is credited with the proceeds - * - * The boolean twoPhase specifies to the server implementation whether or - * not the method is to participate in a global transaction - * - * @param orderID - * the Order to complete - * @return OrderDataBean providing the status of the completed order - */ - Future completeOrderAsync(Integer orderID, boolean twoPhase) throws Exception; - - /** - * Cancel the Order identefied by orderID - * - * The boolean twoPhase specifies to the server implementation whether or - * not the method is to participate in a global transaction - * - * @param orderID - * the Order to complete - * @return OrderDataBean providing the status of the completed order - */ - void cancelOrder(Integer orderID, boolean twoPhase) throws Exception; - - /** - * Signify an order has been completed for the given userID - * - * @param userID - * the user for which an order has completed - * @param orderID - * the order which has completed - * - */ - void orderCompleted(String userID, Integer orderID) throws Exception; - - /** - * Get the collection of all orders for a given account - * - * @param userID - * the customer account to retrieve orders for - * @return Collection OrderDataBeans providing detailed order information - */ - Collection getOrders(String userID) throws Exception; - - /** - * Get the collection of completed orders for a given account that need to - * be alerted to the user - * - * @param userID - * the customer account to retrieve orders for - * @return Collection OrderDataBeans providing detailed order information - */ - Collection getClosedOrders(String userID) throws Exception; - - /** - * Given a market symbol, price, and details, create and return a new - * {@link QuoteDataBean} - * - * @param symbol - * the symbol of the stock - * @param price - * the current stock price - * @param details - * a short description of the stock or company - * @return a new QuoteDataBean or null if Quote could not be created - */ - QuoteDataBean createQuote(String symbol, String companyName, BigDecimal price) throws Exception; - - /** - * Return a {@link QuoteDataBean} describing a current quote for the given - * stock symbol - * - * @param symbol - * the stock symbol to retrieve the current Quote - * @return the QuoteDataBean - */ - QuoteDataBean getQuote(String symbol) throws Exception; - - /** - * Return a {@link java.util.Collection} of {@link QuoteDataBean} describing - * all current quotes - * - * @return A collection of QuoteDataBean - */ - Collection getAllQuotes() throws Exception; - - /** - * Update the stock quote price and volume for the specified stock symbol - * - * @param symbol - * for stock quote to update - * @param price - * the updated quote price - * @return the QuoteDataBean describing the stock - */ - QuoteDataBean updateQuotePriceVolume(String symbol, BigDecimal newPrice, double sharesTraded) throws Exception; - - /** - * Return the portfolio of stock holdings for the specified customer as a - * collection of HoldingDataBeans - * - * @param userID - * the customer requesting the portfolio - * @return Collection of the users portfolio of stock holdings - */ - Collection getHoldings(String userID) throws Exception; - - /** - * Return a specific user stock holding identifed by the holdingID - * - * @param holdingID - * the holdingID to return - * @return a HoldingDataBean describing the holding - */ - HoldingDataBean getHolding(Integer holdingID) throws Exception; - - /** - * Return an AccountDataBean object for userID describing the account - * - * @param userID - * the account userID to lookup - * @return User account data in AccountDataBean - */ - AccountDataBean getAccountData(String userID) throws Exception; - - /** - * Return an AccountProfileDataBean for userID providing the users profile - * - * @param userID - * the account userID to lookup - * @param User - * account profile data in AccountProfileDataBean - */ - AccountProfileDataBean getAccountProfileData(String userID) throws Exception; - - /** - * Update userID's account profile information using the provided - * AccountProfileDataBean object - * - * @param userID - * the account userID to lookup - * @param User - * account profile data in AccountProfileDataBean - */ - AccountProfileDataBean updateAccountProfile(AccountProfileDataBean profileData) throws Exception; - - /** - * Attempt to authenticate and login a user with the given password - * - * @param userID - * the customer to login - * @param password - * the password entered by the customer for authentication - * @return User account data in AccountDataBean - */ - AccountDataBean login(String userID, String password) throws Exception; - - /** - * Logout the given user - * - * @param userID - * the customer to logout - * @return the login status - */ - - void logout(String userID) throws Exception; - - /** - * Register a new Trade customer. Create a new user profile, user registry - * entry, account with initial balance, and empty portfolio. - * - * @param userID - * the new customer to register - * @param password - * the customers password - * @param fullname - * the customers fullname - * @param address - * the customers street address - * @param email - * the customers email address - * @param creditcard - * the customers creditcard number - * @param initialBalance - * the amount to charge to the customers credit to open the - * account and set the initial balance - * @return the userID if successful, null otherwise - */ - AccountDataBean register(String userID, String password, String fullname, String address, String email, String creditcard, BigDecimal openBalance) - throws Exception; - - - int getImpl(); - - QuoteDataBean pingTwoPhase(String symbol) throws Exception; - - double investmentReturn(double rnd1, double rnd2) throws Exception; - - void setInSession(boolean inSession); -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/interfaces/TradeSession2Direct.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/interfaces/TradeSession2Direct.java deleted file mode 100644 index 1e6a0110..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/interfaces/TradeSession2Direct.java +++ /dev/null @@ -1,31 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2019. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.interfaces; - -import static java.lang.annotation.ElementType.FIELD; -import static java.lang.annotation.ElementType.METHOD; -import static java.lang.annotation.ElementType.PARAMETER; -import static java.lang.annotation.ElementType.TYPE; -import static java.lang.annotation.RetentionPolicy.RUNTIME; - -import java.lang.annotation.Retention; -import java.lang.annotation.Target; -import javax.inject.Qualifier; - -@Qualifier -@Retention(RUNTIME) -@Target({TYPE, METHOD, FIELD, PARAMETER}) -public @interface TradeSession2Direct {} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/jaxrs/BroadcastResource.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/jaxrs/BroadcastResource.java deleted file mode 100644 index ea8ddd8e..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/jaxrs/BroadcastResource.java +++ /dev/null @@ -1,68 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2019. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.jaxrs; - -import com.ibm.websphere.samples.daytrader.interfaces.QuotePriceChange; -import com.ibm.websphere.samples.daytrader.util.RecentQuotePriceChangeList; -import java.util.List; -import javax.annotation.Priority; -import javax.enterprise.context.ApplicationScoped; -import javax.enterprise.event.ObservesAsync; -import javax.inject.Inject; -import javax.interceptor.Interceptor; -import javax.ws.rs.GET; -import javax.ws.rs.Path; -import javax.ws.rs.Produces; -import javax.ws.rs.core.Context; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.sse.OutboundSseEvent.Builder; -import javax.ws.rs.sse.Sse; -import javax.ws.rs.sse.SseBroadcaster; -import javax.ws.rs.sse.SseEventSink; - -@Path("broadcastevents") -@ApplicationScoped -public class BroadcastResource { - - private SseBroadcaster broadcaster; - private Builder builder; - - @Inject RecentQuotePriceChangeList recentQuotePriceChangeList; - - @Context - public void setSse(Sse sse) { - broadcaster = sse.newBroadcaster(); - builder = sse.newEventBuilder(); - } - - @GET - @Produces(MediaType.SERVER_SENT_EVENTS) - public void register(@Context SseEventSink eventSink) { - if (recentQuotePriceChangeList.isEmpty()) { - eventSink.send(builder.data(new String("welcome!")).build()); - } else { - eventSink.send(builder.mediaType(MediaType.APPLICATION_JSON_TYPE) - .data(List.class,recentQuotePriceChangeList.recentList()).build()); - } - broadcaster.register(eventSink); - } - - public void eventStreamCdi(@ObservesAsync @Priority(Interceptor.Priority.APPLICATION + 1) @QuotePriceChange String event) { - broadcaster.broadcast(builder.mediaType(MediaType.APPLICATION_JSON_TYPE) - .data(List.class,recentQuotePriceChangeList.recentList()).build()); - - } -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/jaxrs/JAXRSApplication.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/jaxrs/JAXRSApplication.java deleted file mode 100644 index 594f3a52..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/jaxrs/JAXRSApplication.java +++ /dev/null @@ -1,28 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2019. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.jaxrs; - -import javax.ws.rs.ApplicationPath; -import javax.ws.rs.core.Application; - -/** - * - * @author hantsy - */ -@ApplicationPath("/rest") -public class JAXRSApplication extends Application { - -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/jaxrs/QuoteResource.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/jaxrs/QuoteResource.java deleted file mode 100644 index 15a7fe7d..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/jaxrs/QuoteResource.java +++ /dev/null @@ -1,82 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2019. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.jaxrs; - -import com.ibm.websphere.samples.daytrader.entities.QuoteDataBean; -import com.ibm.websphere.samples.daytrader.interfaces.TradeServices; -import com.ibm.websphere.samples.daytrader.util.TradeConfig; -import com.ibm.websphere.samples.daytrader.util.TradeRunTimeModeLiteral; -import java.util.ArrayList; -import java.util.List; -import javax.enterprise.context.RequestScoped; -import javax.enterprise.inject.Any; -import javax.enterprise.inject.Instance; -import javax.inject.Inject; -import javax.ws.rs.Consumes; -import javax.ws.rs.FormParam; -import javax.ws.rs.GET; -import javax.ws.rs.POST; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.core.MediaType; - -@Path("quotes") -@RequestScoped -public class QuoteResource { - - private TradeServices tradeService; - - - public QuoteResource() { - } - - @Inject - public QuoteResource(@Any Instance services) { - tradeService = services.select(new TradeRunTimeModeLiteral(TradeConfig.getRunTimeModeNames()[TradeConfig.getRunTimeMode()])).get(); - } - - @GET - @Produces(MediaType.APPLICATION_JSON) - @Path("/{symbols}") - public List quotesGet(@PathParam("symbols") String symbols) { - return getQuotes(symbols); - } - - @POST - @Consumes({ "application/x-www-form-urlencoded" }) - @Produces(MediaType.APPLICATION_JSON) - public List quotesPost(@FormParam("symbols") String symbols) { - return getQuotes(symbols); - } - - private List getQuotes(String symbols) { - ArrayList quoteDataBeans = new ArrayList(); - - try { - String[] symbolsSplit = symbols.split(","); - for (String symbol: symbolsSplit) { - QuoteDataBean quoteData = tradeService.getQuote(symbol); - quoteDataBeans.add(quoteData); - } - } catch (Exception e) { - e.printStackTrace(); - } - - return (List)quoteDataBeans; - } - -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/mdb/DTBroker3MDB.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/mdb/DTBroker3MDB.java deleted file mode 100644 index 41994c71..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/mdb/DTBroker3MDB.java +++ /dev/null @@ -1,158 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2015. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.mdb; - -import com.ibm.websphere.samples.daytrader.interfaces.Trace; -import com.ibm.websphere.samples.daytrader.interfaces.TradeServices; -import com.ibm.websphere.samples.daytrader.util.Log; -import com.ibm.websphere.samples.daytrader.util.MDBStats; -import com.ibm.websphere.samples.daytrader.util.TimerStat; -import com.ibm.websphere.samples.daytrader.util.TradeConfig; -import com.ibm.websphere.samples.daytrader.util.TradeRunTimeModeLiteral; -import javax.annotation.PostConstruct; -import javax.annotation.Resource; -import javax.ejb.ActivationConfigProperty; -import javax.ejb.MessageDriven; -import javax.ejb.MessageDrivenContext; -import javax.ejb.TransactionAttribute; -import javax.ejb.TransactionAttributeType; -import javax.ejb.TransactionManagement; -import javax.ejb.TransactionManagementType; -import javax.enterprise.inject.Any; -import javax.enterprise.inject.Instance; -import javax.inject.Inject; -import javax.jms.Message; -import javax.jms.MessageListener; -import javax.jms.TextMessage; - -// For Glassfish/Payara - take jms/ off of the destination name - -@TransactionAttribute(TransactionAttributeType.REQUIRED) -@TransactionManagement(TransactionManagementType.CONTAINER) -@MessageDriven(activationConfig = { @ActivationConfigProperty(propertyName = "acknowledgeMode", propertyValue = "Auto-acknowledge"), - @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"), - @ActivationConfigProperty(propertyName = "destination", propertyValue = "jms/TradeBrokerQueue"), - //@ActivationConfigProperty(propertyName = "destination", propertyValue = "TradeBrokerQueue"), - @ActivationConfigProperty(propertyName = "subscriptionDurability", propertyValue = "NonDurable") }) -@Trace -public class DTBroker3MDB implements MessageListener { - private final MDBStats mdbStats; - private int statInterval = 10000; - - @Resource - public MessageDrivenContext mdc; - - @Inject @Any - Instance services; - - private TradeServices trade; - - public DTBroker3MDB() { - - if (statInterval <= 0) { - statInterval = 10000; - } - mdbStats = MDBStats.getInstance(); - } - - @PostConstruct - void boostrapTradeServices() { - trade = services.select(new TradeRunTimeModeLiteral(TradeConfig.getRunTimeModeNames()[TradeConfig.getRunTimeMode()])).get(); - } - - @Override - public void onMessage(Message message) { - try { - - Log.trace("TradeBroker:onMessage -- received message -->" + ((TextMessage) message).getText() + "command-->" - + message.getStringProperty("command") + "<--"); - - if (message.getJMSRedelivered()) { - Log.log("DTBroker3MDB: The following JMS message was redelivered due to a rollback:\n" + ((TextMessage) message).getText()); - // Order has been cancelled -- ignore returned messages - return; - } - String command = message.getStringProperty("command"); - if (command == null) { - Log.debug("DTBroker3MDB:onMessage -- received message with null command. Message-->" + message); - return; - } - if (command.equalsIgnoreCase("neworder")) { - /* Get the Order ID and complete the Order */ - Integer orderID = new Integer(message.getIntProperty("orderID")); - boolean twoPhase = message.getBooleanProperty("twoPhase"); - boolean direct = message.getBooleanProperty("direct"); - long publishTime = message.getLongProperty("publishTime"); - long receiveTime = System.currentTimeMillis(); - - try { - //TODO: why direct? - //trade = getTrade(direct); - - Log.trace("DTBroker3MDB:onMessage - completing order " + orderID + " twoPhase=" + twoPhase + " direct=" + direct); - - trade.completeOrder(orderID, twoPhase); - - TimerStat currentStats = mdbStats.addTiming("DTBroker3MDB:neworder", publishTime, receiveTime); - - if ((currentStats.getCount() % statInterval) == 0) { - Log.log(" DTBroker3MDB: processed " + statInterval + " stock trading orders." + - " Total NewOrders process = " + currentStats.getCount() + - "Time (in seconds):" + - " min: " +currentStats.getMinSecs()+ - " max: " +currentStats.getMaxSecs()+ - " avg: " +currentStats.getAvgSecs()); - } - } catch (Exception e) { - Log.error("DTBroker3MDB:onMessage Exception completing order: " + orderID + "\n", e); - mdc.setRollbackOnly(); - /* - * UPDATE - order is cancelled in trade if an error is - * caught try { trade.cancelOrder(orderID, twoPhase); } - * catch (Exception e2) { Log.error("order cancel failed", - * e); } - */ - } - } else if (command.equalsIgnoreCase("ping")) { - - Log.trace("DTBroker3MDB:onMessage received test command -- message: " + ((TextMessage) message).getText()); - - long publishTime = message.getLongProperty("publishTime"); - long receiveTime = System.currentTimeMillis(); - - TimerStat currentStats = mdbStats.addTiming("DTBroker3MDB:ping", publishTime, receiveTime); - - if ((currentStats.getCount() % statInterval) == 0) { - Log.log(" DTBroker3MDB: received " + statInterval + " ping messages." + - " Total ping message count = " + currentStats.getCount() + - " Time (in seconds):" + - " min: " +currentStats.getMinSecs()+ - " max: " +currentStats.getMaxSecs()+ - " avg: " +currentStats.getAvgSecs()); - } - } else { - Log.error("DTBroker3MDB:onMessage - unknown message request command-->" + command + "<-- message=" + ((TextMessage) message).getText()); - } - } catch (Throwable t) { - // JMS onMessage should handle all exceptions - Log.error("DTBroker3MDB: Error rolling back transaction", t); - mdc.setRollbackOnly(); - } - } - - - -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/mdb/DTStreamer3MDB.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/mdb/DTStreamer3MDB.java deleted file mode 100644 index 2ce649d2..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/mdb/DTStreamer3MDB.java +++ /dev/null @@ -1,121 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2015. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.mdb; - -import com.ibm.websphere.samples.daytrader.interfaces.Trace; -import com.ibm.websphere.samples.daytrader.util.Log; -import com.ibm.websphere.samples.daytrader.util.MDBStats; -import com.ibm.websphere.samples.daytrader.util.TimerStat; -import javax.annotation.Resource; -import javax.ejb.ActivationConfigProperty; -import javax.ejb.MessageDriven; -import javax.ejb.MessageDrivenContext; -import javax.ejb.TransactionAttribute; -import javax.ejb.TransactionAttributeType; -import javax.ejb.TransactionManagement; -import javax.ejb.TransactionManagementType; -import javax.jms.Message; -import javax.jms.MessageListener; -import javax.jms.TextMessage; - -//For Glassfish/Payara - take jms/ off of the destination name - -@TransactionAttribute(TransactionAttributeType.REQUIRED) -@TransactionManagement(TransactionManagementType.CONTAINER) -@MessageDriven(activationConfig = { @ActivationConfigProperty(propertyName = "acknowledgeMode", propertyValue = "Auto-acknowledge"), - @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Topic"), - @ActivationConfigProperty(propertyName = "destination", propertyValue = "jms/TradeStreamerTopic"), - //@ActivationConfigProperty(propertyName = "destination", propertyValue = "TradeStreamerTopic"), - @ActivationConfigProperty(propertyName = "subscriptionDurability", propertyValue = "NonDurable") }) -@Trace -public class DTStreamer3MDB implements MessageListener { - - private final MDBStats mdbStats; - private int statInterval = 10000; - - @Resource - public MessageDrivenContext mdc; - - - /** Creates a new instance of TradeSteamerMDB */ - public DTStreamer3MDB() { - Log.trace("DTStreamer3MDB:DTStreamer3MDB()"); - - if (statInterval <= 0) { - statInterval = 10000; - } - mdbStats = MDBStats.getInstance(); - } - - @Override - public void onMessage(Message message) { - - try { - Log.trace("DTStreamer3MDB:onMessage -- received message -->" + ((TextMessage) message).getText() + "command-->" - + message.getStringProperty("command") + "<--"); - - String command = message.getStringProperty("command"); - if (command == null) { - Log.debug("DTStreamer3MDB:onMessage -- received message with null command. Message-->" + message); - return; - } - if (command.equalsIgnoreCase("updateQuote")) { - Log.trace("DTStreamer3MDB:onMessage -- received message -->" + ((TextMessage) message).getText() + "\n\t symbol = " - + message.getStringProperty("symbol") + "\n\t current price =" + message.getStringProperty("price") + "\n\t old price =" - + message.getStringProperty("oldPrice")); - - long publishTime = message.getLongProperty("publishTime"); - long receiveTime = System.currentTimeMillis(); - - TimerStat currentStats = mdbStats.addTiming("DTStreamer3MDB:udpateQuote", publishTime, receiveTime); - - if ((currentStats.getCount() % statInterval) == 0) { - Log.log(" DTStreamer3MDB: " + statInterval + " prices updated:" + - " Total message count = " + currentStats.getCount() + - " Time (in seconds):" + - " min: " +currentStats.getMinSecs()+ - " max: " +currentStats.getMaxSecs()+ - " avg: " +currentStats.getAvgSecs() ); - } - } else if (command.equalsIgnoreCase("ping")) { - Log.trace("DTStreamer3MDB:onMessage received ping command -- message: " + ((TextMessage) message).getText()); - - - long publishTime = message.getLongProperty("publishTime"); - long receiveTime = System.currentTimeMillis(); - - TimerStat currentStats = mdbStats.addTiming("DTStreamer3MDB:ping", publishTime, receiveTime); - - if ((currentStats.getCount() % statInterval) == 0) { - Log.log(" DTStreamer3MDB: received " + statInterval + " ping messages." + - " Total message count = " + currentStats.getCount() + - " Time (in seconds):" + - " min: " +currentStats.getMinSecs()+ - " max: " +currentStats.getMaxSecs()+ - " avg: " +currentStats.getAvgSecs()); - } - } else { - Log.error("DTStreamer3MDB:onMessage - unknown message request command-->" + command + "<-- message=" + ((TextMessage) message).getText()); - } - } catch (Throwable t) { - // JMS onMessage should handle all exceptions - Log.error("DTStreamer3MDB: Exception", t); - //UPDATE - Not rolling back for now -- so error messages are not redelivered - mdc.setRollbackOnly(); - } - } - -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/util/Diagnostics.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/util/Diagnostics.java deleted file mode 100644 index 7f04a48b..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/util/Diagnostics.java +++ /dev/null @@ -1,77 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2022. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.util; - -import java.util.concurrent.ArrayBlockingQueue; - -public class Diagnostics { - private static final int DRIVE_MEMORY = Integer.getInteger("DRIVE_MEMORY", 0); - private static final int DRIVE_LATENCY = Integer.getInteger("DRIVE_LATENCY", 0); - private static final int DRIVE_MEMACCUMULATION = Integer.getInteger("DRIVE_MEMACCUMULATION", 0); - private static final ArrayBlockingQueue accumulation; - - static { - if (DRIVE_MEMORY > 0) { - Log.warning("DRIVE_MEMORY=" + DRIVE_MEMORY - + " has been specified which will allocate that many bytes on some app requests"); - } - if (DRIVE_MEMACCUMULATION > 0) { - Log.warning("DRIVE_MEMACCUMULATION=" + DRIVE_MEMACCUMULATION - + " has been specified which will accumulate up to " + (DRIVE_MEMORY * DRIVE_MEMACCUMULATION) - + " bytes"); - accumulation = new ArrayBlockingQueue(DRIVE_MEMACCUMULATION); - } else { - accumulation = null; - } - if (DRIVE_LATENCY > 0) { - Log.warning("DRIVE_LATENCY=" + DRIVE_LATENCY - + " has been specified which will sleep that many milliseconds on some app requests"); - } - } - - public static void checkDiagnostics() { - if (DRIVE_MEMORY > 0) { - byte[] memory = new byte[DRIVE_MEMORY]; - // Not sure if Java will optimize this away if we don't use it, so just - // do something trivial - int count = 0; - for (byte b : memory) { - if ((b & 0x01) > 0) { - count++; - } - } - if (count > 0) { - Log.error("Something that shouldn't happen"); - } - if (DRIVE_MEMACCUMULATION > 0) { - synchronized (accumulation) { - if (accumulation.size() >= DRIVE_MEMACCUMULATION) { - accumulation.remove(); - } - accumulation.add(memory); - } - } - } - - if (DRIVE_LATENCY > 0) { - try { - Thread.sleep(DRIVE_LATENCY); - } catch (InterruptedException e) { - e.printStackTrace(); - } - } - } -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/util/FinancialUtils.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/util/FinancialUtils.java deleted file mode 100644 index 311a9e73..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/util/FinancialUtils.java +++ /dev/null @@ -1,104 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2015. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.util; - -import com.ibm.websphere.samples.daytrader.entities.HoldingDataBean; -import java.math.BigDecimal; -import java.util.Collection; -import java.util.Iterator; - -public class FinancialUtils { - - public static final int ROUND = BigDecimal.ROUND_HALF_UP; - public static final int SCALE = 2; - public static final BigDecimal ZERO = (new BigDecimal(0.00)).setScale(SCALE); - public static final BigDecimal ONE = (new BigDecimal(1.00)).setScale(SCALE); - public static final BigDecimal HUNDRED = (new BigDecimal(100.00)).setScale(SCALE); - - public static BigDecimal computeGain(BigDecimal currentBalance, BigDecimal openBalance) { - return currentBalance.subtract(openBalance).setScale(SCALE); - } - - public static BigDecimal computeGainPercent(BigDecimal currentBalance, BigDecimal openBalance) { - if (openBalance.doubleValue() == 0.0) { - return ZERO; - } - BigDecimal gainPercent = currentBalance.divide(openBalance, ROUND).subtract(ONE).multiply(HUNDRED); - return gainPercent; - } - - public static BigDecimal computeHoldingsTotal(Collection holdingDataBeans) { - BigDecimal holdingsTotal = new BigDecimal(0.0).setScale(SCALE); - if (holdingDataBeans == null) { - return holdingsTotal; - } - Iterator it = holdingDataBeans.iterator(); - while (it.hasNext()) { - HoldingDataBean holdingData = (HoldingDataBean) it.next(); - BigDecimal total = holdingData.getPurchasePrice().multiply(new BigDecimal(holdingData.getQuantity())); - holdingsTotal = holdingsTotal.add(total); - } - return holdingsTotal.setScale(SCALE); - } - - public static String printGainHTML(BigDecimal gain) { - String htmlString, arrow; - if (gain.doubleValue() < 0.0) { - htmlString = ""; - arrow = "arrowdown.gif"; - } else { - htmlString = ""; - arrow = "arrowup.gif"; - } - - htmlString += gain.setScale(SCALE, ROUND) + ""; - return htmlString; - } - - public static String printChangeHTML(double change) { - String htmlString, arrow; - if (change < 0.0) { - htmlString = ""; - arrow = "arrowdown.gif"; - } else { - htmlString = ""; - arrow = "arrowup.gif"; - } - - htmlString += change + ""; - return htmlString; - } - - public static String printGainPercentHTML(BigDecimal gain) { - String htmlString, arrow; - if (gain.doubleValue() < 0.0) { - htmlString = "("; - arrow = "arrowdown.gif"; - } else { - htmlString = "(+"; - arrow = "arrowup.gif"; - } - - htmlString += gain.setScale(SCALE, ROUND); - htmlString += "%)"; - return htmlString; - } - - public static String printQuoteLink(String symbol) { - return "" + symbol + ""; - } - -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/util/KeyBlock.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/util/KeyBlock.java deleted file mode 100644 index d1539251..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/util/KeyBlock.java +++ /dev/null @@ -1,140 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2015. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.util; - -import java.util.AbstractSequentialList; -import java.util.ListIterator; - -public class KeyBlock extends AbstractSequentialList { - - // min and max provide range of valid primary keys for this KeyBlock - private int min = 0; - private int max = 0; - private int index = 0; - - /** - * Constructor for KeyBlock - */ - public KeyBlock() { - super(); - min = 0; - max = 0; - index = min; - } - - /** - * Constructor for KeyBlock - */ - public KeyBlock(int min, int max) { - super(); - this.min = min; - this.max = max; - index = min; - } - - /** - * @see AbstractCollection#size() - */ - @Override - public int size() { - return (max - min) + 1; - } - - /** - * @see AbstractSequentialList#listIterator(int) - */ - @Override - public ListIterator listIterator(int arg0) { - return new KeyBlockIterator(); - } - - class KeyBlockIterator implements ListIterator { - - /** - * @see ListIterator#hasNext() - */ - @Override - public boolean hasNext() { - return index <= max; - } - - /** - * @see ListIterator#next() - */ - @Override - public synchronized Object next() { - if (index > max) { - throw new java.lang.RuntimeException("KeyBlock:next() -- Error KeyBlock depleted"); - } - return new Integer(index++); - } - - /** - * @see ListIterator#hasPrevious() - */ - @Override - public boolean hasPrevious() { - return index > min; - } - - /** - * @see ListIterator#previous() - */ - @Override - public Object previous() { - return new Integer(--index); - } - - /** - * @see ListIterator#nextIndex() - */ - @Override - public int nextIndex() { - return index - min; - } - - /** - * @see ListIterator#previousIndex() - */ - @Override - public int previousIndex() { - throw new UnsupportedOperationException("KeyBlock: previousIndex() not supported"); - } - - /** - * @see ListIterator#add() - */ - @Override - public void add(Object o) { - throw new UnsupportedOperationException("KeyBlock: add() not supported"); - } - - /** - * @see ListIterator#remove() - */ - @Override - public void remove() { - throw new UnsupportedOperationException("KeyBlock: remove() not supported"); - } - - /** - * @see ListIterator#set(Object) - */ - @Override - public void set(Object arg0) { - } - } -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/util/Log.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/util/Log.java deleted file mode 100644 index efb75d7a..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/util/Log.java +++ /dev/null @@ -1,162 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2015, 2022. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.util; - -import java.util.Collection; -import java.util.Iterator; -import java.util.logging.Level; -import java.util.logging.Logger; - - - -public class Log { - - private final static Logger log = Logger.getLogger("daytrader"); - - - // A general purpose, high performance logging, tracing, statistic service - - public static void log(String message) { - log.log(Level.INFO, message); - } - - public static void log(String msg1, String msg2) { - log(msg1 + msg2); - } - - public static void log(String msg1, String msg2, String msg3) { - log(msg1 + msg2 + msg3); - } - - public static void error(String message) { - message = "Error: " + message; - log.severe(message); - } - - public static void error(String message, Throwable e) { - error(message + "\n\t" + e.toString()); - e.printStackTrace(System.out); - } - - public static void error(String msg1, String msg2, Throwable e) { - error(msg1 + "\n" + msg2 + "\n\t", e); - } - - public static void error(String msg1, String msg2, String msg3, Throwable e) { - error(msg1 + "\n" + msg2 + "\n" + msg3 + "\n\t", e); - } - - public static void error(Throwable e, String message) { - error(message + "\n\t", e); - e.printStackTrace(System.out); - } - - public static void error(Throwable e, String msg1, String msg2) { - error(msg1 + "\n" + msg2 + "\n\t", e); - } - - public static void error(Throwable e, String msg1, String msg2, String msg3) { - error(msg1 + "\n" + msg2 + "\n" + msg3 + "\n\t", e); - } - - public static void trace(String message) { - log.log(Level.FINE, message + " threadID=" + Thread.currentThread()); - } - - public static void traceInterceptor(String message, Object parm1) { - log.log(Level.SEVERE,message,parm1); - } - - public static void trace(String message, Object parm1) { - trace(message + "(" + parm1 + ")"); - } - - public static void trace(String message, Object parm1, Object parm2) { - trace(message + "(" + parm1 + ", " + parm2 + ")"); - } - - public static void trace(String message, Object parm1, Object parm2, Object parm3) { - trace(message + "(" + parm1 + ", " + parm2 + ", " + parm3 + ")"); - } - - public static void trace(String message, Object parm1, Object parm2, Object parm3, Object parm4) { - trace(message + "(" + parm1 + ", " + parm2 + ", " + parm3 + ")" + ", " + parm4); - } - - public static void trace(String message, Object parm1, Object parm2, Object parm3, Object parm4, Object parm5) { - trace(message + "(" + parm1 + ", " + parm2 + ", " + parm3 + ")" + ", " + parm4 + ", " + parm5); - } - - public static void trace(String message, Object parm1, Object parm2, Object parm3, Object parm4, Object parm5, Object parm6) { - trace(message + "(" + parm1 + ", " + parm2 + ", " + parm3 + ")" + ", " + parm4 + ", " + parm5 + ", " + parm6); - } - - public static void trace(String message, Object parm1, Object parm2, Object parm3, Object parm4, Object parm5, Object parm6, Object parm7) { - trace(message + "(" + parm1 + ", " + parm2 + ", " + parm3 + ")" + ", " + parm4 + ", " + parm5 + ", " + parm6 + ", " + parm7); - } - - public static void traceEnter(String message) { - log.log(Level.FINE,"Method enter --" + message); - } - - public static void traceExit(String message) { - log.log(Level.FINE,"Method exit --" + message); - } - - public static void stat(String message) { - log(message); - } - - public static void debug(String message) { - log.log(Level.INFO,message); - } - - public static void print(String message) { - log(message); - } - - public static void printObject(Object o) { - log("\t" + o.toString()); - } - - public static void printCollection(Collection c) { - log("\t---Log.printCollection -- collection size=" + c.size()); - Iterator it = c.iterator(); - - while (it.hasNext()) { - log("\t\t" + it.next().toString()); - } - log("\t---Log.printCollection -- complete"); - } - - public static void printCollection(String message, Collection c) { - log(message); - printCollection(c); - } - - - public static boolean doDebug() { - return true; - } - - public static boolean doTrace() { - return log.isLoggable(Level.FINE); - } - - public static void warning(String message) { - log.log(Level.WARNING, message); - } -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/util/MDBStats.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/util/MDBStats.java deleted file mode 100644 index fc49ba01..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/util/MDBStats.java +++ /dev/null @@ -1,68 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2015. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.util; - -/** - * - * To change this generated comment edit the template variable "typecomment": - * Window>Preferences>Java>Templates. To enable and disable the creation of type - * comments go to Window>Preferences>Java>Code Generation. - */ -public class MDBStats extends java.util.HashMap { - - private static final long serialVersionUID = -3759835921094193760L; - // Singleton class - private static MDBStats mdbStats = null; - - private MDBStats() { - } - - public static synchronized MDBStats getInstance() { - if (mdbStats == null) { - mdbStats = new MDBStats(); - } - return mdbStats; - } - - public TimerStat addTiming(String type, long sendTime, long recvTime) { - TimerStat stats = null; - synchronized (type) { - - stats = get(type); - if (stats == null) { - stats = new TimerStat(); - } - - long time = recvTime - sendTime; - if (time > stats.getMax()) { - stats.setMax(time); - } - if (time < stats.getMin()) { - stats.setMin(time); - } - stats.setCount(stats.getCount() + 1); - stats.setTotalTime(stats.getTotalTime() + time); - - put(type, stats); - } - return stats; - } - - public synchronized void reset() { - clear(); - } - -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/util/RecentQuotePriceChangeList.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/util/RecentQuotePriceChangeList.java deleted file mode 100644 index 23136f8e..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/util/RecentQuotePriceChangeList.java +++ /dev/null @@ -1,75 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2019. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.util; -import com.ibm.websphere.samples.daytrader.entities.QuoteDataBean; -import com.ibm.websphere.samples.daytrader.interfaces.QuotePriceChange; -import java.util.List; -import java.util.concurrent.CopyOnWriteArrayList; -import javax.annotation.Resource; -import javax.enterprise.concurrent.ManagedExecutorService; -import javax.enterprise.context.ApplicationScoped; -import javax.enterprise.event.Event; -import javax.enterprise.event.NotificationOptions; -import javax.inject.Inject; -import javax.validation.constraints.NotEmpty; -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Size; - - -/** This class is a holds the last 5 stock changes, used by the MarketSummary WebSocket - * and the JAX-RS SSE Broadcaster - * It fires a CDI event everytime a price change is added - **/ - -@ApplicationScoped -public class RecentQuotePriceChangeList { - - private List list = new CopyOnWriteArrayList(); - private int maxSize = 5; - - @Resource - private ManagedExecutorService mes; - - @Inject - @QuotePriceChange - Event quotePriceChangeEvent; - - public boolean add(QuoteDataBean quoteData) { - - int symbolNumber = new Integer(quoteData.getSymbol().substring(2)); - - if ( symbolNumber < TradeConfig.getMAX_QUOTES() * TradeConfig.getListQuotePriceChangeFrequency() * 0.01) { - list.add(0, quoteData); - - // Add stock, remove if needed - if(list.size() > maxSize) { - list.remove(maxSize); - } - quotePriceChangeEvent.fireAsync("quotePriceChange for symbol: " + quoteData.getSymbol(), NotificationOptions.builder().setExecutor(mes).build()); - } - return true; - } - - public boolean isEmpty() { - return list.isEmpty(); - } - - @Size(max=5) - @NotEmpty - public List<@NotNull QuoteDataBean> recentList() { - return list; - } -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/util/TimerStat.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/util/TimerStat.java deleted file mode 100644 index c3057b48..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/util/TimerStat.java +++ /dev/null @@ -1,133 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2015. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.util; - -/** - * - * To change this generated comment edit the template variable "typecomment": - * Window>Preferences>Java>Templates. To enable and disable the creation of type - * comments go to Window>Preferences>Java>Code Generation. - */ -public class TimerStat { - - private double min = 1000000000.0, max = 0.0, totalTime = 0.0; - private int count; - - /** - * Returns the count. - * - * @return int - */ - public int getCount() { - return count; - } - - /** - * Returns the max. - * - * @return double - */ - public double getMax() { - return max; - } - - /** - * Returns the min. - * - * @return double - */ - public double getMin() { - return min; - } - - /** - * Sets the count. - * - * @param count - * The count to set - */ - public void setCount(int count) { - this.count = count; - } - - /** - * Sets the max. - * - * @param max - * The max to set - */ - public void setMax(double max) { - this.max = max; - } - - /** - * Sets the min. - * - * @param min - * The min to set - */ - public void setMin(double min) { - this.min = min; - } - - /** - * Returns the totalTime. - * - * @return double - */ - public double getTotalTime() { - return totalTime; - } - - /** - * Sets the totalTime. - * - * @param totalTime - * The totalTime to set - */ - public void setTotalTime(double totalTime) { - this.totalTime = totalTime; - } - - /** - * Returns the max in Secs - * - * @return double - */ - public double getMaxSecs() { - return max / 1000.0; - } - - /** - * Returns the min in Secs - * - * @return double - */ - public double getMinSecs() { - return min / 1000.0; - } - - /** - * Returns the average time in Secs - * - * @return double - */ - public double getAvgSecs() { - - double avg = getTotalTime() / getCount(); - return avg / 1000.0; - } -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/util/TraceInterceptor.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/util/TraceInterceptor.java deleted file mode 100644 index 69d37552..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/util/TraceInterceptor.java +++ /dev/null @@ -1,46 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2019. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.util; - -import com.ibm.websphere.samples.daytrader.interfaces.Trace; -import java.io.Serializable; -import java.text.MessageFormat; -import java.util.Arrays; -import javax.annotation.Priority; -import javax.interceptor.AroundInvoke; -import javax.interceptor.Interceptor; -import javax.interceptor.InvocationContext; - - -@Trace -@Interceptor -@Priority(Interceptor.Priority.APPLICATION) -public class TraceInterceptor implements Serializable { - - private static final long serialVersionUID = -4195975993998268072L; - private static final MessageFormat form = new MessageFormat("Method enter -- {0} called with {1}"); - - @AroundInvoke - public Object logMethodEntry(InvocationContext ctx) throws Exception { - Log.trace(form.format( - new String[]{ - ctx.getMethod().getDeclaringClass().getSimpleName() + ":"+ ctx.getMethod().getName(), - Arrays.deepToString(ctx.getParameters()) - })); - - return ctx.proceed(); - } -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/util/TradeConfig.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/util/TradeConfig.java deleted file mode 100644 index b4fe5821..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/util/TradeConfig.java +++ /dev/null @@ -1,752 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2015. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.util; - -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.Random; - -/** - * TradeConfig is a JavaBean holding all configuration and runtime parameters - * for the Trade application TradeConfig sets runtime parameters such as the - * RunTimeMode (EJB, JDBC, EJB_ALT) - * - */ - -public class TradeConfig { - - /* Trade Runtime Configuration Parameters */ - - /* Trade Runtime Mode parameters */ - private static String[] runTimeModeNames = { "Full EJB3", "Direct (JDBC)", "Session to Direct"}; - public static final int EJB3 = 0; - public static final int DIRECT = 1; - public static final int SESSION_TO_DIRECT = 2; - private static int runTimeMode = EJB3; - - private static String[] orderProcessingModeNames = { "Sync", "Async","Async_2-Phase" }; - public static final int SYNCH = 0; - public static final int ASYNCH = 1; - public static final int ASYNCH_2PHASE = 2; - private static int orderProcessingMode = SYNCH; - - private static String[] accessModeNames = { "Standard", "WebServices" }; - public static final int STANDARD = 0; - private static int accessMode = STANDARD; - - /* Trade Web Interface parameters */ - private static String[] webInterfaceNames = { "JSP", "JSP-Images", "JSP-Images-Http2" }; - public static final int JSP = 0; - public static final int JSP_Images = 1; - public static final int JSP_Images_HTTP2 = 2; - private static int webInterface = JSP; - - /* Trade Database Scaling parameters */ - private static int MAX_USERS = 15000; - private static int MAX_QUOTES = 10000; - - - /* Trade XA Datasource specific parameters */ - public static boolean JDBCDriverNeedsGlobalTransation = false; - - /* Trade Config Miscellaneous itmes */ - public static String DATASOURCE = "java:comp/env/jdbc/TradeDataSource"; - public static int KEYBLOCKSIZE = 1000; - public static int QUOTES_PER_PAGE = 10; - public static boolean RND_USER = true; - // public static int RND_SEED = 0; - private static int MAX_HOLDINGS = 10; - private static int count = 0; - private static Object userID_count_semaphore = new Object(); - private static int userID_count = 0; - private static String hostName = null; - private static Random r0 = new Random(System.currentTimeMillis()); - // private static Random r1 = new Random(RND_SEED); - private static Random randomNumberGenerator = r0; - public static final String newUserPrefix = "ru:"; - public static final int verifyPercent = 5; - private static boolean updateQuotePrices = true; - private static int primIterations = 1; - private static boolean longRun = true; - private static boolean publishQuotePriceChange = true; - private static int listQuotePriceChangeFrequency = 100; - private static boolean displayOrderAlerts = true; - - /** - * -1 means every operation 0 means never perform a market summary > 0 means - * number of seconds between summaries. These will be synchronized so only - * one transaction in this period will create a summary and will cache its - * results. - */ - private static int marketSummaryInterval = 20; - - /* - * Penny stocks is a problem where the random price change factor gets a - * stock down to $.01. In this case trade jumpstarts the price back to $6.00 - * to keep the math interesting. - */ - public static BigDecimal PENNY_STOCK_PRICE; - public static BigDecimal PENNY_STOCK_RECOVERY_MIRACLE_MULTIPLIER; - static { - PENNY_STOCK_PRICE = new BigDecimal(0.01); - PENNY_STOCK_PRICE = PENNY_STOCK_PRICE.setScale(2, BigDecimal.ROUND_HALF_UP); - PENNY_STOCK_RECOVERY_MIRACLE_MULTIPLIER = new BigDecimal(600.0); - PENNY_STOCK_RECOVERY_MIRACLE_MULTIPLIER.setScale(2, BigDecimal.ROUND_HALF_UP); - } - - /* - * CJB (DAYTRADER-25) - Also need to impose a ceiling on the quote price to - * ensure prevent account and holding balances from exceeding the databases - * decimal precision. At some point, this maximum value can be used to - * trigger a stock split. - */ - - public static BigDecimal MAXIMUM_STOCK_PRICE; - public static BigDecimal MAXIMUM_STOCK_SPLIT_MULTIPLIER; - static { - MAXIMUM_STOCK_PRICE = new BigDecimal(400); - MAXIMUM_STOCK_PRICE.setScale(2, BigDecimal.ROUND_HALF_UP); - MAXIMUM_STOCK_SPLIT_MULTIPLIER = new BigDecimal(0.5); - MAXIMUM_STOCK_SPLIT_MULTIPLIER.setScale(2, BigDecimal.ROUND_HALF_UP); - } - - /* - * Trade Scenario actions mixes. Each of the array rows represents a - * specific Trade Scenario Mix. The columns give the percentages for each - * action in the column header. Note: "login" is always 0. logout represents - * both login and logout (because each logout operation will cause a new - * login when the user context attempts the next action. - */ - /* Trade Scenario Workload parameters */ - public static final int HOME_OP = 0; - public static final int QUOTE_OP = 1; - public static final int LOGIN_OP = 2; - public static final int LOGOUT_OP = 3; - public static final int REGISTER_OP = 4; - public static final int ACCOUNT_OP = 5; - public static final int PORTFOLIO_OP = 6; - public static final int BUY_OP = 7; - public static final int SELL_OP = 8; - public static final int UPDATEACCOUNT_OP = 9; - - private static int[][] scenarioMixes = { - // h q l o r a p b s u - { 20, 40, 0, 4, 2, 10, 12, 4, 4, 4 }, // STANDARD - { 20, 40, 0, 4, 2, 7, 7, 7, 7, 6 }, // High Volume - }; - private static char[] actions = { 'h', 'q', 'l', 'o', 'r', 'a', 'p', 'b', 's', 'u' }; - private static int sellDeficit = 0; - // Tracks the number of buys over sell when a users portfolio is empty - // Used to maintain the correct ratio of buys/sells - - /* JSP pages for all Trade Actions */ - - public static final int WELCOME_PAGE = 0; - public static final int REGISTER_PAGE = 1; - public static final int PORTFOLIO_PAGE = 2; - public static final int QUOTE_PAGE = 3; - public static final int HOME_PAGE = 4; - public static final int ACCOUNT_PAGE = 5; - public static final int ORDER_PAGE = 6; - public static final int CONFIG_PAGE = 7; - public static final int STATS_PAGE = 8; - public static final int MARKET_SUMMARY_PAGE = 9; - - // FUTURE Add XML/XSL View - public static String[][] webUI = { - { "/welcome.jsp", "/register.jsp", "/portfolio.jsp", "/quote.jsp", "/tradehome.jsp", "/account.jsp", "/order.jsp", "/config.jsp", "/runStats.jsp", - "/marketSummary.jsp" }, - // JSP Interface - { "/welcomeImg.jsp", "/registerImg.jsp", "/portfolioImg.jsp", "/quoteImg.jsp", "/tradehomeImg.jsp", "/accountImg.jsp", "/orderImg.jsp", - "/config.jsp", "/runStats.jsp", "/marketSummary.jsp" }, - // JSP Interface - { "/welcomeImg.jsp", "/registerImg.jsp", "/portfolioImg.jsp", "/quoteImg.jsp", "/tradehomeImg.jsp", "/accountImg.jsp", "/orderImg.jsp", - "/config.jsp", "/runStats.jsp", "/marketSummary.jsp" }, - }; - - - /** - * Return the hostname for this system Creation date: (2/16/2000 9:02:25 PM) - */ - - private static String getHostname() { - try { - if (hostName == null) { - hostName = java.net.InetAddress.getLocalHost().getHostName(); - // Strip of fully qualifed domain if necessary - try { - hostName = hostName.substring(0, hostName.indexOf('.')); - } catch (Exception e) { - } - } - } catch (Exception e) { - Log.error("Exception getting local host name using 'localhost' - ", e); - hostName = "localhost"; - } - return hostName; - } - - /** - * Return a Trade UI Web page based on the current configuration This may - * return a JSP page or a Servlet page Creation date: (3/14/2000 9:08:34 PM) - */ - - public static String getPage(int pageNumber) { - return webUI[webInterface][pageNumber]; - } - - /** - * Return the list of run time mode names Creation date: (3/8/2000 5:58:34 - * PM) - * - * @return java.lang.String[] - */ - public static java.lang.String[] getRunTimeModeNames() { - return runTimeModeNames; - } - - private static int scenarioCount = 0; - - /** - * Return a Trade Scenario Operation based on the setting of the current mix - * (TradeScenarioMix) Creation date: (2/10/2000 9:08:34 PM) - */ - - public static char getScenarioAction(boolean newUser) { - int r = rndInt(100); // 0 to 99 = 100 - int i = 0; - int sum = scenarioMixes[0][i]; - while (sum <= r) { - i++; - sum += scenarioMixes[0][i]; - } - - incrementScenarioCount(); - - /* - * In TradeScenarioServlet, if a sell action is selected, but the users - * portfolio is empty, a buy is executed instead and sellDefecit is - * incremented. This allows the number of buy/sell operations to stay in - * sync w/ the given Trade mix. - */ - - if ((!newUser) && (actions[i] == 'b')) { - synchronized (TradeConfig.class) { - if (sellDeficit > 0) { - sellDeficit--; - return 's'; - // Special case for TradeScenarioServlet to note this is a - // buy switched to a sell to fix sellDeficit - } - } - } - - return actions[i]; - } - - public static String getUserID() { - String userID; - if (RND_USER) { - userID = rndUserID(); - } else { - userID = nextUserID(); - } - return userID; - } - - private static final BigDecimal orderFee = new BigDecimal("24.95"); - private static final BigDecimal cashFee = new BigDecimal("0.0"); - - public static BigDecimal getOrderFee(String orderType) { - if ((orderType.compareToIgnoreCase("BUY") == 0) || (orderType.compareToIgnoreCase("SELL") == 0)) { - return orderFee; - } - - return cashFee; - - } - - /** - * Increment the sell deficit counter Creation date: (6/21/2000 11:33:45 AM) - */ - public static synchronized void incrementSellDeficit() { - sellDeficit++; - } - - public static String nextUserID() { - String userID; - synchronized (userID_count_semaphore) { - userID = "uid:" + userID_count; - userID_count++; - if (userID_count % MAX_USERS == 0) { - userID_count = 0; - } - } - return userID; - } - - public static double random() { - return randomNumberGenerator.nextDouble(); - } - - public static String rndAddress() { - return rndInt(1000) + " Oak St."; - } - - public static String rndBalance() { - // Give all new users a cool mill in which to trade - return "1000000"; - } - - public static String rndCreditCard() { - return rndInt(100) + "-" + rndInt(1000) + "-" + rndInt(1000) + "-" + rndInt(1000); - } - - public static String rndEmail(String userID) { - return userID.replace(":", "") + "@" + rndInt(100) + ".com"; - } - - public static String rndFullName() { - return "first:" + rndInt(1000) + " last:" + rndInt(5000); - } - - public static int rndInt(int i) { - return (new Float(random() * i)).intValue(); - } - - public static float rndFloat(int i) { - return (new Float(random() * i)).floatValue(); - } - - public static BigDecimal rndBigDecimal(float f) { - return (new BigDecimal(random() * f)).setScale(2, BigDecimal.ROUND_HALF_UP); - } - - public static boolean rndBoolean() { - return randomNumberGenerator.nextBoolean(); - } - - /** - * Returns a new Trade user Creation date: (2/16/2000 8:50:35 PM) - */ - public static synchronized String rndNewUserID() { - - return newUserPrefix + getHostname() + System.currentTimeMillis() + count++; - } - - public static float rndPrice() { - return ((new Integer(rndInt(200))).floatValue()) + 1.0f; - } - - private static final BigDecimal ONE = new BigDecimal(1.0); - - public static BigDecimal getRandomPriceChangeFactor() { - // CJB (DAYTRADER-25) - Vary change factor between 1.1 and 0.9 - double percentGain = rndFloat(1) * 0.1; - if (random() < .5) { - percentGain *= -1; - } - percentGain += 1; - - // change factor is between +/- 20% - BigDecimal percentGainBD = (new BigDecimal(percentGain)).setScale(2, BigDecimal.ROUND_HALF_UP); - if (percentGainBD.doubleValue() <= 0.0) { - percentGainBD = ONE; - } - - return percentGainBD; - } - - public static float rndQuantity() { - return ((new Integer(rndInt(200))).floatValue()) + 1.0f; - } - - public static String rndSymbol() { - return "s:" + rndInt(MAX_QUOTES - 1); - } - - public static String rndSymbols() { - - String symbols = ""; - int num_symbols = rndInt(QUOTES_PER_PAGE); - - for (int i = 0; i <= num_symbols; i++) { - symbols += "s:" + rndInt(MAX_QUOTES - 1); - if (i < num_symbols) { - symbols += ","; - } - } - return symbols; - } - - public static String rndUserID() { - String nextUser = getNextUserIDFromDeck(); - - Log.trace("TradeConfig:rndUserID -- new trader = " + nextUser); - - - return nextUser; - } - - private static synchronized String getNextUserIDFromDeck() { - int numUsers = getMAX_USERS(); - if (deck == null) { - deck = new ArrayList(numUsers); - for (int i = 0; i < numUsers; i++) { - deck.add(i, new Integer(i)); - } - java.util.Collections.shuffle(deck, r0); - } - if (card >= numUsers) { - card = 0; - } - return "uid:" + deck.get(card++); - - } - - // Trade implements a card deck approach to selecting - // users for trading with tradescenarioservlet - private static ArrayList deck = null; - private static int card = 0; - - /** - * This is a convenience method for servlets to set Trade configuration - * parameters from servlet initialization parameters. The servlet provides - * the init param and its value as strings. This method then parses the - * parameter, converts the value to the correct type and sets the - * corresponding TradeConfig parameter to the converted value - * - */ - public static void setConfigParam(String parm, String value) { - Log.log("TradeConfig setting parameter: " + parm + "=" + value); - // Compare the parm value to valid TradeConfig parameters that can be - // set - // by servlet initialization - - // First check the proposed new parm and value - if empty or null ignore - // it - if (parm == null) { - return; - } - parm = parm.trim(); - if (parm.length() <= 0) { - return; - } - if (value == null) { - return; - } - value = value.trim(); - - if (parm.equalsIgnoreCase("orderProcessingMode")) { - try { - for (int i = 0; i < orderProcessingModeNames.length; i++) { - if (value.equalsIgnoreCase(orderProcessingModeNames[i])) { - orderProcessingMode = i; - break; - } - } - } catch (Exception e) { - Log.error("TradeConfig.setConfigParm(..): minor exception caught" + "trying to set orderProcessingMode to " + value - + "reverting to current value: " + orderProcessingModeNames[orderProcessingMode], e); - } // If the value is bad, simply revert to current - } else if (parm.equalsIgnoreCase("accessMode")) { - try { - for (int i = 0; i < accessModeNames.length; i++) { - if (value.equalsIgnoreCase(accessModeNames[i])) { - accessMode = i; - break; - } - } - } catch (Exception e) { - Log.error("TradeConfig.setConfigParm(..): minor exception caught" + "trying to set accessMode to " + value + "reverting to current value: " - + accessModeNames[accessMode], e); - } - } else if (parm.equalsIgnoreCase("WebInterface")) { - try { - for (int i = 0; i < webInterfaceNames.length; i++) { - if (value.equalsIgnoreCase(webInterfaceNames[i])) { - webInterface = i; - break; - } - } - } catch (Exception e) { - Log.error("TradeConfig.setConfigParm(..): minor exception caught" + "trying to set WebInterface to " + value + "reverting to current value: " - + webInterfaceNames[webInterface], e); - - } // If the value is bad, simply revert to current - } else if (parm.equalsIgnoreCase("maxUsers")) { - try { - MAX_USERS = Integer.parseInt(value); - } catch (Exception e) { - Log.error("TradeConfig.setConfigParm(..): minor exception caught" + "Setting maxusers, error parsing string to int:" + value - + "revering to current value: " + MAX_USERS, e); - } // On error, revert to saved - } else if (parm.equalsIgnoreCase("maxQuotes")) { - try { - MAX_QUOTES = Integer.parseInt(value); - } catch (Exception e) { - // >>rjm - Log.error("TradeConfig.setConfigParm(...) minor exception caught" + "Setting max_quotes, error parsing string to int " + value - + "reverting to current value: " + MAX_QUOTES, e); - // < implements RuntimeMode { - - private static final long serialVersionUID = -252789556335033400L; - private String value; - public TradeRunTimeModeLiteral(String value) { - this.value = value; - } - - @Override - public String value() { - return value; - } - -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/jsf/AccountDataJSF.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/jsf/AccountDataJSF.java deleted file mode 100644 index e22849b4..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/jsf/AccountDataJSF.java +++ /dev/null @@ -1,325 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2015. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.web.jsf; - -import com.ibm.websphere.samples.daytrader.entities.AccountDataBean; -import com.ibm.websphere.samples.daytrader.entities.HoldingDataBean; -import com.ibm.websphere.samples.daytrader.entities.OrderDataBean; -import com.ibm.websphere.samples.daytrader.interfaces.Trace; -import com.ibm.websphere.samples.daytrader.interfaces.TradeServices; -import com.ibm.websphere.samples.daytrader.util.FinancialUtils; -import com.ibm.websphere.samples.daytrader.util.TradeConfig; -import com.ibm.websphere.samples.daytrader.util.TradeRunTimeModeLiteral; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Date; -import java.util.Iterator; -import javax.annotation.PostConstruct; -import javax.enterprise.context.RequestScoped; -import javax.enterprise.inject.Any; -import javax.enterprise.inject.Instance; -import javax.faces.context.ExternalContext; -import javax.inject.Inject; -import javax.inject.Named; -import javax.servlet.http.HttpSession; -import javax.validation.constraints.PastOrPresent; -import javax.validation.constraints.PositiveOrZero; - -@Named("accountdata") -@RequestScoped -@Trace -public class AccountDataJSF { - - @Inject - private ExternalContext context; - - private TradeServices tradeAction; - - private Date sessionCreationDate; - private Date currentTime; - private String profileID; - private Integer accountID; - - @PastOrPresent - private Date creationDate; - - @PositiveOrZero - private int loginCount; - - @PastOrPresent - private Date lastLogin; - - @PositiveOrZero - private int logoutCount; - private BigDecimal balance; - private BigDecimal openBalance; - private Integer numberHoldings; - private BigDecimal holdingsTotal; - private BigDecimal sumOfCashHoldings; - private BigDecimal gain; - private BigDecimal gainPercent; - - private OrderData[] closedOrders; - private OrderData[] allOrders; - - private Integer numberOfOrders = 0; - private Integer numberOfOrderRows = 5; - - public void toggleShowAllRows() { - setNumberOfOrderRows(0); - } - - @Inject - public AccountDataJSF(@Any Instance services) { - tradeAction = services.select(new TradeRunTimeModeLiteral(TradeConfig.getRunTimeModeNames()[TradeConfig.getRunTimeMode()])).get(); - } - - @PostConstruct - public void home() { - try { - HttpSession session = (HttpSession) context.getSession(true); - - // Get the data and then parse - String userID = (String) session.getAttribute("uidBean"); - AccountDataBean accountData = tradeAction.getAccountData(userID); - Collection holdingDataBeans = tradeAction.getHoldings(userID); - - if (TradeConfig.getDisplayOrderAlerts()) { - - Collection closedOrders = tradeAction.getClosedOrders(userID); - - if (closedOrders != null && closedOrders.size() > 0) { - session.setAttribute("closedOrders", closedOrders); - OrderData[] orderjsfs = new OrderData[closedOrders.size()]; - Iterator it = closedOrders.iterator(); - int i = 0; - - while (it.hasNext()) { - OrderDataBean order = (OrderDataBean) it.next(); - OrderData r = new OrderData(order.getOrderID(), order.getOrderStatus(), order.getOpenDate(), order.getCompletionDate(), - order.getOrderFee(), order.getOrderType(), order.getQuantity(), order.getSymbol()); - orderjsfs[i] = r; - i++; - } - - setClosedOrders(orderjsfs); - } - } - - Collection orderDataBeans = (TradeConfig.getLongRun() ? new ArrayList() : (Collection) tradeAction.getOrders(userID)); - - if (orderDataBeans != null && orderDataBeans.size() > 0) { - session.setAttribute("orderDataBeans", orderDataBeans); - OrderData[] orderjsfs = new OrderData[orderDataBeans.size()]; - Iterator it = orderDataBeans.iterator(); - int i = 0; - - while (it.hasNext()) { - OrderDataBean order = (OrderDataBean) it.next(); - OrderData r = new OrderData(order.getOrderID(), order.getOrderStatus(), order.getOpenDate(), order.getCompletionDate(), - order.getOrderFee(), order.getOrderType(), order.getQuantity(), order.getSymbol(),order.getPrice()); - orderjsfs[i] = r; - i++; - } - setNumberOfOrders(orderDataBeans.size()); - setAllOrders(orderjsfs); - } - - setSessionCreationDate((Date) session.getAttribute("sessionCreationDate")); - setCurrentTime(new java.util.Date()); - doAccountData(accountData, holdingDataBeans); - } catch (Exception e) { - e.printStackTrace(); - } - } - - private void doAccountData(AccountDataBean accountData, Collection holdingDataBeans) { - setProfileID(accountData.getProfileID()); - setAccountID(accountData.getAccountID()); - setCreationDate(accountData.getCreationDate()); - setLoginCount(accountData.getLoginCount()); - setLogoutCount(accountData.getLogoutCount()); - setLastLogin(accountData.getLastLogin()); - setOpenBalance(accountData.getOpenBalance()); - setBalance(accountData.getBalance()); - setNumberHoldings(holdingDataBeans.size()); - setHoldingsTotal(FinancialUtils.computeHoldingsTotal(holdingDataBeans)); - setSumOfCashHoldings(balance.add(holdingsTotal)); - setGain(FinancialUtils.computeGain(sumOfCashHoldings, openBalance)); - setGainPercent(FinancialUtils.computeGainPercent(sumOfCashHoldings, openBalance)); - } - - public Date getSessionCreationDate() { - return sessionCreationDate; - } - - public void setSessionCreationDate(Date sessionCreationDate) { - this.sessionCreationDate = sessionCreationDate; - } - - public Date getCurrentTime() { - return currentTime; - } - - public void setCurrentTime(Date currentTime) { - this.currentTime = currentTime; - } - - public String getProfileID() { - return profileID; - } - - public void setProfileID(String profileID) { - this.profileID = profileID; - } - - public void setAccountID(Integer accountID) { - this.accountID = accountID; - } - - public Integer getAccountID() { - return accountID; - } - - public void setCreationDate(Date creationDate) { - this.creationDate = creationDate; - } - - public Date getCreationDate() { - return creationDate; - } - - public void setLoginCount(int loginCount) { - this.loginCount = loginCount; - } - - public int getLoginCount() { - return loginCount; - } - - public void setBalance(BigDecimal balance) { - this.balance = balance; - } - - public BigDecimal getBalance() { - return balance; - } - - public void setOpenBalance(BigDecimal openBalance) { - this.openBalance = openBalance; - } - - public BigDecimal getOpenBalance() { - return openBalance; - } - - public void setHoldingsTotal(BigDecimal holdingsTotal) { - this.holdingsTotal = holdingsTotal; - } - - public BigDecimal getHoldingsTotal() { - return holdingsTotal; - } - - public void setSumOfCashHoldings(BigDecimal sumOfCashHoldings) { - this.sumOfCashHoldings = sumOfCashHoldings; - } - - public BigDecimal getSumOfCashHoldings() { - return sumOfCashHoldings; - } - - public void setGain(BigDecimal gain) { - this.gain = gain; - } - - public BigDecimal getGain() { - return gain; - } - - public void setGainPercent(BigDecimal gainPercent) { - this.gainPercent = gainPercent.setScale(2); - } - - public BigDecimal getGainPercent() { - return gainPercent; - } - - public void setNumberHoldings(Integer numberHoldings) { - this.numberHoldings = numberHoldings; - } - - public Integer getNumberHoldings() { - return numberHoldings; - } - - public OrderData[] getClosedOrders() { - return closedOrders; - } - - public void setClosedOrders(OrderData[] closedOrders) { - this.closedOrders = closedOrders; - } - - public void setLastLogin(Date lastLogin) { - this.lastLogin = lastLogin; - } - - public Date getLastLogin() { - return lastLogin; - } - - public void setLogoutCount(int logoutCount) { - this.logoutCount = logoutCount; - } - - public int getLogoutCount() { - return logoutCount; - } - - public void setAllOrders(OrderData[] allOrders) { - this.allOrders = allOrders; - } - - public OrderData[] getAllOrders() { - return allOrders; - } - - public String getGainHTML() { - return FinancialUtils.printGainHTML(gain); - } - - public String getGainPercentHTML() { - return FinancialUtils.printGainPercentHTML(gainPercent); - } - - public Integer getNumberOfOrderRows() { - return numberOfOrderRows; - } - - public void setNumberOfOrderRows(Integer numberOfOrderRows) { - this.numberOfOrderRows = numberOfOrderRows; - } - - public Integer getNumberOfOrders() { - return numberOfOrders; - } - - public void setNumberOfOrders(Integer numberOfOrders) { - this.numberOfOrders = numberOfOrders; - } -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/jsf/HoldingData.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/jsf/HoldingData.java deleted file mode 100644 index f97dcd3c..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/jsf/HoldingData.java +++ /dev/null @@ -1,116 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2015. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.web.jsf; - -import com.ibm.websphere.samples.daytrader.util.FinancialUtils; -import java.io.Serializable; -import java.math.BigDecimal; -import java.util.Date; -import javax.enterprise.context.RequestScoped; -import javax.inject.Named; - -@Named -@RequestScoped -public class HoldingData implements Serializable { - - private static final long serialVersionUID = -4760036695773749721L; - - private Integer holdingID; - private double quantity; - private BigDecimal purchasePrice; - private Date purchaseDate; - private String quoteID; - private BigDecimal price; - private BigDecimal basis; - private BigDecimal marketValue; - private BigDecimal gain; - - public void setHoldingID(Integer holdingID) { - this.holdingID = holdingID; - } - - public Integer getHoldingID() { - return holdingID; - } - - public void setQuantity(double quantity) { - this.quantity = quantity; - } - - public double getQuantity() { - return quantity; - } - - public void setPurchasePrice(BigDecimal purchasePrice) { - this.purchasePrice = purchasePrice; - } - - public BigDecimal getPurchasePrice() { - return purchasePrice; - } - - public void setPurchaseDate(Date purchaseDate) { - this.purchaseDate = purchaseDate; - } - - public Date getPurchaseDate() { - return purchaseDate; - } - - public void setQuoteID(String quoteID) { - this.quoteID = quoteID; - } - - public String getQuoteID() { - return quoteID; - } - - public void setPrice(BigDecimal price) { - this.price = price; - } - - public BigDecimal getPrice() { - return price; - } - - public void setBasis(BigDecimal basis) { - this.basis = basis; - } - - public BigDecimal getBasis() { - return basis; - } - - public void setMarketValue(BigDecimal marketValue) { - this.marketValue = marketValue; - } - - public BigDecimal getMarketValue() { - return marketValue; - } - - public void setGain(BigDecimal gain) { - this.gain = gain; - } - - public BigDecimal getGain() { - return gain; - } - - public String getGainHTML() { - return FinancialUtils.printGainHTML(gain); - } -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/jsf/JSFLoginFilter.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/jsf/JSFLoginFilter.java deleted file mode 100644 index 9d8c4b0a..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/jsf/JSFLoginFilter.java +++ /dev/null @@ -1,86 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2015. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.web.jsf; - -import java.io.IOException; -import javax.servlet.Filter; -import javax.servlet.FilterChain; -import javax.servlet.FilterConfig; -import javax.servlet.ServletException; -import javax.servlet.ServletRequest; -import javax.servlet.ServletResponse; -import javax.servlet.annotation.WebFilter; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; - -@WebFilter(filterName = "JSFLoginFilter", urlPatterns = "*.faces") -public class JSFLoginFilter implements Filter { - - public JSFLoginFilter() { - super(); - } - - /** - * @see Filter#init(FilterConfig) - */ - private FilterConfig filterConfig = null; - - @Override - public void init(FilterConfig filterConfig) throws ServletException { - this.filterConfig = filterConfig; - } - - /** - * @see Filter#doFilter(ServletRequest, ServletResponse, FilterChain) - */ - @Override - public void doFilter(ServletRequest req, ServletResponse resp, FilterChain chain) throws IOException, ServletException { - if (filterConfig == null) { - return; - } - - HttpServletRequest request = (HttpServletRequest) req; - HttpServletResponse response = (HttpServletResponse) resp; - - HttpSession session = request.getSession(); - String userID = (String) session.getAttribute("uidBean"); - - // If user has not logged in and is trying access account information, - // redirect to login page. - if (userID == null) { - String url = request.getServletPath(); - - if (url.contains("home") || url.contains("account") || url.contains("portfolio") || url.contains("quote") || url.contains("order") - || url.contains("marketSummary")) { - System.out.println("JSF service error: User Not Logged in"); - response.sendRedirect("welcome.faces"); - return; - } - } - - chain.doFilter(req, resp/* wrapper */); - } - - /** - * @see Filter#destroy() - */ - @Override - public void destroy() { - this.filterConfig = null; - } - -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/jsf/LoginValidator.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/jsf/LoginValidator.java deleted file mode 100644 index 1eb05692..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/jsf/LoginValidator.java +++ /dev/null @@ -1,53 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2015. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.web.jsf; - -import com.ibm.websphere.samples.daytrader.util.Log; -import java.util.regex.Matcher; -import java.util.regex.Pattern; -import javax.faces.application.FacesMessage; -import javax.faces.component.UIComponent; -import javax.faces.context.FacesContext; -import javax.faces.validator.FacesValidator; -import javax.faces.validator.Validator; -import javax.faces.validator.ValidatorException; - -@SuppressWarnings("rawtypes") -@FacesValidator("loginValidator") -public class LoginValidator implements Validator{ - - static String loginRegex = "uid:\\d+"; - static Pattern pattern = Pattern.compile(loginRegex); - static Matcher matcher; - - // Simple JSF validator to make sure username starts with uid: and at least 1 number. - public LoginValidator() { - } - - @Override - public void validate(FacesContext context, UIComponent component, Object value) throws ValidatorException { - Log.trace("LoginValidator.validate","Validating submitted login name -- " + value.toString()); - - matcher = pattern.matcher(value.toString()); - - if (!matcher.matches()) { - FacesMessage msg = new FacesMessage("Username validation failed. Please provide username in this format: uid:#"); - msg.setSeverity(FacesMessage.SEVERITY_ERROR); - - throw new ValidatorException(msg); - } - } -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/jsf/MarketSummaryJSF.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/jsf/MarketSummaryJSF.java deleted file mode 100644 index 7297c5e4..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/jsf/MarketSummaryJSF.java +++ /dev/null @@ -1,164 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2015. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.web.jsf; - -import com.ibm.websphere.samples.daytrader.beans.MarketSummaryDataBean; -import com.ibm.websphere.samples.daytrader.entities.QuoteDataBean; -import com.ibm.websphere.samples.daytrader.interfaces.Trace; -import com.ibm.websphere.samples.daytrader.interfaces.TradeServices; -import com.ibm.websphere.samples.daytrader.util.FinancialUtils; -import com.ibm.websphere.samples.daytrader.util.TradeConfig; -import com.ibm.websphere.samples.daytrader.util.TradeRunTimeModeLiteral; -import java.math.BigDecimal; -import java.math.RoundingMode; -import java.util.Collection; -import java.util.Date; -import java.util.Iterator; -import javax.annotation.PostConstruct; -import javax.enterprise.context.RequestScoped; -import javax.enterprise.inject.Any; -import javax.enterprise.inject.Instance; -import javax.inject.Inject; -import javax.inject.Named; - -@Named("marketdata") -@RequestScoped -@Trace -public class MarketSummaryJSF { - - private TradeServices tradeAction; - - private BigDecimal TSIA; - private BigDecimal openTSIA; - private double volume; - private QuoteData[] topGainers; - private QuoteData[] topLosers; - private Date summaryDate; - - // cache the gainPercent once computed for this bean - private BigDecimal gainPercent = null; - - @Inject - public MarketSummaryJSF(@Any Instance services) { - tradeAction = services.select(new TradeRunTimeModeLiteral(TradeConfig.getRunTimeModeNames()[TradeConfig.getRunTimeMode()])).get(); - } - - @PostConstruct - public void getMarketSummary() { - - try { - MarketSummaryDataBean marketSummaryData = tradeAction.getMarketSummary(); - setSummaryDate(marketSummaryData.getSummaryDate()); - setTSIA(marketSummaryData.getTSIA()); - setVolume(marketSummaryData.getVolume()); - setGainPercent(marketSummaryData.getGainPercent()); - - Collection topGainers = marketSummaryData.getTopGainers(); - - Iterator gainers = topGainers.iterator(); - int count = 0; - QuoteData[] gainerjsfs = new QuoteData[5]; - - while (gainers.hasNext() && (count < 5)) { - QuoteDataBean quote = (QuoteDataBean) gainers.next(); - QuoteData r = new QuoteData(quote.getPrice(), quote.getOpen(), quote.getSymbol()); - gainerjsfs[count] = r; - count++; - } - - setTopGainers(gainerjsfs); - - Collection topLosers = marketSummaryData.getTopLosers(); - - QuoteData[] loserjsfs = new QuoteData[5]; - count = 0; - Iterator losers = topLosers.iterator(); - - while (losers.hasNext() && (count < 5)) { - QuoteDataBean quote = (QuoteDataBean) losers.next(); - QuoteData r = new QuoteData(quote.getPrice(), quote.getOpen(), quote.getSymbol()); - loserjsfs[count] = r; - count++; - } - - setTopLosers(loserjsfs); - - } catch (Exception e) { - e.printStackTrace(); - } - } - - public void setTSIA(BigDecimal tSIA) { - TSIA = tSIA; - } - - public BigDecimal getTSIA() { - return TSIA; - } - - public void setOpenTSIA(BigDecimal openTSIA) { - this.openTSIA = openTSIA; - } - - public BigDecimal getOpenTSIA() { - return openTSIA; - } - - public void setVolume(double volume) { - this.volume = volume; - } - - public double getVolume() { - return volume; - } - - public void setTopGainers(QuoteData[] topGainers) { - this.topGainers = topGainers; - } - - public QuoteData[] getTopGainers() { - return topGainers; - } - - public void setTopLosers(QuoteData[] topLosers) { - this.topLosers = topLosers; - } - - public QuoteData[] getTopLosers() { - return topLosers; - } - - public void setSummaryDate(Date summaryDate) { - this.summaryDate = summaryDate; - } - - public Date getSummaryDate() { - return summaryDate; - } - - public void setGainPercent(BigDecimal gainPercent) { - this.gainPercent = gainPercent.setScale(2,RoundingMode.HALF_UP); - } - - public BigDecimal getGainPercent() { - return gainPercent; - } - - public String getGainPercentHTML() { - return FinancialUtils.printGainPercentHTML(gainPercent); - } - -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/jsf/OrderData.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/jsf/OrderData.java deleted file mode 100644 index 7c7a5bc4..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/jsf/OrderData.java +++ /dev/null @@ -1,140 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2015. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.web.jsf; - -import java.math.BigDecimal; -import java.util.Date; - -public class OrderData { - private Integer orderID; - private String orderStatus; - private Date openDate; - private Date completionDate; - private BigDecimal orderFee; - private String orderType; - private double quantity; - private String symbol; - private BigDecimal total; - private BigDecimal price; - - public OrderData(Integer orderID, String orderStatus, Date openDate, Date completeDate, BigDecimal orderFee, String orderType, double quantity, - String symbol) { - this.orderID = orderID; - this.completionDate = completeDate; - this.openDate = openDate; - this.orderFee = orderFee; - this.orderType = orderType; - this.orderStatus = orderStatus; - this.quantity = quantity; - this.symbol = symbol; - } - - public OrderData(Integer orderID, String orderStatus, Date openDate, Date completeDate, BigDecimal orderFee, String orderType, double quantity, - String symbol, BigDecimal price) { - this.orderID = orderID; - this.completionDate = completeDate; - this.openDate = openDate; - this.orderFee = orderFee; - this.orderType = orderType; - this.orderStatus = orderStatus; - this.quantity = quantity; - this.symbol = symbol; - this.price = price; - this.total = price.multiply(new BigDecimal(quantity)); - - } - - public void setOrderID(Integer orderID) { - this.orderID = orderID; - } - - public Integer getOrderID() { - return orderID; - } - - public void setOrderStatus(String orderStatus) { - this.orderStatus = orderStatus; - } - - public String getOrderStatus() { - return orderStatus; - } - - public void setOpenDate(Date openDate) { - this.openDate = openDate; - } - - public Date getOpenDate() { - return openDate; - } - - public void setCompletionDate(Date completionDate) { - this.completionDate = completionDate; - } - - public Date getCompletionDate() { - return completionDate; - } - - public void setOrderFee(BigDecimal orderFee) { - this.orderFee = orderFee; - } - - public BigDecimal getOrderFee() { - return orderFee; - } - - public void setOrderType(String orderType) { - this.orderType = orderType; - } - - public String getOrderType() { - return orderType; - } - - public void setQuantity(double quantity) { - this.quantity = quantity; - } - - public double getQuantity() { - return quantity; - } - - public void setSymbol(String symbol) { - this.symbol = symbol; - } - - public String getSymbol() { - return symbol; - } - - public void setTotal(BigDecimal total) { - this.total = total; - } - - public BigDecimal getTotal() { - return total; - } - - public void setPrice(BigDecimal price) { - this.price = price; - } - - public BigDecimal getPrice() { - return price; - } - -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/jsf/OrderDataJSF.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/jsf/OrderDataJSF.java deleted file mode 100644 index 94ded4af..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/jsf/OrderDataJSF.java +++ /dev/null @@ -1,104 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2015. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.web.jsf; - -import com.ibm.websphere.samples.daytrader.entities.OrderDataBean; -import com.ibm.websphere.samples.daytrader.interfaces.Trace; -import com.ibm.websphere.samples.daytrader.interfaces.TradeServices; -import com.ibm.websphere.samples.daytrader.util.TradeConfig; -import com.ibm.websphere.samples.daytrader.util.TradeRunTimeModeLiteral; -import java.math.BigDecimal; -import java.util.ArrayList; -import javax.annotation.PostConstruct; -import javax.enterprise.inject.Any; -import javax.enterprise.inject.Instance; -import javax.faces.context.ExternalContext; -import javax.inject.Inject; -import javax.inject.Named; -import javax.servlet.http.HttpSession; - -@Named("orderdata") -@Trace -public class OrderDataJSF { - - @Inject - private ExternalContext context; - - private TradeServices tradeAction; - - private OrderData[] allOrders; - private OrderData orderData; - - @Inject - public OrderDataJSF(@Any Instance services) { - tradeAction = services.select(new TradeRunTimeModeLiteral(TradeConfig.getRunTimeModeNames()[TradeConfig.getRunTimeMode()])).get(); - } - - public void getAllOrder() { - try { - HttpSession session = (HttpSession) context.getSession(true); - String userID = (String) session.getAttribute("uidBean"); - - ArrayList orderDataBeans = (TradeConfig.getLongRun() ? new ArrayList() : (ArrayList) tradeAction.getOrders(userID)); - OrderData[] orders = new OrderData[orderDataBeans.size()]; - - int count = 0; - - for (Object order : orderDataBeans) { - OrderData r = new OrderData(((OrderDataBean) order).getOrderID(), ((OrderDataBean) order).getOrderStatus(), - ((OrderDataBean) order).getOpenDate(), ((OrderDataBean) order).getCompletionDate(), ((OrderDataBean) order).getOrderFee(), - ((OrderDataBean) order).getOrderType(), ((OrderDataBean) order).getQuantity(), ((OrderDataBean) order).getSymbol()); - r.setPrice(((OrderDataBean) order).getPrice()); - r.setTotal(r.getPrice().multiply(new BigDecimal(r.getQuantity()))); - orders[count] = r; - count++; - } - - setAllOrders(orders); - } catch (Exception e) { - e.printStackTrace(); - } - - } - - @PostConstruct - public void getOrder() { - - - HttpSession session = (HttpSession) context.getSession(true); - OrderData order = (OrderData) session.getAttribute("orderData"); - - if (order != null) { - setOrderData(order); - } - } - - public void setAllOrders(OrderData[] allOrders) { - this.allOrders = allOrders; - } - - public OrderData[] getAllOrders() { - return allOrders; - } - - public void setOrderData(OrderData orderData) { - this.orderData = orderData; - } - - public OrderData getOrderData() { - return orderData; - } -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/jsf/PortfolioJSF.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/jsf/PortfolioJSF.java deleted file mode 100644 index 23ad7a24..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/jsf/PortfolioJSF.java +++ /dev/null @@ -1,232 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2015. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.web.jsf; - -import com.ibm.websphere.samples.daytrader.entities.HoldingDataBean; -import com.ibm.websphere.samples.daytrader.entities.OrderDataBean; -import com.ibm.websphere.samples.daytrader.entities.QuoteDataBean; -import com.ibm.websphere.samples.daytrader.interfaces.Trace; -import com.ibm.websphere.samples.daytrader.interfaces.TradeServices; -import com.ibm.websphere.samples.daytrader.util.FinancialUtils; -import com.ibm.websphere.samples.daytrader.util.TradeConfig; -import com.ibm.websphere.samples.daytrader.util.TradeRunTimeModeLiteral; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Iterator; -import javax.annotation.PostConstruct; -import javax.enterprise.context.RequestScoped; -import javax.enterprise.inject.Any; -import javax.enterprise.inject.Instance; -import javax.faces.component.html.HtmlDataTable; -import javax.faces.context.ExternalContext; -import javax.inject.Inject; -import javax.inject.Named; -import javax.servlet.http.HttpSession; -import javax.validation.constraints.PositiveOrZero; - -@Named("portfolio") -@RequestScoped -@Trace -public class PortfolioJSF { - @Inject - private ExternalContext context; - - private TradeServices tradeAction; - - private BigDecimal balance; - private BigDecimal openBalance; - - @PositiveOrZero - private Integer numberHoldings; - - private BigDecimal holdingsTotal; - private BigDecimal sumOfCashHoldings; - private BigDecimal totalGain = new BigDecimal(0.0); - private BigDecimal totalValue = new BigDecimal(0.0); - private BigDecimal totalBasis = new BigDecimal(0.0); - private BigDecimal totalGainPercent = new BigDecimal(0.0); - private ArrayList holdingDatas; - private HtmlDataTable dataTable; - - @Inject - public PortfolioJSF(@Any Instance services) { - tradeAction = services.select(new TradeRunTimeModeLiteral(TradeConfig.getRunTimeModeNames()[TradeConfig.getRunTimeMode()])).get(); - } - - @PostConstruct - public void getPortfolio() { - try { - - HttpSession session = (HttpSession) context.getSession(true); - String userID = (String) session.getAttribute("uidBean"); - Collection holdingDataBeans = tradeAction.getHoldings(userID); - - numberHoldings = holdingDataBeans.size(); - - // Walk through the collection of user holdings and creating a list - // of quotes - if (holdingDataBeans.size() > 0) { - Iterator it = holdingDataBeans.iterator(); - holdingDatas = new ArrayList(holdingDataBeans.size()); - - while (it.hasNext()) { - HoldingDataBean holdingData = (HoldingDataBean) it.next(); - QuoteDataBean quoteData = tradeAction.getQuote(holdingData.getQuoteID()); - - BigDecimal basis = holdingData.getPurchasePrice().multiply(new BigDecimal(holdingData.getQuantity())); - BigDecimal marketValue = quoteData.getPrice().multiply(new BigDecimal(holdingData.getQuantity())); - totalBasis = totalBasis.add(basis); - totalValue = totalValue.add(marketValue); - BigDecimal gain = marketValue.subtract(basis); - totalGain = totalGain.add(gain); - - HoldingData h = new HoldingData(); - h.setHoldingID(holdingData.getHoldingID()); - h.setPurchaseDate(holdingData.getPurchaseDate()); - h.setQuoteID(holdingData.getQuoteID()); - h.setQuantity(holdingData.getQuantity()); - h.setPurchasePrice(holdingData.getPurchasePrice()); - h.setBasis(basis); - h.setGain(gain); - h.setMarketValue(marketValue); - h.setPrice(quoteData.getPrice()); - holdingDatas.add(h); - - } - // dataTable - setTotalGainPercent(FinancialUtils.computeGainPercent(totalValue, totalBasis)); - - } - } catch (Exception e) { - e.printStackTrace(); - } - } - - public String sell() { - - HttpSession session = (HttpSession) context.getSession(true); - String userID = (String) session.getAttribute("uidBean"); - - OrderDataBean orderDataBean = null; - HoldingData holdingData = (HoldingData) dataTable.getRowData(); - - try { - orderDataBean = tradeAction.sell(userID, holdingData.getHoldingID(), TradeConfig.getOrderProcessingMode()); - holdingDatas.remove(holdingData); - } catch (Exception e) { - e.printStackTrace(); - } - - OrderData orderData = new OrderData(orderDataBean.getOrderID(), orderDataBean.getOrderStatus(), orderDataBean.getOpenDate(), - orderDataBean.getCompletionDate(), orderDataBean.getOrderFee(), orderDataBean.getOrderType(), orderDataBean.getQuantity(), - orderDataBean.getSymbol()); - session.setAttribute("orderData", orderData); - return "sell"; - } - - public void setDataTable(HtmlDataTable dataTable) { - this.dataTable = dataTable; - } - - public HtmlDataTable getDataTable() { - return dataTable; - } - - public void setBalance(BigDecimal balance) { - this.balance = balance; - } - - public BigDecimal getBalance() { - return balance; - } - - public void setOpenBalance(BigDecimal openBalance) { - this.openBalance = openBalance; - } - - public BigDecimal getOpenBalance() { - return openBalance; - } - - public void setHoldingsTotal(BigDecimal holdingsTotal) { - this.holdingsTotal = holdingsTotal; - } - - public BigDecimal getHoldingsTotal() { - return holdingsTotal; - } - - public void setSumOfCashHoldings(BigDecimal sumOfCashHoldings) { - this.sumOfCashHoldings = sumOfCashHoldings; - } - - public BigDecimal getSumOfCashHoldings() { - return sumOfCashHoldings; - } - - public void setNumberHoldings(Integer numberHoldings) { - this.numberHoldings = numberHoldings; - } - - public Integer getNumberHoldings() { - return numberHoldings; - } - - public void setTotalGain(BigDecimal totalGain) { - this.totalGain = totalGain; - } - - public BigDecimal getTotalGain() { - return totalGain; - } - - public void setTotalValue(BigDecimal totalValue) { - this.totalValue = totalValue; - } - - public BigDecimal getTotalValue() { - return totalValue; - } - - public void setTotalBasis(BigDecimal totalBasis) { - this.totalBasis = totalBasis; - } - - public BigDecimal getTotalBasis() { - return totalBasis; - } - - public void setHoldingDatas(ArrayList holdingDatas) { - this.holdingDatas = holdingDatas; - } - - public ArrayList getHoldingDatas() { - return holdingDatas; - } - - public void setTotalGainPercent(BigDecimal totalGainPercent) { - this.totalGainPercent = totalGainPercent; - } - - public BigDecimal getTotalGainPercent() { - return totalGainPercent; - } - - public String getTotalGainPercentHTML() { - return FinancialUtils.printGainPercentHTML(totalGainPercent); - } -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/jsf/QuoteData.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/jsf/QuoteData.java deleted file mode 100644 index 4410bb55..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/jsf/QuoteData.java +++ /dev/null @@ -1,166 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2015. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.web.jsf; - -import com.ibm.websphere.samples.daytrader.util.FinancialUtils; -import java.math.BigDecimal; -import java.text.DecimalFormat; - -public class QuoteData { - private BigDecimal price; - private BigDecimal open; - private String symbol; - private BigDecimal high; - private BigDecimal low; - private String companyName; - private double volume; - private double change; - private String range; - private BigDecimal gainPercent; - private BigDecimal gain; - - public QuoteData(BigDecimal price, BigDecimal open, String symbol) { - this.open = open; - this.price = price; - this.symbol = symbol; - this.change = price.subtract(open).setScale(2).doubleValue(); - } - - public QuoteData(BigDecimal open, BigDecimal price, String symbol, BigDecimal high, BigDecimal low, String companyName, Double volume, Double change) { - this.open = open; - this.price = price; - this.symbol = symbol; - this.high = high; - this.low = low; - this.companyName = companyName; - this.volume = volume; - this.change = change; - this.range = high.toString() + "-" + low.toString(); - this.gainPercent = FinancialUtils.computeGainPercent(price, open).setScale(2); - this.gain = FinancialUtils.computeGain(price, open).setScale(2); - } - - public void setSymbol(String symbol) { - this.symbol = symbol; - } - - public String getSymbol() { - return symbol; - } - - public void setPrice(BigDecimal price) { - this.price = price; - } - - public BigDecimal getPrice() { - return price; - } - - public void setOpen(BigDecimal open) { - this.open = open; - } - - public BigDecimal getOpen() { - return open; - } - - public void setHigh(BigDecimal high) { - this.high = high; - } - - public BigDecimal getHigh() { - return high; - } - - public void setLow(BigDecimal low) { - this.low = low; - } - - public BigDecimal getLow() { - return low; - } - - public void setCompanyName(String companyName) { - this.companyName = companyName; - } - - public String getCompanyName() { - return companyName; - } - - public void setVolume(double volume) { - this.volume = volume; - } - - public double getVolume() { - return volume; - } - - public void setChange(double change) { - this.change = change; - } - - public double getChange() { - return change; - } - - public void setRange(String range) { - this.range = range; - } - - public String getRange() { - return range; - } - - public void setGainPercent(BigDecimal gainPercent) { - this.gainPercent = gainPercent.setScale(2); - } - - public BigDecimal getGainPercent() { - return gainPercent; - } - - public void setGain(BigDecimal gain) { - this.gain = gain; - } - - public BigDecimal getGain() { - return gain; - } - - public String getGainPercentHTML() { - return FinancialUtils.printGainPercentHTML(gainPercent); - } - - public String getGainHTML() { - return FinancialUtils.printGainHTML(gain); - } - - public String getChangeHTML() { - String htmlString, arrow; - if (change < 0.0) { - htmlString = ""; - arrow = "arrowdown.gif"; - } else { - htmlString = ""; - arrow = "arrowup.gif"; - } - DecimalFormat df = new DecimalFormat("####0.00"); - - htmlString += df.format(change) + ""; - return htmlString; - } -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/jsf/QuoteJSF.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/jsf/QuoteJSF.java deleted file mode 100644 index 025bcc11..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/jsf/QuoteJSF.java +++ /dev/null @@ -1,145 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2015. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.web.jsf; - -import com.ibm.websphere.samples.daytrader.entities.OrderDataBean; -import com.ibm.websphere.samples.daytrader.entities.QuoteDataBean; -import com.ibm.websphere.samples.daytrader.interfaces.Trace; -import com.ibm.websphere.samples.daytrader.interfaces.TradeServices; -import com.ibm.websphere.samples.daytrader.util.Log; -import com.ibm.websphere.samples.daytrader.util.TradeConfig; -import com.ibm.websphere.samples.daytrader.util.TradeRunTimeModeLiteral; -import javax.annotation.PostConstruct; -import javax.enterprise.context.RequestScoped; -import javax.enterprise.inject.Any; -import javax.enterprise.inject.Instance; -import javax.faces.component.html.HtmlDataTable; -import javax.faces.context.ExternalContext; -import javax.inject.Inject; -import javax.inject.Named; -import javax.servlet.http.HttpSession; - -@Named("quotedata") -@RequestScoped -@Trace -public class QuoteJSF { - - @Inject - private ExternalContext context; - - private TradeServices tradeAction; - - private QuoteData[] quotes; - private String symbols = null; - private HtmlDataTable dataTable; - private Integer quantity = 100; - - @Inject - public QuoteJSF(@Any Instance services) { - tradeAction = services.select(new TradeRunTimeModeLiteral(TradeConfig.getRunTimeModeNames()[TradeConfig.getRunTimeMode()])).get(); - } - - @PostConstruct - public void getAllQuotes() { - getQuotesBySymbols(); - } - - public String getQuotesBySymbols() { - HttpSession session = (HttpSession) context.getSession(true); - - if (symbols == null && (session.getAttribute("symbols") == null)) { - setSymbols("s:0,s:1,s:2,s:3,s:4"); - session.setAttribute("symbols", getSymbols()); - } else if (symbols == null && session.getAttribute("symbols") != null) { - setSymbols((String) session.getAttribute("symbols")); - } - - else { - session.setAttribute("symbols", getSymbols()); - } - - java.util.StringTokenizer st = new java.util.StringTokenizer(symbols, " ,"); - QuoteData[] quoteDatas = new QuoteData[st.countTokens()]; - int count = 0; - - while (st.hasMoreElements()) { - String symbol = st.nextToken(); - - try { - QuoteDataBean quoteData = tradeAction.getQuote(symbol); - quoteDatas[count] = new QuoteData(quoteData.getOpen(), quoteData.getPrice(), quoteData.getSymbol(), quoteData.getHigh(), quoteData.getLow(), - quoteData.getCompanyName(), quoteData.getVolume(), quoteData.getChange()); - count++; - } catch (Exception e) { - Log.error(e.toString()); - } - } - setQuotes(quoteDatas); - return "quotes"; - } - - public String buy() { - HttpSession session = (HttpSession) context.getSession(true); - String userID = (String) session.getAttribute("uidBean"); - QuoteData quoteData = (QuoteData) dataTable.getRowData(); - OrderDataBean orderDataBean; - - try { - orderDataBean = tradeAction.buy(userID, quoteData.getSymbol(), new Double(this.quantity).doubleValue(), TradeConfig.getOrderProcessingMode()); - - OrderData orderData = new OrderData(orderDataBean.getOrderID(), orderDataBean.getOrderStatus(), orderDataBean.getOpenDate(), - orderDataBean.getCompletionDate(), orderDataBean.getOrderFee(), orderDataBean.getOrderType(), orderDataBean.getQuantity(), - orderDataBean.getSymbol()); - session.setAttribute("orderData", orderData); - } catch (Exception e) { - Log.error(e.toString()); - e.printStackTrace(); - } - return "buy"; - } - - public void setQuotes(QuoteData[] quotes) { - this.quotes = quotes; - } - - public QuoteData[] getQuotes() { - return quotes; - } - - public void setSymbols(String symbols) { - this.symbols = symbols; - } - - public String getSymbols() { - return symbols; - } - - public void setDataTable(HtmlDataTable dataTable) { - this.dataTable = dataTable; - } - - public HtmlDataTable getDataTable() { - return dataTable; - } - - public void setQuantity(Integer quantity) { - this.quantity = quantity; - } - - public Integer getQuantity() { - return quantity; - } -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/jsf/TradeAppJSF.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/jsf/TradeAppJSF.java deleted file mode 100644 index e7975224..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/jsf/TradeAppJSF.java +++ /dev/null @@ -1,296 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2015. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.web.jsf; - -import com.ibm.websphere.samples.daytrader.entities.AccountDataBean; -import com.ibm.websphere.samples.daytrader.entities.AccountProfileDataBean; -import com.ibm.websphere.samples.daytrader.interfaces.Trace; -import com.ibm.websphere.samples.daytrader.interfaces.TradeServices; -import com.ibm.websphere.samples.daytrader.util.Log; -import com.ibm.websphere.samples.daytrader.util.TradeConfig; -import com.ibm.websphere.samples.daytrader.util.TradeRunTimeModeLiteral; -import java.io.Serializable; -import java.math.BigDecimal; -import javax.enterprise.context.SessionScoped; -import javax.enterprise.inject.Any; -import javax.enterprise.inject.Instance; -import javax.faces.context.ExternalContext; -import javax.inject.Inject; -import javax.inject.Named; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpSession; -import javax.validation.constraints.Email; -import javax.validation.constraints.NotBlank; - -@Named("tradeapp") -@SessionScoped -@Trace -public class TradeAppJSF implements Serializable { - - @Inject ExternalContext context; - - private TradeServices tradeAction; - - private static final long serialVersionUID = 2L; - - @NotBlank - private String userID = "uid:0"; - - @NotBlank - private String password = "xxx"; - - @NotBlank - private String cpassword; - - @NotBlank - private String results; - - @NotBlank - private String fullname; - - @NotBlank - private String address; - - @Email - private String email; - - @NotBlank - private String ccn; - - @NotBlank - private String money; - - @Inject - public TradeAppJSF(@Any Instance services) { - tradeAction = services.select(new TradeRunTimeModeLiteral(TradeConfig.getRunTimeModeNames()[TradeConfig.getRunTimeMode()])).get(); - } - - public String login() { - try { - AccountDataBean accountData = tradeAction.login(userID, password); - - AccountProfileDataBean accountProfileData = tradeAction.getAccountProfileData(userID); - if (accountData != null) { - HttpSession session = (HttpSession) context.getSession(true); - - session.setAttribute("uidBean", userID); - session.setAttribute("sessionCreationDate", new java.util.Date()); - setResults("Ready to Trade"); - - // Get account profile information - setAddress(accountProfileData.getAddress()); - setCcn(accountProfileData.getCreditCard()); - setEmail(accountProfileData.getEmail()); - setFullname(accountProfileData.getFullName()); - setCpassword(accountProfileData.getPassword()); - return "Ready to Trade"; - } else { - Log.log("TradeServletAction.doLogin(...)", "Error finding account for user " + userID + "", - "user entered a bad username or the database is not populated"); - throw new NullPointerException("User does not exist or password is incorrect!"); - } - } - - catch (Exception se) { - // Go to welcome page - setResults("Could not find account"); - return "welcome"; - } - } - - public String register() { - - // Validate user passwords match and are atleast 1 char in length - try { - if ((password.equals(cpassword)) && (password.length() >= 1)) { - AccountDataBean accountData = tradeAction.register(userID, password, fullname, address, email, ccn, new BigDecimal(money)); - - if (accountData == null) { - setResults("Registration operation failed;"); - // Go to register page - return "Registration operation failed"; - - } else { - login(); - setResults("Registration operation succeeded; Account " + accountData.getAccountID() + " has been created."); - return "Registration operation succeeded"; - } - } - - else { - // Password validation failed - setResults("Registration operation failed, your passwords did not match"); - // Go to register page - return "Registration operation failed"; - } - } - - catch (Exception e) { - // log the exception with error page - Log.log("TradeServletAction.doRegister(...)" + " exception user =" + userID); - try { - throw new Exception("TradeServletAction.doRegister(...)" + " exception user =" + userID, e); - } catch (Exception e1) { - e1.printStackTrace(); - } - - } - return "Registration operation succeeded"; - } - - public String updateProfile() { - - // First verify input data - boolean doUpdate = true; - - if (password.equals(cpassword) == false) { - results = "Update profile error: passwords do not match"; - doUpdate = false; - } - - AccountProfileDataBean accountProfileData = new AccountProfileDataBean(userID, password, fullname, address, email, ccn); - - try { - if (doUpdate) { - accountProfileData = tradeAction.updateAccountProfile(accountProfileData); - results = "Account profile update successful"; - } - - } catch (java.lang.IllegalArgumentException e) { - // this is a user error so I will - // forward them to another page rather than throw a 500 - setResults("invalid argument, check userID is correct, and the database is populated" + userID); - Log.error(e, "TradeServletAction.doAccount(...)", "illegal argument, information should be in exception string", - "treating this as a user error and forwarding on to a new page"); - } catch (Exception e) { - // log the exception with error page - e.printStackTrace(); - } - // Go to account.xhtml - return "Go to account"; - } - - public String logout() { - - try { - setResults(""); - tradeAction.logout(userID); - } catch (java.lang.IllegalArgumentException e) { - // this is a user error so I will - // forward them to another page, at the end of the page. - setResults("illegal argument:" + e.getMessage()); - - // log the exception with an error level of 3 which means, handled - // exception but would invalidate a automation run - Log.error(e, "TradeServletAction.doLogout(...)", "illegal argument, information should be in exception string", - "treating this as a user error and forwarding on to a new page"); - } catch (Exception e) { - // log the exception and foward to a error page - Log.error(e, "TradeAppJSF.logout():", "Error logging out" + userID, "fowarding to an error page"); - } - - HttpSession session = (HttpSession)context.getSession(false); - - if (session != null) { - session.invalidate(); - } - - // Added to actually remove a user from the authentication cache - try { - ((HttpServletRequest) context.getRequest()).logout(); - } catch (ServletException e) { - Log.error(e, "TradeAppJSF.logout():", "Error logging out request" + userID, "fowarding to an error page"); - } - - // Go to welcome page - return "welcome"; - } - - public String getUserID() { - return userID; - } - - public void setUserID(String userID) { - this.userID = userID; - } - - public String getPassword() { - return password; - } - - public void setPassword(String password) { - this.password = password; - } - - public String getCpassword() { - return cpassword; - } - - public void setCpassword(String cpassword) { - this.cpassword = cpassword; - } - - public String getFullname() { - return fullname; - } - - public void setFullname(String fullname) { - this.fullname = fullname; - } - - public String getResults() { - String tempResults=results; - results=""; - return tempResults; - } - - public void setResults(String results) { - this.results = results; - } - - public String getAddress() { - return address; - } - - public void setAddress(String address) { - this.address = address; - } - - public String getEmail() { - return email; - } - - public void setEmail(String email) { - this.email = email; - } - - public String getCcn() { - return ccn; - } - - public void setCcn(String ccn) { - this.ccn = ccn; - } - - public String getMoney() { - return money; - } - - public void setMoney(String money) { - this.money = money; - } -}; diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/jsf/TradeConfigJSF.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/jsf/TradeConfigJSF.java deleted file mode 100644 index c716b6e7..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/jsf/TradeConfigJSF.java +++ /dev/null @@ -1,330 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2015. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.web.jsf; - -import com.ibm.websphere.samples.daytrader.beans.RunStatsDataBean; -import com.ibm.websphere.samples.daytrader.impl.direct.TradeDirectDBUtils; -import com.ibm.websphere.samples.daytrader.util.Log; -import com.ibm.websphere.samples.daytrader.util.TradeConfig; -import javax.enterprise.context.RequestScoped; -import javax.faces.context.ExternalContext; -import javax.inject.Inject; -import javax.inject.Named; -import javax.servlet.http.HttpSession; - -@Named("tradeconfig") -@RequestScoped -public class TradeConfigJSF { - - @Inject - private ExternalContext context; - - @Inject - TradeDirectDBUtils dbUtils; - - private String runtimeMode = TradeConfig.getRunTimeModeNames()[TradeConfig.getRunTimeMode()]; - private String orderProcessingMode = TradeConfig.getOrderProcessingModeNames()[TradeConfig.getOrderProcessingMode()]; - private int maxUsers = TradeConfig.getMAX_USERS(); - private int maxQuotes = TradeConfig.getMAX_QUOTES(); - private int marketSummaryInterval = TradeConfig.getMarketSummaryInterval(); - private String webInterface = TradeConfig.getWebInterfaceNames()[TradeConfig.getWebInterface()]; - private int primIterations = TradeConfig.getPrimIterations(); - private int listQuotePriceChangeFrequency = TradeConfig.getListQuotePriceChangeFrequency(); - private boolean publishQuotePriceChange = TradeConfig.getPublishQuotePriceChange(); - private boolean longRun = TradeConfig.getLongRun(); - private boolean displayOrderAlerts = TradeConfig.getDisplayOrderAlerts(); - private String[] runtimeModeList = TradeConfig.getRunTimeModeNames(); - private String[] orderProcessingModeList = TradeConfig.getOrderProcessingModeNames(); - - private String[] webInterfaceList = TradeConfig.getWebInterfaceNames(); - private String result = ""; - - public void updateConfig() { - String currentConfigStr = "\n\n########## Trade configuration update. Current config:\n\n"; - - currentConfigStr += "\t\tRunTimeMode:\t\t\t" + TradeConfig.getRunTimeModeNames()[TradeConfig.getRunTimeMode()] + "\n"; - - String orderProcessingModeStr = this.orderProcessingMode; - if (orderProcessingModeStr != null) { - try { - for (int i = 0; i < orderProcessingModeList.length; i++) { - if (orderProcessingModeStr.equals(orderProcessingModeList[i])) { - TradeConfig.setOrderProcessingMode(i); - } - } - } catch (Exception e) { - Log.error(e, "TradeConfigJSF.updateConfig(..): minor exception caught", "trying to set orderProcessing to " + orderProcessingModeStr, - "reverting to current value"); - - } // If the value is bad, simply revert to current - } - currentConfigStr += "\t\tOrderProcessingMode:\t\t" + TradeConfig.getOrderProcessingModeNames()[TradeConfig.getOrderProcessingMode()] + "\n"; - - String webInterfaceStr = webInterface; - if (webInterfaceStr != null) { - try { - for (int i = 0; i < webInterfaceList.length; i++) { - if (webInterfaceStr.equals(webInterfaceList[i])) { - TradeConfig.setWebInterface(i); - } - } - } catch (Exception e) { - Log.error(e, "TradeConfigJSF.updateConfig(..): minor exception caught", "trying to set WebInterface to " + webInterfaceStr, - "reverting to current value"); - - } // If the value is bad, simply revert to current - } - currentConfigStr += "\t\tWeb Interface:\t\t\t" + TradeConfig.getWebInterfaceNames()[TradeConfig.getWebInterface()] + "\n"; - - TradeConfig.setMAX_USERS(maxUsers); - TradeConfig.setMAX_QUOTES(maxQuotes); - - currentConfigStr += "\t\tTrade Users:\t\t\t" + TradeConfig.getMAX_USERS() + "\n"; - currentConfigStr += "\t\tTrade Quotes:\t\t\t" + TradeConfig.getMAX_QUOTES() + "\n"; - - TradeConfig.setMarketSummaryInterval(marketSummaryInterval); - - currentConfigStr += "\t\tMarket Summary Interval:\t" + TradeConfig.getMarketSummaryInterval() + "\n"; - - TradeConfig.setPrimIterations(primIterations); - - currentConfigStr += "\t\tPrimitive Iterations:\t\t" + TradeConfig.getPrimIterations() + "\n"; - - TradeConfig.setPublishQuotePriceChange(publishQuotePriceChange); - currentConfigStr += "\t\tTradeStreamer MDB Enabled:\t" + TradeConfig.getPublishQuotePriceChange() + "\n"; - - TradeConfig.setListQuotePriceChangeFrequency(listQuotePriceChangeFrequency); - currentConfigStr += "\t\t% of trades on Websocket:\t" + TradeConfig.getListQuotePriceChangeFrequency() + "\n"; - - TradeConfig.setLongRun(longRun); - currentConfigStr += "\t\tLong Run Enabled:\t\t" + TradeConfig.getLongRun() + "\n"; - - TradeConfig.setDisplayOrderAlerts(displayOrderAlerts); - currentConfigStr += "\t\tDisplay Order Alerts:\t\t" + TradeConfig.getDisplayOrderAlerts() + "\n"; - - System.out.println(currentConfigStr); - setResult("DayTrader Configuration Updated"); - } - - public String resetTrade() { - RunStatsDataBean runStatsData = new RunStatsDataBean(); - TradeConfig currentConfig = new TradeConfig(); - HttpSession session = (HttpSession) context.getSession(true); - - - try { - runStatsData = dbUtils.resetTrade(false); - session.setAttribute("runStatsData", runStatsData); - session.setAttribute("tradeConfig", currentConfig); - result += "Trade Reset completed successfully"; - - } catch (Exception e) { - result += "Trade Reset Error - see log for details"; - session.setAttribute("result", result); - Log.error(e, result); - } - - return "stats"; - } - - public String populateDatabase() { - - try { - dbUtils.buildDB(new java.io.PrintWriter(System.out), null); - } catch (Exception e) { - e.printStackTrace(); - } - - result = "TradeBuildDB: **** DayTrader Database Built - " + TradeConfig.getMAX_USERS() + " users created, " + TradeConfig.getMAX_QUOTES() - + " quotes created. ****
    "; - result += "TradeBuildDB: **** Check System.Out for any errors. ****
    "; - - return "database"; - } - - public String buildDatabaseTables() { - try { - String dbProductName = null; - try { - dbProductName = dbUtils.checkDBProductName(); - } catch (Exception e) { - Log.error(e, "TradeBuildDB: Unable to check DB Product name"); - } - if (dbProductName == null) { - result += "TradeBuildDB: **** Unable to check DB Product name, please check Database/AppServer configuration and retry ****
    "; - return "database"; - } - - String ddlFile = null; - //Locate DDL file for the specified database - try { - result = result + "TradeBuildDB: **** Database Product detected: " + dbProductName + " ****
    "; - if (dbProductName.startsWith("DB2/")) { // if db is DB2 - ddlFile = "/dbscripts/db2/Table.ddl"; - } else if (dbProductName.startsWith("Apache Derby")) { //if db is Derby - ddlFile = "/dbscripts/derby/Table.ddl"; - } else if (dbProductName.startsWith("Oracle")) { // if the Db is Oracle - ddlFile = "/dbscripts/oracle/Table.ddl"; - } else { // Unsupported "Other" Database - ddlFile = "/dbscripts/other/Table.ddl"; - result = result + "TradeBuildDB: **** This Database is unsupported/untested use at your own risk ****
    "; - } - - result = result + "TradeBuildDB: **** The DDL file at path" + ddlFile + " will be used ****
    "; - } catch (Exception e) { - Log.error(e, "TradeBuildDB: Unable to locate DDL file for the specified database"); - result = result + "TradeBuildDB: **** Unable to locate DDL file for the specified database ****
    "; - return "database"; - } - - dbUtils.buildDB(new java.io.PrintWriter(System.out), context.getResourceAsStream(ddlFile)); - - result = result + "TradeBuildDB: **** DayTrader Database Created, Check System.Out for any errors. ****
    "; - - } catch (Exception e) { - e.printStackTrace(); - } - - // Go to configure.xhtml - return "database"; - } - - - - - public String getRuntimeMode() { - return runtimeMode; - } - - public void setRuntimeMode(String runtimeMode) { - this.runtimeMode = runtimeMode; - } - - public void setOrderProcessingMode(String orderProcessingMode) { - this.orderProcessingMode = orderProcessingMode; - } - - public String getOrderProcessingMode() { - return orderProcessingMode; - } - - - public void setMaxUsers(int maxUsers) { - this.maxUsers = maxUsers; - } - - public int getMaxUsers() { - return maxUsers; - } - - public void setmaxQuotes(int maxQuotes) { - this.maxQuotes = maxQuotes; - } - - public int getMaxQuotes() { - return maxQuotes; - } - - public void setMarketSummaryInterval(int marketSummaryInterval) { - this.marketSummaryInterval = marketSummaryInterval; - } - - public int getMarketSummaryInterval() { - return marketSummaryInterval; - } - - public void setPrimIterations(int primIterations) { - this.primIterations = primIterations; - } - - public int getPrimIterations() { - return primIterations; - } - - public void setPublishQuotePriceChange(boolean publishQuotePriceChange) { - this.publishQuotePriceChange = publishQuotePriceChange; - } - - public boolean isPublishQuotePriceChange() { - return publishQuotePriceChange; - } - - public void setListQuotePriceChangeFrequency(int listQuotePriceChangeFrequency) { - this.listQuotePriceChangeFrequency = listQuotePriceChangeFrequency; - } - - public int getListQuotePriceChangeFrequency() { - return listQuotePriceChangeFrequency; - } - - public void setDisplayOrderAlerts(boolean displayOrderAlerts) { - this.displayOrderAlerts = displayOrderAlerts; - } - - public boolean isDisplayOrderAlerts() { - return displayOrderAlerts; - } - - - public void setLongRun(boolean longRun) { - this.longRun = longRun; - } - - public boolean isLongRun() { - return longRun; - } - - public String[] getRuntimeModeList() { - return runtimeModeList; - } - - public void setRuntimeModeList(String[] runtimeModeList) { - this.runtimeModeList = runtimeModeList; - } - - public void setOrderProcessingModeList(String[] orderProcessingModeList) { - this.orderProcessingModeList = orderProcessingModeList; - } - - public String[] getOrderProcessingModeList() { - return orderProcessingModeList; - } - - public void setWebInterface(String webInterface) { - this.webInterface = webInterface; - } - - public String getWebInterface() { - return webInterface; - } - - public void setWebInterfaceList(String[] webInterfaceList) { - this.webInterfaceList = webInterfaceList; - } - - public String[] getWebInterfaceList() { - return webInterfaceList; - } - - public void setResult(String result) { - this.result = result; - } - - public String getResult() { - return result; - } - -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/ExplicitGC.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/ExplicitGC.java deleted file mode 100644 index 90f7de30..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/ExplicitGC.java +++ /dev/null @@ -1,156 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2015. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.web.prims; - -import com.ibm.websphere.samples.daytrader.util.Log; -import java.io.IOException; -import javax.servlet.ServletConfig; -import javax.servlet.ServletException; -import javax.servlet.ServletOutputStream; -import javax.servlet.annotation.WebServlet; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -/** - * - * ExplicitGC invokes System.gc(). This allows one to gather min / max heap - * statistics. - * - */ -@WebServlet(name = "ExplicitGC", urlPatterns = { "/servlet/ExplicitGC" }) -public class ExplicitGC extends HttpServlet { - - private static final long serialVersionUID = -3758934393801102408L; - private static String initTime; - private static int hitCount; - - /** - * forwards post requests to the doGet method Creation date: (01/29/2006 - * 20:10:00 PM) - * - * @param res - * javax.servlet.http.HttpServletRequest - * @param res2 - * javax.servlet.http.HttpServletResponse - */ - @Override - public void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { - doGet(req, res); - } - - /** - * this is the main method of the servlet that will service all get - * requests. - * - * @param request - * HttpServletRequest - * @param responce - * HttpServletResponce - **/ - @Override - public void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { - try { - res.setContentType("text/html"); - - ServletOutputStream out = res.getOutputStream(); - hitCount++; - long totalMemory = Runtime.getRuntime().totalMemory(); - - long maxMemoryBeforeGC = Runtime.getRuntime().maxMemory(); - long freeMemoryBeforeGC = Runtime.getRuntime().freeMemory(); - long startTime = System.currentTimeMillis(); - - System.gc(); // Invoke the GC. - - long endTime = System.currentTimeMillis(); - long maxMemoryAfterGC = Runtime.getRuntime().maxMemory(); - long freeMemoryAfterGC = Runtime.getRuntime().freeMemory(); - - out.println("ExplicitGC" - + "

    Explicit Garbage Collection
    Init time : " - + initTime - + "

    Hit Count: " - + hitCount - + "
    " - + "" - + "" - + "
    Total Memory" - + totalMemory - + "
    " - + "" - + "" - + "" - + "" - + "" - + "" - + "" - + "" - + "" - + "
    " - + "Statistics before GC
    " - + "Max Memory" - + maxMemoryBeforeGC - + "
    " - + "Free Memory" - + freeMemoryBeforeGC - + "
    " - + "Used Memory" - + (totalMemory - freeMemoryBeforeGC) - + "
    Statistics after GC
    " - + "Max Memory" - + maxMemoryAfterGC - + "
    " - + "Free Memory" - + freeMemoryAfterGC - + "
    " - + "Used Memory" - + (totalMemory - freeMemoryAfterGC) - + "
    " - + "Total Time in GC" - + Float.toString((endTime - startTime) / 1000) - + "s
    " + ""); - } catch (Exception e) { - Log.error(e, "ExplicitGC.doGet(...): general exception caught"); - res.sendError(500, e.toString()); - - } - } - - /** - * returns a string of information about the servlet - * - * @return info String: contains info about the servlet - **/ - @Override - public String getServletInfo() { - return "Generate Explicit GC to VM"; - } - - /** - * called when the class is loaded to initialize the servlet - * - * @param config - * ServletConfig: - **/ - @Override - public void init(ServletConfig config) throws ServletException { - super.init(config); - initTime = new java.util.Date().toString(); - hitCount = 0; - - } -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/PingBean.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/PingBean.java deleted file mode 100644 index c7ded237..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/PingBean.java +++ /dev/null @@ -1,41 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2016. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.web.prims; - -/** - * Simple bean to get and set messages - */ - -public class PingBean { - - private String msg; - - /** - * returns the message contained in the bean - * - * @return message String - **/ - public String getMsg() { - return msg; - } - - /** - * sets the message contained in the bean param message String - **/ - public void setMsg(String s) { - msg = s; - } -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/PingJDBCRead.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/PingJDBCRead.java deleted file mode 100644 index d1c84bd9..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/PingJDBCRead.java +++ /dev/null @@ -1,133 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2015. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.web.prims; - -import com.ibm.websphere.samples.daytrader.entities.QuoteDataBean; -import com.ibm.websphere.samples.daytrader.interfaces.TradeJDBC; -import com.ibm.websphere.samples.daytrader.interfaces.TradeServices; -import com.ibm.websphere.samples.daytrader.util.Log; -import com.ibm.websphere.samples.daytrader.util.TradeConfig; -import java.io.IOException; -import javax.inject.Inject; -import javax.servlet.ServletConfig; -import javax.servlet.ServletException; -import javax.servlet.annotation.WebServlet; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -/** - * - * PingJDBCReadPrepStmt uses a prepared statement for database read access. This - * primative uses - * {@link com.ibm.websphere.samples.daytrader.impl.direct.TradeDirect} to set the - * price of a random stock (generated by - * {@link com.ibm.websphere.samples.daytrader.util.TradeConfig}) through the use - * of prepared statements. - * - */ - -@WebServlet(name = "PingJDBCRead", urlPatterns = { "/servlet/PingJDBCRead" }) -public class PingJDBCRead extends HttpServlet { - - @Inject - @TradeJDBC - TradeServices trade; - - private static final long serialVersionUID = -8810390150632488526L; - private static String initTime; - private static int hitCount; - - /** - * forwards post requests to the doGet method Creation date: (11/6/2000 - * 10:52:39 AM) - * - * @param res - * javax.servlet.http.HttpServletRequest - * @param res2 - * javax.servlet.http.HttpServletResponse - */ - @Override - public void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { - doGet(req, res); - } - - /** - * this is the main method of the servlet that will service all get - * requests. - * - * @param request - * HttpServletRequest - * @param responce - * HttpServletResponce - **/ - @Override - public void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { - res.setContentType("text/html"); - java.io.PrintWriter out = res.getWriter(); - String symbol = null; - StringBuffer output = new StringBuffer(100); - - try { - // TradeJDBC uses prepared statements so I am going to make use of - // it's code. - - symbol = TradeConfig.rndSymbol(); - - QuoteDataBean quoteData = null; - int iter = TradeConfig.getPrimIterations(); - for (int ii = 0; ii < iter; ii++) { - quoteData = trade.getQuote(symbol); - } - - output.append("Ping JDBC Read w/ Prepared Stmt." - + "
    Ping JDBC Read w/ Prep Stmt:
    Init time : " - + initTime); - hitCount++; - output.append("
    Hit Count: " + hitCount); - output.append("
    Quote Information

    : " + quoteData.toHTML()); - output.append("
    "); - out.println(output.toString()); - } catch (Exception e) { - Log.error(e, "PingJDBCRead w/ Prep Stmt -- error getting quote for symbol", symbol); - res.sendError(500, "PingJDBCRead Exception caught: " + e.toString()); - } - - } - - /** - * returns a string of information about the servlet - * - * @return info String: contains info about the servlet - **/ - @Override - public String getServletInfo() { - return "Basic JDBC Read using a prepared statment, makes use of TradeJDBC class"; - } - - /** - * called when the class is loaded to initialize the servlet - * - * @param config - * ServletConfig: - **/ - @Override - public void init(ServletConfig config) throws ServletException { - super.init(config); - hitCount = 0; - initTime = new java.util.Date().toString(); - } -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/PingJDBCRead2JSP.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/PingJDBCRead2JSP.java deleted file mode 100644 index 2df6f3d4..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/PingJDBCRead2JSP.java +++ /dev/null @@ -1,126 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2015. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.web.prims; - -import com.ibm.websphere.samples.daytrader.entities.QuoteDataBean; -import com.ibm.websphere.samples.daytrader.impl.direct.TradeDirect; -import com.ibm.websphere.samples.daytrader.interfaces.TradeJDBC; -import com.ibm.websphere.samples.daytrader.interfaces.TradeServices; -import com.ibm.websphere.samples.daytrader.util.Log; -import com.ibm.websphere.samples.daytrader.util.TradeConfig; -import java.io.IOException; -import javax.inject.Inject; -import javax.servlet.ServletConfig; -import javax.servlet.ServletContext; -import javax.servlet.ServletException; -import javax.servlet.annotation.WebServlet; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -/** - * - * PingJDBCReadPrepStmt uses a prepared statement for database read access. This - * primative uses - * {@link com.ibm.websphere.samples.daytrader.impl.direct.TradeDirect} to set the - * price of a random stock (generated by - * {@link com.ibm.websphere.samples.daytrader.util.TradeConfig}) through the use - * of prepared statements. - * - */ - -@WebServlet(name = "PingJDBCRead2JSP", urlPatterns = { "/servlet/PingJDBCRead2JSP" }) -public class PingJDBCRead2JSP extends HttpServlet { - - @Inject - @TradeJDBC - TradeServices trade; - - private static final long serialVersionUID = 1118803761565654806L; - - /** - * forwards post requests to the doGet method Creation date: (11/6/2000 - * 10:52:39 AM) - * - * @param res - * javax.servlet.http.HttpServletRequest - * @param res2 - * javax.servlet.http.HttpServletResponse - */ - @Override - public void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { - doGet(req, res); - } - - /** - * this is the main method of the servlet that will service all get - * requests. - * - * @param request - * HttpServletRequest - * @param responce - * HttpServletResponce - **/ - @Override - public void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { - String symbol = null; - QuoteDataBean quoteData = null; - ServletContext ctx = getServletConfig().getServletContext(); - - try { - - symbol = TradeConfig.rndSymbol(); - - int iter = TradeConfig.getPrimIterations(); - for (int ii = 0; ii < iter; ii++) { - quoteData = trade.getQuote(symbol); - } - - req.setAttribute("quoteData", quoteData); - // req.setAttribute("hitCount", hitCount); - // req.setAttribute("initTime", initTime); - - ctx.getRequestDispatcher("/quoteDataPrimitive.jsp").include(req, res); - } catch (Exception e) { - Log.error(e, "PingJDBCRead2JPS -- error getting quote for symbol", symbol); - res.sendError(500, "PingJDBCRead2JSP Exception caught: " + e.toString()); - } - - } - - /** - * returns a string of information about the servlet - * - * @return info String: contains info about the servlet - **/ - @Override - public String getServletInfo() { - return "Basic JDBC Read using a prepared statment forwarded to a JSP, makes use of TradeJDBC class"; - } - - /** - * called when the class is loaded to initialize the servlet - * - * @param config - * ServletConfig: - **/ - @Override - public void init(ServletConfig config) throws ServletException { - super.init(config); - // hitCount = 0; - // initTime = new java.util.Date().toString(); - } -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/PingJDBCWrite.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/PingJDBCWrite.java deleted file mode 100644 index 8a72f535..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/PingJDBCWrite.java +++ /dev/null @@ -1,138 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2015. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.web.prims; - -import com.ibm.websphere.samples.daytrader.entities.QuoteDataBean; -import com.ibm.websphere.samples.daytrader.impl.direct.TradeDirect; -import com.ibm.websphere.samples.daytrader.interfaces.TradeJDBC; -import com.ibm.websphere.samples.daytrader.util.Log; -import com.ibm.websphere.samples.daytrader.util.TradeConfig; -import java.io.IOException; -import java.math.BigDecimal; -import javax.inject.Inject; -import javax.servlet.ServletConfig; -import javax.servlet.ServletException; -import javax.servlet.annotation.WebServlet; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -/** - * - * PingJDBCReadPrepStmt uses a prepared statement for database update. Statement - * parameters are set dynamically on each request. This primative uses - * {@link com.ibm.websphere.samples.daytrader.impl.direct.TradeDirect} to set the - * price of a random stock (generated by - * {@link com.ibm.websphere.samples.daytrader.util.TradeConfig}) through the use - * of prepared statements. - * - */ -@WebServlet(name = "PingJDBCWrite", urlPatterns = { "/servlet/PingJDBCWrite" }) -public class PingJDBCWrite extends HttpServlet { - - @Inject - @TradeJDBC - TradeDirect trade; - - private static final long serialVersionUID = -4938035109655376503L; - private static String initTime; - private static int hitCount; - - /** - * this is the main method of the servlet that will service all get - * requests. - * - * @param request - * HttpServletRequest - * @param responce - * HttpServletResponce - **/ - @Override - public void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { - - String symbol = null; - BigDecimal newPrice; - StringBuffer output = new StringBuffer(100); - res.setContentType("text/html"); - java.io.PrintWriter out = res.getWriter(); - - try { - // get a random symbol to update and a random price. - symbol = TradeConfig.rndSymbol(); - newPrice = TradeConfig.getRandomPriceChangeFactor(); - - - // update the price of our symbol - QuoteDataBean quoteData = null; - int iter = TradeConfig.getPrimIterations(); - for (int ii = 0; ii < iter; ii++) { - quoteData = trade.updateQuotePriceVolumeInt(symbol, newPrice, 100.0, false); - } - - // write the output - output.append("Ping JDBC Write w/ Prepared Stmt." - + "
    Ping JDBC Write w/ Prep Stmt:
    Init time : " - + initTime); - hitCount++; - output.append("
    Hit Count: " + hitCount); - output.append("
    Update Information
    "); - output.append("
    " + quoteData.toHTML() + "
    "); - out.println(output.toString()); - - } catch (Exception e) { - Log.error(e, "PingJDBCWrite -- error updating quote for symbol", symbol); - res.sendError(500, "PingJDBCWrite Exception caught: " + e.toString()); - } - } - - /** - * returns a string of information about the servlet - * - * @return info String: contains info about the servlet - **/ - @Override - public String getServletInfo() { - return "Basic JDBC Write using a prepared statment makes use of TradeJDBC code."; - } - - /** - * called when the class is loaded to initialize the servlet - * - * @param config - * ServletConfig: - **/ - @Override - public void init(ServletConfig config) throws ServletException { - super.init(config); - initTime = new java.util.Date().toString(); - hitCount = 0; - - } - - /** - * forwards post requests to the doGet method Creation date: (11/6/2000 - * 10:52:39 AM) - * - * @param res - * javax.servlet.http.HttpServletRequest - * @param res2 - * javax.servlet.http.HttpServletResponse - */ - @Override - public void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { - doGet(req, res); - } -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/PingJSONPObject.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/PingJSONPObject.java deleted file mode 100644 index 14d89996..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/PingJSONPObject.java +++ /dev/null @@ -1,126 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2015. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.web.prims; - -import com.ibm.websphere.samples.daytrader.util.Log; -import java.io.IOException; -import java.io.StringReader; -import java.io.StringWriter; -import javax.json.Json; -import javax.json.JsonObject; -import javax.json.JsonReader; -import javax.json.stream.JsonGenerator; -import javax.json.stream.JsonParser; -import javax.servlet.ServletConfig; -import javax.servlet.ServletException; -import javax.servlet.ServletOutputStream; -import javax.servlet.annotation.WebServlet; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -/** - * - * PingJSONP tests JSON generating and parsing - * - */ - -@WebServlet(name = "PingJSONPObject", urlPatterns = { "/servlet/PingJSONPObject" }) -public class PingJSONPObject extends HttpServlet { - - - /** - * - */ - private static final long serialVersionUID = -5348806619121122708L; - private static String initTime; - private static int hitCount; - - /** - * forwards post requests to the doGet method Creation date: (11/6/2000 - * 10:52:39 AM) - * - * @param res - * javax.servlet.http.HttpServletRequest - * @param res2 - * javax.servlet.http.HttpServletResponse - */ - @Override - public void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { - doGet(req, res); - } - - /** - * this is the main method of the servlet that will service all get - * requests. - * - * @param request - * HttpServletRequest - * @param responce - * HttpServletResponce - **/ - @Override - public void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { - try { - res.setContentType("text/html"); - - ServletOutputStream out = res.getOutputStream(); - - hitCount++; - - // JSON generate - JsonObject json = Json.createObjectBuilder() - .add("initTime", initTime) - .add("hitCount", hitCount).build(); - String generatedJSON = json.toString(); - - // Read back - JsonReader jsonReader = Json.createReader(new StringReader(generatedJSON)); - String parsedJSON = jsonReader.readObject().toString(); - - - out.println("Ping JSONP" - + "

    Ping JSONP
    Generated JSON: " + generatedJSON + "
    Parsed JSON: " + parsedJSON + ""); - } catch (Exception e) { - Log.error(e, "PingJSONPObject.doGet(...): general exception caught"); - res.sendError(500, e.toString()); - - } - } - - /** - * returns a string of information about the servlet - * - * @return info String: contains info about the servlet - **/ - @Override - public String getServletInfo() { - return "Basic JSON generation and parsing in a servlet"; - } - - /** - * called when the class is loaded to initialize the servlet - * - * @param config - * ServletConfig: - **/ - @Override - public void init(ServletConfig config) throws ServletException { - super.init(config); - initTime = new java.util.Date().toString(); - hitCount = 0; - } -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/PingJSONPObjectFactory.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/PingJSONPObjectFactory.java deleted file mode 100644 index 3119f858..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/PingJSONPObjectFactory.java +++ /dev/null @@ -1,125 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2015. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.web.prims; - -import com.ibm.websphere.samples.daytrader.util.Log; -import java.io.IOException; -import java.io.StringReader; -import javax.json.Json; -import javax.json.JsonBuilderFactory; -import javax.json.JsonObject; -import javax.json.JsonReader; -import javax.json.JsonReaderFactory; -import javax.servlet.ServletConfig; -import javax.servlet.ServletException; -import javax.servlet.ServletOutputStream; -import javax.servlet.annotation.WebServlet; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -/** - * - * PingJSONP tests JSON generating and parsing - * - */ -@WebServlet(name = "PingJSONPObjectFactory", urlPatterns = { "/servlet/PingJSONPObjectFactory" }) -public class PingJSONPObjectFactory extends HttpServlet { - - private static final JsonBuilderFactory jSONObjectFactory = Json.createBuilderFactory(null); - private static final JsonReaderFactory jSONReaderFactory = Json.createReaderFactory(null); - /** - * - */ - private static final long serialVersionUID = -5348806619121122708L; - private static String initTime; - private static int hitCount; - - /** - * forwards post requests to the doGet method Creation date: (11/6/2000 - * 10:52:39 AM) - * - * @param res - * javax.servlet.http.HttpServletRequest - * @param res2 - * javax.servlet.http.HttpServletResponse - */ - @Override - public void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { - doGet(req, res); - } - - /** - * this is the main method of the servlet that will service all get - * requests. - * - * @param request - * HttpServletRequest - * @param responce - * HttpServletResponce - **/ - @Override - public void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { - try { - res.setContentType("text/html"); - - ServletOutputStream out = res.getOutputStream(); - - hitCount++; - - // JSON generate - JsonObject json = jSONObjectFactory.createObjectBuilder() - .add("initTime", initTime) - .add("hitCount", hitCount).build(); - String generatedJSON = json.toString(); - - // Read back - JsonReader jsonReader = jSONReaderFactory.createReader(new StringReader(generatedJSON)); - String parsedJSON = jsonReader.readObject().toString(); - - - out.println("Ping JSONP" - + "

    Ping JSONP
    Generated JSON: " + generatedJSON + "
    Parsed JSON: " + parsedJSON + ""); - } catch (Exception e) { - Log.error(e, "PingJSONPObject.doGet(...): general exception caught"); - res.sendError(500, e.toString()); - - } - } - - /** - * returns a string of information about the servlet - * - * @return info String: contains info about the servlet - **/ - @Override - public String getServletInfo() { - return "Basic JSON generation and parsing in a servlet"; - } - - /** - * called when the class is loaded to initialize the servlet - * - * @param config - * ServletConfig: - **/ - @Override - public void init(ServletConfig config) throws ServletException { - super.init(config); - initTime = new java.util.Date().toString(); - hitCount = 0; - } -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/PingJSONPStreaming.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/PingJSONPStreaming.java deleted file mode 100644 index 75fb1a6e..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/PingJSONPStreaming.java +++ /dev/null @@ -1,149 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2015. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.web.prims; - -import com.ibm.websphere.samples.daytrader.util.Log; -import java.io.IOException; -import java.io.StringReader; -import java.io.StringWriter; -import javax.json.Json; -import javax.json.stream.JsonGenerator; -import javax.json.stream.JsonParser; -import javax.servlet.ServletConfig; -import javax.servlet.ServletException; -import javax.servlet.ServletOutputStream; -import javax.servlet.annotation.WebServlet; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -/** - * - * PingJSONP tests JSON generating and parsing - * - */ - -@WebServlet(name = "PingJSONPStreaming", urlPatterns = { "/servlet/PingJSONPStreaming" }) -public class PingJSONPStreaming extends HttpServlet { - - - /** - * - */ - private static final long serialVersionUID = -5348806619121122708L; - private static String initTime; - private static int hitCount; - - /** - * forwards post requests to the doGet method Creation date: (11/6/2000 - * 10:52:39 AM) - * - * @param res - * javax.servlet.http.HttpServletRequest - * @param res2 - * javax.servlet.http.HttpServletResponse - */ - @Override - public void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { - doGet(req, res); - } - - /** - * this is the main method of the servlet that will service all get - * requests. - * - * @param request - * HttpServletRequest - * @param responce - * HttpServletResponce - **/ - @Override - public void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { - try { - res.setContentType("text/html"); - - ServletOutputStream out = res.getOutputStream(); - - hitCount++; - - // JSON generate - StringWriter sw = new StringWriter(); - JsonGenerator generator = Json.createGenerator(sw); - - generator.writeStartObject(); - generator.write("initTime",initTime); - generator.write("hitCount", hitCount); - generator.writeEnd(); - generator.flush(); - - String generatedJSON = sw.toString(); - StringBuffer parsedJSON = new StringBuffer(); - - // JSON parse - JsonParser parser = Json.createParser(new StringReader(generatedJSON)); - while (parser.hasNext()) { - JsonParser.Event event = parser.next(); - switch(event) { - case START_ARRAY: - case END_ARRAY: - case START_OBJECT: - case END_OBJECT: - case VALUE_FALSE: - case VALUE_NULL: - case VALUE_TRUE: - break; - case KEY_NAME: - parsedJSON.append(parser.getString() + ":"); - break; - case VALUE_STRING: - case VALUE_NUMBER: - parsedJSON.append(parser.getString() + " "); - break; - } - } - - out.println("Ping JSONP" - + "

    Ping JSONP
    Generated JSON: " + generatedJSON + "
    Parsed JSON: " + parsedJSON + ""); - } catch (Exception e) { - Log.error(e, "PingJSONP.doGet(...): general exception caught"); - res.sendError(500, e.toString()); - - } - } - - /** - * returns a string of information about the servlet - * - * @return info String: contains info about the servlet - **/ - @Override - public String getServletInfo() { - return "Basic JSON generation and parsing in a servlet"; - } - - /** - * called when the class is loaded to initialize the servlet - * - * @param config - * ServletConfig: - **/ - @Override - public void init(ServletConfig config) throws ServletException { - super.init(config); - initTime = new java.util.Date().toString(); - hitCount = 0; - } -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/PingManagedExecutor.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/PingManagedExecutor.java deleted file mode 100644 index b99fecbc..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/PingManagedExecutor.java +++ /dev/null @@ -1,119 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2015. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.web.prims; - -import java.io.IOException; -import javax.annotation.Resource; -import javax.enterprise.concurrent.ManagedExecutorService; -import javax.servlet.AsyncContext; -import javax.servlet.ServletConfig; -import javax.servlet.ServletException; -import javax.servlet.ServletOutputStream; -import javax.servlet.annotation.WebServlet; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -@WebServlet(asyncSupported=true,name = "PingManagedExecutor", urlPatterns = { "/servlet/PingManagedExecutor" }) -public class PingManagedExecutor extends HttpServlet{ - - private static final long serialVersionUID = -4695386150928451234L; - private static String initTime; - private static int hitCount; - - @Resource - private ManagedExecutorService mes; - - /** - * forwards post requests to the doGet method Creation date: (03/18/2014 - * 10:52:39 AM) - * - * @param res - * javax.servlet.http.HttpServletRequest - * @param res2 - * javax.servlet.http.HttpServletResponse - */ - @Override - public void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { - doGet(req, res); - } - - /** - * this is the main method of the servlet that will service all get - * requests. - * - * @param request - * HttpServletRequest - * @param responce - * HttpServletResponce - **/ - @Override - protected void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { - - final AsyncContext asyncContext = req.startAsync(); - final ServletOutputStream out = res.getOutputStream(); - - try { - res.setContentType("text/html"); - - out.println("Ping ManagedExecutor" - + "

    Ping ManagedExecutor
    Init time : " + initTime - + "

    "); - - // Runnable task - mes.submit(new Runnable() { - @Override - public void run() { - try { - out.println("HitCount: " + ++hitCount +"
    "); - } catch (IOException e) { - e.printStackTrace(); - } - asyncContext.complete(); - } - }); - - - } catch (Exception e) { - e.printStackTrace(); - } - } - - - /** - * returns a string of information about the servlet - * - * @return info String: contains info about the servlet - **/ - @Override - public String getServletInfo() { - return "Tests a ManagedExecutor"; - } - - /** - * called when the class is loaded to initialize the servlet - * - * @param config - * ServletConfig: - **/ - @Override - public void init(ServletConfig config) throws ServletException { - super.init(config); - initTime = new java.util.Date().toString(); - hitCount = 0; - } - -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/PingManagedThread.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/PingManagedThread.java deleted file mode 100644 index f3ecaf38..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/PingManagedThread.java +++ /dev/null @@ -1,124 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2015. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.web.prims; - -import com.ibm.websphere.samples.daytrader.util.Log; -import java.io.IOException; -import javax.annotation.Resource; -import javax.enterprise.concurrent.ManagedThreadFactory; -import javax.servlet.AsyncContext; -import javax.servlet.ServletConfig; -import javax.servlet.ServletException; -import javax.servlet.ServletOutputStream; -import javax.servlet.annotation.WebServlet; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -@WebServlet(asyncSupported=true,name = "PingManagedThread", urlPatterns = { "/servlet/PingManagedThread" }) -public class PingManagedThread extends HttpServlet{ - - private static final long serialVersionUID = -4695386150928451234L; - private static String initTime; - private static int hitCount; - - @Resource - private ManagedThreadFactory managedThreadFactory; - - /** - * forwards post requests to the doGet method Creation date: (03/18/2014 - * 10:52:39 AM) - * - * @param res - * javax.servlet.http.HttpServletRequest - * @param res2 - * javax.servlet.http.HttpServletResponse - */ - @Override - public void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { - doGet(req, res); - } - - /** - * this is the main method of the servlet that will service all get - * requests. - * - * @param request - * HttpServletRequest - * @param responce - * HttpServletResponce - **/ - @Override - protected void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { - - final AsyncContext asyncContext = req.startAsync(); - final ServletOutputStream out = res.getOutputStream(); - - try { - - res.setContentType("text/html"); - - out.println("Ping ManagedThread" - + "

    Ping ManagedThread
    Init time : " + initTime + "

    "); - - Thread thread = managedThreadFactory.newThread(new Runnable() { - @Override - public void run() { - try { - out.println("HitCount: " + ++hitCount +"
    "); - } catch (IOException e) { - e.printStackTrace(); - } - asyncContext.complete(); - } - }); - - thread.start(); - - } catch (Exception e) { - Log.error(e, "PingManagedThreadServlet.doGet(...): general exception caught"); - res.sendError(500, e.toString()); - } - - } - - - - /** - * returns a string of information about the servlet - * - * @return info String: contains info about the servlet - **/ - @Override - public String getServletInfo() { - return "Tests a ManagedThread asynchronous servlet"; - } - - /** - * called when the class is loaded to initialize the servlet - * - * @param config - * ServletConfig: - **/ - @Override - public void init(ServletConfig config) throws ServletException { - super.init(config); - initTime = new java.util.Date().toString(); - hitCount = 0; - - } - -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/PingReentryServlet.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/PingReentryServlet.java deleted file mode 100644 index d0a02a0f..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/PingReentryServlet.java +++ /dev/null @@ -1,137 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2015. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.web.prims; - -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStreamReader; -import java.net.HttpURLConnection; -import java.net.URL; -import javax.servlet.ServletConfig; -import javax.servlet.ServletException; -import javax.servlet.ServletOutputStream; -import javax.servlet.annotation.WebServlet; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -@WebServlet(name = "PingReentryServlet", urlPatterns = { "/servlet/PingReentryServlet" }) -public class PingReentryServlet extends HttpServlet { - - private static final long serialVersionUID = -2536027021580175706L; - - @Override - public void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { - doGet(req, res); - } - - /** - * this is the main method of the servlet that will service all get - * requests. - * - * @param request - * HttpServletRequest - * @param responce - * HttpServletResponce - **/ - @Override - public void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { - try { - res.setContentType("text/html"); - - // The following 2 lines are the difference between PingServlet and - // PingServletWriter - // the latter uses a PrintWriter for output versus a binary output - // stream. - ServletOutputStream out = res.getOutputStream(); - // java.io.PrintWriter out = res.getWriter(); - int numReentriesLeft; - int sleepTime; - - if(req.getParameter("numReentries") != null){ - numReentriesLeft = Integer.parseInt(req.getParameter("numReentries")); - } else { - numReentriesLeft = 0; - } - - if(req.getParameter("sleep") != null){ - sleepTime = Integer.parseInt(req.getParameter("sleep")); - } else { - sleepTime = 0; - } - - if(numReentriesLeft <= 0) { - Thread.sleep(sleepTime); - out.println(numReentriesLeft); - } else { - String hostname = req.getServerName(); - int port = req.getServerPort(); - req.getContextPath(); - int saveNumReentriesLeft = numReentriesLeft; - int nextNumReentriesLeft = numReentriesLeft - 1; - - // Recursively call into the same server, decrementing the counter by 1. - String url = "http://" + hostname + ":" + port + "/" + req.getRequestURI() + - "?numReentries=" + nextNumReentriesLeft + - "&sleep=" + sleepTime; - URL obj = new URL(url); - HttpURLConnection con = (HttpURLConnection) obj.openConnection(); - con.setRequestMethod("GET"); - con.setRequestProperty("User-Agent", "Mozilla/5.0"); - - //Append the recursion count to the response and return it. - BufferedReader in = new BufferedReader( - new InputStreamReader(con.getInputStream())); - String inputLine; - StringBuffer response = new StringBuffer(); - - while ((inputLine = in.readLine()) != null) { - response.append(inputLine); - } - in.close(); - - Thread.sleep(sleepTime); - out.println(saveNumReentriesLeft + response.toString()); - } - } catch (Exception e) { - //Log.error(e, "PingReentryServlet.doGet(...): general exception caught"); - res.sendError(500, e.toString()); - - } - } - - /** - * returns a string of information about the servlet - * - * @return info String: contains info about the servlet - **/ - @Override - public String getServletInfo() { - return "Basic dynamic HTML generation through a servlet"; - } - - /** - * called when the class is loaded to initialize the servlet - * - * @param config - * ServletConfig: - **/ - @Override - public void init(ServletConfig config) throws ServletException { - super.init(config); - - } -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/PingServlet.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/PingServlet.java deleted file mode 100644 index e33a9727..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/PingServlet.java +++ /dev/null @@ -1,110 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2015. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.web.prims; - -import com.ibm.websphere.samples.daytrader.util.Log; -import java.io.IOException; -import javax.servlet.ServletConfig; -import javax.servlet.ServletException; -import javax.servlet.ServletOutputStream; -import javax.servlet.annotation.WebServlet; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -/** - * - * PingServlet tests fundamental dynamic HTML creation functionality through - * server side servlet processing. - * - */ - -@WebServlet(name = "PingServlet", urlPatterns = { "/servlet/PingServlet" }) -public class PingServlet extends HttpServlet { - - private static final long serialVersionUID = 7097023236709683760L; - private static String initTime; - private static int hitCount; - - /** - * forwards post requests to the doGet method Creation date: (11/6/2000 - * 10:52:39 AM) - * - * @param res - * javax.servlet.http.HttpServletRequest - * @param res2 - * javax.servlet.http.HttpServletResponse - */ - @Override - public void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { - doGet(req, res); - } - - /** - * this is the main method of the servlet that will service all get - * requests. - * - * @param request - * HttpServletRequest - * @param responce - * HttpServletResponce - **/ - @Override - public void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { - try { - res.setContentType("text/html"); - - // The following 2 lines are the difference between PingServlet and - // PingServletWriter - // the latter uses a PrintWriter for output versus a binary output - // stream. - ServletOutputStream out = res.getOutputStream(); - // java.io.PrintWriter out = res.getWriter(); - hitCount++; - out.println("Ping Servlet" - + "

    Ping Servlet
    Init time : " + initTime - + "

    Hit Count: " + hitCount + ""); - } catch (Exception e) { - Log.error(e, "PingServlet.doGet(...): general exception caught"); - res.sendError(500, e.toString()); - - } - } - - /** - * returns a string of information about the servlet - * - * @return info String: contains info about the servlet - **/ - @Override - public String getServletInfo() { - return "Basic dynamic HTML generation through a servlet"; - } - - /** - * called when the class is loaded to initialize the servlet - * - * @param config - * ServletConfig: - **/ - @Override - public void init(ServletConfig config) throws ServletException { - super.init(config); - initTime = new java.util.Date().toString(); - hitCount = 0; - - } -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/PingServlet2DB.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/PingServlet2DB.java deleted file mode 100644 index 681a8601..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/PingServlet2DB.java +++ /dev/null @@ -1,112 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2015. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.web.prims; - -import com.ibm.websphere.samples.daytrader.impl.direct.TradeDirect; -import com.ibm.websphere.samples.daytrader.util.Log; -import java.io.IOException; -import javax.servlet.ServletConfig; -import javax.servlet.ServletException; -import javax.servlet.annotation.WebServlet; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -/** - * - * PingServlet2DB tests the path of a servlet making a JDBC connection to a - * database - * - */ - -@WebServlet(name = "PingServlet2DB", urlPatterns = { "/servlet/PingServlet2DB" }) -public class PingServlet2DB extends HttpServlet { - - private static final long serialVersionUID = -6456675185605592049L; - private static String initTime; - private static int hitCount; - - /** - * forwards post requests to the doGet method Creation date: (11/6/2000 - * 10:52:39 AM) - * - * @param res - * javax.servlet.http.HttpServletRequest - * @param res2 - * javax.servlet.http.HttpServletResponse - */ - @Override - public void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { - doGet(req, res); - } - - /** - * this is the main method of the servlet that will service all get - * requests. - * - * @param request - * HttpServletRequest - * @param responce - * HttpServletResponce - **/ - @Override - public void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { - res.setContentType("text/html"); - java.io.PrintWriter out = res.getWriter(); - String symbol = null; - StringBuffer output = new StringBuffer(100); - - try { - // TradeJDBC uses prepared statements so I am going to make use of - // it's code. - TradeDirect trade = new TradeDirect(); - trade.getConnPublic(); - - output.append("PingServlet2DB." - + "
    PingServlet2DB:
    Init time : " + initTime); - hitCount++; - output.append("
    Hit Count: " + hitCount); - output.append("
    "); - out.println(output.toString()); - } catch (Exception e) { - Log.error(e, "PingServlet2DB -- error getting connection to the database", symbol); - res.sendError(500, "PingServlet2DB Exception caught: " + e.toString()); - } - } - - /** - * returns a string of information about the servlet - * - * @return info String: contains info about the servlet - **/ - @Override - public String getServletInfo() { - return "Basic JDBC Read using a prepared statment, makes use of TradeJDBC class"; - } - - /** - * called when the class is loaded to initialize the servlet - * - * @param config - * ServletConfig: - **/ - @Override - public void init(ServletConfig config) throws ServletException { - super.init(config); - hitCount = 0; - initTime = new java.util.Date().toString(); - } -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/PingServlet2Include.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/PingServlet2Include.java deleted file mode 100644 index b57c2a79..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/PingServlet2Include.java +++ /dev/null @@ -1,102 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2015. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.web.prims; - -import com.ibm.websphere.samples.daytrader.util.Log; -import com.ibm.websphere.samples.daytrader.util.TradeConfig; -import java.io.IOException; -import javax.servlet.ServletConfig; -import javax.servlet.ServletException; -import javax.servlet.annotation.WebServlet; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -/** - * - * PingServlet2Include tests servlet to servlet request dispatching. Servlet 1, - * the controller, creates a new JavaBean object forwards the servlet request - * with the JavaBean added to Servlet 2. Servlet 2 obtains access to the - * JavaBean through the Servlet request object and provides the dynamic HTML - * output based on the JavaBean data. PingServlet2Servlet is the initial servlet - * that sends a request to {@link PingServlet2ServletRcv} - * - */ -@WebServlet(name = "PingServlet2Include", urlPatterns = { "/servlet/PingServlet2Include" }) -public class PingServlet2Include extends HttpServlet { - - private static final long serialVersionUID = 1063447780151198793L; - private static String initTime; - private static int hitCount; - - /** - * forwards post requests to the doGet method Creation date: (11/6/2000 - * 10:52:39 AM) - * - * @param res - * javax.servlet.http.HttpServletRequest - * @param res2 - * javax.servlet.http.HttpServletResponse - */ - @Override - public void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { - doGet(req, res); - } - - /** - * this is the main method of the servlet that will service all get - * requests. - * - * @param request - * HttpServletRequest - * @param responce - * HttpServletResponce - **/ - @Override - public void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { - - try { - res.setContentType("text/html"); - - int iter = TradeConfig.getPrimIterations(); - for (int ii = 0; ii < iter; ii++) { - getServletConfig().getServletContext().getRequestDispatcher("/servlet/PingServlet2IncludeRcv").include(req, res); - } - - // ServletOutputStream out = res.getOutputStream(); - java.io.PrintWriter out = res.getWriter(); - out.println("Ping Servlet 2 Include" - + "

    Ping Servlet 2 Include
    Init time : " - + initTime + "

    Hit Count: " + hitCount++ + ""); - } catch (Exception ex) { - Log.error(ex, "PingServlet2Include.doGet(...): general exception"); - res.sendError(500, "PingServlet2Include.doGet(...): general exception" + ex.toString()); - } - } - - /** - * called when the class is loaded to initialize the servlet - * - * @param config - * ServletConfig: - **/ - @Override - public void init(ServletConfig config) throws ServletException { - super.init(config); - initTime = new java.util.Date().toString(); - hitCount = 0; - } -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/PingServlet2IncludeRcv.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/PingServlet2IncludeRcv.java deleted file mode 100644 index 31a6f4f7..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/PingServlet2IncludeRcv.java +++ /dev/null @@ -1,67 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2015. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.web.prims; - -import java.io.IOException; -import javax.servlet.ServletException; -import javax.servlet.annotation.WebServlet; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -/** - * - * PingServlet2Include tests servlet to servlet request dispatching. Servlet 1, - * the controller, creates a new JavaBean object forwards the servlet request - * with the JavaBean added to Servlet 2. Servlet 2 obtains access to the - * JavaBean through the Servlet request object and provides the dynamic HTML - * output based on the JavaBean data. PingServlet2Servlet is the initial servlet - * that sends a request to {@link PingServlet2ServletRcv} - * - */ -@WebServlet(name = "PingServlet2IncludeRcv", urlPatterns = { "/servlet/PingServlet2IncludeRcv" }) -public class PingServlet2IncludeRcv extends HttpServlet { - - private static final long serialVersionUID = 2628801298561220872L; - - /** - * forwards post requests to the doGet method Creation date: (11/6/2000 - * 10:52:39 AM) - * - * @param res - * javax.servlet.http.HttpServletRequest - * @param res2 - * javax.servlet.http.HttpServletResponse - */ - @Override - public void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { - doGet(req, res); - } - - /** - * this is the main method of the servlet that will service all get - * requests. - * - * @param request - * HttpServletRequest - * @param responce - * HttpServletResponce - **/ - @Override - public void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { - // do nothing but get included by PingServlet2Include - } -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/PingServlet2JNDI.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/PingServlet2JNDI.java deleted file mode 100644 index b4d13203..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/PingServlet2JNDI.java +++ /dev/null @@ -1,107 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2015. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.web.prims; - -import com.ibm.websphere.samples.daytrader.util.Log; -import java.io.IOException; -import javax.servlet.ServletConfig; -import javax.servlet.ServletException; -import javax.servlet.annotation.WebServlet; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -/** - * - * PingServlet2JNDI performs a basic JNDI lookup of a JDBC DataSource - * - */ - -@WebServlet(name = "PingServlet2JNDI", urlPatterns = { "/servlet/PingServlet2JNDI" }) -public class PingServlet2JNDI extends HttpServlet { - - private static final long serialVersionUID = -8236271998141415347L; - private static String initTime; - private static int hitCount; - - /** - * forwards post requests to the doGet method Creation date: (11/6/2000 - * 10:52:39 AM) - * - * @param res - * javax.servlet.http.HttpServletRequest - * @param res2 - * javax.servlet.http.HttpServletResponse - */ - @Override - public void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { - doGet(req, res); - } - - /** - * this is the main method of the servlet that will service all get - * requests. - * - * @param request - * HttpServletRequest - * @param responce - * HttpServletResponce - **/ - @Override - public void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { - res.setContentType("text/html"); - java.io.PrintWriter out = res.getWriter(); - - StringBuffer output = new StringBuffer(100); - - try { - output.append("Ping JNDI -- lookup of JDBC DataSource" - + "
    Ping JNDI -- lookup of JDBC DataSource
    Init time : " - + initTime); - hitCount++; - output.append("
    Hit Count: " + hitCount); - output.append("
    "); - out.println(output.toString()); - } catch (Exception e) { - Log.error(e, "PingServlet2JNDI -- error look up of a JDBC DataSource"); - res.sendError(500, "PingServlet2JNDI Exception caught: " + e.toString()); - } - - } - - /** - * returns a string of information about the servlet - * - * @return info String: contains info about the servlet - **/ - @Override - public String getServletInfo() { - return "Basic JNDI look up of a JDBC DataSource"; - } - - /** - * called when the class is loaded to initialize the servlet - * - * @param config - * ServletConfig: - **/ - @Override - public void init(ServletConfig config) throws ServletException { - super.init(config); - hitCount = 0; - initTime = new java.util.Date().toString(); - } -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/PingServlet2Jsp.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/PingServlet2Jsp.java deleted file mode 100644 index 53492200..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/PingServlet2Jsp.java +++ /dev/null @@ -1,76 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2015. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.web.prims; - -import com.ibm.websphere.samples.daytrader.util.Log; -import java.io.IOException; -import javax.servlet.ServletException; -import javax.servlet.annotation.WebServlet; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -/** - * - * PingServlet2JSP tests a call from a servlet to a JavaServer Page providing - * server-side dynamic HTML through JSP scripting. - * - */ -@WebServlet(name = "PingServlet2Jsp", urlPatterns = { "/servlet/PingServlet2Jsp" }) -public class PingServlet2Jsp extends HttpServlet { - private static final long serialVersionUID = -5199543766883932389L; - private static int hitCount = 0; - - /** - * forwards post requests to the doGet method Creation date: (11/6/2000 - * 10:52:39 AM) - * - * @param res - * javax.servlet.http.HttpServletRequest - * @param res2 - * javax.servlet.http.HttpServletResponse - */ - @Override - public void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { - doGet(req, res); - } - - /** - * this is the main method of the servlet that will service all get - * requests. - * - * @param request - * HttpServletRequest - * @param responce - * HttpServletResponce - **/ - @Override - public void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { - PingBean ab; - try { - ab = new PingBean(); - hitCount++; - ab.setMsg("Hit Count: " + hitCount); - req.setAttribute("ab", ab); - - getServletConfig().getServletContext().getRequestDispatcher("/PingServlet2Jsp.jsp").forward(req, res); - } catch (Exception ex) { - Log.error(ex, "PingServlet2Jsp.doGet(...): request error"); - res.sendError(500, "PingServlet2Jsp.doGet(...): request error" + ex.toString()); - - } - } -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/PingServlet2PDF.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/PingServlet2PDF.java deleted file mode 100644 index 5dc1f740..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/PingServlet2PDF.java +++ /dev/null @@ -1,113 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2015. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.web.prims; - -import com.ibm.websphere.samples.daytrader.util.Log; -import java.io.BufferedInputStream; -import java.io.BufferedOutputStream; -import java.io.IOException; -import java.net.URL; -import java.net.URLConnection; -import javax.servlet.ServletException; -import javax.servlet.ServletOutputStream; -import javax.servlet.annotation.WebServlet; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -/** - * - * PingServlet2PDF tests a call to a servlet which then loads a PDF document. - * - */ -@WebServlet(name = "PingServlet2PDF", urlPatterns = { "/servlet/PingServlet2PDF" }) -public class PingServlet2PDF extends HttpServlet { - - private static final long serialVersionUID = -1321793174442755868L; - private static int hitCount = 0; - private static final int BUFFER_SIZE = 1024 * 8; // 8 KB - - /** - * forwards post requests to the doGet method Creation date: (11/6/2000 - * 10:52:39 AM) - * - * @param res - * javax.servlet.http.HttpServletRequest - * @param res2 - * javax.servlet.http.HttpServletResponse - */ - @Override - public void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { - doGet(req, res); - } - - /** - * this is the main method of the servlet that will service all get - * requests. - * - * @param request - * HttpServletRequest - * @param responce - * HttpServletResponce - **/ - @Override - public void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { - PingBean ab; - BufferedInputStream bis = null; - BufferedOutputStream bos = null; - try { - ab = new PingBean(); - hitCount++; - ab.setMsg("Hit Count: " + hitCount); - req.setAttribute("ab", ab); - - ServletOutputStream out = res.getOutputStream(); - - // MIME type for pdf doc - res.setContentType("application/pdf"); - - // Open an InputStream to the PDF document - String fileURL = "http://localhost:9080/daytrader/WAS_V7_64-bit_performance.pdf"; - URL url = new URL(fileURL); - URLConnection conn = url.openConnection(); - bis = new BufferedInputStream(conn.getInputStream()); - - // Transfer the InputStream (PDF Document) to OutputStream (servlet) - bos = new BufferedOutputStream(out); - byte[] buff = new byte[BUFFER_SIZE]; - int bytesRead; - // Simple read/write loop. - while (-1 != (bytesRead = bis.read(buff, 0, buff.length))) { - bos.write(buff, 0, bytesRead); - } - - } catch (Exception ex) { - Log.error(ex, "PingServlet2Jsp.doGet(...): request error"); - res.sendError(500, "PingServlet2Jsp.doGet(...): request error" + ex.toString()); - - } - - finally { - if (bis != null) { - bis.close(); - } - if (bos != null) { - bos.close(); - } - } - - } -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/PingServlet2Servlet.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/PingServlet2Servlet.java deleted file mode 100644 index 165dbe49..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/PingServlet2Servlet.java +++ /dev/null @@ -1,80 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2015. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.web.prims; - -import com.ibm.websphere.samples.daytrader.util.Log; -import java.io.IOException; -import javax.servlet.ServletException; -import javax.servlet.annotation.WebServlet; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -/** - * - * PingServlet2Servlet tests servlet to servlet request dispatching. Servlet 1, - * the controller, creates a new JavaBean object forwards the servlet request - * with the JavaBean added to Servlet 2. Servlet 2 obtains access to the - * JavaBean through the Servlet request object and provides the dynamic HTML - * output based on the JavaBean data. PingServlet2Servlet is the initial servlet - * that sends a request to {@link PingServlet2ServletRcv} - * - */ -@WebServlet(name = "PingServlet2Servlet", urlPatterns = { "/servlet/PingServlet2Servlet" }) -public class PingServlet2Servlet extends HttpServlet { - private static final long serialVersionUID = -955942781902636048L; - private static int hitCount = 0; - - /** - * forwards post requests to the doGet method Creation date: (11/6/2000 - * 10:52:39 AM) - * - * @param res - * javax.servlet.http.HttpServletRequest - * @param res2 - * javax.servlet.http.HttpServletResponse - */ - @Override - public void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { - doGet(req, res); - } - - /** - * this is the main method of the servlet that will service all get - * requests. - * - * @param request - * HttpServletRequest - * @param responce - * HttpServletResponce - **/ - @Override - public void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { - PingBean ab; - try { - ab = new PingBean(); - hitCount++; - ab.setMsg("Hit Count: " + hitCount); - req.setAttribute("ab", ab); - - getServletConfig().getServletContext().getRequestDispatcher("/servlet/PingServlet2ServletRcv").forward(req, res); - } catch (Exception ex) { - Log.error(ex, "PingServlet2Servlet.doGet(...): general exception"); - res.sendError(500, "PingServlet2Servlet.doGet(...): general exception" + ex.toString()); - - } - } -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/PingServlet2ServletRcv.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/PingServlet2ServletRcv.java deleted file mode 100644 index cf7cc0c1..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/PingServlet2ServletRcv.java +++ /dev/null @@ -1,95 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2015. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.web.prims; - -import com.ibm.websphere.samples.daytrader.util.Log; -import java.io.IOException; -import java.io.PrintWriter; -import javax.servlet.ServletConfig; -import javax.servlet.ServletException; -import javax.servlet.annotation.WebServlet; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -/** - * - * PingServlet2Servlet tests servlet to servlet request dispatching. Servlet 1, - * the controller, creates a new JavaBean object forwards the servlet request - * with the JavaBean added to Servlet 2. Servlet 2 obtains access to the - * JavaBean through the Servlet request object and provides the dynamic HTML - * output based on the JavaBean data. PingServlet2ServletRcv receives a request - * from {@link PingServlet2Servlet} and displays output. - * - */ -@WebServlet(name = "PingServlet2ServletRcv", urlPatterns = { "/servlet/PingServlet2ServletRcv" }) -public class PingServlet2ServletRcv extends HttpServlet { - private static final long serialVersionUID = -5241563129216549706L; - private static String initTime = null; - - /** - * forwards post requests to the doGet method Creation date: (11/6/2000 - * 10:52:39 AM) - * - * @param res - * javax.servlet.http.HttpServletRequest - * @param res2 - * javax.servlet.http.HttpServletResponse - */ - @Override - public void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { - doGet(req, res); - } - - /** - * this is the main method of the servlet that will service all get - * requests. - * - * @param request - * HttpServletRequest - * @param responce - * HttpServletResponce - **/ - @Override - public void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { - PingBean ab; - try { - ab = (PingBean) req.getAttribute("ab"); - res.setContentType("text/html"); - PrintWriter out = res.getWriter(); - out.println("Ping Servlet2Servlet" - + "

    PingServlet2Servlet:
    Init time: " - + initTime + "

    Message from Servlet: " + ab.getMsg() + ""); - } catch (Exception ex) { - Log.error(ex, "PingServlet2ServletRcv.doGet(...): general exception"); - res.sendError(500, "PingServlet2ServletRcv.doGet(...): general exception" + ex.toString()); - } - - } - - /** - * called when the class is loaded to initialize the servlet - * - * @param config - * ServletConfig: - **/ - @Override - public void init(ServletConfig config) throws ServletException { - super.init(config); - initTime = new java.util.Date().toString(); - - } -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/PingServlet30Async.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/PingServlet30Async.java deleted file mode 100644 index 5cbc4b08..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/PingServlet30Async.java +++ /dev/null @@ -1,117 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2015. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.web.prims; - -import java.io.IOException; -import javax.servlet.AsyncContext; -import javax.servlet.ServletConfig; -import javax.servlet.ServletException; -import javax.servlet.ServletInputStream; -import javax.servlet.ServletOutputStream; -import javax.servlet.annotation.WebServlet; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -//import com.ibm.websphere.samples.daytrader.util.Log; - -/** - * - * PingServlet31Async tests fundamental dynamic HTML creation functionality through - * server side servlet processing asynchronously. - * - */ - -@WebServlet(name = "PingServlet30Async", urlPatterns = { "/servlet/PingServlet30Async" }, asyncSupported=true) -public class PingServlet30Async extends HttpServlet { - - private static final long serialVersionUID = 8731300373855056660L; - private static String initTime; - private static int hitCount; - - /** - * forwards post requests to the doGet method Creation date: (11/6/2000 - * 10:52:39 AM) - * - * @param res - * javax.servlet.http.HttpServletRequest - * @param res2 - * javax.servlet.http.HttpServletResponse - */ - @Override - public void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { - res.setContentType("text/html"); - - AsyncContext ac = req.startAsync(); - StringBuilder sb = new StringBuilder(); - - ServletInputStream input = req.getInputStream(); - byte[] b = new byte[1024]; - int len = -1; - while ((len = input.read(b)) != -1) { - String data = new String(b, 0, len); - sb.append(data); - } - - ServletOutputStream output = res.getOutputStream(); - - output.println("Ping Servlet 3.0 Async" - + "

    Ping Servlet 3.0 Async
    " - + "Init time : " + initTime - + "

    Hit Count: " + ++hitCount + "
    Data Received: "+ sb.toString() + ""); - - ac.complete(); - } - - - /** - * this is the main method of the servlet that will service all get - * requests. - * - * @param request - * HttpServletRequest - * @param responce - * HttpServletResponce - **/ - @Override - public void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { - doPost(req,res); - - } - /** - * returns a string of information about the servlet - * - * @return info String: contains info about the servlet - **/ - @Override - public String getServletInfo() { - return "Basic dynamic HTML generation through a servlet"; - } - - /** - * called when the class is loaded to initialize the servlet - * - * @param config - * ServletConfig: - **/ - @Override - public void init(ServletConfig config) throws ServletException { - super.init(config); - initTime = new java.util.Date().toString(); - hitCount = 0; - - } -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/PingServlet31Async.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/PingServlet31Async.java deleted file mode 100644 index 9ddfe6f7..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/PingServlet31Async.java +++ /dev/null @@ -1,184 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2015. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.web.prims; - -import java.io.IOException; -import java.util.Queue; -import java.util.concurrent.LinkedBlockingQueue; -import javax.servlet.AsyncContext; -import javax.servlet.ReadListener; -import javax.servlet.ServletConfig; -import javax.servlet.ServletException; -import javax.servlet.ServletInputStream; -import javax.servlet.ServletOutputStream; -import javax.servlet.WriteListener; -import javax.servlet.annotation.WebServlet; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -//import com.ibm.websphere.samples.daytrader.util.Log; - -/** - * - * PingServlet31Async tests fundamental dynamic HTML creation functionality through - * server side servlet processing asynchronously with non-blocking i/o. - * - */ - -@WebServlet(name = "PingServlet31Async", urlPatterns = { "/servlet/PingServlet31Async" }, asyncSupported=true) -public class PingServlet31Async extends HttpServlet { - - private static final long serialVersionUID = 8731300373855056660L; - private static String initTime; - private static int hitCount; - - /** - * forwards post requests to the doGet method Creation date: (11/6/2000 - * 10:52:39 AM) - * - * @param res - * javax.servlet.http.HttpServletRequest - * @param res2 - * javax.servlet.http.HttpServletResponse - */ - @Override - public void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { - res.setContentType("text/html"); - - AsyncContext ac = req.startAsync(); - - ServletInputStream input = req.getInputStream(); - ReadListener readListener = new ReadListenerImpl(input, res, ac); - input.setReadListener(readListener); - } - - class ReadListenerImpl implements ReadListener { - private ServletInputStream input = null; - private HttpServletResponse res = null; - private AsyncContext ac = null; - private Queue queue = new LinkedBlockingQueue(); - - ReadListenerImpl(ServletInputStream in, HttpServletResponse r, AsyncContext c) { - input = in; - res = r; - ac = c; - } - - public void onDataAvailable() throws IOException { - StringBuilder sb = new StringBuilder(); - int len = -1; - byte b[] = new byte[1024]; - - while (input.isReady() && (len = input.read(b)) != -1) { - String data = new String(b, 0, len); - sb.append(data); - } - queue.add(sb.toString()); - - } - - public void onAllDataRead() throws IOException { - ServletOutputStream output = res.getOutputStream(); - WriteListener writeListener = new WriteListenerImpl(output, queue, ac); - output.setWriteListener(writeListener); - } - - public void onError(final Throwable t) { - ac.complete(); - t.printStackTrace(); - } - } - - class WriteListenerImpl implements WriteListener { - private ServletOutputStream output = null; - private Queue queue = null; - private AsyncContext ac = null; - - WriteListenerImpl(ServletOutputStream sos, Queue q, AsyncContext c) { - output = sos; - queue = q; - ac = c; - - try { - output.print("Ping Servlet 3.1 Async" - + "

    Ping Servlet 3.1 Async" - + "
    Init time : " + initTime - + "

    Hit Count: " + ++hitCount + "
    Data Received: "); - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - - public void onWritePossible() throws IOException { - - while (queue.peek() != null && output.isReady()) { - String data = (String) queue.poll(); - output.print(data); - } - - if (queue.peek() == null) { - output.println(""); - ac.complete(); - } - } - - public void onError(final Throwable t) { - ac.complete(); - t.printStackTrace(); - } - } - - - - /** - * this is the main method of the servlet that will service all get - * requests. - * - * @param request - * HttpServletRequest - * @param responce - * HttpServletResponce - **/ - @Override - public void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { - doPost(req,res); - } - /** - * returns a string of information about the servlet - * - * @return info String: contains info about the servlet - **/ - @Override - public String getServletInfo() { - return "Basic dynamic HTML generation through a servlet"; - } - - /** - * called when the class is loaded to initialize the servlet - * - * @param config - * ServletConfig: - **/ - @Override - public void init(ServletConfig config) throws ServletException { - super.init(config); - initTime = new java.util.Date().toString(); - hitCount = 0; - - } -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/PingServlet31AsyncRead.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/PingServlet31AsyncRead.java deleted file mode 100644 index a5194165..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/PingServlet31AsyncRead.java +++ /dev/null @@ -1,144 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2015. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.web.prims; - -import java.io.IOException; -import javax.servlet.AsyncContext; -import javax.servlet.ReadListener; -import javax.servlet.ServletConfig; -import javax.servlet.ServletException; -import javax.servlet.ServletInputStream; -import javax.servlet.ServletOutputStream; -import javax.servlet.annotation.WebServlet; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -//import com.ibm.websphere.samples.daytrader.util.Log; - -/** - * - * PingServlet31Async tests fundamental dynamic HTML creation functionality through - * server side servlet processing asynchronously with non-blocking i/o. - * - */ - -@WebServlet(name = "PingServlet31AsyncRead", urlPatterns = { "/servlet/PingServlet31AsyncRead" }, asyncSupported=true) -public class PingServlet31AsyncRead extends HttpServlet { - - private static final long serialVersionUID = 8731300373855056660L; - private static String initTime; - private static int hitCount; - - /** - * forwards post requests to the doGet method Creation date: (11/6/2000 - * 10:52:39 AM) - * - * @param res - * javax.servlet.http.HttpServletRequest - * @param res2 - * javax.servlet.http.HttpServletResponse - */ - @Override - public void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { - res.setContentType("text/html"); - - AsyncContext ac = req.startAsync(); - - ServletInputStream input = req.getInputStream(); - ReadListener readListener = new ReadListenerImpl(input, res, ac); - input.setReadListener(readListener); - } - - class ReadListenerImpl implements ReadListener { - private ServletInputStream input = null; - private HttpServletResponse res = null; - private AsyncContext ac = null; - private StringBuilder sb = new StringBuilder(); - - ReadListenerImpl(ServletInputStream in, HttpServletResponse r, AsyncContext c) { - input = in; - res = r; - ac = c; - } - - public void onDataAvailable() throws IOException { - - int len = -1; - byte b[] = new byte[1024]; - - while (input.isReady() && (len = input.read(b)) != -1) { - String data = new String(b, 0, len); - sb.append(data); - } - - - } - - public void onAllDataRead() throws IOException { - ServletOutputStream output = res.getOutputStream(); - output.println("Ping Servlet 3.1 Async" - + "

    Ping Servlet 3.1 AsyncRead" - + "
    Init time : " + initTime - + "

    Hit Count: " + ++hitCount + "
    Data Received: " + sb.toString() + ""); - ac.complete(); - } - - public void onError(final Throwable t) { - ac.complete(); - t.printStackTrace(); - } - } - - - - /** - * this is the main method of the servlet that will service all get - * requests. - * - * @param request - * HttpServletRequest - * @param responce - * HttpServletResponce - **/ - @Override - public void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { - doPost(req,res); - } - /** - * returns a string of information about the servlet - * - * @return info String: contains info about the servlet - **/ - @Override - public String getServletInfo() { - return "Basic dynamic HTML generation through a servlet"; - } - - /** - * called when the class is loaded to initialize the servlet - * - * @param config - * ServletConfig: - **/ - @Override - public void init(ServletConfig config) throws ServletException { - super.init(config); - initTime = new java.util.Date().toString(); - hitCount = 0; - - } -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/PingServletLargeContentLength.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/PingServletLargeContentLength.java deleted file mode 100644 index 2375e8c2..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/PingServletLargeContentLength.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2015. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.web.prims; - -import java.io.IOException; -import javax.servlet.ServletConfig; -import javax.servlet.ServletException; -import javax.servlet.annotation.WebServlet; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -/** - * - * PingServletSetContentLength tests fundamental dynamic HTML creation - * functionality through server side servlet processing. - * - */ - -@WebServlet(name = "PingServletLargeContentLength", urlPatterns = { "/servlet/PingServletLargeContentLength" }) -public class PingServletLargeContentLength extends HttpServlet { - - - - /** - * - */ - private static final long serialVersionUID = -7979576220528252408L; - - /** - * forwards post requests to the doGet method Creation date: (02/07/2013 - * 10:52:39 AM) - * - * @param res - * javax.servlet.http.HttpServletRequest - * @param res2 - * javax.servlet.http.HttpServletResponse - */ - @Override - public void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { - System.out.println("Length: " + req.getContentLengthLong()); - - - - - } - - /** - * this is the main method of the servlet that will service all get - * requests. - * - * @param request - * HttpServletRequest - * @param responce - * HttpServletResponce - **/ - @Override - public void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { - doPost(req,res); } - - /** - * returns a string of information about the servlet - * - * @return info String: contains info about the servlet - **/ - @Override - public String getServletInfo() { - return "Basic dynamic HTML generation through a servlet, with " + "contentLength set by contentLength parameter."; - } - - /** - * called when the class is loaded to initialize the servlet - * - * @param config - * ServletConfig: - **/ - @Override - public void init(ServletConfig config) throws ServletException { - super.init(config); - } -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/PingServletSetContentLength.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/PingServletSetContentLength.java deleted file mode 100644 index ebf67119..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/PingServletSetContentLength.java +++ /dev/null @@ -1,119 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2015. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.web.prims; - -import com.ibm.websphere.samples.daytrader.util.Log; -import java.io.IOException; -import javax.servlet.ServletConfig; -import javax.servlet.ServletException; -import javax.servlet.ServletOutputStream; -import javax.servlet.annotation.WebServlet; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -/** - * - * PingServletSetContentLength tests fundamental dynamic HTML creation - * functionality through server side servlet processing. - * - */ - -@WebServlet(name = "PingServletSetContentLength", urlPatterns = { "/servlet/PingServletSetContentLength" }) -public class PingServletSetContentLength extends HttpServlet { - - private static final long serialVersionUID = 8731300373855056661L; - - /** - * forwards post requests to the doGet method Creation date: (02/07/2013 - * 10:52:39 AM) - * - * @param res - * javax.servlet.http.HttpServletRequest - * @param res2 - * javax.servlet.http.HttpServletResponse - */ - @Override - public void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { - doGet(req, res); - } - - /** - * this is the main method of the servlet that will service all get - * requests. - * - * @param request - * HttpServletRequest - * @param responce - * HttpServletResponce - **/ - @Override - public void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { - try { - res.setContentType("text/html"); - String lengthParam = req.getParameter("contentLength"); - Integer length; - - if (lengthParam == null) { - length = 0; - } else { - length = Integer.parseInt(lengthParam); - } - - ServletOutputStream out = res.getOutputStream(); - - // Add characters (a's) to the SOS to equal the requested length - // 167 is the smallest length possible. - - int i = 0; - String buffer = ""; - - while (i + 167 < length) { - buffer = buffer + "a"; - i++; - } - - out.println("Ping Servlet" - + "

    Ping Servlet
    " + buffer - + "
    "); - } catch (Exception e) { - Log.error(e, "PingServlet.doGet(...): general exception caught"); - res.sendError(500, e.toString()); - - } - } - - /** - * returns a string of information about the servlet - * - * @return info String: contains info about the servlet - **/ - @Override - public String getServletInfo() { - return "Basic dynamic HTML generation through a servlet, with " + "contentLength set by contentLength parameter."; - } - - /** - * called when the class is loaded to initialize the servlet - * - * @param config - * ServletConfig: - **/ - @Override - public void init(ServletConfig config) throws ServletException { - super.init(config); - } -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/PingServletWriter.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/PingServletWriter.java deleted file mode 100644 index 2690e7d0..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/PingServletWriter.java +++ /dev/null @@ -1,108 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2015. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.web.prims; - -import com.ibm.websphere.samples.daytrader.util.Log; -import java.io.IOException; -import javax.servlet.ServletConfig; -import javax.servlet.ServletException; -import javax.servlet.annotation.WebServlet; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -/** - * - * PingServlet extends PingServlet by using a PrintWriter for formatted output - * vs. the output stream used by {@link PingServlet}. - * - */ -@WebServlet(name = "PingServletWriter", urlPatterns = { "/servlet/PingServletWriter" }) -public class PingServletWriter extends HttpServlet { - - private static final long serialVersionUID = -267847365014523225L; - private static String initTime; - private static int hitCount; - - /** - * forwards post requests to the doGet method Creation date: (11/6/2000 - * 10:52:39 AM) - * - * @param res - * javax.servlet.http.HttpServletRequest - * @param res2 - * javax.servlet.http.HttpServletResponse - */ - @Override - public void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { - doGet(req, res); - } - - /** - * this is the main method of the servlet that will service all get - * requests. - * - * @param request - * HttpServletRequest - * @param responce - * HttpServletResponce - **/ - @Override - public void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { - try { - res.setContentType("text/html"); - - // The following 2 lines are the difference between PingServlet and - // PingServletWriter - // the latter uses a PrintWriter for output versus a binary output - // stream. - // ServletOutputStream out = res.getOutputStream(); - java.io.PrintWriter out = res.getWriter(); - hitCount++; - out.println("Ping Servlet Writer" - + "

    Ping Servlet Writer:
    Init time : " - + initTime + "

    Hit Count: " + hitCount + ""); - } catch (Exception e) { - Log.error(e, "PingServletWriter.doGet(...): general exception caught"); - res.sendError(500, e.toString()); - } - } - - /** - * returns a string of information about the servlet - * - * @return info String: contains info about the servlet - **/ - - @Override - public String getServletInfo() { - return "Basic dynamic HTML generation through a servlet using a PrintWriter"; - } - - /** - * called when the class is loaded to initialize the servlet - * - * @param config - * ServletConfig: - **/ - @Override - public void init(ServletConfig config) throws ServletException { - super.init(config); - hitCount = 0; - initTime = new java.util.Date().toString(); - - } -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/PingSession1.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/PingSession1.java deleted file mode 100644 index d2b69b74..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/PingSession1.java +++ /dev/null @@ -1,134 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2015. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.web.prims; - -import com.ibm.websphere.samples.daytrader.util.Log; -import java.io.IOException; -import java.io.PrintWriter; -import javax.servlet.ServletConfig; -import javax.servlet.ServletException; -import javax.servlet.annotation.WebServlet; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; - -/** - * - * PingHTTPSession1 - SessionID tests fundamental HTTP session functionality by - * creating a unique session ID for each individual user. The ID is stored in - * the users session and is accessed and displayed on each user request. - * - */ -@WebServlet(name = "PingSession1", urlPatterns = { "/servlet/PingSession1" }) -public class PingSession1 extends HttpServlet { - private static final long serialVersionUID = -3703858656588519807L; - private static int count; - // For each new session created, add a session ID of the form "sessionID:" + - // count - private static String initTime; - private static int hitCount; - - /** - * forwards post requests to the doGet method Creation date: (11/6/2000 - * 10:52:39 AM) - * - * @param res - * javax.servlet.http.HttpServletRequest - * @param res2 - * javax.servlet.http.HttpServletResponse - */ - @Override - public void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { - doGet(req, res); - } - - /** - * this is the main method of the servlet that will service all get - * requests. - * - * @param request - * HttpServletRequest - * @param responce - * HttpServletResponce - **/ - @Override - public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - HttpSession session = null; - try { - try { - // get the users session, if the user does not have a session - // create one. - session = request.getSession(true); - } catch (Exception e) { - Log.error(e, "PingSession1.doGet(...): error getting session"); - // rethrow the exception for handling in one place. - throw e; - } - - // Get the session data value - Integer ival = (Integer) session.getAttribute("sessiontest.counter"); - // if their is not a counter create one. - if (ival == null) { - ival = new Integer(count++); - session.setAttribute("sessiontest.counter", ival); - } - String SessionID = "SessionID:" + ival.toString(); - - // Output the page - response.setContentType("text/html"); - response.setHeader("SessionKeyTest-SessionID", SessionID); - - PrintWriter out = response.getWriter(); - out.println("HTTP Session Key Test

    HTTP Session Test 1: Session Key
    Init time: " - + initTime + "

    "); - hitCount++; - out.println("Hit Count: " + hitCount + "
    Your HTTP Session key is " + SessionID + "
    "); - } catch (Exception e) { - // log the excecption - Log.error(e, "PingSession1.doGet(..l.): error."); - // set the server responce to 500 and forward to the web app defined - // error page - response.sendError(500, "PingSession1.doGet(...): error. " + e.toString()); - } - } - - /** - * returns a string of information about the servlet - * - * @return info String: contains info about the servlet - **/ - - @Override - public String getServletInfo() { - return "HTTP Session Key: Tests management of a read only unique id"; - } - - /** - * called when the class is loaded to initialize the servlet - * - * @param config - * ServletConfig: - **/ - @Override - public void init(ServletConfig config) throws ServletException { - super.init(config); - count = 0; - hitCount = 0; - initTime = new java.util.Date().toString(); - - } -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/PingSession2.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/PingSession2.java deleted file mode 100644 index f5f6b41d..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/PingSession2.java +++ /dev/null @@ -1,143 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2015. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.web.prims; - -import com.ibm.websphere.samples.daytrader.util.Log; -import java.io.IOException; -import java.io.PrintWriter; -import javax.servlet.ServletConfig; -import javax.servlet.ServletException; -import javax.servlet.annotation.WebServlet; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; - -/** - * - * PingHTTPSession2 session create/destroy further extends the previous test by - * invalidating the HTTP Session on every 5th user access. This results in - * testing HTTPSession create and destroy - * - */ -@WebServlet(name = "PingSession2", urlPatterns = { "/servlet/PingSession2" }) -public class PingSession2 extends HttpServlet { - - private static final long serialVersionUID = -273579463475455800L; - private static String initTime; - private static int hitCount; - - /** - * forwards post requests to the doGet method Creation date: (11/6/2000 - * 10:52:39 AM) - * - * @param res - * javax.servlet.http.HttpServletRequest - * @param res2 - * javax.servlet.http.HttpServletResponse - */ - @Override - public void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { - doGet(req, res); - } - - /** - * this is the main method of the servlet that will service all get - * requests. - * - * @param request - * HttpServletRequest - * @param responce - * HttpServletResponce - **/ - @Override - public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - HttpSession session = null; - try { - try { - session = request.getSession(true); - } catch (Exception e) { - Log.error(e, "PingSession2.doGet(...): error getting session"); - // rethrow the exception for handling in one place. - throw e; - - } - - // Get the session data value - Integer ival = (Integer) session.getAttribute("sessiontest.counter"); - // if there is not a counter then create one. - if (ival == null) { - ival = new Integer(1); - } else { - ival = new Integer(ival.intValue() + 1); - } - session.setAttribute("sessiontest.counter", ival); - // if the session count is equal to five invalidate the session - if (ival.intValue() == 5) { - session.invalidate(); - } - - try { - // Output the page - response.setContentType("text/html"); - response.setHeader("SessionTrackingTest-counter", ival.toString()); - - PrintWriter out = response.getWriter(); - out.println("Session Tracking Test 2

    HTTP Session Test 2: Session create/invalidate
    Init time: " - + initTime + "

    "); - hitCount++; - out.println("Hit Count: " + hitCount + "
    Session hits: " + ival + "
    "); - } catch (Exception e) { - Log.error(e, "PingSession2.doGet(...): error getting session information"); - // rethrow the exception for handling in one place. - throw e; - } - - } - - catch (Exception e) { - // log the excecption - Log.error(e, "PingSession2.doGet(...): error."); - // set the server responce to 500 and forward to the web app defined - // error page - response.sendError(500, "PingSession2.doGet(...): error. " + e.toString()); - } - } // end of the method - - /** - * returns a string of information about the servlet - * - * @return info String: contains info about the servlet - **/ - @Override - public String getServletInfo() { - return "HTTP Session Key: Tests management of a read/write unique id"; - } - - /** - * called when the class is loaded to initialize the servlet - * - * @param config - * ServletConfig: - **/ - @Override - public void init(ServletConfig config) throws ServletException { - super.init(config); - hitCount = 0; - initTime = new java.util.Date().toString(); - - } -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/PingSession3.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/PingSession3.java deleted file mode 100644 index 380ff660..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/PingSession3.java +++ /dev/null @@ -1,180 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2015. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.web.prims; - -import com.ibm.websphere.samples.daytrader.util.Log; -import java.io.IOException; -import java.io.PrintWriter; -import javax.servlet.ServletConfig; -import javax.servlet.ServletException; -import javax.servlet.annotation.WebServlet; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; - -/** - * - * PingHTTPSession3 tests the servers ability to manage and persist large - * HTTPSession data objects. The servlet creates the large custom java object - * {@link PingSession3Object}. This large session object is retrieved and stored - * to the session on each user request. The default settings result in approx - * 2024 bits being retrieved and stored upon each request. - * - */ -@WebServlet(name = "PingSession3", urlPatterns = { "/servlet/PingSession3" }) -public class PingSession3 extends HttpServlet { - private static final long serialVersionUID = -6129599971684210414L; - private static int NUM_OBJECTS = 2; - private static String initTime = null; - private static int hitCount = 0; - - /** - * forwards post requests to the doGet method Creation date: (11/6/2000 - * 10:52:39 AM) - * - * @param res - * javax.servlet.http.HttpServletRequest - * @param res2 - * javax.servlet.http.HttpServletResponse - */ - @Override - public void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { - doGet(req, res); - } - - /** - * this is the main method of the servlet that will service all get - * requests. - * - * @param request - * HttpServletRequest - * @param responce - * HttpServletResponce - **/ - @Override - public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - - PrintWriter out = response.getWriter(); - // Using a StringBuffer to output all at once. - StringBuffer outputBuffer = new StringBuffer(); - HttpSession session = null; - PingSession3Object[] sessionData; - response.setContentType("text/html"); - - // this is a general try/catch block. The catch block at the end of this - // will forward the responce - // to an error page if there is an exception - try { - - try { - session = request.getSession(true); - } catch (Exception e) { - Log.error(e, "PingSession3.doGet(...): error getting session"); - // rethrow the exception for handling in one place. - throw e; - - } - // Each PingSession3Object in the PingSession3Object array is 1K in - // size - // NUM_OBJECTS sets the size of the array to allocate and thus set - // the size in KBytes of the session object - // NUM_OBJECTS can be initialized by the servlet - // Here we check for the request parameter to change the size and - // invalidate the session if it exists - // NOTE: Current user sessions will remain the same (i.e. when - // NUM_OBJECTS is changed, all user thread must be restarted - // for the change to fully take effect - - String num_objects; - if ((num_objects = request.getParameter("num_objects")) != null) { - // validate input - try { - int x = Integer.parseInt(num_objects); - if (x > 0) { - NUM_OBJECTS = x; - } - } catch (Exception e) { - Log.error(e, "PingSession3.doGet(...): input should be an integer, input=" + num_objects); - } // revert to current value on exception - - outputBuffer.append(" Session object size set to " + NUM_OBJECTS + "K bytes "); - if (session != null) { - session.invalidate(); - } - out.print(outputBuffer.toString()); - out.close(); - return; - } - - // Get the session data value - sessionData = (PingSession3Object[]) session.getAttribute("sessiontest.sessionData"); - if (sessionData == null) { - sessionData = new PingSession3Object[NUM_OBJECTS]; - for (int i = 0; i < NUM_OBJECTS; i++) { - sessionData[i] = new PingSession3Object(); - } - } - - session.setAttribute("sessiontest.sessionData", sessionData); - - // Each PingSession3Object is about 1024 bits, there are 8 bits in a - // byte. - int num_bytes = (NUM_OBJECTS * 1024) / 8; - response.setHeader("SessionTrackingTest-largeSessionData", num_bytes + "bytes"); - - outputBuffer - .append("Session Large Data Test

    HTTP Session Test 3: Large Data
    Init time: ") - .append(initTime).append("

    "); - hitCount++; - outputBuffer.append("Hit Count: ").append(hitCount) - .append("
    Session object updated. Session Object size = " + num_bytes + " bytes
    "); - // output the Buffer to the printWriter. - out.println(outputBuffer.toString()); - - } catch (Exception e) { - // log the excecption - Log.error(e, "PingSession3.doGet(..l.): error."); - // set the server responce to 500 and forward to the web app defined - // error page - response.sendError(500, "PingSession3.doGet(...): error. " + e.toString()); - } - } - - /** - * returns a string of information about the servlet - * - * @return info String: contains info about the servlet - **/ - @Override - public String getServletInfo() { - return "HTTP Session Object: Tests management of a large custom session class"; - } - - /** - * called when the class is loaded to initialize the servlet - * - * @param config - * ServletConfig: - **/ - @Override - public void init(ServletConfig config) throws ServletException { - super.init(config); - hitCount = 0; - initTime = new java.util.Date().toString(); - - } -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/PingSession3Object.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/PingSession3Object.java deleted file mode 100644 index 000ac231..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/PingSession3Object.java +++ /dev/null @@ -1,92 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2015. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.web.prims; - -import java.io.Serializable; - -/** - * - * An object that contains approximately 1024 bits of information. This is used - * by {@link PingSession3} - * - */ -public class PingSession3Object implements Serializable { - // PingSession3Object represents a BLOB of session data of various. - // Each instantiation of this class is approximately 1K in size (not - // including overhead for arrays and Strings) - // Using different datatype exercises the various serialization algorithms - // for each type - - private static final long serialVersionUID = 1452347702903504717L; - byte[] byteVal = new byte[16]; // 8 * 16 = 128 bits - char[] charVal = new char[8]; // 16 * 8 = 128 bits - int a, b, c, d; // 4 * 32 = 128 bits - float e, f, g, h; // 4 * 32 = 128 bits - double i, j; // 2 * 64 = 128 bits - // Primitive type size = ~5*128= 640 - - String s1 = new String("123456789012"); - String s2 = new String("abcdefghijkl"); - - // String type size = ~2*12*16 = 384 - // Total blob size (w/o overhead) = 1024 - - // The Session blob must be filled with data to avoid compression of the - // blob during serialization - PingSession3Object() { - int index; - byte b = 0x8; - for (index = 0; index < 16; index++) { - byteVal[index] = (byte) (b + 2); - } - - char c = 'a'; - for (index = 0; index < 8; index++) { - charVal[index] = (char) (c + 2); - } - - a = 1; - b = 2; - c = 3; - d = 5; - e = (float) 7.0; - f = (float) 11.0; - g = (float) 13.0; - h = (float) 17.0; - i = 19.0; - j = 23.0; - } - /** - * Main method to test the serialization of the Session Data blob object - * Creation date: (4/3/2000 3:07:34 PM) - * - * @param args - * java.lang.String[] - */ - - /** - * Since the following main method were written for testing purpose, we - * comment them out public static void main(String[] args) { try { - * PingSession3Object data = new PingSession3Object(); - * - * FileOutputStream ostream = new - * FileOutputStream("c:\\temp\\datablob.xxx"); ObjectOutputStream p = new - * ObjectOutputStream(ostream); p.writeObject(data); p.flush(); - * ostream.close(); } catch (Exception e) { System.out.println("Exception: " - * + e.toString()); } } - */ - -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/PingUpgradeServlet.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/PingUpgradeServlet.java deleted file mode 100644 index a3195a99..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/PingUpgradeServlet.java +++ /dev/null @@ -1,155 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2015. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.ibm.websphere.samples.daytrader.web.prims; - -import com.ibm.websphere.samples.daytrader.util.Log; -import java.io.IOException; -import javax.servlet.ReadListener; -import javax.servlet.ServletException; -import javax.servlet.ServletInputStream; -import javax.servlet.ServletOutputStream; -import javax.servlet.annotation.WebServlet; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpUpgradeHandler; -import javax.servlet.http.WebConnection; - -@WebServlet(name = "PingUpgradeServlet", urlPatterns = { "/servlet/PingUpgradeServlet" }, asyncSupported=true) -public class PingUpgradeServlet extends HttpServlet { - private static final long serialVersionUID = -6955518532146927509L; - - - @Override - protected void doGet(final HttpServletRequest req, final HttpServletResponse res) throws ServletException, IOException { - doPost(req,res); - } - - @Override - protected void doPost(final HttpServletRequest req, final HttpServletResponse res) throws ServletException, IOException { - - - Log.trace("PingUpgradeServlet:doPost"); - - - if ("echo".equals(req.getHeader("Upgrade"))) { - - - Log.trace("PingUpgradeServlet:doPost -- found echo, doing upgrade"); - - - res.setStatus(101); - res.setHeader("Upgrade", "echo"); - res.setHeader("Connection", "Upgrade"); - - req.upgrade(Handler.class); - - } else { - - - Log.trace("PingUpgradeServlet:doPost -- did not find echo, no upgrade"); - - - res.getWriter().println("No upgrade: " + req.getHeader("Upgrade")); - } - } - - public static class Handler implements HttpUpgradeHandler { - - @Override - public void init(final WebConnection wc) { - Listener listener = null; - try { - listener = new Listener(wc); - - } catch (IOException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - } - - try { - - Log.trace("PingUpgradeServlet$Handler.init() -- Initializing Handler"); - - - // flush headers if any - wc.getOutputStream().flush(); - wc.getInputStream().setReadListener(listener); - - } catch (IOException e) { - throw new IllegalArgumentException(e); - } - } - - @Override - public void destroy() { - Log.trace("PingUpgradeServlet$Handler.destroy() -- Destroying Handler"); - } - } - - private static class Listener implements ReadListener { - private final WebConnection connection; - private ServletInputStream input = null; - private ServletOutputStream output = null; - - private Listener(final WebConnection connection) throws IOException { - this.connection = connection; - this.input = connection.getInputStream(); - this.output = connection.getOutputStream(); - } - - @Override - public void onDataAvailable() throws IOException { - - Log.trace("PingUpgradeServlet$Listener.onDataAvailable() called"); - - byte[] data = new byte[1024]; - int len = -1; - - while (input.isReady() && (len = input.read(data)) != -1) { - String dataRead = new String(data, 0, len); - - Log.trace("PingUpgradeServlet$Listener.onDataAvailable() -- Adding data to queue -->" + dataRead + "<--"); - - output.println(dataRead); - output.flush(); - } - - closeConnection(); - } - - private void closeConnection() { - try { - connection.close(); - } catch (Exception e) { - - Log.error(e.toString()); - } - } - - - @Override - public void onAllDataRead() throws IOException { - closeConnection(); - } - - @Override - public void onError(final Throwable t) { - closeConnection(); - } - } -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/PingWebSocketBinary.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/PingWebSocketBinary.java deleted file mode 100644 index 45cbe75b..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/PingWebSocketBinary.java +++ /dev/null @@ -1,64 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2015. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.ibm.websphere.samples.daytrader.web.prims; - -import java.io.IOException; -import java.nio.ByteBuffer; -import javax.websocket.CloseReason; -import javax.websocket.EndpointConfig; -import javax.websocket.OnClose; -import javax.websocket.OnError; -import javax.websocket.OnMessage; -import javax.websocket.OnOpen; -import javax.websocket.Session; -import javax.websocket.server.ServerEndpoint; - -/** This class a simple websocket that echos the binary it has been sent. */ - -@ServerEndpoint(value = "/pingBinary") -public class PingWebSocketBinary { - - private Session currentSession = null; - - @OnOpen - public void onOpen(final Session session, EndpointConfig ec) { - currentSession = session; - } - - @OnMessage - public void ping(ByteBuffer data) { - currentSession.getAsyncRemote().sendBinary(data); - } - - @OnError - public void onError(Throwable t) { - t.printStackTrace(); - } - - @OnClose - public void onClose(Session session, CloseReason reason) { - - try { - if (session.isOpen()) { - session.close(); - } - } catch (IOException e) { - e.printStackTrace(); - } - } - -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/PingWebSocketJson.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/PingWebSocketJson.java deleted file mode 100644 index 249c3bf8..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/PingWebSocketJson.java +++ /dev/null @@ -1,114 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2015. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.ibm.websphere.samples.daytrader.web.prims; - -import com.ibm.websphere.samples.daytrader.web.websocket.JsonDecoder; -import com.ibm.websphere.samples.daytrader.web.websocket.JsonEncoder; -import com.ibm.websphere.samples.daytrader.web.websocket.JsonMessage; -import java.io.IOException; -import javax.enterprise.concurrent.ManagedThreadFactory; -import javax.naming.InitialContext; -import javax.naming.NamingException; -import javax.websocket.CloseReason; -import javax.websocket.EndpointConfig; -import javax.websocket.OnClose; -import javax.websocket.OnError; -import javax.websocket.OnMessage; -import javax.websocket.OnOpen; -import javax.websocket.Session; -import javax.websocket.server.ServerEndpoint; - -/** This class a simple websocket that sends the number of times it has been pinged. */ - -@ServerEndpoint(value = "/pingWebSocketJson",encoders=JsonEncoder.class ,decoders=JsonDecoder.class) -public class PingWebSocketJson { - - private Session currentSession = null; - private Integer sentHitCount = null; - private Integer receivedHitCount = null; - - @OnOpen - public void onOpen(final Session session, EndpointConfig ec) { - currentSession = session; - sentHitCount = 0; - receivedHitCount = 0; - - - InitialContext context; - ManagedThreadFactory mtf = null; - - try { - context = new InitialContext(); - mtf = (ManagedThreadFactory) context.lookup("java:comp/DefaultManagedThreadFactory"); - - } catch (NamingException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - } - - Thread thread = mtf.newThread(new Runnable() { - - @Override - public void run() { - - try { - - Thread.sleep(500); - - while (currentSession.isOpen()) { - sentHitCount++; - - JsonMessage response = new JsonMessage(); - response.setKey("sentHitCount"); - response.setValue(sentHitCount.toString()); - currentSession.getAsyncRemote().sendObject(response); - - Thread.sleep(100); - } - - - } catch (InterruptedException e) { - e.printStackTrace(); - } - } - - }); - - thread.start(); - - } - - @OnMessage - public void ping(JsonMessage message) throws IOException { - receivedHitCount++; - JsonMessage response = new JsonMessage(); - response.setKey("receivedHitCount"); - response.setValue(receivedHitCount.toString()); - currentSession.getAsyncRemote().sendObject(response); - } - - @OnError - public void onError(Throwable t) { - t.printStackTrace(); - } - - @OnClose - public void onClose(Session session, CloseReason reason) { - - } - -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/PingWebSocketTextAsync.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/PingWebSocketTextAsync.java deleted file mode 100644 index 7dfdcff9..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/PingWebSocketTextAsync.java +++ /dev/null @@ -1,70 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2015. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.web.prims; - -import javax.websocket.CloseReason; -import javax.websocket.EndpointConfig; -import javax.websocket.OnClose; -import javax.websocket.OnError; -import javax.websocket.OnMessage; -import javax.websocket.OnOpen; -import javax.websocket.SendHandler; -import javax.websocket.SendResult; -import javax.websocket.Session; -import javax.websocket.server.ServerEndpoint; - -/** This class a simple websocket that sends the number of times it has been pinged. */ - -@ServerEndpoint(value = "/pingTextAsync") -public class PingWebSocketTextAsync { - - private Session currentSession = null; - private Integer hitCount = null; - - @OnOpen - public void onOpen(final Session session, EndpointConfig ec) { - currentSession = session; - hitCount = 0; - } - - @OnMessage - public void ping(String text) { - - - hitCount++; - currentSession.getAsyncRemote().sendText(hitCount.toString(), new SendHandler() { - - @Override - public void onResult(SendResult result) { - if (!result.isOK()) { - System.out.println("NOT OK"); - } - } - } - ); - } - - @OnError - public void onError(Throwable t) { - t.printStackTrace(); - } - - @OnClose - public void onClose(Session session, CloseReason reason) { - - } - -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/PingWebSocketTextSync.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/PingWebSocketTextSync.java deleted file mode 100644 index 8de31756..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/PingWebSocketTextSync.java +++ /dev/null @@ -1,63 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2015. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.web.prims; - -import java.io.IOException; -import javax.websocket.CloseReason; -import javax.websocket.EndpointConfig; -import javax.websocket.OnClose; -import javax.websocket.OnError; -import javax.websocket.OnMessage; -import javax.websocket.OnOpen; -import javax.websocket.Session; -import javax.websocket.server.ServerEndpoint; - -/** This class a simple websocket that sends the number of times it has been pinged. */ - -@ServerEndpoint(value = "/pingTextSync") -public class PingWebSocketTextSync { - - private Session currentSession = null; - private Integer hitCount = null; - - @OnOpen - public void onOpen(final Session session, EndpointConfig ec) { - currentSession = session; - hitCount = 0; - } - - @OnMessage - public void ping(String text) { - hitCount++; - - try { - currentSession.getBasicRemote().sendText(hitCount.toString()); - } catch (IOException e) { - e.printStackTrace(); - } - } - - @OnError - public void onError(Throwable t) { - t.printStackTrace(); - } - - @OnClose - public void onClose(Session session, CloseReason reason) { - - } - -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/beanval/CDIMethodConstraintBean.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/beanval/CDIMethodConstraintBean.java deleted file mode 100644 index 3fb32cbf..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/beanval/CDIMethodConstraintBean.java +++ /dev/null @@ -1,46 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2019. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.web.prims.beanval; - -import java.time.LocalDateTime; -import java.util.ArrayList; -import java.util.List; -import javax.enterprise.context.RequestScoped; -import javax.validation.constraints.Min; -import javax.validation.constraints.NotNull; -import javax.validation.constraints.PastOrPresent; -import javax.validation.constraints.Size; - -@RequestScoped -public class CDIMethodConstraintBean { - - private static int hitCount = 0; - private List list = new ArrayList<>(); - - // Dumb primitive, beanval checks that the date passed in is valid and that the - // return is > 0; - @Min(1) - public int getHitCount(@NotNull @PastOrPresent LocalDateTime now) { - list.add(++hitCount); - return hitCount; - } - - @Size(max=1) - public List<@Min(1) Integer> hitList() { - return list; - } - -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/beanval/PingServletBeanValCDI.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/beanval/PingServletBeanValCDI.java deleted file mode 100644 index 463b54a1..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/beanval/PingServletBeanValCDI.java +++ /dev/null @@ -1,105 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2019. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.web.prims.beanval; - -import com.ibm.websphere.samples.daytrader.util.Log; -import java.io.IOException; -import java.time.LocalDateTime; -import javax.inject.Inject; -import javax.servlet.ServletConfig; -import javax.servlet.ServletException; -import javax.servlet.ServletOutputStream; -import javax.servlet.annotation.WebServlet; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -@WebServlet(name = "PingServletBeanValCDI", urlPatterns = { "/servlet/PingServletBeanValCDI" }) -public class PingServletBeanValCDI extends HttpServlet { - - @Inject CDIMethodConstraintBean hitCountBean; - - private static final long serialVersionUID = 7097023236709683760L; - private static LocalDateTime initTime; - - - /** - * forwards post requests to the doGet method Creation date: (11/6/2000 - * 10:52:39 AM) - * - * @param res - * javax.servlet.http.HttpServletRequest - * @param res2 - * javax.servlet.http.HttpServletResponse - */ - @Override - public void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { - doGet(req, res); - } - - /** - * this is the main method of the servlet that will service all get - * requests. - * - * @param request - * HttpServletRequest - * @param responce - * HttpServletResponce - **/ - @Override - public void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { - try { - res.setContentType("text/html"); - - ServletOutputStream out = res.getOutputStream(); - - int currentHitCount = hitCountBean.getHitCount(initTime); - hitCountBean.hitList(); - - out.println("Ping Servlet Bean Validation CDI" - + "

    Ping Servlet Bean Validation CDI
    Init time : " + initTime - + "

    Hit Count: " + currentHitCount + ""); - } catch (Exception e) { - Log.error(e, "PingServlet.doGet(...): general exception caught"); - res.sendError(500, e.toString()); - - } - } - - /** - * returns a string of information about the servlet - * - * @return info String: contains info about the servlet - **/ - @Override - public String getServletInfo() { - return "Basic dynamic HTML generation through a servlet"; - } - - /** - * called when the class is loaded to initialize the servlet - * - * @param config - * ServletConfig: - **/ - @Override - public void init(ServletConfig config) throws ServletException { - super.init(config); - initTime = LocalDateTime.now(); - - - } -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/beanval/PingServletBeanValSimple1.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/beanval/PingServletBeanValSimple1.java deleted file mode 100644 index 0aa3b504..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/beanval/PingServletBeanValSimple1.java +++ /dev/null @@ -1,104 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2019. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.web.prims.beanval; - -import com.ibm.websphere.samples.daytrader.util.Log; -import java.io.IOException; -import java.time.LocalDateTime; -import javax.servlet.ServletConfig; -import javax.servlet.ServletException; -import javax.servlet.ServletOutputStream; -import javax.servlet.annotation.WebServlet; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -@WebServlet(name = "PingServletBeanValSimple1", urlPatterns = { "/servlet/PingServletBeanValSimple1" }) -public class PingServletBeanValSimple1 extends HttpServlet { - - private static final long serialVersionUID = 7097023236709683760L; - private static LocalDateTime initTime; - private static int hitCount = 0; - - - /** - * forwards post requests to the doGet method Creation date: (11/6/2000 - * 10:52:39 AM) - * - * @param res - * javax.servlet.http.HttpServletRequest - * @param res2 - * javax.servlet.http.HttpServletResponse - */ - @Override - public void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { - doGet(req, res); - } - - /** - * this is the main method of the servlet that will service all get - * requests. - * - * @param request - * HttpServletRequest - * @param responce - * HttpServletResponce - **/ - @Override - public void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { - try { - res.setContentType("text/html"); - - SimpleBean1 simpleBean1 = new SimpleBean1(); - simpleBean1.checkInjectionValidation(); - - ServletOutputStream out = res.getOutputStream(); - - int currentHitCount = ++hitCount; - out.println("Ping Servlet Bean Validation Simple" - + "

    Ping Servlet Bean Validation Simple
    Init time : " + initTime - + "

    Hit Count: " + currentHitCount + ""); - } catch (Exception e) { - Log.error(e, "PingServlet.doGet(...): general exception caught"); - res.sendError(500, e.toString()); - - } - } - - /** - * returns a string of information about the servlet - * - * @return info String: contains info about the servlet - **/ - @Override - public String getServletInfo() { - return "Basic dynamic HTML generation through a servlet"; - } - - /** - * called when the class is loaded to initialize the servlet - * - * @param config - * ServletConfig: - **/ - @Override - public void init(ServletConfig config) throws ServletException { - super.init(config); - initTime = LocalDateTime.now(); - - - } -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/beanval/PingServletBeanValSimple2.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/beanval/PingServletBeanValSimple2.java deleted file mode 100644 index 938ed202..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/beanval/PingServletBeanValSimple2.java +++ /dev/null @@ -1,104 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2019. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.web.prims.beanval; - -import com.ibm.websphere.samples.daytrader.util.Log; -import java.io.IOException; -import java.time.LocalDateTime; -import javax.servlet.ServletConfig; -import javax.servlet.ServletException; -import javax.servlet.ServletOutputStream; -import javax.servlet.annotation.WebServlet; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -@WebServlet(name = "PingServletBeanValSimple2", urlPatterns = { "/servlet/PingServletBeanValSimple2" }) -public class PingServletBeanValSimple2 extends HttpServlet { - - private static final long serialVersionUID = 7097023236709683760L; - private static LocalDateTime initTime; - private static int hitCount = 0; - - - /** - * forwards post requests to the doGet method Creation date: (11/6/2000 - * 10:52:39 AM) - * - * @param res - * javax.servlet.http.HttpServletRequest - * @param res2 - * javax.servlet.http.HttpServletResponse - */ - @Override - public void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { - doGet(req, res); - } - - /** - * this is the main method of the servlet that will service all get - * requests. - * - * @param request - * HttpServletRequest - * @param responce - * HttpServletResponce - **/ - @Override - public void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { - try { - res.setContentType("text/html"); - - SimpleBean2 simpleBean2 = new SimpleBean2(); - simpleBean2.checkInjectionValidation(); - - ServletOutputStream out = res.getOutputStream(); - - int currentHitCount = ++hitCount; - out.println("Ping Servlet Bean Validation Simple" - + "

    Ping Servlet Bean Validation Simple
    Init time : " + initTime - + "

    Hit Count: " + currentHitCount + ""); - } catch (Exception e) { - Log.error(e, "PingServlet.doGet(...): general exception caught"); - res.sendError(500, e.toString()); - - } - } - - /** - * returns a string of information about the servlet - * - * @return info String: contains info about the servlet - **/ - @Override - public String getServletInfo() { - return "Basic dynamic HTML generation through a servlet"; - } - - /** - * called when the class is loaded to initialize the servlet - * - * @param config - * ServletConfig: - **/ - @Override - public void init(ServletConfig config) throws ServletException { - super.init(config); - initTime = LocalDateTime.now(); - - - } -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/beanval/SimpleBean1.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/beanval/SimpleBean1.java deleted file mode 100644 index 66917168..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/beanval/SimpleBean1.java +++ /dev/null @@ -1,115 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2019. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.web.prims.beanval; - -import java.util.Set; -import java.util.logging.Level; -import java.util.logging.Logger; -import javax.naming.Context; -import javax.naming.InitialContext; -import javax.validation.ConstraintViolation; -import javax.validation.Validator; -import javax.validation.ValidatorFactory; -import javax.validation.constraints.Max; -import javax.validation.constraints.Min; -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Pattern; -import javax.validation.constraints.Size; - -public class SimpleBean1 { - /** - * Logging support and the static initializer for this class. Used to trace file - * version information. This will display the current version of the class in the - * debug log at the time the class is loaded. - */ - private static final String thisClass = SimpleBean1.class.getName(); - private static Logger traceLogger = Logger.getLogger(thisClass); - private static ValidatorFactory validatorFactory = null; - private Validator validator; - - @Min(1) - int iMin = 1; - @Max(1) - Integer iMax = 1; - @Size(min = 1) - int[] iMinArray = { 1 }; - @Size(max = 1) - Integer[] iMaxArray = { 1 }; - @Pattern(regexp = "[a-z][a-z]*", message = "go to your room!") - String pattern = "mypattern"; - - - - boolean setToFail = false; - - - - public SimpleBean1() throws Exception { - if (validatorFactory == null) { - Context nContext = new InitialContext(); - validatorFactory = (ValidatorFactory) nContext.lookup("java:comp/ValidatorFactory"); - - } - validator = validatorFactory.getValidator(); - } - - @NotNull - public String getDesc() { - return pattern; - } - - public void checkInjectionValidation() { - - traceLogger.entering(thisClass, "checkInjectionValidation", this); - - Set> cvSet = validator.validate(this); - - if (!cvSet.isEmpty()) { - String msg = formatConstraintViolations(cvSet); - traceLogger.log(Level.INFO, "Some reason cvSet was not null: " + cvSet + ", " + msg); - - throw new IllegalStateException("validation should not have found constraints: " + msg); - } - - traceLogger.exiting(thisClass, "checkInjectionValidation "); - } - - - @Override - public String toString() { - String result = "iMin:" + iMin + " iMax:" + iMax + " iMinArray:" + iMinArray + " iMaxArray:" + iMaxArray + " pattern:" + pattern - + " setToFail:" + setToFail; - - return result; - } - - /** - * Convert the constraint violations for use within WAS diagnostic logs. - * - * @return a String representation of the constraint violations formatted one per line and uniformly indented. - */ - public String formatConstraintViolations(Set> cvSet) { - traceLogger.entering(thisClass, "formatConstraintViolations " + cvSet); - - StringBuffer msg = new StringBuffer(); - for (ConstraintViolation cv : cvSet) { - msg.append("\n\t" + cv.toString()); - } - - traceLogger.exiting(thisClass, "formatConstraintViolations " + msg); - return msg.toString(); - } -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/beanval/SimpleBean2.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/beanval/SimpleBean2.java deleted file mode 100644 index 1fa6e833..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/beanval/SimpleBean2.java +++ /dev/null @@ -1,46 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2019. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.web.prims.beanval; - -import java.time.LocalDateTime; -import java.util.ArrayList; -import java.util.List; -import javax.validation.constraints.FutureOrPresent; -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.PastOrPresent; -import javax.validation.constraints.PositiveOrZero; - -public class SimpleBean2 extends SimpleBean1 { - - private List<@PositiveOrZero Integer> numbers= new ArrayList(); - private List<@NotBlank String> strings = new ArrayList(); - - @PastOrPresent - LocalDateTime now = LocalDateTime.now(); - - @FutureOrPresent - LocalDateTime future = LocalDateTime.now().plusDays(1); - - public SimpleBean2() throws Exception { - super(); - - numbers.add(1); - numbers.add(2); - - strings.add("string1"); - strings.add("string2"); - } -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/cdi/CDIEventProducer.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/cdi/CDIEventProducer.java deleted file mode 100644 index 7678138b..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/cdi/CDIEventProducer.java +++ /dev/null @@ -1,49 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2019. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.web.prims.cdi; - -import javax.annotation.Resource; -import javax.enterprise.concurrent.ManagedExecutorService; -import javax.enterprise.context.ApplicationScoped; -import javax.enterprise.event.Event; -import javax.enterprise.event.NotificationOptions; -import javax.inject.Inject; - -@ApplicationScoped //? -public class CDIEventProducer { - - @Resource - private ManagedExecutorService mes; - - @Inject - @Hit - Event hitCountEvent; - - @Inject - @HitAsync - Event hitCountEventAsync; - - public void produceSyncEvent() { - hitCountEvent.fire("hitCount++"); - } - - public void produceAsyncEvent() { - hitCountEventAsync.fireAsync("hitCount++", NotificationOptions.builder().setExecutor(mes).build()); - } - - - -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/cdi/Hit.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/cdi/Hit.java deleted file mode 100644 index 1cc3ee30..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/cdi/Hit.java +++ /dev/null @@ -1,28 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2019. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.web.prims.cdi; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; -import javax.inject.Qualifier; - -@Qualifier -@Retention(RetentionPolicy.RUNTIME) -@Target({ElementType.METHOD, ElementType.FIELD, ElementType.PARAMETER, ElementType.TYPE}) -public @interface Hit { -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/cdi/HitAsync.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/cdi/HitAsync.java deleted file mode 100644 index 02cfd635..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/cdi/HitAsync.java +++ /dev/null @@ -1,28 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2019. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.web.prims.cdi; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; -import javax.inject.Qualifier; - -@Qualifier -@Retention(RetentionPolicy.RUNTIME) -@Target({ElementType.METHOD, ElementType.FIELD, ElementType.PARAMETER, ElementType.TYPE}) -public @interface HitAsync { -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/cdi/PingCDIBean.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/cdi/PingCDIBean.java deleted file mode 100755 index 2a0270e3..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/cdi/PingCDIBean.java +++ /dev/null @@ -1,58 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2015. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.web.prims.cdi; - -import java.util.Set; -import javax.enterprise.context.RequestScoped; -import javax.enterprise.inject.spi.Bean; -import javax.enterprise.inject.spi.BeanManager; -import javax.enterprise.inject.spi.CDI; -import javax.naming.InitialContext; - -@RequestScoped -@PingInterceptorBinding -public class PingCDIBean { - - private static int helloHitCount = 0; - private static int getBeanManagerHitCountJNDI = 0; - private static int getBeanManagerHitCountSPI = 0; - - - public int hello() { - return ++helloHitCount; - } - - public int getBeanMangerViaJNDI() throws Exception { - BeanManager beanManager = (BeanManager) new InitialContext().lookup("java:comp/BeanManager"); - Set> beans = beanManager.getBeans(Object.class); - if (beans.size() > 0) { - return ++getBeanManagerHitCountJNDI; - } - return 0; - - } - - public int getBeanMangerViaCDICurrent() throws Exception { - BeanManager beanManager = CDI.current().getBeanManager(); - Set> beans = beanManager.getBeans(Object.class); - - if (beans.size() > 0) { - return ++getBeanManagerHitCountSPI; - } - return 0; - - } -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/cdi/PingCDIJSFBean.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/cdi/PingCDIJSFBean.java deleted file mode 100755 index e7960b83..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/cdi/PingCDIJSFBean.java +++ /dev/null @@ -1,32 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2016. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.web.prims.cdi; - -import java.io.Serializable; -import javax.enterprise.context.SessionScoped; -import javax.inject.Named; - -@Named -@SessionScoped -public class PingCDIJSFBean implements Serializable { - - private static final long serialVersionUID = -7475815494313679416L; - private int hitCount = 0; - - public int getHitCount() { - return ++hitCount; - } -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/cdi/PingEJBIFace.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/cdi/PingEJBIFace.java deleted file mode 100755 index 28bd563f..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/cdi/PingEJBIFace.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2016. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.web.prims.cdi; - -/** - * EJB interface - */ -public interface PingEJBIFace { - - public String getMsg(); -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/cdi/PingEJBLocal.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/cdi/PingEJBLocal.java deleted file mode 100755 index 378d76bb..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/cdi/PingEJBLocal.java +++ /dev/null @@ -1,41 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2015. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.web.prims.cdi; - -import javax.ejb.Local; -import javax.ejb.Stateful; - -/** - * - */ -@Stateful -@Local -public class PingEJBLocal implements PingEJBIFace { - - private static int hitCount; - - /* - * (non-Javadoc) - * - * @see com.ibm.websphere.samples.daytrader.web.prims.EJBIFace#getMsg() - */ - @Override - public String getMsg() { - - return "PingEJBLocal: " + hitCount++; - } - -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/cdi/PingEJBLocalDecorator.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/cdi/PingEJBLocalDecorator.java deleted file mode 100755 index 8829e98f..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/cdi/PingEJBLocalDecorator.java +++ /dev/null @@ -1,43 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2015. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.web.prims.cdi; - -import javax.annotation.Priority; -import javax.decorator.Decorator; -import javax.decorator.Delegate; -import javax.inject.Inject; -import javax.interceptor.Interceptor; - -@Decorator -@Priority(Interceptor.Priority.APPLICATION) -public class PingEJBLocalDecorator implements PingEJBIFace { - - /* - * (non-Javadoc) - * - * @see com.ibm.websphere.samples.daytrader.web.prims.EJBIFace#getMsg() - */ - @Delegate - @Inject - PingEJBIFace ejb; - - @Override - public String getMsg() { - - return "Decorated " + ejb.getMsg(); - } - -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/cdi/PingInterceptor.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/cdi/PingInterceptor.java deleted file mode 100755 index 35ee4466..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/cdi/PingInterceptor.java +++ /dev/null @@ -1,41 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2015. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.web.prims.cdi; - -import java.io.Serializable; -import javax.annotation.Priority; -import javax.interceptor.AroundInvoke; -import javax.interceptor.Interceptor; -import javax.interceptor.InvocationContext; - -/** - * - */ -@PingInterceptorBinding -@Interceptor -@Priority(Interceptor.Priority.APPLICATION) -public class PingInterceptor implements Serializable { - - /** */ - private static final long serialVersionUID = 1L; - - @AroundInvoke - public Object methodInterceptor(InvocationContext ctx) throws Exception { - - //noop - return ctx.proceed(); - } -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/cdi/PingInterceptorBinding.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/cdi/PingInterceptorBinding.java deleted file mode 100755 index 844df726..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/cdi/PingInterceptorBinding.java +++ /dev/null @@ -1,32 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2015. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.web.prims.cdi; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; -import javax.interceptor.InterceptorBinding; - -/** - * - */ -@InterceptorBinding -@Target({ ElementType.TYPE, ElementType.CONSTRUCTOR }) -@Retention(RetentionPolicy.RUNTIME) -public @interface PingInterceptorBinding { - -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/cdi/PingServletCDI.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/cdi/PingServletCDI.java deleted file mode 100755 index 1e7e7966..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/cdi/PingServletCDI.java +++ /dev/null @@ -1,69 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2015. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.web.prims.cdi; - -import java.io.IOException; -import java.io.PrintWriter; -import javax.ejb.EJB; -import javax.inject.Inject; -import javax.servlet.ServletConfig; -import javax.servlet.ServletException; -import javax.servlet.annotation.WebServlet; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -@WebServlet("/servlet/PingServletCDI") -public class PingServletCDI extends HttpServlet { - - private static final long serialVersionUID = -1803544618879689949L; - private static String initTime; - - @Inject - PingCDIBean cdiBean; - - @EJB - PingEJBIFace ejb; - - @Override - protected void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException { - - PrintWriter pw = response.getWriter(); - pw.write("Ping Servlet CDI" - + "

    Ping Servlet CDI
    Init time : " + initTime - + "

    "); - - pw.write("hitCount: " + cdiBean.hello() + "
    "); - pw.write("hitCount: " + ejb.getMsg() + "
    "); - - pw.flush(); - pw.close(); - - } - - /** - * called when the class is loaded to initialize the servlet - * - * @param config - * ServletConfig: - **/ - @Override - public void init(ServletConfig config) throws ServletException { - super.init(config); - initTime = new java.util.Date().toString(); - - } -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/cdi/PingServletCDIBeanManagerViaCDICurrent.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/cdi/PingServletCDIBeanManagerViaCDICurrent.java deleted file mode 100644 index 3ac56fb9..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/cdi/PingServletCDIBeanManagerViaCDICurrent.java +++ /dev/null @@ -1,70 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2015. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.web.prims.cdi; - -import java.io.IOException; -import java.io.PrintWriter; -import javax.inject.Inject; -import javax.servlet.ServletConfig; -import javax.servlet.ServletException; -import javax.servlet.annotation.WebServlet; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -@WebServlet("/servlet/PingServletCDIBeanManagerViaCDICurrent") -public class PingServletCDIBeanManagerViaCDICurrent extends HttpServlet { - - private static final long serialVersionUID = -1803544618879689949L; - private static String initTime; - - @Inject - PingCDIBean cdiBean; - - - - @Override - protected void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException { - - PrintWriter pw = response.getWriter(); - pw.write("Ping Servlet CDI Bean Manager" - + "

    Ping Servlet CDI Bean Manager
    Init time : " + initTime - + "

    "); - - try { - pw.write("hitCount: " + cdiBean.getBeanMangerViaCDICurrent() + ""); - } catch (Exception e) { - e.printStackTrace(); - } - - pw.flush(); - pw.close(); - - } - - /** - * called when the class is loaded to initialize the servlet - * - * @param config - * ServletConfig: - **/ - @Override - public void init(ServletConfig config) throws ServletException { - super.init(config); - initTime = new java.util.Date().toString(); - - } -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/cdi/PingServletCDIBeanManagerViaJNDI.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/cdi/PingServletCDIBeanManagerViaJNDI.java deleted file mode 100755 index dd9457ec..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/cdi/PingServletCDIBeanManagerViaJNDI.java +++ /dev/null @@ -1,70 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2015. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.web.prims.cdi; - -import java.io.IOException; -import java.io.PrintWriter; -import javax.inject.Inject; -import javax.servlet.ServletConfig; -import javax.servlet.ServletException; -import javax.servlet.annotation.WebServlet; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -@WebServlet("/servlet/PingServletCDIBeanManagerViaJNDI") -public class PingServletCDIBeanManagerViaJNDI extends HttpServlet { - - private static final long serialVersionUID = -1803544618879689949L; - private static String initTime; - - @Inject - PingCDIBean cdiBean; - - - - @Override - protected void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException { - - PrintWriter pw = response.getWriter(); - pw.write("Ping Servlet CDI Bean Manager" - + "

    Ping Servlet CDI Bean Manager
    Init time : " + initTime - + "

    "); - - try { - pw.write("hitCount: " + cdiBean.getBeanMangerViaJNDI() + ""); - } catch (Exception e) { - e.printStackTrace(); - } - - pw.flush(); - pw.close(); - - } - - /** - * called when the class is loaded to initialize the servlet - * - * @param config - * ServletConfig: - **/ - @Override - public void init(ServletConfig config) throws ServletException { - super.init(config); - initTime = new java.util.Date().toString(); - - } -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/cdi/PingServletCDIEvent.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/cdi/PingServletCDIEvent.java deleted file mode 100644 index 2cb5d05b..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/cdi/PingServletCDIEvent.java +++ /dev/null @@ -1,77 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2015. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.web.prims.cdi; - -import java.io.IOException; -import java.io.PrintWriter; -import javax.enterprise.event.Observes; -import javax.inject.Inject; -import javax.servlet.ServletConfig; -import javax.servlet.ServletException; -import javax.servlet.annotation.WebServlet; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - - -@WebServlet("/servlet/PingServletCDIEvent") -public class PingServletCDIEvent extends HttpServlet { - - private static final long serialVersionUID = -1803544618879689949L; - private static String initTime; - private static int hitCount; - - @Inject - CDIEventProducer cdiEventProducer; - - @Override - protected void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException { - - cdiEventProducer.produceSyncEvent(); - - PrintWriter pw = response.getWriter(); - pw.write("Ping Servlet CDI Event" - + "

    Ping Servlet CDI Event
    Init time : " + initTime - + "

    "); - - try { - pw.write("hitCount1: " + hitCount + ""); - } catch (Exception e) { - e.printStackTrace(); - } - - pw.flush(); - pw.close(); - } - - /** - * called when the class is loaded to initialize the servlet - * - * @param config - * ServletConfig: - **/ - @Override - public void init(ServletConfig config) throws ServletException { - super.init(config); - initTime = new java.util.Date().toString(); - hitCount = 0; - - } - - public void onEvent(@Observes @Hit String event) { - hitCount++; - } -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/cdi/PingServletCDIEventAsync.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/cdi/PingServletCDIEventAsync.java deleted file mode 100644 index 6ead268b..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/cdi/PingServletCDIEventAsync.java +++ /dev/null @@ -1,87 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2015. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.web.prims.cdi; - -import com.ibm.websphere.samples.daytrader.util.Log; -import java.io.IOException; -import java.io.PrintWriter; -import javax.annotation.Priority; -import javax.enterprise.event.ObservesAsync; -import javax.inject.Inject; -import javax.interceptor.Interceptor; -import javax.servlet.ServletConfig; -import javax.servlet.ServletException; -import javax.servlet.annotation.WebServlet; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -@WebServlet("/servlet/PingServletCDIEventAsync") -public class PingServletCDIEventAsync extends HttpServlet { - - private static final long serialVersionUID = -1803544618879689949L; - private static String initTime; - private static int hitCount1; - private static int hitCount2; - - @Inject - CDIEventProducer cdiEventProducer; - - @Override - protected void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException { - - cdiEventProducer.produceAsyncEvent(); - - PrintWriter pw = response.getWriter(); - pw.write("Ping Servlet CDI Event Async" - + "

    Ping Servlet CDI Event Async
    Init time : " + initTime - + "

    "); - - try { - pw.write("hitCount1: " + hitCount1 + "
    hitCount2: " + hitCount2 + ""); - } catch (Exception e) { - e.printStackTrace(); - } - - pw.flush(); - pw.close(); - } - - /** - * called when the class is loaded to initialize the servlet - * - * @param config - * ServletConfig: - **/ - @Override - public void init(ServletConfig config) throws ServletException { - super.init(config); - initTime = new java.util.Date().toString(); - hitCount1 = 0; - hitCount2 = 0; - } - - public void onAsyncEvent1(@ObservesAsync @Priority(Interceptor.Priority.APPLICATION) @HitAsync String event) { - hitCount1++; - } - - public void onAsyncEvent2(@ObservesAsync @Priority(Interceptor.Priority.APPLICATION + 1) @HitAsync String event) { - if (hitCount1 <= hitCount2 ) { - Log.error("Priority Error");; - } - hitCount2++; - } -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/drive/PingServletDrive.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/drive/PingServletDrive.java deleted file mode 100644 index 8f14514c..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/drive/PingServletDrive.java +++ /dev/null @@ -1,110 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2015. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.web.prims.drive; - -import com.ibm.websphere.samples.daytrader.util.Log; -import java.io.IOException; -import javax.servlet.ServletConfig; -import javax.servlet.ServletException; -import javax.servlet.ServletOutputStream; -import javax.servlet.annotation.WebServlet; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -/** - * - * PingServlet tests fundamental dynamic HTML creation functionality through - * server side servlet processing. - * - */ - -@WebServlet(name = "PingServletDrive", urlPatterns = { "/drive/PingServlet" }) -public class PingServletDrive extends HttpServlet { - - private static final long serialVersionUID = 7097023236709683760L; - private static String initTime; - private static int hitCount; - - /** - * forwards post requests to the doGet method Creation date: (11/6/2000 - * 10:52:39 AM) - * - * @param res - * javax.servlet.http.HttpServletRequest - * @param res2 - * javax.servlet.http.HttpServletResponse - */ - @Override - public void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { - doGet(req, res); - } - - /** - * this is the main method of the servlet that will service all get - * requests. - * - * @param request - * HttpServletRequest - * @param responce - * HttpServletResponce - **/ - @Override - public void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { - try { - res.setContentType("text/html"); - - // The following 2 lines are the difference between PingServlet and - // PingServletWriter - // the latter uses a PrintWriter for output versus a binary output - // stream. - ServletOutputStream out = res.getOutputStream(); - // java.io.PrintWriter out = res.getWriter(); - hitCount++; - out.println("Ping Servlet" - + "

    Ping Servlet
    Init time : " + initTime - + "

    Hit Count: " + hitCount + ""); - } catch (Exception e) { - Log.error(e, "PingServlet.doGet(...): general exception caught"); - res.sendError(500, e.toString()); - - } - } - - /** - * returns a string of information about the servlet - * - * @return info String: contains info about the servlet - **/ - @Override - public String getServletInfo() { - return "Basic dynamic HTML generation through a servlet"; - } - - /** - * called when the class is loaded to initialize the servlet - * - * @param config - * ServletConfig: - **/ - @Override - public void init(ServletConfig config) throws ServletException { - super.init(config); - initTime = new java.util.Date().toString(); - hitCount = 0; - - } -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/ejb3/PingServlet2Entity.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/ejb3/PingServlet2Entity.java deleted file mode 100644 index 77232013..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/ejb3/PingServlet2Entity.java +++ /dev/null @@ -1,112 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2015. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.web.prims.ejb3; - -import com.ibm.websphere.samples.daytrader.entities.QuoteDataBean; -import com.ibm.websphere.samples.daytrader.util.Log; -import com.ibm.websphere.samples.daytrader.util.TradeConfig; -import java.io.IOException; -import javax.persistence.EntityManager; -import javax.persistence.PersistenceContext; -import javax.servlet.ServletConfig; -import javax.servlet.ServletException; -import javax.servlet.annotation.WebServlet; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -/** - * - * Primitive designed to run within the TradeApplication and makes use of - * {@link trade_client.TradeConfig} for config parameters and random stock - * symbols. Servlet will generate a random stock symbol and get the price of - * that symbol using a {@link trade.Quote} Entity EJB This tests the common path - * of a Servlet calling an Entity EJB to get data - * - */ - -@WebServlet(name = "ejb3.PingServlet2Entity", urlPatterns = { "/ejb3/PingServlet2Entity" }) -public class PingServlet2Entity extends HttpServlet { - private static final long serialVersionUID = -9004026114063894842L; - - private static String initTime; - - private static int hitCount; - - @PersistenceContext(unitName = "daytrader") - private EntityManager em; - - @Override - public void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { - doGet(req, res); - } - - @Override - public void doGet(HttpServletRequest req, HttpServletResponse res) throws IOException, ServletException { - - res.setContentType("text/html"); - java.io.PrintWriter out = res.getWriter(); - - QuoteDataBean quote = null; - String symbol = null; - - StringBuffer output = new StringBuffer(100); - output.append("Servlet2Entity" + "
    PingServlet2Entity
    " - + "
    PingServlet2Entity accesses an EntityManager" - + " using a PersistenceContext annotaion and then gets the price of a random symbol (generated by TradeConfig)" - + " through the EntityManager find method"); - try { - // generate random symbol - try { - int iter = TradeConfig.getPrimIterations(); - for (int ii = 0; ii < iter; ii++) { - // get a random symbol to look up and get the key to that - // symbol. - symbol = TradeConfig.rndSymbol(); - // find the EntityInstance. - quote = em.find(QuoteDataBean.class, symbol); - } - } catch (Exception e) { - Log.error("web_primtv.PingServlet2Entity.doGet(...): error performing find"); - throw e; - } - // get the price and print the output. - - output.append("
    initTime: " + initTime + "
    Hit Count: ").append(hitCount++); - output.append("
    Quote Information

    " + quote.toHTML()); - output.append("

    "); - out.println(output.toString()); - } catch (Exception e) { - Log.error(e, "PingServlet2Entity.doGet(...): error"); - // this will send an Error to teh web applications defined error - // page. - res.sendError(500, "PingServlet2Entity.doGet(...): error" + e.toString()); - - } - } - - @Override - public String getServletInfo() { - return "web primitive, tests Servlet to Entity EJB path"; - } - - @Override - public void init(ServletConfig config) throws ServletException { - super.init(config); - hitCount = 0; - initTime = new java.util.Date().toString(); - } -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/ejb3/PingServlet2MDBQueue.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/ejb3/PingServlet2MDBQueue.java deleted file mode 100644 index cd102881..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/ejb3/PingServlet2MDBQueue.java +++ /dev/null @@ -1,145 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2015. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.web.prims.ejb3; - -import com.ibm.websphere.samples.daytrader.util.Log; -import com.ibm.websphere.samples.daytrader.util.TradeConfig; -import java.io.IOException; -import javax.annotation.Resource; -import javax.jms.Connection; -import javax.jms.ConnectionFactory; -import javax.jms.JMSContext; -import javax.jms.Queue; -import javax.jms.TextMessage; -import javax.servlet.ServletConfig; -import javax.servlet.ServletException; -import javax.servlet.annotation.WebServlet; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -/** - * This primitive is designed to run inside the TradeApplication and relies upon - * the {@link com.ibm.websphere.samples.daytrader.util.TradeConfig} class to set - * configuration parameters. PingServlet2MDBQueue tests key functionality of a - * servlet call to a post a message to an MDB Queue. The TradeBrokerMDB receives - * the message This servlet makes use of the MDB EJB - * {@link com.ibm.websphere.samples.daytrader.ejb3.DTBroker3MDB} by posting a - * message to the MDB Queue - */ -@WebServlet(name = "ejb3.PingServlet2MDBQueue", urlPatterns = { "/ejb3/PingServlet2MDBQueue" }) -public class PingServlet2MDBQueue extends HttpServlet { - - private static final long serialVersionUID = 2637271552188745216L; - - private static String initTime; - - private static int hitCount; - - @Resource(name = "jms/QueueConnectionFactory", authenticationType = javax.annotation.Resource.AuthenticationType.APPLICATION) - private ConnectionFactory queueConnectionFactory; - - // TODO: Glassfish does not like this - change to lookup? - @Resource(name = "jms/TradeBrokerQueue") - private Queue tradeBrokerQueue; - - @Override - public void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { - doGet(req, res); - } - - @Override - public void doGet(HttpServletRequest req, HttpServletResponse res) throws IOException, ServletException { - - res.setContentType("text/html"); - java.io.PrintWriter out = res.getWriter(); - // use a stringbuffer to avoid concatenation of Strings - StringBuffer output = new StringBuffer(100); - output.append("PingServlet2MDBQueue" - + "
    PingServlet2MDBQueue
    " + "" - + "Tests the basic operation of a servlet posting a message to an EJB MDB through a JMS Queue.
    " - + "Note: Not intended for performance testing."); - - try { - Connection conn = queueConnectionFactory.createConnection(); - - try { - TextMessage message = null; - int iter = TradeConfig.getPrimIterations(); - for (int ii = 0; ii < iter; ii++) { - /*Session sess = conn.createSession(false, Session.AUTO_ACKNOWLEDGE); - try { - MessageProducer producer = sess.createProducer(tradeBrokerQueue); - - message = sess.createTextMessage(); - - String command = "ping"; - message.setStringProperty("command", command); - message.setLongProperty("publishTime", System.currentTimeMillis()); - message.setText("Ping message for queue java:comp/env/jms/TradeBrokerQueue sent from PingServlet2MDBQueue at " + new java.util.Date()); - producer.send(message); - } finally { - sess.close(); - }*/ - - JMSContext context = queueConnectionFactory.createContext(); - - message = context.createTextMessage(); - - message.setStringProperty("command", "ping"); - message.setLongProperty("publishTime", System.currentTimeMillis()); - message.setText("Ping message for queue java:comp/env/jms/TradeBrokerQueue sent from PingServlet2MDBQueue at " + new java.util.Date()); - - context.createProducer().send(tradeBrokerQueue, message); - } - - // write out the output - output.append("
    initTime: ").append(initTime); - output.append("
    Hit Count: ").append(hitCount++); - output.append("
    Posted Text message to java:comp/env/jms/TradeBrokerQueue destination"); - output.append("
    Message: ").append(message); - output.append("

    Message text: ").append(message.getText()); - output.append("

    "); - out.println(output.toString()); - - } catch (Exception e) { - Log.error("PingServlet2MDBQueue.doGet(...):exception posting message to TradeBrokerQueue destination "); - throw e; - } finally { - conn.close(); - } - } // this is where I actually handle the exceptions - catch (Exception e) { - Log.error(e, "PingServlet2MDBQueue.doGet(...): error"); - res.sendError(500, "PingServlet2MDBQueue.doGet(...): error, " + e.toString()); - - } - } - - @Override - public String getServletInfo() { - return "web primitive, configured with trade runtime configs, tests Servlet to Session EJB path"; - - } - - @Override - public void init(ServletConfig config) throws ServletException { - super.init(config); - hitCount = 0; - initTime = new java.util.Date().toString(); - } - -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/ejb3/PingServlet2MDBTopic.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/ejb3/PingServlet2MDBTopic.java deleted file mode 100644 index 8b4609b4..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/ejb3/PingServlet2MDBTopic.java +++ /dev/null @@ -1,146 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2015. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.web.prims.ejb3; - -import com.ibm.websphere.samples.daytrader.util.Log; -import com.ibm.websphere.samples.daytrader.util.TradeConfig; -import java.io.IOException; -import javax.annotation.Resource; -import javax.jms.Connection; -import javax.jms.ConnectionFactory; -import javax.jms.JMSContext; -import javax.jms.TextMessage; -import javax.jms.Topic; -import javax.servlet.ServletConfig; -import javax.servlet.ServletException; -import javax.servlet.annotation.WebServlet; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -/** - * This primitive is designed to run inside the TradeApplication and relies upon - * the {@link com.ibm.websphere.samples.daytrader.util.TradeConfig} class to set - * configuration parameters. PingServlet2MDBQueue tests key functionality of a - * servlet call to a post a message to an MDB Topic. The TradeStreamerMDB (and - * any other subscribers) receives the message This servlet makes use of the MDB - * EJB {@link com.ibm.websphere.samples.daytrader.ejb3.DTStreamer3MDB} by - * posting a message to the MDB Topic - */ -@WebServlet(name = "ejb3.PingServlet2MDBTopic", urlPatterns = { "/ejb3/PingServlet2MDBTopic" }) -public class PingServlet2MDBTopic extends HttpServlet { - - private static final long serialVersionUID = 5925470158886928225L; - - private static String initTime; - - private static int hitCount; - - @Resource(name = "jms/TopicConnectionFactory", authenticationType = javax.annotation.Resource.AuthenticationType.APPLICATION) - private ConnectionFactory topicConnectionFactory; - - // TODO: Glassfish does not like this - change to lookup? - @Resource(name = "jms/TradeStreamerTopic") - private Topic tradeStreamerTopic; - - @Override - public void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { - doGet(req, res); - } - - @Override - public void doGet(HttpServletRequest req, HttpServletResponse res) throws IOException, ServletException { - - res.setContentType("text/html"); - java.io.PrintWriter out = res.getWriter(); - // use a stringbuffer to avoid concatenation of Strings - StringBuffer output = new StringBuffer(100); - output.append("PingServlet2MDBTopic" - + "
    PingServlet2MDBTopic
    " + "" - + "Tests the basic operation of a servlet posting a message to an EJB MDB (and other subscribers) through a JMS Topic.
    " - + "Note: Not intended for performance testing."); - - // we only want to look up the JMS resources once - try { - - Connection conn = topicConnectionFactory.createConnection(); - - try { - TextMessage message = null; - int iter = TradeConfig.getPrimIterations(); - for (int ii = 0; ii < iter; ii++) { - /*Session sess = conn.createSession(false, Session.AUTO_ACKNOWLEDGE); - try { - MessageProducer producer = sess.createProducer(tradeStreamerTopic); - message = sess.createTextMessage(); - - String command = "ping"; - message.setStringProperty("command", command); - message.setLongProperty("publishTime", System.currentTimeMillis()); - message.setText("Ping message for topic java:comp/env/jms/TradeStreamerTopic sent from PingServlet2MDBTopic at " + new java.util.Date()); - - producer.send(message); - } finally { - sess.close(); - }*/ - - JMSContext context = topicConnectionFactory.createContext(); - - message = context.createTextMessage(); - - message.setStringProperty("command", "ping"); - message.setLongProperty("publishTime", System.currentTimeMillis()); - message.setText("Ping message for topic java:comp/env/jms/TradeStreamerTopic sent from PingServlet2MDBTopic at " + new java.util.Date()); - - context.createProducer().send(tradeStreamerTopic, message); - } - - // write out the output - output.append("
    initTime: ").append(initTime); - output.append("
    Hit Count: ").append(hitCount++); - output.append("
    Posted Text message to java:comp/env/jms/TradeStreamerTopic topic"); - output.append("
    Message: ").append(message); - output.append("

    Message text: ").append(message.getText()); - output.append("

    "); - out.println(output.toString()); - - } catch (Exception e) { - Log.error("PingServlet2MDBTopic.doGet(...):exception posting message to TradeStreamerTopic topic"); - throw e; - } finally { - conn.close(); - } - } // this is where I actually handle the exceptions - catch (Exception e) { - Log.error(e, "PingServlet2MDBTopic.doGet(...): error"); - res.sendError(500, "PingServlet2MDBTopic.doGet(...): error, " + e.toString()); - - } - } - - @Override - public String getServletInfo() { - return "web primitive, configured with trade runtime configs, tests Servlet to Session EJB path"; - } - - @Override - public void init(ServletConfig config) throws ServletException { - super.init(config); - hitCount = 0; - initTime = new java.util.Date().toString(); - } - -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/ejb3/PingServlet2Session.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/ejb3/PingServlet2Session.java deleted file mode 100644 index bd29d2ef..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/ejb3/PingServlet2Session.java +++ /dev/null @@ -1,119 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2015. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.web.prims.ejb3; - -import com.ibm.websphere.samples.daytrader.impl.ejb3.TradeSLSBBean; -import com.ibm.websphere.samples.daytrader.interfaces.TradeEJB; -import com.ibm.websphere.samples.daytrader.interfaces.TradeServices; -import com.ibm.websphere.samples.daytrader.util.Log; -import com.ibm.websphere.samples.daytrader.util.TradeConfig; -import java.io.IOException; -import javax.annotation.PostConstruct; -import javax.inject.Inject; -import javax.servlet.ServletConfig; -import javax.servlet.ServletException; -import javax.servlet.annotation.WebServlet; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -/** - * - * This primitive is designed to run inside the TradeApplication and relies upon - * the {@link trade_client.TradeConfig} class to set configuration parameters. - * PingServlet2SessionEJB tests key functionality of a servlet call to a - * stateless SessionEJB. This servlet makes use of the Stateless Session EJB - * {@link trade.Trade} by calling calculateInvestmentReturn with three random - * numbers. - * - */ -@WebServlet(name = "ejb3.PingServlet2Session", urlPatterns = { "/ejb3/PingServlet2Session" }) -public class PingServlet2Session extends HttpServlet { - - private static final long serialVersionUID = 6854998080392777053L; - - private static String initTime; - - private static int hitCount; - - @Inject - @TradeEJB - private TradeServices tradeSLSBLocal; - - - @Override - public void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { - doGet(req, res); - } - - @Override - public void doGet(HttpServletRequest req, HttpServletResponse res) throws IOException, ServletException { - - res.setContentType("text/html"); - java.io.PrintWriter out = res.getWriter(); - // use a stringbuffer to avoid concatenation of Strings - StringBuffer output = new StringBuffer(100); - output.append("PingServlet2SessionLocal" - + "
    PingServlet2SessionLocal
    " + "" - + "Tests the basis path from a Servlet to a Session Bean."); - - try { - - try { - // create three random numbers - double rnd1 = Math.random() * 1000000; - double rnd2 = Math.random() * 1000000; - - // use a function to do some work. - double increase = 0.0; - int iter = TradeConfig.getPrimIterations(); - for (int ii = 0; ii < iter; ii++) { - increase = tradeSLSBLocal.investmentReturn(rnd1, rnd2); - } - - // write out the output - output.append("
    initTime: " + initTime); - output.append("
    Hit Count: " + hitCount++); - output.append("
    Investment Return Information

    investment: " + rnd1); - output.append("
    current Value: " + rnd2); - output.append("
    investment return " + increase + "
    "); - out.println(output.toString()); - - } catch (Exception e) { - Log.error("PingServlet2Session.doGet(...):exception calling trade.investmentReturn "); - throw e; - } - } // this is where I actually handle the exceptions - catch (Exception e) { - Log.error(e, "PingServlet2Session.doGet(...): error"); - res.sendError(500, "PingServlet2Session.doGet(...): error, " + e.toString()); - - } - } - - @Override - public String getServletInfo() { - return "web primitive, configured with trade runtime configs, tests Servlet to Session EJB path"; - - } - - @Override - public void init(ServletConfig config) throws ServletException { - super.init(config); - hitCount = 0; - initTime = new java.util.Date().toString(); - } -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/ejb3/PingServlet2Session2CMROne2Many.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/ejb3/PingServlet2Session2CMROne2Many.java deleted file mode 100644 index d1ed0bc6..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/ejb3/PingServlet2Session2CMROne2Many.java +++ /dev/null @@ -1,112 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2015. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.web.prims.ejb3; - -import com.ibm.websphere.samples.daytrader.entities.OrderDataBean; -import com.ibm.websphere.samples.daytrader.interfaces.TradeEJB; -import com.ibm.websphere.samples.daytrader.interfaces.TradeServices; -import com.ibm.websphere.samples.daytrader.util.Log; -import com.ibm.websphere.samples.daytrader.util.TradeConfig; -import java.io.IOException; -import java.util.Collection; -import java.util.Iterator; -import javax.inject.Inject; -import javax.servlet.ServletConfig; -import javax.servlet.ServletException; -import javax.servlet.annotation.WebServlet; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -/** - * Primitive to test Entity Container Managed Relationshiop One to One Servlet - * will generate a random userID and get the profile for that user using a - * {@link trade.Account} Entity EJB This tests the common path of a Servlet - * calling a Session to Entity EJB to get CMR One to One data - * - */ -@WebServlet(name = "ejb3.PingServlet2Session2CMR2One2Many", urlPatterns = { "/ejb3/PingServlet2Session2CMROne2Many" }) -public class PingServlet2Session2CMROne2Many extends HttpServlet { - private static final long serialVersionUID = -8658929449987440032L; - - private static String initTime; - - private static int hitCount; - - @Inject - @TradeEJB - private TradeServices tradeSLSBLocal; - - @Override - public void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { - doGet(req, res); - } - - @Override - public void doGet(HttpServletRequest req, HttpServletResponse res) throws IOException, ServletException { - - res.setContentType("text/html"); - java.io.PrintWriter out = res.getWriter(); - - String userID = null; - - StringBuffer output = new StringBuffer(100); - output.append("Servlet2Session2CMROne20ne" - + "
    PingServlet2Session2CMROne2Many
    " - + "
    PingServlet2Session2CMROne2Many uses the Trade Session EJB" - + " to get the orders for a user using an EJB 3.0 Entity CMR one to many relationship"); - try { - - Collection orderDataBeans = null; - int iter = TradeConfig.getPrimIterations(); - for (int ii = 0; ii < iter; ii++) { - userID = TradeConfig.rndUserID(); - - // get the users orders and print the output. - orderDataBeans = tradeSLSBLocal.getOrders(userID); - } - - output.append("
    initTime: " + initTime + "
    Hit Count: ").append(hitCount++); - output.append("
    One to Many CMR access of Account Orders from Account Entity
    "); - output.append("
    User: " + userID + " currently has " + orderDataBeans.size() + " stock orders:"); - Iterator it = orderDataBeans.iterator(); - while (it.hasNext()) { - OrderDataBean orderData = (OrderDataBean) it.next(); - output.append("
    " + orderData.toHTML()); - } - output.append("

    "); - out.println(output.toString()); - } catch (Exception e) { - Log.error(e, "PingServlet2Session2CMROne2Many.doGet(...): error"); - // this will send an Error to teh web applications defined error - // page. - res.sendError(500, "PingServlet2Session2CMROne2Many.doGet(...): error" + e.toString()); - - } - } - - @Override - public String getServletInfo() { - return "web primitive, tests Servlet to Entity EJB path"; - } - - @Override - public void init(ServletConfig config) throws ServletException { - super.init(config); - hitCount = 0; - initTime = new java.util.Date().toString(); - } -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/ejb3/PingServlet2Session2CMROne2One.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/ejb3/PingServlet2Session2CMROne2One.java deleted file mode 100644 index 6fa62713..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/ejb3/PingServlet2Session2CMROne2One.java +++ /dev/null @@ -1,105 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2015. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.web.prims.ejb3; - -import com.ibm.websphere.samples.daytrader.entities.AccountProfileDataBean; -import com.ibm.websphere.samples.daytrader.impl.ejb3.TradeSLSBBean; -import com.ibm.websphere.samples.daytrader.interfaces.TradeEJB; -import com.ibm.websphere.samples.daytrader.interfaces.TradeServices; -import com.ibm.websphere.samples.daytrader.util.Log; -import com.ibm.websphere.samples.daytrader.util.TradeConfig; -import java.io.IOException; -import javax.ejb.EJB; -import javax.inject.Inject; -import javax.servlet.ServletConfig; -import javax.servlet.ServletException; -import javax.servlet.annotation.WebServlet; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -/** - * Primitive to test Entity Container Managed Relationshiop One to One Servlet - * will generate a random userID and get the profile for that user using a - * {@link trade.Account} Entity EJB This tests the common path of a Servlet - * calling a Session to Entity EJB to get CMR One to One data - * - */ -@WebServlet(name = "ejb3.PingServlet2Session2CMR2One2One", urlPatterns = { "/ejb3/PingServlet2Session2CMROne2One" }) -public class PingServlet2Session2CMROne2One extends HttpServlet { - private static final long serialVersionUID = 567062418489199248L; - - private static String initTime; - - private static int hitCount; - - @Inject - @TradeEJB - private TradeServices tradeSLSBLocal; - - @Override - public void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { - doGet(req, res); - } - - @Override - public void doGet(HttpServletRequest req, HttpServletResponse res) throws IOException, ServletException { - - res.setContentType("text/html"); - java.io.PrintWriter out = res.getWriter(); - - String userID = null; - - StringBuffer output = new StringBuffer(100); - output.append("Servlet2Session2CMROne20ne" - + "
    PingServlet2Session2CMROne2One
    " - + "
    PingServlet2Session2CMROne2One uses the Trade Session EJB" - + " to get the profile for a user using an EJB 3.0 CMR one to one relationship"); - try { - - AccountProfileDataBean accountProfileData = null; - int iter = TradeConfig.getPrimIterations(); - for (int ii = 0; ii < iter; ii++) { - userID = TradeConfig.rndUserID(); - // get the price and print the output. - accountProfileData = tradeSLSBLocal.getAccountProfileData(userID); - } - - output.append("
    initTime: " + initTime + "
    Hit Count: ").append(hitCount++); - output.append("
    One to One CMR access of AccountProfile Information from Account Entity

    " + accountProfileData.toHTML()); - output.append("

    "); - out.println(output.toString()); - } catch (Exception e) { - Log.error(e, "PingServlet2Session2CMROne2One.doGet(...): error"); - // this will send an Error to teh web applications defined error - // page. - res.sendError(500, "PingServlet2Session2CMROne2One.doGet(...): error" + e.toString()); - - } - } - - @Override - public String getServletInfo() { - return "web primitive, tests Servlet to Entity EJB path"; - } - - @Override - public void init(ServletConfig config) throws ServletException { - super.init(config); - hitCount = 0; - initTime = new java.util.Date().toString(); - } -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/ejb3/PingServlet2Session2Entity.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/ejb3/PingServlet2Session2Entity.java deleted file mode 100644 index e8f4e7ee..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/ejb3/PingServlet2Session2Entity.java +++ /dev/null @@ -1,124 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2015. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.web.prims.ejb3; - -import com.ibm.websphere.samples.daytrader.entities.QuoteDataBean; -import com.ibm.websphere.samples.daytrader.impl.ejb3.TradeSLSBBean; -import com.ibm.websphere.samples.daytrader.interfaces.TradeEJB; -import com.ibm.websphere.samples.daytrader.interfaces.TradeServices; -import com.ibm.websphere.samples.daytrader.util.Log; -import com.ibm.websphere.samples.daytrader.util.TradeConfig; -import java.io.IOException; -import javax.ejb.EJB; -import javax.inject.Inject; -import javax.naming.InitialContext; -import javax.servlet.ServletConfig; -import javax.servlet.ServletException; -import javax.servlet.annotation.WebServlet; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -/** - * - * PingServlet2Session2Entity tests key functionality of a servlet call to a - * stateless SessionEJB, and then to a Entity EJB representing data in a - * database. This servlet makes use of the Stateless Session EJB {@link Trade}, - * and then uses {@link TradeConfig} to generate a random stock symbol. The - * stocks price is looked up using the Quote Entity EJB. - * - */ -@WebServlet(name = "ejb3.PingServlet2Session2Entity", urlPatterns = { "/ejb3/PingServlet2Session2Entity" }) -public class PingServlet2Session2Entity extends HttpServlet { - - private static final long serialVersionUID = -5043457201022265012L; - - private static String initTime; - - private static int hitCount; - - @Inject - @TradeEJB - private TradeServices tradeSLSBLocal; - - @Override - public void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { - doGet(req, res); - } - - @Override - public void doGet(HttpServletRequest req, HttpServletResponse res) throws IOException, ServletException { - - res.setContentType("text/html"); - java.io.PrintWriter out = res.getWriter(); - String symbol = null; - QuoteDataBean quoteData = null; - StringBuffer output = new StringBuffer(100); - - output.append("PingServlet2Session2Entity" - + "
    PingServlet2Session2Entity
    " + "" - + "PingServlet2Session2Entity tests the common path of a Servlet calling a Session EJB " + "which in turn calls an Entity EJB.
    "); - - try { - try { - int iter = TradeConfig.getPrimIterations(); - for (int ii = 0; ii < iter; ii++) { - symbol = TradeConfig.rndSymbol(); - // getQuote will call findQuote which will instaniate the - // Quote Entity Bean - // and then will return a QuoteObject - quoteData = tradeSLSBLocal.getQuote(symbol); - } - } catch (Exception ne) { - Log.error(ne, "PingServlet2Session2Entity.goGet(...): exception getting QuoteData through Trade"); - throw ne; - } - - output.append("
    initTime: " + initTime).append("
    Hit Count: " + hitCount++); - output.append("
    Quote Information

    " + quoteData.toHTML()); - out.println(output.toString()); - - } catch (Exception e) { - Log.error(e, "PingServlet2Session2Entity.doGet(...): General Exception caught"); - res.sendError(500, "General Exception caught, " + e.toString()); - } - } - - @Override - public String getServletInfo() { - return "web primitive, tests Servlet to Session to Entity EJB path"; - - } - - @Override - public void init(ServletConfig config) throws ServletException { - super.init(config); - hitCount = 0; - initTime = new java.util.Date().toString(); - - if (tradeSLSBLocal == null) { - Log.error("PingServlet2Session2Entity:init - Injection of tradeSLSBLocal failed - performing JNDI lookup!"); - - try { - InitialContext context = new InitialContext(); - tradeSLSBLocal = (TradeSLSBBean) context.lookup("java:comp/env/ejb/TradeSLSBBean"); - } catch (Exception ex) { - Log.error("PingServlet2Session2Entity:init - Lookup of tradeSLSBLocal failed!!!"); - ex.printStackTrace(); - } - } - } -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/ejb3/PingServlet2Session2Entity2JSP.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/ejb3/PingServlet2Session2Entity2JSP.java deleted file mode 100644 index 6896b7b1..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/ejb3/PingServlet2Session2Entity2JSP.java +++ /dev/null @@ -1,104 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2015. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.web.prims.ejb3; - -import com.ibm.websphere.samples.daytrader.entities.QuoteDataBean; -import com.ibm.websphere.samples.daytrader.impl.ejb3.TradeSLSBBean; -import com.ibm.websphere.samples.daytrader.interfaces.TradeEJB; -import com.ibm.websphere.samples.daytrader.interfaces.TradeServices; -import com.ibm.websphere.samples.daytrader.util.Log; -import com.ibm.websphere.samples.daytrader.util.TradeConfig; -import java.io.IOException; -import javax.ejb.EJB; -import javax.inject.Inject; -import javax.naming.InitialContext; -import javax.servlet.ServletConfig; -import javax.servlet.ServletContext; -import javax.servlet.ServletException; -import javax.servlet.annotation.WebServlet; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -/** - * - * PingServlet2Session2Entity tests key functionality of a servlet call to a - * stateless SessionEJB, and then to a Entity EJB representing data in a - * database. This servlet makes use of the Stateless Session EJB {@link Trade}, - * and then uses {@link TradeConfig} to generate a random stock symbol. The - * stocks price is looked up using the Quote Entity EJB. - * - */ -@WebServlet(name = "ejb3.PingServlet2Session2Entity2JSP", urlPatterns = { "/ejb3/PingServlet2Session2Entity2JSP" }) -public class PingServlet2Session2Entity2JSP extends HttpServlet { - - private static final long serialVersionUID = -8966014710582651693L; - - @Inject - @TradeEJB - private TradeServices tradeSLSBLocal; - - @Override - public void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { - doGet(req, res); - } - - @Override - public void doGet(HttpServletRequest req, HttpServletResponse res) throws IOException, ServletException { - String symbol = null; - QuoteDataBean quoteData = null; - ServletContext ctx = getServletConfig().getServletContext(); - - try { - try { - int iter = TradeConfig.getPrimIterations(); - for (int ii = 0; ii < iter; ii++) { - symbol = TradeConfig.rndSymbol(); - // getQuote will call findQuote which will instaniate the - // Quote Entity Bean - // and then will return a QuoteObject - quoteData = tradeSLSBLocal.getQuote(symbol); - } - - req.setAttribute("quoteData", quoteData); - // req.setAttribute("hitCount", hitCount); - // req.setAttribute("initTime", initTime); - - ctx.getRequestDispatcher("/quoteDataPrimitive.jsp").include(req, res); - } catch (Exception ne) { - Log.error(ne, "PingServlet2Session2Entity2JSP.goGet(...): exception getting QuoteData through Trade"); - throw ne; - } - - } catch (Exception e) { - Log.error(e, "PingServlet2Session2Entity2JSP.doGet(...): General Exception caught"); - res.sendError(500, "General Exception caught, " + e.toString()); - } - } - - @Override - public String getServletInfo() { - return "web primitive, tests Servlet to Session to Entity EJB to JSP path"; - - } - - @Override - public void init(ServletConfig config) throws ServletException { - super.init(config); - // hitCount = 0; - // initTime = new java.util.Date().toString(); - } -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/ejb3/PingServlet2Session2EntityCollection.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/ejb3/PingServlet2Session2EntityCollection.java deleted file mode 100644 index d258eb6b..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/ejb3/PingServlet2Session2EntityCollection.java +++ /dev/null @@ -1,121 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2015. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.web.prims.ejb3; - -import com.ibm.websphere.samples.daytrader.entities.HoldingDataBean; -import com.ibm.websphere.samples.daytrader.impl.ejb3.TradeSLSBBean; -import com.ibm.websphere.samples.daytrader.interfaces.TradeEJB; -import com.ibm.websphere.samples.daytrader.interfaces.TradeServices; -import com.ibm.websphere.samples.daytrader.util.Log; -import com.ibm.websphere.samples.daytrader.util.TradeConfig; -import java.io.IOException; -import java.util.Collection; -import java.util.Iterator; -import javax.ejb.EJB; -import javax.inject.Inject; -import javax.servlet.ServletConfig; -import javax.servlet.ServletException; -import javax.servlet.annotation.WebServlet; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -/** - * - * PingServlet2Session2Entity tests key functionality of a servlet call to a - * stateless SessionEJB, and then to a Entity EJB representing data in a - * database. This servlet makes use of the Stateless Session EJB {@link Trade}, - * and then uses {@link TradeConfig} to generate a random user. The users - * portfolio is looked up using the Holding Entity EJB returnin a collection of - * Holdings - * - */ -@WebServlet(name = "ejb3.PingServlet2Session2EntityCollection", urlPatterns = { "/ejb3/PingServlet2Session2EntityCollection" }) -public class PingServlet2Session2EntityCollection extends HttpServlet { - - private static final long serialVersionUID = 6171380014749902308L; - - private static String initTime; - - private static int hitCount; - - @Inject - @TradeEJB - private TradeServices tradeSLSBLocal; - - @Override - public void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { - doGet(req, res); - } - - @Override - public void doGet(HttpServletRequest req, HttpServletResponse res) throws IOException, ServletException { - - res.setContentType("text/html"); - java.io.PrintWriter out = res.getWriter(); - String userID = null; - Collection holdingDataBeans = null; - StringBuffer output = new StringBuffer(100); - - output.append("PingServlet2Session2EntityCollection" - + "
    PingServlet2Session2EntityCollection
    " + "" - + "PingServlet2Session2EntityCollection tests the common path of a Servlet calling a Session EJB " - + "which in turn calls a finder on an Entity EJB returning a collection of Entity EJBs.
    "); - - try { - - try { - int iter = TradeConfig.getPrimIterations(); - for (int ii = 0; ii < iter; ii++) { - userID = TradeConfig.rndUserID(); - // getQuote will call findQuote which will instaniate the - // Quote Entity Bean - // and then will return a QuoteObject - holdingDataBeans = tradeSLSBLocal.getHoldings(userID); - // trade.remove(); - } - } catch (Exception ne) { - Log.error(ne, "PingServlet2Session2EntityCollection.goGet(...): exception getting HoldingData collection through Trade for user " + userID); - throw ne; - } - - output.append("
    initTime: " + initTime).append("
    Hit Count: " + hitCount++); - output.append("
    User: " + userID + " is currently holding " + holdingDataBeans.size() + " stock holdings:"); - Iterator it = holdingDataBeans.iterator(); - while (it.hasNext()) { - HoldingDataBean holdingData = (HoldingDataBean) it.next(); - output.append("
    " + holdingData.toHTML()); - } - out.println(output.toString()); - - } catch (Exception e) { - Log.error(e, "PingServlet2Session2EntityCollection.doGet(...): General Exception caught"); - res.sendError(500, "General Exception caught, " + e.toString()); - } - } - - @Override - public String getServletInfo() { - return "web primitive, tests Servlet to Session to Entity returning a collection of Entity EJBs"; - } - - @Override - public void init(ServletConfig config) throws ServletException { - super.init(config); - hitCount = 0; - initTime = new java.util.Date().toString(); - } -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/ejb3/PingServlet2TwoPhase.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/ejb3/PingServlet2TwoPhase.java deleted file mode 100644 index bad1e037..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/ejb3/PingServlet2TwoPhase.java +++ /dev/null @@ -1,116 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2015. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.web.prims.ejb3; - -import com.ibm.websphere.samples.daytrader.entities.QuoteDataBean; -import com.ibm.websphere.samples.daytrader.interfaces.TradeEJB; -import com.ibm.websphere.samples.daytrader.interfaces.TradeServices; -import com.ibm.websphere.samples.daytrader.util.Log; -import com.ibm.websphere.samples.daytrader.util.TradeConfig; -import java.io.IOException; -import javax.inject.Inject; -import javax.servlet.ServletConfig; -import javax.servlet.ServletException; -import javax.servlet.annotation.WebServlet; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - - -/** - * - * PingServlet2TwoPhase tests key functionality of a TwoPhase commit In this - * primitive a servlet calls a Session EJB which begins a global txn The Session - * EJB then reads a DB row and sends a message to JMS Queue The txn is closed w/ - * a 2-phase commit - * - */ -@WebServlet(name = "ejb3.PingServlet2TwoPhase", urlPatterns = { "/ejb3/PingServlet2TwoPhase" }) -public class PingServlet2TwoPhase extends HttpServlet { - - private static final long serialVersionUID = -1563251786527079548L; - - private static String initTime; - - private static int hitCount; - - @Inject - @TradeEJB - private TradeServices tradeSLSBLocal; - - @Override - public void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { - doGet(req, res); - } - - - - @Override - public void doGet(HttpServletRequest req, HttpServletResponse res) throws IOException, ServletException { - - res.setContentType("text/html"); - java.io.PrintWriter out = res.getWriter(); - String symbol = null; - QuoteDataBean quoteData = null; - StringBuffer output = new StringBuffer(100); - - output.append("PingServlet2TwoPhase" - + "
    PingServlet2TwoPhase
    " + "" - + "PingServlet2TwoPhase tests the path of a Servlet calling a Session EJB " - + "which in turn calls an Entity EJB to read a DB row (quote). The Session EJB " + "then posts a message to a JMS Queue. " - + "
    These operations are wrapped in a 2-phase commit
    "); - - try { - - try { - int iter = TradeConfig.getPrimIterations(); - for (int ii = 0; ii < iter; ii++) { - symbol = TradeConfig.rndSymbol(); - // getQuote will call findQuote which will instaniate the - // Quote Entity Bean - // and then will return a QuoteObject - quoteData = tradeSLSBLocal.pingTwoPhase(symbol); - - } - } catch (Exception ne) { - Log.error(ne, "PingServlet2TwoPhase.goGet(...): exception getting QuoteData through Trade"); - throw ne; - } - - output.append("
    initTime: " + initTime).append("
    Hit Count: " + hitCount++); - output.append("
    Two phase ping selected a quote and sent a message to TradeBrokerQueue JMS queue
    Quote Information

    " - + quoteData.toHTML()); - out.println(output.toString()); - - } catch (Exception e) { - Log.error(e, "PingServlet2TwoPhase.doGet(...): General Exception caught"); - res.sendError(500, "General Exception caught, " + e.toString()); - } - } - - @Override - public String getServletInfo() { - return "web primitive, tests Servlet to Session to Entity EJB and JMS -- 2-phase commit path"; - - } - - @Override - public void init(ServletConfig config) throws ServletException { - super.init(config); - hitCount = 0; - initTime = new java.util.Date().toString(); - } -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/http2/PingServletPush.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/http2/PingServletPush.java deleted file mode 100644 index 6ee30fa0..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/http2/PingServletPush.java +++ /dev/null @@ -1,70 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2019. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.web.prims.http2; - -import com.ibm.websphere.samples.daytrader.util.Log; -import java.io.IOException; -import java.io.PrintWriter; -import javax.servlet.ServletConfig; -import javax.servlet.ServletException; -import javax.servlet.annotation.WebServlet; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.PushBuilder; - -@WebServlet(name = "PingServletPush", urlPatterns = { "/PingServletPush" }) -public class PingServletPush extends HttpServlet { - - private static final long serialVersionUID = -1687383294950455998L; - private static String initTime; - private static int hitCount; - - @Override - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { - - try { - PushBuilder pushBuilder = req.newPushBuilder(); - if (pushBuilder != null) { - pushBuilder - .path("images/graph.gif") - .push(); - - } else { - Log.error("HTTP/2 not enabled or Push not supported"); - } - } catch (Exception e) { - e.printStackTrace(); - } - - try(PrintWriter respWriter = resp.getWriter();){ - hitCount++; - //System.out.println("Sending hit count: " + hitCount); - respWriter.write("Ping Servlet HTTP/2" - + "

    Ping Servlet HTTP/2
    Init time : " + initTime - + "

    Hit Count: " + hitCount + "
    " + - "" + - ""); - } - } - - @Override - public void init(ServletConfig config) throws ServletException { - super.init(config); - initTime = new java.util.Date().toString(); - hitCount = 0; - } -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/http2/PingServletSimple.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/http2/PingServletSimple.java deleted file mode 100644 index 53faf00d..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/http2/PingServletSimple.java +++ /dev/null @@ -1,54 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2019. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.web.prims.http2; - -import java.io.IOException; -import java.io.PrintWriter; -import javax.servlet.ServletConfig; -import javax.servlet.ServletException; -import javax.servlet.annotation.WebServlet; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -@WebServlet(name = "PingServletHttpSimple", urlPatterns = { "/PingServletHttpSimple" }) -public class PingServletSimple extends HttpServlet { - - private static final long serialVersionUID = -1687383294950455998L; - private static String initTime; - private static int hitCount; - - @Override - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { - - try(PrintWriter respWriter = resp.getWriter();){ - hitCount++; - //System.out.println("Sending hit count: " + hitCount); - respWriter.write("Ping Servlet HTTP/2" - + "

    Ping Servlet HTTP/2
    Init time : " + initTime - + "

    Hit Count: " + hitCount + "
    " + - "" + - ""); - } - } - - @Override - public void init(ServletConfig config) throws ServletException { - super.init(config); - initTime = new java.util.Date().toString(); - hitCount = 0; - } -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/jaxrs/JAXRSSyncService.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/jaxrs/JAXRSSyncService.java deleted file mode 100644 index 92275935..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/jaxrs/JAXRSSyncService.java +++ /dev/null @@ -1,62 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2019. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.web.prims.jaxrs; - -import javax.ws.rs.ApplicationPath; -import javax.ws.rs.Consumes; -import javax.ws.rs.GET; -import javax.ws.rs.POST; -import javax.ws.rs.Path; -import javax.ws.rs.Produces; -import javax.ws.rs.QueryParam; -import javax.ws.rs.core.MediaType; - -@ApplicationPath("/jaxrs") -@Path("sync") -public class JAXRSSyncService { - - /** - * note: this should be the basic code path for jaxrs process - * @param input - * @return - */ - @GET - @Path("echoText") - public String echoString(@QueryParam("input") String input) { - return input; - } - - /** - * note: this code path involves JSON marshaller & un-marshaller based on basic code path - * @param p Person Object - * @return Person Object - */ - @POST - @Path("echoJSON") - @Produces(value={MediaType.APPLICATION_JSON}) - @Consumes(value={MediaType.APPLICATION_JSON}) - public TestJSONObject echoObject(TestJSONObject jsonObject) { - return jsonObject; - } - - @POST - @Path("echoXML") - @Produces(value={MediaType.TEXT_XML,MediaType.APPLICATION_XML}) - @Consumes(value={MediaType.TEXT_XML,MediaType.APPLICATION_XML}) - public XMLObject echoObject(XMLObject xmlObject) { - return xmlObject; - } -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/jaxrs/ObjectFactory.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/jaxrs/ObjectFactory.java deleted file mode 100644 index f7993d8c..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/jaxrs/ObjectFactory.java +++ /dev/null @@ -1,28 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2019. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.web.prims.jaxrs; - -import javax.xml.bind.annotation.XmlRegistry; - - -@XmlRegistry -public class ObjectFactory { - - public XMLObject createXMLObject() { - XMLObject xo = new XMLObject(); - return xo; - } -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/jaxrs/TestJSONObject.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/jaxrs/TestJSONObject.java deleted file mode 100644 index 6d1ca4fd..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/jaxrs/TestJSONObject.java +++ /dev/null @@ -1,133 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2019. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.web.prims.jaxrs; - -public class TestJSONObject { - - private String prop0001; - private String prop0002; - private String prop0003; - private String prop0004; - private String prop0005; - private String prop0006; - private String prop0007; - private String prop0008; - private String prop0009; - private String prop0010; - private String prop0011; - private String prop0012; - private String prop0013; - private String prop0014; - private String prop0015; - private String prop0016; - - public String getProp0001() { - return prop0001; - } - public void setProp0001(String prop0001) { - this.prop0001 = prop0001; - } - public String getProp0002() { - return prop0002; - } - public void setProp0002(String prop0002) { - this.prop0002 = prop0002; - } - public String getProp0003() { - return prop0003; - } - public void setProp0003(String prop0003) { - this.prop0003 = prop0003; - } - public String getProp0004() { - return prop0004; - } - public void setProp0004(String prop0004) { - this.prop0004 = prop0004; - } - public String getProp0005() { - return prop0005; - } - public void setProp0005(String prop0005) { - this.prop0005 = prop0005; - } - public String getProp0006() { - return prop0006; - } - public void setProp0006(String prop0006) { - this.prop0006 = prop0006; - } - public String getProp0007() { - return prop0007; - } - public void setProp0007(String prop0007) { - this.prop0007 = prop0007; - } - public String getProp0008() { - return prop0008; - } - public void setProp0008(String prop0008) { - this.prop0008 = prop0008; - } - public String getProp0009() { - return prop0009; - } - public void setProp0009(String prop0009) { - this.prop0009 = prop0009; - } - public String getProp0010() { - return prop0010; - } - public void setProp0010(String prop0010) { - this.prop0010 = prop0010; - } - public String getProp0011() { - return prop0011; - } - public void setProp0011(String prop0011) { - this.prop0011 = prop0011; - } - public String getProp0012() { - return prop0012; - } - public void setProp0012(String prop0012) { - this.prop0012 = prop0012; - } - public String getProp0013() { - return prop0013; - } - public void setProp0013(String prop0013) { - this.prop0013 = prop0013; - } - public String getProp0014() { - return prop0014; - } - public void setProp0014(String prop0014) { - this.prop0014 = prop0014; - } - public String getProp0015() { - return prop0015; - } - public void setProp0015(String prop0015) { - this.prop0015 = prop0015; - } - public String getProp0016() { - return prop0016; - } - public void setProp0016(String prop0016) { - this.prop0016 = prop0016; - } -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/jaxrs/XMLObject.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/jaxrs/XMLObject.java deleted file mode 100644 index be65ce39..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/prims/jaxrs/XMLObject.java +++ /dev/null @@ -1,152 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2019. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.web.prims.jaxrs; - -import javax.xml.bind.annotation.XmlRootElement; - -/** - * with @XmlRootElement, make the XMLObject as a JAXB object - * then add/remove any atteribute with setter& getter - * - * note: please change all XMLObjects in project JAXRSJ2SEClient,JAXRSBenchService,JAXRS20Client - * they should share the same XMLObject - * @author alexzan - * - */ -@XmlRootElement -public class XMLObject { - - private String prop0001; - private String prop0002; - private String prop0003; - private String prop0004; - private String prop0005; - private String prop0006; - private String prop0007; - private String prop0008; - private String prop0009; - private String prop0010; - private String prop0011; - private String prop0012; - private String prop0013; - private String prop0014; - private String prop0015; - private String prop0016; - private String x; - - public String getProp0001() { - return prop0001; - } - public void setProp0001(String prop0001) { - this.prop0001 = prop0001; - } - public String getProp0002() { - return prop0002; - } - public void setProp0002(String prop0002) { - this.prop0002 = prop0002; - } - public String getProp0003() { - return prop0003; - } - public void setProp0003(String prop0003) { - this.prop0003 = prop0003; - } - public String getProp0004() { - return prop0004; - } - public void setProp0004(String prop0004) { - this.prop0004 = prop0004; - } - public String getProp0005() { - return prop0005; - } - public void setProp0005(String prop0005) { - this.prop0005 = prop0005; - } - public String getProp0006() { - return prop0006; - } - public void setProp0006(String prop0006) { - this.prop0006 = prop0006; - } - public String getProp0007() { - return prop0007; - } - public void setProp0007(String prop0007) { - this.prop0007 = prop0007; - } - public String getProp0008() { - return prop0008; - } - public void setProp0008(String prop0008) { - this.prop0008 = prop0008; - } - public String getProp0009() { - return prop0009; - } - public void setProp0009(String prop0009) { - this.prop0009 = prop0009; - } - public String getProp0010() { - return prop0010; - } - public void setProp0010(String prop0010) { - this.prop0010 = prop0010; - } - public String getProp0011() { - return prop0011; - } - public void setProp0011(String prop0011) { - this.prop0011 = prop0011; - } - public String getProp0012() { - return prop0012; - } - public void setProp0012(String prop0012) { - this.prop0012 = prop0012; - } - public String getProp0013() { - return prop0013; - } - public void setProp0013(String prop0013) { - this.prop0013 = prop0013; - } - public String getProp0014() { - return prop0014; - } - public void setProp0014(String prop0014) { - this.prop0014 = prop0014; - } - public String getProp0015() { - return prop0015; - } - public void setProp0015(String prop0015) { - this.prop0015 = prop0015; - } - public String getProp0016() { - return prop0016; - } - public void setProp0016(String prop0016) { - this.prop0016 = prop0016; - } - public String getX() { - return x; - } - public void setX(String x) { - this.x = x; - } -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/servlet/OrdersAlertFilter.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/servlet/OrdersAlertFilter.java deleted file mode 100644 index ffbd6ec8..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/servlet/OrdersAlertFilter.java +++ /dev/null @@ -1,114 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2015, 2022. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.web.servlet; - -import com.ibm.websphere.samples.daytrader.interfaces.Trace; -import com.ibm.websphere.samples.daytrader.interfaces.TradeServices; -import com.ibm.websphere.samples.daytrader.util.Diagnostics; -import com.ibm.websphere.samples.daytrader.util.Log; -import com.ibm.websphere.samples.daytrader.util.TradeConfig; -import com.ibm.websphere.samples.daytrader.util.TradeRunTimeModeLiteral; -import java.io.IOException; -import java.util.Collection; -import javax.enterprise.inject.Any; -import javax.enterprise.inject.Instance; -import javax.inject.Inject; -import javax.servlet.Filter; -import javax.servlet.FilterChain; -import javax.servlet.FilterConfig; -import javax.servlet.ServletException; -import javax.servlet.ServletRequest; -import javax.servlet.ServletResponse; -import javax.servlet.annotation.WebFilter; -import javax.servlet.http.HttpServletRequest; - -@WebFilter(filterName = "OrdersAlertFilter", urlPatterns = "/app") -@Trace -public class OrdersAlertFilter implements Filter { - - private TradeServices tradeAction; - - @Inject - public OrdersAlertFilter(@Any Instance services) { - super(); - tradeAction = services.select(new TradeRunTimeModeLiteral(TradeConfig.getRunTimeModeNames()[TradeConfig.getRunTimeMode()])).get(); - } - - - /** - * @see Filter#init(FilterConfig) - */ - private FilterConfig filterConfig = null; - - @Override - public void init(FilterConfig filterConfig) throws ServletException { - this.filterConfig = filterConfig; - } - - /** - * @see Filter#doFilter(ServletRequest, ServletResponse, FilterChain) - */ - @Override - public void doFilter(ServletRequest req, ServletResponse resp, FilterChain chain) throws IOException, ServletException { - if (filterConfig == null) { - return; - } - - if (TradeConfig.getDisplayOrderAlerts() == true) { - - try { - String action = req.getParameter("action"); - if (action != null) { - action = action.trim(); - if ((action.length() > 0) && (!action.equals("logout"))) { - String userID; - if (action.equals("login")) { - userID = req.getParameter("uid"); - } else { - userID = (String) ((HttpServletRequest) req).getSession().getAttribute("uidBean"); - } - - if ((userID != null) && (userID.trim().length() > 0)) { - - Collection closedOrders = tradeAction.getClosedOrders(userID); - if ((closedOrders != null) && (closedOrders.size() > 0)) { - req.setAttribute("closedOrders", closedOrders); - } - if (Log.doTrace()) { - Log.printCollection("OrderAlertFilter: userID=" + userID + " closedOrders=", closedOrders); - } - } - } - } - } catch (Exception e) { - Log.error(e, "OrdersAlertFilter - Error checking for closedOrders"); - } - } - - Diagnostics.checkDiagnostics(); - - chain.doFilter(req, resp/* wrapper */); - } - - /** - * @see Filter#destroy() - */ - @Override - public void destroy() { - this.filterConfig = null; - } - -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/servlet/PrimFilter.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/servlet/PrimFilter.java deleted file mode 100644 index 9e2145e3..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/servlet/PrimFilter.java +++ /dev/null @@ -1,66 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2015, 2022. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.web.servlet; - -import com.ibm.websphere.samples.daytrader.interfaces.Trace; -import com.ibm.websphere.samples.daytrader.util.Diagnostics; -import java.io.IOException; -import javax.servlet.Filter; -import javax.servlet.FilterChain; -import javax.servlet.FilterConfig; -import javax.servlet.ServletException; -import javax.servlet.ServletRequest; -import javax.servlet.ServletResponse; -import javax.servlet.annotation.WebFilter; - -@WebFilter(filterName = "PrimFilter", urlPatterns = "/drive/*") -@Trace -public class PrimFilter implements Filter { - - /** - * @see Filter#init(FilterConfig) - */ - private FilterConfig filterConfig = null; - - @Override - public void init(FilterConfig filterConfig) throws ServletException { - this.filterConfig = filterConfig; - } - - /** - * @see Filter#doFilter(ServletRequest, ServletResponse, FilterChain) - */ - @Override - public void doFilter(ServletRequest req, ServletResponse resp, FilterChain chain) throws IOException, ServletException { - - if (filterConfig == null) { - return; - } - - Diagnostics.checkDiagnostics(); - - chain.doFilter(req, resp/* wrapper */); - } - - /** - * @see Filter#destroy() - */ - @Override - public void destroy() { - this.filterConfig = null; - } - -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/servlet/TestServlet.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/servlet/TestServlet.java deleted file mode 100644 index 7e187c7a..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/servlet/TestServlet.java +++ /dev/null @@ -1,120 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2015. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.web.servlet; - -import com.ibm.websphere.samples.daytrader.interfaces.TradeServices; -import com.ibm.websphere.samples.daytrader.util.Log; -import com.ibm.websphere.samples.daytrader.util.TradeConfig; -import com.ibm.websphere.samples.daytrader.util.TradeRunTimeModeLiteral; -import java.io.IOException; -import java.math.BigDecimal; -import javax.enterprise.inject.Any; -import javax.enterprise.inject.Instance; -import javax.inject.Inject; -import javax.servlet.ServletConfig; -import javax.servlet.ServletException; -import javax.servlet.annotation.WebServlet; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -@WebServlet(name = "TestServlet", urlPatterns = { "/TestServlet" }) -public class TestServlet extends HttpServlet { - - private static final long serialVersionUID = -2927579146688173127L; - - private TradeServices tradeAction; - - @Inject - public TestServlet(@Any Instance services) { - tradeAction = services.select(new TradeRunTimeModeLiteral(TradeConfig.getRunTimeModeNames()[TradeConfig.getRunTimeMode()])).get(); - } - - @Override - public void init(ServletConfig config) throws ServletException { - super.init(config); - } - - /** - * Process incoming HTTP GET requests - * - * @param request - * Object that encapsulates the request to the servlet - * @param response - * Object that encapsulates the response from the servlet - */ - @Override - public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - performTask(request, response); - } - - /** - * Process incoming HTTP POST requests - * - * @param request - * Object that encapsulates the request to the servlet - * @param response - * Object that encapsulates the response from the servlet - */ - @Override - public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - performTask(request, response); - } - - /** - * Main service method for TradeAppServlet - * - * @param request - * Object that encapsulates the request to the servlet - * @param response - * Object that encapsulates the response from the servlet - */ - public void performTask(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { - try { - Log.debug("Enter TestServlet doGet"); - //TradeDirect tradeDirect = new TradeDirect(); - for (int i = 0; i < 10; i++) { - tradeAction.createQuote("s:" + i, "Company " + i, new BigDecimal(i * 1.1)); - } - /* - * - * AccountDataBean accountData = new TradeAction().register("user1", - * "password", "fullname", "address", "email", "creditCard", new - * BigDecimal(123.45), false); - * - * OrderDataBean orderData = new TradeAction().buy("user1", "s:1", - * 100.0); orderData = new TradeAction().buy("user1", "s:2", 200.0); - * Thread.sleep(5000); accountData = new - * TradeAction().getAccountData("user1"); Collection - * holdingDataBeans = new TradeAction().getHoldings("user1"); - * PrintWriter out = resp.getWriter(); - * resp.setContentType("text/html"); - * out.write("

    "); - * out.write(accountData.toString()); - * Log.printCollection("user1 Holdings", holdingDataBeans); - * ServletContext sc = getServletContext(); - * req.setAttribute("results", "Success"); - * req.setAttribute("accountData", accountData); - * req.setAttribute("holdingDataBeans", holdingDataBeans); - * getServletContext - * ().getRequestDispatcher("/tradehome.jsp").include(req, resp); - * out.write("

    done."); - */ - } catch (Exception e) { - Log.error("TestServletException", e); - } - } -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/servlet/TradeAppServlet.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/servlet/TradeAppServlet.java deleted file mode 100644 index deb90cae..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/servlet/TradeAppServlet.java +++ /dev/null @@ -1,219 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2015. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.web.servlet; - -import com.ibm.websphere.samples.daytrader.interfaces.Trace; -import com.ibm.websphere.samples.daytrader.util.Log; -import com.ibm.websphere.samples.daytrader.util.TradeConfig; -import java.io.IOException; -import javax.inject.Inject; -import javax.servlet.ServletConfig; -import javax.servlet.ServletContext; -import javax.servlet.ServletException; -import javax.servlet.annotation.WebServlet; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; -import javax.servlet.http.PushBuilder; - - -/** - * - * TradeAppServlet provides the standard web interface to Trade and can be - * accessed with the Go Trade! link. Driving benchmark load using this interface - * requires a sophisticated web load generator that is capable of filling HTML - * forms and posting dynamic data. - */ - -@WebServlet(name = "TradeAppServlet", urlPatterns = { "/app" }) -@Trace -public class TradeAppServlet extends HttpServlet { - - @Inject - TradeServletAction tsAction; - - private static final long serialVersionUID = 481530522846648373L; - - /** - * Servlet initialization method. - */ - @Override - public void init(ServletConfig config) throws ServletException { - super.init(config); - java.util.Enumeration en = config.getInitParameterNames(); - while (en.hasMoreElements()) { - String parm = en.nextElement(); - String value = config.getInitParameter(parm); - TradeConfig.setConfigParam(parm, value); - } - try { - // TODO: Uncomment this once split-tier issue is resolved - // TradeDirect.init(); - } catch (Exception e) { - Log.error(e, "TradeAppServlet:init -- Error initializing TradeDirect"); - } - } - - /** - * Returns a string that contains information about TradeScenarioServlet - * - * @return The servlet information - */ - @Override - public java.lang.String getServletInfo() { - return "TradeAppServlet provides the standard web interface to Trade"; - } - - /** - * Process incoming HTTP GET requests - * - * @param request - * Object that encapsulates the request to the servlet - * @param response - * Object that encapsulates the response from the servlet - */ - @Override - public void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws ServletException, IOException { - performTask(request, response); - } - - /** - * Process incoming HTTP POST requests - * - * @param request - * Object that encapsulates the request to the servlet - * @param response - * Object that encapsulates the response from the servlet - */ - @Override - public void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws ServletException, IOException { - performTask(request, response); - } - - /** - * Main service method for TradeAppServlet - * - * @param request - * Object that encapsulates the request to the servlet - * @param response - * Object that encapsulates the response from the servlet - */ - public void performTask(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { - - String action = null; - String userID = null; - // String to create full dispatch path to TradeAppServlet w/ request - // Parameters - - resp.setContentType("text/html"); - - // Dyna - need status string - prepended to output - action = req.getParameter("action"); - - ServletContext ctx = getServletConfig().getServletContext(); - - if (action == null) { - tsAction.doWelcome(ctx, req, resp, ""); - return; - } else if (action.equals("login")) { - userID = req.getParameter("uid"); - String passwd = req.getParameter("passwd"); - tsAction.doLogin(ctx, req, resp, userID, passwd); - return; - } else if (action.equals("register")) { - userID = req.getParameter("user id"); - String passwd = req.getParameter("passwd"); - String cpasswd = req.getParameter("confirm passwd"); - String fullname = req.getParameter("Full Name"); - String ccn = req.getParameter("Credit Card Number"); - String money = req.getParameter("money"); - String email = req.getParameter("email"); - String smail = req.getParameter("snail mail"); - tsAction.doRegister(ctx, req, resp, userID, passwd, cpasswd, fullname, ccn, money, email, smail); - return; - } - - // The rest of the operations require the user to be logged in - - // Get the Session and validate the user. - HttpSession session = req.getSession(); - userID = (String) session.getAttribute("uidBean"); - - if (userID == null) { - System.out.println("TradeAppServlet service error: User Not Logged in"); - tsAction.doWelcome(ctx, req, resp, "User Not Logged in"); - return; - } - - // try http/2 push if we get here - // should be logged in and doing real work by this point - if (!action.equals("logout") && TradeConfig.getWebInterface() == TradeConfig.JSP_Images_HTTP2) { - pushHeaderImages(req.newPushBuilder()); - } - - if (action.equals("quotes")) { - String symbols = req.getParameter("symbols"); - tsAction.doQuotes(ctx, req, resp, userID, symbols); - } else if (action.equals("buy")) { - String symbol = req.getParameter("symbol"); - String quantity = req.getParameter("quantity"); - tsAction.doBuy(ctx, req, resp, userID, symbol, quantity); - } else if (action.equals("sell")) { - int holdingID = Integer.parseInt(req.getParameter("holdingID")); - tsAction.doSell(ctx, req, resp, userID, new Integer(holdingID)); - } else if (action.equals("portfolio") || action.equals("portfolioNoEdge")) { - tsAction.doPortfolio(ctx, req, resp, userID, "Portfolio as of " + new java.util.Date()); - } else if (action.equals("logout")) { - tsAction.doLogout(ctx, req, resp, userID); - } else if (action.equals("home")) { - tsAction.doHome(ctx, req, resp, userID, "Ready to Trade"); - } else if (action.equals("account")) { - tsAction.doAccount(ctx, req, resp, userID, ""); - } else if (action.equals("update_profile")) { - String password = req.getParameter("password"); - String cpassword = req.getParameter("cpassword"); - String fullName = req.getParameter("fullname"); - String address = req.getParameter("address"); - String creditcard = req.getParameter("creditcard"); - String email = req.getParameter("email"); - tsAction.doAccountUpdate(ctx, req, resp, userID, password == null ? "" : password.trim(), cpassword == null ? "" : cpassword.trim(), - fullName == null ? "" : fullName.trim(), address == null ? "" : address.trim(), creditcard == null ? "" : creditcard.trim(), - email == null ? "" : email.trim()); - } else if (action.equals("mksummary")) { - tsAction.doMarketSummary(ctx, req, resp, userID); - } else { - System.out.println("TradeAppServlet: Invalid Action=" + action); - tsAction.doWelcome(ctx, req, resp, "TradeAppServlet: Invalid Action" + action); - } - } - - private void pushHeaderImages(PushBuilder pushBuilder) { - if (pushBuilder != null) { - pushBuilder.path("images/menuHome.gif").addHeader("content-type", "image/gif").push(); - pushBuilder.path("images/account.gif").addHeader("content-type", "image/gif").push(); - pushBuilder.path("images/portfolio.gif").addHeader("content-type", "image/gif").push(); - pushBuilder.path("images/quotes.gif").addHeader("content-type", "image/gif").push(); - pushBuilder.path("images/logout.gif").addHeader("content-type", "image/gif").push(); - pushBuilder.path("images/graph.gif").addHeader("content-type", "image/gif").push(); - pushBuilder.path("images/line.gif").addHeader("content-type", "image/gif").push(); - Log.trace("HTTP/2 is enabled"); - } else { - Log.error("HTTP/2 not enabled"); - } - - } - -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/servlet/TradeConfigServlet.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/servlet/TradeConfigServlet.java deleted file mode 100644 index 820b27ed..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/servlet/TradeConfigServlet.java +++ /dev/null @@ -1,289 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2015. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.web.servlet; - -import com.ibm.websphere.samples.daytrader.beans.RunStatsDataBean; -import com.ibm.websphere.samples.daytrader.impl.direct.TradeDirectDBUtils; -import com.ibm.websphere.samples.daytrader.interfaces.Trace; -import com.ibm.websphere.samples.daytrader.util.Log; -import com.ibm.websphere.samples.daytrader.util.TradeConfig; -import java.io.IOException; -import javax.inject.Inject; -import javax.servlet.ServletConfig; -import javax.servlet.ServletException; -import javax.servlet.annotation.WebServlet; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - - -/** - * TradeConfigServlet provides a servlet interface to adjust DayTrader runtime parameters. - * TradeConfigServlet updates values in the {@link com.ibm.websphere.samples.daytrader.web.TradeConfig} JavaBean holding - * all configuration and runtime parameters for the Trade application - * - */ -@WebServlet(name = "TradeConfigServlet", urlPatterns = { "/config" }) -@Trace -public class TradeConfigServlet extends HttpServlet { - - @Inject - private TradeDirectDBUtils dbUtils; - - private static final long serialVersionUID = -1910381529792500095L; - - /** - * Servlet initialization method. - */ - @Override - public void init(ServletConfig config) throws ServletException { - super.init(config); - } - - /** - * Create the TradeConfig bean and pass it the config.jsp page - * to display the current Trade runtime configuration - * Creation date: (2/8/2000 3:43:59 PM) - */ - void doConfigDisplay(HttpServletRequest req, HttpServletResponse resp, String results) throws Exception { - - TradeConfig currentConfig = new TradeConfig(); - - req.setAttribute("tradeConfig", currentConfig); - req.setAttribute("status", results); - getServletConfig().getServletContext().getRequestDispatcher(TradeConfig.getPage(TradeConfig.CONFIG_PAGE)).include(req, resp); - } - - void doResetTrade(HttpServletRequest req, HttpServletResponse resp, String results) throws Exception { - RunStatsDataBean runStatsData = new RunStatsDataBean(); - TradeConfig currentConfig = new TradeConfig(); - - try { - runStatsData = dbUtils.resetTrade(false); - - req.setAttribute("runStatsData", runStatsData); - req.setAttribute("tradeConfig", currentConfig); - results += "Trade Reset completed successfully"; - req.setAttribute("status", results); - - } catch (Exception e) { - results += "Trade Reset Error - see log for details"; - Log.error(e, results); - throw e; - } - getServletConfig().getServletContext().getRequestDispatcher(TradeConfig.getPage(TradeConfig.STATS_PAGE)).include(req, resp); - - } - - /** - * Update Trade runtime configuration paramaters - * Creation date: (2/8/2000 3:44:24 PM) - */ - void doConfigUpdate(HttpServletRequest req, HttpServletResponse resp) throws Exception { - String currentConfigStr = "\n\n########## Trade configuration update. Current config:\n\n"; - - currentConfigStr += "\t\tRuntimeMode:\t\t" + TradeConfig.getRunTimeModeNames()[TradeConfig.getRunTimeMode()] + "\n"; - - String orderProcessingModeStr = req.getParameter("OrderProcessingMode"); - if (orderProcessingModeStr != null) { - try { - int i = Integer.parseInt(orderProcessingModeStr); - if ((i >= 0) && (i < TradeConfig.getOrderProcessingModeNames().length)) //Input validation - TradeConfig.setOrderProcessingMode(i); - } catch (Exception e) { - //>>rjm - Log.error(e, "TradeConfigServlet.doConfigUpdate(..): minor exception caught", "trying to set orderProcessing to " + orderProcessingModeStr, - "reverting to current value"); - - } // If the value is bad, simply revert to current - } - currentConfigStr += "\t\tOrderProcessingMode:\t\t" + TradeConfig.getOrderProcessingModeNames()[TradeConfig.getOrderProcessingMode()] + "\n"; - - String webInterfaceStr = req.getParameter("WebInterface"); - if (webInterfaceStr != null) { - try { - int i = Integer.parseInt(webInterfaceStr); - if ((i >= 0) && (i < TradeConfig.getWebInterfaceNames().length)) //Input validation - TradeConfig.setWebInterface(i); - } catch (Exception e) { - Log.error(e, "TradeConfigServlet.doConfigUpdate(..): minor exception caught", "trying to set WebInterface to " + webInterfaceStr, - "reverting to current value"); - - } // If the value is bad, simply revert to current - } - currentConfigStr += "\t\tWeb Interface:\t\t\t" + TradeConfig.getWebInterfaceNames()[TradeConfig.getWebInterface()] + "\n"; - - String parm = req.getParameter("MaxUsers"); - if ((parm != null) && (parm.length() > 0)) { - try { - TradeConfig.setMAX_USERS(Integer.parseInt(parm)); - } catch (Exception e) { - Log.error(e, "TradeConfigServlet.doConfigUpdate(..): minor exception caught", "Setting maxusers, probably error parsing string to int:" + parm, - "revertying to current value: " + TradeConfig.getMAX_USERS()); - - } //On error, revert to saved - } - parm = req.getParameter("MaxQuotes"); - if ((parm != null) && (parm.length() > 0)) { - try { - TradeConfig.setMAX_QUOTES(Integer.parseInt(parm)); - } catch (Exception e) { - //>>rjm - Log.error(e, "TradeConfigServlet: minor exception caught", "trying to set max_quotes, error on parsing int " + parm, - "reverting to current value " + TradeConfig.getMAX_QUOTES()); - //< 0)) { - try { - TradeConfig.setMarketSummaryInterval(Integer.parseInt(parm)); - } catch (Exception e) { - Log.error(e, "TradeConfigServlet: minor exception caught", "trying to set marketSummaryInterval, error on parsing int " + parm, - "reverting to current value " + TradeConfig.getMarketSummaryInterval()); - - } - } - currentConfigStr += "\t\tMarket Summary Interval:\t" + TradeConfig.getMarketSummaryInterval() + "\n"; - - parm = req.getParameter("primIterations"); - if ((parm != null) && (parm.length() > 0)) { - try { - TradeConfig.setPrimIterations(Integer.parseInt(parm)); - } catch (Exception e) { - Log.error(e, "TradeConfigServlet: minor exception caught", "trying to set primIterations, error on parsing int " + parm, - "reverting to current value " + TradeConfig.getPrimIterations()); - - } - } - currentConfigStr += "\t\tPrimitive Iterations:\t\t" + TradeConfig.getPrimIterations() + "\n"; - - String enablePublishQuotePriceChange = req.getParameter("EnablePublishQuotePriceChange"); - - if (enablePublishQuotePriceChange != null) - TradeConfig.setPublishQuotePriceChange(true); - else - TradeConfig.setPublishQuotePriceChange(false); - currentConfigStr += "\t\tTradeStreamer MDB Enabled:\t" + TradeConfig.getPublishQuotePriceChange() + "\n"; - - parm = req.getParameter("ListQuotePriceChangeFrequency"); - if ((parm != null) && (parm.length() > 0)) { - try { - TradeConfig.setListQuotePriceChangeFrequency(Integer.parseInt(parm)); - } catch (Exception e) { - Log.error(e, "TradeConfigServlet: minor exception caught", "trying to set percentSentToWebSocket, error on parsing int " + parm, - "reverting to current value " + TradeConfig.getListQuotePriceChangeFrequency()); - - } - } - currentConfigStr += "\t\t% of trades on Websocket:\t" + TradeConfig.getListQuotePriceChangeFrequency() + "\n"; - - String enableLongRun = req.getParameter("EnableLongRun"); - - if (enableLongRun != null) - TradeConfig.setLongRun(true); - else - TradeConfig.setLongRun(false); - currentConfigStr += "\t\tLong Run Enabled:\t\t" + TradeConfig.getLongRun() + "\n"; - - String displayOrderAlerts = req.getParameter("DisplayOrderAlerts"); - - if (displayOrderAlerts != null) - TradeConfig.setDisplayOrderAlerts(true); - else - TradeConfig.setDisplayOrderAlerts(false); - currentConfigStr += "\t\tDisplay Order Alerts:\t\t" + TradeConfig.getDisplayOrderAlerts() + "\n"; - - System.out.println(currentConfigStr); - } - - @Override - public void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { - - String action = null; - String result = ""; - - resp.setContentType("text/html"); - try { - action = req.getParameter("action"); - if (action == null) { - doConfigDisplay(req, resp, result + "
    Current DayTrader Configuration:
    "); - return; - } else if (action.equals("updateConfig")) { - doConfigUpdate(req, resp); - result = "
    DayTrader Configuration Updated
    "; - } else if (action.equals("resetTrade")) { - doResetTrade(req, resp, ""); - return; - } else if (action.equals("buildDB")) { - resp.setContentType("text/html"); - dbUtils.buildDB(resp.getWriter(), null); - result = "DayTrader Database Built - " + TradeConfig.getMAX_USERS() + "users created"; - } else if (action.equals("buildDBTables")) { - - resp.setContentType("text/html"); - - String dbProductName = null; - try { - dbProductName = dbUtils.checkDBProductName(); - } catch (Exception e) { - Log.error(e, "TradeBuildDB: Unable to check DB Product name"); - } - if (dbProductName == null) { - resp.getWriter().println( - "
    TradeBuildDB: **** Unable to check DB Product name, please check Database/AppServer configuration and retry ****
    "); - return; - } - - String ddlFile = null; - //Locate DDL file for the specified database - try { - resp.getWriter().println("
    TradeBuildDB: **** Database Product detected: " + dbProductName + " ****
    "); - if (dbProductName.startsWith("DB2/")) {// if db is DB2 - ddlFile = "/dbscripts/db2/Table.ddl"; - } else if (dbProductName.startsWith("Apache Derby")) { //if db is Derby - ddlFile = "/dbscripts/derby/Table.ddl"; - } else if (dbProductName.startsWith("Oracle")) { // if the Db is Oracle - ddlFile = "/dbscripts/oracle/Table.ddl"; - } else {// Unsupported "Other" Database - ddlFile = "/dbscripts/other/Table.ddl"; - resp.getWriter().println("
    TradeBuildDB: **** This Database is unsupported/untested use at your own risk ****
    "); - } - - resp.getWriter().println("
    TradeBuildDB: **** The DDL file at path " + ddlFile + " will be used ****
    "); - resp.getWriter().flush(); - } catch (Exception e) { - Log.error(e, "TradeBuildDB: Unable to locate DDL file for the specified database"); - resp.getWriter().println("
    TradeBuildDB: **** Unable to locate DDL file for the specified database ****
    "); - return; - } - - dbUtils.buildDB(resp.getWriter(), getServletContext().getResourceAsStream(ddlFile)); - - } - doConfigDisplay(req, resp, result + "Current DayTrader Configuration:"); - } catch (Exception e) { - Log.error(e, "TradeConfigServlet.service(...)", "Exception trying to perform action=" + action); - - resp.sendError(500, "TradeConfigServlet.service(...)" + "Exception trying to perform action=" + action + "\nException details: " + e.toString()); - - } - } -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/servlet/TradeScenarioServlet.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/servlet/TradeScenarioServlet.java deleted file mode 100644 index a57af1b4..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/servlet/TradeScenarioServlet.java +++ /dev/null @@ -1,295 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2015. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.web.servlet; - -import com.ibm.websphere.samples.daytrader.entities.HoldingDataBean; -import com.ibm.websphere.samples.daytrader.util.Log; -import com.ibm.websphere.samples.daytrader.util.TradeConfig; -import java.io.IOException; -import java.io.PrintWriter; -import java.util.Collection; -import java.util.Iterator; -import javax.servlet.ServletConfig; -import javax.servlet.ServletContext; -import javax.servlet.ServletException; -import javax.servlet.annotation.WebServlet; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; - -/** - * TradeScenarioServlet emulates a population of web users by generating a - * specific Trade operation for a randomly chosen user on each access to the - * URL. Test this servlet by clicking Trade Scenario and hit "Reload" on your - * browser to step through a Trade Scenario. To benchmark using this URL aim - * your favorite web load generator (such as AKStress) at the Trade Scenario URL - * and fire away. - */ -@WebServlet(name = "TradeScenarioServlet", urlPatterns = { "/scenario" }) -public class TradeScenarioServlet extends HttpServlet { - - private static final long serialVersionUID = 1410005249314201829L; - - /** - * Servlet initialization method. - */ - @Override - public void init(ServletConfig config) throws ServletException { - super.init(config); - java.util.Enumeration en = config.getInitParameterNames(); - while (en.hasMoreElements()) { - String parm = en.nextElement(); - String value = config.getInitParameter(parm); - TradeConfig.setConfigParam(parm, value); - } - } - - /** - * Returns a string that contains information about TradeScenarioServlet - * - * @return The servlet information - */ - @Override - public java.lang.String getServletInfo() { - return "TradeScenarioServlet emulates a population of web users"; - } - - /** - * Process incoming HTTP GET requests - * - * @param request - * Object that encapsulates the request to the servlet - * @param response - * Object that encapsulates the response from the servlet - */ - @Override - public void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws ServletException, IOException { - performTask(request, response); - } - - /** - * Process incoming HTTP POST requests - * - * @param request - * Object that encapsulates the request to the servlet - * @param response - * Object that encapsulates the response from the servlet - */ - @Override - public void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws ServletException, IOException { - performTask(request, response); - } - - /** - * Main service method for TradeScenarioServlet - * - * @param request - * Object that encapsulates the request to the servlet - * @param response - * Object that encapsulates the response from the servlet - */ - public void performTask(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { - - // Scenario generator for Trade2 - char action = ' '; - String userID = null; - - // String to create full dispatch path to TradeAppServlet w/ request - // Parameters - String dispPath = null; // Dispatch Path to TradeAppServlet - - resp.setContentType("text/html"); - - String scenarioAction = req.getParameter("action"); - if ((scenarioAction != null) && (scenarioAction.length() >= 1)) { - action = scenarioAction.charAt(0); - if (action == 'n') { // null; - try { - // resp.setContentType("text/html"); - PrintWriter out = new PrintWriter(resp.getOutputStream()); - out.println("TradeScenarioServletHello"); - out.close(); - return; - - } catch (Exception e) { - Log.error("trade_client.TradeScenarioServlet.service(...)" + "error creating printwriter from responce.getOutputStream", e); - - resp.sendError(500, - "trade_client.TradeScenarioServlet.service(...): erorr creating and writing to PrintStream created from response.getOutputStream()"); - } // end of catch - - } // end of action=='n' - } - - ServletContext ctx = null; - HttpSession session = null; - try { - ctx = getServletConfig().getServletContext(); - // These operations require the user to be logged in. Verify the - // user and if not logged in - // change the operation to a login - session = req.getSession(true); - userID = (String) session.getAttribute("uidBean"); - } catch (Exception e) { - Log.error("trade_client.TradeScenarioServlet.service(...): performing " + scenarioAction - + "error getting ServletContext,HttpSession, or UserID from session" + "will make scenarioAction a login and try to recover from there", e); - userID = null; - action = 'l'; - } - - if (userID == null) { - action = 'l'; // change to login - TradeConfig.incrementScenarioCount(); - } else if (action == ' ') { - // action is not specified perform a random operation according to - // current mix - // Tell getScenarioAction if we are an original user or a registered - // user - // -- sellDeficits should only be compensated for with original - // users. - action = TradeConfig.getScenarioAction(userID.startsWith(TradeConfig.newUserPrefix)); - } - switch (action) { - - case 'q': // quote - dispPath = tasPathPrefix + "quotes&symbols=" + TradeConfig.rndSymbols(); - ctx.getRequestDispatcher(dispPath).include(req, resp); - break; - case 'a': // account - dispPath = tasPathPrefix + "account"; - ctx.getRequestDispatcher(dispPath).include(req, resp); - break; - case 'u': // update account profile - dispPath = tasPathPrefix + "account"; - ctx.getRequestDispatcher(dispPath).include(req, resp); - - String fullName = "rnd" + System.currentTimeMillis(); - String address = "rndAddress"; - String password = "xxx"; - String email = "rndEmail"; - String creditcard = "rndCC"; - dispPath = tasPathPrefix + "update_profile&fullname=" + fullName + "&password=" + password + "&cpassword=" + password + "&address=" + address - + "&email=" + email + "&creditcard=" + creditcard; - ctx.getRequestDispatcher(dispPath).include(req, resp); - break; - case 'h': // home - dispPath = tasPathPrefix + "home"; - ctx.getRequestDispatcher(dispPath).include(req, resp); - break; - case 'l': // login - userID = TradeConfig.getUserID(); - String password2 = "xxx"; - dispPath = tasPathPrefix + "login&inScenario=true&uid=" + userID + "&passwd=" + password2; - ctx.getRequestDispatcher(dispPath).include(req, resp); - - // login is successful if the userID is written to the HTTP session - if (session.getAttribute("uidBean") == null) { - System.out.println("TradeScenario login failed. Reset DB between runs"); - } - break; - case 'o': // logout - dispPath = tasPathPrefix + "logout"; - ctx.getRequestDispatcher(dispPath).include(req, resp); - break; - case 'p': // portfolio - dispPath = tasPathPrefix + "portfolio"; - ctx.getRequestDispatcher(dispPath).include(req, resp); - break; - case 'r': // register - // Logout the current user to become a new user - // see note in TradeServletAction - req.setAttribute("TSS-RecreateSessionInLogout", Boolean.TRUE); - dispPath = tasPathPrefix + "logout"; - ctx.getRequestDispatcher(dispPath).include(req, resp); - - userID = TradeConfig.rndNewUserID(); - String passwd = "yyy"; - fullName = TradeConfig.rndFullName(); - creditcard = TradeConfig.rndCreditCard(); - String money = TradeConfig.rndBalance(); - email = TradeConfig.rndEmail(userID); - String smail = TradeConfig.rndAddress(); - dispPath = tasPathPrefix + "register&Full Name=" + fullName + "&snail mail=" + smail + "&email=" + email + "&user id=" + userID + "&passwd=" - + passwd + "&confirm passwd=" + passwd + "&money=" + money + "&Credit Card Number=" + creditcard; - ctx.getRequestDispatcher(dispPath).include(req, resp); - break; - case 's': // sell - dispPath = tasPathPrefix + "portfolioNoEdge"; - ctx.getRequestDispatcher(dispPath).include(req, resp); - - Collection holdings = (Collection) req.getAttribute("holdingDataBeans"); - int numHoldings = holdings.size(); - if (numHoldings > 0) { - // sell first available security out of holding - - Iterator it = holdings.iterator(); - boolean foundHoldingToSell = false; - while (it.hasNext()) { - HoldingDataBean holdingData = (HoldingDataBean) it.next(); - if (!(holdingData.getPurchaseDate().equals(new java.util.Date(0)))) { - Integer holdingID = holdingData.getHoldingID(); - - dispPath = tasPathPrefix + "sell&holdingID=" + holdingID; - ctx.getRequestDispatcher(dispPath).include(req, resp); - foundHoldingToSell = true; - break; - } - } - if (foundHoldingToSell) { - break; - } - - Log.trace("TradeScenario: No holding to sell -switch to buy -- userID = " + userID + " Collection count = " + numHoldings); - - - } - // At this point: A TradeScenario Sell was requested with No Stocks - // in Portfolio - // This can happen when a new registered user happens to request a - // sell before a buy - // In this case, fall through and perform a buy instead - - /* - * Trade 2.037: Added sell_deficit counter to maintain correct - * buy/sell mix. When a users portfolio is reduced to 0 holdings, a - * buy is requested instead of a sell. This throws off the buy/sell - * mix by 1. This results in unwanted holding table growth To fix - * this we increment a sell deficit counter to maintain the correct - * ratio in getScenarioAction The 'z' action from getScenario - * denotes that this is a sell action that was switched from a buy - * to reduce a sellDeficit - */ - if (userID.startsWith(TradeConfig.newUserPrefix) == false) { - TradeConfig.incrementSellDeficit(); - } - case 'b': // buy - String symbol = TradeConfig.rndSymbol(); - String amount = TradeConfig.rndQuantity() + ""; - - dispPath = tasPathPrefix + "quotes&symbols=" + symbol; - ctx.getRequestDispatcher(dispPath).include(req, resp); - - dispPath = tasPathPrefix + "buy&quantity=" + amount + "&symbol=" + symbol; - ctx.getRequestDispatcher(dispPath).include(req, resp); - break; - } // end of switch statement - } - - // URL Path Prefix for dispatching to TradeAppServlet - private static final String tasPathPrefix = "/app?action="; - -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/servlet/TradeServletAction.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/servlet/TradeServletAction.java deleted file mode 100644 index 18aad48c..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/servlet/TradeServletAction.java +++ /dev/null @@ -1,652 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2015. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.web.servlet; - -import com.ibm.websphere.samples.daytrader.entities.AccountDataBean; -import com.ibm.websphere.samples.daytrader.entities.AccountProfileDataBean; -import com.ibm.websphere.samples.daytrader.entities.HoldingDataBean; -import com.ibm.websphere.samples.daytrader.entities.OrderDataBean; -import com.ibm.websphere.samples.daytrader.entities.QuoteDataBean; -import com.ibm.websphere.samples.daytrader.interfaces.Trace; -import com.ibm.websphere.samples.daytrader.interfaces.TradeServices; -import com.ibm.websphere.samples.daytrader.util.Log; -import com.ibm.websphere.samples.daytrader.util.TradeConfig; -import com.ibm.websphere.samples.daytrader.util.TradeRunTimeModeLiteral; -import java.io.IOException; -import java.io.Serializable; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Iterator; -import javax.enterprise.context.SessionScoped; -import javax.enterprise.inject.Any; -import javax.enterprise.inject.Instance; -import javax.inject.Inject; -import javax.servlet.ServletContext; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; - - -/** - * TradeServletAction provides servlet specific client side access to each of - * the Trade brokerage user operations. These include login, logout, buy, sell, - * getQuote, etc. TradeServletAction manages a web interface to Trade handling - * HttpRequests/HttpResponse objects and forwarding results to the appropriate - * JSP page for the web interface. TradeServletAction invokes - * {@link TradeAction} methods to actually perform each trading operation. - * - */ -@SessionScoped -@Trace -public class TradeServletAction implements Serializable { - - private static final long serialVersionUID = 7732313125198761455L; - - private TradeServices tAction; - - @Inject - public TradeServletAction(@Any Instance services) { - tAction = services.select(new TradeRunTimeModeLiteral(TradeConfig.getRunTimeModeNames()[TradeConfig.getRunTimeMode()])).get(); - } - - public TradeServletAction() { - } - - /** - * Display User Profile information such as address, email, etc. for the - * given Trader Dispatch to the Trade Account JSP for display - * - * @param userID - * The User to display profile info - * @param ctx - * the servlet context - * @param req - * the HttpRequest object - * @param resp - * the HttpResponse object - * @param results - * A short description of the results/success of this web request - * provided on the web page - * @exception javax.servlet.ServletException - * If a servlet specific exception is encountered - * @exception javax.io.IOException - * If an exception occurs while writing results back to the - * user - * - */ - void doAccount(ServletContext ctx, HttpServletRequest req, HttpServletResponse resp, String userID, String results) throws javax.servlet.ServletException, - java.io.IOException { - try { - - AccountDataBean accountData = tAction.getAccountData(userID); - AccountProfileDataBean accountProfileData = tAction.getAccountProfileData(userID); - Collection orderDataBeans = (TradeConfig.getLongRun() ? new ArrayList() : (Collection) tAction.getOrders(userID)); - - req.setAttribute("accountData", accountData); - req.setAttribute("accountProfileData", accountProfileData); - req.setAttribute("orderDataBeans", orderDataBeans); - req.setAttribute("results", results); - requestDispatch(ctx, req, resp, userID, TradeConfig.getPage(TradeConfig.ACCOUNT_PAGE)); - } catch (java.lang.IllegalArgumentException e) { // this is a user - // error so I will - // forward them to another page rather than throw a 500 - req.setAttribute("results", results + "could not find account for userID = " + userID); - requestDispatch(ctx, req, resp, userID, TradeConfig.getPage(TradeConfig.HOME_PAGE)); - // log the exception with an error level of 3 which means, handled - // exception but would invalidate a automation run - Log.error("TradeServletAction.doAccount(...)", "illegal argument, information should be in exception string", e); - } catch (Exception e) { - // log the exception with error page - throw new ServletException("TradeServletAction.doAccount(...)" + " exception user =" + userID, e); - } - - } - - /** - * Update User Profile information such as address, email, etc. for the - * given Trader Dispatch to the Trade Account JSP for display If any in put - * is incorrect revert back to the account page w/ an appropriate message - * - * @param userID - * The User to upddate profile info - * @param password - * The new User password - * @param cpassword - * Confirm password - * @param fullname - * The new User fullname info - * @param address - * The new User address info - * @param cc - * The new User credit card info - * @param email - * The new User email info - * @param ctx - * the servlet context - * @param req - * the HttpRequest object - * @param resp - * the HttpResponse object - * @exception javax.servlet.ServletException - * If a servlet specific exception is encountered - * @exception javax.io.IOException - * If an exception occurs while writing results back to the - * user - * - */ - void doAccountUpdate(ServletContext ctx, HttpServletRequest req, HttpServletResponse resp, String userID, String password, String cpassword, - String fullName, String address, String creditcard, String email) throws javax.servlet.ServletException, java.io.IOException { - String results = ""; - - // First verify input data - boolean doUpdate = true; - if (password.equals(cpassword) == false) { - results = "Update profile error: passwords do not match"; - doUpdate = false; - } else if (password.length() <= 0 || fullName.length() <= 0 || address.length() <= 0 || creditcard.length() <= 0 || email.length() <= 0) { - results = "Update profile error: please fill in all profile information fields"; - doUpdate = false; - } - AccountProfileDataBean accountProfileData = new AccountProfileDataBean(userID, password, fullName, address, email, creditcard); - try { - if (doUpdate) { - accountProfileData = tAction.updateAccountProfile(accountProfileData); - results = "Account profile update successful"; - } - - } catch (java.lang.IllegalArgumentException e) { // this is a user - // error so I will - // forward them to another page rather than throw a 500 - req.setAttribute("results", results + "invalid argument, check userID is correct, and the database is populated" + userID); - Log.error(e, "TradeServletAction.doAccount(...)", "illegal argument, information should be in exception string", - "treating this as a user error and forwarding on to a new page"); - } catch (Exception e) { - // log the exception with error page - throw new ServletException("TradeServletAction.doAccountUpdate(...)" + " exception user =" + userID, e); - } - doAccount(ctx, req, resp, userID, results); - } - - /** - * Buy a new holding of shares for the given trader Dispatch to the Trade - * Portfolio JSP for display - * - * @param userID - * The User buying shares - * @param symbol - * The stock to purchase - * @param amount - * The quantity of shares to purchase - * @param ctx - * the servlet context - * @param req - * the HttpRequest object - * @param resp - * the HttpResponse object - * @exception javax.servlet.ServletException - * If a servlet specific exception is encountered - * @exception javax.io.IOException - * If an exception occurs while writing results back to the - * user - * - */ - void doBuy(ServletContext ctx, HttpServletRequest req, HttpServletResponse resp, String userID, String symbol, String quantity) throws ServletException, - IOException { - - String results = ""; - - try { - - OrderDataBean orderData = tAction.buy(userID, symbol, new Double(quantity).doubleValue(), TradeConfig.getOrderProcessingMode()); - - req.setAttribute("orderData", orderData); - req.setAttribute("results", results); - } catch (java.lang.IllegalArgumentException e) { // this is a user - // error so I will - // forward them to another page rather than throw a 500 - req.setAttribute("results", results + "illegal argument:"); - requestDispatch(ctx, req, resp, userID, TradeConfig.getPage(TradeConfig.HOME_PAGE)); - // log the exception with an error level of 3 which means, handled - // exception but would invalidate a automation run - Log.error(e, "TradeServletAction.doBuy(...)", "illegal argument. userID = " + userID, "symbol = " + symbol); - } catch (Exception e) { - // log the exception with error page - throw new ServletException("TradeServletAction.buy(...)" + " exception buying stock " + symbol + " for user " + userID, e); - } - requestDispatch(ctx, req, resp, userID, TradeConfig.getPage(TradeConfig.ORDER_PAGE)); - } - - /** - * Create the Trade Home page with personalized information such as the - * traders account balance Dispatch to the Trade Home JSP for display - * - * @param ctx - * the servlet context - * @param req - * the HttpRequest object - * @param resp - * the HttpResponse object - * @param results - * A short description of the results/success of this web request - * provided on the web page - * @exception javax.servlet.ServletException - * If a servlet specific exception is encountered - * @exception javax.io.IOException - * If an exception occurs while writing results back to the - * user - * - */ - void doHome(ServletContext ctx, HttpServletRequest req, HttpServletResponse resp, String userID, String results) throws javax.servlet.ServletException, - java.io.IOException { - - try { - AccountDataBean accountData = tAction.getAccountData(userID); - Collection holdingDataBeans = tAction.getHoldings(userID); - - // Edge Caching: - // Getting the MarketSummary has been moved to the JSP - // MarketSummary.jsp. This makes the MarketSummary a - // standalone "fragment", and thus is a candidate for - // Edge caching. - // marketSummaryData = tAction.getMarketSummary(); - - req.setAttribute("accountData", accountData); - req.setAttribute("holdingDataBeans", holdingDataBeans); - // See Edge Caching above - // req.setAttribute("marketSummaryData", marketSummaryData); - req.setAttribute("results", results); - } catch (java.lang.IllegalArgumentException e) { // this is a user - // error so I will - // forward them to another page rather than throw a 500 - req.setAttribute("results", results + "check userID = " + userID + " and that the database is populated"); - requestDispatch(ctx, req, resp, userID, TradeConfig.getPage(TradeConfig.HOME_PAGE)); - // log the exception with an error level of 3 which means, handled - // exception but would invalidate a automation run - Log.error("TradeServletAction.doHome(...)" + "illegal argument, information should be in exception string" - + "treating this as a user error and forwarding on to a new page", e); - } catch (javax.ejb.FinderException e) { - // this is a user error so I will - // forward them to another page rather than throw a 500 - req.setAttribute("results", results + "\nCould not find account for + " + userID); - // requestDispatch(ctx, req, resp, - // TradeConfig.getPage(TradeConfig.HOME_PAGE)); - // log the exception with an error level of 3 which means, handled - // exception but would invalidate a automation run - Log.error("TradeServletAction.doHome(...)" + "Error finding account for user " + userID - + "treating this as a user error and forwarding on to a new page", e); - } catch (Exception e) { - // log the exception with error page - throw new ServletException("TradeServletAction.doHome(...)" + " exception user =" + userID, e); - } - - requestDispatch(ctx, req, resp, userID, TradeConfig.getPage(TradeConfig.HOME_PAGE)); - } - - /** - * Login a Trade User. Dispatch to the Trade Home JSP for display - * - * @param userID - * The User to login - * @param passwd - * The password supplied by the trader used to authenticate - * @param ctx - * the servlet context - * @param req - * the HttpRequest object - * @param resp - * the HttpResponse object - * @param results - * A short description of the results/success of this web request - * provided on the web page - * @exception javax.servlet.ServletException - * If a servlet specific exception is encountered - * @exception javax.io.IOException - * If an exception occurs while writing results back to the - * user - * - */ - void doLogin(ServletContext ctx, HttpServletRequest req, HttpServletResponse resp, String userID, String passwd) throws javax.servlet.ServletException, - java.io.IOException { - - String results = ""; - try { - // Got a valid userID and passwd, attempt login - if (tAction==null) { - System.out.println("null"); } - AccountDataBean accountData = tAction.login(userID, passwd); - - if (accountData != null) { - HttpSession session = req.getSession(true); - session.setAttribute("uidBean", userID); - session.setAttribute("sessionCreationDate", new java.util.Date()); - - results = "Ready to Trade"; - doHome(ctx, req, resp, userID, results); - return; - } else { - req.setAttribute("results", results + "\nCould not find account for + " + userID); - // log the exception with an error level of 3 which means, - // handled exception but would invalidate a automation run - Log.log("TradeServletAction.doLogin(...)", "Error finding account for user " + userID + "", - "user entered a bad username or the database is not populated"); - } - } catch (java.lang.IllegalArgumentException e) { // this is a user - // error so I will - // forward them to another page rather than throw a 500 - req.setAttribute("results", results + "illegal argument:" + e.getMessage()); - // log the exception with an error level of 3 which means, handled - // exception but would invalidate a automation run - Log.error(e, "TradeServletAction.doLogin(...)", "illegal argument, information should be in exception string", - "treating this as a user error and forwarding on to a new page"); - - } catch (Exception e) { - // log the exception with error page - throw new ServletException("TradeServletAction.doLogin(...)" + "Exception logging in user " + userID + "with password" + passwd, e); - } - - requestDispatch(ctx, req, resp, userID, TradeConfig.getPage(TradeConfig.WELCOME_PAGE)); - - } - - /** - * Logout a Trade User Dispatch to the Trade Welcome JSP for display - * - * @param userID - * The User to logout - * @param ctx - * the servlet context - * @param req - * the HttpRequest object - * @param resp - * the HttpResponse object - * @param results - * A short description of the results/success of this web request - * provided on the web page - * @exception javax.servlet.ServletException - * If a servlet specific exception is encountered - * @exception javax.io.IOException - * If an exception occurs while writing results back to the - * user - * - */ - void doLogout(ServletContext ctx, HttpServletRequest req, HttpServletResponse resp, String userID) throws ServletException, IOException { - String results = ""; - - try { - tAction.logout(userID); - - } catch (java.lang.IllegalArgumentException e) { // this is a user - // error so I will - // forward them to another page, at the end of the page. - req.setAttribute("results", results + "illegal argument:" + e.getMessage()); - - // log the exception with an error level of 3 which means, handled - // exception but would invalidate a automation run - Log.error(e, "TradeServletAction.doLogout(...)", "illegal argument, information should be in exception string", - "treating this as a user error and forwarding on to a new page"); - } catch (Exception e) { - // log the exception and foward to a error page - Log.error(e, "TradeServletAction.doLogout(...):", "Error logging out" + userID, "fowarding to an error page"); - // set the status_code to 500 - throw new ServletException("TradeServletAction.doLogout(...)" + "exception logging out user " + userID, e); - } - HttpSession session = req.getSession(); - if (session != null) { - session.invalidate(); - } - - // Added to actually remove a user from the authentication cache - req.logout(); - - Object o = req.getAttribute("TSS-RecreateSessionInLogout"); - if (o != null && ((Boolean) o).equals(Boolean.TRUE)) { - // Recreate Session object before writing output to the response - // Once the response headers are written back to the client the - // opportunity - // to create a new session in this request may be lost - // This is to handle only the TradeScenarioServlet case - session = req.getSession(true); - } - requestDispatch(ctx, req, resp, userID, TradeConfig.getPage(TradeConfig.WELCOME_PAGE)); - } - - /** - * Retrieve the current portfolio of stock holdings for the given trader - * Dispatch to the Trade Portfolio JSP for display - * - * @param userID - * The User requesting to view their portfolio - * @param ctx - * the servlet context - * @param req - * the HttpRequest object - * @param resp - * the HttpResponse object - * @param results - * A short description of the results/success of this web request - * provided on the web page - * @exception javax.servlet.ServletException - * If a servlet specific exception is encountered - * @exception javax.io.IOException - * If an exception occurs while writing results back to the - * user - * - */ - void doPortfolio(ServletContext ctx, HttpServletRequest req, HttpServletResponse resp, String userID, String results) throws ServletException, IOException { - - try { - // Get the holdiings for this user - - Collection quoteDataBeans = new ArrayList(); - Collection holdingDataBeans = tAction.getHoldings(userID); - - // Walk through the collection of user - // holdings and creating a list of quotes - if (holdingDataBeans.size() > 0) { - - Iterator it = holdingDataBeans.iterator(); - while (it.hasNext()) { - HoldingDataBean holdingData = (HoldingDataBean) it.next(); - QuoteDataBean quoteData = tAction.getQuote(holdingData.getQuoteID()); - quoteDataBeans.add(quoteData); - } - } else { - results = results + ". Your portfolio is empty."; - } - req.setAttribute("results", results); - req.setAttribute("holdingDataBeans", holdingDataBeans); - req.setAttribute("quoteDataBeans", quoteDataBeans); - requestDispatch(ctx, req, resp, userID, TradeConfig.getPage(TradeConfig.PORTFOLIO_PAGE)); - } catch (java.lang.IllegalArgumentException e) { // this is a user - // error so I will - // forward them to another page rather than throw a 500 - req.setAttribute("results", results + "illegal argument:" + e.getMessage()); - requestDispatch(ctx, req, resp, userID, TradeConfig.getPage(TradeConfig.PORTFOLIO_PAGE)); - // log the exception with an error level of 3 which means, handled - // exception but would invalidate a automation run - Log.error(e, "TradeServletAction.doPortfolio(...)", "illegal argument, information should be in exception string", "user error"); - } catch (Exception e) { - // log the exception with error page - throw new ServletException("TradeServletAction.doPortfolio(...)" + " exception user =" + userID, e); - } - } - - /** - * Retrieve the current Quote for the given stock symbol Dispatch to the - * Trade Quote JSP for display - * - * @param userID - * The stock symbol used to get the current quote - * @param ctx - * the servlet context - * @param req - * the HttpRequest object - * @param resp - * the HttpResponse object - * @exception javax.servlet.ServletException - * If a servlet specific exception is encountered - * @exception javax.io.IOException - * If an exception occurs while writing results back to the - * user - * - */ - void doQuotes(ServletContext ctx, HttpServletRequest req, HttpServletResponse resp, String userID, String symbols) throws ServletException, IOException { - - try { - Collection quoteDataBeans = new ArrayList(); - String[] symbolsSplit = symbols.split(","); - for (String symbol: symbolsSplit) { - QuoteDataBean quoteData = tAction.getQuote(symbol.trim()); - quoteDataBeans.add(quoteData); - } - req.setAttribute("quoteDataBeans", quoteDataBeans); - requestDispatch(ctx, req, resp, userID, TradeConfig.getPage(TradeConfig.QUOTE_PAGE)); - - } catch (Exception e) { - // log the exception with error page - throw new ServletException("TradeServletAction.doQuotes(...)" + " exception user =" + userID, e); - } - } - - /** - * Register a new trader given the provided user Profile information such as - * address, email, etc. Dispatch to the Trade Home JSP for display - * - * @param userID - * The User to create - * @param passwd - * The User password - * @param fullname - * The new User fullname info - * @param ccn - * The new User credit card info - * @param money - * The new User opening account balance - * @param address - * The new User address info - * @param email - * The new User email info - * @return The userID of the new trader - * @param ctx - * the servlet context - * @param req - * the HttpRequest object - * @param resp - * the HttpResponse object - * @exception javax.servlet.ServletException - * If a servlet specific exception is encountered - * @exception javax.io.IOException - * If an exception occurs while writing results back to the - * user - * - */ - void doRegister(ServletContext ctx, HttpServletRequest req, HttpServletResponse resp, String userID, String passwd, String cpasswd, String fullname, - String ccn, String openBalanceString, String email, String address) throws ServletException, IOException { - String results = ""; - - try { - // Validate user passwords match and are atleast 1 char in length - if ((passwd.equals(cpasswd)) && (passwd.length() >= 1)) { - - AccountDataBean accountData = tAction.register(userID, passwd, fullname, address, email, ccn, new BigDecimal(openBalanceString)); - if (accountData == null) { - results = "Registration operation failed;"; - System.out.println(results); - req.setAttribute("results", results); - requestDispatch(ctx, req, resp, userID, TradeConfig.getPage(TradeConfig.REGISTER_PAGE)); - } else { - doLogin(ctx, req, resp, userID, passwd); - results = "Registration operation succeeded; Account " + accountData.getAccountID() + " has been created."; - req.setAttribute("results", results); - - } - } else { - // Password validation failed - results = "Registration operation failed, your passwords did not match"; - System.out.println(results); - req.setAttribute("results", results); - requestDispatch(ctx, req, resp, userID, TradeConfig.getPage(TradeConfig.REGISTER_PAGE)); - } - - } catch (Exception e) { - // log the exception with error page - throw new ServletException("TradeServletAction.doRegister(...)" + " exception user =" + userID, e); - } - } - - /** - * Sell a current holding of stock shares for the given trader. Dispatch to - * the Trade Portfolio JSP for display - * - * @param userID - * The User buying shares - * @param symbol - * The stock to sell - * @param indx - * The unique index identifying the users holding to sell - * @param ctx - * the servlet context - * @param req - * the HttpRequest object - * @param resp - * the HttpResponse object - * @exception javax.servlet.ServletException - * If a servlet specific exception is encountered - * @exception javax.io.IOException - * If an exception occurs while writing results back to the - * user - * - */ - void doSell(ServletContext ctx, HttpServletRequest req, HttpServletResponse resp, String userID, Integer holdingID) throws ServletException, IOException { - String results = ""; - try { - OrderDataBean orderData = tAction.sell(userID, holdingID, TradeConfig.getOrderProcessingMode()); - - req.setAttribute("orderData", orderData); - req.setAttribute("results", results); - } catch (java.lang.IllegalArgumentException e) { // this is a user - // error so I will - // just log the exception and then later on I will redisplay the - // portfolio page - // because this is just a user exception - Log.error(e, "TradeServletAction.doSell(...)", "illegal argument, information should be in exception string", "user error"); - } catch (Exception e) { - // log the exception with error page - throw new ServletException("TradeServletAction.doSell(...)" + " exception selling holding " + holdingID + " for user =" + userID, e); - } - requestDispatch(ctx, req, resp, userID, TradeConfig.getPage(TradeConfig.ORDER_PAGE)); - } - - void doWelcome(ServletContext ctx, HttpServletRequest req, HttpServletResponse resp, String status) throws ServletException, IOException { - - req.setAttribute("results", status); - requestDispatch(ctx, req, resp, null, TradeConfig.getPage(TradeConfig.WELCOME_PAGE)); - } - - private void requestDispatch(ServletContext ctx, HttpServletRequest req, HttpServletResponse resp, String userID, String page) throws ServletException, - IOException { - - ctx.getRequestDispatcher(page).include(req, resp); - } - - void doMarketSummary(ServletContext ctx, HttpServletRequest req, HttpServletResponse resp, String userID) throws ServletException, IOException { - req.setAttribute("results", "test"); - requestDispatch(ctx, req, resp, userID, TradeConfig.getPage(TradeConfig.MARKET_SUMMARY_PAGE)); - - } -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/servlet/TradeWebContextListener.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/servlet/TradeWebContextListener.java deleted file mode 100644 index 4481120d..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/servlet/TradeWebContextListener.java +++ /dev/null @@ -1,114 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2015. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.web.servlet; - -import static javax.faces.annotation.FacesConfig.Version.JSF_2_3; - -import com.ibm.websphere.samples.daytrader.util.Log; -import com.ibm.websphere.samples.daytrader.util.TradeConfig; -import java.io.InputStream; -import java.util.Properties; -import javax.faces.annotation.FacesConfig; -import javax.servlet.ServletContextEvent; -import javax.servlet.ServletContextListener; -import javax.servlet.annotation.WebListener; - -@WebListener() -@FacesConfig(version = JSF_2_3) -public class TradeWebContextListener implements ServletContextListener { - - - - // receieve trade web app startup/shutown events to start(initialized)/stop - // TradeDirect - @Override - public void contextInitialized(ServletContextEvent event) { - Log.trace("TradeWebContextListener contextInitialized -- initializing TradeDirect"); - - // Load settings from properties file (if it exists) - Properties prop = new Properties(); - InputStream stream = event.getServletContext().getResourceAsStream("/properties/daytrader.properties"); - - try { - prop.load(stream); - System.out.println("Settings from daytrader.properties: " + prop); - - if (System.getenv("RUNTIME_MODE") != null) { - TradeConfig.setRunTimeMode(Integer.parseInt(System.getenv("RUNTIME_MODE"))); - } else { - TradeConfig.setRunTimeMode(Integer.parseInt(prop.getProperty("runtimeMode"))); - } - System.out.print("Running in " + TradeConfig.getRunTimeModeNames()[TradeConfig.getRunTimeMode()] + " Mode"); - - if (System.getenv("ORDER_PROCESSING_MODE") != null) { - TradeConfig.setOrderProcessingMode(Integer.parseInt(System.getenv("ORDER_PROCESSING_MODE"))); - } else { - TradeConfig.setOrderProcessingMode(Integer.parseInt(prop.getProperty("orderProcessingMode"))); - } - System.out.print("Running in " + TradeConfig.getOrderProcessingModeNames()[TradeConfig.getOrderProcessingMode()] + " Order Processing Mode"); - - if (System.getenv("MAX_USERS") != null) { - TradeConfig.setMAX_USERS(Integer.parseInt(System.getenv("MAX_USERS"))); - } else { - TradeConfig.setMAX_USERS(Integer.parseInt(prop.getProperty("maxUsers"))); - } - System.out.print("MAX_USERS = " + TradeConfig.getMAX_USERS() + " users"); - - if (System.getenv("MAX_QUOTES") != null) { - TradeConfig.setMAX_QUOTES(Integer.parseInt(System.getenv("MAX_QUOTES"))); - } else { - TradeConfig.setMAX_QUOTES(Integer.parseInt(prop.getProperty("maxQuotes"))); - } - System.out.print("MAX_QUOTES = " + TradeConfig.getMAX_QUOTES() + " quotes"); - - if (System.getenv("PUBLISH_QUOTES") != null) { - TradeConfig.setPublishQuotePriceChange(Boolean.parseBoolean(System.getenv("PUBLISH_QUOTES"))); - } else { - TradeConfig.setPublishQuotePriceChange(Boolean.parseBoolean(prop.getProperty("publishQuotePriceChange"))); - } - - if (System.getenv("DISPLAY_ORDER_ALERTS") != null) { - TradeConfig.setDisplayOrderAlerts(Boolean.parseBoolean(System.getenv("DISPLAY_ORDER_ALERTS"))); - } else { - TradeConfig.setDisplayOrderAlerts(Boolean.parseBoolean(prop.getProperty("displayOrderAlerts"))); - } - if (System.getenv("WEB_INTERFACE") != null) { - TradeConfig.setWebInterface(Integer.parseInt(System.getenv("WEB_INTERFACE"))); - } else { - TradeConfig.setWebInterface(Integer.parseInt(prop.getProperty("webInterface"))); - } - if (System.getenv("LIST_QUOTE_PRICE_CHANGE_FREQUENCY") != null) { - TradeConfig.setListQuotePriceChangeFrequency(Integer.parseInt(System.getenv("LIST_QUOTE_PRICE_CHANGE_FREQUENCY"))); - } else { - TradeConfig.setListQuotePriceChangeFrequency(Integer.parseInt(prop.getProperty("listQuotePriceChangeFrequency"))); - } - - TradeConfig.setPrimIterations(Integer.parseInt(prop.getProperty("primIterations"))); - TradeConfig.setMarketSummaryInterval(Integer.parseInt(prop.getProperty("marketSummaryInterval"))); - TradeConfig.setLongRun(Boolean.parseBoolean(prop.getProperty("longRun"))); - - } catch (Exception e) { - System.out.println("daytrader.properties not found"); - } - - } - - @Override - public void contextDestroyed(ServletContextEvent event) { - Log.trace("TradeWebContextListener contextDestroy calling TradeDirect:destroy()"); - } - -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/websocket/ActionDecoder.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/websocket/ActionDecoder.java deleted file mode 100644 index cc81f811..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/websocket/ActionDecoder.java +++ /dev/null @@ -1,56 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2015. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.web.websocket; - -import com.ibm.websphere.samples.daytrader.util.Log; -import javax.websocket.DecodeException; -import javax.websocket.Decoder; -import javax.websocket.EndpointConfig; - -// This is coded to be a Text type decoder expecting JSON format. -// It will decode incoming messages into object of type String -public class ActionDecoder implements Decoder.Text { - - public ActionDecoder() { - } - - @Override - public void destroy() { - } - - @Override - public void init(EndpointConfig config) { - } - - @Override - public ActionMessage decode(String jsonText) throws DecodeException { - - - Log.trace("ActionDecoder:decode -- received -->" + jsonText + "<--"); - - - ActionMessage actionMessage = new ActionMessage(); - actionMessage.doDecoding(jsonText); - return actionMessage; - - } - - @Override - public boolean willDecode(String s) { - return true; - } - -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/websocket/ActionMessage.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/websocket/ActionMessage.java deleted file mode 100644 index e5697906..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/websocket/ActionMessage.java +++ /dev/null @@ -1,82 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2015. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.web.websocket; - -import com.ibm.websphere.samples.daytrader.util.Log; -import java.io.StringReader; -import javax.json.Json; -import javax.json.stream.JsonParser; - -/** - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -public class ActionMessage { - - String decodedAction = null; - - public ActionMessage() { - } - - public void doDecoding(String jsonText) { - - String keyName = null; - try - { - // JSON parse - JsonParser parser = Json.createParser(new StringReader(jsonText)); - while (parser.hasNext()) { - JsonParser.Event event = parser.next(); - switch(event) { - case KEY_NAME: - keyName=parser.getString(); - break; - case VALUE_STRING: - if (keyName != null && keyName.equals("action")) { - decodedAction=parser.getString(); - } - break; - default: - break; - } - } - } catch (Exception e) { - Log.error("ActionMessage:doDecoding(" + jsonText + ") --> failed", e); - } - - - Log.trace("ActionMessage:doDecoding -- decoded action -->" + decodedAction + "<--"); - - } - - -public String getDecodedAction() { - return decodedAction; -} - -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/websocket/JsonDecoder.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/websocket/JsonDecoder.java deleted file mode 100644 index 33a70643..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/websocket/JsonDecoder.java +++ /dev/null @@ -1,56 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2015. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.web.websocket; - -import java.io.StringReader; -import javax.json.Json; -import javax.json.JsonObject; -import javax.websocket.DecodeException; -import javax.websocket.Decoder; -import javax.websocket.EndpointConfig; - -public class JsonDecoder implements Decoder.Text { - - @Override - public void destroy() { - } - - @Override - public void init(EndpointConfig ec) { - } - - @Override - public JsonMessage decode(String json) throws DecodeException { - JsonObject jsonObject = Json.createReader(new StringReader(json)).readObject(); - - JsonMessage message = new JsonMessage(); - message.setKey(jsonObject.getString("key")); - message.setValue(jsonObject.getString("value")); - - return message; - } - - @Override - public boolean willDecode(String json) { - try { - Json.createReader(new StringReader(json)).readObject(); - return true; - } catch (Exception e) { - return false; - } - } - -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/websocket/JsonEncoder.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/websocket/JsonEncoder.java deleted file mode 100644 index e726c395..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/websocket/JsonEncoder.java +++ /dev/null @@ -1,46 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2015. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.web.websocket; - -import javax.json.Json; -import javax.json.JsonObject; -import javax.websocket.EncodeException; -import javax.websocket.Encoder; -import javax.websocket.EndpointConfig; - -public class JsonEncoder implements Encoder.Text{ - - @Override - public void destroy() { - } - - @Override - public void init(EndpointConfig ec) { - } - - @Override - public String encode(JsonMessage message) throws EncodeException { - - JsonObject jsonObject = Json.createObjectBuilder() - .add("key", message.getKey()) - .add("value", message.getValue()).build(); - - return jsonObject.toString(); - } - - - -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/websocket/JsonMessage.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/websocket/JsonMessage.java deleted file mode 100644 index 784ccffd..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/websocket/JsonMessage.java +++ /dev/null @@ -1,40 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2015. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.web.websocket; - -public class JsonMessage { - - private String key; - private String value; - - public String getKey() { - return key; - } - - public void setKey(String key) { - this.key = key; - } - - public String getValue() { - return value; - } - - public void setValue(String value) { - this.value = value; - } - - -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/websocket/MarketSummaryWebSocket.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/websocket/MarketSummaryWebSocket.java deleted file mode 100644 index 47e03c59..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/websocket/MarketSummaryWebSocket.java +++ /dev/null @@ -1,157 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2015, 2021. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.web.websocket; - -import com.ibm.websphere.samples.daytrader.interfaces.MarketSummaryUpdate; -import com.ibm.websphere.samples.daytrader.interfaces.QuotePriceChange; -import com.ibm.websphere.samples.daytrader.interfaces.TradeServices; -import com.ibm.websphere.samples.daytrader.util.Log; -import com.ibm.websphere.samples.daytrader.util.RecentQuotePriceChangeList; -import com.ibm.websphere.samples.daytrader.util.TradeConfig; -import com.ibm.websphere.samples.daytrader.util.TradeRunTimeModeLiteral; -import java.util.Iterator; -import java.util.List; -import java.util.concurrent.CopyOnWriteArrayList; -import java.util.concurrent.CountDownLatch; -import javax.annotation.Priority; -import javax.enterprise.event.ObservesAsync; -import javax.enterprise.inject.Any; -import javax.enterprise.inject.Instance; -import javax.inject.Inject; -import javax.interceptor.Interceptor; -import javax.json.JsonObject; -import javax.websocket.CloseReason; -import javax.websocket.EndpointConfig; -import javax.websocket.OnClose; -import javax.websocket.OnError; -import javax.websocket.OnMessage; -import javax.websocket.OnOpen; -import javax.websocket.Session; -import javax.websocket.server.ServerEndpoint; - - -/** This class is a WebSocket EndPoint that sends the Market Summary in JSON form and - * encodes recent quote price changes when requested or when triggered by CDI events. - **/ - -@ServerEndpoint(value = "/marketsummary",encoders={QuotePriceChangeListEncoder.class},decoders={ActionDecoder.class}) -public class MarketSummaryWebSocket { - - @Inject - RecentQuotePriceChangeList recentQuotePriceChangeList; - - private TradeServices tradeAction; - - private static final List sessions = new CopyOnWriteArrayList<>(); - private final CountDownLatch latch = new CountDownLatch(1); - - @Inject - public MarketSummaryWebSocket(@Any Instance services) { - tradeAction = services.select(new TradeRunTimeModeLiteral(TradeConfig.getRunTimeModeNames()[TradeConfig.getRunTimeMode()])).get(); - } - - // should never be used - public MarketSummaryWebSocket(){ - } - - @OnOpen - public void onOpen(final Session session, EndpointConfig ec) { - Log.trace("MarketSummaryWebSocket:onOpen -- session -->" + session + "<--"); - - sessions.add(session); - latch.countDown(); - } - - @OnMessage - public void sendMarketSummary(ActionMessage message, Session currentSession) { - - String action = message.getDecodedAction(); - - Log.trace("MarketSummaryWebSocket:sendMarketSummary -- received -->" + action + "<--"); - - // Make sure onopen is finished - try { - latch.await(); - } catch (Exception e) { - e.printStackTrace(); - return; - } - - - if (action != null && action.equals("updateMarketSummary")) { - - try { - - JsonObject mkSummary = tradeAction.getMarketSummary().toJSON(); - - Log.trace("MarketSummaryWebSocket:sendMarketSummary -- sending -->" + mkSummary + "<--"); - - currentSession.getAsyncRemote().sendText(mkSummary.toString()); - - } catch (Exception e) { - e.printStackTrace(); - } - } else if (action != null && action.equals("updateRecentQuotePriceChange")) { - if (!recentQuotePriceChangeList.isEmpty()) { - currentSession.getAsyncRemote().sendObject(recentQuotePriceChangeList.recentList()); - } - } - } - - @OnError - public void onError(Throwable t, Session currentSession) { - Log.trace("MarketSummaryWebSocket:onError -- session -->" + currentSession + "<--"); - t.printStackTrace(); - } - - @OnClose - public void onClose(Session session, CloseReason reason) { - Log.trace("MarketSummaryWebSocket:onClose -- session -->" + session + "<--"); - sessions.remove(session); - } - - public void onStockChange(@ObservesAsync @Priority(Interceptor.Priority.APPLICATION) @QuotePriceChange String event) { - - Log.trace("MarketSummaryWebSocket:onStockChange"); - - Iterator failSafeIterator = sessions.iterator(); - while(failSafeIterator.hasNext()) { - Session s = failSafeIterator.next(); - if (s.isOpen()) { - s.getAsyncRemote().sendObject(recentQuotePriceChangeList.recentList()); - } - } - } - - public void onMarketSummarytUpdate(@ObservesAsync @Priority(Interceptor.Priority.APPLICATION) @MarketSummaryUpdate String event) { - - Log.trace("MarketSummaryWebSocket:onJMSMessage"); - - try { - JsonObject mkSummary = tradeAction.getMarketSummary().toJSON(); - - Iterator failSafeIterator = sessions.iterator(); - while(failSafeIterator.hasNext()) { - Session s = failSafeIterator.next(); - if (s.isOpen()) { - s.getAsyncRemote().sendText(mkSummary.toString()); - } - } - } catch (Exception e) { - e.printStackTrace(); - } - } -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/websocket/QuotePriceChangeListEncoder.java b/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/websocket/QuotePriceChangeListEncoder.java deleted file mode 100644 index 4105750d..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/java/com/ibm/websphere/samples/daytrader/web/websocket/QuotePriceChangeListEncoder.java +++ /dev/null @@ -1,65 +0,0 @@ -/** - * (C) Copyright IBM Corporation 2019. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.ibm.websphere.samples.daytrader.web.websocket; - -import com.ibm.websphere.samples.daytrader.entities.QuoteDataBean; -import java.util.Iterator; -import java.util.concurrent.CopyOnWriteArrayList; -import javax.json.Json; -import javax.json.JsonBuilderFactory; -import javax.json.JsonObjectBuilder; -import javax.websocket.EncodeException; -import javax.websocket.Encoder; -import javax.websocket.EndpointConfig; - - -/** This class takes a list of quotedata (from the RecentQuotePriceChangeList bean) and encodes - it to the json format the client (marektsummary.html) is expecting. **/ -public class QuotePriceChangeListEncoder implements Encoder.Text> { - - private static final JsonBuilderFactory jsonObjectFactory = Json.createBuilderFactory(null); - - public String encode(CopyOnWriteArrayList list) throws EncodeException { - - JsonObjectBuilder jObjectBuilder = jsonObjectFactory.createObjectBuilder(); - - int i = 1; - - for (Iterator iterator = list.iterator(); iterator.hasNext();) { - QuoteDataBean quotedata = iterator.next(); - - jObjectBuilder.add("change" + i + "_stock", quotedata.getSymbol()); - jObjectBuilder.add("change" + i + "_price","$" + quotedata.getPrice()); - jObjectBuilder.add("change" + i + "_change", quotedata.getChange()); - i++; - } - - return jObjectBuilder.build().toString(); - } - - @Override - public void init(EndpointConfig config) { - // TODO Auto-generated method stub - - } - - @Override - public void destroy() { - // TODO Auto-generated method stub - - } - -} diff --git a/src/test/resources/test-applications/daytrader8/src/main/liberty/config/bootstrap.properties b/src/test/resources/test-applications/daytrader8/src/main/liberty/config/bootstrap.properties deleted file mode 100644 index b20b3d57..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/liberty/config/bootstrap.properties +++ /dev/null @@ -1,2 +0,0 @@ -default.http.port=9080 -default.https.port=9443 diff --git a/src/test/resources/test-applications/daytrader8/src/main/liberty/config/server.env b/src/test/resources/test-applications/daytrader8/src/main/liberty/config/server.env deleted file mode 100644 index e56f3dd7..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/liberty/config/server.env +++ /dev/null @@ -1,2 +0,0 @@ -MAX_QUOTES=1000 -MAX_USERS=500 diff --git a/src/test/resources/test-applications/daytrader8/src/main/liberty/config/server.xml b/src/test/resources/test-applications/daytrader8/src/main/liberty/config/server.xml deleted file mode 100644 index c951cac3..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/liberty/config/server.xml +++ /dev/null @@ -1,79 +0,0 @@ - - - - ejb-3.2 - servlet-4.0 - jsf-2.3 - jpa-2.2 - mdb-3.2 - wasJmsServer-1.0 - wasJmsClient-2.0 - cdi-2.0 - websocket-1.1 - concurrent-1.0 - jsonp-1.1 - jsonb-1.0 - beanValidation-2.0 - jaxrs-2.1 - ssl-1.0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/test/resources/test-applications/daytrader8/src/main/liberty/config/server.xml_db2 b/src/test/resources/test-applications/daytrader8/src/main/liberty/config/server.xml_db2 deleted file mode 100644 index a9287130..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/liberty/config/server.xml_db2 +++ /dev/null @@ -1,74 +0,0 @@ - - - ejb-3.2 - servlet-4.0 - jsf-2.3 - jpa-2.2 - mdb-3.2 - wasJmsServer-1.0 - wasJmsClient-2.0 - cdi-2.0 - websocket-1.1 - concurrent-1.0 - jsonp-1.1 - jsonb-1.0 - beanValidation-2.0 - jaxrs-2.1 - ssl-1.0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/test/resources/test-applications/daytrader8/src/main/webapp/META-INF/LICENSE b/src/test/resources/test-applications/daytrader8/src/main/webapp/META-INF/LICENSE deleted file mode 100644 index d6456956..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/webapp/META-INF/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/src/test/resources/test-applications/daytrader8/src/main/webapp/META-INF/MANIFEST.MF b/src/test/resources/test-applications/daytrader8/src/main/webapp/META-INF/MANIFEST.MF deleted file mode 100644 index 7b603592..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/webapp/META-INF/MANIFEST.MF +++ /dev/null @@ -1,5 +0,0 @@ -Manifest-Version: 1.0 -Ant-Version: Apache Ant 1.7.1 -Class-Path: daytrader-ee7-ejb.jar -Created-By: 2.6 (IBM Corporation) - diff --git a/src/test/resources/test-applications/daytrader8/src/main/webapp/PingCDIJSF.xhtml b/src/test/resources/test-applications/daytrader8/src/main/webapp/PingCDIJSF.xhtml deleted file mode 100644 index 949bdce7..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/webapp/PingCDIJSF.xhtml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - -DayTrader PingJSF - - - - - - - - - - -
    Hit Count: #{pingCDIJSFBean.hitCount}
    -
    - - \ No newline at end of file diff --git a/src/test/resources/test-applications/daytrader8/src/main/webapp/PingHtml.html b/src/test/resources/test-applications/daytrader8/src/main/webapp/PingHtml.html deleted file mode 100644 index 53ec32d5..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/webapp/PingHtml.html +++ /dev/null @@ -1,29 +0,0 @@ - - - -PingHTML.html - - -
    -

    - PING HTML: -

    -

    - Hello World -

    - - diff --git a/src/test/resources/test-applications/daytrader8/src/main/webapp/PingJsf.xhtml b/src/test/resources/test-applications/daytrader8/src/main/webapp/PingJsf.xhtml deleted file mode 100644 index e06ab7ec..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/webapp/PingJsf.xhtml +++ /dev/null @@ -1,145 +0,0 @@ - - - - - -DayTrader PingJSF - - - - - - - - - - -
    - - - - - - - - - -
    Quotes
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - -
    -
    -
    -
    - diff --git a/src/test/resources/test-applications/daytrader8/src/main/webapp/PingJsp.jsp b/src/test/resources/test-applications/daytrader8/src/main/webapp/PingJsp.jsp deleted file mode 100644 index 787f8793..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/webapp/PingJsp.jsp +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - -PingJsp - - - <%!int hitCount = 0; - String initTime = new java.util.Date().toString();%> -
    -
    - PING JSP:
    -
    - Init time: <%=initTime%> - <% - hitCount++; - %> -

    - Hit Count: <%=hitCount%> -

    - - diff --git a/src/test/resources/test-applications/daytrader8/src/main/webapp/PingJspEL.jsp b/src/test/resources/test-applications/daytrader8/src/main/webapp/PingJspEL.jsp deleted file mode 100644 index 56fc66df..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/webapp/PingJspEL.jsp +++ /dev/null @@ -1,124 +0,0 @@ - - - - -PingJspEL - - - <%@ page - import="com.ibm.websphere.samples.daytrader.util.TradeConfig,com.ibm.websphere.samples.daytrader.entities.QuoteDataBean" - session="false"%> - - <%!int hitCount = 0; - String initTime = new java.util.Date().toString();%> - - <% - // setup some variables to work with later - int someint1 = TradeConfig.rndInt(100) + 1; - pageContext.setAttribute("someint1", new Integer(someint1)); - int someint2 = TradeConfig.rndInt(100) + 1; - pageContext.setAttribute("someint2", new Integer(someint2)); - float somefloat1 = TradeConfig.rndFloat(100) + 1.0f; - pageContext.setAttribute("somefloat1", new Float(somefloat1)); - float somefloat2 = TradeConfig.rndFloat(100) + 1.0f; - pageContext.setAttribute("somefloat2", new Float(somefloat2)); - - QuoteDataBean quoteData1 = QuoteDataBean.getRandomInstance(); - pageContext.setAttribute("quoteData1", quoteData1); - QuoteDataBean quoteData2 = QuoteDataBean.getRandomInstance(); - pageContext.setAttribute("quoteData2", quoteData2); - QuoteDataBean quoteData3 = QuoteDataBean.getRandomInstance(); - pageContext.setAttribute("quoteData3", quoteData3); - QuoteDataBean quoteData4 = QuoteDataBean.getRandomInstance(); - pageContext.setAttribute("quoteData4", quoteData4); - - QuoteDataBean quoteData[] = new QuoteDataBean[4]; - quoteData[0] = quoteData1; - quoteData[1] = quoteData2; - quoteData[2] = quoteData3; - quoteData[3] = quoteData4; - pageContext.setAttribute("quoteData", quoteData); - %> - -
    -
    - PING JSP EL:
    - Init time: <%=initTime%> -

    - Hit Count: <%=hitCount++%> -

    -
    - -

    - - someint1 = - <%=someint1%>
    someint2 = - <%=someint2%>
    somefloat1 = - <%=somefloat1%>
    somefloat2 = - <%=somefloat2%>
    -

    -


    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    EL TypeEL ExpressionsResult
    Integer Arithmetic\${someint1 + someint2 - someint1 * someint2 mod - someint1}${someint1 + someint2 - someint1 * someint2 mod someint1}
    Floating Point Arithmetic\${somefloat1 + somefloat2 - somefloat1 * - somefloat2 / somefloat1}${somefloat1 + somefloat2 - somefloat1 * somefloat2 / somefloat1}
    Logical Operations\${(someint1 < someint2) && (someint1 <= someint2) - || (someint1 == someint2) && !Boolean.FALSE}${(someint1 < someint2) && (someint1 <= someint2) || (someint1 == someint2) && !Boolean.FALSE}
    Indexing Operations\${quoteData3.symbol}
    - \${quoteData[2].symbol}
    \${quoteData4["symbol"]}
    - \${header["host"]}
    \${header.host}
    -
    ${quoteData3.symbol}
    ${quoteData[1].symbol}
    - ${quoteData4["symbol"]}
    ${header["host"]}
    - ${header.host} -
    Variable Scope Tests\${(quoteData3 == null) ? "null" : quoteData3}
    - \${(noSuchVariableAtAnyScope == null) ? "null" : noSuchVariableAtAnyScope} -
    ${(quoteData3 == null) ? "null" : quoteData3}
    - ${(noSuchVariableAtAnyScope == null) ? "null" : noSuchVariableAtAnyScope} -
    - - diff --git a/src/test/resources/test-applications/daytrader8/src/main/webapp/PingServlet2Jsp.jsp b/src/test/resources/test-applications/daytrader8/src/main/webapp/PingServlet2Jsp.jsp deleted file mode 100644 index dfe06f6c..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/webapp/PingServlet2Jsp.jsp +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - -PingJsp - - - <%!String initTime = (new java.util.Date()).toString();%> - -
    -
    Ping Servlet2JSP:
    -
    - Init time: <%=initTime%> -
    -
    - Message from Servlet: - <%= ab.getMsg() %> - - - diff --git a/src/test/resources/test-applications/daytrader8/src/main/webapp/PingWebSocketBinary.html b/src/test/resources/test-applications/daytrader8/src/main/webapp/PingWebSocketBinary.html deleted file mode 100644 index 8aa71445..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/webapp/PingWebSocketBinary.html +++ /dev/null @@ -1,92 +0,0 @@ - - - - -WebSocket Primitive - PingWebSocketBinary - - - - - -

    -
    - Ping WebSocket Binary
    - Init time :
    0


    - Hit Count:
    0

    - -
    - - \ No newline at end of file diff --git a/src/test/resources/test-applications/daytrader8/src/main/webapp/PingWebSocketJson.html b/src/test/resources/test-applications/daytrader8/src/main/webapp/PingWebSocketJson.html deleted file mode 100644 index 026a40b1..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/webapp/PingWebSocketJson.html +++ /dev/null @@ -1,112 +0,0 @@ - - - - -WebSocket Primitive - PingWebSocketJson - - - - - -

    -
    - Ping WebSocket Json
    - Init time :
    0


    - Sent Count :
    0

    - Received Count:
    0

    - -
    - - \ No newline at end of file diff --git a/src/test/resources/test-applications/daytrader8/src/main/webapp/PingWebSocketTextAsync.html b/src/test/resources/test-applications/daytrader8/src/main/webapp/PingWebSocketTextAsync.html deleted file mode 100644 index 96dfe2bb..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/webapp/PingWebSocketTextAsync.html +++ /dev/null @@ -1,90 +0,0 @@ - - - - -WebSocket Primitive - PingWebSocketTextAsync - - - - - -

    -
    - Ping WebSocket Text Async
    - Init time :
    0


    - Hit Count:
    0

    - -
    - - \ No newline at end of file diff --git a/src/test/resources/test-applications/daytrader8/src/main/webapp/PingWebSocketTextSync.html b/src/test/resources/test-applications/daytrader8/src/main/webapp/PingWebSocketTextSync.html deleted file mode 100644 index e454f185..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/webapp/PingWebSocketTextSync.html +++ /dev/null @@ -1,90 +0,0 @@ - - - - -WebSocket Primitive - PingWebSocketTextSync - - - - - -

    -
    - Ping WebSocket Text Sync
    - Init time :
    0


    - Hit Count:
    0

    - -
    - - \ No newline at end of file diff --git a/src/test/resources/test-applications/daytrader8/src/main/webapp/WAS_V7_64-bit_performance.pdf b/src/test/resources/test-applications/daytrader8/src/main/webapp/WAS_V7_64-bit_performance.pdf deleted file mode 100644 index 2f75b129..00000000 Binary files a/src/test/resources/test-applications/daytrader8/src/main/webapp/WAS_V7_64-bit_performance.pdf and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/src/main/webapp/WEB-INF/beans.xml b/src/test/resources/test-applications/daytrader8/src/main/webapp/WEB-INF/beans.xml deleted file mode 100644 index 99546567..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/webapp/WEB-INF/beans.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - diff --git a/src/test/resources/test-applications/daytrader8/src/main/webapp/WEB-INF/classes/META-INF/DEPENDENCIES b/src/test/resources/test-applications/daytrader8/src/main/webapp/WEB-INF/classes/META-INF/DEPENDENCIES deleted file mode 100644 index cb8878a9..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/webapp/WEB-INF/classes/META-INF/DEPENDENCIES +++ /dev/null @@ -1,15 +0,0 @@ -// ------------------------------------------------------------------ -// Transitive dependencies of this project determined from the -// maven pom organized by organization. -// ------------------------------------------------------------------ - -DayTrader :: Web Application - - -From: 'an unknown organization' - - Unnamed - taglibs:standard:jar:1.1.1 taglibs:standard:jar:1.1.1 - - - - - diff --git a/src/test/resources/test-applications/daytrader8/src/main/webapp/WEB-INF/classes/META-INF/LICENSE b/src/test/resources/test-applications/daytrader8/src/main/webapp/WEB-INF/classes/META-INF/LICENSE deleted file mode 100644 index d6456956..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/webapp/WEB-INF/classes/META-INF/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/src/test/resources/test-applications/daytrader8/src/main/webapp/WEB-INF/classes/META-INF/NOTICE b/src/test/resources/test-applications/daytrader8/src/main/webapp/WEB-INF/classes/META-INF/NOTICE deleted file mode 100644 index 883959db..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/webapp/WEB-INF/classes/META-INF/NOTICE +++ /dev/null @@ -1,8 +0,0 @@ - -DayTrader :: Web Application -Copyright 2005-2010 Apache Software Foundation - -This product includes software developed at -The Apache Software Foundation (http://www.apache.org/). - - diff --git a/src/test/resources/test-applications/daytrader8/src/main/webapp/WEB-INF/classes/META-INF/persistence.xml b/src/test/resources/test-applications/daytrader8/src/main/webapp/WEB-INF/classes/META-INF/persistence.xml deleted file mode 100644 index 4400b9fb..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/webapp/WEB-INF/classes/META-INF/persistence.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - jdbc/TradeDataSource - - com.ibm.websphere.samples.daytrader.entities.AccountDataBean - com.ibm.websphere.samples.daytrader.entities.AccountProfileDataBean - com.ibm.websphere.samples.daytrader.entities.HoldingDataBean - com.ibm.websphere.samples.daytrader.entities.OrderDataBean - com.ibm.websphere.samples.daytrader.entities.QuoteDataBean - true - NONE - - diff --git a/src/test/resources/test-applications/daytrader8/src/main/webapp/WEB-INF/classes/build.properties b/src/test/resources/test-applications/daytrader8/src/main/webapp/WEB-INF/classes/build.properties deleted file mode 100644 index 65f995b4..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/webapp/WEB-INF/classes/build.properties +++ /dev/null @@ -1,16 +0,0 @@ -## Licensed to the Apache Software Foundation (ASF) under one or more -## contributor license agreements. See the NOTICE file distributed with -## this work for additional information regarding copyright ownership. -## The ASF licenses this file to You under the Apache License, Version 2.0 -## (the "License"); you may not use this file except in compliance with -## the License. You may obtain a copy of the License at -## -## http://www.apache.org/licenses/LICENSE-2.0 -## -## Unless required by applicable law or agreed to in writing, software -## distributed under the License is distributed on an "AS IS" BASIS, -## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -## See the License for the specific language governing permissions and -## limitations under the License. - -ejb_version=${pom.version} diff --git a/src/test/resources/test-applications/daytrader8/src/main/webapp/WEB-INF/classes/persistence.xml b/src/test/resources/test-applications/daytrader8/src/main/webapp/WEB-INF/classes/persistence.xml deleted file mode 100644 index 4400b9fb..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/webapp/WEB-INF/classes/persistence.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - jdbc/TradeDataSource - - com.ibm.websphere.samples.daytrader.entities.AccountDataBean - com.ibm.websphere.samples.daytrader.entities.AccountProfileDataBean - com.ibm.websphere.samples.daytrader.entities.HoldingDataBean - com.ibm.websphere.samples.daytrader.entities.OrderDataBean - com.ibm.websphere.samples.daytrader.entities.QuoteDataBean - true - NONE - - diff --git a/src/test/resources/test-applications/daytrader8/src/main/webapp/WEB-INF/ejb-jar.xml b/src/test/resources/test-applications/daytrader8/src/main/webapp/WEB-INF/ejb-jar.xml deleted file mode 100644 index 04cc73bf..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/webapp/WEB-INF/ejb-jar.xml +++ /dev/null @@ -1,446 +0,0 @@ - - - DayTrader Enterprise Bean Definitions - - - diff --git a/src/test/resources/test-applications/daytrader8/src/main/webapp/WEB-INF/faces-config.xml b/src/test/resources/test-applications/daytrader8/src/main/webapp/WEB-INF/faces-config.xml deleted file mode 100644 index f3c699ea..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/webapp/WEB-INF/faces-config.xml +++ /dev/null @@ -1,120 +0,0 @@ - - - - - /welcome.xhtml - - Ready to Trade - /tradehome.xhtml - - - welcome - /welcome.xhtml - - - - /register.xhtml - - Registration operation succeeded - /tradehome.xhtml - - - Registration operation failed - /register.xhtml - - - - /tradehome.xhtml - - quotes - /quote.xhtml - - - Registration operation failed - /register.xhtml - - - - /account.xhtml - - quotes - /quote.xhtml - - - Go to account - /account.xhtml - - - welcome - /welcome.xhtml - - - - /portfolio.xhtml - - quotes - /quote.xhtml - - - sell - /order.xhtml - - - - /marketSummary.xhtml - - quotes - /quote.xhtml - - - - /configure.xhtml - - welcome - /welcome.xhtml - - - config - /config.xhtml - - - database - /configure.xhtml - - - stats - /configure.xhtml - - - - /order.xhtml - - quotes - /quote.xhtml - - - - /quote.xhtml - - buy - /order.xhtml - - - diff --git a/src/test/resources/test-applications/daytrader8/src/main/webapp/WEB-INF/ibm-web-bnd.xml b/src/test/resources/test-applications/daytrader8/src/main/webapp/WEB-INF/ibm-web-bnd.xml deleted file mode 100644 index 255c8fa6..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/webapp/WEB-INF/ibm-web-bnd.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - - - diff --git a/src/test/resources/test-applications/daytrader8/src/main/webapp/WEB-INF/ibm-web-ext.xml b/src/test/resources/test-applications/daytrader8/src/main/webapp/WEB-INF/ibm-web-ext.xml deleted file mode 100644 index 93291de1..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/webapp/WEB-INF/ibm-web-ext.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - diff --git a/src/test/resources/test-applications/daytrader8/src/main/webapp/WEB-INF/web.xml b/src/test/resources/test-applications/daytrader8/src/main/webapp/WEB-INF/web.xml deleted file mode 100644 index ea357968..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/webapp/WEB-INF/web.xml +++ /dev/null @@ -1,215 +0,0 @@ - - - - DayTrader Web - - javax.faces.PROJECT_STAGE - Production - - - javax.faces.STATE_SAVING_METHOD - server - - - javax.faces.DEFAULT_SUFFIX - .xhtml - - - - Faces Servlet - javax.faces.webapp.FacesServlet - 0 - true - false - - - - Faces Servlet - *.faces - - - - 30 - - - - index.html - index.jsp - index.faces - - - - java.lang.Exception - /error.jsp - - - - 500 - /error.jsp - - - - diff --git a/src/test/resources/test-applications/daytrader8/src/main/webapp/account.jsp b/src/test/resources/test-applications/daytrader8/src/main/webapp/account.jsp deleted file mode 100644 index ebf882a4..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/webapp/account.jsp +++ /dev/null @@ -1,392 +0,0 @@ - - - - - -DayTrader Account Information - - - - - <%@ page - import="java.util.Collection, - java.util.Iterator, - java.math.BigDecimal,com.ibm.websphere.samples.daytrader.entities.OrderDataBean,com.ibm.websphere.samples.daytrader.util.FinancialUtils" - session="true" isThreadSafe="true" isErrorPage="false"%> - - - - - - - - - - - - - - - - - - - - - - - <% - boolean showAllOrders = request.getParameter("showAllOrders") == null ? false : true; - Collection closedOrders = (Collection) request.getAttribute("closedOrders"); - if ((closedOrders != null) && (closedOrders.size() > 0)) { - %> - - - - - - - <% - } - %> - -
    DayTrader AccountDayTrader
    HomeAccountMarket SummaryPortfolioQuotes/TradeLogoff
    -
    <%=new java.util.Date()%> -
    - Alert: The - following Order(s) have completed. -
    - - - <% - Iterator it = closedOrders.iterator(); - while (it.hasNext()) { - OrderDataBean closedOrderData = (OrderDataBean) it.next(); - %> - - - - - - - - - - - - - - - - - - - - - <% - } - %> - - -
    order - IDorder - statuscreation - datecompletion - datetxn - feetypesymbolquantity
    <%=closedOrderData.getOrderID()%><%=closedOrderData.getOrderStatus()%><%=closedOrderData.getOpenDate()%><%=closedOrderData.getCompletionDate()%><%=closedOrderData.getOrderFee()%><%=closedOrderData.getOrderType()%><%=FinancialUtils.printQuoteLink(closedOrderData.getSymbol())%><%=closedOrderData.getQuantity()%>
    -
    - - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    <%=results%>
    Account - Information
    account - created:<%=accountData.getCreationDate()%>last - login: <%=accountData.getLastLogin()%>
    account - ID<%=accountData.getAccountID()%>total - logins: <%=accountData.getLoginCount()%>cash - balance: <%=accountData.getBalance()%>
    user - ID:<%=accountData.getProfileID()%>total - logouts: <%=accountData.getLogoutCount()%>opening - balance: <%=accountData.getOpenBalance()%>
    - - - - - - - - - - - - - - -
    Total - Orders: <%=orderDataBeans.size()%>show - all orders
    - - - - - - - - - - - - - - - - <% - Iterator it = orderDataBeans.iterator(); - int count = 0; - while (it.hasNext()) { - if ((showAllOrders == false) && (count++ >= 5)) - break; - OrderDataBean orderData = (OrderDataBean) it.next(); - %> - - - - - - - - - - - - - <% - } - %> - -
    - Recent Orders -
    order - IDorder - Statuscreation - datecompletion - datetxn - feetypesymbolquantitypricetotal
    <%=orderData.getOrderID()%><%=orderData.getOrderStatus()%><%=orderData.getOpenDate()%><%=orderData.getCompletionDate()%><%=orderData.getOrderFee()%><%=orderData.getOrderType()%><%=FinancialUtils.printQuoteLink(orderData.getSymbol())%><%=orderData.getQuantity()%><%=orderData.getPrice()%><%=orderData.getPrice().multiply(new BigDecimal(orderData.getQuantity()))%>
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Account - Profile
    user - ID:full - name:
    password: - address: -
    confirm - password:
    credit - card:
    email - address:
    -
    -
    - - - - - - - - - - - - - -
    -
    -
    - - - - - - - -
    Note: Click any symbol - for a quote or to trade. - -
    - - -
    -
    -
    DayTrader - AccountDayTrader
    - - diff --git a/src/test/resources/test-applications/daytrader8/src/main/webapp/account.xhtml b/src/test/resources/test-applications/daytrader8/src/main/webapp/account.xhtml deleted file mode 100644 index 30d87d69..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/webapp/account.xhtml +++ /dev/null @@ -1,430 +0,0 @@ - - - - - - DayTrader Account - - - - - -
    - - - -
    - -
    - - - - - - - - - - - -
    - - Alert: The following Order(s) have completed. - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -

    Account Information

    -
    - account created: - - - - last login: - - -
    - account ID: - - - - total logins: - - - - cash balance: - - -
    - user ID: - - - - total logouts: - - - - opening balance: - - -
    - - - - - - - - - - - - - - -
    -

    Total Orders: ${accountdata.numberOfOrders}

    -
    - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -

    Account Profile

    -
    - user ID: - - - - full name: - - -
    - password: - - - - - - address: - - -
    - confirm password: -
    -
    - - - credit card: - - - - -
    - email address: - - - - -
    -
    - - - - - - - - - -
    -
    -
    - - - - - - - -
    - - - - -
    -
    -
    -
    -
    -
    - - -
    - \ No newline at end of file diff --git a/src/test/resources/test-applications/daytrader8/src/main/webapp/accountImg.jsp b/src/test/resources/test-applications/daytrader8/src/main/webapp/accountImg.jsp deleted file mode 100644 index b6c6a9d1..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/webapp/accountImg.jsp +++ /dev/null @@ -1,409 +0,0 @@ - - - - - -DayTrader Account Information - - - - - <%@ page - import="java.util.Collection, - java.util.Iterator, - java.math.BigDecimal,com.ibm.websphere.samples.daytrader.entities.OrderDataBean,com.ibm.websphere.samples.daytrader.util.FinancialUtils" - session="true" isThreadSafe="true" isErrorPage="false"%> - - - - - - - - - - - - - - - - - - - - - - <% - boolean showAllOrders = request.getParameter("showAllOrders") == null ? false : true; - Collection closedOrders = (Collection) request.getAttribute("closedOrders"); - if ((closedOrders != null) && (closedOrders.size() > 0)) { - %> - - - - - - - <% - } - %> - -
    DayTrader AccountDayTrader

    <%=new java.util.Date()%>
    - Alert: The - following Order(s) have completed. -
    - - - <% - Iterator it = closedOrders.iterator(); - while (it.hasNext()) { - OrderDataBean closedOrderData = (OrderDataBean) it.next(); - %> - - - - - - - - - - - - - - - - - - - - - <% - } - %> - - -
    order - IDorder - statuscreation - datecompletion - datetxn - feetypesymbolquantity
    <%=closedOrderData.getOrderID()%><%=closedOrderData.getOrderStatus()%><%=closedOrderData.getOpenDate()%><%=closedOrderData.getCompletionDate()%><%=closedOrderData.getOrderFee()%><%=closedOrderData.getOrderType()%><%=FinancialUtils.printQuoteLink(closedOrderData.getSymbol())%><%=closedOrderData.getQuantity()%>
    -
    - - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    <%=results%>
    Account - Information
    account - created:<%=accountData.getCreationDate()%>last - login: <%=accountData.getLastLogin()%>
    account - ID<%=accountData.getAccountID()%>total - logins: <%=accountData.getLoginCount()%>cash - balance: <%=accountData.getBalance()%>
    user - ID:<%=accountData.getProfileID()%>total - logouts: <%=accountData.getLogoutCount()%>opening - balance: <%=accountData.getOpenBalance()%>
    - - - - - - - - - - - - - - -
    Total - Orders: <%=orderDataBeans.size()%>show - all orders
    - - - - - - - - - - - - - - - - <% - Iterator it = orderDataBeans.iterator(); - int count = 0; - while (it.hasNext()) { - if ((showAllOrders == false) && (count++ >= 5)) - break; - OrderDataBean orderData = (OrderDataBean) it.next(); - %> - - - - - - - - - - - - - <% - } - %> - -
    - Recent Orders -
    order - IDorder - Statuscreation - datecompletion - datetxn - feetypesymbolquantitypricetotal
    <%=orderData.getOrderID()%><%=orderData.getOrderStatus()%><%=orderData.getOpenDate()%><%=orderData.getCompletionDate()%><%=orderData.getOrderFee()%><%=orderData.getOrderType()%><%=FinancialUtils.printQuoteLink(orderData.getSymbol())%><%=orderData.getQuantity()%><%=orderData.getPrice()%><%=orderData.getPrice().multiply(new BigDecimal(orderData.getQuantity()))%>
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Account - Profile
    user - ID:full - name:
    password: - address: -
    confirm - password:
    credit - card:
    email - address:
    -
    -
    - - - - - - - - - - - - - - - - -
    -
    -
    - - - - - - - -
    Note: Click any symbol - for a quote or to trade. - -
    - - -
    -
    -
    DayTrader - AccountDayTrader
    - - diff --git a/src/test/resources/test-applications/daytrader8/src/main/webapp/config.jsp b/src/test/resources/test-applications/daytrader8/src/main/webapp/config.jsp deleted file mode 100644 index 119712d8..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/webapp/config.jsp +++ /dev/null @@ -1,251 +0,0 @@ - - - - - - -Welcome to DayTrader - - - <%@ page - import="com.ibm.websphere.samples.daytrader.util.TradeConfig" - session="false" isThreadSafe="true" isErrorPage="false"%> - - - - - - - - - - - - - -
    DayTrader - ConfigurationDayTrader
    -
    -
    - - <% - String status; - status = (String) request.getAttribute("status"); - if (status != null) { - %> - - - - - - - - -
    <% - out.print(status); - %> -
    - <% - } - %> - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    The current DayTrader runtime - configuration is detailed below. View and - optionally update run-time parameters.  
    -
    NOTE: Parameters settings will - return to default on server restart. To - make configuration settings persistent across - application server stop/starts, edit the daytrader.props - file inside daytrader-ee7-web.war (which is inside the - daytrader ear file).
    -
    -
    Run-Time Mode -

    - <% - String configParm = "RunTimeMode"; - String names[] = TradeConfig.getRunTimeModeNames(); - int index = TradeConfig.getRunTimeMode(); - for (int i = 0; i < names.length; i++) { - out.print(" " + names[i] + "
    "); - } - %> -


    Run Time Mode determines server - implementation of the TradeServices to use in - the DayTrader application Enterprise Java Beans - including Session, Entity and Message beans or - Direct mode which uses direct database and JMS - access. See DayTrader - FAQ for details.
    Order-Processing Mode -

    - <% - configParm = "OrderProcessingMode"; - names = TradeConfig.getOrderProcessingModeNames(); - index = TradeConfig.getOrderProcessingMode(); - for (int i = 0; i < names.length; i++) { - out.print(" " + names[i] + "
    "); - } - %> -


    Order Processing Mode determines - the mode for completing stock purchase and sell - operations. Synchronous mode completes the order - immediately. Asychronous_2-Phase performs a - 2-phase commit over the EJB Entity/DB and - MDB/JMS transactions. See DayTrader FAQ for - details.
    WebInterface -

    - <% - configParm = "WebInterface"; - names = TradeConfig.getWebInterfaceNames(); - index = TradeConfig.getWebInterface(); - for (int i = 0; i < names.length; i++) { - out.print(" " + names[i] + "
    "); - } - %> -

    This setting determines the Web interface - technology used, JSPs or JSPs with static images - and GIFs.
    Miscellaneous - Settings
    DayTrader Max Users
    -
    - Trade Max Quotes
    By default the DayTrader database is - populated with 15,000 users (uid:0 - uid:199) - and 10,000 quotes (s:0 - s:399).
    -
    Market Summary Interval
    -
    < 0 Do not perform Market Summary - Operations.
    = 0 Perform market Summary - on every request.

    > 0 number of - seconds between Market Summary Operations
    -
    Primitive Iteration
    -
    By default the DayTrader primitives are - execute one operation per web request. Change - this value to repeat operations multiple times - per web request.
    - name="EnablePublishQuotePriceChange"> Publish Quote Updates
    Publish quote price changes to a JMS topic.
    -
    Percent of Quote Price Changes to List
    -
    The percent of recent trades to display on the Market Summary websocket.
    - name="DisplayOrderAlerts"> Display Order Alerts
    Display completed order alerts.
    -
    - name="EnableLongRun"> Enable long run support
    Enable long run support by disabling the - show all orders query performed on the Account - page.
    -
    -
    - - - - - - - - - - - - - - -
    -
    -
    DayTrader - ConfigurationDayTrader
    -
    - - diff --git a/src/test/resources/test-applications/daytrader8/src/main/webapp/config.xhtml b/src/test/resources/test-applications/daytrader8/src/main/webapp/config.xhtml deleted file mode 100644 index c0b3d78c..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/webapp/config.xhtml +++ /dev/null @@ -1,232 +0,0 @@ - - - - - DayTrader Config - - - - -
    - - -
    -
    - - - - - - - - - -
    - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -

    The current DayTrader runtime configuration is detailed below. View and optionally update run-time parameters.  

    -
    -
    - NOTE: - Parameters settings will return to default on server restart. To - make configuration settings persistent across - application server stop/starts, edit the daytrader.props - file inside daytrader-ee7-web.war (which is inside the - daytrader ear file). -
    -
    - Run-Time Mode -

    - - - -

    -
    -
    - Run Time Mode determines server implementation of the TradeServices to use in the DayTrader application Enterprise Java Beans including - Session, Entity and Message beans or Direct mode which uses direct database and JMS access. See - DayTrader FAQ - for details. -
    -
    - Order-Processing Mode -

    - - - -

    -
    -
    - Order Processing Mode determines the mode for completing stock purchase and sell operations. Synchronous mode completes the order - immediately. Asychronous_2-Phase performs a 2-phase commit over the EJB Entity/DB and MDB/JMS transactions. See - DayTrader FAQ - for details. - -
    -
    - WebInterface -

    - - - -

    -
    This setting determines the Web interface technology used, JSPs or JSPs with static images and GIFs.
    - Miscellaneous Settings -
    - DayTrader Max Users -
    - -
    - Trade Max Quotes -
    - -
    - By default the DayTrader database is populated with 15000 users (uid:0 - uid:14999) and 10000 quotes (s:0 - s:9999). -
    -
    - Market Summary Interval -
    - -
    - < 0 Do not perform Market Summary Operations. -
    - = 0 Perform market Summary on every request. -
    - > 0 number of seconds between Market Summary Operations -
    -
    - Primitive Iteration -
    - -
    By default the DayTrader primitives are execute one operation per web request. Change this value to repeat - operations multiple times per web request.
    - - Publish Quote Updates -
    -
    - Publish quote price changes to a JMS topic. -
    -
    - Percent of Quote Price Changes to List -
    - -
    The percent of recent trades to display on the Market Summary websocket.
    - - Display Order Alerts -
    -
    - Display completed order alerts -
    -
    - - Enable long run support -
    -
    - Enable long run support by disabling the show all orders query performed on the Account page. -
    -
    - -
    -
    -
    -
    -
    - -
    - \ No newline at end of file diff --git a/src/test/resources/test-applications/daytrader8/src/main/webapp/configure.html b/src/test/resources/test-applications/daytrader8/src/main/webapp/configure.html deleted file mode 100644 index a5669233..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/webapp/configure.html +++ /dev/null @@ -1,115 +0,0 @@ - - - - - - -Configuration and utilities - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -

    Configuration Utilities

    -
    Benchmark - Configuration
    Tools -
    Description -
    Reset - DayTrader
    (to be done before each - run) -
    Reset the DayTrader runtime to a clean starting - point by logging off all users, removing new - registrations and other general cleanup. For - consistent results this URL should be run before - each Trade run. -
    Configure - DayTrader run-time parametersThis link provides an interface to set - configuration parameters that control DayTrader - run-time characteristics such as using EJBs or JDBC. - This link also provides utilities such as setting - the UID and Password for a remote or protected - database when using JDBC.
    (Re)-create -  DayTrader Database Tables and - IndexesThis link is used to (a) initially create or - (b) drop and re-create the DayTrader tables. A - DayTrader database should exist before doing - this action, the existing DayTrader tables, if - any, are dropped, then new tables and indexes are - created. Please stop and re-start the - Daytrader application (or your application - server) after this action and then use the - "Repopulate DayTrader Database" link below to - repopulate the new database tables. -
    (Re)-populate -  DayTrader DatabaseThis link is used to initially populate or - re-populate the DayTrader database with fictitious - users (uid:0, uid:1, ...) and stocks (s:0, s:1, - ...). First all existing users and stocks are - deleted (if any). The database is then populated - with a new set of DayTrader users and stocks. This - option does not drop and recreate the Daytrader db - tables.
    Test - DayTrader ScenarioThis links pops up a browser to manually step - through a DayTrader scenario by hitting - "Reload" on your browser
    DayTrader - VersionDayTrader application version and change - history information
    - - - diff --git a/src/test/resources/test-applications/daytrader8/src/main/webapp/configure.xhtml b/src/test/resources/test-applications/daytrader8/src/main/webapp/configure.xhtml deleted file mode 100644 index 9e334bd1..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/webapp/configure.xhtml +++ /dev/null @@ -1,148 +0,0 @@ - - - - - DayTrader Configure - - - - - -
    - - - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -

    Configuration Utilities

    -
    - - Benchmark Configuration Tools - - - - - Description - -
    - - - Reset DayTrader -
    - (to be done before each run) -
    -
    -
    - Reset the DayTrader runtime to a clean starting point by logging off all users, removing new registrations and other general cleanup. For - consistent results this URL should be run - before each - Trade run. -
    - - Configure DayTrader run-time parameters - - This link provides an interface to set configuration parameters that control DayTrader run-time characteristics - such as using EJBs or JDBC. This link also provides utilities such as setting the UID and Password for a remote or protected database when - using JDBC.
    - - (Re)-create  DayTrader Database Tables and Indexes - - - This link is used to (a) initially create or (b) drop and re-create the DayTrader tables. - A DayTrader database should exist before doing this action - , the existing DayTrader tables, if any, are dropped, then new tables and indexes are created. - Please stop and re-start the Daytrader application (or your application server) after this action and then use the "Repopulate - DayTrader Database" link below to repopulate the new database tables. -
    - - (Re)-populate  DayTrader Database - - This link is used to initially populate or re-populate the DayTrader database with fictitious users (uid:0, - uid:1, ...) and stocks (s:0, s:1, ...). First all existing users and stocks are deleted (if any). The database is then populated with a new - set of DayTrader users and stocks. This option does not drop and recreate the Daytrader db tables.
    - DayTrader Version - DayTrader application version and change history information
    -
    -
    -
    -
    - - -
    - \ No newline at end of file diff --git a/src/test/resources/test-applications/daytrader8/src/main/webapp/contentHome.html b/src/test/resources/test-applications/daytrader8/src/main/webapp/contentHome.html deleted file mode 100644 index a30929c9..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/webapp/contentHome.html +++ /dev/null @@ -1,87 +0,0 @@ - - - - - -Daytrader performance benchmark sample overview - - - - - - - - - - - - - - -
    -
    -
    -

    - Overview -

    -
    - The - Daytrader performance benchmark sample provides a suite of workloads for characterizing performance of - Java EE Application Servers. The workloads - consist of an end to end web application and a full set of primitives. The applications are a - collection of Java classes, Java Servlets, JavaServer Pages, and Enterprise Java - Beans built to open Java EE APIs. Together these provide versatile and portable test cases - designed to measure aspects of scalability and performance. - -
    -

    - -
    DayTrader J2EE Components
    - Model-View-Controller Architecture -

    -
    - DayTrader
    - DayTrader is an end-to-end benchmark - and performance sample application. It provides a - real world Java EE workload.

    DayTrader's new - design spans Java EE 7, including the new WebSockets specification. Other Java EE features include JSPs, Servlets, EJBs, JPA, JDBC, JSF, JMS, MDBs, and - transactions (synchronous and asynchronous/2-phase commit).

    Primitives
    -
    The Primitives provide a - set of workloads to individually test various - components of an Application Server. - The primitives leverage the DayTrader - application infrastructure to test specific - Java EE components such as the servlet - engine, JSP support, EJB Entitiy, Session and - Message Driven beans, HTTP Session support and - more. - -
    -
    - Additional - overview information is included in the FAQ - -
    -
    -
    -
    - - - diff --git a/src/test/resources/test-applications/daytrader8/src/main/webapp/dbscripts/db2/Table.ddl b/src/test/resources/test-applications/daytrader8/src/main/webapp/dbscripts/db2/Table.ddl deleted file mode 100644 index 124e43a2..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/webapp/dbscripts/db2/Table.ddl +++ /dev/null @@ -1,289 +0,0 @@ -## (C) Copyright IBM Corporation 2015. -## -## Licensed under the Apache License, Version 2.0 (the "License"); -## you may not use this file except in compliance with the License. -## You may obtain a copy of the License at -## -## http://www.apache.org/licenses/LICENSE-2.0 -## -## Unless required by applicable law or agreed to in writing, software -## distributed under the License is distributed on an "AS IS" BASIS, -## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -## See the License for the specific language governing permissions and -## limitations under the License. - -DROP TABLE HOLDINGEJB; -DROP TABLE ACCOUNTPROFILEEJB; -DROP TABLE QUOTEEJB; -DROP TABLE KEYGENEJB; -DROP TABLE ACCOUNTEJB; -DROP TABLE ORDEREJB; - -DROP TABLESPACE "HOLDING_TS"; -DROP TABLESPACE "ACCOUNTP_TS"; -DROP TABLESPACE "QUOTE_TS"; - -DROP TABLESPACE "ACCOUNT_ITS1"; -DROP TABLESPACE "ACCOUNT_ITS2"; -DROP TABLESPACE "ACCOUNT_ITS3"; -DROP TABLESPACE "ACCOUNT_ITS4"; -DROP TABLESPACE "ACCOUNT_ITS5"; -DROP TABLESPACE "ACCOUNT_ITS6"; -DROP TABLESPACE "ACCOUNT_ITS7"; - -DROP TABLESPACE "QUOTE_ITS1"; -DROP TABLESPACE "QUOTE_ITS2"; -DROP TABLESPACE "QUOTE_ITS3"; -DROP TABLESPACE "QUOTE_ITS4"; -DROP TABLESPACE "QUOTE_ITS5"; -DROP TABLESPACE "QUOTE_ITS6"; -DROP TABLESPACE "QUOTE_ITS7"; -DROP TABLESPACE "QUOTE_ITS8"; -DROP TABLESPACE "QUOTE_ITS9"; -DROP TABLESPACE "QUOTE_ITS10"; -DROP TABLESPACE "QUOTE_ITS11"; -DROP TABLESPACE "QUOTE_ITS12"; -DROP TABLESPACE "QUOTE_ITS13"; -DROP TABLESPACE "QUOTE_ITS14"; -DROP TABLESPACE "QUOTE_ITS15"; -DROP TABLESPACE "QUOTE_ITS16"; -DROP TABLESPACE "QUOTE_ITS17"; -DROP TABLESPACE "QUOTE_ITS18"; -DROP TABLESPACE "QUOTE_ITS19"; -DROP TABLESPACE "QUOTE_ITS20"; - -DROP TABLESPACE "KEYGENE_TS"; -DROP TABLESPACE "ACCOUNTE_TS"; -DROP TABLESPACE "ORDER_TS"; - -DROP BUFFERPOOL "HOLDING_BP"; -CREATE BUFFERPOOL "HOLDING_BP" SIZE AUTOMATIC PAGESIZE 4096; -DROP BUFFERPOOL "ACCOUNTP_BP"; -CREATE BUFFERPOOL "ACCOUNTP_BP" SIZE AUTOMATIC PAGESIZE 4096; -DROP BUFFERPOOL "QUOTE_BP"; -CREATE BUFFERPOOL "QUOTE_BP" SIZE AUTOMATIC PAGESIZE 4096; - - -DROP BUFFERPOOL "ACCOUNT_IBP1"; -CREATE BUFFERPOOL "ACCOUNT_IBP1" SIZE AUTOMATIC PAGESIZE 4096; -DROP BUFFERPOOL "ACCOUNT_IBP2"; -CREATE BUFFERPOOL "ACCOUNT_IBP2" SIZE AUTOMATIC PAGESIZE 4096; -DROP BUFFERPOOL "ACCOUNT_IBP3"; -CREATE BUFFERPOOL "ACCOUNT_IBP3" SIZE AUTOMATIC PAGESIZE 4096; -DROP BUFFERPOOL "ACCOUNT_IBP4"; -CREATE BUFFERPOOL "ACCOUNT_IBP4" SIZE AUTOMATIC PAGESIZE 4096; -DROP BUFFERPOOL "ACCOUNT_IBP5"; -CREATE BUFFERPOOL "ACCOUNT_IBP5" SIZE AUTOMATIC PAGESIZE 4096; -DROP BUFFERPOOL "ACCOUNT_IBP6"; -CREATE BUFFERPOOL "ACCOUNT_IBP6" SIZE AUTOMATIC PAGESIZE 4096; -DROP BUFFERPOOL "ACCOUNT_IBP7"; -CREATE BUFFERPOOL "ACCOUNT_IBP7" SIZE AUTOMATIC PAGESIZE 4096; - -DROP BUFFERPOOL "QUOTE_IBP1"; -CREATE BUFFERPOOL "QUOTE_IBP1" SIZE AUTOMATIC PAGESIZE 4096; -DROP BUFFERPOOL "QUOTE_IBP2"; -CREATE BUFFERPOOL "QUOTE_IBP2" SIZE AUTOMATIC PAGESIZE 4096; -DROP BUFFERPOOL "QUOTE_IBP3"; -CREATE BUFFERPOOL "QUOTE_IBP3" SIZE AUTOMATIC PAGESIZE 4096; -DROP BUFFERPOOL "QUOTE_IBP4"; -CREATE BUFFERPOOL "QUOTE_IBP4" SIZE AUTOMATIC PAGESIZE 4096; -DROP BUFFERPOOL "QUOTE_IBP5"; -CREATE BUFFERPOOL "QUOTE_IBP5" SIZE AUTOMATIC PAGESIZE 4096; -DROP BUFFERPOOL "QUOTE_IBP6"; -CREATE BUFFERPOOL "QUOTE_IBP6" SIZE AUTOMATIC PAGESIZE 4096; -DROP BUFFERPOOL "QUOTE_IBP7"; -CREATE BUFFERPOOL "QUOTE_IBP7" SIZE AUTOMATIC PAGESIZE 4096; -DROP BUFFERPOOL "QUOTE_IBP8"; -CREATE BUFFERPOOL "QUOTE_IBP8" SIZE AUTOMATIC PAGESIZE 4096; -DROP BUFFERPOOL "QUOTE_IBP9"; -CREATE BUFFERPOOL "QUOTE_IBP9" SIZE AUTOMATIC PAGESIZE 4096; -DROP BUFFERPOOL "QUOTE_IBP10"; -CREATE BUFFERPOOL "QUOTE_IBP10" SIZE AUTOMATIC PAGESIZE 4096; -DROP BUFFERPOOL "QUOTE_IBP11"; -CREATE BUFFERPOOL "QUOTE_IBP11" SIZE AUTOMATIC PAGESIZE 4096; -DROP BUFFERPOOL "QUOTE_IBP12"; -CREATE BUFFERPOOL "QUOTE_IBP12" SIZE AUTOMATIC PAGESIZE 4096; -DROP BUFFERPOOL "QUOTE_IBP13"; -CREATE BUFFERPOOL "QUOTE_IBP13" SIZE AUTOMATIC PAGESIZE 4096; -DROP BUFFERPOOL "QUOTE_IBP14"; -CREATE BUFFERPOOL "QUOTE_IBP14" SIZE AUTOMATIC PAGESIZE 4096; -DROP BUFFERPOOL "QUOTE_IBP15"; -CREATE BUFFERPOOL "QUOTE_IBP15" SIZE AUTOMATIC PAGESIZE 4096; -DROP BUFFERPOOL "QUOTE_IBP16"; -CREATE BUFFERPOOL "QUOTE_IBP16" SIZE AUTOMATIC PAGESIZE 4096; -DROP BUFFERPOOL "QUOTE_IBP17"; -CREATE BUFFERPOOL "QUOTE_IBP17" SIZE AUTOMATIC PAGESIZE 4096; -DROP BUFFERPOOL "QUOTE_IBP18"; -CREATE BUFFERPOOL "QUOTE_IBP18" SIZE AUTOMATIC PAGESIZE 4096; -DROP BUFFERPOOL "QUOTE_IBP19"; -CREATE BUFFERPOOL "QUOTE_IBP19" SIZE AUTOMATIC PAGESIZE 4096; -DROP BUFFERPOOL "QUOTE_IBP20"; -CREATE BUFFERPOOL "QUOTE_IBP20" SIZE AUTOMATIC PAGESIZE 4096; - - - -DROP BUFFERPOOL "KEYGENE_BP"; -CREATE BUFFERPOOL "KEYGENE_BP" SIZE AUTOMATIC PAGESIZE 4096; -DROP BUFFERPOOL "ACCOUNTE_BP"; -CREATE BUFFERPOOL "ACCOUNTE_BP" SIZE AUTOMATIC PAGESIZE 4096; -DROP BUFFERPOOL "ORDER_BP"; -CREATE BUFFERPOOL "ORDER_BP" SIZE AUTOMATIC PAGESIZE 4096; - -CREATE LARGE TABLESPACE "HOLDING_TS" PAGESIZE 4096 MANAGED BY AUTOMATIC STORAGE BUFFERPOOL "HOLDING_BP" AUTORESIZE YES NO FILE SYSTEM CACHING; -CREATE LARGE TABLESPACE "ACCOUNTP_TS" PAGESIZE 4096 MANAGED BY AUTOMATIC STORAGE BUFFERPOOL "ACCOUNTP_BP" AUTORESIZE YES NO FILE SYSTEM CACHING; -CREATE LARGE TABLESPACE "QUOTE_TS" PAGESIZE 4096 MANAGED BY AUTOMATIC STORAGE BUFFERPOOL "QUOTE_BP" AUTORESIZE YES NO FILE SYSTEM CACHING; - -CREATE LARGE TABLESPACE "QUOTE_ITS1" PAGESIZE 4096 MANAGED BY AUTOMATIC STORAGE BUFFERPOOL "QUOTE_IBP1" AUTORESIZE YES NO FILE SYSTEM CACHING; -CREATE LARGE TABLESPACE "QUOTE_ITS2" PAGESIZE 4096 MANAGED BY AUTOMATIC STORAGE BUFFERPOOL "QUOTE_IBP2" AUTORESIZE YES NO FILE SYSTEM CACHING; -CREATE LARGE TABLESPACE "QUOTE_ITS3" PAGESIZE 4096 MANAGED BY AUTOMATIC STORAGE BUFFERPOOL "QUOTE_IBP3" AUTORESIZE YES NO FILE SYSTEM CACHING; -CREATE LARGE TABLESPACE "QUOTE_ITS4" PAGESIZE 4096 MANAGED BY AUTOMATIC STORAGE BUFFERPOOL "QUOTE_IBP4" AUTORESIZE YES NO FILE SYSTEM CACHING; -CREATE LARGE TABLESPACE "QUOTE_ITS5" PAGESIZE 4096 MANAGED BY AUTOMATIC STORAGE BUFFERPOOL "QUOTE_IBP5" AUTORESIZE YES NO FILE SYSTEM CACHING; -CREATE LARGE TABLESPACE "QUOTE_ITS6" PAGESIZE 4096 MANAGED BY AUTOMATIC STORAGE BUFFERPOOL "QUOTE_IBP6" AUTORESIZE YES NO FILE SYSTEM CACHING; -CREATE LARGE TABLESPACE "QUOTE_ITS7" PAGESIZE 4096 MANAGED BY AUTOMATIC STORAGE BUFFERPOOL "QUOTE_IBP7" AUTORESIZE YES NO FILE SYSTEM CACHING; -CREATE LARGE TABLESPACE "QUOTE_ITS8" PAGESIZE 4096 MANAGED BY AUTOMATIC STORAGE BUFFERPOOL "QUOTE_IBP8" AUTORESIZE YES NO FILE SYSTEM CACHING; -CREATE LARGE TABLESPACE "QUOTE_ITS9" PAGESIZE 4096 MANAGED BY AUTOMATIC STORAGE BUFFERPOOL "QUOTE_IBP9" AUTORESIZE YES NO FILE SYSTEM CACHING; -CREATE LARGE TABLESPACE "QUOTE_ITS10" PAGESIZE 4096 MANAGED BY AUTOMATIC STORAGE BUFFERPOOL "QUOTE_IBP10" AUTORESIZE YES NO FILE SYSTEM CACHING; -CREATE LARGE TABLESPACE "QUOTE_ITS11" PAGESIZE 4096 MANAGED BY AUTOMATIC STORAGE BUFFERPOOL "QUOTE_IBP11" AUTORESIZE YES NO FILE SYSTEM CACHING; -CREATE LARGE TABLESPACE "QUOTE_ITS12" PAGESIZE 4096 MANAGED BY AUTOMATIC STORAGE BUFFERPOOL "QUOTE_IBP12" AUTORESIZE YES NO FILE SYSTEM CACHING; -CREATE LARGE TABLESPACE "QUOTE_ITS13" PAGESIZE 4096 MANAGED BY AUTOMATIC STORAGE BUFFERPOOL "QUOTE_IBP13" AUTORESIZE YES NO FILE SYSTEM CACHING; -CREATE LARGE TABLESPACE "QUOTE_ITS14" PAGESIZE 4096 MANAGED BY AUTOMATIC STORAGE BUFFERPOOL "QUOTE_IBP14" AUTORESIZE YES NO FILE SYSTEM CACHING; -CREATE LARGE TABLESPACE "QUOTE_ITS15" PAGESIZE 4096 MANAGED BY AUTOMATIC STORAGE BUFFERPOOL "QUOTE_IBP15" AUTORESIZE YES NO FILE SYSTEM CACHING; -CREATE LARGE TABLESPACE "QUOTE_ITS16" PAGESIZE 4096 MANAGED BY AUTOMATIC STORAGE BUFFERPOOL "QUOTE_IBP16" AUTORESIZE YES NO FILE SYSTEM CACHING; -CREATE LARGE TABLESPACE "QUOTE_ITS17" PAGESIZE 4096 MANAGED BY AUTOMATIC STORAGE BUFFERPOOL "QUOTE_IBP17" AUTORESIZE YES NO FILE SYSTEM CACHING; -CREATE LARGE TABLESPACE "QUOTE_ITS18" PAGESIZE 4096 MANAGED BY AUTOMATIC STORAGE BUFFERPOOL "QUOTE_IBP18" AUTORESIZE YES NO FILE SYSTEM CACHING; -CREATE LARGE TABLESPACE "QUOTE_ITS19" PAGESIZE 4096 MANAGED BY AUTOMATIC STORAGE BUFFERPOOL "QUOTE_IBP19" AUTORESIZE YES NO FILE SYSTEM CACHING; -CREATE LARGE TABLESPACE "QUOTE_ITS20" PAGESIZE 4096 MANAGED BY AUTOMATIC STORAGE BUFFERPOOL "QUOTE_IBP20" AUTORESIZE YES NO FILE SYSTEM CACHING; - -CREATE LARGE TABLESPACE "ACCOUNT_ITS1" PAGESIZE 4096 MANAGED BY AUTOMATIC STORAGE BUFFERPOOL "ACCOUNT_IBP1" AUTORESIZE YES NO FILE SYSTEM CACHING; -CREATE LARGE TABLESPACE "ACCOUNT_ITS2" PAGESIZE 4096 MANAGED BY AUTOMATIC STORAGE BUFFERPOOL "ACCOUNT_IBP2" AUTORESIZE YES NO FILE SYSTEM CACHING; -CREATE LARGE TABLESPACE "ACCOUNT_ITS3" PAGESIZE 4096 MANAGED BY AUTOMATIC STORAGE BUFFERPOOL "ACCOUNT_IBP3" AUTORESIZE YES NO FILE SYSTEM CACHING; -CREATE LARGE TABLESPACE "ACCOUNT_ITS4" PAGESIZE 4096 MANAGED BY AUTOMATIC STORAGE BUFFERPOOL "ACCOUNT_IBP4" AUTORESIZE YES NO FILE SYSTEM CACHING; -CREATE LARGE TABLESPACE "ACCOUNT_ITS5" PAGESIZE 4096 MANAGED BY AUTOMATIC STORAGE BUFFERPOOL "ACCOUNT_IBP5" AUTORESIZE YES NO FILE SYSTEM CACHING; -CREATE LARGE TABLESPACE "ACCOUNT_ITS6" PAGESIZE 4096 MANAGED BY AUTOMATIC STORAGE BUFFERPOOL "ACCOUNT_IBP6" AUTORESIZE YES NO FILE SYSTEM CACHING; -CREATE LARGE TABLESPACE "ACCOUNT_ITS7" PAGESIZE 4096 MANAGED BY AUTOMATIC STORAGE BUFFERPOOL "ACCOUNT_IBP7" AUTORESIZE YES NO FILE SYSTEM CACHING; - -CREATE LARGE TABLESPACE "KEYGENE_TS" PAGESIZE 4096 MANAGED BY AUTOMATIC STORAGE BUFFERPOOL "KEYGENE_BP" AUTORESIZE YES NO FILE SYSTEM CACHING; -CREATE LARGE TABLESPACE "ACCOUNTE_TS" PAGESIZE 4096 MANAGED BY AUTOMATIC STORAGE BUFFERPOOL "ACCOUNTE_BP" AUTORESIZE YES NO FILE SYSTEM CACHING; -CREATE LARGE TABLESPACE "ORDER_TS" PAGESIZE 4096 MANAGED BY AUTOMATIC STORAGE BUFFERPOOL "ORDER_BP" AUTORESIZE YES NO FILE SYSTEM CACHING; - -CREATE TABLE HOLDINGEJB - (PURCHASEPRICE DECIMAL(14, 2), - HOLDINGID INTEGER NOT NULL, - QUANTITY DOUBLE NOT NULL, - PURCHASEDATE TIMESTAMP, - ACCOUNT_ACCOUNTID INTEGER, - QUOTE_SYMBOL VARCHAR(250)) IN "HOLDING_TS" INDEX IN "HOLDING_TS"; - -ALTER TABLE HOLDINGEJB - ADD CONSTRAINT PK_HOLDINGEJB PRIMARY KEY (HOLDINGID); - -ALTER TABLE HOLDINGEJB APPEND ON; - -CREATE TABLE ACCOUNTPROFILEEJB - (ADDRESS VARCHAR(250), - PASSWD VARCHAR(250), - USERID VARCHAR(250) NOT NULL, - EMAIL VARCHAR(250), - CREDITCARD VARCHAR(250), - FULLNAME VARCHAR(250)) IN "ACCOUNTP_TS" INDEX IN "ACCOUNTP_TS"; - -ALTER TABLE ACCOUNTPROFILEEJB - ADD CONSTRAINT PK_ACCOUNTPROFILE2 PRIMARY KEY (USERID); - -CREATE TABLE QUOTEEJB - (LOW DECIMAL(14, 2), - OPEN1 DECIMAL(14, 2), - VOLUME DOUBLE NOT NULL, - PRICE DECIMAL(14, 2), - HIGH DECIMAL(14, 2), - COMPANYNAME VARCHAR(250), - SYMBOL VARCHAR(250) NOT NULL, - CHANGE1 DOUBLE NOT NULL) IN "QUOTE_TS" INDEX IN "QUOTE_TS" PARTITION BY RANGE("SYMBOL") - (PART "PART0" STARTING('s:0') ENDING('s:1000') IN "QUOTE_TS" INDEX IN "QUOTE_ITS1", - PART "PART10" ENDING('s:10999') IN "QUOTE_TS" INDEX IN "QUOTE_ITS11", - PART "PART11" ENDING('s:11999') IN "QUOTE_TS" INDEX IN "QUOTE_ITS12", - PART "PART12" ENDING('s:12999') IN "QUOTE_TS" INDEX IN "QUOTE_ITS13", - PART "PART13" ENDING('s:13999') IN "QUOTE_TS" INDEX IN "QUOTE_ITS14", - PART "PART14" ENDING('s:14999') IN "QUOTE_TS" INDEX IN "QUOTE_ITS15", - PART "PART15" ENDING('s:15999') IN "QUOTE_TS" INDEX IN "QUOTE_ITS16", - PART "PART16" ENDING('s:16999') IN "QUOTE_TS" INDEX IN "QUOTE_ITS17", - PART "PART17" ENDING('s:17999') IN "QUOTE_TS" INDEX IN "QUOTE_ITS18", - PART "PART18" ENDING('s:18999') IN "QUOTE_TS" INDEX IN "QUOTE_ITS19", - PART "PART1" ENDING('s:1999') IN "QUOTE_TS" INDEX IN "QUOTE_ITS2", - PART "PART19" ENDING('s:20001') IN "QUOTE_TS" INDEX IN "QUOTE_ITS20", - PART "PART2" ENDING('s:2999') IN "QUOTE_TS" INDEX IN "QUOTE_ITS3", - PART "PART3" ENDING('s:3999') IN "QUOTE_TS" INDEX IN "QUOTE_ITS4", - PART "PART4" ENDING('s:4999') IN "QUOTE_TS" INDEX IN "QUOTE_ITS5", - PART "PART5" ENDING('s:5999') IN "QUOTE_TS" INDEX IN "QUOTE_ITS6", - PART "PART6" ENDING('s:6999') IN "QUOTE_TS" INDEX IN "QUOTE_ITS7", - PART "PART7" ENDING('s:7999') IN "QUOTE_TS" INDEX IN "QUOTE_ITS8", - PART "PART8" ENDING('s:8999') IN "QUOTE_TS" INDEX IN "QUOTE_ITS9", - PART "PART9" ENDING('s:9999') IN "QUOTE_TS" INDEX IN "QUOTE_ITS10"); - -CREATE UNIQUE INDEX QUOTE_SYM ON QUOTEEJB(SYMBOL); - -ALTER TABLE QUOTEEJB - ADD CONSTRAINT PK_QUOTEEJB PRIMARY KEY (SYMBOL); - - -CREATE TABLE KEYGENEJB - (KEYVAL INTEGER NOT NULL, - KEYNAME VARCHAR(250) NOT NULL) IN "KEYGENE_TS" INDEX IN "KEYGENE_TS"; - -ALTER TABLE KEYGENEJB - ADD CONSTRAINT PK_KEYGENEJB PRIMARY KEY (KEYNAME); - -INSERT INTO KEYGENEJB (KEYNAME,KEYVAL) VALUES ('account', 0); -INSERT INTO KEYGENEJB (KEYNAME,KEYVAL) VALUES ('holding', 0); -INSERT INTO KEYGENEJB (KEYNAME,KEYVAL) VALUES ('order', 0); - -CREATE TABLE ACCOUNTEJB - (CREATIONDATE TIMESTAMP, - OPENBALANCE DECIMAL(14, 2), - LOGOUTCOUNT INTEGER NOT NULL, - BALANCE DECIMAL(14, 2), - ACCOUNTID INTEGER NOT NULL, - LASTLOGIN TIMESTAMP, - LOGINCOUNT INTEGER NOT NULL, - PROFILE_USERID VARCHAR(250)) IN "ACCOUNTE_TS" INDEX IN "ACCOUNTE_TS" PARTITION BY RANGE("ACCOUNTID") - (PART "PART0" STARTING(0) ENDING(4999) IN "ACCOUNTE_TS" INDEX IN "ACCOUNT_ITS1", - PART "PART1" ENDING(9999) IN "ACCOUNTE_TS" INDEX IN "ACCOUNT_ITS2", - PART "PART2" ENDING(14999) IN "ACCOUNTE_TS" INDEX IN "ACCOUNT_ITS3", - PART "PART3" ENDING(19999) IN "ACCOUNTE_TS" INDEX IN "ACCOUNT_ITS4", - PART "PART4" ENDING(24999) IN "ACCOUNTE_TS" INDEX IN "ACCOUNT_ITS5", - PART "PART5" ENDING(300001) IN "ACCOUNTE_TS" INDEX IN "ACCOUNT_ITS6", - PART "PART6" ENDING(2147483646) IN "ACCOUNTE_TS" INDEX IN "ACCOUNT_ITS6"); - -ALTER TABLE ACCOUNTEJB - ADD CONSTRAINT PK_ACCOUNTEJB PRIMARY KEY (ACCOUNTID); - -CREATE TABLE ORDEREJB - (ORDERFEE DECIMAL(14, 2), - COMPLETIONDATE TIMESTAMP, - ORDERTYPE VARCHAR(250), - ORDERSTATUS VARCHAR(250), - PRICE DECIMAL(14, 2), - QUANTITY DOUBLE NOT NULL, - OPENDATE TIMESTAMP, - ORDERID INTEGER NOT NULL, - ACCOUNT_ACCOUNTID INTEGER, - QUOTE_SYMBOL VARCHAR(250), - HOLDING_HOLDINGID INTEGER) IN "ORDER_TS" INDEX IN "ORDER_TS"; - -ALTER TABLE ORDEREJB - ADD CONSTRAINT PK_ORDEREJB PRIMARY KEY (ORDERID); - -ALTER TABLE ORDEREJB APPEND ON; - -ALTER TABLE HOLDINGEJB VOLATILE; -ALTER TABLE ACCOUNTPROFILEEJB VOLATILE; -ALTER TABLE QUOTEEJB VOLATILE; -ALTER TABLE KEYGENEJB VOLATILE; -ALTER TABLE ACCOUNTEJB VOLATILE; -ALTER TABLE ORDEREJB VOLATILE; - -CREATE INDEX ACCOUNT_USERID ON ACCOUNTEJB(PROFILE_USERID); -CREATE INDEX HOLDING_ACCOUNTID ON HOLDINGEJB(ACCOUNT_ACCOUNTID); -CREATE INDEX ORDER_ACCOUNTID ON ORDEREJB(ACCOUNT_ACCOUNTID); -CREATE INDEX ORDER_HOLDINGID ON ORDEREJB(HOLDING_HOLDINGID); -CREATE INDEX CLOSED_ORDERS ON ORDEREJB(ACCOUNT_ACCOUNTID,ORDERSTATUS); diff --git a/src/test/resources/test-applications/daytrader8/src/main/webapp/dbscripts/derby/Table.ddl b/src/test/resources/test-applications/daytrader8/src/main/webapp/dbscripts/derby/Table.ddl deleted file mode 100644 index 08ac681f..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/webapp/dbscripts/derby/Table.ddl +++ /dev/null @@ -1,104 +0,0 @@ -## (C) Copyright IBM Corporation 2015. -## -## Licensed under the Apache License, Version 2.0 (the "License"); -## you may not use this file except in compliance with the License. -## You may obtain a copy of the License at -## -## http://www.apache.org/licenses/LICENSE-2.0 -## -## Unless required by applicable law or agreed to in writing, software -## distributed under the License is distributed on an "AS IS" BASIS, -## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -## See the License for the specific language governing permissions and -## limitations under the License. - -# Each SQL statement in this file should terminate with a semicolon (;) -# Lines starting with the pound character (#) are considered as comments -DROP TABLE HOLDINGEJB; -DROP TABLE ACCOUNTPROFILEEJB; -DROP TABLE QUOTEEJB; -DROP TABLE KEYGENEJB; -DROP TABLE ACCOUNTEJB; -DROP TABLE ORDEREJB; - -CREATE TABLE HOLDINGEJB - (PURCHASEPRICE DECIMAL(14, 2), - HOLDINGID INTEGER NOT NULL, - QUANTITY DOUBLE NOT NULL, - PURCHASEDATE TIMESTAMP, - ACCOUNT_ACCOUNTID INTEGER, - QUOTE_SYMBOL VARCHAR(250)); - -ALTER TABLE HOLDINGEJB - ADD CONSTRAINT PK_HOLDINGEJB PRIMARY KEY (HOLDINGID); - -CREATE TABLE ACCOUNTPROFILEEJB - (ADDRESS VARCHAR(250), - PASSWD VARCHAR(250), - USERID VARCHAR(250) NOT NULL, - EMAIL VARCHAR(250), - CREDITCARD VARCHAR(250), - FULLNAME VARCHAR(250)); - -ALTER TABLE ACCOUNTPROFILEEJB - ADD CONSTRAINT PK_ACCOUNTPROFILE2 PRIMARY KEY (USERID); - -CREATE TABLE QUOTEEJB - (LOW DECIMAL(14, 2), - OPEN1 DECIMAL(14, 2), - VOLUME DOUBLE NOT NULL, - PRICE DECIMAL(14, 2), - HIGH DECIMAL(14, 2), - COMPANYNAME VARCHAR(250), - SYMBOL VARCHAR(250) NOT NULL, - CHANGE1 DOUBLE NOT NULL); - -ALTER TABLE QUOTEEJB - ADD CONSTRAINT PK_QUOTEEJB PRIMARY KEY (SYMBOL); - -CREATE TABLE KEYGENEJB - (KEYVAL INTEGER NOT NULL, - KEYNAME VARCHAR(250) NOT NULL); - -ALTER TABLE KEYGENEJB - ADD CONSTRAINT PK_KEYGENEJB PRIMARY KEY (KEYNAME); - -INSERT INTO KEYGENEJB (KEYNAME,KEYVAL) VALUES ('account', 0); -INSERT INTO KEYGENEJB (KEYNAME,KEYVAL) VALUES ('holding', 0); -INSERT INTO KEYGENEJB (KEYNAME,KEYVAL) VALUES ('order', 0); - -CREATE TABLE ACCOUNTEJB - (CREATIONDATE TIMESTAMP, - OPENBALANCE DECIMAL(14, 2), - LOGOUTCOUNT INTEGER NOT NULL, - BALANCE DECIMAL(14, 2), - ACCOUNTID INTEGER NOT NULL, - LASTLOGIN TIMESTAMP, - LOGINCOUNT INTEGER NOT NULL, - PROFILE_USERID VARCHAR(250)); - -ALTER TABLE ACCOUNTEJB - ADD CONSTRAINT PK_ACCOUNTEJB PRIMARY KEY (ACCOUNTID); - -CREATE TABLE ORDEREJB - (ORDERFEE DECIMAL(14, 2), - COMPLETIONDATE TIMESTAMP, - ORDERTYPE VARCHAR(250), - ORDERSTATUS VARCHAR(250), - PRICE DECIMAL(14, 2), - QUANTITY DOUBLE NOT NULL, - OPENDATE TIMESTAMP, - ORDERID INTEGER NOT NULL, - ACCOUNT_ACCOUNTID INTEGER, - QUOTE_SYMBOL VARCHAR(250), - HOLDING_HOLDINGID INTEGER); - -ALTER TABLE ORDEREJB - ADD CONSTRAINT PK_ORDEREJB PRIMARY KEY (ORDERID); - -CREATE INDEX ACCOUNT_USERID ON ACCOUNTEJB(PROFILE_USERID); -CREATE INDEX HOLDING_ACCOUNTID ON HOLDINGEJB(ACCOUNT_ACCOUNTID); -CREATE INDEX ORDER_ACCOUNTID ON ORDEREJB(ACCOUNT_ACCOUNTID); -CREATE INDEX ORDER_HOLDINGID ON ORDEREJB(HOLDING_HOLDINGID); -CREATE INDEX CLOSED_ORDERS ON ORDEREJB(ACCOUNT_ACCOUNTID,ORDERSTATUS); - diff --git a/src/test/resources/test-applications/daytrader8/src/main/webapp/dbscripts/oracle/Table.ddl b/src/test/resources/test-applications/daytrader8/src/main/webapp/dbscripts/oracle/Table.ddl deleted file mode 100644 index 3fa33c27..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/webapp/dbscripts/oracle/Table.ddl +++ /dev/null @@ -1,103 +0,0 @@ -## (C) Copyright IBM Corporation 2015. -## -## Licensed under the Apache License, Version 2.0 (the "License"); -## you may not use this file except in compliance with the License. -## You may obtain a copy of the License at -## -## http://www.apache.org/licenses/LICENSE-2.0 -## -## Unless required by applicable law or agreed to in writing, software -## distributed under the License is distributed on an "AS IS" BASIS, -## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -## See the License for the specific language governing permissions and -## limitations under the License. - -# Each SQL statement in this file should terminate with a semicolon (;) -# Lines starting with the pound character (#) are considered as comments -DROP TABLE HOLDINGEJB cascade constraints; -DROP TABLE ACCOUNTPROFILEEJB cascade constraints; -DROP TABLE QUOTEEJB cascade constraints; -DROP TABLE KEYGENEJB cascade constraints; -DROP TABLE ACCOUNTEJB cascade constraints; -DROP TABLE ORDEREJB cascade constraints; - -CREATE TABLE HOLDINGEJB - (PURCHASEPRICE DECIMAL(14, 2) NULL, - HOLDINGID INTEGER NOT NULL, - QUANTITY NUMBER NOT NULL, - PURCHASEDATE DATE NULL, - ACCOUNT_ACCOUNTID INTEGER NULL, - QUOTE_SYMBOL VARCHAR2(250) NULL); - -ALTER TABLE HOLDINGEJB - ADD CONSTRAINT PK_HOLDINGEJB PRIMARY KEY (HOLDINGID); - -CREATE TABLE ACCOUNTPROFILEEJB - (ADDRESS VARCHAR2(250) NULL, - PASSWD VARCHAR2(250) NULL, - USERID VARCHAR2(250) NOT NULL, - EMAIL VARCHAR2(250) NULL, - CREDITCARD VARCHAR2(250) NULL, - FULLNAME VARCHAR2(250) NULL); - -ALTER TABLE ACCOUNTPROFILEEJB - ADD CONSTRAINT PK_ACCOUNTPROFILEEJB PRIMARY KEY (USERID); - -CREATE TABLE QUOTEEJB - (LOW DECIMAL(14, 2) NULL, - OPEN1 DECIMAL(14, 2) NULL, - VOLUME NUMBER NOT NULL, - PRICE DECIMAL(14, 2) NULL, - HIGH DECIMAL(14, 2) NULL, - COMPANYNAME VARCHAR2(250) NULL, - SYMBOL VARCHAR2(250) NOT NULL, - CHANGE1 NUMBER NOT NULL); - -ALTER TABLE QUOTEEJB - ADD CONSTRAINT PK_QUOTEEJB PRIMARY KEY (SYMBOL); - -CREATE TABLE KEYGENEJB - (KEYVAL INTEGER NOT NULL, - KEYNAME VARCHAR2(250) NOT NULL); - -ALTER TABLE KEYGENEJB - ADD CONSTRAINT PK_KEYGENEJB PRIMARY KEY (KEYNAME); - -INSERT INTO KEYGENEJB (KEYNAME,KEYVAL) VALUES ('account', 0); -INSERT INTO KEYGENEJB (KEYNAME,KEYVAL) VALUES ('holding', 0); -INSERT INTO KEYGENEJB (KEYNAME,KEYVAL) VALUES ('order', 0); - -CREATE TABLE ACCOUNTEJB - (CREATIONDATE DATE NULL, - OPENBALANCE DECIMAL(14, 2) NULL, - LOGOUTCOUNT INTEGER NOT NULL, - BALANCE DECIMAL(14, 2) NULL, - ACCOUNTID INTEGER NOT NULL, - LASTLOGIN DATE NULL, - LOGINCOUNT INTEGER NOT NULL, - PROFILE_USERID VARCHAR2(250) NULL); - -ALTER TABLE ACCOUNTEJB - ADD CONSTRAINT PK_ACCOUNTEJB PRIMARY KEY (ACCOUNTID); - -CREATE TABLE ORDEREJB - (ORDERFEE DECIMAL(14, 2) NULL, - COMPLETIONDATE DATE NULL, - ORDERTYPE VARCHAR2(250) NULL, - ORDERSTATUS VARCHAR2(250) NULL, - PRICE DECIMAL(14, 2) NULL, - QUANTITY NUMBER NOT NULL, - OPENDATE DATE NULL, - ORDERID INTEGER NOT NULL, - ACCOUNT_ACCOUNTID INTEGER NULL, - QUOTE_SYMBOL VARCHAR2(250) NULL, - HOLDING_HOLDINGID INTEGER NULL); - -ALTER TABLE ORDEREJB - ADD CONSTRAINT PK_ORDEREJB PRIMARY KEY (ORDERID); - -CREATE INDEX ACCOUNT_USERID ON ACCOUNTEJB(PROFILE_USERID); -CREATE INDEX HOLDING_ACCOUNTID ON HOLDINGEJB(ACCOUNT_ACCOUNTID); -CREATE INDEX ORDER_ACCOUNTID ON ORDEREJB(ACCOUNT_ACCOUNTID); -CREATE INDEX ORDER_HOLDINGID ON ORDEREJB(HOLDING_HOLDINGID); -CREATE INDEX CLOSED_ORDERS ON ORDEREJB(ACCOUNT_ACCOUNTID,ORDERSTATUS); diff --git a/src/test/resources/test-applications/daytrader8/src/main/webapp/docs/benchmarking.html b/src/test/resources/test-applications/daytrader8/src/main/webapp/docs/benchmarking.html deleted file mode 100644 index 0a7cb9b4..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/webapp/docs/benchmarking.html +++ /dev/null @@ -1,67 +0,0 @@ - - - - - - -Benchmarking Details - - - -
    - - - - - - -
    -

    Benchmarking

    -
    -
    -

    DayTrader provides two servlets to create a workload for benchmarking: TradeApp servlet and TradeScenario servlet. -In either case, the load generation tool used to drive the Trade workload must provide cookie support to handle -HTTP sessions.

    -

    TradeApp servlet provides the standard web interface and -can be accessed with the Go Trade! link. Driving benchmark load using this -interface requires a sophisticated web load -generator that is capable of filling HTML -forms and posting dynamic data.

    -

    TradeScenario servlet emulates a population of web users by generating -a specific Trade operation for a randomly -chosen user on each access to the URL. Test -this servlet by clicking Trade Scenario and hit "Reload" on your browser to step through a Trade Scenario. -To benchmark using this URL aim your favorite web load generator at the -Trade Scenario URL and fire away.

    -

    There is a drawback to using the Trade Scenario -servlet to drive the workload versus using a series of more complicated -load scripts. As previously mentioned, the scenario -servlet is responsible for managing clients and emulating user -operations by dispatching simple client requests to complex Trade -actions. This causes the application server to spend a large percentage -of time performing work that would typically be handled by a client or -a more complex load driver. Consequently, performance numbers are -artificially deflated when using Trade Scenario servlet as compared to -driving the workload directly.

    - - -

    Web Primitive Benchmarking

    -

    A set of automated Web Primitives is also provided. The web primitives leverage the DayTrader infrastructure to test specific features of the web application development environment. This provides basic workloads for servlets, JSPs, EJBs, MDBs and more. The Web Primitives are installed automatically with the daytrader configuration archive.
    -

    -
    - - diff --git a/src/test/resources/test-applications/daytrader8/src/main/webapp/docs/documentation.html b/src/test/resources/test-applications/daytrader8/src/main/webapp/docs/documentation.html deleted file mode 100644 index be31be9f..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/webapp/docs/documentation.html +++ /dev/null @@ -1,67 +0,0 @@ - - - - - - - -Technical Documentation - - - -
    - - - - - - - -
    -

    Technical Documentation

    -
    -
    -
    -

    Documents below provide documentation on Trade application design, runtime -characteristics and FAQs.

    -
    - - - - - - - - - - - - - - - - - - - - -
    Trade Technical OverviewProvides an overview of the Trade application design, configuration, and usage
    Trade UML DiagramsUML diagrams showing application architecture
    FAQFrequently Asked Questions
    Runtime and Database
    - Usage Characteristics
    Details runtime characteristics and database operations
    -
    -
    - - diff --git a/src/test/resources/test-applications/daytrader8/src/main/webapp/docs/glossary.html b/src/test/resources/test-applications/daytrader8/src/main/webapp/docs/glossary.html deleted file mode 100644 index 1c9c5e1d..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/webapp/docs/glossary.html +++ /dev/null @@ -1,98 +0,0 @@ - - - - - - - -Technical Documentation - - - -
    - - - - - - - -
    -

    Trade Glossary and Terms

    -
    -
    -
    -
      -
    • account ID - A unique Integer based key. Each user is assigned an account ID at account creation time.
    • -
    • account Created - The time and date the users account was first created.
    • -
    • cash balance - The current cash balance in the users account. This does not include current stock holdings.
    • -
    • company - The full company name for an individual stock.
      -
    • -
    • current gain/loss - The total gain or loss of this account, computed by substracting the current sum of cash/holdings minus the opening account balance.
    • -
    • current price - The current trading price for a given stock symbol.
      -
    • - -
    • gain/loss - The current gain or loss of an individual stock holding, computed as (current market value - holding basis).
      -
    • -
    • last login - The date and time this user last logged in to Trade.
    • -
    • market value - The current total value of a stock holding, computed as (quantity * current price).
      -
    • - - -
    • number of holdings - The total number of stocks currently owned by this account.
    • -
    • open price - The price of a given stock at the open of the trading session.
      -
    • -
    • opening balance - The initial cash balance in this account when it was opened.
    • -
    • order id - A unique Integer based key. Each order is assigned an order ID at order creation time.
    • -
    • order status - orders are opened, processed, closed and completed. Order status shows the current stat for this order.
    • -
    • price range - The low and high prices for this stock during the current trading session
      -
    • -
    • purchase date - The date and time the a stock was purchased.
    • -
    • purchase price - The price used when purchasing the stock.
    • -
    • purchase basis - The total cost to purchase this holding. This is computed as (quantity * purchase price).
      -
    • - -
    • quantity - The number of stock shares in the order or user holding.
      -
    • - -
    • session created - An HTTP session is created for each user at during login. Session created shows the time and day when the session was created.
    • -
    • sum of cash/holdings - The total current value of this account. This is the sum of the cash balance along with the value of current stock holdings.
    • -
    • symbol - The symbol for a Trade stock.
      -
    • -
    • total logins - The total number of logins performed by this user since the last Trade Reset.
    • -
    • total logouts - The total number of logouts performed by this user since the last Trade Reset.
      -
    • - -
    • total of holdings - The current total value of all stock holdings in this account given the current valuation of each stock held.
    • -
    • Top gainers - The list of stock gaining the most in price during the current trading session.
    • -
    • Top losers - The list of stock falling the most in price during the current trading session.
      -
    • -
    • Trade Stock Index (TSIA) - A computed index of the top 20 stocks in Trade.
    • -
    • Trading Volume - The total number of shares traded for all stocks during this trading session.
      -
    • -
    • txn fee - The fee charged by the brokerage to process this order.
    • -
    • type - The order type (buy or sell).
      -
    • - -
    • user ID - The unique user ID for the account chosen by the user at account registration.
    • -
    • volume - The total number of shares traded for this stock.
    • - -
    - -
    - - diff --git a/src/test/resources/test-applications/daytrader8/src/main/webapp/docs/rtCharacterisitics.html b/src/test/resources/test-applications/daytrader8/src/main/webapp/docs/rtCharacterisitics.html deleted file mode 100644 index 66132b6e..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/webapp/docs/rtCharacterisitics.html +++ /dev/null @@ -1,158 +0,0 @@ - - - - - - - -Trade Runtime and Database Usage Characteristics - - - -
    - - - - - - - -
    Trade Runtime and Database Usage Characteristics
    -

    The table below details each of the high level user operations in the Trade -application.
    -

    -
      -
    • Description - a short description of the user operation -
    • Complexity - the J2EE components invoked to complete the operation -
    • HTTP Session - operations on HTTP Session objects -
    • DB Activity - Create, Read, RC Read Collection, Update, and Delete operations on database tables -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Trade ActionDescriptionComplexityHTTP SessionDB Activity
    - (C, R, U, D)
    LoginUser sign in, session creation, market summaryServlet, JSP,
    - Session EJB
    - CMP Beans Read, Update, Collections
    Create, UpdateAccount: R, U
    - AccountProfile: R
    -
    Quote: RC *3
    LogoutUse sign-off, session destroyServlet, JSP,
    - Session EJB
    - CMP Bean Read, Update
    Read, DestroyAccount: R, U
    - AccountProfile: R
    BuyQuote followed buy a security purchaseServlet, JSP,
    - Session EJB
    - Message Driven Beans (Queue and Pub/Sub)
    - Multi CMP Read/Update
    ReadQuote: R
    - Account: R, U
    - Holding: C, R, U
    Orders: C, R, U -
    SellPortfolio followed by the sell of a holdingServlet, JSP,
    - Session EJB
    - Message Driven Beans (Queue and Pub/Sub)
    Multi CMP Read/Update
    ReadQuote: R
    - Account: R, U
    - Holding: D, R
    Orders: R, U
    RegisterCreate a new user profile and accountServlet, JSP,
    - Session EJB
    - CMP Bean Creates
    Create, UpdateAccount: C, R
    - AccountProfile: C
    HomePersonalized home page including current market conditions in a detailed market summaryServlet, JSP,
    - Session EJB
    - CMP Bean Read, Collections
    ReadAccount: R
    AccountProfile: R
    Quote: RC *3
    AccountReview current user account and profile information along with recent ordersServlet, JSP,
    - Session EJB
    - CMP Bean Read, Collections
    ReadAccount: R
    AccountProfile: R
    Orders: RC
    Account UpdateAccount followed by user profile update Servlet, JSP,
    - Session EJB
    - CMP Bean Read/Update, Collections
    ReadAccount: R
    AccountProfile: R, U
    Orders: RCQuote: RC
    PortfolioView users current security holdingsServlet, JSP,
    - Session EJB
    - CMP Bean Read, Collections
    ReadHolding: RC
    - Quote: RC
    QuotesView an arbirtray list of current security quotesServlet, JSP
    - Cached CMP Bean Read, Collections
    ReadQuote: RC
    -
    - - diff --git a/src/test/resources/test-applications/daytrader8/src/main/webapp/docs/tradeFAQ.html b/src/test/resources/test-applications/daytrader8/src/main/webapp/docs/tradeFAQ.html deleted file mode 100644 index f10e895c..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/webapp/docs/tradeFAQ.html +++ /dev/null @@ -1,190 +0,0 @@ - - - - - - -Frequently Asked Questions - - - -
    - - - - - - - -
    -

    Frequently Asked Questions

    -
    - -

    The Apache Software Foundation® DayTrader Performance Benchmark Sample -provides a suite of workloads for characterizing performance of J2EE 1.4 Application -Servers. The workloads consist of an end-to-end Web application and a full set of Web -primitives. The applications are a collection of JavaTM classes, Java servlets, -Java ServerPagesTM (JSPTM) files and Enterprise JavaBeansTM (EJBTM) built to open Java 2 Platform, Enterprise Edition (J2EETM) APIs. Together, the Trade application and Web primitives provide versatile and portable test cases that are designed to measure aspects -of scalability and performance.


    - -

    Application Design

    - -

    What is DayTrader?

    -

    DayTrader is an end-to-end Web application that is modeled after an on-line stock brokerage. -DayTrader leverages J2EE components such as servlets, JSP files, enterprise beans, -message-driven beans (MDBs) and Java database connectivity (JDBCTM) to -provide a set of user services such as login/logout, stock quotes, buy, -sell, account details, and so on through standards-based HTTP and Web services protocols.

    - -

    What are Web Primitives?

    -

    The Web primitives leverage the DayTrader infrastructure to test specific features -of the Application Servers implementing the J2EE 1.4 programming model. A description of each of the Web -primitives is provided on the main web primitive -page.

    - - -

    What software is required to run DayTrader?

    -
      -
    • Any J2EE 1.4 Compliant Application Server
    • -
    • A database that has a suitable JDBC driver for both XA and non-XA connectivity.
    • -
    - -

    What are the most common configuration scenarios?

      -
    • Single server with a remote database - The DayTrader application runs on a stand alone WebSphere Application Server instance. The required database software and the associated Trade database are located on a different system from the Application Server. The Application Server system must have the necessary database client software to connect to the remote database.
    • -
    • Single server with a local database - Same as the previous scenario; however, the required database software and the - associated DayTrader database are located on the same system as the Application Server.
    • -
    - - -
    -

    Run-time Configuration

    - -

    What does the ResetDayTrader link do?

    -

    The ResetDayTrader link on the configuration page must be clicked between DayTrader runs. -This link sets the database to a consistent size by removing all the newly registered users created during -a DayTrader run. The reset also sets all outstanding orders to a consistent state. Resetting the database -to a consistent size ensures repeatable throughput on subsequent DayTrader runs.

    - -

    How are the DayTrader configuration parameters modified?

    -

    The Trade configuration page provides a dynamic mechanism to set -the run-time configuration for a DayTrader run. These settings control the application -run-time characteristics such as the run-time mode, the order processing mode, and other run-time -variations supported in DayTrader. All settings are reset to defaults when the DayTrader application -server is restarted.

    - -

    Can you make configuration changes permanent?

    -

    Yes. Normally, Trade configuration parameters return to defaults whenever the Trade application -server is restarted. Settings can be made permanent by setting the configuration values in the -servlet init parameters of the TradeApp servlet and the TradeScenario servlet. Modify the -servlet init parameters in the web.xml file of the Trade Web application to change these parameters.

    - -

    What are the run-time modes?

    -

    DayTrader provides two server implementations of the emulated DayTrader brokerage services.

    -
      -
    • EJB - Database access uses EJB 2.1 technology to drive transactional trading operations.
    • -
    • Direct - This mode uses database and messaging access through direct JDBC and JMS code.
    • -
    - -

    What are the order processing modes?

    -

    DayTrader provides an asynchronous order processing mode through messaging with MDBs. The order -processing mode determines the mode for completing stock purchase and sell operations. Synchronous -mode completes the order immediately. Asynchronous mode uses MDB and JMS to queue the order to a -TradeBroker agent to complete the order. Asychronous_2-Phase performs a two-phase commit over the EJB -database and messaging transactions.

    -
      -
    • Synchronous - Orders are completed immediately by the DayTrader session enterprise bean and entity enterprise beans.
    • -
    • Asynchronous 2-phase - Orders are queued to the TradeBrokerMDB for asynchronous processing.
    • -
    - -

    What are the access modes?

    -

    DayTrader provides multiple access modes to the server-side brokerage services.

    -
      - -
    • Standard - Servlets access the Trade enterprise beans through the standard RMI protocol
    • -
    • WebServices - Servlets access DayTrader services through the Web services implementation in - the System Under Test (SUT). Each trading service is available as a standard Web service through the SOAP - Remote Procedure Call (RPC) protocol. Because DayTrader is wrapped to provide SOAP services, each DayTrader - operation (login, quote, buy, and son on) is available as a SOAP service.
    • - -
    - -

    What is the Primitive Iteration setting?

    -

    By default, the DayTrader primitives run one operation per Web request. Setting this value alters -the number of operations performed per client request. This is useful for reducing the amount of work -that is performed by the Web Container and for stressing other components within the application server. - -

    -
    -

    Benchmarking

    - -

    What is the TradeScenario servlet?

    -

    The TradeScenario servlet provides a simple mechanism to drive the DayTrader application. -The Trade database is initially populated with a set of fictitious users with names ranging -from uid:0 to uid:49 and a set of stocks ranging from s:0 to s:99. -The TradeScenario servlet emulates a population of Web users by generating a specific DayTrader operation for -a randomly chosen user on each access to the URL. To run the TradeScenario servlet use the single -TradeScenario URL (http://hostname/daytrader/scenario) with a load generation tool.

    - -

    Although TradeScenario servlet provides a simple mechanism for driving the DayTrader application, -there is a drawback to using this method versus using a series of load generation scripts -that drive the operations directly. This servlet consumes processing resources on the server -to manage incoming clients and dispatch these simple client requests to complex Trade actions. This -action artificially decreases server throughput because the server is emulating tasks that are normally - performed by a standard client or a more complex load generation tool.

    - -

    What is the typical procedure for collecting performance measurements with DayTrader? -

    When DayTrader is successfully installed on the application server and the supporting -database is populated, you can us the DayTrader application to collect performance measurements. -The following list provides the typical process for gathering performance measurements with DayTrader.

    -
      -
    1. Select the DayTrader run-time configuration parameters from the configuration - page (EJB, synchronous, and so on).
    2. -
    3. Reset the DayTrader run-time using the Reset DayTrader link.
    4. -
    5. Warm-up the application server JVMTM by applying load for a short period of time. The load generation tool - may access the TradeScenario servlet, - web primitives, or use custom scripts to drive the various operations of TradeApp servlet. To warm-up the - JVM, each code path within DayTrader must be processed enough times to esnure that the JIT compiler - has compiled and optimzed the application and server paths; generally, about 3000 iterations should do the trick. - Remember that the same code path is not necessarily run on each request unless primitives are being - run. Therefore, perform an adequate number of requests to stabilize the performance results.
    6. -
    7. Stop the load generation tool.
    8. -
    9. Reset the Trade run-time again
    10. -
    11. Restart the load generation tool and record measurements after the driver completes the requests.
    12. -
    13. Repeat steps 5 and 6 to obtain additional measurements.
    14. -
    - -

    Where did DayTrader come from? -

    DayTrader was originally an application designed by IBM to test their commercial Application Server. -The application was designed around common development patterns as well as to use the majority of the -J2EE programming model. The original author was Stan Cox where he developed Trade (the original name) -for J2EE 1.3. Since then Stan has evolved Trade and several other individuals have contributed to the project. -Christopher Blythe has been instrumental in stabilizing the long running capability of the benchmark and Andrew -Spyker introduced the Application Clients. The Application Clients (Streamer and WSAppClient) provide remote -capability to validate remote J2EE functionality and database consistency as well as provide a remote -WebServices client. Matt Hogstrom has used Trade extensively for performance analysis and brought Trade -to the Apache Software Foundation Geronimo Project. He has removed (hopefully) all WebSphere specific items -in the application and introduced additional functionality for gathering server compliance information -and low-level diagnostic information.

    -

    Where is DayTrader now? -

    David Hare developed DayTrader 3.0 internally at IBM. Daytrader 3.0 updated the Daytrader benchmark to -Java EE6 and added some jsf and jax-rs functionality. The Application Clients were removed. Daytrader 3.0 -was made public on IBMs WebSphere Performance page. Joe McClure is now adding functionality and improvements -for Java EE7.

    -
    - - - diff --git a/src/test/resources/test-applications/daytrader8/src/main/webapp/docs/tradeFAQ.xhtml b/src/test/resources/test-applications/daytrader8/src/main/webapp/docs/tradeFAQ.xhtml deleted file mode 100644 index 0698074e..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/webapp/docs/tradeFAQ.xhtml +++ /dev/null @@ -1,209 +0,0 @@ - - - - - DayTrader - - - - -
    - - -
    -
    - - - - - - - - -
    -

    Frequently Asked Questions

    -
    - -

    The Apache Software Foundation® DayTrader Performance Benchmark Sample -provides a suite of workloads for characterizing performance of J2EE 1.4 Application -Servers. The workloads consist of an end-to-end Web application and a full set of Web -primitives. The applications are a collection of JavaTM classes, Java servlets, -Java ServerPagesTM (JSPTM) files and Enterprise JavaBeansTM (EJBTM) built to open Java 2 Platform, Enterprise Edition (J2EETM) APIs. Together, the Trade application and Web primitives provide versatile and portable test cases that are designed to measure aspects -of scalability and performance.



    - -

    Application Design

    -
    -What is DayTrader?
    -DayTrader is an end-to-end Web application that is modeled after an on-line stock brokerage. -DayTrader leverages J2EE components such as servlets, JSP files, enterprise beans, -message-driven beans (MDBs) and Java database connectivity (JDBCTM) to -provide a set of user services such as login/logout, stock quotes, buy, -sell, account details, and so on through standards-based HTTP and Web services protocols. -

    -What are Web Primitives?
    -The Web primitives leverage the DayTrader infrastructure to test specific features -of the Application Servers implementing the J2EE 1.4 programming model. A description of each of the Web -primitives is provided on the main web primitive -page.

    - - -What software is required to run DayTrader?
    -
      -
    • Any J2EE 1.4 Compliant Application Server
    • -
    • A database that has a suitable JDBC driver for both XA and non-XA connectivity.
    • -
    -

    -What are the most common configuration scenarios?
    -
      -
    • Single server with a remote database - The DayTrader application runs on a stand alone WebSphere Application Server instance. The required database software and the associated Trade database are located on a different system from the Application Server. The Application Server system must have the necessary database client software to connect to the remote database.
    • -
    • Single server with a local database - Same as the previous scenario; however, the required database software and the - associated DayTrader database are located on the same system as the Application Server.
    • -


    - -

    Run-time Configuration

    - -What does the ResetDayTrader link do?
    -The ResetDayTrader link on the configuration page must be clicked between DayTrader runs. -This link sets the database to a consistent size by removing all the newly registered users created during -a DayTrader run. The reset also sets all outstanding orders to a consistent state. Resetting the database -to a consistent size ensures repeatable throughput on subsequent DayTrader runs.

    - -How are the DayTrader configuration parameters modified?
    -The Trade configuration page provides a dynamic mechanism to set -the run-time configuration for a DayTrader run. These settings control the application -run-time characteristics such as the run-time mode, the order processing mode, and other run-time -variations supported in DayTrader. All settings are reset to defaults when the DayTrader application -server is restarted.

    - -Can you make configuration changes permanent?
    -Yes. Normally, Trade configuration parameters return to defaults whenever the Trade application -server is restarted. Settings can be made permanent by setting the configuration values in the -servlet init parameters of the TradeApp servlet and the TradeScenario servlet. Modify the -servlet init parameters in the web.xml file of the Trade Web application to change these parameters.

    - -What are the run-time modes?
    -DayTrader provides two server implementations of the emulated DayTrader brokerage services.
    -
      -
    • EJB - Database access uses EJB 2.1 technology to drive transactional trading operations.
    • -
    • Direct - This mode uses database and messaging access through direct JDBC and JMS code.
    • -


    - -What are the order processing modes?
    -DayTrader provides an asynchronous order processing mode through messaging with MDBs. The order -processing mode determines the mode for completing stock purchase and sell operations. Synchronous -mode completes the order immediately. Asynchronous mode uses MDB and JMS to queue the order to a -TradeBroker agent to complete the order. Asychronous_2-Phase performs a two-phase commit over the EJB -database and messaging transactions.
    -
      -
    • Synchronous - Orders are completed immediately by the DayTrader session enterprise bean and entity enterprise beans.
    • -
    • Asynchronous 2-phase - Orders are queued to the TradeBrokerMDB for asynchronous processing.
    • -


    - -What are the access modes?
    -DayTrader provides multiple access modes to the server-side brokerage services.
    -
      - -
    • Standard - Servlets access the Trade enterprise beans through the standard RMI protocol
    • -
    • WebServices - Servlets access DayTrader services through the Web services implementation in - the System Under Test (SUT). Each trading service is available as a standard Web service through the SOAP - Remote Procedure Call (RPC) protocol. Because DayTrader is wrapped to provide SOAP services, each DayTrader - operation (login, quote, buy, and son on) is available as a SOAP service.
    • - -


    - -What is the Primitive Iteration setting?
    -By default, the DayTrader primitives run one operation per Web request. Setting this value alters -the number of operations performed per client request. This is useful for reducing the amount of work -that is performed by the Web Container and for stressing other components within the application server.

    - -

    Benchmarking


    - -What is the TradeScenario servlet?
    -The TradeScenario servlet provides a simple mechanism to drive the DayTrader application. -The Trade database is initially populated with a set of fictitious users with names ranging -from uid:0 to uid:49 and a set of stocks ranging from s:0 to s:99. -The TradeScenario servlet emulates a population of Web users by generating a specific DayTrader operation for -a randomly chosen user on each access to the URL. To run the TradeScenario servlet use the single -TradeScenario URL (http://hostname/daytrader/scenario) with a load generation tool.
    - -Although TradeScenario servlet provides a simple mechanism for driving the DayTrader application, -there is a drawback to using this method versus using a series of load generation scripts -that drive the operations directly. This servlet consumes processing resources on the server -to manage incoming clients and dispatch these simple client requests to complex Trade actions. This -action artificially decreases server throughput because the server is emulating tasks that are normally - performed by a standard client or a more complex load generation tool.

    - -What is the typical procedure for collecting performance measurements with DayTrader?
    -When DayTrader is successfully installed on the application server and the supporting -database is populated, you can us the DayTrader application to collect performance measurements. -The following list provides the typical process for gathering performance measurements with DayTrader.
    -
      -
    1. Select the DayTrader run-time configuration parameters from the configuration - page (EJB, synchronous, and so on).
    2. -
    3. Reset the DayTrader run-time using the Reset DayTrader link.
    4. -
    5. Warm-up the application server JVMTM by applying load for a short period of time. The load generation tool - may access the TradeScenario servlet, - web primitives, or use custom scripts to drive the various operations of TradeApp servlet. To warm-up the - JVM, each code path within DayTrader must be processed enough times to esnure that the JIT compiler - has compiled and optimzed the application and server paths; generally, about 3000 iterations should do the trick. - Remember that the same code path is not necessarily run on each request unless primitives are being - run. Therefore, perform an adequate number of requests to stabilize the performance results.
    6. -
    7. Stop the load generation tool.
    8. -
    9. Reset the Trade run-time again
    10. -
    11. Restart the load generation tool and record measurements after the driver completes the requests.
    12. -
    13. Repeat steps 5 and 6 to obtain additional measurements.
    14. -

    - -Where did DayTrader come from?
    -

    DayTrader was originally an application designed by IBM to test their commercial Application Server. -The application was designed around common development patterns as well as to use the majority of the -J2EE programming model. The original author was Stan Cox where he developed Trade (the original name) -for J2EE 1.3. Since then Stan has evolved Trade and several other individuals have contributed to the project. -Christopher Blythe has been instrumental in stabilizing the long running capability of the benchmark and Andrew -Spyker introduced the Application Clients. The Application Clients (Streamer and WSAppClient) provide remote -capability to validate remote J2EE functionality and database consistency as well as provide a remote -WebServices client. Matt Hogstrom has used Trade extensively for performance analysis and brought Trade -to the Apache Software Foundation Geronimo Project. He has removed (hopefully) all WebSphere specific items -in the application and introduced additional functionality for gathering server compliance information -and low-level diagnostic information.



    -Where is DayTrader now?
    -David Hare developed DayTrader 3.0 internally at IBM. Daytrader 3.0 updated the Daytrader benchmark to -Java EE6 and added some jsf and jax-rs functionality. The Application Clients were removed. Daytrader 3.0 -was made public on IBMs WebSphere Performance page. Joe McClure is now adding functionality and improvements -for Java EE7.

    -
    -
    - -
    - \ No newline at end of file diff --git a/src/test/resources/test-applications/daytrader8/src/main/webapp/docs/tradeversion.html b/src/test/resources/test-applications/daytrader8/src/main/webapp/docs/tradeversion.html deleted file mode 100644 index 38be2eee..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/webapp/docs/tradeversion.html +++ /dev/null @@ -1,24 +0,0 @@ - - -DayTrader Version - -IBM WebSphere Application Server Samples - DayTrader 8 (Version 8.0.0) -
    Full EE 8 Spec Compliant -
    Date: 20180417 -
    Contact: jdmcclur@us.ibm.com - - diff --git a/src/test/resources/test-applications/daytrader8/src/main/webapp/error.jsp b/src/test/resources/test-applications/daytrader8/src/main/webapp/error.jsp deleted file mode 100644 index 988ad2d9..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/webapp/error.jsp +++ /dev/null @@ -1,122 +0,0 @@ - - -<%@ page - import="java.io.StringWriter, - java.io.PrintWriter"%> - - - - - - - -
    DayTrader - ErrorDayTrader
    -
    - - - - - - - - - - - - - - - - - - - - - - -
    -
    -
    An Error has - occurred during DayTrader processing.
    The - stack trace detailing the error follows. -

    - Please consult the application server error - logs for further details. -

    <% - String message = null; - int status_code = -1; - String exception_info = null; - String url = null; - - try { - Exception theException = null; - Integer status = null; - - //these attribute names are specified by Servlet 2.2 - message = (String) request.getAttribute("javax.servlet.error.message"); - status = ((Integer) request.getAttribute("javax.servlet.error.status_code")); - theException = (Exception) request.getAttribute("javax.servlet.error.exception"); - url = (String) request.getAttribute("javax.servlet.error.request_uri"); - - // convert the stack trace to a string - StringWriter sw = new StringWriter(); - PrintWriter pw = new PrintWriter(sw); - theException.printStackTrace(pw); - pw.flush(); - pw.close(); - - if (message == null) { - message = "not available"; - } - - if (status == null) { - status_code = -1; - } else { - status_code = status.intValue(); - } - - exception_info = theException.toString(); - exception_info = exception_info + "
    " + sw.toString(); - sw.close(); - - } catch (Exception e) { - e.printStackTrace(); - } - - out.println("

    Processing request:" + url); - out.println("
    StatusCode: " + status_code); - out.println("
    Message:" + message); - out.println("
    Exception:" + exception_info); - %> -
    -
    -
    - - - - - - - -
    DayTrader - ErrorDayTrader
    diff --git a/src/test/resources/test-applications/daytrader8/src/main/webapp/favicon.ico b/src/test/resources/test-applications/daytrader8/src/main/webapp/favicon.ico deleted file mode 100644 index beacc182..00000000 Binary files a/src/test/resources/test-applications/daytrader8/src/main/webapp/favicon.ico and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/src/main/webapp/footer.html b/src/test/resources/test-applications/daytrader8/src/main/webapp/footer.html deleted file mode 100644 index 683d80bf..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/webapp/footer.html +++ /dev/null @@ -1,38 +0,0 @@ - - - -daytrader2_matts_mods - - - - - - - - -
    - - - - -
    -
    - - - diff --git a/src/test/resources/test-applications/daytrader8/src/main/webapp/header.html b/src/test/resources/test-applications/daytrader8/src/main/webapp/header.html deleted file mode 100644 index c70149df..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/webapp/header.html +++ /dev/null @@ -1,96 +0,0 @@ - - - -DayTrader Header - - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - diff --git a/src/test/resources/test-applications/daytrader8/src/main/webapp/images/DayTraderHead_blue.gif b/src/test/resources/test-applications/daytrader8/src/main/webapp/images/DayTraderHead_blue.gif deleted file mode 100644 index 49745642..00000000 Binary files a/src/test/resources/test-applications/daytrader8/src/main/webapp/images/DayTraderHead_blue.gif and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/src/main/webapp/images/DayTraderHead_red.gif b/src/test/resources/test-applications/daytrader8/src/main/webapp/images/DayTraderHead_red.gif deleted file mode 100644 index 5f05eec8..00000000 Binary files a/src/test/resources/test-applications/daytrader8/src/main/webapp/images/DayTraderHead_red.gif and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/src/main/webapp/images/Thumbs.db b/src/test/resources/test-applications/daytrader8/src/main/webapp/images/Thumbs.db deleted file mode 100644 index 3b66be0e..00000000 Binary files a/src/test/resources/test-applications/daytrader8/src/main/webapp/images/Thumbs.db and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/src/main/webapp/images/about.gif b/src/test/resources/test-applications/daytrader8/src/main/webapp/images/about.gif deleted file mode 100644 index 855c676a..00000000 Binary files a/src/test/resources/test-applications/daytrader8/src/main/webapp/images/about.gif and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/src/main/webapp/images/account.gif b/src/test/resources/test-applications/daytrader8/src/main/webapp/images/account.gif deleted file mode 100644 index a98761b1..00000000 Binary files a/src/test/resources/test-applications/daytrader8/src/main/webapp/images/account.gif and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/src/main/webapp/images/arrowdown.gif b/src/test/resources/test-applications/daytrader8/src/main/webapp/images/arrowdown.gif deleted file mode 100644 index 11012117..00000000 Binary files a/src/test/resources/test-applications/daytrader8/src/main/webapp/images/arrowdown.gif and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/src/main/webapp/images/arrowup.gif b/src/test/resources/test-applications/daytrader8/src/main/webapp/images/arrowup.gif deleted file mode 100644 index 24b6c53f..00000000 Binary files a/src/test/resources/test-applications/daytrader8/src/main/webapp/images/arrowup.gif and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/src/main/webapp/images/bottomRedBar.gif b/src/test/resources/test-applications/daytrader8/src/main/webapp/images/bottomRedBar.gif deleted file mode 100644 index c814872d..00000000 Binary files a/src/test/resources/test-applications/daytrader8/src/main/webapp/images/bottomRedBar.gif and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/src/main/webapp/images/configuration.gif b/src/test/resources/test-applications/daytrader8/src/main/webapp/images/configuration.gif deleted file mode 100644 index 16798fb6..00000000 Binary files a/src/test/resources/test-applications/daytrader8/src/main/webapp/images/configuration.gif and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/src/main/webapp/images/dayTraderLogo.gif b/src/test/resources/test-applications/daytrader8/src/main/webapp/images/dayTraderLogo.gif deleted file mode 100644 index c569db51..00000000 Binary files a/src/test/resources/test-applications/daytrader8/src/main/webapp/images/dayTraderLogo.gif and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/src/main/webapp/images/daytrader_simple_arch.gif b/src/test/resources/test-applications/daytrader8/src/main/webapp/images/daytrader_simple_arch.gif deleted file mode 100644 index 5d9bf60e..00000000 Binary files a/src/test/resources/test-applications/daytrader8/src/main/webapp/images/daytrader_simple_arch.gif and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/src/main/webapp/images/faq.gif b/src/test/resources/test-applications/daytrader8/src/main/webapp/images/faq.gif deleted file mode 100644 index 37a644c0..00000000 Binary files a/src/test/resources/test-applications/daytrader8/src/main/webapp/images/faq.gif and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/src/main/webapp/images/favicon.ico b/src/test/resources/test-applications/daytrader8/src/main/webapp/images/favicon.ico deleted file mode 100644 index beacc182..00000000 Binary files a/src/test/resources/test-applications/daytrader8/src/main/webapp/images/favicon.ico and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/src/main/webapp/images/graph.gif b/src/test/resources/test-applications/daytrader8/src/main/webapp/images/graph.gif deleted file mode 100644 index 7d91ee96..00000000 Binary files a/src/test/resources/test-applications/daytrader8/src/main/webapp/images/graph.gif and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/src/main/webapp/images/home.gif b/src/test/resources/test-applications/daytrader8/src/main/webapp/images/home.gif deleted file mode 100644 index a74e60de..00000000 Binary files a/src/test/resources/test-applications/daytrader8/src/main/webapp/images/home.gif and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/src/main/webapp/images/homeBanner.gif b/src/test/resources/test-applications/daytrader8/src/main/webapp/images/homeBanner.gif deleted file mode 100644 index 775318ab..00000000 Binary files a/src/test/resources/test-applications/daytrader8/src/main/webapp/images/homeBanner.gif and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/src/main/webapp/images/line.gif b/src/test/resources/test-applications/daytrader8/src/main/webapp/images/line.gif deleted file mode 100644 index 0cf9e512..00000000 Binary files a/src/test/resources/test-applications/daytrader8/src/main/webapp/images/line.gif and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/src/main/webapp/images/logout.gif b/src/test/resources/test-applications/daytrader8/src/main/webapp/images/logout.gif deleted file mode 100644 index e31a6a11..00000000 Binary files a/src/test/resources/test-applications/daytrader8/src/main/webapp/images/logout.gif and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/src/main/webapp/images/lower_banner.gif b/src/test/resources/test-applications/daytrader8/src/main/webapp/images/lower_banner.gif deleted file mode 100644 index 9c7c294d..00000000 Binary files a/src/test/resources/test-applications/daytrader8/src/main/webapp/images/lower_banner.gif and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/src/main/webapp/images/menuHome.gif b/src/test/resources/test-applications/daytrader8/src/main/webapp/images/menuHome.gif deleted file mode 100644 index 2fa03dd0..00000000 Binary files a/src/test/resources/test-applications/daytrader8/src/main/webapp/images/menuHome.gif and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/src/main/webapp/images/nav_bg.png b/src/test/resources/test-applications/daytrader8/src/main/webapp/images/nav_bg.png deleted file mode 100644 index 7157603c..00000000 Binary files a/src/test/resources/test-applications/daytrader8/src/main/webapp/images/nav_bg.png and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/src/main/webapp/images/portfolio.gif b/src/test/resources/test-applications/daytrader8/src/main/webapp/images/portfolio.gif deleted file mode 100644 index 637f9ab9..00000000 Binary files a/src/test/resources/test-applications/daytrader8/src/main/webapp/images/portfolio.gif and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/src/main/webapp/images/primitives.gif b/src/test/resources/test-applications/daytrader8/src/main/webapp/images/primitives.gif deleted file mode 100644 index a031415e..00000000 Binary files a/src/test/resources/test-applications/daytrader8/src/main/webapp/images/primitives.gif and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/src/main/webapp/images/quotes.gif b/src/test/resources/test-applications/daytrader8/src/main/webapp/images/quotes.gif deleted file mode 100644 index 74499d7f..00000000 Binary files a/src/test/resources/test-applications/daytrader8/src/main/webapp/images/quotes.gif and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/src/main/webapp/images/reports.gif b/src/test/resources/test-applications/daytrader8/src/main/webapp/images/reports.gif deleted file mode 100644 index 15c987a9..00000000 Binary files a/src/test/resources/test-applications/daytrader8/src/main/webapp/images/reports.gif and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/src/main/webapp/images/spacer.gif b/src/test/resources/test-applications/daytrader8/src/main/webapp/images/spacer.gif deleted file mode 100644 index 5bfd67a2..00000000 Binary files a/src/test/resources/test-applications/daytrader8/src/main/webapp/images/spacer.gif and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/src/main/webapp/images/ticker-anim.gif b/src/test/resources/test-applications/daytrader8/src/main/webapp/images/ticker-anim.gif deleted file mode 100644 index 04c4c88b..00000000 Binary files a/src/test/resources/test-applications/daytrader8/src/main/webapp/images/ticker-anim.gif and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/src/main/webapp/images/topRedBar.gif b/src/test/resources/test-applications/daytrader8/src/main/webapp/images/topRedBar.gif deleted file mode 100644 index 2198e7d6..00000000 Binary files a/src/test/resources/test-applications/daytrader8/src/main/webapp/images/topRedBar.gif and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/src/main/webapp/images/topline.jpg b/src/test/resources/test-applications/daytrader8/src/main/webapp/images/topline.jpg deleted file mode 100644 index d51fee32..00000000 Binary files a/src/test/resources/test-applications/daytrader8/src/main/webapp/images/topline.jpg and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/src/main/webapp/images/tradeOverview.png b/src/test/resources/test-applications/daytrader8/src/main/webapp/images/tradeOverview.png deleted file mode 100644 index f4215940..00000000 Binary files a/src/test/resources/test-applications/daytrader8/src/main/webapp/images/tradeOverview.png and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/src/main/webapp/images/tradingAndPortfolios.gif b/src/test/resources/test-applications/daytrader8/src/main/webapp/images/tradingAndPortfolios.gif deleted file mode 100644 index 85827ccc..00000000 Binary files a/src/test/resources/test-applications/daytrader8/src/main/webapp/images/tradingAndPortfolios.gif and /dev/null differ diff --git a/src/test/resources/test-applications/daytrader8/src/main/webapp/index.html b/src/test/resources/test-applications/daytrader8/src/main/webapp/index.html deleted file mode 100644 index 1b09bf01..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/webapp/index.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - -DayTrader - - - - - - - <BODY> - <P>Need browser which supports frames to see this page</P> - </BODY> - - - diff --git a/src/test/resources/test-applications/daytrader8/src/main/webapp/index.xhtml b/src/test/resources/test-applications/daytrader8/src/main/webapp/index.xhtml deleted file mode 100644 index e6cac242..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/webapp/index.xhtml +++ /dev/null @@ -1,93 +0,0 @@ - - - - - DayTrader - - - - -
    - - -
    -
    -

    Overview

    -
    -
    The Daytrader performance benchmark sample provides a suite of workloads for characterizing performance of Java EE - Application Servers. The workloads consist of an end to end web application and a full set of primitives. The applications are a collection of - Java classes, Java Servlets, JavaServer Pages, and Enterprise Java Beans built to open Java EE APIs. Together these provide versatile and - portable test cases designed to measure aspects of scalability and performance.
    -
    -

    - -
    - Daytrader J2EE Components -
    - Model-View-Controller architecture -

    -
    -
    -

    Daytrader

    - DayTrader is an end-to-end benchmark and performance sample application. It provides a real world Java EE workload. -
    -
    - DayTrader's new design spans Java EE 7, including the new WebSockets specification. Other Java EE features include JSPs, Servlets, EJBs, JPA, - JDBC, JSF, JMS, MDBs, and transactions (synchronous and asynchronous/2-phase commit). -
    -
    - -

    Primitives

    - The - primitives - provide a set of workloads to individually test various components of a Java EE application Server. The primitives leverage the Daytrader - application infrastructure to test specific Java EE components such as the servlet engine, JSP support, EJB Entitiy, Session and Message Driven - beans, HTTp Session support and more. -
    -
    -
    -
    - -
    - \ No newline at end of file diff --git a/src/test/resources/test-applications/daytrader8/src/main/webapp/leftMenu.html b/src/test/resources/test-applications/daytrader8/src/main/webapp/leftMenu.html deleted file mode 100644 index 1b930bc3..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/webapp/leftMenu.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - - -Leftmenu - - - - -
    -

    -
    -
    Overview
    -

    - -

    - Benchmarking -

    -

    - Configuration -

    -

    - Go Trade! -

    -

    - Web Primitives -

    -
    - - - diff --git a/src/test/resources/test-applications/daytrader8/src/main/webapp/marketSummary.html b/src/test/resources/test-applications/daytrader8/src/main/webapp/marketSummary.html deleted file mode 100644 index 34cdd340..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/webapp/marketSummary.html +++ /dev/null @@ -1,283 +0,0 @@ - - - - -Market Summary Web Socket - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Market Summary
    - DayTrader Stock Index(TSIA)
    Trading Volume
    Top Gainers - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    SymbolPriceChange
    -
    Top Losers - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    SymbolPriceChange
    -
    Recent Price Changes - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    SymbolPriceChange
    -
    - - \ No newline at end of file diff --git a/src/test/resources/test-applications/daytrader8/src/main/webapp/marketSummary.jsp b/src/test/resources/test-applications/daytrader8/src/main/webapp/marketSummary.jsp deleted file mode 100644 index 976164a2..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/webapp/marketSummary.jsp +++ /dev/null @@ -1,156 +0,0 @@ - - - - - -DayTrader Market Summary - - - - - <%@ page - import="java.util.Collection, - java.util.Iterator, - java.math.BigDecimal,com.ibm.websphere.samples.daytrader.entities.OrderDataBean,com.ibm.websphere.samples.daytrader.util.FinancialUtils" - session="true" isThreadSafe="true" isErrorPage="false"%> - - - - - - - - - - - - - - - - - - - - - - <% - Collection closedOrders = (Collection) request.getAttribute("closedOrders"); - if ((closedOrders != null) && (closedOrders.size() > 0)) { - %> - - - - - - - <% - } - %> - -
    DayTrader Market SummaryDayTrader
    HomeAccountMarket SummaryPortfolioQuotes/TradeLogoff
    -
    <%=new java.util.Date()%> -
    - Alert: The - following Order(s) have completed. -
    - - - <% - Iterator it = closedOrders.iterator(); - while (it.hasNext()) { - OrderDataBean closedOrderData = (OrderDataBean) it.next(); - %> - - - - - - - - - - - - - - - - - - - - - <% - } - %> - - -
    order - IDorder - statuscreation - datecompletion - datetxn - feetypesymbolquantity
    <%=closedOrderData.getOrderID()%><%=closedOrderData.getOrderStatus()%><%=closedOrderData.getOpenDate()%><%=closedOrderData.getCompletionDate()%><%=closedOrderData.getOrderFee()%><%=closedOrderData.getOrderType()%><%=FinancialUtils.printQuoteLink(closedOrderData.getSymbol())%><%=closedOrderData.getQuantity()%>
    -
    - - -
    - - - - - - - - - - - - - -
    -
    -
    - - - - - - - -
    Note: Click any symbol - for a quote or to trade. - -
    - - -
    -
    -
    DayTrader - Market SummaryDayTrader
    - - diff --git a/src/test/resources/test-applications/daytrader8/src/main/webapp/marketSummary.xhtml b/src/test/resources/test-applications/daytrader8/src/main/webapp/marketSummary.xhtml deleted file mode 100644 index aebae230..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/webapp/marketSummary.xhtml +++ /dev/null @@ -1,605 +0,0 @@ - - - - - DayTrader Market - - - - - - - - -
    - - - -
    - -
    - - - - - - - - - - -
    - - Alert: The following Order(s) have completed. - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - - - - - - - -
    -

    Market Summary

    -
    -
    -
    - - - - - - -
    - - - - - - - - - - - -
    - DayTrader Stock Index(TSIA) - -
    -
    - Trading Volume - -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - Recent Changes -
    - Symbol - - Price - - Change -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - Top Gainers -
    - Symbol - - Price - - Change -
    -
    -
    -
    -
    -
    - -
    -
    -
    -
    -
    -
    - -
    -
    -
    -
    -
    -
    - -
    -
    -
    -
    -
    -
    - -
    -
    -
    -
    -
    -
    - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - Top Losers -
    - Symbol - - Price - - Change -
    -
    -
    -
    -
    -
    - -
    -
    -
    -
    -
    -
    - -
    -
    -
    -
    -
    -
    - -
    -
    -
    -
    -
    -
    - -
    -
    -
    -
    -
    -
    - -
    -
    - - - - - - - - - - -
    -
    -
    - - - - - - - -
    - - - - -
    -
    -
    -
    -
    -
    - - -
    - \ No newline at end of file diff --git a/src/test/resources/test-applications/daytrader8/src/main/webapp/order.jsp b/src/test/resources/test-applications/daytrader8/src/main/webapp/order.jsp deleted file mode 100644 index fdb7fc99..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/webapp/order.jsp +++ /dev/null @@ -1,233 +0,0 @@ - - - - - -DayTrader Order information - - - - <%@ page - import="java.util.Collection, - java.util.Iterator,com.ibm.websphere.samples.daytrader.entities.OrderDataBean,com.ibm.websphere.samples.daytrader.util.FinancialUtils" - session="true" isThreadSafe="true" isErrorPage="false"%> - - - - - - - - - - - - - - - - - - - - - <% - Collection closedOrders = (Collection) request.getAttribute("closedOrders"); - if ((closedOrders != null) && (closedOrders.size() > 0)) { - %> - - - - - - - <% - } - %> - -
    DayTrader New OrdersDayTrader
    HomeAccountMarket SummaryPortfolioQuotes/TradeLogoff
    -
    <%=new java.util.Date()%> -
    - Alert: The - following Order(s) have completed. -
    - - - <% - Iterator it = closedOrders.iterator(); - while (it.hasNext()) { - OrderDataBean closedOrderData = (OrderDataBean) it.next(); - %> - - - - - - - - - - - - - - - - - - - - - <% - } - %> - - -
    order - IDorder - statuscreation - datecompletion - datetxn - feetypesymbolquantity
    <%=closedOrderData.getOrderID()%><%=closedOrderData.getOrderStatus()%><%=closedOrderData.getOpenDate()%><%=closedOrderData.getCompletionDate()%><%=closedOrderData.getOrderFee()%><%=closedOrderData.getOrderType()%><%=FinancialUtils.printQuoteLink(closedOrderData.getSymbol())%><%=closedOrderData.getQuantity()%>
    -
    - - - - - - -
    - - - - - - <% - OrderDataBean orderData = (OrderDataBean) request.getAttribute("orderData"); - if (orderData != null) { - %> - - - - - - - - - - <% - } - %> - -
    New - Order

    - Order <%=orderData.getOrderID()%>
    - to <%=orderData.getOrderType()%> - <%=orderData.getQuantity()%> - shares of <%=orderData.getSymbol()%> - has been submitted for - processing.


    - Order <%=orderData.getOrderID()%> - details: -
    - - - - - - - - - - - - - - - - - - - - - - - -
    order - IDorder - statuscreation - datecompletion - datetxn - feetypesymbolquantity
    <%= orderData.getOrderID()%><%= orderData.getOrderStatus()%><%= orderData.getOpenDate()%><%= orderData.getCompletionDate()%><%= orderData.getOrderFee()%><%= orderData.getOrderType()%><%= FinancialUtils.printQuoteLink(orderData.getSymbol()) %><%= orderData.getQuantity()%>
    -
    -
    - - - - - - - - - - - - - -
    -
    -
    - - - - - - - -
    Note: Click any symbol - for a quote or to trade. -
    - - -
    -
    DayTrader New OrdersDayTrader
    - - diff --git a/src/test/resources/test-applications/daytrader8/src/main/webapp/order.xhtml b/src/test/resources/test-applications/daytrader8/src/main/webapp/order.xhtml deleted file mode 100644 index 6d90cb98..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/webapp/order.xhtml +++ /dev/null @@ -1,308 +0,0 @@ - - - - - DayTrader Order - - - - - -
    - - - -
    - -
    - - - - - - - - - - -
    - - Alert: The following Order(s) have completed. - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - - - - - - -
    - - - - - - - - - - - - - - - - -
    - New Order -
    - - -
    - Order  - -
    -  to  - - -   - - -  shares of  - - symbol: - - -  has been submitted for processing. -
    -
    -
    - - Order  - - - - - - details: - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - order ID - - order status - - creation date - - completion date - - txn fee - - type - - symbol - - quantity -
    - - - - - - - - - - - - - - - -
    -
    -
    - - - - - - - - - -
    -
    -
    - - - - - - - -
    - - - - -
    -
    -
    -
    -
    -
    - - -
    - \ No newline at end of file diff --git a/src/test/resources/test-applications/daytrader8/src/main/webapp/orderImg.jsp b/src/test/resources/test-applications/daytrader8/src/main/webapp/orderImg.jsp deleted file mode 100644 index 3d105a49..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/webapp/orderImg.jsp +++ /dev/null @@ -1,248 +0,0 @@ - - - - - -DayTrader Order information - - - - - <%@ page - import="java.util.Collection, java.util.Iterator,com.ibm.websphere.samples.daytrader.entities.OrderDataBean,com.ibm.websphere.samples.daytrader.util.FinancialUtils" - session="true" isThreadSafe="true" isErrorPage="false"%> - - - - - - - - - - - - - - - - - - - - <% - Collection closedOrders = (Collection) request.getAttribute("closedOrders"); - if ((closedOrders != null) && (closedOrders.size() > 0)) { - %> - - - - - - - <% - } - %> - -
    DayTrader New Orders
    -

    <%=new java.util.Date()%>
    - Alert: The - following Order(s) have completed. -
    - - - <% - Iterator it = closedOrders.iterator(); - while (it.hasNext()) { - OrderDataBean closedOrderData = (OrderDataBean) it.next(); - %> - - - - - - - - - - - - - - - - - - - - - <% - } - %> - - -
    order - IDorder - statuscreation - datecompletion - datetxn - feetypesymbolquantity
    <%=closedOrderData.getOrderID()%><%=closedOrderData.getOrderStatus()%><%=closedOrderData.getOpenDate()%><%=closedOrderData.getCompletionDate()%><%=closedOrderData.getOrderFee()%><%=closedOrderData.getOrderType()%><%=FinancialUtils.printQuoteLink(closedOrderData.getSymbol())%><%=closedOrderData.getQuantity()%>
    -
    - - - - - - -
    - - - - - - <% - OrderDataBean orderData = (OrderDataBean) request.getAttribute("orderData"); - if (orderData != null) { - %> - - - - - - - - - - <% - } - %> - -
    New - Order

    - Order <%=orderData.getOrderID()%>
    - to <%=orderData.getOrderType()%> - <%=orderData.getQuantity()%> - shares of <%=orderData.getSymbol()%> - has been submitted for - processing.


    - Order <%=orderData.getOrderID()%> - details: -
    - - - - - - - - - - - - - - - - - - - - - - - -
    order - IDorder - statuscreation - datecompletion - datetxn - feetypesymbolquantity
    <%= orderData.getOrderID()%><%= orderData.getOrderStatus()%><%= orderData.getOpenDate()%><%= orderData.getCompletionDate()%><%= orderData.getOrderFee()%><%= orderData.getOrderType()%><%= FinancialUtils.printQuoteLink(orderData.getSymbol()) %><%= orderData.getQuantity()%>
    -
    -
    - - - - - - - - - - - - - -
    -
    -
    - - - - - - - -
    Note: Click any symbol - for a quote or to trade. -
    - - -
    -
    DayTrader New Orders
    - - diff --git a/src/test/resources/test-applications/daytrader8/src/main/webapp/portfolio.jsp b/src/test/resources/test-applications/daytrader8/src/main/webapp/portfolio.jsp deleted file mode 100644 index c1fb732a..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/webapp/portfolio.jsp +++ /dev/null @@ -1,284 +0,0 @@ - - - - - -DayTrader Portfolio - - - - - <%@ page - import="java.util.Collection, - java.util.Iterator, - java.util.HashMap, - java.math.BigDecimal,com.ibm.websphere.samples.daytrader.entities.HoldingDataBean,com.ibm.websphere.samples.daytrader.entities.OrderDataBean,com.ibm.websphere.samples.daytrader.entities.QuoteDataBean,com.ibm.websphere.samples.daytrader.util.Log,com.ibm.websphere.samples.daytrader.util.FinancialUtils" - session="true" isThreadSafe="true" isErrorPage="false"%> - - - - - - - - - - - - - - - - - - - - - - <% - Collection closedOrders = (Collection) request.getAttribute("closedOrders"); - if ((closedOrders != null) && (closedOrders.size() > 0)) { - %> - - - - - - - <% - } - %> - -
    DayTrader PortfolioDayTrader
    HomeAccountMarket SummaryPortfolioQuotes/TradeLogoff
    -
    <%=new java.util.Date()%> -
    - Alert: The - following Order(s) have completed. -
    - - - <% - Iterator it = closedOrders.iterator(); - while (it.hasNext()) { - OrderDataBean closedOrderData = (OrderDataBean) it.next(); - %> - - - - - - - - - - - - - - - - - - - - - <% - } - %> - - -
    order - IDorder - statuscreation - datecompletion - datetxn - feetypesymbolquantity
    <%=closedOrderData.getOrderID()%><%=closedOrderData.getOrderStatus()%><%=closedOrderData.getOpenDate()%><%=closedOrderData.getCompletionDate()%><%=closedOrderData.getOrderFee()%><%=closedOrderData.getOrderType()%><%=FinancialUtils.printQuoteLink(closedOrderData.getSymbol())%><%=closedOrderData.getQuantity()%>
    -
    - - - - - - -
    - - - - - - - - - - - - - - -
    Portfolio - Number - of Holdings: <%=holdingDataBeans.size()%>
    -
    - - - - - - - - - - - - - - - - <% - // Create Hashmap for quick lookup of quote values - Iterator it = quoteDataBeans.iterator(); - HashMap quoteMap = new HashMap(); - while (it.hasNext()) { - QuoteDataBean quoteData = (QuoteDataBean) it.next(); - quoteMap.put(quoteData.getSymbol(), quoteData); - } - //Step through and printout Holdings - - it = holdingDataBeans.iterator(); - BigDecimal totalGain = new BigDecimal(0.0); - BigDecimal totalBasis = new BigDecimal(0.0); - BigDecimal totalValue = new BigDecimal(0.0); - try { - while (it.hasNext()) { - HoldingDataBean holdingData = (HoldingDataBean) it.next(); - QuoteDataBean quoteData = (QuoteDataBean) quoteMap.get(holdingData.getQuoteID()); - BigDecimal basis = holdingData.getPurchasePrice().multiply(new BigDecimal(holdingData.getQuantity())); - BigDecimal marketValue = quoteData.getPrice().multiply(new BigDecimal(holdingData.getQuantity())); - totalBasis = totalBasis.add(basis); - totalValue = totalValue.add(marketValue); - BigDecimal gain = marketValue.subtract(basis); - totalGain = totalGain.add(gain); - BigDecimal gainPercent = null; - if (basis.doubleValue() == 0.0) { - gainPercent = new BigDecimal(0.0); - Log.error("portfolio.jsp: Holding with zero basis. holdingID=" + holdingData.getHoldingID() + " symbol=" + holdingData.getQuoteID() - + " purchasePrice=" + holdingData.getPurchasePrice()); - } else - gainPercent = marketValue.divide(basis, BigDecimal.ROUND_HALF_UP).subtract(new BigDecimal(1.0)).multiply(new BigDecimal(100.0)); - %> - - - - - - - - - - - - - <% - } - } catch (Exception e) { - Log.error("portfolio.jsp: error displaying user holdings", e); - } - %> - - - - - - - - - - - - -
    - Portfolio -
    holding - IDpurchase - datesymbolquantitypurchase - pricecurrent - pricepurchase - basismarket - valuegain/(loss)trade
    <%=holdingData.getHoldingID()%><%=holdingData.getPurchaseDate()%><%=FinancialUtils.printQuoteLink(holdingData.getQuoteID())%><%=holdingData.getQuantity()%><%=holdingData.getPurchasePrice()%><%=quoteData.getPrice()%><%=basis%><%=marketValue%><%=FinancialUtils.printGainHTML(gain)%><%="sell"%>
    Total$ - <%=totalBasis%>$ - <%=totalValue%>$ <%=FinancialUtils.printGainHTML(totalGain)%> - <%=FinancialUtils.printGainPercentHTML(FinancialUtils.computeGainPercent(totalValue, totalBasis))%>
    -
    -
    -
    - - - - - - - - - - - - - -
    -
    -
    - - - - - - - -
    Note: Click any symbol - for a quote or to trade. -
    - - -
    -
    DayTrader - PortfolioDayTrader
    - - diff --git a/src/test/resources/test-applications/daytrader8/src/main/webapp/portfolio.xhtml b/src/test/resources/test-applications/daytrader8/src/main/webapp/portfolio.xhtml deleted file mode 100644 index 8af86c77..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/webapp/portfolio.xhtml +++ /dev/null @@ -1,340 +0,0 @@ - - - - - DayTrader Portfolio - - - - - -
    - - - -
    - -
    - - - - - - - - - - -
    - - Alert: The following Order(s) have completed. - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - - - - - - - - - - - - - - - -
    - Portfolio - Number of Holdings:
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - - -
    - - - - - - - - - - - -
    Total purchase basisTotal market valueTotal gain/loss
    - $ - - - $ - - - $ - - -
    -
    -
    - - - - - - - - - - -
    -
    -
    - - - - - - - -
    - - - - -
    -
    -
    -
    -
    -
    - - -
    - \ No newline at end of file diff --git a/src/test/resources/test-applications/daytrader8/src/main/webapp/portfolioImg.jsp b/src/test/resources/test-applications/daytrader8/src/main/webapp/portfolioImg.jsp deleted file mode 100644 index 062418bf..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/webapp/portfolioImg.jsp +++ /dev/null @@ -1,296 +0,0 @@ - - - - - -DayTrader Portfolio - - - - - <%@ page - import="java.util.Collection, - java.util.Iterator, - java.util.HashMap, - java.math.BigDecimal,com.ibm.websphere.samples.daytrader.entities.HoldingDataBean,com.ibm.websphere.samples.daytrader.entities.OrderDataBean,com.ibm.websphere.samples.daytrader.entities.QuoteDataBean,com.ibm.websphere.samples.daytrader.util.Log,com.ibm.websphere.samples.daytrader.util.FinancialUtils" - session="true" isThreadSafe="true" isErrorPage="false"%> - - - - - - - - - - - - - - - - - - - - - <% - Collection closedOrders = (Collection) request.getAttribute("closedOrders"); - if ((closedOrders != null) && (closedOrders.size() > 0)) { - %> - - - - - - - <% - } - %> - -
    DayTrader PortfolioDayTrader

    <%=new java.util.Date()%>
    - Alert: The - following Order(s) have completed. -
    - - - <% - Iterator it = closedOrders.iterator(); - while (it.hasNext()) { - OrderDataBean closedOrderData = (OrderDataBean) it.next(); - %> - - - - - - - - - - - - - - - - - - - - - <% - } - %> - - -
    order - IDorder - statuscreation - datecompletion - datetxn - feetypesymbolquantity
    <%=closedOrderData.getOrderID()%><%=closedOrderData.getOrderStatus()%><%=closedOrderData.getOpenDate()%><%=closedOrderData.getCompletionDate()%><%=closedOrderData.getOrderFee()%><%=closedOrderData.getOrderType()%><%=FinancialUtils.printQuoteLink(closedOrderData.getSymbol())%><%=closedOrderData.getQuantity()%>
    -
    - - - - - - -
    - - - - - - - - - - - - - - -
    Portfolio - Number - of Holdings: <%=holdingDataBeans.size()%>
    -
    - - - - - - - - - - - - - - - - <% - // Create Hashmap for quick lookup of quote values - Iterator it = quoteDataBeans.iterator(); - HashMap quoteMap = new HashMap(); - while (it.hasNext()) { - QuoteDataBean quoteData = (QuoteDataBean) it.next(); - quoteMap.put(quoteData.getSymbol(), quoteData); - } - //Step through and printout Holdings - - it = holdingDataBeans.iterator(); - BigDecimal totalGain = new BigDecimal(0.0); - BigDecimal totalBasis = new BigDecimal(0.0); - BigDecimal totalValue = new BigDecimal(0.0); - try { - while (it.hasNext()) { - HoldingDataBean holdingData = (HoldingDataBean) it.next(); - QuoteDataBean quoteData = (QuoteDataBean) quoteMap.get(holdingData.getQuoteID()); - BigDecimal basis = holdingData.getPurchasePrice().multiply(new BigDecimal(holdingData.getQuantity())); - BigDecimal marketValue = quoteData.getPrice().multiply(new BigDecimal(holdingData.getQuantity())); - totalBasis = totalBasis.add(basis); - totalValue = totalValue.add(marketValue); - BigDecimal gain = marketValue.subtract(basis); - totalGain = totalGain.add(gain); - BigDecimal gainPercent = null; - if (basis.doubleValue() == 0.0) { - gainPercent = new BigDecimal(0.0); - Log.error("portfolio.jsp: Holding with zero basis. holdingID=" + holdingData.getHoldingID() + " symbol=" + holdingData.getQuoteID() - + " purchasePrice=" + holdingData.getPurchasePrice()); - } else - gainPercent = marketValue.divide(basis, BigDecimal.ROUND_HALF_UP).subtract(new BigDecimal(1.0)).multiply(new BigDecimal(100.0)); - %> - - - - - - - - - - - - - <% - } - } catch (Exception e) { - Log.error("portfolio.jsp: error displaying user holdings", e); - } - %> - - - - - - - - - - - - -
    - Portfolio -
    holding - IDpurchase - datesymbolquantitypurchase - pricecurrent - pricepurchase - basismarket - valuegain/(loss)trade
    <%=holdingData.getHoldingID()%><%=holdingData.getPurchaseDate()%><%=FinancialUtils.printQuoteLink(holdingData.getQuoteID())%><%=holdingData.getQuantity()%><%=holdingData.getPurchasePrice()%><%=quoteData.getPrice()%><%=basis%><%=marketValue%><%=FinancialUtils.printGainHTML(gain)%><%="sell"%>
    Total$<%=totalBasis%>$<%=totalValue%>$<%=FinancialUtils.printGainHTML(totalGain)%> - <%=FinancialUtils.printGainPercentHTML(FinancialUtils.computeGainPercent(totalValue, totalBasis))%>
    -
    -
    -
    - - - - - - - - - - - - - -
    -
    -
    - - - - - - - -
    Note: Click any symbol - for a quote or to trade. - -
    - - -
    -
    -
    DayTrader PortfolioDayTrader
    - - diff --git a/src/test/resources/test-applications/daytrader8/src/main/webapp/properties/daytrader.properties b/src/test/resources/test-applications/daytrader8/src/main/webapp/properties/daytrader.properties deleted file mode 100644 index 1f2ebeb2..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/webapp/properties/daytrader.properties +++ /dev/null @@ -1,24 +0,0 @@ - # (C) Copyright IBM Corporation 2015. - # - # Licensed under the Apache License, Version 2.0 (the "License"); - # you may not use this file except in compliance with the License. - # You may obtain a copy of the License at - # - # http://www.apache.org/licenses/LICENSE-2.0 - # - # Unless required by applicable law or agreed to in writing, software - # distributed under the License is distributed on an "AS IS" BASIS, - # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - # See the License for the specific language governing permissions and - # limitations under the License. -runtimeMode=0 -orderProcessingMode=0 -maxUsers=15000 -maxQuotes=10000 -publishQuotePriceChange=true -listQuotePriceChangeFrequency=100 -displayOrderAlerts=true -webInterface=0 -marketSummaryInterval=20 -primIterations=1 -longRun=true diff --git a/src/test/resources/test-applications/daytrader8/src/main/webapp/quote.jsp b/src/test/resources/test-applications/daytrader8/src/main/webapp/quote.jsp deleted file mode 100644 index e4972624..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/webapp/quote.jsp +++ /dev/null @@ -1,234 +0,0 @@ - - - - - -DayTrader: Quotes and Trading - - - - - - <%@ page - import="java.util.Collection,java.math.BigDecimal,com.ibm.websphere.samples.daytrader.entities.QuoteDataBean,com.ibm.websphere.samples.daytrader.util.Log, - java.util.Iterator,com.ibm.websphere.samples.daytrader.entities.OrderDataBean,com.ibm.websphere.samples.daytrader.util.FinancialUtils" - session="true" isThreadSafe="true" isErrorPage="false"%> - - - - - - - - - - - - - - - - - - - - - <% - Collection closedOrders = (Collection) request.getAttribute("closedOrders"); - if ((closedOrders != null) && (closedOrders.size() > 0)) { - %> - - - - - - - <% - } - %> - -
    DayTrader QuotesDayTrader
    HomeAccountMarket SummaryPortfolioQuotes/TradeLogoff
    -
    <%=new java.util.Date()%> -
    - Alert: The - following Order(s) have completed. -
    - - - <% - Iterator it = closedOrders.iterator(); - while (it.hasNext()) { - OrderDataBean closedOrderData = (OrderDataBean) it.next(); - %> - - - - - - - - - - - - - - - - - - - - - <% - } - %> - - -
    order - IDorder - statuscreation - datecompletion - datetxn - feetypesymbolquantity
    <%=closedOrderData.getOrderID()%><%=closedOrderData.getOrderStatus()%><%=closedOrderData.getOpenDate()%><%=closedOrderData.getCompletionDate()%><%=closedOrderData.getOrderFee()%><%=closedOrderData.getOrderType()%><%=FinancialUtils.printQuoteLink(closedOrderData.getSymbol())%><%=closedOrderData.getQuantity()%>
    -
    - - - - - - -
    - - - - - - - - - - - - -
    Quotes
    - - - - - - - - - - - - - <% - // Create Hashmap for quick lookup of quote values - Iterator it = quoteDataBeans.iterator(); - while (it.hasNext()) { - try { - QuoteDataBean quoteData = (QuoteDataBean) it.next(); - %> - - - - - - - - - - - -<% - } catch (Exception e) { - Log.error("displayQuote.jsp exception. Check that symbol: exists in the database.", e); - } -%> - - - <% - } - %> - -
    symbolcompanyvolumeprice - rangeopen - pricecurrent - pricegain/(loss)trade
    <%=FinancialUtils.printQuoteLink(quoteData.getSymbol())%><%=quoteData.getCompanyName()%><%=quoteData.getVolume()%><%=quoteData.getLow() + " - " + quoteData.getHigh()%><%=quoteData.getOpen()%>$ <%=quoteData.getPrice()%><%=FinancialUtils.printGainHTML(new BigDecimal(quoteData.getChange()))%> - <%=FinancialUtils.printGainPercentHTML(FinancialUtils.computeGainPercent(quoteData.getPrice(), quoteData.getOpen()))%> -
    - - - -
    -
    -
    -
    - - - - - - - - - - - - - -
    -
    -
    - - - - - - - -
    Note: Click any symbol - for a quote or to trade. -
    - - -
    -
    DayTrader - QuotesDayTrader
    - - diff --git a/src/test/resources/test-applications/daytrader8/src/main/webapp/quote.xhtml b/src/test/resources/test-applications/daytrader8/src/main/webapp/quote.xhtml deleted file mode 100644 index b4822706..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/webapp/quote.xhtml +++ /dev/null @@ -1,291 +0,0 @@ - - - - - DayTrader Quotes - - - - - -
    - - - -
    - -
    - - - - - - - - - - -
    - - Alert: The following Order(s) have completed. - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - - - - - - -
    - - - - - - - - - -
    - Quotes -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - -
    - - - - - - - - - - - - -
    -
    -
    - - - - - - - - - -
    -
    -
    - - - - - - - -
    - - - - -
    -
    -
    -
    -
    -
    - - -
    - \ No newline at end of file diff --git a/src/test/resources/test-applications/daytrader8/src/main/webapp/quoteDataPrimitive.jsp b/src/test/resources/test-applications/daytrader8/src/main/webapp/quoteDataPrimitive.jsp deleted file mode 100644 index 4b6a8f8f..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/webapp/quoteDataPrimitive.jsp +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - -Quote Data Primitive (PingServet2Session2Entity2JSP) - - - <%@ page - import="com.ibm.websphere.samples.daytrader.entities.QuoteDataBean,com.ibm.websphere.samples.daytrader.util.FinancialUtils" - session="false" isThreadSafe="true" isErrorPage="false"%> - <%!int hitCount = 0; - String initTime = new java.util.Date().toString();%> - <% - QuoteDataBean quoteData = (QuoteDataBean) request.getAttribute("quoteData"); - %> -
    -
    - Quote Data Primitive - (PingServlet2Session2EntityJSP):
    -
    - Init time: <%=initTime%> - <% - hitCount++; - %> -

    - Hit Count: <%=hitCount%> -

    -
    - Quote Information -
    -
    <%=quoteData.toHTML()%> - - diff --git a/src/test/resources/test-applications/daytrader8/src/main/webapp/quoteImg.jsp b/src/test/resources/test-applications/daytrader8/src/main/webapp/quoteImg.jsp deleted file mode 100644 index 9ae34c54..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/webapp/quoteImg.jsp +++ /dev/null @@ -1,255 +0,0 @@ - - - - - -DayTrader: Quotes and Trading - - - - - - <%@ page - import="java.util.Collection,java.math.BigDecimal,com.ibm.websphere.samples.daytrader.util.Log, - java.util.Iterator,com.ibm.websphere.samples.daytrader.entities.OrderDataBean,com.ibm.websphere.samples.daytrader.entities.QuoteDataBean,com.ibm.websphere.samples.daytrader.util.FinancialUtils" - session="true" isThreadSafe="true" isErrorPage="false"%> - - - - - - - - - - - - - - - - - - - - <% - Collection closedOrders = (Collection) request.getAttribute("closedOrders"); - if ((closedOrders != null) && (closedOrders.size() > 0)) { - %> - - - - - - - <% - } - %> - -
    DayTrader QuotesDayTrader

    <%=new java.util.Date()%>
    - Alert: The - following Order(s) have completed. -
    - - - <% - Iterator it = closedOrders.iterator(); - while (it.hasNext()) { - OrderDataBean closedOrderData = (OrderDataBean) it.next(); - %> - - - - - - - - - - - - - - - - - - - - - <% - } - %> - - -
    order - IDorder - statuscreation - datecompletion - datetxn - feetypesymbolquantity
    <%=closedOrderData.getOrderID()%><%=closedOrderData.getOrderStatus()%><%=closedOrderData.getOpenDate()%><%=closedOrderData.getCompletionDate()%><%=closedOrderData.getOrderFee()%><%=closedOrderData.getOrderType()%><%=FinancialUtils.printQuoteLink(closedOrderData.getSymbol())%><%=closedOrderData.getQuantity()%>
    -
    - - - - - - -
    - - - - - - - - - - - - -
    Quotes
    - - - - - - - - - - - - - - <% - // Create Hashmap for quick lookup of quote values - Iterator it = quoteDataBeans.iterator(); - while (it.hasNext()) { - try { - QuoteDataBean quoteData = (QuoteDataBean) it.next(); - %> - - - - - - - - - - - -<% - } catch (Exception e) { - Log.error("displayQuote.jsp exception. Check that symbol: exists in the database.", e); - } -%> - - - <% - } - %> - -
    symbolcompanyvolumeprice - rangeopen - pricecurrent - pricegain/(loss)trade
    <%=FinancialUtils.printQuoteLink(quoteData.getSymbol())%><%=quoteData.getCompanyName()%><%=quoteData.getVolume()%><%=quoteData.getLow() + " - " + quoteData.getHigh()%><%=quoteData.getOpen()%>$ <%=quoteData.getPrice()%><%=FinancialUtils.printGainHTML(new BigDecimal(quoteData.getChange()))%> - <%=FinancialUtils.printGainPercentHTML(FinancialUtils.computeGainPercent(quoteData.getPrice(), quoteData.getOpen()))%> -
    - - - -
    -
    -
    -
    - - - - - - - - - - - - - - - - -
    -
    -
    - - - - - - - -
    Note: Click any symbol - for a quote or to trade. - -
    - - -
    -
    -
    DayTrader QuotesDayTrader
    -
    - - diff --git a/src/test/resources/test-applications/daytrader8/src/main/webapp/quotes.html b/src/test/resources/test-applications/daytrader8/src/main/webapp/quotes.html deleted file mode 100644 index a69d6f6c..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/webapp/quotes.html +++ /dev/null @@ -1,158 +0,0 @@ - - - - - - - - - - - - - - - - - - - -
    -
    -
    - -
    - -
    - - - -
    - - - - - - - - - - - - - -

    Get Quotes

    symbol(s):
    -
    -
    -
    - - - - - - - - - - -
    Recent Price Changes
    Recent Price Changes - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    SymbolPriceChange
    -
    -
    - -
    -
    - -

     

    diff --git a/src/test/resources/test-applications/daytrader8/src/main/webapp/register.jsp b/src/test/resources/test-applications/daytrader8/src/main/webapp/register.jsp deleted file mode 100644 index d97eae03..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/webapp/register.jsp +++ /dev/null @@ -1,169 +0,0 @@ - - - - -DayTrader Registration - - - - <%@ page session="false"%> - <% - String blank = ""; - String fakeCC = "123-fake-ccnum-456"; - String fullname = request.getParameter("Full Name"); - String snailmail = request.getParameter("snail mail"); - String email = request.getParameter("email"); - String userID = request.getParameter("user id"); - String money = request.getParameter("money"); - String creditcard = request.getParameter("Credit Card Number"); - String results = (String) request.getAttribute("results"); - %> - - - - - - - -
    DayTrader - RegisterDayTrader
    - - - - - - - - -
    <%=results == null ? blank : results%>
    - - - - - - - -
    Register -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    *Full name:
    *Address:
    *E-Mail address:
      
    *User ID:
    *Password:
    *Confirm password:
      
    *Opening account - balance:$
    *Credit card number:  
    - -
    - - - - - - - - - - - - - -
    -
    -
    DayTrader - RegisterDayTrader
    - - diff --git a/src/test/resources/test-applications/daytrader8/src/main/webapp/register.xhtml b/src/test/resources/test-applications/daytrader8/src/main/webapp/register.xhtml deleted file mode 100644 index 868b249c..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/webapp/register.xhtml +++ /dev/null @@ -1,205 +0,0 @@ - - - - - DayTrader Register - - - - -
    - - -
    - -
    - - - - - - - - - -
    - - - -
    - - - - - - -
    -

    Register

    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - * - Full name: - - - - -
    - * - Address: - - - - -
    - * - E-Mail address: - - - - -
      
    - * - User ID: - - - - -
    - - * - Password: - - - - - -
    - - * - Confirm password: - - - - - -
      
    - * - Opening account balance: - - - - -
    - - * - Credit card number: - - - - - -
    - -
    -
    -
    -
    -
    - -
    - \ No newline at end of file diff --git a/src/test/resources/test-applications/daytrader8/src/main/webapp/registerImg.jsp b/src/test/resources/test-applications/daytrader8/src/main/webapp/registerImg.jsp deleted file mode 100644 index 6b41d064..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/webapp/registerImg.jsp +++ /dev/null @@ -1,172 +0,0 @@ - - - - -DayTrader Registration - - - - <%@ page session="false"%> - <% - String blank = ""; - String fakeCC = "123-fake-ccnum-456"; - String fullname = request.getParameter("Full Name"); - String snailmail = request.getParameter("snail mail"); - String email = request.getParameter("email"); - String userID = request.getParameter("user id"); - String money = request.getParameter("money"); - String creditcard = request.getParameter("Credit Card Number"); - String results = (String) request.getAttribute("results"); - %> - - - - - - - -
    DayTrader - Register
    - - - - - - - - -
    <%=results == null ? blank : results%>
    - - - - - - - -
    Register -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    *Full name:
    *Address:
    *E-Mail address:
      
    *User ID:
    *Password:
    *Confirm password:
      
    *Opening account - balance:$
    *Credit card number:  
    - -
    - - - - - - - - - - - - - -
    -
    -
    DayTrader - HomeDayTrader
    - - diff --git a/src/test/resources/test-applications/daytrader8/src/main/webapp/runStats.jsp b/src/test/resources/test-applications/daytrader8/src/main/webapp/runStats.jsp deleted file mode 100644 index f196a6db..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/webapp/runStats.jsp +++ /dev/null @@ -1,445 +0,0 @@ - - - - - -Welcome to Trade - - - <%@ page - import="com.ibm.websphere.samples.daytrader.util.TradeConfig" - session="false" isThreadSafe="true" isErrorPage="false"%> - - - <% - double loginPercentage = (double) ((TradeConfig.getScenarioMixes())[0][TradeConfig.LOGOUT_OP]) / 100.0; - double logoutPercentage = (double) ((TradeConfig.getScenarioMixes())[0][TradeConfig.LOGOUT_OP]) / 100.0; - double buyOrderPercentage = (double) ((TradeConfig.getScenarioMixes())[0][TradeConfig.BUY_OP]) / 100.0; - double sellOrderPercentage = (double) ((TradeConfig.getScenarioMixes())[0][TradeConfig.SELL_OP]) / 100.0; - double orderPercentage = buyOrderPercentage + sellOrderPercentage; - double registerPercentage = (double) ((TradeConfig.getScenarioMixes())[0][TradeConfig.REGISTER_OP]) / 100.0; - - int logins = runStatsData.getSumLoginCount() - runStatsData.getTradeUserCount(); //account for each user being logged in up front - if (logins < 0) - logins = 0; //no requests before reset - //double expectedRequests = ((double) logins) / loginPercentage; - double expectedRequests = (double) TradeConfig.getScenarioCount(); - TradeConfig.setScenarioCount(0); - - int verifyPercent = TradeConfig.verifyPercent; - %> - <%!// verifies 2 values are w/in tradeConfig.verifyPercent percent - String verify(double expected, double actual, int verifyPercent) { - String retVal = ""; - if ((expected == 0.0) || (actual == 0.0)) - return "N/A"; - double check = (actual / expected) * 100 - 100; - //PASS - retVal += check + "% "; - if ((check >= (-1.0 * verifyPercent)) && (check <= verifyPercent)) - retVal += " Pass"; - else - retVal += " Fail4"; - if (check > 0.0) - retVal = "+" + retVal; - //System.out.println("verify --- expected="+expected+" actual="+actual+ " check="+check); - return retVal; - } - - String verify(int expected, int actual, int verifyPercent) { - return verify((double) expected, (double) actual, verifyPercent); - }%> -
    - - - - - - - - -
    DayTrader Scenario - Runtime StatisticsDayTrader
    - - - - - - - - -
    <% - String status; - status = (String) request.getAttribute("status"); - if (status != null) - out.print(status); - %> - Modify - runtime configuration
    -
    - - - - - - -
    - - - - - - - - - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - Benchmark - scenario statistics -
    Benchmark - runtime - configuration - summaryValue -
    Run-Time - Mode<%=(TradeConfig.getRunTimeModeNames())[TradeConfig.getRunTimeMode()]%>
    Order-Processing - Mode<%=(TradeConfig.getOrderProcessingModeNames())[TradeConfig.getOrderProcessingMode()]%>
    Web - Interface<%=(TradeConfig.getWebInterfaceNames())[TradeConfig.getWebInterface()]%>
    Active - Traders / Trade - User population<%=runStatsData.getTradeUserCount()%> - / <%=TradeConfig.getMAX_USERS()%> -
    Active - Stocks / Trade - Stock population<%=TradeConfig.getMAX_QUOTES()%> - / <%=runStatsData.getTradeStockCount()%>
    Benchmark - scenario - verification
    Run - StatisticScenario - verification - testExpected - ValueActual - ValuePass/Fail
    Active StocksActive stocks - should generally - equal the db - population of stocks<%=runStatsData.getTradeStockCount()%><%=TradeConfig.getMAX_QUOTES()%><%=(runStatsData.getTradeStockCount() == TradeConfig.getMAX_QUOTES()) ? "Pass" : "Warn"%>
    Active - TradersActive traders - should generally - equal the db - population of - traders<%=runStatsData.getTradeUserCount()%><%=TradeConfig.getMAX_USERS()%><%=(runStatsData.getTradeUserCount() == TradeConfig.getMAX_USERS()) ? "Pass" : "Warn"%>
    Estimated - total requestsActual - benchmark scenario - requests should be - within +/- 2% of the - estimated number of - requests in the last - benchmark run to - pass.<%=expectedRequests%>see2see2
    New - Users Registered - <%=registerPercentage * 100%>% - of expected requests - (<%=registerPercentage%> - * <%=expectedRequests%> - )<%=registerPercentage * expectedRequests%><%=runStatsData.getNewUserCount()%><%=verify(registerPercentage * expectedRequests, (double) runStatsData.getNewUserCount(), verifyPercent)%>
    Logins - <%=loginPercentage * 100%>% - of expected requests - (<%=loginPercentage%> - * <%=expectedRequests%> - ) + initial login<%=loginPercentage * expectedRequests + runStatsData.getTradeUserCount()%><%=runStatsData.getSumLoginCount() + runStatsData.getTradeUserCount()%><%=verify((double) loginPercentage * expectedRequests, (double) runStatsData.getSumLoginCount(), verifyPercent)%>
    Logouts - #logouts must - be >= - #logins-active - traders ( <%=runStatsData.getSumLoginCount()%> - - <%=TradeConfig.getMAX_USERS()%> - ) - <%=runStatsData.getSumLoginCount() - TradeConfig.getMAX_USERS()%><%=runStatsData.getSumLogoutCount()%><%=(runStatsData.getSumLogoutCount() >= (runStatsData.getSumLoginCount() - TradeConfig.getMAX_USERS())) ? "Pass" : "Fail4"%> -
    User - Holdings Trade users own - an average of 5 - holdings, 5* total - Users = ( 5 * <%=runStatsData.getTradeUserCount()%>) - <%=5 * runStatsData.getTradeUserCount()%><%=runStatsData.getHoldingCount()%><%=verify(5 * runStatsData.getTradeUserCount(), runStatsData.getHoldingCount(), verifyPercent)%>
    Buy - Order Count <%=buyOrderPercentage * 100%>% - of expected requests - (<%=buyOrderPercentage%> - * <%=expectedRequests%> - ) + current holdings - count<%=buyOrderPercentage * expectedRequests + runStatsData.getHoldingCount()%><%=runStatsData.getBuyOrderCount()%><%=verify(buyOrderPercentage * expectedRequests + runStatsData.getHoldingCount(), (double) runStatsData.getBuyOrderCount(), verifyPercent)%>
    Sell - Order Count <%=sellOrderPercentage * 100%>% - of expected requests - (<%=sellOrderPercentage%> - * <%=expectedRequests%> - )<%=sellOrderPercentage * expectedRequests%><%=runStatsData.getSellOrderCount()%><%=verify(sellOrderPercentage * expectedRequests, (double) runStatsData.getSellOrderCount(), verifyPercent)%>
    Total - Order Count <%=orderPercentage * 100%>% - of expected requests - (<%=orderPercentage%> - * <%=expectedRequests%> - ) + current holdings - count<%=orderPercentage * expectedRequests + runStatsData.getHoldingCount()%><%=runStatsData.getOrderCount()%><%=verify(orderPercentage * expectedRequests + runStatsData.getHoldingCount(), (double) runStatsData.getOrderCount(), verifyPercent)%>
    Open - Orders All orders - should be completed - before reset3 - 0<%=runStatsData.getOpenOrderCount()%><%=(runStatsData.getOpenOrderCount() > 0) ? "Fail4" : "Pass"%>
    Cancelled - Orders Orders are - cancelled if an - error is encountered - during order - processing.0<%=runStatsData.getCancelledOrderCount()%><%=(runStatsData.getCancelledOrderCount() > 0) ? "Fail4" : "Pass"%>
    Orders - remaining after - reset After Trade - reset, each user - should carry an - average of 5 orders - in the database. 5* - total Users = (5 * <%=runStatsData.getTradeUserCount()%>) - <%=5 * runStatsData.getTradeUserCount()%><%=runStatsData.getOrderCount() - runStatsData.getDeletedOrderCount()%><%=verify(5 * runStatsData.getTradeUserCount(), runStatsData.getOrderCount() - runStatsData.getDeletedOrderCount(), verifyPercent)%>
    -
    -
    -
    -
    -
      -
    1. - Benchmark verification - tests require a Trade - Reset between each - benchmark run.
    2. -
    3. The - expected value of - benchmark requests is - computed based on the - the count from the Web - application since the - last Trade reset.The - actual value of - benchmark request - requires user - verification and may be - incorrect for a cluster.
    4. -
    5. Orders - are processed - asynchronously in Trade. - Therefore, processing - may continue beyond the - end of a benchmark run. - Trade Reset should not - be invoked until - processing is completed.
    6. -
    7. Actual - values must be within - <%=TradeConfig.verifyPercent%>% - of - corresponding estimated - values to pass - verification.
    8. -
    -
    -
    -
    - - - - - - - - - - - - - - - - - -
    -
    -
    DayTrader Scenario - Runtime StatisticsDayTrader
    -
    - - diff --git a/src/test/resources/test-applications/daytrader8/src/main/webapp/sample.jsp b/src/test/resources/test-applications/daytrader8/src/main/webapp/sample.jsp deleted file mode 100644 index 487f6fa7..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/webapp/sample.jsp +++ /dev/null @@ -1,26 +0,0 @@ - -<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> -<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%> -<%@ taglib prefix="x" uri="http://java.sun.com/jsp/jstl/xml"%> -<%@ taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql"%> - - - - Hello world JSP on - - - diff --git a/src/test/resources/test-applications/daytrader8/src/main/webapp/style-jsf.css b/src/test/resources/test-applications/daytrader8/src/main/webapp/style-jsf.css deleted file mode 100644 index 6381df0c..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/webapp/style-jsf.css +++ /dev/null @@ -1,253 +0,0 @@ -/* - * (C) Copyright IBM Corporation 2015. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -* { - margin: 0; -} - -html { - height: 100%; -} - -#page-wrap { - min-height: 100%; - /* equal to footer height */ - margin-bottom: -31px; -} - -#page-wrap:after { - content: ""; - display: block; - height: 31px; -} - -body { - height: 100%; - margin: 0; - background-color: #ccc -} - -#content { - width: 700px; - margin: 0 auto; - padding-top: 95px; - padding-bottom: 31px; - font-size: 13px; -} - -#header { - width: 100%; - background-color: #FFFFFF; - position: fixed; -} - -#nav { - width: 100%; - float: left; - margin: 0; - padding: 0 0; - background: url(images/nav_bg.png) repeat-x; -} - -#nav ul { - list-style: none; - width: 450px; - margin: 0 auto; - padding: 0; - height: 31px; - line-height: 31px; -} - -#nav li { - float: left; -} - -#nav li a { - display: block; - width: 90px; - text-align: center; - vertical-align: middle; - font-size: 13px; - padding: 0 0; - text-decoration: none; - font-weight: bold; - color: white; -} - -#nav li a:hover { - text-decoration: underline; -} - -#nav2 { - width: 100%; - float: left; - margin: 0; - padding: 0 0; - background: url(images/nav_bg.png) repeat-x; -} - -#nav2 ul { - list-style: none; - width: 540px; - margin: 0 auto; - padding: 0; - height: 31px; - line-height: 31px; -} - -#nav2 li { - float: left; -} - -#nav2 li a { - display: block; - width: 90px; - text-align: center; - vertical-align: middle; - font-size: 13px; - padding: 0 0; - text-decoration: none; - font-weight: bold; - color: white; -} - -#nav2 li a:hover { - text-decoration: underline; -} - -#footer { - position: absolute; - height: 31px; - line-height: 31px; - vertical-align: middle; - width: 100%; - background: url(images/nav_bg.png) repeat-x; - margin: 0; - color: white; - text-align: center; - font-size: 13px; -} - -#contentContainer { - margin-top: 10px; - border: 1px solid #000; - -moz-border-radius: 5px; - -webkit-border-radius: 5px; - border-radius: 5px; - width: 700px; - margin-left: auto; - margin-right: auto; - padding: 10px; - background-color: #eee; - font-size: 14px; - text-decoration: none; -} - -#contentContainer a { - text-decoration: none; - color: #333333; -} - -#loginContainer { - margin-top: 10px; - border: 1px solid #000; - -moz-border-radius: 5px; - -webkit-border-radius: 5px; - border-radius: 5px; - width: 400px; - margin-left: auto; - margin-right: auto; - padding: 10px; - background-color: #eee; - font-size: 14px; - text-decoration: none; -} - -#loginContainer a { - text-decoration: none; - color: #333333; -} - -input.rounded { - border: 1px solid #ccc; - -moz-border-radius: 5px; - -webkit-border-radius: 5px; - border-radius: 5px; - font-size: 13px; - padding: 4px 4px; - outline: 0; - -webkit-appearance: none; # - margin-bottom: 20px; -} - -input.submit { - border: 1px solid #ccc; - -moz-border-radius: 5px; - -webkit-border-radius: 5px; - border-radius: 5px; - font-size: 13px; - padding: 4px 4px; - outline: 1; - -webkit-appearance: none; # - margin-bottom: 20px; - background-color: #0066CC; - color: white; -} - -.table { - border-collapse: collapse; - border: 1px solid #000000; -} - -.tableHeader { - text-align: center; - background: none repeat scroll 0 0 #B5B5B5; - border: 1px solid #000000; - padding: 2px; - font-size: 12px; -} - -.tableHeaderMarket { - text-align: center; - background: none repeat scroll 0 0 #000000; - border: 1px solid #000000; - padding: 10px; - font-size: 14px; -} - -.tableOddRow { - text-align: center; - font-size: 12px; - font-weight: none; - border: 1px solid #000000; - background: none repeat scroll 0 0 #FFFFFF; - padding: 2px; -} - -.tableEvenRow { - text-align: center; - font-size: 12px; - font-weight: none; - border: 1px solid #000000; - background: none repeat scroll 0 0 #fafcb6; - padding: 2px; -} - -.tableColumn { - border: 1px solid #000000; - padding: 2px; -} \ No newline at end of file diff --git a/src/test/resources/test-applications/daytrader8/src/main/webapp/style.css b/src/test/resources/test-applications/daytrader8/src/main/webapp/style.css deleted file mode 100644 index 3d92fcde..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/webapp/style.css +++ /dev/null @@ -1,82 +0,0 @@ -/*====================================================================== - * (C) Copyright IBM Corporation 2015. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. -======================================================================*/ -tr th td body { - font-size:12pt; -} - -A:HOVER { - text-decoration: underline; color: red; -} - -A:ACTIVE { - color: red; - font-weight: bold -} - -.table{ - border-collapse:collapse; - border:1px solid #000000; -} - -.tableHeader{ - text-align:center; - background:none repeat scroll 0 0 #B5B5B5; - border:1px solid #000000; - padding:10px; - font-size:12px; -} - -.tableHeaderMarket{ - text-align:center; - background:none repeat scroll 0 0 #000000; - border:1px solid #000000; - padding:10px; - font-size:14px; -} - -.tableOddRow{ - text-align:center; - font-size:12px; - font-weight: none; - border:1px solid #000000; - background:none repeat scroll 0 0 #FFFFFF; -} - -.tableEvenRow{ - text-align:center; - font-size:12px; - font-weight: none; - border:1px solid #000000; - background:none repeat scroll 0 0 #D3D3D3; -} -.tableColumn{ - border:1px solid #000000; -} - -.tableHeader -{ - background:none repeat scroll 0 0 #FFFFFF; - border-collapse: collapse; - border-spacing: 0px; -} -.tableHeader td -{ - padding: 0px 0px; -} -.tableHeader tr -{ - padding: 0px 0px; -} \ No newline at end of file diff --git a/src/test/resources/test-applications/daytrader8/src/main/webapp/tradehome.jsp b/src/test/resources/test-applications/daytrader8/src/main/webapp/tradehome.jsp deleted file mode 100644 index aead7aae..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/webapp/tradehome.jsp +++ /dev/null @@ -1,251 +0,0 @@ - - - - - -Welcome to DayTrader - - - - - <%@ page - import="java.util.Collection, - java.util.Iterator, - java.math.BigDecimal,com.ibm.websphere.samples.daytrader.entities.OrderDataBean,com.ibm.websphere.samples.daytrader.util.FinancialUtils" - session="true" isThreadSafe="true" isErrorPage="false"%> - - - - - - - - - - - - - - - - - - - - - - - <% - Collection closedOrders = (Collection) request.getAttribute("closedOrders"); - if ((closedOrders != null) && (closedOrders.size() > 0)) { - %> - - - - - - - <% - } - %> - -
    DayTrader HomeDayTrader
    HomeAccountMarket SummaryPortfolioQuotes/TradeLogoff
    -
    <%=new java.util.Date()%> -
    - Alert: The - following Order(s) have completed. -
    - - - <% - Iterator it = closedOrders.iterator(); - while (it.hasNext()) { - OrderDataBean closedOrderData = (OrderDataBean) it.next(); - %> - - - - - - - - - - - - - - - - - - - - - <% - } - %> - - -
    order - IDorder - statuscreation - datecompletion - datetxn - feetypesymbolquantity
    <%=closedOrderData.getOrderID()%><%=closedOrderData.getOrderStatus()%><%=closedOrderData.getOpenDate()%><%=closedOrderData.getCompletionDate()%><%=closedOrderData.getOrderFee()%><%=closedOrderData.getOrderType()%><%=FinancialUtils.printQuoteLink(closedOrderData.getSymbol())%><%=closedOrderData.getQuantity()%>
    -
    - - - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Welcome -  <%=accountData.getProfileID()%>, -
    User - Statistics
    account - ID:
    -
    account - created:
    total - logins:
    session - created:
    <%=accountData.getAccountID()%>
    - <%=accountData.getCreationDate()%>
    - <%=accountData.getLoginCount()%>
    - <%=(java.util.Date) session.getAttribute("sessionCreationDate")%>
    Account - Summary
    cash - balance:
    number - of holdings:
    total - of holdings:
    sum of - cash/holdings
    opening - balance:
    -
    -
    - <% - BigDecimal openBalance = accountData.getOpenBalance(); - BigDecimal balance = accountData.getBalance(); - BigDecimal holdingsTotal = FinancialUtils.computeHoldingsTotal(holdingDataBeans); - BigDecimal sumOfCashHoldings = balance.add(holdingsTotal); - BigDecimal gain = FinancialUtils.computeGain(sumOfCashHoldings, openBalance); - BigDecimal gainPercent = FinancialUtils.computeGainPercent(sumOfCashHoldings, openBalance); - %>$ <%=balance%>
    <%=holdingDataBeans.size()%>
    - $ <%=holdingsTotal%>
    $ <%=sumOfCashHoldings%>
    - $ <%=openBalance%>
    - -
    -
    current - gain/(loss):$ <%=FinancialUtils.printGainHTML(gain)%> - <%=FinancialUtils.printGainPercentHTML(gainPercent)%>
    -

    -
    - - - - - - - - - - - - - -
    -
    -
    - - - - - - - -
    Note: Click any symbol - for a quote or to trade. - -
    - - -
    -
    -
    DayTrader - HomeDayTrader
    - - diff --git a/src/test/resources/test-applications/daytrader8/src/main/webapp/tradehome.xhtml b/src/test/resources/test-applications/daytrader8/src/main/webapp/tradehome.xhtml deleted file mode 100644 index 23ed8ed2..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/webapp/tradehome.xhtml +++ /dev/null @@ -1,283 +0,0 @@ - - - - - DayTrader Home - - - - - -
    - - - -
    - -
    - - -

    - Welcome  - -

    - - - - - - - - - -
    - - Alert: The following Order(s) have completed. - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -

    User Statistics

    -
    - account ID: -
    - account created: -
    - total logins: -
    - session created: -
    -
    - -
    - -
    - -
    - -
    -
    -

    Account Summary

    -
    - cash balance: -
    - number of holdings: -
    - total of holdings: -
    - sum of cash/holdings -
    - opening balance: -
    -
    -
    - $  - -
    - -
    - $  - -
    - $  - -
    - $  - -
    -
    -
    - current gain/(loss): - - $ - - -   - - -
    - - - - - - - - - - -
    -
    -
    - - - - - - - -
    - - - - -
    -
    -
    -
    -
    -
    - - -
    - \ No newline at end of file diff --git a/src/test/resources/test-applications/daytrader8/src/main/webapp/tradehomeImg.jsp b/src/test/resources/test-applications/daytrader8/src/main/webapp/tradehomeImg.jsp deleted file mode 100644 index 3d7a2990..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/webapp/tradehomeImg.jsp +++ /dev/null @@ -1,267 +0,0 @@ - - - - - -Welcome to DayTrader - - - - - <%@ page - import="java.util.Collection, - java.util.Iterator, - java.math.BigDecimal,com.ibm.websphere.samples.daytrader.entities.AccountDataBean,com.ibm.websphere.samples.daytrader.entities.OrderDataBean,com.ibm.websphere.samples.daytrader.util.FinancialUtils" - session="true" isThreadSafe="true" isErrorPage="false"%> - - - - - - - - - - - - - - - - - - - - - - <% - Collection closedOrders = (Collection) request.getAttribute("closedOrders"); - if ((closedOrders != null) && (closedOrders.size() > 0)) { - %> - - - - - - - <% - } - %> - -
    DayTrader HomeDayTrader

    <%=new java.util.Date()%>
    - Alert: The - following Order(s) have completed. -
    - - - <% - Iterator it = closedOrders.iterator(); - while (it.hasNext()) { - OrderDataBean closedOrderData = (OrderDataBean) it.next(); - %> - - - - - - - - - - - - - - - - - - - - - <% - } - %> - - -
    order - IDorder - statuscreation - datecompletion - datetxn - feetypesymbolquantity
    <%=closedOrderData.getOrderID()%><%=closedOrderData.getOrderStatus()%><%=closedOrderData.getOpenDate()%><%=closedOrderData.getCompletionDate()%><%=closedOrderData.getOrderFee()%><%=closedOrderData.getOrderType()%><%=FinancialUtils.printQuoteLink(closedOrderData.getSymbol())%><%=closedOrderData.getQuantity()%>
    -
    - - - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Welcome -  <%=accountData.getProfileID()%>, -
    User - Statistics
    account - ID:
    -
    account - created:
    total - logins:
    session - created:
    <%=accountData.getAccountID()%>
    - <%=accountData.getCreationDate()%>
    - <%=accountData.getLoginCount()%>
    - <%=(java.util.Date) session.getAttribute("sessionCreationDate")%>
    Account - Summary
    cash - balance:
    number - of holdings:
    total - of holdings:
    sum of - cash/holdings
    opening - balance:
    -
    -
    - <% - BigDecimal openBalance = accountData.getOpenBalance(); - BigDecimal balance = accountData.getBalance(); - BigDecimal holdingsTotal = FinancialUtils.computeHoldingsTotal(holdingDataBeans); - BigDecimal sumOfCashHoldings = balance.add(holdingsTotal); - BigDecimal gain = FinancialUtils.computeGain(sumOfCashHoldings, openBalance); - BigDecimal gainPercent = FinancialUtils.computeGainPercent(sumOfCashHoldings, openBalance); - %>$<%=balance%>
    <%=holdingDataBeans.size()%>
    - $<%=holdingsTotal%>
    $<%=sumOfCashHoldings%>
    - $<%=openBalance%>
    - -
    -
    current - gain/(loss):$ <%=FinancialUtils.printGainHTML(gain)%> - <%=FinancialUtils.printGainPercentHTML(gainPercent)%>
    -

    - - - - - - - - - - - - - - - - -
    - - - - - - - -
    Note: Click any symbol - for a quote or to trade. - -
    - - -
    -
    -
    DayTrader HomeDayTrader
    - - diff --git a/src/test/resources/test-applications/daytrader8/src/main/webapp/web_prmtv.html b/src/test/resources/test-applications/daytrader8/src/main/webapp/web_prmtv.html deleted file mode 100644 index fa2b5837..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/webapp/web_prmtv.html +++ /dev/null @@ -1,449 +0,0 @@ - - - - - - -Web Primitives - - - - -
    - - - - - - - -
    -

    Web and EJB Primitive Tests

    -
    -
    - - - - - - - - - - - -
    Primitive Test Suite
    -

    The DayTrader performance benchmark sample - provides a suite of web primitives. These - primitives singularly test key operations in the - enterprise Java programming model. Links to each - of the web primitive tests are provided below - along with a description of each operation.

    -

    - Note that some primitives below can have their - main operations repeated. These operations are - marked with a red *. - In order to adjust the repetition, change the - primitive iteration value in the Trade - configuration page. -

    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Web Container ping suite
    PingHtmlPingHtml is the most - basic operation providing access to a simple - "Hello World" page of static HTML.
    Explicit GCInvoke Garbage - Collection on AppServer. Reports heap statistics - after the GC has completed.
    PingServletPingServlet tests - fundamental dynamic HTML creation through server - side servlet processing.
    PingServletCDIPingServletCDI tests various simple CDI invocations.
    PingServletCDIBeanManagerViaJNDIPingServletCDIBeanManagerViaJNDI tests getting the BeanManager with JNDI.
    PingServletCDIBeanManagerViaCDICurrentPingServletCDIBeanManagerViaCDICurrent tests getting the BeanManager with the CDI spi.
    PingServletWriter - PingServletWriter - extends PingServlet by using a PrintWriter for - formatted output vs. the output stream used by - PingServlet.
    PingServlet2Include*PingServlet2Include - tests response inclusion. Servlet 1 includes the - response of Servlet 2.
    PingServlet2ServletPingServlet2Servlet - tests request dispatching. Servlet 1, the - controller, creates a new JavaBean object - forwards the request with the JavaBean added to - Servlet 2. Servlet 2 obtains access to the - JavaBean through the Servlet request object and - provides dynamic HTML output based on the - JavaBean data.
    PingJSPPingJSP tests a direct - call to JavaServer Page providing server-side - dynamic HTML through JSP scripting.
    PingJSPELPingJSPEL tests a direct - call to JavaServer Page providing server-side - dynamic HTML through JSP scripting and the usage - of the new JSP 2.0 Expression Language.
    PingServlet2JSPPingServlet2JSP tests a - commonly used design pattern, where a request is - issued to servlet providing server side control - processing. The servlet creates a JavaBean - object with dynamically set attributes and - forwards the bean to the JSP through a - RequestDispatcher The JSP obtains access to the - JavaBean and provides formatted display with - dynamic HTML output based on the JavaBean data.
    PingServlet2PDFPingServlet2PDF tests a - call to a servlet which displays the contents of - a PDF Document (~1 MB in file size).
    PingServlet2DBPingServlet2DB tests a - call to a servlet which makes a JDBC connection - to the database.
    PingJSFPingJSF tests a - call to a JSF Facelet which performs a lookup - of quotes.
    PingCDIJSFPingCDIJSF tests a MangedBean called from a jsf page.
    PingHTTPSession1 - PingHTTPSession1 - SessionID - tests fundamental HTTP session function by - creating a unique session ID for each individual - user. The ID is stored in the users session and - is accessed and displayed on each user request. -
    PingHTTPSession2PingHTTPSession2 session - create/destroy further extends the previous - test by invalidating the HTTP Session on every - 5th user access. This results in testing - HTTPSession create and destroy -
    PingHTTPSession3PingHTTPSession3 large - session object tests the servers ability to - manage and persist large HTTPSession data - objects. The servlet creates a large custom java - object. The class contains multiple data fields - and results in 2048 bytes of data. This large - session object is retrieved and stored to the - session on each user request. -
    PingJDBCRead*PingJDBCRead tests - fundamental servlet to JDBC access to a database - performing a single-row read using a prepared - SQL statment.
    PingJDBCRead2JSP*PingJDBCRead2JSP tests - fundamental servlet to JDBC access to a database - performing a single-row read using a prepared - SQL statment, then displays the output in a JSP.
    PingJDBCWrite*PingJDBCRead tests - fundamental servlet to JDBC access to a database - performing a single-row write using a prepared - SQL statment.
    PingServlet2JNDI*PingServlet2JNDI tests - the fundamental J2EE operation of a servlet - allocating a JNDI context and performing a JNDI - lookup of a JDBC DataSource.
    PingUpgradeServletPingUpgradeServlet tests a simple UpgradeHandler request. JMeter is needed for testing.
    PingWebSocketTextSyncPingWebSocketTextSync tests a simple synchronous WebSocket with text.
    PingWebSocketTextAsyncPingWebSocketTextAsync tests a simple asynchronous WebSocket with text.
    PingWebSocketBinaryPingWebSocketBinary tests a simple WebSocket with binary data.
    PingWebSocketJsonPingWebSocketJson tests a WebSocket with a JSON Decoder and Encoder.
    PingManagedThreadPingManagedThread tests a ManagedThreadFactory inside an asynchronous servlet.
    PingManagedExecutorPingManagedExecutor tests the ManagedExecutorService inside an asynchronous servlet.
    - - PingJSONP - - - PingJSONP tests generating and parsing JSON. -
    EJB 3 Container ping - suite
    PingServlet2Session*PingServlet2Session - tests key function of a servlet call to a remote - stateless Session EJB. The Session EJB performs - a simple calculation and returns the result
    PingServlet2Entity*
    PingServlet2Entity tests key function of a - servlet call to an EJB 3.0 Container Managed Entity. In this test the - EJB entity represents a single row in the database table.
    PingServlet2Session2Entity*This tests the full - servlet to Session EJB to Entity EJB path to - retrieve a single row from the database.
    PingServlet2Session2Entity2JSP*This tests the full - servlet to Session EJB to Entity EJB path to - retrieve a single row from the database and - displays the output in a JSP.
    PingServlet2Session2
    - EntityCollection -
    *
    This test extends the - previous EJB Entity test by calling a Session - EJB which uses a finder method on the Entity - that returns a collection of Entity objects. - Each object is displayed by the servlet.
    PingServlet2Session2CMROne2One*This test drives an - Entity EJB to get another Entity EJB's data - through an EJB 3.0 CMR One to One relationship.
    PingServlet2Session2CMROne2Many*This test drives an - Entity EJB to get another Entity EJB's data - through an EJB 3.0 CMR One to Many relationship.
    PingServlet2MDBQueue*PingServlet2MDBQueue - drives messages to a Queue based Message Driven - EJB (MDB). Each request to the servlet posts a - message to the Queue. The MDB receives the - message asynchronously and prints message - delivery statistics on each 100th message. Note: Not intended - for performance testing. - -
    PingServlet2MDBTopic*PingServlet2MDBTopic - drives messages to a Topic based - Publish/Subscribe Message Driven EJB (MDB). Each - request to the servlet posts a message to the - Topic. The TradeStreamMDB receives the message - asynchronously and prints message delivery - statistics on each 100th message. Other - subscribers to the Topic will also receive the - messages. Note: - Not intended for performance testing. -
    PingServlet2TwoPhase*PingServlet2TwoPhase - drives a Session EJB which invokes an Entity EJB - with findByPrimaryKey (DB Access) followed by - posting a message to an MDB through a JMS Queue - (Message access). These operations are wrapped - in a global 2-phase transaction and commit.
    - - diff --git a/src/test/resources/test-applications/daytrader8/src/main/webapp/web_prmtv.xhtml b/src/test/resources/test-applications/daytrader8/src/main/webapp/web_prmtv.xhtml deleted file mode 100644 index 3cfda53c..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/webapp/web_prmtv.xhtml +++ /dev/null @@ -1,584 +0,0 @@ - - - - - DayTrader Primitives - - - - -
    - - -
    - -
    - - - - - - - -
    -

    Web Primitive Tests

    -
    - - - - - - - - - - -
    - - Primitive Test Suite - -
    -

    The DayTrader performance benchmark sample provides a suite of web primitives. These primitives singularly test key operations in the - enterprise Java programming model. Links to each of the web primitive tests are provided below along with a description of each operation.

    -

    - Note that some primitives below can have their main operations repeated. These operations are marked with a red - * - . In order to adjust the repetition, change the primitive iteration value in the Trade configuration page. - -

    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - Web Container ping suite - -
    - - - PingHtml - - - - PingHtml is the most basic operation providing access to a simple "Hello World" page of static HTML. -
    - - - Explicit GC - - - - Invoke Garbage Collection on AppServer. Reports heap statistics after the GC has completed. -
    - - - PingServlet - - - - PingServlet tests fundamental dynamic HTML creation through server side servlet processing. -
    PingServletCDIPingServletCDI tests - various simple CDI invocations.
    PingServletCDIBeanManagerViaJNDIPingServletCDIBeanManagerViaJNDI tests getting the BeanManager with JNDI.
    PingServletCDIBeanManagerViaCDICurrentIPingServletCDIBeanManagerViaCDICurrent tests getting the BeanManager with SPI.
    - - - PingServletWriter - - - - PingServletWriter extends PingServlet by using a PrintWriter for formatted output vs. the output stream used by - PingServlet. -
    - - - PingServlet2Include - - - * - - PingServlet2Include tests response inclusion. Servlet 1 includes the response of Servlet 2. -
    - - - PingServlet2Servlet - - - - PingServlet2Servlet tests request dispatching. Servlet 1, the controller, creates a new JavaBean object forwards the - request with the JavaBean added to Servlet 2. Servlet 2 obtains access to the JavaBean through the Servlet request object and provides - dynamic HTML output based on the JavaBean data. -
    - - PingJSP - - - PingJSP tests a direct call to JavaServer Page providing server-side dynamic HTML through JSP scripting. -
    - - PingJSPEL - - - PingJSPEL tests a direct call to JavaServer Page providing server-side dynamic HTML through JSP scripting and the usage - of the new JSP 2.0 Expression Language. -
    - - PingServlet2JSP - - - PingServlet2JSP tests a commonly used design pattern, where a request is issued to servlet providing server side - control processing. The servlet creates a JavaBean object with dynamically set attributes and forwards the bean to the JSP through a - RequestDispatcher The JSP obtains access to the JavaBean and provides formatted display with dynamic HTML output based on the JavaBean data. -
    - - PingServlet2PDF - - - PingServlet2PDF tests a call to a servlet which displays the contents of a PDF Document (~1 MB in file size). -
    - - PingServlet2DB - - - PingServlet2DB tests a call to a servlet which makes a JDBC connection to the database. -
    - - PingJSF - - - PingJSF tests a call to a JSF Facelet which performs a lookup of quotes. -
    PingCDIJSFPingCDIJSF tests a MangedBean called from a jsf page.
    - - PingHTTPSession1 - - - - PingHTTPSession1 - - SessionID - tests fundamental HTTP session function by creating a unique session ID for each individual user. The ID is stored in the users session and - is accessed and displayed on each user request. - -
    - - PingHTTPSession2 - - - - PingHTTPSession2 - session create/destroy - further extends the previous test by invalidating the HTTP Session on every 5th user access. This results in testing HTTPSession create and - destroy - -
    - - PingHTTPSession3 - - - - PingHTTPSession3 - large session object - tests the servers ability to manage and persist large HTTPSession data objects. The servlet creates a large custom java object. The class - contains multiple data fields and results in 2048 bytes of data. This large session object is retrieved and stored to the session on each - user request. - -
    - - PingJDBCRead - - * - - PingJDBCRead tests fundamental servlet to JDBC access to a database performing a single-row read using a prepared SQL - statment. -
    - - PingJDBCWrite - - * - - PingJDBCRead tests fundamental servlet to JDBC access to a database performing a single-row write using a prepared SQL - statment. -
    - - PingServlet2JNDI - - * - - PingServlet2JNDI tests the fundamental J2EE operation of a servlet allocating a JNDI context and performing a JNDI - lookup of a JDBC DataSource. -
    PingUpgradeServletPingUpgradeServlet tests a simple UpgradeHandler request. JMeter is needed for testing.
    PingWebSocketTextSyncPingWebSocketTextSync tests a simple synchronous WebSocket with text.
    PingWebSocketTextAsyncPingWebSocketTextAsync tests a simple asynchronous WebSocket with text.
    PingWebSocketBinaryPingWebSocketBinary tests a simple WebSocket with binary data.
    PingWebSocketJsonPingWebSocketJson tests a WebSocket with a JSON Decoder and Encoder.
    - - PingManagedThread - - - - PingManagedThread tests a ManagedThreadFactory inside an asynchronous servlet. -
    - - PingManagedExecutor - - - - PingManagedExecutor tests the ManagedExecutorService inside an asynchronous servlet. -
    - - PingJSONP - - - - PingJSONP tests generating and parsing JSON. -
    - - EJB 3 Container ping suite - -
    - - PingServlet2Session - - * - - PingServlet2Session tests key function of a servlet call to a remote stateless Session EJB. The Session EJB performs a - simple calculation and returns the result -
    - - PingServlet2SessionLocal - - * - - PingServlet2SessionLocal tests key function of a servlet call to a local stateless Session EJB. The Session EJB - performs a simple calculation and returns the result -
    - - PingServlet2Session2Entity - - * - - This tests the full servlet to Session EJB to Entity EJB path to retrieve a single row from the database. -
    - - PingServlet2Session2Entity2JSP - - * - - This tests the full servlet to Session EJB to Entity EJB path to retrieve a single row from the database and displays - the output in a JSP. -
    - - - PingServlet2Session2 -
    - EntityCollection -
    -
    - * -
    - This test extends the previous EJB Entity test by calling a Session EJB which uses a finder method on the Entity that - returns a collection of Entity objects. Each object is displayed by the servlet. -
    - - PingServlet2Session2CMROne2One - - * - - This test drives an Entity EJB to get another Entity EJB's data through an EJB 3.0 CMR One to One relationship. -
    - - PingServlet2Session2CMROne2Many - - * - - This test drives an Entity EJB to get another Entity EJB's data through an EJB 3.0 CMR One to Many relationship. -
    - - PingServlet2Session2JDBC - - * - - This tests the full servlet to Session EJB to JDBC path to retrieve a single row from the database. -
    - - - PingServlet2Session2 -
    - JDBCCollection -
    -
    - * -
    - This test extends the previous JDBC test by calling a Session EJB to JDBC path which returns multiple rows from the - database. -
    - - PingServlet2MDBQueue - - * - - - PingServlet2MDBQueue drives messages to a Queue based Message Driven EJB (MDB). Each request to the servlet posts a message to the Queue. The - MDB receives the message asynchronously and prints message delivery statistics on each 100th message. - - Note: - Not intended for performance testing. - - -
    - - PingServlet2MDBTopic - - * - - - PingServlet2MDBTopic drives messages to a Topic based Publish/Subscribe Message Driven EJB (MDB). Each request to the servlet posts a message - to the Topic. The TradeStreamMDB receives the message asynchronously and prints message delivery statistics on each 100th message. Other - subscribers to the Topic will also receive the messages. - - Note: - Not intended for performance testing. - - -
    - - PingServlet2TwoPhase - - * - - PingServlet2TwoPhase drives a Session EJB which invokes an Entity EJB with findByPrimaryKey (DB Access) followed by - posting a message to an MDB through a JMS Queue (Message access). These operations are wrapped in a global 2-phase transaction and commit. -
    -
    -
    -
    - -
    - \ No newline at end of file diff --git a/src/test/resources/test-applications/daytrader8/src/main/webapp/welcome.jsp b/src/test/resources/test-applications/daytrader8/src/main/webapp/welcome.jsp deleted file mode 100644 index f2fc601c..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/webapp/welcome.jsp +++ /dev/null @@ -1,133 +0,0 @@ - - - - -DayTrader Login - - - - - <%@ page session="false"%> - - - - - - - -
    DayTrader - LoginDayTrader
    - - - - - - - - -
    - <% - String results; - results = (String) request.getAttribute("results"); - if (results != null) - out.print(results); - %> -
    -
    - - - - - - - - - - - - - -
    Log in -
    Username -              -     Password       -               -               -    
    -
    -       -     -
    -
    - - - - - - - - - - - - - - - - - - - - -
    -
    -
    First - time user?  Please Register
    -
    - Register With DayTrader -
    -
    -
    -
    - - - - - - - - - - - - - -
    -
    -
    DayTrader - LoginDayTrader
    - - diff --git a/src/test/resources/test-applications/daytrader8/src/main/webapp/welcome.xhtml b/src/test/resources/test-applications/daytrader8/src/main/webapp/welcome.xhtml deleted file mode 100644 index e0577f55..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/webapp/welcome.xhtml +++ /dev/null @@ -1,93 +0,0 @@ - - - - - DayTrader Login - - - - -
    - -
    - -
    - - - - - - - -
    - -
    -

    Log in to DayTrader

    -
    Username -
    - - - - -
    -
    Password -
    - - - -
    -
    - - -
    -
    Don't have an account?
    - Register With DayTrader -
    -
    -
    -
    - -
    - \ No newline at end of file diff --git a/src/test/resources/test-applications/daytrader8/src/main/webapp/welcomeImg.jsp b/src/test/resources/test-applications/daytrader8/src/main/webapp/welcomeImg.jsp deleted file mode 100644 index 252a22e6..00000000 --- a/src/test/resources/test-applications/daytrader8/src/main/webapp/welcomeImg.jsp +++ /dev/null @@ -1,132 +0,0 @@ - - - - -DayTrader Login - - - - - <%@ page session="false"%> - - - - - - - -
    DayTrader LoginDayTrader
    - - - - - - - - - -
    - <% - String results; - results = (String) request.getAttribute("results"); - if (results != null) - out.print(results); - %> -
    -
    - - - - - - - - - - - - - -
    Log in -
    Username -              -     Password       -               -               -    
    -
    -       -     -
    -
    - - - - - - - - - - - - - - - - - - - - -
    -
    -
    First - time user?  Please Register
    -
    - Register With DayTrader -
    -
    -
    -
    - - - - - - - - - - -

    DayTrader - LoginDayTrader
    - - diff --git a/src/test/resources/test-applications/daytrader8/zos_db2_files/RUNSTAT.JCL b/src/test/resources/test-applications/daytrader8/zos_db2_files/RUNSTAT.JCL deleted file mode 100644 index 07579d73..00000000 --- a/src/test/resources/test-applications/daytrader8/zos_db2_files/RUNSTAT.JCL +++ /dev/null @@ -1,23 +0,0 @@ -//TDRUNSTA JOB MSGCLASS=H,MSGLEVEL=(1,1),REGION=0M,NOTIFY=&SYSUID. -//* ----------------------- // -//* DB2V11.JUN2915.SDSNEXIT -//* RUNSTATS -//* -//STEP1 EXEC PGM=DSNUTILB,PARM='DB94,STAA1',DYNAMNBR=25 -//STEPLIB DD DISP=SHR,DSN=DB2V11.JUN2915.SDSNEXIT -//SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,(600,50)) -//SORTWK01 DD UNIT=SYSDA,SPACE=(CYL,(600,50)) -//SORTWK02 DD UNIT=SYSDA,SPACE=(CYL,(600,50)) -//SORTWK03 DD UNIT=SYSDA,SPACE=(CYL,(600,50)) -//SORTWK04 DD UNIT=SYSDA,SPACE=(CYL,(600,50)) -//SYSREC DD UNIT=SYSDA,SPACE=(CYL,(599,49)) -//SYSPRINT DD SYSOUT=* -//UTPRINT DD SYSOUT=* -//SYSUDUMP DD SYSOUT=* -//SYSIN DD * - RUNSTATS TABLESPACE TRADE.TRADETS1 INDEX ALL TABLE ALL REPORT YES - RUNSTATS TABLESPACE TRADE.TRADETS2 INDEX ALL TABLE ALL REPORT YES - RUNSTATS TABLESPACE TRADE.TRADETS3 INDEX ALL TABLE ALL REPORT YES - RUNSTATS TABLESPACE TRADE.TRADETS4 INDEX ALL TABLE ALL REPORT YES - RUNSTATS TABLESPACE TRADE.TRADETS5 INDEX ALL TABLE ALL REPORT YES - RUNSTATS TABLESPACE TRADE.TRADETS6 INDEX ALL TABLE ALL REPORT YES diff --git a/src/test/resources/test-applications/daytrader8/zos_db2_files/dbbind.jcl b/src/test/resources/test-applications/daytrader8/zos_db2_files/dbbind.jcl deleted file mode 100644 index 261cabed..00000000 --- a/src/test/resources/test-applications/daytrader8/zos_db2_files/dbbind.jcl +++ /dev/null @@ -1,42 +0,0 @@ -//DBINDS20 JOB MSGCLASS=H,NOTIFY=&SYSUID.,REGION=0M -//*********************************************************************/00010000 -//* JOB NAME = DSNTIJSG */00020000 -//* */00030000 -//* DESCRIPTIVE NAME = INSTALLATION JOB STREAM */00040000 -//* */00050000 -//*********************************************************************/00290000 -//JOBLIB DD DISP=SHR, 00300000 -// DSN=DB211.D121916.SDSNLOAD 00310000 -//* 00430000 -//DSNTIRU EXEC PGM=IKJEFT01,DYNAMNBR=20 00440000 -//SYSTSPRT DD SYSOUT=* 00450000 -//SYSPRINT DD SYSOUT=* 00460000 -//SYSUDUMP DD SYSOUT=* 00470000 -//SYSTSIN DD * 00480000 - DSN SYSTEM(DB90) 00490000 - REBIND PACKAGE(NULLID.SYSLH100) ISOLATION(CS) CURRENTDATA (NO) 00728260 - REBIND PACKAGE(NULLID.SYSLH200) CURRENTDATA(NO) ISOLATION(CS) 00728260 - REBIND PACKAGE(NULLID.SYSLH300) CURRENTDATA(NO) ISOLATION(CS) 00728260 - REBIND PACKAGE(NULLID.SYSLH400) CURRENTDATA(NO) ISOLATION(CS) 00728260 - REBIND PACKAGE(NULLID.SYSLN100) CURRENTDATA(NO) ISOLATION(CS) 00728260 - REBIND PACKAGE(NULLID.SYSLN200) CURRENTDATA(NO) ISOLATION(CS) 00728260 - REBIND PACKAGE(NULLID.SYSLN300) CURRENTDATA(NO) ISOLATION(CS) 00728260 - REBIND PACKAGE(NULLID.SYSLN400) CURRENTDATA(NO) ISOLATION(CS) 00728260 - REBIND PACKAGE(NULLID.SYSLH101) CURRENTDATA(NO) ISOLATION(CS) 00728260 - REBIND PACKAGE(NULLID.SYSLH201) CURRENTDATA(NO) ISOLATION(CS) 00728260 - REBIND PACKAGE(NULLID.SYSLH301) CURRENTDATA(NO) ISOLATION(CS) 00728260 - REBIND PACKAGE(NULLID.SYSLH401) CURRENTDATA(NO) ISOLATION(CS) 00728260 - REBIND PACKAGE(NULLID.SYSLN101) CURRENTDATA(NO) ISOLATION(CS) 00728260 - REBIND PACKAGE(NULLID.SYSLN201) CURRENTDATA(NO) ISOLATION(CS) 00728260 - REBIND PACKAGE(NULLID.SYSLN301) CURRENTDATA(NO) ISOLATION(CS) 00728260 - REBIND PACKAGE(NULLID.SYSLN401) CURRENTDATA(NO) ISOLATION(CS) 00728260 - REBIND PACKAGE(NULLID.SYSLH102) CURRENTDATA(NO) ISOLATION(CS) 00728260 - REBIND PACKAGE(NULLID.SYSLH202) CURRENTDATA(NO) ISOLATION(CS) 00728260 - REBIND PACKAGE(NULLID.SYSLH302) CURRENTDATA(NO) ISOLATION(CS) 00728260 - REBIND PACKAGE(NULLID.SYSLH402) CURRENTDATA(NO) ISOLATION(CS) 00728260 - REBIND PACKAGE(NULLID.SYSLN102) CURRENTDATA(NO) ISOLATION(CS) 00728260 - REBIND PACKAGE(NULLID.SYSLN202) CURRENTDATA(NO) ISOLATION(CS) 00728260 - REBIND PACKAGE(NULLID.SYSLN302) CURRENTDATA(NO) ISOLATION(CS) 00728260 - REBIND PACKAGE(NULLID.SYSLN402) CURRENTDATA(NO) ISOLATION(CS) 00728260 - REBIND PACKAGE(NULLID.SYSSTAT) CURRENTDATA(NO) ISOLATION(CS) 00728260 - END 00728840 diff --git a/src/test/resources/test-applications/daytrader8/zos_db2_files/dbtable.jcl b/src/test/resources/test-applications/daytrader8/zos_db2_files/dbtable.jcl deleted file mode 100644 index 5398fa74..00000000 --- a/src/test/resources/test-applications/daytrader8/zos_db2_files/dbtable.jcl +++ /dev/null @@ -1,255 +0,0 @@ -//TDBIGS10 JOB MSGCLASS=H,MSGLEVEL=(1,1),NOTIFY=&SYSUID -//STEP01 EXEC PGM=IKJEFT01,DYNAMNBR=20 -//STEPLIB DD DSN=DB2V11.JUN2915.SDSNLOAD,DISP=SHR -//SYSTSPRT DD SYSOUT=* -//SYSUDUMP DD SYSOUT=* -//SYSPRINT DD SYSOUT=* -//SYSTSIN DD * - DSN SYSTEM(DB90) - RUN PROGRAM(DSNTIAD) PLAN(DSNTIA11) - - LIB('DB90.RUNLIB.LOAD') - END -//SYSIN DD * - - SET CURRENT SQLID='WSADMIN'; - DROP TABLESPACE TRADEDB.TRADETS1; - DROP TABLESPACE TRADEDB.TRADETS2; - DROP TABLESPACE TRADEDB.TRADETS3; - DROP TABLESPACE TRADEDB.TRADETS4; - DROP TABLESPACE TRADEDB.TRADETS5; - DROP TABLESPACE TRADEDB.TRADETS6; - DROP DATABASE TRADEDB; - DROP STOGROUP TRADESG; - COMMIT; -//* LIB('DB2V11.JUN2915.RUNLIB.LOAD') -//STEP02 EXEC PGM=IKJEFT01,DYNAMNBR=20 -//STEPLIB DD DSN=DB2V11.JUN2915.SDSNLOAD,DISP=SHR -//SYSTSPRT DD SYSOUT=* -//SYSUDUMP DD SYSOUT=* -//SYSPRINT DD SYSOUT=* -//SYSTSIN DD * - DSN SYSTEM(DB90) - RUN PROGRAM(DSNTIAD) PLAN(DSNTIA11) - - LIB('DB90.RUNLIB.LOAD') - END -//SYSIN DD * - - SET CURRENT SQLID='WSADMIN'; - - CREATE STOGROUP TRADESG VOLUMES(WSPRF4) VCAT TRADESP6; - COMMIT; - - CREATE DATABASE TRADEDB - STOGROUP TRADESG - BUFFERPOOL BP2; - - COMMIT WORK; - - CREATE TABLESPACE TRADETS1 IN TRADEDB - USING STOGROUP TRADESG - PRIQTY 15000 - SECQTY 5000 - ERASE NO - CLOSE NO - LOCKSIZE ROW - BUFFERPOOL BP4; - - CREATE TABLESPACE TRADETS2 IN TRADEDB - USING STOGROUP TRADESG - PRIQTY 15000 - SECQTY 5000 - ERASE NO - CLOSE NO - LOCKSIZE ROW - BUFFERPOOL BP5; - - CREATE TABLESPACE TRADETS3 IN TRADEDB - USING STOGROUP TRADESG - PRIQTY 15000 - SECQTY 5000 - ERASE NO - CLOSE NO - LOCKSIZE ROW - BUFFERPOOL BP6; - - CREATE TABLESPACE TRADETS4 IN TRADEDB - USING STOGROUP TRADESG - PRIQTY 15000 - SECQTY 5000 - ERASE NO - CLOSE NO - LOCKSIZE ROW - BUFFERPOOL BP7; - - CREATE TABLESPACE TRADETS5 IN TRADEDB - USING STOGROUP TRADESG - PRIQTY 128 - SECQTY 128 - ERASE NO - CLOSE NO - LOCKSIZE ROW - BUFFERPOOL BP3; - - CREATE TABLESPACE TRADETS6 IN TRADEDB - USING STOGROUP TRADESG - PRIQTY 5000 - SECQTY 1000 - ERASE NO - CLOSE NO - LOCKSIZE ROW - BUFFERPOOL BP4; - - CREATE TABLE HOLDINGEJB - (PURCHASEPRICE DECIMAL(14, 2), - HOLDINGID INTEGER NOT NULL, - QUANTITY DOUBLE NOT NULL, - PURCHASEDATE TIMESTAMP, - ACCOUNT_ACCOUNTID INTEGER, - QUOTE_SYMBOL VARCHAR(250), - CONSTRAINT PK_HOLDINGEJB PRIMARY KEY(HOLDINGID)) - IN TRADEDB.TRADETS1; - - CREATE UNIQUE INDEX HOLDINGEJBIDX - ON HOLDINGEJB(HOLDINGID) - USING STOGROUP TRADESG - PRIQTY 5000 - SECQTY 1000 - CLOSE NO - BUFFERPOOL BP8; - - CREATE INDEX HOLDINGACTIDX - ON HOLDINGEJB(ACCOUNT_ACCOUNTID) - USING STOGROUP TRADESG - PRIQTY 5000 - SECQTY 1000 - CLOSE NO - BUFFERPOOL BP9; - - CREATE TABLE ACCOUNTPROFILEEJB - (ADDRESS VARCHAR(250), - PASSWD VARCHAR(250), - USERID VARCHAR(250) NOT NULL, - EMAIL VARCHAR(250), - CREDITCARD VARCHAR(250), - FULLNAME VARCHAR(250), - CONSTRAINT PK_ACCOUNTPROFILE1 PRIMARY KEY(USERID)) - IN TRADEDB.TRADETS2; - - CREATE UNIQUE INDEX ACCTPROFILEEJBIDX - ON ACCOUNTPROFILEEJB(USERID) - USING STOGROUP TRADESG - PRIQTY 5000 - SECQTY 1000 - CLOSE NO - BUFFERPOOL BP10; - - CREATE TABLE QUOTEEJB - (LOW DECIMAL(14, 2), - OPEN1 DECIMAL(14, 2), - VOLUME DOUBLE NOT NULL, - PRICE DECIMAL(14, 2), - HIGH DECIMAL(14, 2), - COMPANYNAME VARCHAR(255), - SYMBOL VARCHAR(250) NOT NULL, - CHANGE1 DOUBLE NOT NULL, - CONSTRAINT PK_QUOTEEJB PRIMARY KEY(SYMBOL)) - IN TRADE.TRADETS6; - - CREATE UNIQUE INDEX QUOTEEJBIDX - ON QUOTEEJB(SYMBOL) - USING STOGROUP TRADESG - PRIQTY 2500 - SECQTY 1000 - CLOSE NO - BUFFERPOOL BP11; - - CREATE TABLE KEYGENEJB - (KEYVAL INTEGER NOT NULL, - KEYNAME VARCHAR(250) NOT NULL, - CONSTRAINT PK_KEYGENEJB PRIMARY KEY(KEYNAME)) - IN TRADEDB.TRADETS5; - - CREATE UNIQUE INDEX KEYGENEJBIDX - ON KEYGENEJB(KEYNAME) - USING STOGROUP TRADESG - PRIQTY 128 - SECQTY 64 - CLOSE NO - BUFFERPOOL BP12; - - CREATE TABLE ACCOUNTEJB - (CREATIONDATE TIMESTAMP, - OPENBALANCE DECIMAL(14, 2), - LOGOUTCOUNT INTEGER NOT NULL, - BALANCE DECIMAL(14, 2), - ACCOUNTID INTEGER NOT NULL, - LASTLOGIN TIMESTAMP, - LOGINCOUNT INTEGER NOT NULL, - PROFILE_USERID VARCHAR(250), - CONSTRAINT PK_ACCOUNTEJB PRIMARY KEY(ACCOUNTID)) - IN TRADEDB.TRADETS4; - - - CREATE UNIQUE INDEX ACCOUNTEJBIDX - ON ACCOUNTEJB(ACCOUNTID) - USING STOGROUP TRADESG - PRIQTY 5000 - SECQTY 1000 - CLOSE NO - BUFFERPOOL BP8; - - CREATE UNIQUE INDEX ACCOUNTPUSRIDX - ON ACCOUNTEJB(PROFILE_USERID) - USING STOGROUP TRADESG - PRIQTY 5000 - SECQTY 1000 - CLOSE NO - BUFFERPOOL BP9; - - CREATE TABLE ORDEREJB - (ORDERFEE DECIMAL(14, 2), - COMPLETIONDATE TIMESTAMP, - ORDERTYPE VARCHAR(250), - ORDERSTATUS VARCHAR(250), - PRICE DECIMAL(14, 2), - QUANTITY DOUBLE NOT NULL, - OPENDATE TIMESTAMP, - ORDERID INTEGER NOT NULL, - ACCOUNT_ACCOUNTID INTEGER, - QUOTE_SYMBOL VARCHAR(250), - HOLDING_HOLDINGID INTEGER, - CONSTRAINT PK_ORDEREJB PRIMARY KEY(ORDERID)) - IN TRADEDB.TRADETS3; - - CREATE UNIQUE INDEX ORDEREJBIDX - ON ORDEREJB(ORDERID) - USING STOGROUP TRADESG - PRIQTY 5000 - SECQTY 1000 - CLOSE NO - BUFFERPOOL BP10; - - CREATE INDEX ORDEREACTIDX - ON ORDEREJB(ACCOUNT_ACCOUNTID) - USING STOGROUP TRADESG - PRIQTY 5000 - SECQTY 1000 - CLOSE NO - BUFFERPOOL BP11; - - CREATE INDEX ORDEREHLDIDX - ON ORDEREJB(HOLDING_HOLDINGID) - USING STOGROUP TRADESG - PRIQTY 5000 - SECQTY 1000 - CLOSE NO - BUFFERPOOL BP12; - - CREATE INDEX CLOSED_ORDERS - ON ORDEREJB(ORDERSTATUS,ACCOUNT_ACCOUNTID) - USING STOGROUP TRADESG - PRIQTY 5000 - SECQTY 1000 - CLOSE NO - BUFFERPOOL BP8; - COMMIT; diff --git a/src/test/resources/test-applications/default-keyword-method-decl/IndexExtractor.java b/src/test/resources/test-applications/default-keyword-method-decl/IndexExtractor.java deleted file mode 100644 index 1df739c9..00000000 --- a/src/test/resources/test-applications/default-keyword-method-decl/IndexExtractor.java +++ /dev/null @@ -1,160 +0,0 @@ -import java.util.Arrays; -import java.util.BitSet; -import java.util.Objects; -import java.util.function.IntPredicate; -import java.util.function.LongPredicate; - -/** - * An object that produces indices of a Bloom filter. - *

    - * The default implementation of {@code asIndexArray} is slow. Implementers should reimplement the - * method where possible.

    - * - * @since 4.5.0-M2 - */ -@FunctionalInterface -public interface IndexExtractor { - - /** - * Creates an IndexExtractor from a {@code BitMapExtractor}. - * - * @param bitMapExtractor the {@code BitMapExtractor} - * @return a new {@code IndexExtractor}. - */ - static IndexExtractor fromBitMapExtractor(final BitMapExtractor bitMapExtractor) { - Objects.requireNonNull(bitMapExtractor, "bitMapExtractor"); - return consumer -> { - final LongPredicate longPredicate = new LongPredicate() { - int wordIdx; - - @Override - public boolean test(long word) { - int i = wordIdx; - while (word != 0) { - if ((word & 1) == 1 && !consumer.test(i)) { - return false; - } - word >>>= 1; - i++; - } - wordIdx += 64; - return true; - } - }; - return bitMapExtractor.processBitMaps(longPredicate::test); - }; - } - - /** - * Creates an IndexExtractor from an array of integers. - * - * @param values the index values - * @return an IndexExtractor that uses the values. - */ - static IndexExtractor fromIndexArray(final int... values) { - return new IndexExtractor() { - - @Override - public int[] asIndexArray() { - return values.clone(); - } - - @Override - public boolean processIndices(final IntPredicate predicate) { - for (final int value : values) { - if (!predicate.test(value)) { - return false; - } - } - return true; - } - }; - } - - /** - * Return a copy of the IndexExtractor data as an int array. - * - *

    Indices ordering and uniqueness is not guaranteed.

    - * - *

    - * The default implementation of this method creates an array and populates - * it. Implementations that have access to an index array should consider - * returning a copy of that array if possible. - *

    - * - * @return An int array of the data. - */ - default int[] asIndexArray() { - final class Indices { - private int[] data = new int[32]; - private int size; - - boolean add(final int index) { - data = IndexUtils.ensureCapacityForAdd(data, size); - data[size++] = index; - return true; - } - - int[] toArray() { - // Edge case to avoid a large array copy - return size == data.length ? data : Arrays.copyOf(data, size); - } - } - final Indices indices = new Indices(); - processIndices(indices::add); - return indices.toArray(); - } - - /** - * Each index is passed to the predicate. The predicate is applied to each - * index value, if the predicate returns {@code false} the execution is stopped, {@code false} - * is returned, and no further indices are processed. - * - *

    Any exceptions thrown by the action are relayed to the caller.

    - * - *

    Indices ordering and uniqueness is not guaranteed.

    - * - * @param predicate the action to be performed for each non-zero bit index. - * @return {@code true} if all indexes return true from consumer, {@code false} otherwise. - * @throws NullPointerException if the specified action is null - */ - boolean processIndices(IntPredicate predicate); - - /** - * Creates an IndexExtractor comprising the unique indices for this extractor. - * - *

    By default creates a new extractor with some overhead to remove - * duplicates. IndexExtractors that return unique indices by default - * should override this to return {@code this}.

    - * - *

    The default implementation will filter the indices from this instance - * and return them in ascending order.

    - * - * @return the IndexExtractor of unique values. - * @throws IndexOutOfBoundsException if any index is less than zero. - */ - default IndexExtractor uniqueIndices() { - final BitSet bitSet = new BitSet(); - processIndices(i -> { - bitSet.set(i); - return true; - }); - - return new IndexExtractor() { - @Override - public boolean processIndices(final IntPredicate predicate) { - for (int idx = bitSet.nextSetBit(0); idx >= 0; idx = bitSet.nextSetBit(idx + 1)) { - if (!predicate.test(idx)) { - return false; - } - } - return true; - } - - @Override - public IndexExtractor uniqueIndices() { - return this; - } - }; - } -} diff --git a/src/test/resources/test-applications/generics-varargs-duplicate-signature-test/FunctorUtils.java b/src/test/resources/test-applications/generics-varargs-duplicate-signature-test/FunctorUtils.java deleted file mode 100644 index dc52e08d..00000000 --- a/src/test/resources/test-applications/generics-varargs-duplicate-signature-test/FunctorUtils.java +++ /dev/null @@ -1,76 +0,0 @@ -import java.util.Collection; -import java.util.Objects; -import java.util.function.Consumer; -import java.util.function.Function; -import org.apache.commons.collections4.Predicate; - -final class FunctorUtils { - - private static T[] clone(final T... array) { - return array != null ? array.clone() : null; - } - - static , P extends java.util.function.Predicate, T> R coerce(final P predicate) { - return (R) predicate; - } - - static , P extends Function, I, O> R coerce(final P transformer) { - return (R) transformer; - } - - static > T[] copy(final T... consumers) { - return clone(consumers); - } - - static > T[] copy(final T... predicates) { - return clone(predicates); - } - - static > T[] copy(final T... transformers) { - return clone(transformers); - } - - static Predicate[] validate(final Collection> predicates) { - Objects.requireNonNull(predicates, "predicates"); - // convert to array like this to guarantee iterator() ordering - @SuppressWarnings("unchecked") // OK - final Predicate[] preds = new Predicate[predicates.size()]; - int i = 0; - for (final java.util.function.Predicate predicate : predicates) { - preds[i] = (Predicate) predicate; - if (preds[i] == null) { - throw new NullPointerException("predicates[" + i + "]"); - } - i++; - } - return preds; - } - - static void validate(final Consumer... consumers) { - Objects.requireNonNull(consumers, "consumers"); - for (int i = 0; i < consumers.length; i++) { - if (consumers[i] == null) { - throw new NullPointerException("closures[" + i + "]"); - } - } - } - - static void validate(final Function... functions) { - Objects.requireNonNull(functions, "functions"); - for (int i = 0; i < functions.length; i++) { - if (functions[i] == null) { - throw new NullPointerException("functions[" + i + "]"); - } - } - } - - static void validate(final java.util.function.Predicate... predicates) { - Objects.requireNonNull(predicates, "predicates"); - for (int i = 0; i < predicates.length; i++) { - if (predicates[i] == null) { - throw new NullPointerException("predicates[" + i + "]"); - } - } - } - -} diff --git a/src/test/resources/test-applications/generics-varargs-duplicate-signature-test/Validate.java b/src/test/resources/test-applications/generics-varargs-duplicate-signature-test/Validate.java deleted file mode 100644 index 1ade3d7d..00000000 --- a/src/test/resources/test-applications/generics-varargs-duplicate-signature-test/Validate.java +++ /dev/null @@ -1,114 +0,0 @@ -import java.util.Collection; -import java.util.Map; -import java.util.Objects; -import java.util.function.Supplier; - -public class Validate { - - private static final String DEFAULT_NOT_EMPTY_ARRAY_EX_MESSAGE = "The validated array is empty"; - private static final String DEFAULT_NOT_EMPTY_CHAR_SEQUENCE_EX_MESSAGE = - "The validated character sequence is empty"; - private static final String DEFAULT_NOT_EMPTY_COLLECTION_EX_MESSAGE = "The validated collection is empty"; - private static final String DEFAULT_NOT_EMPTY_MAP_EX_MESSAGE = "The validated map is empty"; - private static final String DEFAULT_VALID_INDEX_ARRAY_EX_MESSAGE = "The validated array index is invalid: %d"; - private static final String DEFAULT_VALID_INDEX_CHAR_SEQUENCE_EX_MESSAGE = - "The validated character sequence index is invalid: %d"; - private static final String DEFAULT_VALID_INDEX_COLLECTION_EX_MESSAGE = - "The validated collection index is invalid: %d"; - - private static String getMessage(final String message, final Object... values) { - return ArrayUtils.isEmpty(values) ? message : String.format(message, values); - } - - public static > T notEmpty(final T collection) { - return notEmpty(collection, DEFAULT_NOT_EMPTY_COLLECTION_EX_MESSAGE); - } - - public static > T notEmpty(final T map) { - return notEmpty(map, DEFAULT_NOT_EMPTY_MAP_EX_MESSAGE); - } - - public static T notEmpty(final T chars) { - return notEmpty(chars, DEFAULT_NOT_EMPTY_CHAR_SEQUENCE_EX_MESSAGE); - } - - public static > T notEmpty(final T collection, final String message, final Object... values) { - Objects.requireNonNull(collection, toSupplier(message, values)); - if (collection.isEmpty()) { - throw new IllegalArgumentException(getMessage(message, values)); - } - return collection; - } - - public static > T notEmpty(final T map, final String message, final Object... values) { - Objects.requireNonNull(map, toSupplier(message, values)); - if (map.isEmpty()) { - throw new IllegalArgumentException(getMessage(message, values)); - } - return map; - } - - public static T notEmpty(final T chars, final String message, final Object... values) { - Objects.requireNonNull(chars, toSupplier(message, values)); - if (chars.length() == 0) { - throw new IllegalArgumentException(getMessage(message, values)); - } - return chars; - } - - public static T[] notEmpty(final T[] array) { - return notEmpty(array, DEFAULT_NOT_EMPTY_ARRAY_EX_MESSAGE); - } - - public static T[] notEmpty(final T[] array, final String message, final Object... values) { - Objects.requireNonNull(array, toSupplier(message, values)); - if (array.length == 0) { - throw new IllegalArgumentException(getMessage(message, values)); - } - return array; - } - - private static Supplier toSupplier(final String message, final Object... values) { - return () -> getMessage(message, values); - } - - private static Supplier toSupplier(final String message, final Object values) { - return () -> getMessage(message, values); - } - - public static > T validIndex(final T collection, final int index) { - return validIndex(collection, index, DEFAULT_VALID_INDEX_COLLECTION_EX_MESSAGE, Integer.valueOf(index)); - } - - public static T validIndex(final T chars, final int index) { - return validIndex(chars, index, DEFAULT_VALID_INDEX_CHAR_SEQUENCE_EX_MESSAGE, Integer.valueOf(index)); - } - - public static > T validIndex(final T collection, final int index, final String message, final Object... values) { - Objects.requireNonNull(collection, "collection"); - if (index < 0 || index >= collection.size()) { - throw new IndexOutOfBoundsException(getMessage(message, values)); - } - return collection; - } - - public static T validIndex(final T chars, final int index, final String message, final Object... values) { - Objects.requireNonNull(chars, "chars"); - if (index < 0 || index >= chars.length()) { - throw new IndexOutOfBoundsException(getMessage(message, values)); - } - return chars; - } - - public static T[] validIndex(final T[] array, final int index) { - return validIndex(array, index, DEFAULT_VALID_INDEX_ARRAY_EX_MESSAGE, Integer.valueOf(index)); - } - - public static T[] validIndex(final T[] array, final int index, final String message, final Object... values) { - Objects.requireNonNull(array, "array"); - if (index < 0 || index >= array.length) { - throw new IndexOutOfBoundsException(getMessage(message, values)); - } - return array; - } -} diff --git a/src/test/resources/test-applications/gradlew-corrupt-test/.dockerignore b/src/test/resources/test-applications/gradlew-corrupt-test/.dockerignore deleted file mode 100644 index 326c2bc2..00000000 --- a/src/test/resources/test-applications/gradlew-corrupt-test/.dockerignore +++ /dev/null @@ -1,3 +0,0 @@ -target/ -!target/*.war -!target/liberty/wlp/usr/shared/resources/* diff --git a/src/test/resources/test-applications/gradlew-corrupt-test/.gitignore b/src/test/resources/test-applications/gradlew-corrupt-test/.gitignore deleted file mode 100644 index fef207d2..00000000 --- a/src/test/resources/test-applications/gradlew-corrupt-test/.gitignore +++ /dev/null @@ -1,11 +0,0 @@ -target/ -pom.xml.tag -pom.xml.releaseBackup -pom.xml.versionsBackup -pom.xml.next -release.properties -dependency-reduced-pom.xml -buildNumber.properties -.mvn/timing.properties -# https://github.com/takari/maven-wrapper#usage-without-binary-jar -.mvn/wrapper/maven-wrapper.jar \ No newline at end of file diff --git a/src/test/resources/test-applications/gradlew-corrupt-test/Dockerfile b/src/test/resources/test-applications/gradlew-corrupt-test/Dockerfile deleted file mode 100644 index 05e9a7e2..00000000 --- a/src/test/resources/test-applications/gradlew-corrupt-test/Dockerfile +++ /dev/null @@ -1,10 +0,0 @@ - -FROM icr.io/appcafe/open-liberty:kernel-slim-java17-openj9-ubi - -COPY --chown=1001:0 /src/main/liberty/config /config - -RUN features.sh - -COPY --chown=1001:0 target/*.war /config/apps - -RUN configure.sh diff --git a/src/test/resources/test-applications/gradlew-corrupt-test/README.txt b/src/test/resources/test-applications/gradlew-corrupt-test/README.txt deleted file mode 100644 index 0e4c219b..00000000 --- a/src/test/resources/test-applications/gradlew-corrupt-test/README.txt +++ /dev/null @@ -1,35 +0,0 @@ -After you generate a starter project, these instructions will help you with what to do next. - -The Open Liberty starter gives you a simple, quick way to get the necessary files to start building -an application on Open Liberty. There is no need to search how to find out what to add to your -Maven build files. A simple RestApplication.java file is generated for you to start -creating a REST based application. A server.xml configuration file is provided with the necessary -features for the MicroProfile and Jakarta EE versions that you previously selected. - -If you plan on developing and/or deploying your app in a containerized environment, the included -Dockerfile will make it easier to create your application image on top of the Open Liberty Docker -image. - -1) Once you download the starter project, unpackage the .zip file on your machine. -2) Open a command line session, navigate to the installation directory, and run `./mvnw liberty:dev` (Linux/Mac) or `mvnw liberty:dev` (Windows). - This will install all required dependencies and start the default server. When complete, you will - see the necessary features installed and the message "server is ready to run a smarter planet." - -For information on developing your application in dev mode using Maven, see the -dev mode documentation (https://openliberty.io/docs/latest/development-mode.html). - -For further help on getting started actually developing your application, see some of our -MicroProfile guides (https://openliberty.io/guides/?search=microprofile&key=tag) and Jakarta EE -guides (https://openliberty.io/guides/?search=jakarta%20ee&key=tag). - -If you have problems building the starter project, make sure the Java SE version on your -machine matches the Java SE version you picked from the Open Liberty starter on the downloads -page (https://openliberty.io/downloads/). You can test this with the command `java -version`. - -Open Liberty performs at its best when running using Open J9 which can be obtained via IBM Semeru -(https://developer.ibm.com/languages/java/semeru-runtimes/downloads/). For a full list of supported -Java SE versions and where to obtain them, reference the Java SE support page -(https://openliberty.io/docs/latest/java-se.html). - -If you find any issues with the starter project or have recommendations to improve it, open an -issue in the starter GitHub repo (https://github.com/OpenLiberty/start.openliberty.io). diff --git a/src/test/resources/test-applications/gradlew-corrupt-test/build.gradle b/src/test/resources/test-applications/gradlew-corrupt-test/build.gradle deleted file mode 100644 index c80e50c1..00000000 --- a/src/test/resources/test-applications/gradlew-corrupt-test/build.gradle +++ /dev/null @@ -1,37 +0,0 @@ -/* - * This file was generated by the Gradle 'init' task. - */ - -plugins { - id 'java' - id 'maven-publish' -} - -repositories { - mavenLocal() - maven { - url = uri('https://repo.maven.apache.org/maven2/') - } -} - -dependencies { - compileOnly 'javax:javaee-api:7.0' - compileOnly 'org.eclipse.microprofile:microprofile:1.4' -} - -group = 'com.demo' -version = '1.0-SNAPSHOT' -description = 'my-javaee-mvn' -java.sourceCompatibility = JavaVersion.VERSION_1_8 - -publishing { - publications { - maven(MavenPublication) { - from(components.java) - } - } -} - -tasks.withType(JavaCompile) { - options.encoding = 'UTF-8' -} diff --git a/src/test/resources/test-applications/gradlew-corrupt-test/gradle/wrapper/gradle-wrapper.properties b/src/test/resources/test-applications/gradlew-corrupt-test/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index 2e6e5897..00000000 --- a/src/test/resources/test-applications/gradlew-corrupt-test/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,5 +0,0 @@ -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists diff --git a/src/test/resources/test-applications/gradlew-corrupt-test/gradlew b/src/test/resources/test-applications/gradlew-corrupt-test/gradlew deleted file mode 100644 index e69de29b..00000000 diff --git a/src/test/resources/test-applications/gradlew-corrupt-test/gradlew.bat b/src/test/resources/test-applications/gradlew-corrupt-test/gradlew.bat deleted file mode 100644 index ac1b06f9..00000000 --- a/src/test/resources/test-applications/gradlew-corrupt-test/gradlew.bat +++ /dev/null @@ -1,89 +0,0 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem - -@if "%DEBUG%" == "" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto execute - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega diff --git a/src/test/resources/test-applications/gradlew-corrupt-test/settings.gradle b/src/test/resources/test-applications/gradlew-corrupt-test/settings.gradle deleted file mode 100644 index 81f4ec38..00000000 --- a/src/test/resources/test-applications/gradlew-corrupt-test/settings.gradle +++ /dev/null @@ -1,5 +0,0 @@ -/* - * This file was generated by the Gradle 'init' task. - */ - -rootProject.name = 'my-javaee-mvn' diff --git a/src/test/resources/test-applications/gradlew-corrupt-test/src/main/java/com/demo/CurrentTimeServlet.java b/src/test/resources/test-applications/gradlew-corrupt-test/src/main/java/com/demo/CurrentTimeServlet.java deleted file mode 100644 index dbc91c39..00000000 --- a/src/test/resources/test-applications/gradlew-corrupt-test/src/main/java/com/demo/CurrentTimeServlet.java +++ /dev/null @@ -1,28 +0,0 @@ -// Assisted by watsonx Code Assistant - -package com.demo; - -import java.io.IOException; -import java.io.PrintWriter; -import java.util.Date; -import javax.servlet.ServletException; -import javax.servlet.annotation.WebServlet; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -@WebServlet("/currentTime") -public class CurrentTimeServlet extends HttpServlet { - - private static final long serialVersionUID = 1L; - - @Override - protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - response.setContentType("text/html"); - PrintWriter out = response.getWriter(); - out.println("

    Current Time

    "); - out.println("

    The current date and time is:

    "); - out.println("

    " + new Date() + "

    "); - } - -} diff --git a/src/test/resources/test-applications/gradlew-corrupt-test/src/main/java/com/demo/rest/RestApplication.java b/src/test/resources/test-applications/gradlew-corrupt-test/src/main/java/com/demo/rest/RestApplication.java deleted file mode 100644 index 7da72e46..00000000 --- a/src/test/resources/test-applications/gradlew-corrupt-test/src/main/java/com/demo/rest/RestApplication.java +++ /dev/null @@ -1,9 +0,0 @@ -package com.demo.rest; - -import javax.ws.rs.ApplicationPath; -import javax.ws.rs.core.Application; - -@ApplicationPath("/api") -public class RestApplication extends Application { - -} diff --git a/src/test/resources/test-applications/gradlew-corrupt-test/src/main/liberty/config/server.xml b/src/test/resources/test-applications/gradlew-corrupt-test/src/main/liberty/config/server.xml deleted file mode 100644 index 70e8fc1a..00000000 --- a/src/test/resources/test-applications/gradlew-corrupt-test/src/main/liberty/config/server.xml +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - javaee-7.0 - microProfile-1.4 - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/test/resources/test-applications/gradlew-corrupt-test/src/main/resources/META-INF/microprofile-config.properties b/src/test/resources/test-applications/gradlew-corrupt-test/src/main/resources/META-INF/microprofile-config.properties deleted file mode 100644 index e69de29b..00000000 diff --git a/src/test/resources/test-applications/gradlew-working-test/.dockerignore b/src/test/resources/test-applications/gradlew-working-test/.dockerignore deleted file mode 100644 index 326c2bc2..00000000 --- a/src/test/resources/test-applications/gradlew-working-test/.dockerignore +++ /dev/null @@ -1,3 +0,0 @@ -target/ -!target/*.war -!target/liberty/wlp/usr/shared/resources/* diff --git a/src/test/resources/test-applications/gradlew-working-test/.gitignore b/src/test/resources/test-applications/gradlew-working-test/.gitignore deleted file mode 100644 index fef207d2..00000000 --- a/src/test/resources/test-applications/gradlew-working-test/.gitignore +++ /dev/null @@ -1,11 +0,0 @@ -target/ -pom.xml.tag -pom.xml.releaseBackup -pom.xml.versionsBackup -pom.xml.next -release.properties -dependency-reduced-pom.xml -buildNumber.properties -.mvn/timing.properties -# https://github.com/takari/maven-wrapper#usage-without-binary-jar -.mvn/wrapper/maven-wrapper.jar \ No newline at end of file diff --git a/src/test/resources/test-applications/gradlew-working-test/Dockerfile b/src/test/resources/test-applications/gradlew-working-test/Dockerfile deleted file mode 100644 index 05e9a7e2..00000000 --- a/src/test/resources/test-applications/gradlew-working-test/Dockerfile +++ /dev/null @@ -1,10 +0,0 @@ - -FROM icr.io/appcafe/open-liberty:kernel-slim-java17-openj9-ubi - -COPY --chown=1001:0 /src/main/liberty/config /config - -RUN features.sh - -COPY --chown=1001:0 target/*.war /config/apps - -RUN configure.sh diff --git a/src/test/resources/test-applications/gradlew-working-test/README.txt b/src/test/resources/test-applications/gradlew-working-test/README.txt deleted file mode 100644 index 0e4c219b..00000000 --- a/src/test/resources/test-applications/gradlew-working-test/README.txt +++ /dev/null @@ -1,35 +0,0 @@ -After you generate a starter project, these instructions will help you with what to do next. - -The Open Liberty starter gives you a simple, quick way to get the necessary files to start building -an application on Open Liberty. There is no need to search how to find out what to add to your -Maven build files. A simple RestApplication.java file is generated for you to start -creating a REST based application. A server.xml configuration file is provided with the necessary -features for the MicroProfile and Jakarta EE versions that you previously selected. - -If you plan on developing and/or deploying your app in a containerized environment, the included -Dockerfile will make it easier to create your application image on top of the Open Liberty Docker -image. - -1) Once you download the starter project, unpackage the .zip file on your machine. -2) Open a command line session, navigate to the installation directory, and run `./mvnw liberty:dev` (Linux/Mac) or `mvnw liberty:dev` (Windows). - This will install all required dependencies and start the default server. When complete, you will - see the necessary features installed and the message "server is ready to run a smarter planet." - -For information on developing your application in dev mode using Maven, see the -dev mode documentation (https://openliberty.io/docs/latest/development-mode.html). - -For further help on getting started actually developing your application, see some of our -MicroProfile guides (https://openliberty.io/guides/?search=microprofile&key=tag) and Jakarta EE -guides (https://openliberty.io/guides/?search=jakarta%20ee&key=tag). - -If you have problems building the starter project, make sure the Java SE version on your -machine matches the Java SE version you picked from the Open Liberty starter on the downloads -page (https://openliberty.io/downloads/). You can test this with the command `java -version`. - -Open Liberty performs at its best when running using Open J9 which can be obtained via IBM Semeru -(https://developer.ibm.com/languages/java/semeru-runtimes/downloads/). For a full list of supported -Java SE versions and where to obtain them, reference the Java SE support page -(https://openliberty.io/docs/latest/java-se.html). - -If you find any issues with the starter project or have recommendations to improve it, open an -issue in the starter GitHub repo (https://github.com/OpenLiberty/start.openliberty.io). diff --git a/src/test/resources/test-applications/gradlew-working-test/build.gradle b/src/test/resources/test-applications/gradlew-working-test/build.gradle deleted file mode 100644 index c80e50c1..00000000 --- a/src/test/resources/test-applications/gradlew-working-test/build.gradle +++ /dev/null @@ -1,37 +0,0 @@ -/* - * This file was generated by the Gradle 'init' task. - */ - -plugins { - id 'java' - id 'maven-publish' -} - -repositories { - mavenLocal() - maven { - url = uri('https://repo.maven.apache.org/maven2/') - } -} - -dependencies { - compileOnly 'javax:javaee-api:7.0' - compileOnly 'org.eclipse.microprofile:microprofile:1.4' -} - -group = 'com.demo' -version = '1.0-SNAPSHOT' -description = 'my-javaee-mvn' -java.sourceCompatibility = JavaVersion.VERSION_1_8 - -publishing { - publications { - maven(MavenPublication) { - from(components.java) - } - } -} - -tasks.withType(JavaCompile) { - options.encoding = 'UTF-8' -} diff --git a/src/test/resources/test-applications/gradlew-working-test/gradle/wrapper/gradle-wrapper.properties b/src/test/resources/test-applications/gradlew-working-test/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index 2e6e5897..00000000 --- a/src/test/resources/test-applications/gradlew-working-test/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,5 +0,0 @@ -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists diff --git a/src/test/resources/test-applications/gradlew-working-test/gradlew b/src/test/resources/test-applications/gradlew-working-test/gradlew deleted file mode 100755 index 1b6c7873..00000000 --- a/src/test/resources/test-applications/gradlew-working-test/gradlew +++ /dev/null @@ -1,234 +0,0 @@ -#!/bin/sh - -# -# Copyright © 2015-2021 the original authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -############################################################################## -# -# Gradle start up script for POSIX generated by Gradle. -# -# Important for running: -# -# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is -# noncompliant, but you have some other compliant shell such as ksh or -# bash, then to run this script, type that shell name before the whole -# command line, like: -# -# ksh Gradle -# -# Busybox and similar reduced shells will NOT work, because this script -# requires all of these POSIX shell features: -# * functions; -# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», -# «${var#prefix}», «${var%suffix}», and «$( cmd )»; -# * compound commands having a testable exit status, especially «case»; -# * various built-in commands including «command», «set», and «ulimit». -# -# Important for patching: -# -# (2) This script targets any POSIX shell, so it avoids extensions provided -# by Bash, Ksh, etc; in particular arrays are avoided. -# -# The "traditional" practice of packing multiple parameters into a -# space-separated string is a well documented source of bugs and security -# problems, so this is (mostly) avoided, by progressively accumulating -# options in "$@", and eventually passing that to Java. -# -# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, -# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; -# see the in-line comments for details. -# -# There are tweaks for specific operating systems such as AIX, CygWin, -# Darwin, MinGW, and NonStop. -# -# (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt -# within the Gradle project. -# -# You can find Gradle at https://github.com/gradle/gradle/. -# -############################################################################## - -# Attempt to set APP_HOME - -# Resolve links: $0 may be a link -app_path=$0 - -# Need this for daisy-chained symlinks. -while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] -do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac -done - -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -APP_NAME="Gradle" -APP_BASE_NAME=${0##*/} - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' - -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD=maximum - -warn () { - echo "$*" -} >&2 - -die () { - echo - echo "$*" - echo - exit 1 -} >&2 - -# OS specific support (must be 'true' or 'false'). -cygwin=false -msys=false -darwin=false -nonstop=false -case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; -esac - -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar - - -# Determine the Java command to use to start the JVM. -if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -else - JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi - -# Increase the maximum file descriptors if we can. -if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac -fi - -# Collect all arguments for the java command, stacking in reverse order: -# * args from the command line -# * the main class name -# * -classpath -# * -D...appname settings -# * --module-path (only if needed) -# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. - -# For Cygwin or MSYS, switch paths to Windows format before running java -if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - - JAVACMD=$( cygpath --unix "$JAVACMD" ) - - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done -fi - -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. - -set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" - -# Use "xargs" to parse quoted args. -# -# With -n1 it outputs one arg per line, with the quotes and backslashes removed. -# -# In Bash we could simply go: -# -# readarray ARGS < <( xargs -n1 <<<"$var" ) && -# set -- "${ARGS[@]}" "$@" -# -# but POSIX shell has neither arrays nor command substitution, so instead we -# post-process each arg (as a line of input to sed) to backslash-escape any -# character that might be a shell metacharacter, then use eval to reverse -# that process (while maintaining the separation between arguments), and wrap -# the whole thing up as a single "set" statement. -# -# This will of course break if any of these variables contains a newline or -# an unmatched quote. -# - -eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' - -exec "$JAVACMD" "$@" diff --git a/src/test/resources/test-applications/gradlew-working-test/gradlew.bat b/src/test/resources/test-applications/gradlew-working-test/gradlew.bat deleted file mode 100644 index ac1b06f9..00000000 --- a/src/test/resources/test-applications/gradlew-working-test/gradlew.bat +++ /dev/null @@ -1,89 +0,0 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem - -@if "%DEBUG%" == "" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto execute - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega diff --git a/src/test/resources/test-applications/gradlew-working-test/settings.gradle b/src/test/resources/test-applications/gradlew-working-test/settings.gradle deleted file mode 100644 index 81f4ec38..00000000 --- a/src/test/resources/test-applications/gradlew-working-test/settings.gradle +++ /dev/null @@ -1,5 +0,0 @@ -/* - * This file was generated by the Gradle 'init' task. - */ - -rootProject.name = 'my-javaee-mvn' diff --git a/src/test/resources/test-applications/gradlew-working-test/src/main/java/com/demo/CurrentTimeServlet.java b/src/test/resources/test-applications/gradlew-working-test/src/main/java/com/demo/CurrentTimeServlet.java deleted file mode 100644 index dbc91c39..00000000 --- a/src/test/resources/test-applications/gradlew-working-test/src/main/java/com/demo/CurrentTimeServlet.java +++ /dev/null @@ -1,28 +0,0 @@ -// Assisted by watsonx Code Assistant - -package com.demo; - -import java.io.IOException; -import java.io.PrintWriter; -import java.util.Date; -import javax.servlet.ServletException; -import javax.servlet.annotation.WebServlet; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -@WebServlet("/currentTime") -public class CurrentTimeServlet extends HttpServlet { - - private static final long serialVersionUID = 1L; - - @Override - protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - response.setContentType("text/html"); - PrintWriter out = response.getWriter(); - out.println("

    Current Time

    "); - out.println("

    The current date and time is:

    "); - out.println("

    " + new Date() + "

    "); - } - -} diff --git a/src/test/resources/test-applications/gradlew-working-test/src/main/java/com/demo/rest/RestApplication.java b/src/test/resources/test-applications/gradlew-working-test/src/main/java/com/demo/rest/RestApplication.java deleted file mode 100644 index 7da72e46..00000000 --- a/src/test/resources/test-applications/gradlew-working-test/src/main/java/com/demo/rest/RestApplication.java +++ /dev/null @@ -1,9 +0,0 @@ -package com.demo.rest; - -import javax.ws.rs.ApplicationPath; -import javax.ws.rs.core.Application; - -@ApplicationPath("/api") -public class RestApplication extends Application { - -} diff --git a/src/test/resources/test-applications/gradlew-working-test/src/main/liberty/config/server.xml b/src/test/resources/test-applications/gradlew-working-test/src/main/liberty/config/server.xml deleted file mode 100644 index 70e8fc1a..00000000 --- a/src/test/resources/test-applications/gradlew-working-test/src/main/liberty/config/server.xml +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - javaee-7.0 - microProfile-1.4 - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/test/resources/test-applications/gradlew-working-test/src/main/resources/META-INF/microprofile-config.properties b/src/test/resources/test-applications/gradlew-working-test/src/main/resources/META-INF/microprofile-config.properties deleted file mode 100644 index e69de29b..00000000 diff --git a/src/test/resources/test-applications/init-blocks-test/.gitattributes b/src/test/resources/test-applications/init-blocks-test/.gitattributes deleted file mode 100644 index f91f6460..00000000 --- a/src/test/resources/test-applications/init-blocks-test/.gitattributes +++ /dev/null @@ -1,12 +0,0 @@ -# -# https://help.github.com/articles/dealing-with-line-endings/ -# -# Linux start script should use lf -/gradlew text eol=lf - -# These are Windows script files and should use crlf -*.bat text eol=crlf - -# Binary files should be left untouched -*.jar binary - diff --git a/src/test/resources/test-applications/init-blocks-test/.gitignore b/src/test/resources/test-applications/init-blocks-test/.gitignore deleted file mode 100644 index 1b6985c0..00000000 --- a/src/test/resources/test-applications/init-blocks-test/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -# Ignore Gradle project-specific cache directory -.gradle - -# Ignore Gradle build output directory -build diff --git a/src/test/resources/test-applications/init-blocks-test/app/src/main/java/org/example/App.java b/src/test/resources/test-applications/init-blocks-test/app/src/main/java/org/example/App.java deleted file mode 100644 index f90c428c..00000000 --- a/src/test/resources/test-applications/init-blocks-test/app/src/main/java/org/example/App.java +++ /dev/null @@ -1,80 +0,0 @@ -/** - * Static and Instance Initialization Blocks Example with comments. - * - * MIT License - *

    - */ -package org.example; - -// Import statements -import java.util.List; - -/** - * The App class demonstrates the use of static and instance initialization blocks, - * as well as a constructor in Java. - */ -public class App { - // Static field - private static String staticMessage; - - // Static initialization block - static { - try { - staticMessage = "Static block initialized"; - System.out.println("Static initialization block executed."); - initializeStaticFields(); // Call a method to initialize static fields - } catch (Exception e) { - // Handle any exceptions that occur during initialization - System.err.println("Error in static block: " + e.getMessage()); - throw new RuntimeException(e); // Rethrow the exception - } - } - - // Instance initialization block - { - try { - System.out.println("Instance initialization block executed."); - initializeInstanceFields(); - } catch (Exception e) { - System.err.println("Error in instance block: " + e.getMessage()); - } - } - - /** - * Constructor for the App class. - * Prints a message indicating that the constructor has been executed. - */ - public App() { - System.out.println("Constructor executed."); - } - - /** - * Initializes static fields. - * Prints a message indicating that static fields are being initialized. - */ - private static void initializeStaticFields() { - System.out.println("Initializing static fields."); - } - - /** - * Initializes instance fields. - * Prints a message indicating that instance fields are being initialized. - */ - private void initializeInstanceFields() { - // This is a comment associated with the println statement below - System.out.println("Initializing instance fields."); - } - - /** - * The main method is the entry point of the application. - * Creates a new instance of the App class. - * - * @param args Command line arguments - */ - public static void main(String[] args) { - - // This is an orphaned comment - - new App(); // Create a new instance of the App class - } -} diff --git a/src/test/resources/test-applications/init-blocks-test/gradle.properties b/src/test/resources/test-applications/init-blocks-test/gradle.properties deleted file mode 100644 index 51540088..00000000 --- a/src/test/resources/test-applications/init-blocks-test/gradle.properties +++ /dev/null @@ -1,7 +0,0 @@ -# This file was generated by the Gradle 'init' task. -# https://docs.gradle.org/current/userguide/build_environment.html#sec:gradle_configuration_properties - -org.gradle.configuration-cache=true -org.gradle.parallel=true -org.gradle.caching=true - diff --git a/src/test/resources/test-applications/init-blocks-test/gradlew b/src/test/resources/test-applications/init-blocks-test/gradlew deleted file mode 100755 index f3b75f3b..00000000 --- a/src/test/resources/test-applications/init-blocks-test/gradlew +++ /dev/null @@ -1,251 +0,0 @@ -#!/bin/sh - -# -# Copyright © 2015-2021 the original authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# SPDX-License-Identifier: Apache-2.0 -# - -############################################################################## -# -# Gradle start up script for POSIX generated by Gradle. -# -# Important for running: -# -# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is -# noncompliant, but you have some other compliant shell such as ksh or -# bash, then to run this script, type that shell name before the whole -# command line, like: -# -# ksh Gradle -# -# Busybox and similar reduced shells will NOT work, because this script -# requires all of these POSIX shell features: -# * functions; -# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», -# «${var#prefix}», «${var%suffix}», and «$( cmd )»; -# * compound commands having a testable exit status, especially «case»; -# * various built-in commands including «command», «set», and «ulimit». -# -# Important for patching: -# -# (2) This script targets any POSIX shell, so it avoids extensions provided -# by Bash, Ksh, etc; in particular arrays are avoided. -# -# The "traditional" practice of packing multiple parameters into a -# space-separated string is a well documented source of bugs and security -# problems, so this is (mostly) avoided, by progressively accumulating -# options in "$@", and eventually passing that to Java. -# -# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, -# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; -# see the in-line comments for details. -# -# There are tweaks for specific operating systems such as AIX, CygWin, -# Darwin, MinGW, and NonStop. -# -# (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt -# within the Gradle project. -# -# You can find Gradle at https://github.com/gradle/gradle/. -# -############################################################################## - -# Attempt to set APP_HOME - -# Resolve links: $0 may be a link -app_path=$0 - -# Need this for daisy-chained symlinks. -while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] -do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac -done - -# This is normally unused -# shellcheck disable=SC2034 -APP_BASE_NAME=${0##*/} -# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) -APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit - -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD=maximum - -warn () { - echo "$*" -} >&2 - -die () { - echo - echo "$*" - echo - exit 1 -} >&2 - -# OS specific support (must be 'true' or 'false'). -cygwin=false -msys=false -darwin=false -nonstop=false -case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; -esac - -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar - - -# Determine the Java command to use to start the JVM. -if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -else - JAVACMD=java - if ! command -v java >/dev/null 2>&1 - then - die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -fi - -# Increase the maximum file descriptors if we can. -if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC2039,SC3045 - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC2039,SC3045 - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac -fi - -# Collect all arguments for the java command, stacking in reverse order: -# * args from the command line -# * the main class name -# * -classpath -# * -D...appname settings -# * --module-path (only if needed) -# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. - -# For Cygwin or MSYS, switch paths to Windows format before running java -if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - - JAVACMD=$( cygpath --unix "$JAVACMD" ) - - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done -fi - - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' - -# Collect all arguments for the java command: -# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, -# and any embedded shellness will be escaped. -# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be -# treated as '${Hostname}' itself on the command line. - -set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" - -# Stop when "xargs" is not available. -if ! command -v xargs >/dev/null 2>&1 -then - die "xargs is not available" -fi - -# Use "xargs" to parse quoted args. -# -# With -n1 it outputs one arg per line, with the quotes and backslashes removed. -# -# In Bash we could simply go: -# -# readarray ARGS < <( xargs -n1 <<<"$var" ) && -# set -- "${ARGS[@]}" "$@" -# -# but POSIX shell has neither arrays nor command substitution, so instead we -# post-process each arg (as a line of input to sed) to backslash-escape any -# character that might be a shell metacharacter, then use eval to reverse -# that process (while maintaining the separation between arguments), and wrap -# the whole thing up as a single "set" statement. -# -# This will of course break if any of these variables contains a newline or -# an unmatched quote. -# - -eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' - -exec "$JAVACMD" "$@" diff --git a/src/test/resources/test-applications/init-blocks-test/gradlew.bat b/src/test/resources/test-applications/init-blocks-test/gradlew.bat deleted file mode 100644 index 9d21a218..00000000 --- a/src/test/resources/test-applications/init-blocks-test/gradlew.bat +++ /dev/null @@ -1,94 +0,0 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem -@rem SPDX-License-Identifier: Apache-2.0 -@rem - -@if "%DEBUG%"=="" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -set DIRNAME=%~dp0 -if "%DIRNAME%"=="" set DIRNAME=. -@rem This is normally unused -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if %ERRORLEVEL% equ 0 goto execute - -echo. 1>&2 -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 -echo. 1>&2 -echo Please set the JAVA_HOME variable in your environment to match the 1>&2 -echo location of your Java installation. 1>&2 - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto execute - -echo. 1>&2 -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 -echo. 1>&2 -echo Please set the JAVA_HOME variable in your environment to match the 1>&2 -echo location of your Java installation. 1>&2 - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* - -:end -@rem End local scope for the variables with windows NT shell -if %ERRORLEVEL% equ 0 goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -set EXIT_CODE=%ERRORLEVEL% -if %EXIT_CODE% equ 0 set EXIT_CODE=1 -if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% -exit /b %EXIT_CODE% - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega diff --git a/src/test/resources/test-applications/init-blocks-test/settings.gradle.kts b/src/test/resources/test-applications/init-blocks-test/settings.gradle.kts deleted file mode 100644 index d1bf0739..00000000 --- a/src/test/resources/test-applications/init-blocks-test/settings.gradle.kts +++ /dev/null @@ -1,15 +0,0 @@ -package `test-applications`.`init-blocks-test`/* - * This file was generated by the Gradle 'init' task. - * - * The settings file is used to specify which projects to include in your build. - * For more detailed information on multi-project builds, please refer to https://docs.gradle.org/8.12.1/userguide/multi_project_builds.html in the Gradle documentation. - * This project uses @Incubating APIs which are subject to change. - */ - -plugins { - // Apply the foojay-resolver plugin to allow automatic download of JDKs - id("org.gradle.toolchains.foojay-resolver-convention") version "0.8.0" -} - -rootProject.name = "record-class-test" -include("app") diff --git a/src/test/resources/test-applications/missing-node-range-test/WeakHashtableTestCase.java b/src/test/resources/test-applications/missing-node-range-test/WeakHashtableTestCase.java deleted file mode 100644 index 4781ea54..00000000 --- a/src/test/resources/test-applications/missing-node-range-test/WeakHashtableTestCase.java +++ /dev/null @@ -1,36 +0,0 @@ -import java.lang.ref.ReferenceQueue; -import java.lang.ref.WeakReference; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Enumeration; -import java.util.HashMap; -import java.util.Map; -import java.util.Set; -import junit.framework.TestCase; - -public class WeakHashtableTestCase extends TestCase { - - public static class TestThread extends Thread { - - public TestThread(final String name) { - super(name); - } - - @Override - public void run() { - for (int i = 0; i < RUN_LOOPS; i++) { - hashtable.put("key:" + i % 10, Boolean.TRUE); - if (i % 50 == 0) { - yield(); - } - } - } - } - private static final int RUN_LOOPS = 3000; - private static WeakHashtable hashtable; - - public WeakHashtableTestCase(final String testName) { - super(testName); - } - -} diff --git a/src/test/resources/test-applications/mvnw-corrupt-test/.dockerignore b/src/test/resources/test-applications/mvnw-corrupt-test/.dockerignore deleted file mode 100644 index 326c2bc2..00000000 --- a/src/test/resources/test-applications/mvnw-corrupt-test/.dockerignore +++ /dev/null @@ -1,3 +0,0 @@ -target/ -!target/*.war -!target/liberty/wlp/usr/shared/resources/* diff --git a/src/test/resources/test-applications/mvnw-corrupt-test/.gitignore b/src/test/resources/test-applications/mvnw-corrupt-test/.gitignore deleted file mode 100644 index fef207d2..00000000 --- a/src/test/resources/test-applications/mvnw-corrupt-test/.gitignore +++ /dev/null @@ -1,11 +0,0 @@ -target/ -pom.xml.tag -pom.xml.releaseBackup -pom.xml.versionsBackup -pom.xml.next -release.properties -dependency-reduced-pom.xml -buildNumber.properties -.mvn/timing.properties -# https://github.com/takari/maven-wrapper#usage-without-binary-jar -.mvn/wrapper/maven-wrapper.jar \ No newline at end of file diff --git a/src/test/resources/test-applications/mvnw-corrupt-test/.mvn/wrapper/maven-wrapper.properties b/src/test/resources/test-applications/mvnw-corrupt-test/.mvn/wrapper/maven-wrapper.properties deleted file mode 100644 index 207aa436..00000000 --- a/src/test/resources/test-applications/mvnw-corrupt-test/.mvn/wrapper/maven-wrapper.properties +++ /dev/null @@ -1,2 +0,0 @@ -distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.1/apache-maven-3.9.1-bin.zip -wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.1/maven-wrapper-3.1.1.jar diff --git a/src/test/resources/test-applications/mvnw-corrupt-test/Dockerfile b/src/test/resources/test-applications/mvnw-corrupt-test/Dockerfile deleted file mode 100644 index 05e9a7e2..00000000 --- a/src/test/resources/test-applications/mvnw-corrupt-test/Dockerfile +++ /dev/null @@ -1,10 +0,0 @@ - -FROM icr.io/appcafe/open-liberty:kernel-slim-java17-openj9-ubi - -COPY --chown=1001:0 /src/main/liberty/config /config - -RUN features.sh - -COPY --chown=1001:0 target/*.war /config/apps - -RUN configure.sh diff --git a/src/test/resources/test-applications/mvnw-corrupt-test/README.txt b/src/test/resources/test-applications/mvnw-corrupt-test/README.txt deleted file mode 100644 index 0e4c219b..00000000 --- a/src/test/resources/test-applications/mvnw-corrupt-test/README.txt +++ /dev/null @@ -1,35 +0,0 @@ -After you generate a starter project, these instructions will help you with what to do next. - -The Open Liberty starter gives you a simple, quick way to get the necessary files to start building -an application on Open Liberty. There is no need to search how to find out what to add to your -Maven build files. A simple RestApplication.java file is generated for you to start -creating a REST based application. A server.xml configuration file is provided with the necessary -features for the MicroProfile and Jakarta EE versions that you previously selected. - -If you plan on developing and/or deploying your app in a containerized environment, the included -Dockerfile will make it easier to create your application image on top of the Open Liberty Docker -image. - -1) Once you download the starter project, unpackage the .zip file on your machine. -2) Open a command line session, navigate to the installation directory, and run `./mvnw liberty:dev` (Linux/Mac) or `mvnw liberty:dev` (Windows). - This will install all required dependencies and start the default server. When complete, you will - see the necessary features installed and the message "server is ready to run a smarter planet." - -For information on developing your application in dev mode using Maven, see the -dev mode documentation (https://openliberty.io/docs/latest/development-mode.html). - -For further help on getting started actually developing your application, see some of our -MicroProfile guides (https://openliberty.io/guides/?search=microprofile&key=tag) and Jakarta EE -guides (https://openliberty.io/guides/?search=jakarta%20ee&key=tag). - -If you have problems building the starter project, make sure the Java SE version on your -machine matches the Java SE version you picked from the Open Liberty starter on the downloads -page (https://openliberty.io/downloads/). You can test this with the command `java -version`. - -Open Liberty performs at its best when running using Open J9 which can be obtained via IBM Semeru -(https://developer.ibm.com/languages/java/semeru-runtimes/downloads/). For a full list of supported -Java SE versions and where to obtain them, reference the Java SE support page -(https://openliberty.io/docs/latest/java-se.html). - -If you find any issues with the starter project or have recommendations to improve it, open an -issue in the starter GitHub repo (https://github.com/OpenLiberty/start.openliberty.io). diff --git a/src/test/resources/test-applications/mvnw-corrupt-test/mvnw b/src/test/resources/test-applications/mvnw-corrupt-test/mvnw deleted file mode 100644 index e69de29b..00000000 diff --git a/src/test/resources/test-applications/mvnw-corrupt-test/pom.xml b/src/test/resources/test-applications/mvnw-corrupt-test/pom.xml deleted file mode 100644 index 9b78f42c..00000000 --- a/src/test/resources/test-applications/mvnw-corrupt-test/pom.xml +++ /dev/null @@ -1,57 +0,0 @@ - - - 4.0.0 - - com.demo - my-javaee-mvn - 1.0-SNAPSHOT - war - - - 17 - 17 - UTF-8 - - - - - javax - javaee-api - 7.0 - provided - - - org.eclipse.microprofile - microprofile - 1.4 - pom - provided - - - - - my-javaee-mvn - - - - org.apache.maven.plugins - maven-war-plugin - 3.3.2 - - - io.openliberty.tools - liberty-maven-plugin - 3.11.1 - - - - - - io.openliberty.tools - liberty-maven-plugin - - - - diff --git a/src/test/resources/test-applications/mvnw-corrupt-test/settings.gradle b/src/test/resources/test-applications/mvnw-corrupt-test/settings.gradle deleted file mode 100644 index 81f4ec38..00000000 --- a/src/test/resources/test-applications/mvnw-corrupt-test/settings.gradle +++ /dev/null @@ -1,5 +0,0 @@ -/* - * This file was generated by the Gradle 'init' task. - */ - -rootProject.name = 'my-javaee-mvn' diff --git a/src/test/resources/test-applications/mvnw-corrupt-test/src/main/java/com/demo/CurrentTimeServlet.java b/src/test/resources/test-applications/mvnw-corrupt-test/src/main/java/com/demo/CurrentTimeServlet.java deleted file mode 100644 index dbc91c39..00000000 --- a/src/test/resources/test-applications/mvnw-corrupt-test/src/main/java/com/demo/CurrentTimeServlet.java +++ /dev/null @@ -1,28 +0,0 @@ -// Assisted by watsonx Code Assistant - -package com.demo; - -import java.io.IOException; -import java.io.PrintWriter; -import java.util.Date; -import javax.servlet.ServletException; -import javax.servlet.annotation.WebServlet; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -@WebServlet("/currentTime") -public class CurrentTimeServlet extends HttpServlet { - - private static final long serialVersionUID = 1L; - - @Override - protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - response.setContentType("text/html"); - PrintWriter out = response.getWriter(); - out.println("

    Current Time

    "); - out.println("

    The current date and time is:

    "); - out.println("

    " + new Date() + "

    "); - } - -} diff --git a/src/test/resources/test-applications/mvnw-corrupt-test/src/main/java/com/demo/rest/RestApplication.java b/src/test/resources/test-applications/mvnw-corrupt-test/src/main/java/com/demo/rest/RestApplication.java deleted file mode 100644 index 7da72e46..00000000 --- a/src/test/resources/test-applications/mvnw-corrupt-test/src/main/java/com/demo/rest/RestApplication.java +++ /dev/null @@ -1,9 +0,0 @@ -package com.demo.rest; - -import javax.ws.rs.ApplicationPath; -import javax.ws.rs.core.Application; - -@ApplicationPath("/api") -public class RestApplication extends Application { - -} diff --git a/src/test/resources/test-applications/mvnw-corrupt-test/src/main/liberty/config/server.xml b/src/test/resources/test-applications/mvnw-corrupt-test/src/main/liberty/config/server.xml deleted file mode 100644 index 70e8fc1a..00000000 --- a/src/test/resources/test-applications/mvnw-corrupt-test/src/main/liberty/config/server.xml +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - javaee-7.0 - microProfile-1.4 - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/test/resources/test-applications/mvnw-corrupt-test/src/main/resources/META-INF/microprofile-config.properties b/src/test/resources/test-applications/mvnw-corrupt-test/src/main/resources/META-INF/microprofile-config.properties deleted file mode 100644 index e69de29b..00000000 diff --git a/src/test/resources/test-applications/mvnw-working-test/.dockerignore b/src/test/resources/test-applications/mvnw-working-test/.dockerignore deleted file mode 100644 index 326c2bc2..00000000 --- a/src/test/resources/test-applications/mvnw-working-test/.dockerignore +++ /dev/null @@ -1,3 +0,0 @@ -target/ -!target/*.war -!target/liberty/wlp/usr/shared/resources/* diff --git a/src/test/resources/test-applications/mvnw-working-test/.gitignore b/src/test/resources/test-applications/mvnw-working-test/.gitignore deleted file mode 100644 index fef207d2..00000000 --- a/src/test/resources/test-applications/mvnw-working-test/.gitignore +++ /dev/null @@ -1,11 +0,0 @@ -target/ -pom.xml.tag -pom.xml.releaseBackup -pom.xml.versionsBackup -pom.xml.next -release.properties -dependency-reduced-pom.xml -buildNumber.properties -.mvn/timing.properties -# https://github.com/takari/maven-wrapper#usage-without-binary-jar -.mvn/wrapper/maven-wrapper.jar \ No newline at end of file diff --git a/src/test/resources/test-applications/mvnw-working-test/.mvn/wrapper/maven-wrapper.properties b/src/test/resources/test-applications/mvnw-working-test/.mvn/wrapper/maven-wrapper.properties deleted file mode 100644 index 2f093d08..00000000 --- a/src/test/resources/test-applications/mvnw-working-test/.mvn/wrapper/maven-wrapper.properties +++ /dev/null @@ -1,19 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -wrapperVersion=3.3.2 -distributionType=only-script -distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.5/apache-maven-3.9.5-bin.zip diff --git a/src/test/resources/test-applications/mvnw-working-test/Dockerfile b/src/test/resources/test-applications/mvnw-working-test/Dockerfile deleted file mode 100644 index 05e9a7e2..00000000 --- a/src/test/resources/test-applications/mvnw-working-test/Dockerfile +++ /dev/null @@ -1,10 +0,0 @@ - -FROM icr.io/appcafe/open-liberty:kernel-slim-java17-openj9-ubi - -COPY --chown=1001:0 /src/main/liberty/config /config - -RUN features.sh - -COPY --chown=1001:0 target/*.war /config/apps - -RUN configure.sh diff --git a/src/test/resources/test-applications/mvnw-working-test/README.txt b/src/test/resources/test-applications/mvnw-working-test/README.txt deleted file mode 100644 index 0e4c219b..00000000 --- a/src/test/resources/test-applications/mvnw-working-test/README.txt +++ /dev/null @@ -1,35 +0,0 @@ -After you generate a starter project, these instructions will help you with what to do next. - -The Open Liberty starter gives you a simple, quick way to get the necessary files to start building -an application on Open Liberty. There is no need to search how to find out what to add to your -Maven build files. A simple RestApplication.java file is generated for you to start -creating a REST based application. A server.xml configuration file is provided with the necessary -features for the MicroProfile and Jakarta EE versions that you previously selected. - -If you plan on developing and/or deploying your app in a containerized environment, the included -Dockerfile will make it easier to create your application image on top of the Open Liberty Docker -image. - -1) Once you download the starter project, unpackage the .zip file on your machine. -2) Open a command line session, navigate to the installation directory, and run `./mvnw liberty:dev` (Linux/Mac) or `mvnw liberty:dev` (Windows). - This will install all required dependencies and start the default server. When complete, you will - see the necessary features installed and the message "server is ready to run a smarter planet." - -For information on developing your application in dev mode using Maven, see the -dev mode documentation (https://openliberty.io/docs/latest/development-mode.html). - -For further help on getting started actually developing your application, see some of our -MicroProfile guides (https://openliberty.io/guides/?search=microprofile&key=tag) and Jakarta EE -guides (https://openliberty.io/guides/?search=jakarta%20ee&key=tag). - -If you have problems building the starter project, make sure the Java SE version on your -machine matches the Java SE version you picked from the Open Liberty starter on the downloads -page (https://openliberty.io/downloads/). You can test this with the command `java -version`. - -Open Liberty performs at its best when running using Open J9 which can be obtained via IBM Semeru -(https://developer.ibm.com/languages/java/semeru-runtimes/downloads/). For a full list of supported -Java SE versions and where to obtain them, reference the Java SE support page -(https://openliberty.io/docs/latest/java-se.html). - -If you find any issues with the starter project or have recommendations to improve it, open an -issue in the starter GitHub repo (https://github.com/OpenLiberty/start.openliberty.io). diff --git a/src/test/resources/test-applications/mvnw-working-test/mvnw b/src/test/resources/test-applications/mvnw-working-test/mvnw deleted file mode 100755 index 19529ddf..00000000 --- a/src/test/resources/test-applications/mvnw-working-test/mvnw +++ /dev/null @@ -1,259 +0,0 @@ -#!/bin/sh -# ---------------------------------------------------------------------------- -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# ---------------------------------------------------------------------------- - -# ---------------------------------------------------------------------------- -# Apache Maven Wrapper startup batch script, version 3.3.2 -# -# Optional ENV vars -# ----------------- -# JAVA_HOME - location of a JDK home dir, required when download maven via java source -# MVNW_REPOURL - repo url base for downloading maven distribution -# MVNW_USERNAME/MVNW_PASSWORD - user and password for downloading maven -# MVNW_VERBOSE - true: enable verbose log; debug: trace the mvnw script; others: silence the output -# ---------------------------------------------------------------------------- - -set -euf -[ "${MVNW_VERBOSE-}" != debug ] || set -x - -# OS specific support. -native_path() { printf %s\\n "$1"; } -case "$(uname)" in -CYGWIN* | MINGW*) - [ -z "${JAVA_HOME-}" ] || JAVA_HOME="$(cygpath --unix "$JAVA_HOME")" - native_path() { cygpath --path --windows "$1"; } - ;; -esac - -# set JAVACMD and JAVACCMD -set_java_home() { - # For Cygwin and MinGW, ensure paths are in Unix format before anything is touched - if [ -n "${JAVA_HOME-}" ]; then - if [ -x "$JAVA_HOME/jre/sh/java" ]; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" - JAVACCMD="$JAVA_HOME/jre/sh/javac" - else - JAVACMD="$JAVA_HOME/bin/java" - JAVACCMD="$JAVA_HOME/bin/javac" - - if [ ! -x "$JAVACMD" ] || [ ! -x "$JAVACCMD" ]; then - echo "The JAVA_HOME environment variable is not defined correctly, so mvnw cannot run." >&2 - echo "JAVA_HOME is set to \"$JAVA_HOME\", but \"\$JAVA_HOME/bin/java\" or \"\$JAVA_HOME/bin/javac\" does not exist." >&2 - return 1 - fi - fi - else - JAVACMD="$( - 'set' +e - 'unset' -f command 2>/dev/null - 'command' -v java - )" || : - JAVACCMD="$( - 'set' +e - 'unset' -f command 2>/dev/null - 'command' -v javac - )" || : - - if [ ! -x "${JAVACMD-}" ] || [ ! -x "${JAVACCMD-}" ]; then - echo "The java/javac command does not exist in PATH nor is JAVA_HOME set, so mvnw cannot run." >&2 - return 1 - fi - fi -} - -# hash string like Java String::hashCode -hash_string() { - str="${1:-}" h=0 - while [ -n "$str" ]; do - char="${str%"${str#?}"}" - h=$(((h * 31 + $(LC_CTYPE=C printf %d "'$char")) % 4294967296)) - str="${str#?}" - done - printf %x\\n $h -} - -verbose() { :; } -[ "${MVNW_VERBOSE-}" != true ] || verbose() { printf %s\\n "${1-}"; } - -die() { - printf %s\\n "$1" >&2 - exit 1 -} - -trim() { - # MWRAPPER-139: - # Trims trailing and leading whitespace, carriage returns, tabs, and linefeeds. - # Needed for removing poorly interpreted newline sequences when running in more - # exotic environments such as mingw bash on Windows. - printf "%s" "${1}" | tr -d '[:space:]' -} - -# parse distributionUrl and optional distributionSha256Sum, requires .mvn/wrapper/maven-wrapper.properties -while IFS="=" read -r key value; do - case "${key-}" in - distributionUrl) distributionUrl=$(trim "${value-}") ;; - distributionSha256Sum) distributionSha256Sum=$(trim "${value-}") ;; - esac -done <"${0%/*}/.mvn/wrapper/maven-wrapper.properties" -[ -n "${distributionUrl-}" ] || die "cannot read distributionUrl property in ${0%/*}/.mvn/wrapper/maven-wrapper.properties" - -case "${distributionUrl##*/}" in -maven-mvnd-*bin.*) - MVN_CMD=mvnd.sh _MVNW_REPO_PATTERN=/maven/mvnd/ - case "${PROCESSOR_ARCHITECTURE-}${PROCESSOR_ARCHITEW6432-}:$(uname -a)" in - *AMD64:CYGWIN* | *AMD64:MINGW*) distributionPlatform=windows-amd64 ;; - :Darwin*x86_64) distributionPlatform=darwin-amd64 ;; - :Darwin*arm64) distributionPlatform=darwin-aarch64 ;; - :Linux*x86_64*) distributionPlatform=linux-amd64 ;; - *) - echo "Cannot detect native platform for mvnd on $(uname)-$(uname -m), use pure java version" >&2 - distributionPlatform=linux-amd64 - ;; - esac - distributionUrl="${distributionUrl%-bin.*}-$distributionPlatform.zip" - ;; -maven-mvnd-*) MVN_CMD=mvnd.sh _MVNW_REPO_PATTERN=/maven/mvnd/ ;; -*) MVN_CMD="mvn${0##*/mvnw}" _MVNW_REPO_PATTERN=/org/apache/maven/ ;; -esac - -# apply MVNW_REPOURL and calculate MAVEN_HOME -# maven home pattern: ~/.m2/wrapper/dists/{apache-maven-,maven-mvnd--}/ -[ -z "${MVNW_REPOURL-}" ] || distributionUrl="$MVNW_REPOURL$_MVNW_REPO_PATTERN${distributionUrl#*"$_MVNW_REPO_PATTERN"}" -distributionUrlName="${distributionUrl##*/}" -distributionUrlNameMain="${distributionUrlName%.*}" -distributionUrlNameMain="${distributionUrlNameMain%-bin}" -MAVEN_USER_HOME="${MAVEN_USER_HOME:-${HOME}/.m2}" -MAVEN_HOME="${MAVEN_USER_HOME}/wrapper/dists/${distributionUrlNameMain-}/$(hash_string "$distributionUrl")" - -exec_maven() { - unset MVNW_VERBOSE MVNW_USERNAME MVNW_PASSWORD MVNW_REPOURL || : - exec "$MAVEN_HOME/bin/$MVN_CMD" "$@" || die "cannot exec $MAVEN_HOME/bin/$MVN_CMD" -} - -if [ -d "$MAVEN_HOME" ]; then - verbose "found existing MAVEN_HOME at $MAVEN_HOME" - exec_maven "$@" -fi - -case "${distributionUrl-}" in -*?-bin.zip | *?maven-mvnd-?*-?*.zip) ;; -*) die "distributionUrl is not valid, must match *-bin.zip or maven-mvnd-*.zip, but found '${distributionUrl-}'" ;; -esac - -# prepare tmp dir -if TMP_DOWNLOAD_DIR="$(mktemp -d)" && [ -d "$TMP_DOWNLOAD_DIR" ]; then - clean() { rm -rf -- "$TMP_DOWNLOAD_DIR"; } - trap clean HUP INT TERM EXIT -else - die "cannot create temp dir" -fi - -mkdir -p -- "${MAVEN_HOME%/*}" - -# Download and Install Apache Maven -verbose "Couldn't find MAVEN_HOME, downloading and installing it ..." -verbose "Downloading from: $distributionUrl" -verbose "Downloading to: $TMP_DOWNLOAD_DIR/$distributionUrlName" - -# select .zip or .tar.gz -if ! command -v unzip >/dev/null; then - distributionUrl="${distributionUrl%.zip}.tar.gz" - distributionUrlName="${distributionUrl##*/}" -fi - -# verbose opt -__MVNW_QUIET_WGET=--quiet __MVNW_QUIET_CURL=--silent __MVNW_QUIET_UNZIP=-q __MVNW_QUIET_TAR='' -[ "${MVNW_VERBOSE-}" != true ] || __MVNW_QUIET_WGET='' __MVNW_QUIET_CURL='' __MVNW_QUIET_UNZIP='' __MVNW_QUIET_TAR=v - -# normalize http auth -case "${MVNW_PASSWORD:+has-password}" in -'') MVNW_USERNAME='' MVNW_PASSWORD='' ;; -has-password) [ -n "${MVNW_USERNAME-}" ] || MVNW_USERNAME='' MVNW_PASSWORD='' ;; -esac - -if [ -z "${MVNW_USERNAME-}" ] && command -v wget >/dev/null; then - verbose "Found wget ... using wget" - wget ${__MVNW_QUIET_WGET:+"$__MVNW_QUIET_WGET"} "$distributionUrl" -O "$TMP_DOWNLOAD_DIR/$distributionUrlName" || die "wget: Failed to fetch $distributionUrl" -elif [ -z "${MVNW_USERNAME-}" ] && command -v curl >/dev/null; then - verbose "Found curl ... using curl" - curl ${__MVNW_QUIET_CURL:+"$__MVNW_QUIET_CURL"} -f -L -o "$TMP_DOWNLOAD_DIR/$distributionUrlName" "$distributionUrl" || die "curl: Failed to fetch $distributionUrl" -elif set_java_home; then - verbose "Falling back to use Java to download" - javaSource="$TMP_DOWNLOAD_DIR/Downloader.java" - targetZip="$TMP_DOWNLOAD_DIR/$distributionUrlName" - cat >"$javaSource" <<-END - public class Downloader extends java.net.Authenticator - { - protected java.net.PasswordAuthentication getPasswordAuthentication() - { - return new java.net.PasswordAuthentication( System.getenv( "MVNW_USERNAME" ), System.getenv( "MVNW_PASSWORD" ).toCharArray() ); - } - public static void main( String[] args ) throws Exception - { - setDefault( new Downloader() ); - java.nio.file.Files.copy( java.net.URI.create( args[0] ).toURL().openStream(), java.nio.file.Paths.get( args[1] ).toAbsolutePath().normalize() ); - } - } - END - # For Cygwin/MinGW, switch paths to Windows format before running javac and java - verbose " - Compiling Downloader.java ..." - "$(native_path "$JAVACCMD")" "$(native_path "$javaSource")" || die "Failed to compile Downloader.java" - verbose " - Running Downloader.java ..." - "$(native_path "$JAVACMD")" -cp "$(native_path "$TMP_DOWNLOAD_DIR")" Downloader "$distributionUrl" "$(native_path "$targetZip")" -fi - -# If specified, validate the SHA-256 sum of the Maven distribution zip file -if [ -n "${distributionSha256Sum-}" ]; then - distributionSha256Result=false - if [ "$MVN_CMD" = mvnd.sh ]; then - echo "Checksum validation is not supported for maven-mvnd." >&2 - echo "Please disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties." >&2 - exit 1 - elif command -v sha256sum >/dev/null; then - if echo "$distributionSha256Sum $TMP_DOWNLOAD_DIR/$distributionUrlName" | sha256sum -c >/dev/null 2>&1; then - distributionSha256Result=true - fi - elif command -v shasum >/dev/null; then - if echo "$distributionSha256Sum $TMP_DOWNLOAD_DIR/$distributionUrlName" | shasum -a 256 -c >/dev/null 2>&1; then - distributionSha256Result=true - fi - else - echo "Checksum validation was requested but neither 'sha256sum' or 'shasum' are available." >&2 - echo "Please install either command, or disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties." >&2 - exit 1 - fi - if [ $distributionSha256Result = false ]; then - echo "Error: Failed to validate Maven distribution SHA-256, your Maven distribution might be compromised." >&2 - echo "If you updated your Maven version, you need to update the specified distributionSha256Sum property." >&2 - exit 1 - fi -fi - -# unzip and move -if command -v unzip >/dev/null; then - unzip ${__MVNW_QUIET_UNZIP:+"$__MVNW_QUIET_UNZIP"} "$TMP_DOWNLOAD_DIR/$distributionUrlName" -d "$TMP_DOWNLOAD_DIR" || die "failed to unzip" -else - tar xzf${__MVNW_QUIET_TAR:+"$__MVNW_QUIET_TAR"} "$TMP_DOWNLOAD_DIR/$distributionUrlName" -C "$TMP_DOWNLOAD_DIR" || die "failed to untar" -fi -printf %s\\n "$distributionUrl" >"$TMP_DOWNLOAD_DIR/$distributionUrlNameMain/mvnw.url" -mv -- "$TMP_DOWNLOAD_DIR/$distributionUrlNameMain" "$MAVEN_HOME" || [ -d "$MAVEN_HOME" ] || die "fail to move MAVEN_HOME" - -clean || : -exec_maven "$@" diff --git a/src/test/resources/test-applications/mvnw-working-test/mvnw.cmd b/src/test/resources/test-applications/mvnw-working-test/mvnw.cmd deleted file mode 100644 index b150b91e..00000000 --- a/src/test/resources/test-applications/mvnw-working-test/mvnw.cmd +++ /dev/null @@ -1,149 +0,0 @@ -<# : batch portion -@REM ---------------------------------------------------------------------------- -@REM Licensed to the Apache Software Foundation (ASF) under one -@REM or more contributor license agreements. See the NOTICE file -@REM distributed with this work for additional information -@REM regarding copyright ownership. The ASF licenses this file -@REM to you under the Apache License, Version 2.0 (the -@REM "License"); you may not use this file except in compliance -@REM with the License. You may obtain a copy of the License at -@REM -@REM http://www.apache.org/licenses/LICENSE-2.0 -@REM -@REM Unless required by applicable law or agreed to in writing, -@REM software distributed under the License is distributed on an -@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -@REM KIND, either express or implied. See the License for the -@REM specific language governing permissions and limitations -@REM under the License. -@REM ---------------------------------------------------------------------------- - -@REM ---------------------------------------------------------------------------- -@REM Apache Maven Wrapper startup batch script, version 3.3.2 -@REM -@REM Optional ENV vars -@REM MVNW_REPOURL - repo url base for downloading maven distribution -@REM MVNW_USERNAME/MVNW_PASSWORD - user and password for downloading maven -@REM MVNW_VERBOSE - true: enable verbose log; others: silence the output -@REM ---------------------------------------------------------------------------- - -@IF "%__MVNW_ARG0_NAME__%"=="" (SET __MVNW_ARG0_NAME__=%~nx0) -@SET __MVNW_CMD__= -@SET __MVNW_ERROR__= -@SET __MVNW_PSMODULEP_SAVE=%PSModulePath% -@SET PSModulePath= -@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 @( - IF "%%A"=="MVN_CMD" (set __MVNW_CMD__=%%B) ELSE IF "%%B"=="" (echo %%A) ELSE (echo %%A=%%B) -) -@SET PSModulePath=%__MVNW_PSMODULEP_SAVE% -@SET __MVNW_PSMODULEP_SAVE= -@SET __MVNW_ARG0_NAME__= -@SET MVNW_USERNAME= -@SET MVNW_PASSWORD= -@IF NOT "%__MVNW_CMD__%"=="" (%__MVNW_CMD__% %*) -@echo Cannot start maven from wrapper >&2 && exit /b 1 -@GOTO :EOF -: end batch / begin powershell #> - -$ErrorActionPreference = "Stop" -if ($env:MVNW_VERBOSE -eq "true") { - $VerbosePreference = "Continue" -} - -# calculate distributionUrl, requires .mvn/wrapper/maven-wrapper.properties -$distributionUrl = (Get-Content -Raw "$scriptDir/.mvn/wrapper/maven-wrapper.properties" | ConvertFrom-StringData).distributionUrl -if (!$distributionUrl) { - Write-Error "cannot read distributionUrl property in $scriptDir/.mvn/wrapper/maven-wrapper.properties" -} - -switch -wildcard -casesensitive ( $($distributionUrl -replace '^.*/','') ) { - "maven-mvnd-*" { - $USE_MVND = $true - $distributionUrl = $distributionUrl -replace '-bin\.[^.]*$',"-windows-amd64.zip" - $MVN_CMD = "mvnd.cmd" - break - } - default { - $USE_MVND = $false - $MVN_CMD = $script -replace '^mvnw','mvn' - break - } -} - -# apply MVNW_REPOURL and calculate MAVEN_HOME -# maven home pattern: ~/.m2/wrapper/dists/{apache-maven-,maven-mvnd--}/ -if ($env:MVNW_REPOURL) { - $MVNW_REPO_PATTERN = if ($USE_MVND) { "/org/apache/maven/" } else { "/maven/mvnd/" } - $distributionUrl = "$env:MVNW_REPOURL$MVNW_REPO_PATTERN$($distributionUrl -replace '^.*'+$MVNW_REPO_PATTERN,'')" -} -$distributionUrlName = $distributionUrl -replace '^.*/','' -$distributionUrlNameMain = $distributionUrlName -replace '\.[^.]*$','' -replace '-bin$','' -$MAVEN_HOME_PARENT = "$HOME/.m2/wrapper/dists/$distributionUrlNameMain" -if ($env:MAVEN_USER_HOME) { - $MAVEN_HOME_PARENT = "$env:MAVEN_USER_HOME/wrapper/dists/$distributionUrlNameMain" -} -$MAVEN_HOME_NAME = ([System.Security.Cryptography.MD5]::Create().ComputeHash([byte[]][char[]]$distributionUrl) | ForEach-Object {$_.ToString("x2")}) -join '' -$MAVEN_HOME = "$MAVEN_HOME_PARENT/$MAVEN_HOME_NAME" - -if (Test-Path -Path "$MAVEN_HOME" -PathType Container) { - Write-Verbose "found existing MAVEN_HOME at $MAVEN_HOME" - Write-Output "MVN_CMD=$MAVEN_HOME/bin/$MVN_CMD" - exit $? -} - -if (! $distributionUrlNameMain -or ($distributionUrlName -eq $distributionUrlNameMain)) { - Write-Error "distributionUrl is not valid, must end with *-bin.zip, but found $distributionUrl" -} - -# prepare tmp dir -$TMP_DOWNLOAD_DIR_HOLDER = New-TemporaryFile -$TMP_DOWNLOAD_DIR = New-Item -Itemtype Directory -Path "$TMP_DOWNLOAD_DIR_HOLDER.dir" -$TMP_DOWNLOAD_DIR_HOLDER.Delete() | Out-Null -trap { - if ($TMP_DOWNLOAD_DIR.Exists) { - try { Remove-Item $TMP_DOWNLOAD_DIR -Recurse -Force | Out-Null } - catch { Write-Warning "Cannot remove $TMP_DOWNLOAD_DIR" } - } -} - -New-Item -Itemtype Directory -Path "$MAVEN_HOME_PARENT" -Force | Out-Null - -# Download and Install Apache Maven -Write-Verbose "Couldn't find MAVEN_HOME, downloading and installing it ..." -Write-Verbose "Downloading from: $distributionUrl" -Write-Verbose "Downloading to: $TMP_DOWNLOAD_DIR/$distributionUrlName" - -$webclient = New-Object System.Net.WebClient -if ($env:MVNW_USERNAME -and $env:MVNW_PASSWORD) { - $webclient.Credentials = New-Object System.Net.NetworkCredential($env:MVNW_USERNAME, $env:MVNW_PASSWORD) -} -[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 -$webclient.DownloadFile($distributionUrl, "$TMP_DOWNLOAD_DIR/$distributionUrlName") | Out-Null - -# If specified, validate the SHA-256 sum of the Maven distribution zip file -$distributionSha256Sum = (Get-Content -Raw "$scriptDir/.mvn/wrapper/maven-wrapper.properties" | ConvertFrom-StringData).distributionSha256Sum -if ($distributionSha256Sum) { - if ($USE_MVND) { - Write-Error "Checksum validation is not supported for maven-mvnd. `nPlease disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties." - } - Import-Module $PSHOME\Modules\Microsoft.PowerShell.Utility -Function Get-FileHash - if ((Get-FileHash "$TMP_DOWNLOAD_DIR/$distributionUrlName" -Algorithm SHA256).Hash.ToLower() -ne $distributionSha256Sum) { - 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." - } -} - -# unzip and move -Expand-Archive "$TMP_DOWNLOAD_DIR/$distributionUrlName" -DestinationPath "$TMP_DOWNLOAD_DIR" | Out-Null -Rename-Item -Path "$TMP_DOWNLOAD_DIR/$distributionUrlNameMain" -NewName $MAVEN_HOME_NAME | Out-Null -try { - Move-Item -Path "$TMP_DOWNLOAD_DIR/$MAVEN_HOME_NAME" -Destination $MAVEN_HOME_PARENT | Out-Null -} catch { - if (! (Test-Path -Path "$MAVEN_HOME" -PathType Container)) { - Write-Error "fail to move MAVEN_HOME" - } -} finally { - try { Remove-Item $TMP_DOWNLOAD_DIR -Recurse -Force | Out-Null } - catch { Write-Warning "Cannot remove $TMP_DOWNLOAD_DIR" } -} - -Write-Output "MVN_CMD=$MAVEN_HOME/bin/$MVN_CMD" diff --git a/src/test/resources/test-applications/mvnw-working-test/pom.xml b/src/test/resources/test-applications/mvnw-working-test/pom.xml deleted file mode 100644 index 9b78f42c..00000000 --- a/src/test/resources/test-applications/mvnw-working-test/pom.xml +++ /dev/null @@ -1,57 +0,0 @@ - - - 4.0.0 - - com.demo - my-javaee-mvn - 1.0-SNAPSHOT - war - - - 17 - 17 - UTF-8 - - - - - javax - javaee-api - 7.0 - provided - - - org.eclipse.microprofile - microprofile - 1.4 - pom - provided - - - - - my-javaee-mvn - - - - org.apache.maven.plugins - maven-war-plugin - 3.3.2 - - - io.openliberty.tools - liberty-maven-plugin - 3.11.1 - - - - - - io.openliberty.tools - liberty-maven-plugin - - - - diff --git a/src/test/resources/test-applications/mvnw-working-test/src/main/java/com/demo/CurrentTimeServlet.java b/src/test/resources/test-applications/mvnw-working-test/src/main/java/com/demo/CurrentTimeServlet.java deleted file mode 100644 index dbc91c39..00000000 --- a/src/test/resources/test-applications/mvnw-working-test/src/main/java/com/demo/CurrentTimeServlet.java +++ /dev/null @@ -1,28 +0,0 @@ -// Assisted by watsonx Code Assistant - -package com.demo; - -import java.io.IOException; -import java.io.PrintWriter; -import java.util.Date; -import javax.servlet.ServletException; -import javax.servlet.annotation.WebServlet; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -@WebServlet("/currentTime") -public class CurrentTimeServlet extends HttpServlet { - - private static final long serialVersionUID = 1L; - - @Override - protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - response.setContentType("text/html"); - PrintWriter out = response.getWriter(); - out.println("

    Current Time

    "); - out.println("

    The current date and time is:

    "); - out.println("

    " + new Date() + "

    "); - } - -} diff --git a/src/test/resources/test-applications/mvnw-working-test/src/main/java/com/demo/rest/RestApplication.java b/src/test/resources/test-applications/mvnw-working-test/src/main/java/com/demo/rest/RestApplication.java deleted file mode 100644 index 7da72e46..00000000 --- a/src/test/resources/test-applications/mvnw-working-test/src/main/java/com/demo/rest/RestApplication.java +++ /dev/null @@ -1,9 +0,0 @@ -package com.demo.rest; - -import javax.ws.rs.ApplicationPath; -import javax.ws.rs.core.Application; - -@ApplicationPath("/api") -public class RestApplication extends Application { - -} diff --git a/src/test/resources/test-applications/mvnw-working-test/src/main/liberty/config/server.xml b/src/test/resources/test-applications/mvnw-working-test/src/main/liberty/config/server.xml deleted file mode 100644 index 70e8fc1a..00000000 --- a/src/test/resources/test-applications/mvnw-working-test/src/main/liberty/config/server.xml +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - javaee-7.0 - microProfile-1.4 - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/test/resources/test-applications/mvnw-working-test/src/main/resources/META-INF/microprofile-config.properties b/src/test/resources/test-applications/mvnw-working-test/src/main/resources/META-INF/microprofile-config.properties deleted file mode 100644 index e69de29b..00000000 diff --git a/src/test/resources/test-applications/no-mvnw-test/.dockerignore b/src/test/resources/test-applications/no-mvnw-test/.dockerignore deleted file mode 100644 index 326c2bc2..00000000 --- a/src/test/resources/test-applications/no-mvnw-test/.dockerignore +++ /dev/null @@ -1,3 +0,0 @@ -target/ -!target/*.war -!target/liberty/wlp/usr/shared/resources/* diff --git a/src/test/resources/test-applications/no-mvnw-test/.gitignore b/src/test/resources/test-applications/no-mvnw-test/.gitignore deleted file mode 100644 index fef207d2..00000000 --- a/src/test/resources/test-applications/no-mvnw-test/.gitignore +++ /dev/null @@ -1,11 +0,0 @@ -target/ -pom.xml.tag -pom.xml.releaseBackup -pom.xml.versionsBackup -pom.xml.next -release.properties -dependency-reduced-pom.xml -buildNumber.properties -.mvn/timing.properties -# https://github.com/takari/maven-wrapper#usage-without-binary-jar -.mvn/wrapper/maven-wrapper.jar \ No newline at end of file diff --git a/src/test/resources/test-applications/no-mvnw-test/.mvn/wrapper/maven-wrapper.properties b/src/test/resources/test-applications/no-mvnw-test/.mvn/wrapper/maven-wrapper.properties deleted file mode 100644 index 207aa436..00000000 --- a/src/test/resources/test-applications/no-mvnw-test/.mvn/wrapper/maven-wrapper.properties +++ /dev/null @@ -1,2 +0,0 @@ -distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.1/apache-maven-3.9.1-bin.zip -wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.1/maven-wrapper-3.1.1.jar diff --git a/src/test/resources/test-applications/no-mvnw-test/Dockerfile b/src/test/resources/test-applications/no-mvnw-test/Dockerfile deleted file mode 100644 index 05e9a7e2..00000000 --- a/src/test/resources/test-applications/no-mvnw-test/Dockerfile +++ /dev/null @@ -1,10 +0,0 @@ - -FROM icr.io/appcafe/open-liberty:kernel-slim-java17-openj9-ubi - -COPY --chown=1001:0 /src/main/liberty/config /config - -RUN features.sh - -COPY --chown=1001:0 target/*.war /config/apps - -RUN configure.sh diff --git a/src/test/resources/test-applications/no-mvnw-test/README.txt b/src/test/resources/test-applications/no-mvnw-test/README.txt deleted file mode 100644 index 0e4c219b..00000000 --- a/src/test/resources/test-applications/no-mvnw-test/README.txt +++ /dev/null @@ -1,35 +0,0 @@ -After you generate a starter project, these instructions will help you with what to do next. - -The Open Liberty starter gives you a simple, quick way to get the necessary files to start building -an application on Open Liberty. There is no need to search how to find out what to add to your -Maven build files. A simple RestApplication.java file is generated for you to start -creating a REST based application. A server.xml configuration file is provided with the necessary -features for the MicroProfile and Jakarta EE versions that you previously selected. - -If you plan on developing and/or deploying your app in a containerized environment, the included -Dockerfile will make it easier to create your application image on top of the Open Liberty Docker -image. - -1) Once you download the starter project, unpackage the .zip file on your machine. -2) Open a command line session, navigate to the installation directory, and run `./mvnw liberty:dev` (Linux/Mac) or `mvnw liberty:dev` (Windows). - This will install all required dependencies and start the default server. When complete, you will - see the necessary features installed and the message "server is ready to run a smarter planet." - -For information on developing your application in dev mode using Maven, see the -dev mode documentation (https://openliberty.io/docs/latest/development-mode.html). - -For further help on getting started actually developing your application, see some of our -MicroProfile guides (https://openliberty.io/guides/?search=microprofile&key=tag) and Jakarta EE -guides (https://openliberty.io/guides/?search=jakarta%20ee&key=tag). - -If you have problems building the starter project, make sure the Java SE version on your -machine matches the Java SE version you picked from the Open Liberty starter on the downloads -page (https://openliberty.io/downloads/). You can test this with the command `java -version`. - -Open Liberty performs at its best when running using Open J9 which can be obtained via IBM Semeru -(https://developer.ibm.com/languages/java/semeru-runtimes/downloads/). For a full list of supported -Java SE versions and where to obtain them, reference the Java SE support page -(https://openliberty.io/docs/latest/java-se.html). - -If you find any issues with the starter project or have recommendations to improve it, open an -issue in the starter GitHub repo (https://github.com/OpenLiberty/start.openliberty.io). diff --git a/src/test/resources/test-applications/no-mvnw-test/pom.xml b/src/test/resources/test-applications/no-mvnw-test/pom.xml deleted file mode 100644 index 9b78f42c..00000000 --- a/src/test/resources/test-applications/no-mvnw-test/pom.xml +++ /dev/null @@ -1,57 +0,0 @@ - - - 4.0.0 - - com.demo - my-javaee-mvn - 1.0-SNAPSHOT - war - - - 17 - 17 - UTF-8 - - - - - javax - javaee-api - 7.0 - provided - - - org.eclipse.microprofile - microprofile - 1.4 - pom - provided - - - - - my-javaee-mvn - - - - org.apache.maven.plugins - maven-war-plugin - 3.3.2 - - - io.openliberty.tools - liberty-maven-plugin - 3.11.1 - - - - - - io.openliberty.tools - liberty-maven-plugin - - - - diff --git a/src/test/resources/test-applications/no-mvnw-test/src/main/java/com/demo/CurrentTimeServlet.java b/src/test/resources/test-applications/no-mvnw-test/src/main/java/com/demo/CurrentTimeServlet.java deleted file mode 100644 index dbc91c39..00000000 --- a/src/test/resources/test-applications/no-mvnw-test/src/main/java/com/demo/CurrentTimeServlet.java +++ /dev/null @@ -1,28 +0,0 @@ -// Assisted by watsonx Code Assistant - -package com.demo; - -import java.io.IOException; -import java.io.PrintWriter; -import java.util.Date; -import javax.servlet.ServletException; -import javax.servlet.annotation.WebServlet; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -@WebServlet("/currentTime") -public class CurrentTimeServlet extends HttpServlet { - - private static final long serialVersionUID = 1L; - - @Override - protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - response.setContentType("text/html"); - PrintWriter out = response.getWriter(); - out.println("

    Current Time

    "); - out.println("

    The current date and time is:

    "); - out.println("

    " + new Date() + "

    "); - } - -} diff --git a/src/test/resources/test-applications/no-mvnw-test/src/main/java/com/demo/rest/RestApplication.java b/src/test/resources/test-applications/no-mvnw-test/src/main/java/com/demo/rest/RestApplication.java deleted file mode 100644 index 7da72e46..00000000 --- a/src/test/resources/test-applications/no-mvnw-test/src/main/java/com/demo/rest/RestApplication.java +++ /dev/null @@ -1,9 +0,0 @@ -package com.demo.rest; - -import javax.ws.rs.ApplicationPath; -import javax.ws.rs.core.Application; - -@ApplicationPath("/api") -public class RestApplication extends Application { - -} diff --git a/src/test/resources/test-applications/no-mvnw-test/src/main/liberty/config/server.xml b/src/test/resources/test-applications/no-mvnw-test/src/main/liberty/config/server.xml deleted file mode 100644 index 70e8fc1a..00000000 --- a/src/test/resources/test-applications/no-mvnw-test/src/main/liberty/config/server.xml +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - javaee-7.0 - microProfile-1.4 - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/test/resources/test-applications/no-mvnw-test/src/main/resources/META-INF/microprofile-config.properties b/src/test/resources/test-applications/no-mvnw-test/src/main/resources/META-INF/microprofile-config.properties deleted file mode 100644 index e69de29b..00000000 diff --git a/src/test/resources/test-applications/plantsbywebsphere/.gitignore b/src/test/resources/test-applications/plantsbywebsphere/.gitignore deleted file mode 100644 index 33f0b551..00000000 --- a/src/test/resources/test-applications/plantsbywebsphere/.gitignore +++ /dev/null @@ -1,49 +0,0 @@ -# Compiled source # -################### -*.com -*.class -*.dll -*.exe -*.o -*.so -.metadata -.recommenders -RemoteSystemsTempFiles - -# Packages # -############ -# it's better to unpack these files and commit the raw source -# git has its own built in compression methods -*.7z -*.dmg -*.gz -*.iso -*.rar -*.tar -*.zip -*.war - -# Logs and databases # -###################### -*.log -*.sql -*.sqlite - -# OS generated files # -###################### -.DS_Store -.DS_Store? -._* -.Spotlight-V100 -.Trashes -ehthumbs.db -Thumbs.db - -/.apt_generated/ -/target/ -.settings/ -/.gradle/ -/build/ -bin/ -.classpath -.project diff --git a/src/test/resources/test-applications/plantsbywebsphere/LICENSE b/src/test/resources/test-applications/plantsbywebsphere/LICENSE deleted file mode 100644 index 8dada3ed..00000000 --- a/src/test/resources/test-applications/plantsbywebsphere/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "{}" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright {yyyy} {name of copyright owner} - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/src/test/resources/test-applications/plantsbywebsphere/README.md b/src/test/resources/test-applications/plantsbywebsphere/README.md deleted file mode 100644 index b8d9fde0..00000000 --- a/src/test/resources/test-applications/plantsbywebsphere/README.md +++ /dev/null @@ -1,40 +0,0 @@ -# sample.plantsbywebsphere -Updated Plants By WebSphere showcase sample to run on WebSphere Liberty. - -This Repository is for testing the PlantsByWebSphere application -in an open source development environment. - -## How to run: - -1. Clone the github repo -2. Start the Liberty server and open the application in a web browser by running: -``` -./gradlew start open -``` - -### Collaborators: -- Dalia A. Abo Sheasha -- Ryan Gallus -- Samuel Ivanecky -- Alex Mortimer - -### Overview -This repository contains the PlantsByWebSphere Java EE sample application. There are two versions of the sample application. The main branch contains the original version of PlantsByWebSphere, while the rest branch contains an updated version which is still under development. - -### Original -The original version of PlantsByWebSphere is a simple Java EE application which uses CDI managed beans, Java Server Faces (JSF), and Java Server Pages (JSP). The sample runs on both TWAS and Liberty. - -### Updated -The updated version of PlantsByWebSphere replaces components of the original with a more modern web application design. JSF and JSP have been replaced by JAX-RS with the application redesigned as a RESTful Web Service. The client is a simple bootstrap framework, and all client JavaScript can be found in application.js. The server's additional REST code can be found in ApplicationResource.java. - -Additionally, this new version supports the use of the javaMail-1.5 feature which requires the configuration of a mailSession object in the server.xml. Below is an example mailSession configuration. Make sure to modify the the mail account (Gmail, Yahoo, etc.) settings and allow access of less secure applications in order for it to connect with PlantsByWebSphere. - -```xml - - - - - - - -``` diff --git a/src/test/resources/test-applications/plantsbywebsphere/build.gradle b/src/test/resources/test-applications/plantsbywebsphere/build.gradle deleted file mode 100644 index 42a7d22d..00000000 --- a/src/test/resources/test-applications/plantsbywebsphere/build.gradle +++ /dev/null @@ -1,82 +0,0 @@ -plugins { - id 'war' - id 'io.openliberty.tools.gradle.Liberty' version '3.9.2' -} - -group = 'net.wasdev.sample' -version = '1.0-SNAPSHOT' -description = "PlantsByWebSphere" - -sourceCompatibility = 1.7 -targetCompatibility = 1.7 -tasks.withType(JavaCompile) { - options.encoding = 'UTF-8' -} - -repositories { - mavenCentral() -} - -configurations { - serverLibs -} - -dependencies { - providedCompile 'javax:javaee-api:7.0' - serverLibs 'org.apache.derby:derby:10.11.1.1' - libertyRuntime 'io.openliberty:openliberty-runtime:23.0.0.12' -} - -task copyServerLibs(type: Copy) { - shouldRunAfter 'libertyCreate' - from configurations.serverLibs - into "${buildDir}/wlp/usr/servers/${rootProject.name}Server/lib" -} - -war.archiveFileName = "${rootProject.name}.war" -test.dependsOn 'war' - -test { - defaultCharacterEncoding = "UTF-8" - useJUnitPlatform() - testLogging { - displayGranularity = 1 - showStandardStreams = true - showStackTraces = true - exceptionFormat = 'full' - events 'PASSED', 'FAILED', 'SKIPPED' - } -} - -ext { - appUrl = "http://localhost:9080/${rootProject.name}/" -} - -liberty { - server { - name = rootProject.name + 'Server' - deploy { - apps = [war] // Correct syntax for deploying apps - } - looseApplication = false - configDirectory = file('src/main/liberty/config') - } -} - -task openBrowser { - description = "Open browser to ${appUrl}" - doLast { - java.awt.Desktop.desktop.browse "${appUrl}".toURI() - } -} - -clean.dependsOn 'libertyStop' -libertyPackage.dependsOn 'libertyStop', 'copyServerLibs' -libertyStart.dependsOn 'libertyStop', 'copyServerLibs' -libertyRun.dependsOn 'libertyStop' -libertyStart.doLast { - println "Application available at: ${appUrl}" -} - -task start { dependsOn 'libertyStart' } -task stop { dependsOn 'libertyStop' } \ No newline at end of file diff --git a/src/test/resources/test-applications/plantsbywebsphere/gradle/wrapper/gradle-wrapper.jar b/src/test/resources/test-applications/plantsbywebsphere/gradle/wrapper/gradle-wrapper.jar deleted file mode 100644 index a4b76b95..00000000 Binary files a/src/test/resources/test-applications/plantsbywebsphere/gradle/wrapper/gradle-wrapper.jar and /dev/null differ diff --git a/src/test/resources/test-applications/plantsbywebsphere/gradle/wrapper/gradle-wrapper.properties b/src/test/resources/test-applications/plantsbywebsphere/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index 164080a8..00000000 --- a/src/test/resources/test-applications/plantsbywebsphere/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,7 +0,0 @@ -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip -networkTimeout=10000 -validateDistributionUrl=true -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists diff --git a/src/test/resources/test-applications/plantsbywebsphere/gradlew b/src/test/resources/test-applications/plantsbywebsphere/gradlew deleted file mode 100755 index f3b75f3b..00000000 --- a/src/test/resources/test-applications/plantsbywebsphere/gradlew +++ /dev/null @@ -1,251 +0,0 @@ -#!/bin/sh - -# -# Copyright © 2015-2021 the original authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# SPDX-License-Identifier: Apache-2.0 -# - -############################################################################## -# -# Gradle start up script for POSIX generated by Gradle. -# -# Important for running: -# -# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is -# noncompliant, but you have some other compliant shell such as ksh or -# bash, then to run this script, type that shell name before the whole -# command line, like: -# -# ksh Gradle -# -# Busybox and similar reduced shells will NOT work, because this script -# requires all of these POSIX shell features: -# * functions; -# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», -# «${var#prefix}», «${var%suffix}», and «$( cmd )»; -# * compound commands having a testable exit status, especially «case»; -# * various built-in commands including «command», «set», and «ulimit». -# -# Important for patching: -# -# (2) This script targets any POSIX shell, so it avoids extensions provided -# by Bash, Ksh, etc; in particular arrays are avoided. -# -# The "traditional" practice of packing multiple parameters into a -# space-separated string is a well documented source of bugs and security -# problems, so this is (mostly) avoided, by progressively accumulating -# options in "$@", and eventually passing that to Java. -# -# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, -# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; -# see the in-line comments for details. -# -# There are tweaks for specific operating systems such as AIX, CygWin, -# Darwin, MinGW, and NonStop. -# -# (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt -# within the Gradle project. -# -# You can find Gradle at https://github.com/gradle/gradle/. -# -############################################################################## - -# Attempt to set APP_HOME - -# Resolve links: $0 may be a link -app_path=$0 - -# Need this for daisy-chained symlinks. -while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] -do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac -done - -# This is normally unused -# shellcheck disable=SC2034 -APP_BASE_NAME=${0##*/} -# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) -APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit - -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD=maximum - -warn () { - echo "$*" -} >&2 - -die () { - echo - echo "$*" - echo - exit 1 -} >&2 - -# OS specific support (must be 'true' or 'false'). -cygwin=false -msys=false -darwin=false -nonstop=false -case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; -esac - -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar - - -# Determine the Java command to use to start the JVM. -if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -else - JAVACMD=java - if ! command -v java >/dev/null 2>&1 - then - die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -fi - -# Increase the maximum file descriptors if we can. -if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC2039,SC3045 - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC2039,SC3045 - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac -fi - -# Collect all arguments for the java command, stacking in reverse order: -# * args from the command line -# * the main class name -# * -classpath -# * -D...appname settings -# * --module-path (only if needed) -# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. - -# For Cygwin or MSYS, switch paths to Windows format before running java -if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - - JAVACMD=$( cygpath --unix "$JAVACMD" ) - - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done -fi - - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' - -# Collect all arguments for the java command: -# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, -# and any embedded shellness will be escaped. -# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be -# treated as '${Hostname}' itself on the command line. - -set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" - -# Stop when "xargs" is not available. -if ! command -v xargs >/dev/null 2>&1 -then - die "xargs is not available" -fi - -# Use "xargs" to parse quoted args. -# -# With -n1 it outputs one arg per line, with the quotes and backslashes removed. -# -# In Bash we could simply go: -# -# readarray ARGS < <( xargs -n1 <<<"$var" ) && -# set -- "${ARGS[@]}" "$@" -# -# but POSIX shell has neither arrays nor command substitution, so instead we -# post-process each arg (as a line of input to sed) to backslash-escape any -# character that might be a shell metacharacter, then use eval to reverse -# that process (while maintaining the separation between arguments), and wrap -# the whole thing up as a single "set" statement. -# -# This will of course break if any of these variables contains a newline or -# an unmatched quote. -# - -eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' - -exec "$JAVACMD" "$@" diff --git a/src/test/resources/test-applications/plantsbywebsphere/gradlew.bat b/src/test/resources/test-applications/plantsbywebsphere/gradlew.bat deleted file mode 100755 index 9b42019c..00000000 --- a/src/test/resources/test-applications/plantsbywebsphere/gradlew.bat +++ /dev/null @@ -1,94 +0,0 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem -@rem SPDX-License-Identifier: Apache-2.0 -@rem - -@if "%DEBUG%"=="" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -set DIRNAME=%~dp0 -if "%DIRNAME%"=="" set DIRNAME=. -@rem This is normally unused -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if %ERRORLEVEL% equ 0 goto execute - -echo. 1>&2 -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 -echo. 1>&2 -echo Please set the JAVA_HOME variable in your environment to match the 1>&2 -echo location of your Java installation. 1>&2 - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto execute - -echo. 1>&2 -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 -echo. 1>&2 -echo Please set the JAVA_HOME variable in your environment to match the 1>&2 -echo location of your Java installation. 1>&2 - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* - -:end -@rem End local scope for the variables with windows NT shell -if %ERRORLEVEL% equ 0 goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -set EXIT_CODE=%ERRORLEVEL% -if %EXIT_CODE% equ 0 set EXIT_CODE=1 -if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% -exit /b %EXIT_CODE% - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega diff --git a/src/test/resources/test-applications/plantsbywebsphere/settings.gradle b/src/test/resources/test-applications/plantsbywebsphere/settings.gradle deleted file mode 100644 index 46652e4c..00000000 --- a/src/test/resources/test-applications/plantsbywebsphere/settings.gradle +++ /dev/null @@ -1 +0,0 @@ -rootProject.name = 'PlantsByWebSphere' diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/java/com/ibm/websphere/samples/pbw/bean/BackOrderMgr.java b/src/test/resources/test-applications/plantsbywebsphere/src/main/java/com/ibm/websphere/samples/pbw/bean/BackOrderMgr.java deleted file mode 100755 index 022daf99..00000000 --- a/src/test/resources/test-applications/plantsbywebsphere/src/main/java/com/ibm/websphere/samples/pbw/bean/BackOrderMgr.java +++ /dev/null @@ -1,236 +0,0 @@ -// -// COPYRIGHT LICENSE: This information contains sample code provided in source code form. You may copy, -// modify, and distribute these sample programs in any form without payment to IBM for the purposes of -// developing, using, marketing or distributing application programs conforming to the application -// programming interface for the operating platform for which the sample code is written. -// Notwithstanding anything to the contrary, IBM PROVIDES THE SAMPLE SOURCE CODE ON AN "AS IS" BASIS -// AND IBM DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, ANY IMPLIED -// WARRANTIES OR CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A PARTICULAR PURPOSE, -// TITLE, AND ANY WARRANTY OR CONDITION OF NON-INFRINGEMENT. IBM SHALL NOT BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR OPERATION OF THE -// SAMPLE SOURCE CODE. IBM HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS -// OR MODIFICATIONS TO THE SAMPLE SOURCE CODE. -// -// (C) COPYRIGHT International Business Machines Corp., 2003,2011 -// All Rights Reserved * Licensed Materials - Property of IBM -// -package com.ibm.websphere.samples.pbw.bean; - -import com.ibm.websphere.samples.pbw.jpa.BackOrder; -import com.ibm.websphere.samples.pbw.jpa.Inventory; -import com.ibm.websphere.samples.pbw.utils.Util; -import java.io.Serializable; -import java.util.Collection; -import javax.annotation.security.RolesAllowed; -import javax.enterprise.context.Dependent; -import javax.persistence.EntityManager; -import javax.persistence.NoResultException; -import javax.persistence.PersistenceContext; -import javax.persistence.Query; - -/** - * The BackOrderMgr provides a transactional and secured facade to access back order information. - * This bean no longer requires an interface as there is one and only one implementation. - */ -@Dependent -@RolesAllowed("SampAdmin") -public class BackOrderMgr implements Serializable { - @PersistenceContext(unitName = "PBW") - private EntityManager em; - - /** - * Method createBackOrder. - * - * @param inventoryID - * @param amountToOrder - * @param maximumItems - */ - public void createBackOrder(String inventoryID, int amountToOrder, int maximumItems) { - try { - Util.debug("BackOrderMgr.createBackOrder() - Entered"); - BackOrder backOrder = null; - try { - // See if there is already an existing backorder and increase - // the order quantity - // but only if it has not been sent to the supplier. - Query q = em.createNamedQuery("findByInventoryID"); - q.setParameter("id", inventoryID); - backOrder = (BackOrder) q.getSingleResult(); - if (!(backOrder.getStatus().equals(Util.STATUS_ORDERSTOCK))) { - Util.debug("BackOrderMgr.createBackOrder() - Backorders found but have already been ordered from the supplier"); - // throw new FinderException(); - } - // Increase the BackOrder quantity for an existing Back Order. - backOrder.setQuantity(backOrder.getQuantity() + amountToOrder); - } catch (NoResultException e) { - Util.debug("BackOrderMgr.createBackOrder() - BackOrder doesn't exist." + e); - Util.debug("BackOrderMgr.createBackOrder() - Creating BackOrder for InventoryID: " + inventoryID); - // Order enough stock from the supplier to reach the maximum - // threshold and to - // satisfy the back order. - amountToOrder = maximumItems + amountToOrder; - Inventory inv = em.find(Inventory.class, inventoryID); - BackOrder b = new BackOrder(inv, amountToOrder); - em.persist(b); - } - } catch (Exception e) { - Util.debug("BackOrderMgr.createBackOrder() - Exception: " + e); - } - } - - /** - * Method findBackOrderItems. - * - * @return Collection - */ - @SuppressWarnings("unchecked") - public Collection findBackOrders() { - Query q = em.createNamedQuery("findAllBackOrders"); - return q.getResultList(); - } - - /** - * Method deleteBackOrder. - * - * @param backOrderID - */ - public void deleteBackOrder(String backOrderID) { - Util.debug("BackOrderMgr.deleteBackOrder() - Entered"); - // BackOrderLocal backOrder = - // getBackOrderLocalHome().findByPrimaryKeyUpdate(backOrderID); - BackOrder backOrder = em.find(BackOrder.class, backOrderID); - em.remove(backOrder); - } - - /** - * Method receiveConfirmation. - * - * @param backOrderID - * / public int receiveConfirmation(String backOrderID) { int rc = 0; BackOrder - * backOrder; Util.debug( - * "BackOrderMgr.receiveConfirmation() - Finding Back Order for backOrderID=" + - * backOrderID); backOrder = em.find(BackOrder.class, backOrderID); - * backOrder.setStatus(Util.STATUS_RECEIVEDSTOCK); Util.debug( - * "BackOrderMgr.receiveConfirmation() - Updating status(" + - * Util.STATUS_RECEIVEDSTOCK + ") of backOrderID(" + backOrderID + ")"); return (rc); - * } - */ - - /** - * Method orderStock. - * - * @param backOrderID - * @param quantity - * / public void orderStock(String backOrderID, int quantity) { - * this.setBackOrderStatus(backOrderID, Util.STATUS_ORDEREDSTOCK); - * this.setBackOrderQuantity(backOrderID, quantity); - * this.setBackOrderOrderDate(backOrderID); } - */ - - /** - * Method updateStock. - * - * @param backOrderID - * @param quantity - */ - public void updateStock(String backOrderID, int quantity) { - this.setBackOrderStatus(backOrderID, Util.STATUS_ADDEDSTOCK); - } - - /** - * @param backOrderID - * / public void abortorderStock(String backOrderID) { Util.debug( - * "backOrderStockBean.abortorderStock() - Aborting orderStock transation for backorderID: " - * + backOrderID); // Reset the back order status since the order failed. - * this.setBackOrderStatus(backOrderID, Util.STATUS_ORDERSTOCK); } - */ - - /** - * Method getBackOrderID. - * - * @param backOrderID - * @return String / public String getBackOrderID(String backOrderID) { String retbackOrderID = - * ""; Util.debug( "BackOrderMgr.getBackOrderID() - Entered"); // BackOrderLocal - * backOrder = getBackOrderLocalHome().findByPrimaryKey(new BackOrderKey(backOrderID)); - * BackOrder backOrder = em.find(BackOrder.class, backOrderID); retbackOrderID = - * backOrder.getBackOrderID(); return retbackOrderID; } - */ - - /** - * Method getBackOrderInventoryID. - * - * @param backOrderID - * @return String - */ - public String getBackOrderInventoryID(String backOrderID) { - String retinventoryID = ""; - - Util.debug("BackOrderMgr.getBackOrderID() - Entered"); - // BackOrderLocal backOrder = - // getBackOrderLocalHome().findByPrimaryKey(new - // BackOrderKey(backOrderID)); - BackOrder backOrder = em.find(BackOrder.class, backOrderID); - retinventoryID = backOrder.getInventory().getInventoryId(); - - return retinventoryID; - } - - /** - * Method getBackOrderQuantity. - * - * @param backOrderID - * @return int - */ - public int getBackOrderQuantity(String backOrderID) { - int backOrderQuantity = -1; - Util.debug("BackOrderMgr.getBackOrderQuantity() - Entered"); - // BackOrderLocal backOrder = - // getBackOrderLocalHome().findByPrimaryKey(new - // BackOrderKey(backOrderID)); - BackOrder backOrder = em.find(BackOrder.class, backOrderID); - backOrderQuantity = backOrder.getQuantity(); - return backOrderQuantity; - } - - /** - * Method setBackOrderQuantity. - * - * @param backOrderID - * @param quantity - */ - public void setBackOrderQuantity(String backOrderID, int quantity) { - Util.debug("BackOrderMgr.setBackOrderQuantity() - Entered"); - // BackOrderLocal backOrder = - // getBackOrderLocalHome().findByPrimaryKeyUpdate(backOrderID); - BackOrder backOrder = em.find(BackOrder.class, backOrderID); - backOrder.setQuantity(quantity); - } - - /** - * Method setBackOrderStatus. - * - * @param backOrderID - * @param Status - */ - public void setBackOrderStatus(String backOrderID, String Status) { - Util.debug("BackOrderMgr.setBackOrderStatus() - Entered"); - // BackOrderLocal backOrder = - // getBackOrderLocalHome().findByPrimaryKeyUpdate(backOrderID); - BackOrder backOrder = em.find(BackOrder.class, backOrderID); - backOrder.setStatus(Status); - } - - /** - * Method setBackOrderOrderDate. - * - * @param backOrderID - */ - public void setBackOrderOrderDate(String backOrderID) { - Util.debug("BackOrderMgr.setBackOrderQuantity() - Entered"); - // BackOrderLocal backOrder = - // getBackOrderLocalHome().findByPrimaryKeyUpdate(backOrderID); - BackOrder backOrder = em.find(BackOrder.class, backOrderID); - backOrder.setOrderDate(System.currentTimeMillis()); - } - -} diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/java/com/ibm/websphere/samples/pbw/bean/CatalogMgr.java b/src/test/resources/test-applications/plantsbywebsphere/src/main/java/com/ibm/websphere/samples/pbw/bean/CatalogMgr.java deleted file mode 100755 index af507179..00000000 --- a/src/test/resources/test-applications/plantsbywebsphere/src/main/java/com/ibm/websphere/samples/pbw/bean/CatalogMgr.java +++ /dev/null @@ -1,203 +0,0 @@ -// -// COPYRIGHT LICENSE: This information contains sample code provided in source code form. You may copy, -// modify, and distribute these sample programs in any form without payment to IBM for the purposes of -// developing, using, marketing or distributing application programs conforming to the application -// programming interface for the operating platform for which the sample code is written. -// Notwithstanding anything to the contrary, IBM PROVIDES THE SAMPLE SOURCE CODE ON AN "AS IS" BASIS -// AND IBM DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, ANY IMPLIED -// WARRANTIES OR CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A PARTICULAR PURPOSE, -// TITLE, AND ANY WARRANTY OR CONDITION OF NON-INFRINGEMENT. IBM SHALL NOT BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR OPERATION OF THE -// SAMPLE SOURCE CODE. IBM HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS -// OR MODIFICATIONS TO THE SAMPLE SOURCE CODE. -// -// (C) COPYRIGHT International Business Machines Corp., 2001,2011 -// All Rights Reserved * Licensed Materials - Property of IBM -// -package com.ibm.websphere.samples.pbw.bean; - -import com.ibm.websphere.samples.pbw.jpa.Inventory; -import com.ibm.websphere.samples.pbw.utils.Util; -import java.io.Serializable; -import java.util.Vector; -import javax.enterprise.context.Dependent; -import javax.persistence.EntityManager; -import javax.persistence.LockModeType; -import javax.persistence.PersistenceContext; -import javax.persistence.Query; - -/** - * The CatalogMgr provides transactional access to the catalog of items the store is willing to sell - * to customers. - * - * @see com.ibm.websphere.samples.pbw.jpa.Inventory - */ -@Dependent -@SuppressWarnings("unchecked") -public class CatalogMgr implements Serializable { - @PersistenceContext(unitName = "PBW") - EntityManager em; - - /** - * Get all inventory items. - * - * @return Vector of Inventorys. / public Vector getItems() { Vector items - * = new Vector(); int count = Util.getCategoryStrings().length; for (int i = - * 0; i < count; i++) { items.addAll(getItemsByCategory(i)); } return items; } - */ - - /** - * Get all inventory items for the given category. - * - * @param category - * of items desired. - * @return Vector of Inventory. - */ - public Vector getItemsByCategory(int category) { - Query q = em.createNamedQuery("getItemsByCategory"); - q.setParameter("category", category); - // The return type must be Vector because the PBW client ActiveX sample requires Vector - return new Vector(q.getResultList()); - } - - /** - * Get inventory items that contain a given String within their names. - * - * @param name - * String to search names for. - * @return A Vector of Inventorys that match. / public Vector getItemsLikeName(String - * name) { Query q = em.createNamedQuery("getItemsLikeName"); q.setParameter("name", '%' - * + name + '%'); //The return type must be Vector because the PBW client ActiveX sample - * requires Vector return new Vector(q.getResultList()); } - */ - - /** - * Get the StoreItem for the given ID. - * - * @param inventoryID - * - ID of the Inventory item desired. - * @return StoreItem / public StoreItem getItem(String inventoryID) { return new - * StoreItem(getItemInventory(inventoryID)); } - */ - - /** - * Get the Inventory item for the given ID. - * - * @param inventoryID - * - ID of the Inventory item desired. - * @return Inventory - */ - public Inventory getItemInventory(String inventoryID) { - Inventory si = null; - Util.debug("getItemInventory id=" + inventoryID); - si = em.find(Inventory.class, inventoryID); - return si; - } - - /** - * Add an inventory item. - * - * @param item - * The Inventory to add. - * @return True, if item added. - */ - public boolean addItem(Inventory item) { - boolean retval = true; - Util.debug("addItem " + item.getInventoryId()); - em.persist(item); - em.flush(); - return retval; - } - - /** - * Add an StoreItem item (same as Inventory item). - * - * @param item - * The StoreItem to add. - * @return True, if item added. / public boolean addItem(StoreItem item) { return addItem(new - * Inventory(item)); } - */ - - /** - * Delete an inventory item. - * - * @param inventoryID - * The ID of the inventory item to delete. - * @return True, if item deleted. / public boolean deleteItem(String inventoryID) { boolean - * retval = true; em.remove(em.find(Inventory.class, inventoryID)); return retval; } - */ - - /** - * Get the image for the inventory item. - * - * @param inventoryID - * The id of the inventory item wanted. - * @return Buffer containing the image. - */ - public byte[] getItemImageBytes(String inventoryID) { - byte[] retval = null; - Inventory inv = getInv(inventoryID); - if (inv != null) { - retval = inv.getImgbytes(); - } - - return retval; - } - - /** - * Set the image for the inventory item. - * - * @param inventoryID - * The id of the inventory item wanted. - * @param imgbytes - * Buffer containing the image. - */ - public void setItemImageBytes(String inventoryID, byte[] imgbytes) { - Inventory inv = getInvUpdate(inventoryID); - if (inv != null) { - inv.setImgbytes(imgbytes); - } - } - - /** - * Set the inventory item's quantity. - * - * @param inventoryID - * The inventory item's ID. - * @param quantity - * The inventory item's new quantity. - */ - public void setItemQuantity(String inventoryID, int quantity) { - Inventory inv = getInvUpdate(inventoryID); - if (inv != null) { - inv.setQuantity(quantity); - } - } - - /** - * Get a remote Inventory object. - * - * @param inventoryID - * The id of the inventory item wanted. - * @return Reference to the remote Inventory object. - */ - private Inventory getInv(String inventoryID) { - return em.find(Inventory.class, inventoryID); - } - - /** - * Get a remote Inventory object to Update. - * - * @param inventoryID - * The id of the inventory item wanted. - * @return Reference to the remote Inventory object. - */ - private Inventory getInvUpdate(String inventoryID) { - Inventory inv = null; - inv = em.find(Inventory.class, inventoryID); - em.lock(inv, LockModeType.OPTIMISTIC_FORCE_INCREMENT); - em.refresh(inv); - return inv; - } - -} diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/java/com/ibm/websphere/samples/pbw/bean/CustomerMgr.java b/src/test/resources/test-applications/plantsbywebsphere/src/main/java/com/ibm/websphere/samples/pbw/bean/CustomerMgr.java deleted file mode 100755 index 73beb6d3..00000000 --- a/src/test/resources/test-applications/plantsbywebsphere/src/main/java/com/ibm/websphere/samples/pbw/bean/CustomerMgr.java +++ /dev/null @@ -1,174 +0,0 @@ -// -// COPYRIGHT LICENSE: This information contains sample code provided in source code form. You may copy, -// modify, and distribute these sample programs in any form without payment to IBM for the purposes of -// developing, using, marketing or distributing application programs conforming to the application -// programming interface for the operating platform for which the sample code is written. -// Notwithstanding anything to the contrary, IBM PROVIDES THE SAMPLE SOURCE CODE ON AN "AS IS" BASIS -// AND IBM DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, ANY IMPLIED -// WARRANTIES OR CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A PARTICULAR PURPOSE, -// TITLE, AND ANY WARRANTY OR CONDITION OF NON-INFRINGEMENT. IBM SHALL NOT BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR OPERATION OF THE -// SAMPLE SOURCE CODE. IBM HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS -// OR MODIFICATIONS TO THE SAMPLE SOURCE CODE. -// -// (C) COPYRIGHT International Business Machines Corp., 2001,2011 -// All Rights Reserved * Licensed Materials - Property of IBM -// -package com.ibm.websphere.samples.pbw.bean; - -import com.ibm.websphere.samples.pbw.jpa.Customer; -import com.ibm.websphere.samples.pbw.utils.Util; -import java.io.Serializable; -import javax.enterprise.context.Dependent; -import javax.persistence.EntityManager; -import javax.persistence.LockModeType; -import javax.persistence.PersistenceContext; -import javax.transaction.Transactional; - -/** - * The CustomerMgr provides a transactional facade for access to a user DB as well as simple - * authentication support for those users. - * - */ -@Transactional -@Dependent -public class CustomerMgr implements Serializable { - @PersistenceContext(unitName = "PBW") - EntityManager em; - - /** - * Create a new user. - * - * @param customerID - * The new customer ID. - * @param password - * The password for the customer ID. - * @param firstName - * First name. - * @param lastName - * Last name. - * @param addr1 - * Address line 1. - * @param addr2 - * Address line 2. - * @param addrCity - * City address information. - * @param addrState - * State address information. - * @param addrZip - * Zip code address information. - * @param phone - * User's phone number. - * @return Customer - */ - public Customer createCustomer(String customerID, - String password, - String firstName, - String lastName, - String addr1, - String addr2, - String addrCity, - String addrState, - String addrZip, - String phone) { - Customer c = new Customer(customerID, password, firstName, lastName, addr1, addr2, addrCity, addrState, addrZip, - phone); - em.persist(c); - em.flush(); - return c; - } - - /** - * Retrieve an existing user. - * - * @param customerID - * The customer ID. - * @return Customer - */ - public Customer getCustomer(String customerID) { - Customer c = em.find(Customer.class, customerID); - return c; - - } - - /** - * Update an existing user. - * - * @param customerID - * The customer ID. - * @param firstName - * First name. - * @param lastName - * Last name. - * @param addr1 - * Address line 1. - * @param addr2 - * Address line 2. - * @param addrCity - * City address information. - * @param addrState - * State address information. - * @param addrZip - * Zip code address information. - * @param phone - * User's phone number. - * @return Customer - */ - public Customer updateUser(String customerID, - String firstName, - String lastName, - String addr1, - String addr2, - String addrCity, - String addrState, - String addrZip, - String phone) { - Customer c = em.find(Customer.class, customerID); - em.lock(c, LockModeType.WRITE); - em.refresh(c); - - c.setFirstName(firstName); - c.setLastName(lastName); - c.setAddr1(addr1); - c.setAddr2(addr2); - c.setAddrCity(addrCity); - c.setAddrState(addrState); - c.setAddrZip(addrZip); - c.setPhone(phone); - - return c; - } - - /** - * Verify that the user exists and the password is value. - * - * @param customerID - * The customer ID - * @param password - * The password for the customer ID - * @return String with a results message. - */ - public String verifyUserAndPassword(String customerID, String password) { - // Try to get customer. - String results = null; - Customer customer = null; - - customer = em.find(Customer.class, customerID); - - // Does customer exist? - if (customer != null) { - if (!customer.verifyPassword(password)) // Is password correct? - { - results = "\nPassword does not match for : " + customerID; - Util.debug("Password given does not match for userid=" + customerID); - } - } else // Customer was not found. - { - results = "\nCould not find account for : " + customerID; - Util.debug("customer " + customerID + " NOT found"); - } - - return results; - } - -} diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/java/com/ibm/websphere/samples/pbw/bean/EMailMessage.java b/src/test/resources/test-applications/plantsbywebsphere/src/main/java/com/ibm/websphere/samples/pbw/bean/EMailMessage.java deleted file mode 100755 index 7428ec6a..00000000 --- a/src/test/resources/test-applications/plantsbywebsphere/src/main/java/com/ibm/websphere/samples/pbw/bean/EMailMessage.java +++ /dev/null @@ -1,57 +0,0 @@ -// -// COPYRIGHT LICENSE: This information contains sample code provided in source code form. You may copy, -// modify, and distribute these sample programs in any form without payment to IBM for the purposes of -// developing, using, marketing or distributing application programs conforming to the application -// programming interface for the operating platform for which the sample code is written. -// Notwithstanding anything to the contrary, IBM PROVIDES THE SAMPLE SOURCE CODE ON AN "AS IS" BASIS -// AND IBM DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, ANY IMPLIED -// WARRANTIES OR CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A PARTICULAR PURPOSE, -// TITLE, AND ANY WARRANTY OR CONDITION OF NON-INFRINGEMENT. IBM SHALL NOT BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR OPERATION OF THE -// SAMPLE SOURCE CODE. IBM HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS -// OR MODIFICATIONS TO THE SAMPLE SOURCE CODE. -// -// (C) COPYRIGHT International Business Machines Corp., 2001,2011 -// All Rights Reserved * Licensed Materials - Property of IBM -// -package com.ibm.websphere.samples.pbw.bean; - -/** - * This class encapsulates the info needed to send an email message. This object is passed to the - * Mailer EJB sendMail() method. - */ -public class EMailMessage implements java.io.Serializable { - /** - * - */ - private static final long serialVersionUID = 1L; - private String subject; - private String htmlContents; - private String emailReceiver; - - public EMailMessage(String subject, String htmlContents, String emailReceiver) { - this.subject = subject; - this.htmlContents = htmlContents; - this.emailReceiver = emailReceiver; - } - - // subject field of email message - public String getSubject() { - return subject; - } - - // Email address of recipient of email message - public String getEmailReceiver() { - return emailReceiver; - } - - // contents of email message - public String getHtmlContents() { - return htmlContents; - } - - public String toString() { - return " subject=" + subject + " " + emailReceiver + " " + htmlContents; - } - -} diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/java/com/ibm/websphere/samples/pbw/bean/MailerAppException.java b/src/test/resources/test-applications/plantsbywebsphere/src/main/java/com/ibm/websphere/samples/pbw/bean/MailerAppException.java deleted file mode 100755 index 8babb8c7..00000000 --- a/src/test/resources/test-applications/plantsbywebsphere/src/main/java/com/ibm/websphere/samples/pbw/bean/MailerAppException.java +++ /dev/null @@ -1,37 +0,0 @@ -// -// COPYRIGHT LICENSE: This information contains sample code provided in source code form. You may copy, -// modify, and distribute these sample programs in any form without payment to IBM for the purposes of -// developing, using, marketing or distributing application programs conforming to the application -// programming interface for the operating platform for which the sample code is written. -// Notwithstanding anything to the contrary, IBM PROVIDES THE SAMPLE SOURCE CODE ON AN "AS IS" BASIS -// AND IBM DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, ANY IMPLIED -// WARRANTIES OR CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A PARTICULAR PURPOSE, -// TITLE, AND ANY WARRANTY OR CONDITION OF NON-INFRINGEMENT. IBM SHALL NOT BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR OPERATION OF THE -// SAMPLE SOURCE CODE. IBM HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS -// OR MODIFICATIONS TO THE SAMPLE SOURCE CODE. -// -// (C) COPYRIGHT International Business Machines Corp., 2001,2011 -// All Rights Reserved * Licensed Materials - Property of IBM -// -package com.ibm.websphere.samples.pbw.bean; - -/** - * MailerAppException extends the standard Exception. This is thrown by the mailer component when - * there is some failure sending the mail. - */ -public class MailerAppException extends Exception { - - /** - * - */ - private static final long serialVersionUID = 1L; - - public MailerAppException() { - } - - public MailerAppException(String str) { - super(str); - } - -} diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/java/com/ibm/websphere/samples/pbw/bean/MailerBean.java b/src/test/resources/test-applications/plantsbywebsphere/src/main/java/com/ibm/websphere/samples/pbw/bean/MailerBean.java deleted file mode 100755 index 4a5a96a7..00000000 --- a/src/test/resources/test-applications/plantsbywebsphere/src/main/java/com/ibm/websphere/samples/pbw/bean/MailerBean.java +++ /dev/null @@ -1,135 +0,0 @@ -// -// COPYRIGHT LICENSE: This information contains sample code provided in source code form. You may copy, -// modify, and distribute these sample programs in any form without payment to IBM for the purposes of -// developing, using, marketing or distributing application programs conforming to the application -// programming interface for the operating platform for which the sample code is written. -// Notwithstanding anything to the contrary, IBM PROVIDES THE SAMPLE SOURCE CODE ON AN "AS IS" BASIS -// AND IBM DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, ANY IMPLIED -// WARRANTIES OR CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A PARTICULAR PURPOSE, -// TITLE, AND ANY WARRANTY OR CONDITION OF NON-INFRINGEMENT. IBM SHALL NOT BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR OPERATION OF THE -// SAMPLE SOURCE CODE. IBM HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS -// OR MODIFICATIONS TO THE SAMPLE SOURCE CODE. -// -// (C) COPYRIGHT International Business Machines Corp., 2001,2011 -// All Rights Reserved * Licensed Materials - Property of IBM -// -package com.ibm.websphere.samples.pbw.bean; - -import com.ibm.websphere.samples.pbw.jpa.Customer; -import com.ibm.websphere.samples.pbw.jpa.Order; -import com.ibm.websphere.samples.pbw.utils.Util; -import java.io.Serializable; -import java.util.Date; -import javax.annotation.Resource; -import javax.enterprise.context.Dependent; -import javax.inject.Named; -import javax.mail.Message; -import javax.mail.Multipart; -import javax.mail.Session; -import javax.mail.Transport; -import javax.mail.internet.InternetAddress; -import javax.mail.internet.MimeBodyPart; -import javax.mail.internet.MimeMessage; -import javax.mail.internet.MimeMultipart; -import javax.persistence.EntityManager; -import javax.persistence.PersistenceContext; - -/** - * MailerBean provides a transactional facade for access to Order information and notification of - * the buyer of order state. - * - */ - -@Named(value = "mailerbean") -@Dependent - -public class MailerBean implements Serializable { - private static final long serialVersionUID = 1L; - // public static final String MAIL_SESSION = "java:comp/env/mail/PlantsByWebSphere"; - @Resource(name = "mail/PlantsByWebSphere") - Session mailSession; - - @PersistenceContext(unitName = "PBW") - - EntityManager em; - - /** - * Create the email message. - * - * @param orderKey - * The order number. - * @return The email message. - */ - private String createMessage(String orderKey) { - Util.debug("creating email message for order:" + orderKey); - StringBuffer msg = new StringBuffer(); - Order order = em.find(Order.class, orderKey); - msg.append("Thank you for your order " + orderKey + ".\n"); - msg.append("Your Plants By WebSphere order will be shipped to:\n"); - msg.append(" " + order.getShipName() + "\n"); - msg.append(" " + order.getShipAddr1() + " " + order.getShipAddr2() + "\n"); - msg.append(" " + order.getShipCity() + ", " + order.getShipState() + " " + order.getShipZip() + "\n\n"); - msg.append("Please save it for your records.\n"); - return msg.toString(); - } - - /** - * Create the Subject line. - * - * @param orderKey - * The order number. - * @return The Order number string. - */ - private String createSubjectLine(String orderKey) { - StringBuffer msg = new StringBuffer(); - msg.append("Your order number " + orderKey); - - return msg.toString(); - } - - /** - * Create a mail message and send it. - * - * @param customerInfo - * Customer information. - * @param orderKey - * @throws MailerAppException - */ - public void createAndSendMail(Customer customerInfo, String orderKey) throws MailerAppException { - try { - EMailMessage eMessage = new EMailMessage(createSubjectLine(orderKey), createMessage(orderKey), - customerInfo.getCustomerID()); - - Util.debug("Sending message" + "\nTo: " + eMessage.getEmailReceiver() + "\nSubject: " - + eMessage.getSubject() + "\nContents: " + eMessage.getHtmlContents()); - - Util.debug("Sending message" + "\nTo: " + eMessage.getEmailReceiver() + "\nSubject: " - + eMessage.getSubject() + "\nContents: " + eMessage.getHtmlContents()); - - MimeMessage msg = new MimeMessage(mailSession); - msg.setFrom(); - - msg.setRecipients(Message.RecipientType.TO, InternetAddress.parse(eMessage.getEmailReceiver(), false)); - - msg.setSubject(eMessage.getSubject()); - MimeBodyPart mbp = new MimeBodyPart(); - mbp.setText(eMessage.getHtmlContents(), "us-ascii"); - msg.setHeader("X-Mailer", "JavaMailer"); - Multipart mp = new MimeMultipart(); - mp.addBodyPart(mbp); - msg.setContent(mp); - msg.setSentDate(new Date()); - - Transport.send(msg); - Util.debug("Mail sent successfully."); - - } catch (Exception e) { - - Util.debug("Error sending mail. Have mail resources been configured correctly?"); - Util.debug("createAndSendMail exception : " + e); - e.printStackTrace(); - throw new MailerAppException("Failure while sending mail"); - } - } -} diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/java/com/ibm/websphere/samples/pbw/bean/NoSupplierException.java b/src/test/resources/test-applications/plantsbywebsphere/src/main/java/com/ibm/websphere/samples/pbw/bean/NoSupplierException.java deleted file mode 100755 index bf4ac63b..00000000 --- a/src/test/resources/test-applications/plantsbywebsphere/src/main/java/com/ibm/websphere/samples/pbw/bean/NoSupplierException.java +++ /dev/null @@ -1,35 +0,0 @@ -// -// COPYRIGHT LICENSE: This information contains sample code provided in source code form. You may copy, -// modify, and distribute these sample programs in any form without payment to IBM for the purposes of -// developing, using, marketing or distributing application programs conforming to the application -// programming interface for the operating platform for which the sample code is written. -// Notwithstanding anything to the contrary, IBM PROVIDES THE SAMPLE SOURCE CODE ON AN "AS IS" BASIS -// AND IBM DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, ANY IMPLIED -// WARRANTIES OR CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A PARTICULAR PURPOSE, -// TITLE, AND ANY WARRANTY OR CONDITION OF NON-INFRINGEMENT. IBM SHALL NOT BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR OPERATION OF THE -// SAMPLE SOURCE CODE. IBM HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS -// OR MODIFICATIONS TO THE SAMPLE SOURCE CODE. -// -// (C) COPYRIGHT International Business Machines Corp., 2003,2011 -// All Rights Reserved * Licensed Materials - Property of IBM -// - -package com.ibm.websphere.samples.pbw.bean; - -public class NoSupplierException extends Exception { - /** - * - */ - private static final long serialVersionUID = 1L; - - /** - * Method NoSupplierException - * - * @param message - */ - public NoSupplierException(String message) { - super(message); - return; - } -} diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/java/com/ibm/websphere/samples/pbw/bean/PopulateDBBean.java b/src/test/resources/test-applications/plantsbywebsphere/src/main/java/com/ibm/websphere/samples/pbw/bean/PopulateDBBean.java deleted file mode 100644 index 0fd4e37a..00000000 --- a/src/test/resources/test-applications/plantsbywebsphere/src/main/java/com/ibm/websphere/samples/pbw/bean/PopulateDBBean.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.ibm.websphere.samples.pbw.bean; - -import com.ibm.websphere.samples.pbw.utils.Util; -import javax.annotation.PostConstruct; -import javax.ejb.Singleton; -import javax.ejb.Startup; -import javax.inject.Inject; - -@Singleton -@Startup -public class PopulateDBBean { - - @Inject - ResetDBBean dbBean; - - @PostConstruct - public void initDB() { - Util.debug("Initializing database..."); - dbBean.populateDB(); - } - -} diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/java/com/ibm/websphere/samples/pbw/bean/ResetDBBean.java b/src/test/resources/test-applications/plantsbywebsphere/src/main/java/com/ibm/websphere/samples/pbw/bean/ResetDBBean.java deleted file mode 100755 index 0e487a6a..00000000 --- a/src/test/resources/test-applications/plantsbywebsphere/src/main/java/com/ibm/websphere/samples/pbw/bean/ResetDBBean.java +++ /dev/null @@ -1,341 +0,0 @@ -// -// COPYRIGHT LICENSE: This information contains sample code provided in source code form. You may copy, -// modify, and distribute these sample programs in any form without payment to IBM for the purposes of -// developing, using, marketing or distributing application programs conforming to the application -// programming interface for the operating platform for which the sample code is written. -// Notwithstanding anything to the contrary, IBM PROVIDES THE SAMPLE SOURCE CODE ON AN "AS IS" BASIS -// AND IBM DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, ANY IMPLIED -// WARRANTIES OR CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A PARTICULAR PURPOSE, -// TITLE, AND ANY WARRANTY OR CONDITION OF NON-INFRINGEMENT. IBM SHALL NOT BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR OPERATION OF THE -// SAMPLE SOURCE CODE. IBM HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS -// OR MODIFICATIONS TO THE SAMPLE SOURCE CODE. -// -// (C) COPYRIGHT International Business Machines Corp., 2004,2011 -// All Rights Reserved * Licensed Materials - Property of IBM -// -package com.ibm.websphere.samples.pbw.bean; - -import com.ibm.websphere.samples.pbw.jpa.Inventory; -import com.ibm.websphere.samples.pbw.utils.Util; -import java.io.DataInputStream; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.io.Serializable; -import java.net.URL; -import java.util.Vector; -import javax.annotation.Resource; -import javax.annotation.security.RolesAllowed; -import javax.enterprise.context.Dependent; -import javax.inject.Inject; -import javax.inject.Named; -import javax.persistence.EntityManager; -import javax.persistence.PersistenceContext; -import javax.persistence.PersistenceContextType; -import javax.persistence.Query; -import javax.persistence.SynchronizationType; -import javax.transaction.HeuristicMixedException; -import javax.transaction.HeuristicRollbackException; -import javax.transaction.NotSupportedException; -import javax.transaction.RollbackException; -import javax.transaction.SystemException; -import javax.transaction.Transactional; -import javax.transaction.UserTransaction; - -/** - * ResetDBBean provides a transactional and secure facade to reset all the database information for - * the PlantsByWebSphere application. - */ - -@Named(value = "resetbean") -@Dependent -@RolesAllowed("SampAdmin") -public class ResetDBBean implements Serializable { - - @Inject - private CatalogMgr catalog; - @Inject - private CustomerMgr customer; - @Inject - private ShoppingCartBean cart; - @Inject - private BackOrderMgr backOrderStock; - @Inject - private SuppliersBean suppliers; - - @PersistenceContext(unitName = "PBW") - EntityManager em; - - @Resource - UserTransaction tx; - - public void resetDB() { - deleteAll(); - populateDB(); - } - - /** - * @param itemID - * @param fileName - * @param catalog - * @throws FileNotFoundException - * @throws IOException - */ - public static void addImage(String itemID, - String fileName, - CatalogMgr catalog) throws FileNotFoundException, IOException { - URL url = Thread.currentThread().getContextClassLoader().getResource("resources/images/" + fileName); - Util.debug("URL: " + url); - fileName = url.getPath(); - Util.debug("Fully-qualified Filename: " + fileName); - File imgFile = new File(fileName); - // Open the input file as a stream of bytes - FileInputStream fis = new FileInputStream(imgFile); - DataInputStream dis = new DataInputStream(fis); - int dataSize = dis.available(); - byte[] data = new byte[dataSize]; - dis.readFully(data); - catalog.setItemImageBytes(itemID, data); - } - - public void populateDB() { - /** - * Populate INVENTORY table with text - */ - Util.debug("Populating INVENTORY table with text..."); - try { - String[] values = Util.getProperties("inventory"); - for (int index = 0; index < values.length; index++) { - Util.debug("Found INVENTORY property values: " + values[index]); - String[] fields = Util.readTokens(values[index], "|"); - String id = fields[0]; - String name = fields[1]; - String heading = fields[2]; - String descr = fields[3]; - String pkginfo = fields[4]; - String image = fields[5]; - float price = new Float(fields[6]).floatValue(); - float cost = new Float(fields[7]).floatValue(); - int quantity = new Integer(fields[8]).intValue(); - int category = new Integer(fields[9]).intValue(); - String notes = fields[10]; - boolean isPublic = new Boolean(fields[11]).booleanValue(); - Util.debug("Populating INVENTORY with following values: "); - Util.debug(fields[0]); - Util.debug(fields[1]); - Util.debug(fields[2]); - Util.debug(fields[3]); - Util.debug(fields[4]); - Util.debug(fields[5]); - Util.debug(fields[6]); - Util.debug(fields[7]); - Util.debug(fields[8]); - Util.debug(fields[9]); - Util.debug(fields[10]); - Util.debug(fields[11]); - Inventory storeItem = new Inventory(id, name, heading, descr, pkginfo, image, price, cost, quantity, - category, notes, isPublic); - catalog.addItem(storeItem); - addImage(id, image, catalog); - } - Util.debug("INVENTORY table populated with text..."); - } catch (Exception e) { - Util.debug("Unable to populate INVENTORY table with text data: " + e); - e.printStackTrace(); - } - /** - * Populate CUSTOMER table with text - */ - Util.debug("Populating CUSTOMER table with default values..."); - try { - String[] values = Util.getProperties("customer"); - Util.debug("Found CUSTOMER properties: " + values[0]); - for (int index = 0; index < values.length; index++) { - String[] fields = Util.readTokens(values[index], "|"); - String customerID = fields[0]; - String password = fields[1]; - String firstName = fields[2]; - String lastName = fields[3]; - String addr1 = fields[4]; - String addr2 = fields[5]; - String addrCity = fields[6]; - String addrState = fields[7]; - String addrZip = fields[8]; - String phone = fields[9]; - Util.debug("Populating CUSTOMER with following values: "); - Util.debug(fields[0]); - Util.debug(fields[1]); - Util.debug(fields[2]); - Util.debug(fields[3]); - Util.debug(fields[4]); - Util.debug(fields[5]); - Util.debug(fields[6]); - Util.debug(fields[7]); - Util.debug(fields[8]); - Util.debug(fields[9]); - customer.createCustomer(customerID, password, firstName, lastName, addr1, addr2, addrCity, addrState, addrZip, phone); - } - } catch (Exception e) { - Util.debug("Unable to populate CUSTOMER table with text data: " + e); - e.printStackTrace(); - } - /** - * Populate ORDER table with text - */ - Util.debug("Populating ORDER table with default values..."); - try { - String[] values = Util.getProperties("order"); - Util.debug("Found ORDER properties: " + values[0]); - if (values[0] != null && values.length > 0) { - for (int index = 0; index < values.length; index++) { - String[] fields = Util.readTokens(values[index], "|"); - if (fields != null && fields.length >= 21) { - String customerID = fields[0]; - String billName = fields[1]; - String billAddr1 = fields[2]; - String billAddr2 = fields[3]; - String billCity = fields[4]; - String billState = fields[5]; - String billZip = fields[6]; - String billPhone = fields[7]; - String shipName = fields[8]; - String shipAddr1 = fields[9]; - String shipAddr2 = fields[10]; - String shipCity = fields[11]; - String shipState = fields[12]; - String shipZip = fields[13]; - String shipPhone = fields[14]; - int shippingMethod = Integer.parseInt(fields[15]); - String creditCard = fields[16]; - String ccNum = fields[17]; - String ccExpireMonth = fields[18]; - String ccExpireYear = fields[19]; - String cardHolder = fields[20]; - Vector items = new Vector(); - Util.debug("Populating ORDER with following values: "); - Util.debug(fields[0]); - Util.debug(fields[1]); - Util.debug(fields[2]); - Util.debug(fields[3]); - Util.debug(fields[4]); - Util.debug(fields[5]); - Util.debug(fields[6]); - Util.debug(fields[7]); - Util.debug(fields[8]); - Util.debug(fields[9]); - Util.debug(fields[10]); - Util.debug(fields[11]); - Util.debug(fields[12]); - Util.debug(fields[13]); - Util.debug(fields[14]); - Util.debug(fields[15]); - Util.debug(fields[16]); - Util.debug(fields[17]); - Util.debug(fields[18]); - Util.debug(fields[19]); - Util.debug(fields[20]); - cart.createOrder(customerID, billName, billAddr1, billAddr2, billCity, billState, billZip, billPhone, shipName, shipAddr1, shipAddr2, shipCity, shipState, shipZip, shipPhone, creditCard, ccNum, ccExpireMonth, ccExpireYear, cardHolder, shippingMethod, items); - } else { - Util.debug("Property does not contain enough fields: " + values[index]); - Util.debug("Fields found were: " + fields); - } - } - } - // stmt.executeUpdate(" INSERT INTO ORDERITEM(INVENTORYID, NAME, PKGINFO, PRICE, COST, - // CATEGORY, QUANTITY, SELLDATE, ORDER_ORDERID) VALUES ('A0001', 'Bulb Digger', - // 'Assembled', 12.0, 5.0, 3, 900, '01054835419625', '1')"); - } catch (Exception e) { - Util.debug("Unable to populate ORDERITEM table with text data: " + e); - e.printStackTrace(); - e.printStackTrace(); - } - /** - * Populate BACKORDER table with text - */ - Util.debug("Populating BACKORDER table with default values..."); - try { - String[] values = Util.getProperties("backorder"); - Util.debug("Found BACKORDER properties: " + values[0]); - // Inserting backorders - for (int index = 0; index < values.length; index++) { - String[] fields = Util.readTokens(values[index], "|"); - String inventoryID = fields[0]; - int amountToOrder = new Integer(fields[1]).intValue(); - int maximumItems = new Integer(fields[2]).intValue(); - Util.debug("Populating BACKORDER with following values: "); - Util.debug(inventoryID); - Util.debug("amountToOrder -> " + amountToOrder); - Util.debug("maximumItems -> " + maximumItems); - backOrderStock.createBackOrder(inventoryID, amountToOrder, maximumItems); - } - } catch (Exception e) { - Util.debug("Unable to populate BACKORDER table with text data: " + e); - e.printStackTrace(); - } - /** - * Populate SUPPLIER table with text - */ - Util.debug("Populating SUPPLIER table with default values..."); - try { - String[] values = Util.getProperties("supplier"); - Util.debug("Found SUPPLIER properties: " + values[0]); - // Inserting Suppliers - for (int index = 0; index < values.length; index++) { - String[] fields = Util.readTokens(values[index], "|"); - String supplierID = fields[0]; - String name = fields[1]; - String address = fields[2]; - String city = fields[3]; - String state = fields[4]; - String zip = fields[5]; - String phone = fields[6]; - String url = fields[7]; - Util.debug("Populating SUPPLIER with following values: "); - Util.debug(fields[0]); - Util.debug(fields[1]); - Util.debug(fields[2]); - Util.debug(fields[3]); - Util.debug(fields[4]); - Util.debug(fields[5]); - Util.debug(fields[6]); - Util.debug(fields[7]); - suppliers.createSupplier(supplierID, name, address, city, state, zip, phone, url); - } - } catch (Exception e) { - Util.debug("Unable to populate SUPPLIER table with text data: " + e); - e.printStackTrace(); - } - } - - @Transactional - public void deleteAll() { - try { - Query q = em.createNamedQuery("removeAllOrders"); - q.executeUpdate(); - q = em.createNamedQuery("removeAllInventory"); - q.executeUpdate(); - // q=em.createNamedQuery("removeAllIdGenerator"); - // q.executeUpdate(); - q = em.createNamedQuery("removeAllCustomers"); - q.executeUpdate(); - q = em.createNamedQuery("removeAllOrderItem"); - q.executeUpdate(); - q = em.createNamedQuery("removeAllBackOrder"); - q.executeUpdate(); - q = em.createNamedQuery("removeAllSupplier"); - q.executeUpdate(); - em.flush(); - Util.debug("Deleted all data from database"); - } catch (Exception e) { - Util.debug("ResetDB(deleteAll) -- Error deleting data from the database: " + e); - e.printStackTrace(); - try { - tx.setRollbackOnly(); - } catch (IllegalStateException | SystemException ignore) { - } - } - } - -} diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/java/com/ibm/websphere/samples/pbw/bean/ShoppingCartBean.java b/src/test/resources/test-applications/plantsbywebsphere/src/main/java/com/ibm/websphere/samples/pbw/bean/ShoppingCartBean.java deleted file mode 100755 index d39a2a94..00000000 --- a/src/test/resources/test-applications/plantsbywebsphere/src/main/java/com/ibm/websphere/samples/pbw/bean/ShoppingCartBean.java +++ /dev/null @@ -1,345 +0,0 @@ -// -// COPYRIGHT LICENSE: This information contains sample code provided in source code form. You may copy, -// modify, and distribute these sample programs in any form without payment to IBM for the purposes of -// developing, using, marketing or distributing application programs conforming to the application -// programming interface for the operating platform for which the sample code is written. -// Notwithstanding anything to the contrary, IBM PROVIDES THE SAMPLE SOURCE CODE ON AN "AS IS" BASIS -// AND IBM DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, ANY IMPLIED -// WARRANTIES OR CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A PARTICULAR PURPOSE, -// TITLE, AND ANY WARRANTY OR CONDITION OF NON-INFRINGEMENT. IBM SHALL NOT BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR OPERATION OF THE -// SAMPLE SOURCE CODE. IBM HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS -// OR MODIFICATIONS TO THE SAMPLE SOURCE CODE. -// -// (C) COPYRIGHT International Business Machines Corp., 2001,2011 -// All Rights Reserved * Licensed Materials - Property of IBM -// -package com.ibm.websphere.samples.pbw.bean; - -import com.ibm.websphere.samples.pbw.jpa.BackOrder; -import com.ibm.websphere.samples.pbw.jpa.Customer; -import com.ibm.websphere.samples.pbw.jpa.Inventory; -import com.ibm.websphere.samples.pbw.jpa.Order; -import com.ibm.websphere.samples.pbw.jpa.OrderItem; -import com.ibm.websphere.samples.pbw.utils.Util; -import java.io.Serializable; -import java.util.ArrayList; -import java.util.Collection; -import javax.enterprise.context.SessionScoped; -import javax.persistence.EntityManager; -import javax.persistence.LockModeType; -import javax.persistence.PersistenceContext; -import javax.transaction.Transactional; - -/** - * ShopingCartBean provides a transactional facade for order collection and processing. - * - */ - -@Transactional -@SessionScoped -public class ShoppingCartBean implements Serializable { - - @PersistenceContext(unitName = "PBW") - EntityManager em; - - private ArrayList items = new ArrayList(); - - /** - * Add an item to the cart. - * - * @param new_item - * Item to add to the cart. - */ - public void addItem(Inventory new_item) { - boolean added = false; - // If the same item is already in the cart, just increase the quantity. - for (Inventory old_item : items) { - if (old_item.getID().equals(new_item.getID())) { - old_item.setQuantity(old_item.getQuantity() + new_item.getQuantity()); - added = true; - break; - } - } - // Add this item to shopping cart, if it is a brand new item. - if (!added) - items.add(new_item); - } - - /** - * Remove an item from the cart. - * - * @param item - * Item to remove from cart. - */ - public void removeItem(Inventory item) { - for (Inventory i : items) { - if (item.equals(i)) { - items.remove(i); - break; - } - } - } - - /** - * Remove all items from the cart. - */ - public void removeAllItems() { - items = new ArrayList(); - } - - /** - * Remove zero quantity items. - */ - public void removeZeroQuantityItems() { - ArrayList newItems = new ArrayList(); - - for (Inventory i : items) { - if (i.getQuantity() > 0) { - newItems.add(i); - } - } - - items = newItems; - } - - /** - * Get the items in the shopping cart. - * - * @return A Collection of ShoppingCartItems. - */ - public ArrayList getItems() { - return items; - } - - /** - * Set the items in the shopping cart. - * - * @param items - * A Vector of ShoppingCartItem's. - */ - public void setItems(Collection items) { - this.items = new ArrayList(items); - } - - /** - * Get the contents of the shopping cart. - * - * @return The contents of the shopping cart. / public ShoppingCartContents getCartContents() { - * ShoppingCartContents cartContents = new ShoppingCartContents(); // Fill it with data. - * for (int i = 0; i < items.size(); i++) { cartContents.addItem((ShoppingCartItem) - * items.get(i)); } return cartContents; } - */ - - /** - * Create a shopping cart. - * - * @param cartContents - * Contents to populate cart with. / public void setCartContents(ShoppingCartContents - * cartContents) { items = new ArrayList(); int qty; String - * inventoryID; ShoppingCartItem si; Inventory inv; for (int i = 0; i < - * cartContents.size(); i++) { inventoryID = cartContents.getInventoryID(i); qty = - * cartContents.getQuantity(inventoryID); inv = em.find(Inventory.class, - * inventoryID); // clone so we can use Qty as qty to purchase, not inventory in - * stock si = new ShoppingCartItem(inv); si.setQuantity(qty); addItem(si); } } - */ - - /** - * Get the cost of all items in the shopping cart. - * - * @return The total cost of all items in the shopping cart. - */ - public float getSubtotalCost() { - float f = 0.0F; - - for (Inventory item : items) { - f += item.getPrice() * (float) item.getQuantity(); - } - return f; - } - - /** - * Method checkInventory. Check the inventory level of a store item. Order additional inventory - * when necessary. - * - * @param si - * - Store item - */ - public void checkInventory(Inventory si) { - Util.debug("ShoppingCart.checkInventory() - checking Inventory quantity of item: " + si.getID()); - Inventory inv = getInventoryItem(si.getID()); - - /** - * Decrease the quantity of this inventory item. - * - * @param quantity - * The number to decrease the inventory by. - * @return The number of inventory items removed. - */ - int quantity = si.getQuantity(); - int minimumItems = inv.getMinThreshold(); - - int amountToOrder = 0; - Util.debug("ShoppingCartBean:checkInventory() - Decreasing inventory item " + inv.getInventoryId()); - int quantityNotFilled = 0; - if (inv.getQuantity() < 1) { - quantityNotFilled = quantity; - } else if (inv.getQuantity() < quantity) { - quantityNotFilled = quantity - inv.getQuantity(); - } - - // When quantity becomes < 0, this will be to determine the - // quantity of unfilled orders due to insufficient stock. - inv.setQuantity(inv.getQuantity() - quantity); - - // Check to see if more inventory needs to be ordered from the supplier - // based on a set minimum Threshold - if (inv.getQuantity() < minimumItems) { - // Calculate the amount of stock to order from the supplier - // to get the inventory up to the maximum. - amountToOrder = quantityNotFilled; - backOrder(inv, amountToOrder); - } - - } - - /** - * Create an order with contents of a shopping cart. - * - * @param customerID - * customer's ID - * @param billName - * billing name - * @param billAddr1 - * billing address line 1 - * @param billAddr2 - * billing address line 2 - * @param billCity - * billing address city - * @param billState - * billing address state - * @param billZip - * billing address zip code - * @param billPhone - * billing phone - * @param shipName - * shippng name - * @param shipAddr1 - * shippng address line 1 - * @param shipAddr2 - * shippng address line 2 - * @param shipCity - * shippng address city - * @param shipState - * shippng address state - * @param shipZip - * shippng address zip code - * @param shipPhone - * shippng phone - * @param creditCard - * credit card - * @param ccNum - * credit card number - * @param ccExpireMonth - * credit card expiration month - * @param ccExpireYear - * credit card expiration year - * @param cardHolder - * credit card holder name - * @param shippingMethod - * int of shipping method used - * @param items - * vector of StoreItems ordered - * @return OrderInfo - */ - public Order createOrder(String customerID, - String billName, - String billAddr1, - String billAddr2, - String billCity, - String billState, - String billZip, - String billPhone, - String shipName, - String shipAddr1, - String shipAddr2, - String shipCity, - String shipState, - String shipZip, - String shipPhone, - String creditCard, - String ccNum, - String ccExpireMonth, - String ccExpireYear, - String cardHolder, - int shippingMethod, - Collection items) { - Order order = null; - Util.debug("ShoppingCartBean.createOrder: Creating Order"); - Collection orderitems = new ArrayList(); - for (Inventory si : items) { - Inventory inv = em.find(Inventory.class, si.getID()); - OrderItem oi = new OrderItem(inv); - oi.setQuantity(si.getQuantity()); - orderitems.add(oi); - } - Customer c = em.find(Customer.class, customerID); - order = new Order(c, billName, billAddr1, billAddr2, billCity, billState, billZip, billPhone, shipName, - shipAddr1, shipAddr2, shipCity, shipState, shipZip, shipPhone, creditCard, ccNum, ccExpireMonth, - ccExpireYear, cardHolder, shippingMethod, orderitems); - em.persist(order); - em.flush(); - // store the order items - for (OrderItem o : orderitems) { - o.setOrder(order); - o.updatePK(); - em.persist(o); - } - em.flush(); - - return order; - } - - public int getSize() { - return getItems().size(); - } - - /* - * Get the inventory item. - * - * @param id of inventory item. - * - * @return an inventory bean. - */ - private Inventory getInventoryItem(String inventoryID) { - Inventory inv = null; - inv = em.find(Inventory.class, inventoryID); - return inv; - } - - /* - * Create a BackOrder of this inventory item. - * - * @param quantity The number of the inventory item to be backordered - */ - private void backOrder(Inventory inv, int amountToOrder) { - BackOrder b = em.find(BackOrder.class, inv.getInventoryId()); - if (b == null) { - // create a new backorder if none exists - BackOrder newBO = new BackOrder(inv, amountToOrder); - em.persist(newBO); - em.flush(); - inv.setBackOrder(newBO); - } else { - // update the backorder with the new quantity - int quantity = b.getQuantity(); - quantity += amountToOrder; - em.lock(b, LockModeType.WRITE); - em.refresh(b); - b.setQuantity(quantity); - em.flush(); - inv.setBackOrder(b); - } - } - -} diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/java/com/ibm/websphere/samples/pbw/bean/ShoppingCartContent.java b/src/test/resources/test-applications/plantsbywebsphere/src/main/java/com/ibm/websphere/samples/pbw/bean/ShoppingCartContent.java deleted file mode 100755 index 3291588d..00000000 --- a/src/test/resources/test-applications/plantsbywebsphere/src/main/java/com/ibm/websphere/samples/pbw/bean/ShoppingCartContent.java +++ /dev/null @@ -1,96 +0,0 @@ -// -// COPYRIGHT LICENSE: This information contains sample code provided in source code form. You may copy, -// modify, and distribute these sample programs in any form without payment to IBM for the purposes of -// developing, using, marketing or distributing application programs conforming to the application -// programming interface for the operating platform for which the sample code is written. -// Notwithstanding anything to the contrary, IBM PROVIDES THE SAMPLE SOURCE CODE ON AN "AS IS" BASIS -// AND IBM DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, ANY IMPLIED -// WARRANTIES OR CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A PARTICULAR PURPOSE, -// TITLE, AND ANY WARRANTY OR CONDITION OF NON-INFRINGEMENT. IBM SHALL NOT BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR OPERATION OF THE -// SAMPLE SOURCE CODE. IBM HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS -// OR MODIFICATIONS TO THE SAMPLE SOURCE CODE. -// -// (C) COPYRIGHT International Business Machines Corp., 2001,2011 -// All Rights Reserved * Licensed Materials - Property of IBM -// -package com.ibm.websphere.samples.pbw.bean; - -import com.ibm.websphere.samples.pbw.jpa.Inventory; -import java.util.Enumeration; -import java.util.Hashtable; - -/** - * A class to hold a shopping cart's contents. - */ -public class ShoppingCartContent implements java.io.Serializable { - /** - * - */ - private static final long serialVersionUID = 1L; - private Hashtable table = null; - - public ShoppingCartContent() { - table = new Hashtable(); - } - - /** Add the item to the shopping cart. */ - public void addItem(Inventory si) { - table.put(si.getID(), new Integer(si.getQuantity())); - } - - /** Update the item in the shopping cart. */ - public void updateItem(Inventory si) { - table.put(si.getID(), new Integer(si.getQuantity())); - } - - /** Remove the item from the shopping cart. */ - public void removeItem(Inventory si) { - table.remove(si.getID()); - } - - /** - * Return the number of items in the cart. - * - * @return The number of items in the cart. - */ - public int size() { - return table.size(); - } - - /** - * Return the inventory ID at the index given. The first element is at index 0, the second at - * index 1, and so on. - * - * @return The inventory ID at the index, or NULL if not present. - */ - public String getInventoryID(int index) { - String retval = null; - String inventoryID; - int cnt = 0; - for (Enumeration myEnum = table.keys(); myEnum.hasMoreElements(); cnt++) { - inventoryID = (String) myEnum.nextElement(); - if (index == cnt) { - retval = inventoryID; - break; - } - } - return retval; - } - - /** - * Return the quantity for the inventory ID given. - * - * @return The quantity for the inventory ID given.. - * - */ - public int getQuantity(String inventoryID) { - Integer quantity = (Integer) table.get(inventoryID); - - if (quantity == null) - return 0; - else - return quantity.intValue(); - } - -} diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/java/com/ibm/websphere/samples/pbw/bean/SuppliersBean.java b/src/test/resources/test-applications/plantsbywebsphere/src/main/java/com/ibm/websphere/samples/pbw/bean/SuppliersBean.java deleted file mode 100755 index bf1b79fe..00000000 --- a/src/test/resources/test-applications/plantsbywebsphere/src/main/java/com/ibm/websphere/samples/pbw/bean/SuppliersBean.java +++ /dev/null @@ -1,142 +0,0 @@ -// -// COPYRIGHT LICENSE: This information contains sample code provided in source code form. You may copy, -// modify, and distribute these sample programs in any form without payment to IBM for the purposes of -// developing, using, marketing or distributing application programs conforming to the application -// programming interface for the operating platform for which the sample code is written. -// Notwithstanding anything to the contrary, IBM PROVIDES THE SAMPLE SOURCE CODE ON AN "AS IS" BASIS -// AND IBM DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, ANY IMPLIED -// WARRANTIES OR CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A PARTICULAR PURPOSE, -// TITLE, AND ANY WARRANTY OR CONDITION OF NON-INFRINGEMENT. IBM SHALL NOT BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR OPERATION OF THE -// SAMPLE SOURCE CODE. IBM HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS -// OR MODIFICATIONS TO THE SAMPLE SOURCE CODE. -// -// (C) COPYRIGHT International Business Machines Corp., 2004,2011 -// All Rights Reserved * Licensed Materials - Property of IBM -// -package com.ibm.websphere.samples.pbw.bean; - -import com.ibm.websphere.samples.pbw.jpa.Supplier; -import com.ibm.websphere.samples.pbw.utils.Util; -import java.io.Serializable; -import java.util.Collection; -import java.util.Iterator; -import javax.enterprise.context.Dependent; -import javax.persistence.EntityManager; -import javax.persistence.PersistenceContext; -import javax.persistence.Query; - -/** - * Bean implementation class for Enterprise Bean: Suppliers - */ -@Dependent -public class SuppliersBean implements Serializable { - - @PersistenceContext(unitName = "PBW") - EntityManager em; - - /** - * @param supplierID - * @param name - * @param street - * @param city - * @param state - * @param zip - * @param phone - * @param url - */ - public void createSupplier(String supplierID, - String name, - String street, - String city, - String state, - String zip, - String phone, - String url) { - try { - Util.debug("SuppliersBean.createSupplier() - Entered"); - Supplier supplier = null; - supplier = em.find(Supplier.class, supplierID); - if (supplier == null) { - Util.debug("SuppliersBean.createSupplier() - supplier doesn't exist."); - Util.debug("SuppliersBean.createSupplier() - Creating Supplier for SupplierID: " + supplierID); - supplier = new Supplier(supplierID, name, street, city, state, zip, phone, url); - em.persist(supplier); - } - } catch (Exception e) { - Util.debug("SuppliersBean.createSupplier() - Exception: " + e); - } - } - - /** - * @return Supplier - */ - public Supplier getSupplier() { - // Retrieve the first Supplier Info - try { - Collection suppliers = this.findSuppliers(); - if (suppliers != null) { - Util.debug("AdminServlet.getSupplierInfo() - Supplier found!"); - Iterator i = suppliers.iterator(); - if (i.hasNext()) { - return (Supplier) i.next(); - } - } - } catch (Exception e) { - Util.debug("AdminServlet.getSupplierInfo() - Exception:" + e); - } - return null; - } - - /** - * @param supplierID - * @param name - * @param street - * @param city - * @param state - * @param zip - * @param phone - * @param url - * @return supplierInfo - */ - public Supplier updateSupplier(String supplierID, - String name, - String street, - String city, - String state, - String zip, - String phone, - String url) { - Supplier supplier = null; - try { - Util.debug("SuppliersBean.updateSupplier() - Entered"); - supplier = em.find(Supplier.class, supplierID); - if (supplier != null) { - // Create a new Supplier if there is NOT an existing Supplier. - // supplier = getSupplierLocalHome().findByPrimaryKey(new SupplierKey(supplierID)); - supplier.setName(name); - supplier.setStreet(street); - supplier.setCity(city); - supplier.setUsstate(state); - supplier.setZip(zip); - supplier.setPhone(phone); - supplier.setUrl(url); - } else { - Util.debug("SuppliersBean.updateSupplier() - supplier doesn't exist."); - Util.debug("SuppliersBean.updateSupplier() - Couldn't update Supplier for SupplierID: " + supplierID); - } - } catch (Exception e) { - Util.debug("SuppliersBean.createSupplier() - Exception: " + e); - } - return (supplier); - } - - /** - * @return suppliers - */ - @SuppressWarnings("unchecked") - private Collection findSuppliers() { - Query q = em.createNamedQuery("findAllSuppliers"); - return q.getResultList(); - } -} diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/java/com/ibm/websphere/samples/pbw/jpa/BackOrder.java b/src/test/resources/test-applications/plantsbywebsphere/src/main/java/com/ibm/websphere/samples/pbw/jpa/BackOrder.java deleted file mode 100755 index c89512e1..00000000 --- a/src/test/resources/test-applications/plantsbywebsphere/src/main/java/com/ibm/websphere/samples/pbw/jpa/BackOrder.java +++ /dev/null @@ -1,134 +0,0 @@ -// -// COPYRIGHT LICENSE: This information contains sample code provided in source code form. You may copy, -// modify, and distribute these sample programs in any form without payment to IBM for the purposes of -// developing, using, marketing or distributing application programs conforming to the application -// programming interface for the operating platform for which the sample code is written. -// Notwithstanding anything to the contrary, IBM PROVIDES THE SAMPLE SOURCE CODE ON AN "AS IS" BASIS -// AND IBM DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, ANY IMPLIED -// WARRANTIES OR CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A PARTICULAR PURPOSE, -// TITLE, AND ANY WARRANTY OR CONDITION OF NON-INFRINGEMENT. IBM SHALL NOT BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR OPERATION OF THE -// SAMPLE SOURCE CODE. IBM HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS -// OR MODIFICATIONS TO THE SAMPLE SOURCE CODE. -// -// (C) COPYRIGHT International Business Machines Corp., 2003,2011 -// All Rights Reserved * Licensed Materials - Property of IBM -// -package com.ibm.websphere.samples.pbw.jpa; - -import com.ibm.websphere.samples.pbw.utils.Util; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.JoinColumn; -import javax.persistence.NamedQueries; -import javax.persistence.NamedQuery; -import javax.persistence.OneToOne; -import javax.persistence.Table; -import javax.persistence.TableGenerator; - -/** - * Bean mapping for BACKORDER table. - */ -@Entity(name = "BackOrder") -@Table(name = "BACKORDER", schema = "APP") -@NamedQueries({ @NamedQuery(name = "findAllBackOrders", query = "select b from BackOrder b"), - @NamedQuery(name = "findByInventoryID", query = "select b from BackOrder b where ((b.inventory.inventoryId = :id) and (b.status = 'Order Stock'))"), - @NamedQuery(name = "removeAllBackOrder", query = "delete from BackOrder") }) -public class BackOrder { - @Id - @GeneratedValue(strategy = GenerationType.TABLE, generator = "BackOrderSeq") - @TableGenerator(name = "BackOrderSeq", table = "IDGENERATOR", pkColumnName = "IDNAME", pkColumnValue = "BACKORDER", valueColumnName = "IDVALUE") - private String backOrderID; - private int quantity; - private String status; - private long lowDate; - private long orderDate; - private String supplierOrderID; // missing table - - // relationships - @OneToOne - @JoinColumn(name = "INVENTORYID") - private Inventory inventory; - - public BackOrder() { - } - - public BackOrder(String backOrderID) { - setBackOrderID(backOrderID); - } - - public BackOrder(Inventory inventory, int quantity) { - this.setInventory(inventory); - this.setQuantity(quantity); - this.setStatus(Util.STATUS_ORDERSTOCK); - this.setLowDate(System.currentTimeMillis()); - } - - public String getBackOrderID() { - return backOrderID; - } - - public void setBackOrderID(String backOrderID) { - this.backOrderID = backOrderID; - } - - public long getLowDate() { - return lowDate; - } - - public void setLowDate(long lowDate) { - this.lowDate = lowDate; - } - - public long getOrderDate() { - return orderDate; - } - - public void setOrderDate(long orderDate) { - this.orderDate = orderDate; - } - - public int getQuantity() { - return quantity; - } - - public void setQuantity(int quantity) { - this.quantity = quantity; - } - - public void increateQuantity(int delta) { - if (!(status.equals(Util.STATUS_ORDERSTOCK))) { - Util.debug("BackOrderMgr.createBackOrder() - Backorders found but have already been ordered from the supplier"); - throw new RuntimeException("cannot increase order size for orders already in progress"); - } - // Increase the BackOrder quantity for an existing Back Order. - quantity = quantity + delta; - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - public String getSupplierOrderID() { - return supplierOrderID; - } - - public void setSupplierOrderID(String supplierOrderID) { - this.supplierOrderID = supplierOrderID; - } - - public Inventory getInventory() { - return inventory; - } - - public void setInventory(Inventory inventory) { - this.inventory = inventory; - } - -} diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/java/com/ibm/websphere/samples/pbw/jpa/Customer.java b/src/test/resources/test-applications/plantsbywebsphere/src/main/java/com/ibm/websphere/samples/pbw/jpa/Customer.java deleted file mode 100755 index e378aac9..00000000 --- a/src/test/resources/test-applications/plantsbywebsphere/src/main/java/com/ibm/websphere/samples/pbw/jpa/Customer.java +++ /dev/null @@ -1,204 +0,0 @@ -// -// COPYRIGHT LICENSE: This information contains sample code provided in source code form. You may copy, -// modify, and distribute these sample programs in any form without payment to IBM for the purposes of -// developing, using, marketing or distributing application programs conforming to the application -// programming interface for the operating platform for which the sample code is written. -// Notwithstanding anything to the contrary, IBM PROVIDES THE SAMPLE SOURCE CODE ON AN "AS IS" BASIS -// AND IBM DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, ANY IMPLIED -// WARRANTIES OR CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A PARTICULAR PURPOSE, -// TITLE, AND ANY WARRANTY OR CONDITION OF NON-INFRINGEMENT. IBM SHALL NOT BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR OPERATION OF THE -// SAMPLE SOURCE CODE. IBM HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS -// OR MODIFICATIONS TO THE SAMPLE SOURCE CODE. -// -// (C) COPYRIGHT International Business Machines Corp., 2001,2011 -// All Rights Reserved * Licensed Materials - Property of IBM -// -package com.ibm.websphere.samples.pbw.jpa; - -import javax.persistence.Entity; -import javax.persistence.Id; -import javax.persistence.NamedQueries; -import javax.persistence.NamedQuery; -import javax.persistence.Table; -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Pattern; -import javax.validation.constraints.Size; - -/** - * Customer is the bean mapping for the CUSTOMER table. - * - * @see Customer - */ -@Entity(name = "Customer") -@Table(name = "CUSTOMER", schema = "APP") -@NamedQueries({ @NamedQuery(name = "removeAllCustomers", query = "delete from Customer") }) -public class Customer { - @Id - private String customerID; - private String password; - - @NotNull - @Size(min = 1, message = "First name must include at least one letter.") - private String firstName; - @NotNull - @Size(min = 1, message = "Last name must include at least one letter.") - private String lastName; - @NotNull - @Size(min = 1, message = "Address must include at least one letter.") - private String addr1; - private String addr2; - @NotNull - @Size(min = 1, message = "City name must include at least one letter.") - private String addrCity; - @NotNull - @Size(min = 2, message = "State must include at least two letters.") - private String addrState; - @Pattern(regexp = "\\d{5}", message = "Zip code does not have 5 digits.") - private String addrZip; - @NotNull - @Pattern(regexp = "\\d{3}-\\d{3}-\\d{4}", message = "Phone number does not match xxx-xxx-xxxx.") - private String phone; - - public Customer() { - } - - /** - * Create a new Customer. - * - * @param key - * CustomerKey - * @param password - * Password used for this customer account. - * @param firstName - * First name of the customer. - * @param lastName - * Last name of the customer - * @param addr1 - * Street address of the customer - * @param addr2 - * Street address of the customer - * @param addrCity - * City - * @param addrState - * State - * @param addrZip - * Zip code - * @param phone - * Phone number - */ - public Customer(String key, String password, String firstName, String lastName, String addr1, String addr2, - String addrCity, String addrState, String addrZip, String phone) { - this.setCustomerID(key); - this.setPassword(password); - this.setFirstName(firstName); - this.setLastName(lastName); - this.setAddr1(addr1); - this.setAddr2(addr2); - this.setAddrCity(addrCity); - this.setAddrState(addrState); - this.setAddrZip(addrZip); - this.setPhone(phone); - } - - /** - * Verify password. - * - * @param password - * value to be checked. - * @return True, if password matches one stored. - */ - public boolean verifyPassword(String password) { - return this.getPassword().equals(password); - } - - /** - * Get the customer's full name. - * - * @return String of customer's full name. - */ - public String getFullName() { - return this.getFirstName() + " " + this.getLastName(); - } - - public String getAddr1() { - return addr1; - } - - public void setAddr1(String addr1) { - this.addr1 = addr1; - } - - public String getAddr2() { - return addr2; - } - - public void setAddr2(String addr2) { - this.addr2 = addr2; - } - - public String getAddrCity() { - return addrCity; - } - - public void setAddrCity(String addrCity) { - this.addrCity = addrCity; - } - - public String getAddrState() { - return addrState; - } - - public void setAddrState(String addrState) { - this.addrState = addrState; - } - - public String getAddrZip() { - return addrZip; - } - - public void setAddrZip(String addrZip) { - this.addrZip = addrZip; - } - - public String getCustomerID() { - return customerID; - } - - public void setCustomerID(String customerID) { - this.customerID = customerID; - } - - public String getFirstName() { - return firstName; - } - - public void setFirstName(String firstName) { - this.firstName = firstName; - } - - public String getLastName() { - return lastName; - } - - public void setLastName(String lastName) { - this.lastName = lastName; - } - - public String getPassword() { - return password; - } - - public void setPassword(String password) { - this.password = password; - } - - public String getPhone() { - return phone; - } - - public void setPhone(String phone) { - this.phone = phone; - } - -} diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/java/com/ibm/websphere/samples/pbw/jpa/Inventory.java b/src/test/resources/test-applications/plantsbywebsphere/src/main/java/com/ibm/websphere/samples/pbw/jpa/Inventory.java deleted file mode 100755 index 90bc1965..00000000 --- a/src/test/resources/test-applications/plantsbywebsphere/src/main/java/com/ibm/websphere/samples/pbw/jpa/Inventory.java +++ /dev/null @@ -1,311 +0,0 @@ -// -// COPYRIGHT LICENSE: This information contains sample code provided in source code form. You may copy, -// modify, and distribute these sample programs in any form without payment to IBM for the purposes of -// developing, using, marketing or distributing application programs conforming to the application -// programming interface for the operating platform for which the sample code is written. -// Notwithstanding anything to the contrary, IBM PROVIDES THE SAMPLE SOURCE CODE ON AN "AS IS" BASIS -// AND IBM DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, ANY IMPLIED -// WARRANTIES OR CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A PARTICULAR PURPOSE, -// TITLE, AND ANY WARRANTY OR CONDITION OF NON-INFRINGEMENT. IBM SHALL NOT BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR OPERATION OF THE -// SAMPLE SOURCE CODE. IBM HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS -// OR MODIFICATIONS TO THE SAMPLE SOURCE CODE. -// -// (C) COPYRIGHT International Business Machines Corp., 2001,2011 -// All Rights Reserved * Licensed Materials - Property of IBM -// -package com.ibm.websphere.samples.pbw.jpa; - -import com.ibm.websphere.samples.pbw.utils.Util; -import javax.persistence.Entity; -import javax.persistence.Id; -import javax.persistence.NamedQueries; -import javax.persistence.NamedQuery; -import javax.persistence.Table; -import javax.persistence.Transient; -import javax.persistence.Version; - -/** - * Inventory is the bean mapping for the INVENTORY table. It provides information about products the - * store has for sale. - * - * @see Inventory - */ -@Entity(name = "Inventory") -@Table(name = "INVENTORY", schema = "APP") -@NamedQueries({ - @NamedQuery(name = "getItemsByCategory", query = "select i from Inventory i where i.category = :category ORDER BY i.inventoryId"), - @NamedQuery(name = "getItemsLikeName", query = "select i from Inventory i where i.name like :name"), - @NamedQuery(name = "removeAllInventory", query = "delete from Inventory") }) -public class Inventory implements Cloneable, java.io.Serializable { - private static final long serialVersionUID = 1L; - private static final int DEFAULT_MINTHRESHOLD = 50; - private static final int DEFAULT_MAXTHRESHOLD = 200; - @Id - private String inventoryId; - private String name; - private String heading; - private String description; - private String pkginfo; - private String image; - private byte[] imgbytes; - private float price; - private float cost; - private int quantity; - private int category; - private String notes; - private boolean isPublic; - private int minThreshold; - private int maxThreshold; - - @Version - private long version; - - @Transient - private BackOrder backOrder; - - public Inventory() { - } - - /** - * Create a new Inventory. - * - * @param key - * Inventory Key - * @param name - * Name of inventory item. - * @param heading - * Description heading of inventory item. - * @param desc - * Description of inventory item. - * @param pkginfo - * Package info of inventory item. - * @param image - * Image of inventory item. - * @param price - * Price of inventory item. - * @param cost - * Cost of inventory item. - * @param quantity - * Quantity of inventory items in stock. - * @param category - * Category of inventory item. - * @param notes - * Notes of inventory item. - * @param isPublic - * Access permission of inventory item. - */ - public Inventory(String key, String name, String heading, String desc, String pkginfo, String image, float price, - float cost, int quantity, int category, String notes, boolean isPublic) { - this.setInventoryId(key); - Util.debug("creating new Inventory, inventoryId=" + this.getInventoryId()); - this.setName(name); - this.setHeading(heading); - this.setDescription(desc); - this.setPkginfo(pkginfo); - this.setImage(image); - this.setPrice(price); - this.setCost(cost); - this.setQuantity(quantity); - this.setCategory(category); - this.setNotes(notes); - this.setIsPublic(isPublic); - this.setMinThreshold(DEFAULT_MINTHRESHOLD); - this.setMaxThreshold(DEFAULT_MAXTHRESHOLD); - - } - - /** - * Create a new Inventory. - * - * @param item - * Inventory to use to make a new inventory item. - */ - public Inventory(Inventory item) { - this.setInventoryId(item.getInventoryId()); - this.setName(item.getName()); - this.setHeading(item.getHeading()); - this.setDescription(item.getDescription()); - this.setPkginfo(item.getPkginfo()); - this.setImage(item.getImage()); - this.setPrice(item.getPrice()); - this.setCost(item.getCost()); - this.setQuantity(item.getQuantity()); - this.setCategory(item.getCategory()); - this.setNotes(item.getNotes()); - this.setMinThreshold(DEFAULT_MINTHRESHOLD); - this.setMaxThreshold(DEFAULT_MAXTHRESHOLD); - - setIsPublic(item.isPublic()); - - // does not clone BackOrder info - } - - /** - * Increase the quantity of this inventory item. - * - * @param quantity - * The number to increase the inventory by. - */ - public void increaseInventory(int quantity) { - this.setQuantity(this.getQuantity() + quantity); - } - - public int getCategory() { - return category; - } - - public void setCategory(int category) { - this.category = category; - } - - public float getCost() { - return cost; - } - - public void setCost(float cost) { - this.cost = cost; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public String getHeading() { - return heading; - } - - public void setHeading(String heading) { - this.heading = heading; - } - - public String getImage() { - return image; - } - - public void setImage(String image) { - this.image = image; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getNotes() { - return notes; - } - - public void setNotes(String notes) { - this.notes = notes; - } - - public String getPkginfo() { - return pkginfo; - } - - public void setPkginfo(String pkginfo) { - this.pkginfo = pkginfo; - } - - public float getPrice() { - return price; - } - - public void setPrice(float price) { - this.price = price; - } - - public int getQuantity() { - return quantity; - } - - public void setQuantity(int quantity) { - this.quantity = quantity; - } - - public int getMaxThreshold() { - return maxThreshold; - } - - public void setMaxThreshold(int maxThreshold) { - this.maxThreshold = maxThreshold; - } - - public int getMinThreshold() { - return minThreshold; - } - - public void setMinThreshold(int minThreshold) { - this.minThreshold = minThreshold; - } - - public String getInventoryId() { - return inventoryId; - } - - public void setInventoryId(String id) { - inventoryId = id; - } - - /** - * Same as getInventoryId. Added for compatability with ShoppingCartItem when used by the Client - * XJB sample - * - * @return String ID of the inventory item - */ - public String getID() { - return inventoryId; - } - - /** - * Same as setInventoryId. Added for compatability with ShoppingCartItem when used by the Client - * XJB sample - * - */ - public void setID(String id) { - inventoryId = id; - } - - public boolean isPublic() { - return isPublic; - } - - public void setIsPublic(boolean isPublic) { - this.isPublic = isPublic; - } - - /** Set the inventory item's public availability. */ - public void setPrivacy(boolean isPublic) { - setIsPublic(isPublic); - } - - public byte[] getImgbytes() { - return imgbytes; - } - - public void setImgbytes(byte[] imgbytes) { - this.imgbytes = imgbytes; - } - - public BackOrder getBackOrder() { - return backOrder; - } - - public void setBackOrder(BackOrder backOrder) { - this.backOrder = backOrder; - } - - @Override - public String toString() { - return getClass().getSimpleName() + "{id=" + inventoryId + "}"; - } - -} diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/java/com/ibm/websphere/samples/pbw/jpa/Order.java b/src/test/resources/test-applications/plantsbywebsphere/src/main/java/com/ibm/websphere/samples/pbw/jpa/Order.java deleted file mode 100755 index 85bf49db..00000000 --- a/src/test/resources/test-applications/plantsbywebsphere/src/main/java/com/ibm/websphere/samples/pbw/jpa/Order.java +++ /dev/null @@ -1,391 +0,0 @@ -// -// COPYRIGHT LICENSE: This information contains sample code provided in source code form. You may copy, -// modify, and distribute these sample programs in any form without payment to IBM for the purposes of -// developing, using, marketing or distributing application programs conforming to the application -// programming interface for the operating platform for which the sample code is written. -// Notwithstanding anything to the contrary, IBM PROVIDES THE SAMPLE SOURCE CODE ON AN "AS IS" BASIS -// AND IBM DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, ANY IMPLIED -// WARRANTIES OR CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A PARTICULAR PURPOSE, -// TITLE, AND ANY WARRANTY OR CONDITION OF NON-INFRINGEMENT. IBM SHALL NOT BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR OPERATION OF THE -// SAMPLE SOURCE CODE. IBM HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS -// OR MODIFICATIONS TO THE SAMPLE SOURCE CODE. -// -// (C) COPYRIGHT International Business Machines Corp., 2001,2011 -// All Rights Reserved * Licensed Materials - Property of IBM -// - -package com.ibm.websphere.samples.pbw.jpa; - -import com.ibm.websphere.samples.pbw.utils.Util; -import java.util.Collection; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToOne; -import javax.persistence.NamedQueries; -import javax.persistence.NamedQuery; -import javax.persistence.Table; -import javax.persistence.TableGenerator; -import javax.persistence.Transient; - -/** - * Bean mapping for the ORDER1 table. - */ -@Entity(name = "Order") -@Table(name = "ORDER1", schema = "APP") -@NamedQueries({ @NamedQuery(name = "removeAllOrders", query = "delete from Order") }) -public class Order { - public static final String ORDER_INFO_TABLE_NAME = "java:comp/env/jdbc/OrderInfoTableName"; - public static final String ORDER_ITEMS_TABLE_NAME = "java:comp/env/jdbc/OrderItemsTableName"; - - @Id - @GeneratedValue(strategy = GenerationType.TABLE, generator = "OrderSeq") - @TableGenerator(name = "OrderSeq", table = "IDGENERATOR", pkColumnName = "IDNAME", pkColumnValue = "ORDER", valueColumnName = "IDVALUE") - private String orderID; - private String sellDate; - private String billName; - private String billAddr1; - private String billAddr2; - private String billCity; - private String billState; - private String billZip; - private String billPhone; - private String shipName; - private String shipAddr1; - private String shipAddr2; - private String shipCity; - private String shipState; - private String shipZip; - private String shipPhone; - private String creditCard; - private String ccNum; - private String ccExpireMonth; - private String ccExpireYear; - private String cardHolder; - private int shippingMethod; - private float profit; - - @ManyToOne - @JoinColumn(name = "CUSTOMERID") - private Customer customer; - @Transient - private Collection orderItems; - - @Transient - private Collection items = null; - - /** - * Constructor to create an Order. - * - * @param customer - * - customer who created the order - * @param billName - * - billing name - * @param billAddr1 - * - billing address line 1 - * @param billAddr2 - * - billing address line 2 - * @param billCity - * - billing address city - * @param billState - * - billing address state - * @param billZip - * - billing address zip code - * @param billPhone - * - billing phone - * @param shipName - * - shippng name - * @param shipAddr1 - * - shippng address line 1 - * @param shipAddr2 - * - shippng address line 2 - * @param shipCity - * - shippng address city - * @param shipState - * - shippng address state - * @param shipZip - * - shippng address zip code - * @param shipPhone - * - shippng phone - * @param creditCard - * - credit card - * @param ccNum - * - credit card number - * @param ccExpireMonth - * - credit card expiration month - * @param ccExpireYear - * - credit card expiration year - * @param cardHolder - * - credit card holder name - * @param shippingMethod - * int of shipping method used - * @param items - * vector of StoreItems ordered - */ - public Order(Customer customer, String billName, String billAddr1, String billAddr2, String billCity, - String billState, String billZip, String billPhone, String shipName, String shipAddr1, String shipAddr2, - String shipCity, String shipState, String shipZip, String shipPhone, String creditCard, String ccNum, - String ccExpireMonth, String ccExpireYear, String cardHolder, int shippingMethod, - Collection items) { - this.setSellDate(Long.toString(System.currentTimeMillis())); - - // Pad it to 14 digits so sorting works properly. - if (this.getSellDate().length() < 14) { - StringBuffer sb = new StringBuffer(Util.ZERO_14); - sb.replace((14 - this.getSellDate().length()), 14, this.getSellDate()); - this.setSellDate(sb.toString()); - } - - this.setCustomer(customer); - this.setBillName(billName); - this.setBillAddr1(billAddr1); - this.setBillAddr2(billAddr2); - this.setBillCity(billCity); - this.setBillState(billState); - this.setBillZip(billZip); - this.setBillPhone(billPhone); - this.setShipName(shipName); - this.setShipAddr1(shipAddr1); - this.setShipAddr2(shipAddr2); - this.setShipCity(shipCity); - this.setShipState(shipState); - this.setShipZip(shipZip); - this.setShipPhone(shipPhone); - this.setCreditCard(creditCard); - this.setCcNum(ccNum); - this.setCcExpireMonth(ccExpireMonth); - this.setCcExpireYear(ccExpireYear); - this.setCardHolder(cardHolder); - this.setShippingMethod(shippingMethod); - this.items = items; - - // Get profit for total order. - OrderItem oi; - float profit; - profit = 0.0f; - for (Object o : items) { - oi = (OrderItem) o; - profit = profit + (oi.getQuantity() * (oi.getPrice() - oi.getCost())); - oi.setOrder(this); - } - this.setProfit(profit); - } - - public Order(String orderID) { - setOrderID(orderID); - } - - public Order() { - } - - public String getBillAddr1() { - return billAddr1; - } - - public void setBillAddr1(String billAddr1) { - this.billAddr1 = billAddr1; - } - - public String getBillAddr2() { - return billAddr2; - } - - public void setBillAddr2(String billAddr2) { - this.billAddr2 = billAddr2; - } - - public String getBillCity() { - return billCity; - } - - public void setBillCity(String billCity) { - this.billCity = billCity; - } - - public String getBillName() { - return billName; - } - - public void setBillName(String billName) { - this.billName = billName; - } - - public String getBillPhone() { - return billPhone; - } - - public void setBillPhone(String billPhone) { - this.billPhone = billPhone; - } - - public String getBillState() { - return billState; - } - - public void setBillState(String billState) { - this.billState = billState; - } - - public String getBillZip() { - return billZip; - } - - public void setBillZip(String billZip) { - this.billZip = billZip; - } - - public String getCardHolder() { - return cardHolder; - } - - public void setCardHolder(String cardHolder) { - this.cardHolder = cardHolder; - } - - public String getCcExpireMonth() { - return ccExpireMonth; - } - - public void setCcExpireMonth(String ccExpireMonth) { - this.ccExpireMonth = ccExpireMonth; - } - - public String getCcExpireYear() { - return ccExpireYear; - } - - public void setCcExpireYear(String ccExpireYear) { - this.ccExpireYear = ccExpireYear; - } - - public String getCcNum() { - return ccNum; - } - - public void setCcNum(String ccNum) { - this.ccNum = ccNum; - } - - public String getCreditCard() { - return creditCard; - } - - public void setCreditCard(String creditCard) { - this.creditCard = creditCard; - } - - public Customer getCustomer() { - return customer; - } - - public void setCustomer(Customer customer) { - this.customer = customer; - } - - public Collection getItems() { - return items; - } - - public void setItems(Collection items) { - this.items = items; - } - - public String getOrderID() { - return orderID; - } - - public void setOrderID(String orderID) { - this.orderID = orderID; - } - - public Collection getOrderItems() { - return orderItems; - } - - public void setOrderItems(Collection orderItems) { - this.orderItems = orderItems; - } - - public float getProfit() { - return profit; - } - - public void setProfit(float profit) { - this.profit = profit; - } - - public String getSellDate() { - return sellDate; - } - - public void setSellDate(String sellDate) { - this.sellDate = sellDate; - } - - public String getShipAddr1() { - return shipAddr1; - } - - public void setShipAddr1(String shipAddr1) { - this.shipAddr1 = shipAddr1; - } - - public String getShipAddr2() { - return shipAddr2; - } - - public void setShipAddr2(String shipAddr2) { - this.shipAddr2 = shipAddr2; - } - - public String getShipCity() { - return shipCity; - } - - public void setShipCity(String shipCity) { - this.shipCity = shipCity; - } - - public String getShipName() { - return shipName; - } - - public void setShipName(String shipName) { - this.shipName = shipName; - } - - public String getShipPhone() { - return shipPhone; - } - - public void setShipPhone(String shipPhone) { - this.shipPhone = shipPhone; - } - - public int getShippingMethod() { - return shippingMethod; - } - - public void setShippingMethod(int shippingMethod) { - this.shippingMethod = shippingMethod; - } - - public String getShipZip() { - return shipZip; - } - - public void setShipZip(String shipZip) { - this.shipZip = shipZip; - } - - public String getShipState() { - return shipState; - } - - public void setShipState(String shipState) { - this.shipState = shipState; - } -} diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/java/com/ibm/websphere/samples/pbw/jpa/OrderItem.java b/src/test/resources/test-applications/plantsbywebsphere/src/main/java/com/ibm/websphere/samples/pbw/jpa/OrderItem.java deleted file mode 100755 index d5bcd472..00000000 --- a/src/test/resources/test-applications/plantsbywebsphere/src/main/java/com/ibm/websphere/samples/pbw/jpa/OrderItem.java +++ /dev/null @@ -1,227 +0,0 @@ -// -// COPYRIGHT LICENSE: This information contains sample code provided in source code form. You may copy, -// modify, and distribute these sample programs in any form without payment to IBM for the purposes of -// developing, using, marketing or distributing application programs conforming to the application -// programming interface for the operating platform for which the sample code is written. -// Notwithstanding anything to the contrary, IBM PROVIDES THE SAMPLE SOURCE CODE ON AN "AS IS" BASIS -// AND IBM DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, ANY IMPLIED -// WARRANTIES OR CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A PARTICULAR PURPOSE, -// TITLE, AND ANY WARRANTY OR CONDITION OF NON-INFRINGEMENT. IBM SHALL NOT BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR OPERATION OF THE -// SAMPLE SOURCE CODE. IBM HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS -// OR MODIFICATIONS TO THE SAMPLE SOURCE CODE. -// -// (C) COPYRIGHT International Business Machines Corp., 2003,2011 -// All Rights Reserved * Licensed Materials - Property of IBM -// -package com.ibm.websphere.samples.pbw.jpa; - -import com.ibm.websphere.samples.pbw.utils.Util; -import javax.persistence.Column; -import javax.persistence.Embeddable; -import javax.persistence.EmbeddedId; -import javax.persistence.Entity; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToOne; -import javax.persistence.NamedQueries; -import javax.persistence.NamedQuery; -import javax.persistence.Table; -import javax.persistence.Transient; - -/** - * Bean mapping for the ORDERITEM table. - */ -@Entity(name = "OrderItem") -@Table(name = "ORDERITEM", schema = "APP") -@NamedQueries({ @NamedQuery(name = "removeAllOrderItem", query = "delete from OrderItem") }) -public class OrderItem { - /** - * Composite Key class for Entity Bean: OrderItem - * - * Key consists of essentially two foreign key relations, but is mapped as foreign keys. - */ - @Embeddable - public static class PK implements java.io.Serializable { - static final long serialVersionUID = 3206093459760846163L; - @Column(name = "inventoryID") - public String inventoryID; - @Column(name = "ORDER_ORDERID") - public String order_orderID; - - public PK() { - Util.debug("OrderItem.PK()"); - } - - public PK(String inventoryID, String argOrder) { - Util.debug("OrderItem.PK() inventoryID=" + inventoryID + "="); - Util.debug("OrderItem.PK() orderID=" + argOrder + "="); - this.inventoryID = inventoryID; - this.order_orderID = argOrder; - } - - /** - * Returns true if both keys are equal. - */ - public boolean equals(java.lang.Object otherKey) { - if (otherKey instanceof PK) { - PK o = (PK) otherKey; - return ((this.inventoryID.equals(o.inventoryID)) && (this.order_orderID.equals(o.order_orderID))); - } - return false; - } - - /** - * Returns the hash code for the key. - */ - public int hashCode() { - Util.debug("OrderItem.PK.hashCode() inventoryID=" + inventoryID + "="); - Util.debug("OrderItem.PK.hashCode() orderID=" + order_orderID + "="); - - return (inventoryID.hashCode() + order_orderID.hashCode()); - } - } - - @SuppressWarnings("unused") - @EmbeddedId - private OrderItem.PK id; - private String name; - private String pkginfo; - private float price; - private float cost; - private int category; - private int quantity; - private String sellDate; - @Transient - private String inventoryId; - - @ManyToOne - @JoinColumn(name = "INVENTORYID", insertable = false, updatable = false) - private Inventory inventory; - @ManyToOne - @JoinColumn(name = "ORDER_ORDERID", insertable = false, updatable = false) - private Order order; - - public int getCategory() { - return category; - } - - public void setCategory(int category) { - this.category = category; - } - - public float getCost() { - return cost; - } - - public void setCost(float cost) { - this.cost = cost; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getPkginfo() { - return pkginfo; - } - - public void setPkginfo(String pkginfo) { - this.pkginfo = pkginfo; - } - - public float getPrice() { - return price; - } - - public void setPrice(float price) { - this.price = price; - } - - public int getQuantity() { - return quantity; - } - - public void setQuantity(int quantity) { - this.quantity = quantity; - } - - public String getSellDate() { - return sellDate; - } - - public void setSellDate(String sellDate) { - this.sellDate = sellDate; - } - - public OrderItem() { - } - - public OrderItem(Inventory inv) { - Util.debug("OrderItem(inv) - id = " + inv.getInventoryId()); - setInventoryId(inv.getInventoryId()); - inventory = inv; - name = inv.getName(); - pkginfo = inv.getPkginfo(); - price = inv.getPrice(); - cost = inv.getCost(); - category = inv.getCategory(); - } - - public OrderItem(Order order, String orderID, Inventory inv, java.lang.String name, java.lang.String pkginfo, - float price, float cost, int quantity, int category, java.lang.String sellDate) { - Util.debug("OrderItem(etc.)"); - inventory = inv; - setInventoryId(inv.getInventoryId()); - setName(name); - setPkginfo(pkginfo); - setPrice(price); - setCost(cost); - setQuantity(quantity); - setCategory(category); - setSellDate(sellDate); - setOrder(order); - id = new OrderItem.PK(inv.getInventoryId(), order.getOrderID()); - } - - /* - * updates the primary key field with the composite orderId+inventoryId - */ - public void updatePK() { - id = new OrderItem.PK(inventoryId, order.getOrderID()); - } - - public Inventory getInventory() { - return inventory; - } - - public void setInventory(Inventory inv) { - this.inventory = inv; - } - - public Order getOrder() { - return order; - } - - /** - * Sets the order for this item Also updates the sellDate - * - * @param order - */ - public void setOrder(Order order) { - this.order = order; - this.sellDate = order.getSellDate(); - } - - public String getInventoryId() { - return inventoryId; - } - - public void setInventoryId(String inventoryId) { - this.inventoryId = inventoryId; - } - -} diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/java/com/ibm/websphere/samples/pbw/jpa/OrderKey.java b/src/test/resources/test-applications/plantsbywebsphere/src/main/java/com/ibm/websphere/samples/pbw/jpa/OrderKey.java deleted file mode 100755 index 608093b1..00000000 --- a/src/test/resources/test-applications/plantsbywebsphere/src/main/java/com/ibm/websphere/samples/pbw/jpa/OrderKey.java +++ /dev/null @@ -1,81 +0,0 @@ -// -// COPYRIGHT LICENSE: This information contains sample code provided in source code form. You may copy, -// modify, and distribute these sample programs in any form without payment to IBM for the purposes of -// developing, using, marketing or distributing application programs conforming to the application -// programming interface for the operating platform for which the sample code is written. -// Notwithstanding anything to the contrary, IBM PROVIDES THE SAMPLE SOURCE CODE ON AN "AS IS" BASIS -// AND IBM DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, ANY IMPLIED -// WARRANTIES OR CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A PARTICULAR PURPOSE, -// TITLE, AND ANY WARRANTY OR CONDITION OF NON-INFRINGEMENT. IBM SHALL NOT BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR OPERATION OF THE -// SAMPLE SOURCE CODE. IBM HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS -// OR MODIFICATIONS TO THE SAMPLE SOURCE CODE. -// -// (C) COPYRIGHT International Business Machines Corp., 2001,2011 -// All Rights Reserved * Licensed Materials - Property of IBM -// -package com.ibm.websphere.samples.pbw.jpa; - -import java.io.Serializable; - -/** - * The key class of the Order entity bean. - **/ -public class OrderKey implements Serializable { - - private static final long serialVersionUID = 7912030586849592135L; - - public String orderID; - - /** - * Constructs an OrderKey object. - */ - public OrderKey() { - } - - /** - * Constructs a newly allocated OrderKey object that represents the primitive long argument. - */ - public OrderKey(String orderID) { - this.orderID = orderID; - } - - /** - * Determines if the OrderKey object passed to the method matches this OrderKey object. - * - * @param obj - * java.lang.Object The OrderKey object to compare to this OrderKey object. - * @return boolean The pass object is either equal to this OrderKey object (true) or not. - */ - public boolean equals(Object obj) { - if (obj instanceof OrderKey) { - OrderKey otherKey = (OrderKey) obj; - return (((orderID.equals(otherKey.orderID)))); - } else - return false; - } - - /** - * Generates a hash code for this OrderKey object. - * - * @return int The hash code. - */ - public int hashCode() { - return (orderID.hashCode()); - } - - /** - * Get accessor for persistent attribute: orderID - */ - public java.lang.String getOrderID() { - return orderID; - } - - /** - * Set accessor for persistent attribute: orderID - */ - public void setOrderID(java.lang.String newOrderID) { - orderID = newOrderID; - } - -} diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/java/com/ibm/websphere/samples/pbw/jpa/Supplier.java b/src/test/resources/test-applications/plantsbywebsphere/src/main/java/com/ibm/websphere/samples/pbw/jpa/Supplier.java deleted file mode 100755 index d74aa7c9..00000000 --- a/src/test/resources/test-applications/plantsbywebsphere/src/main/java/com/ibm/websphere/samples/pbw/jpa/Supplier.java +++ /dev/null @@ -1,135 +0,0 @@ -// -// COPYRIGHT LICENSE: This information contains sample code provided in source code form. You may copy, -// modify, and distribute these sample programs in any form without payment to IBM for the purposes of -// developing, using, marketing or distributing application programs conforming to the application -// programming interface for the operating platform for which the sample code is written. -// Notwithstanding anything to the contrary, IBM PROVIDES THE SAMPLE SOURCE CODE ON AN "AS IS" BASIS -// AND IBM DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, ANY IMPLIED -// WARRANTIES OR CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A PARTICULAR PURPOSE, -// TITLE, AND ANY WARRANTY OR CONDITION OF NON-INFRINGEMENT. IBM SHALL NOT BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR OPERATION OF THE -// SAMPLE SOURCE CODE. IBM HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS -// OR MODIFICATIONS TO THE SAMPLE SOURCE CODE. -// -// (C) COPYRIGHT International Business Machines Corp., 2004,2011 -// All Rights Reserved * Licensed Materials - Property of IBM -// -package com.ibm.websphere.samples.pbw.jpa; - -import javax.persistence.Entity; -import javax.persistence.Id; -import javax.persistence.NamedQueries; -import javax.persistence.NamedQuery; -import javax.persistence.Table; - -/** - * Bean mapping for the SUPPLIER table. - */ -@Entity(name = "Supplier") -@Table(name = "SUPPLIER", schema = "APP") -@NamedQueries({ @NamedQuery(name = "findAllSuppliers", query = "select s from Supplier s"), - @NamedQuery(name = "removeAllSupplier", query = "delete from Supplier") }) -public class Supplier { - @Id - private String supplierID; - private String name; - private String city; - private String usstate; - private String zip; - private String phone; - private String url; - private String street; - - public String getCity() { - return city; - } - - public void setCity(String city) { - this.city = city; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getPhone() { - return phone; - } - - public void setPhone(String phone) { - this.phone = phone; - } - - public String getStreet() { - return street; - } - - public void setStreet(String street) { - this.street = street; - } - - public String getSupplierID() { - return supplierID; - } - - public void setSupplierID(String supplierID) { - this.supplierID = supplierID; - } - - public String getUrl() { - return url; - } - - public void setUrl(String url) { - this.url = url; - } - - public String getUsstate() { - return usstate; - } - - public void setUsstate(String usstate) { - this.usstate = usstate; - } - - public String getZip() { - return zip; - } - - public void setZip(String zip) { - this.zip = zip; - } - - public Supplier() { - } - - public Supplier(String supplierID) { - setSupplierID(supplierID); - } - - /** - * @param supplierID - * @param name - * @param street - * @param city - * @param state - * @param zip - * @param phone - * @param url - */ - public Supplier(String supplierID, String name, String street, String city, String state, String zip, String phone, - String url) { - this.setSupplierID(supplierID); - this.setName(name); - this.setStreet(street); - this.setCity(city); - this.setUsstate(state); - this.setZip(zip); - this.setPhone(phone); - this.setUrl(url); - } -} diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/java/com/ibm/websphere/samples/pbw/utils/ListProperties.java b/src/test/resources/test-applications/plantsbywebsphere/src/main/java/com/ibm/websphere/samples/pbw/utils/ListProperties.java deleted file mode 100644 index 5df97e61..00000000 --- a/src/test/resources/test-applications/plantsbywebsphere/src/main/java/com/ibm/websphere/samples/pbw/utils/ListProperties.java +++ /dev/null @@ -1,155 +0,0 @@ -// -// COPYRIGHT LICENSE: This information contains sample code provided in source code form. You may copy, -// modify, and distribute these sample programs in any form without payment to IBM for the purposes of -// developing, using, marketing or distributing application programs conforming to the application -// programming interface for the operating platform for which the sample code is written. -// Notwithstanding anything to the contrary, IBM PROVIDES THE SAMPLE SOURCE CODE ON AN "AS IS" BASIS -// AND IBM DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, ANY IMPLIED -// WARRANTIES OR CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A PARTICULAR PURPOSE, -// TITLE, AND ANY WARRANTY OR CONDITION OF NON-INFRINGEMENT. IBM SHALL NOT BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR OPERATION OF THE -// SAMPLE SOURCE CODE. IBM HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS -// OR MODIFICATIONS TO THE SAMPLE SOURCE CODE. -// -// (C) COPYRIGHT International Business Machines Corp., 2004,2011 -// All Rights Reserved * Licensed Materials - Property of IBM -// -package com.ibm.websphere.samples.pbw.utils; -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.util.Hashtable; -import java.util.Properties; -import java.util.StringTokenizer; -import java.util.Vector; - - -/** - * @author aamortim - * - * To change the template for this generated type comment go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ -/** - * Utility class. - */ -public class ListProperties extends Properties { - /** - * - */ - private static final long serialVersionUID = 1L; - private Hashtable> listProps = null; - /* Method load - * @param inStream - */ - - public void load(InputStream inStream) throws IOException { - try { - Util.debug("ListProperties.load - loading from stream "+inStream); - // Parse property file, remove comments, blank lines, and combine - // continued lines. - String propFile = ""; - BufferedReader inputLine = new BufferedReader(new InputStreamReader(inStream)); - String line = inputLine.readLine(); - boolean lineContinue = false; - while (line != null) { - Util.debug("ListProperties.load - Line read: " + line); - line = line.trim(); - String currLine = ""; - if (line.startsWith("#")) { - // Skipping comment - } else if (line.startsWith("!")) { - // Skipping comment - } else if (line.equals("")) { - // Skipping blank lines - } else { - if (!lineContinue) { - currLine = line; - } else { - // This is a continuation line. Add to previous line. - currLine += line; - } - // Must be a property line - if (line.endsWith("\\")) { - // Next line is continued from the current one. - lineContinue = true; - } else { - // The current line is completed. Parse the property. - propFile += currLine + "\n"; - currLine = ""; - lineContinue = false; - } - } - line = inputLine.readLine(); - } - // Load Properties - listProps = new Hashtable>(); - // Now parse the Properties to create an array - String[] props = readTokens(propFile, "\n"); - for (int index = 0; index < props.length; index++) { - Util.debug("ListProperties.load() - props[" + index + "] = " + props[index]); - // Parse the line to get the key,value pair - String[] val = readTokens(props[index], "="); - Util.debug("ListProperties.load() - val[0]: " + val[0] + " val[1]: " + val[1]); - if (!val[0].equals("")) { - if (this.containsKey(val[0])) { - // Previous key,value was already created. - // Need an array - Vector currList = (Vector) listProps.get(val[0]); - if ((currList == null) || currList.isEmpty()) { - currList = new Vector(); - String prevVal = this.getProperty(val[0]); - currList.addElement(prevVal); - } - currList.addElement(val[1]); - listProps.put(val[0], currList); - } - this.setProperty(val[0], val[1]); - } - } - } catch (Exception e) { - Util.debug("ListProperties.load(): Exception: " + e); - e.printStackTrace(); - } - } - /** - * Method readTokens. - * @param text - * @param token - * @return list - */ - public String[] readTokens(String text, String token) { - StringTokenizer parser = new StringTokenizer(text, token); - int numTokens = parser.countTokens(); - String[] list = new String[numTokens]; - for (int i = 0; i < numTokens; i++) { - list[i] = parser.nextToken(); - } - return list; - } - /** - * Method getProperties. - * @param name - * @return values - */ - public String[] getProperties(String name) { - String[] values = { "" }; - try { - String value = this.getProperty(name); - Util.debug("ListProperties.getProperties: property (" + name + ") -> " + value); - if (listProps.containsKey(name)) { - Vector list = (Vector) listProps.get(name); - values = new String[list.size()]; - for (int index = 0; index < list.size(); index++) { - values[index] = (String) list.elementAt(index); - } - } else { - values[0] = value; - } - } catch (Exception e) { - Util.debug("ListProperties.getProperties(): Exception: " + e); - } - return (values); - } -} diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/java/com/ibm/websphere/samples/pbw/utils/Util.java b/src/test/resources/test-applications/plantsbywebsphere/src/main/java/com/ibm/websphere/samples/pbw/utils/Util.java deleted file mode 100644 index 31e092e7..00000000 --- a/src/test/resources/test-applications/plantsbywebsphere/src/main/java/com/ibm/websphere/samples/pbw/utils/Util.java +++ /dev/null @@ -1,310 +0,0 @@ -// -// COPYRIGHT LICENSE: This information contains sample code provided in source code form. You may copy, -// modify, and distribute these sample programs in any form without payment to IBM for the purposes of -// developing, using, marketing or distributing application programs conforming to the application -// programming interface for the operating platform for which the sample code is written. -// Notwithstanding anything to the contrary, IBM PROVIDES THE SAMPLE SOURCE CODE ON AN "AS IS" BASIS -// AND IBM DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, ANY IMPLIED -// WARRANTIES OR CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A PARTICULAR PURPOSE, -// TITLE, AND ANY WARRANTY OR CONDITION OF NON-INFRINGEMENT. IBM SHALL NOT BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR OPERATION OF THE -// SAMPLE SOURCE CODE. IBM HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS -// OR MODIFICATIONS TO THE SAMPLE SOURCE CODE. -// -// (C) COPYRIGHT International Business Machines Corp., 2001,2011 -// All Rights Reserved * Licensed Materials - Property of IBM -// -package com.ibm.websphere.samples.pbw.utils; - -import java.io.FileNotFoundException; -import java.text.NumberFormat; -import java.util.StringTokenizer; -import javax.faces.application.Application; -import javax.faces.application.ProjectStage; -import javax.faces.context.FacesContext; -import javax.naming.InitialContext; -import javax.naming.NamingException; - -/** - * Utility class. - */ -public class Util { - /** Datasource name. */ - public static final String DS_NAME = "java:comp/env/jdbc/PlantsByWebSphereDataSource"; - // Constants for JSPs and HTMLs. - public static final String PAGE_ACCOUNT = "account.jsp"; - public static final String PAGE_CART = "cart.jsp"; - public static final String PAGE_CHECKOUTFINAL = "checkout_final.jsp"; - public static final String PAGE_HELP = "help.jsp"; - public static final String PAGE_LOGIN = "login.jsp"; - public static final String PAGE_ORDERDONE = "orderdone.jsp"; - public static final String PAGE_ORDERINFO = "orderinfo.jsp"; - public static final String PAGE_PRODUCT = "product.jsp"; - public static final String PAGE_PROMO = "promo.html"; - public static final String PAGE_REGISTER = "register.jsp"; - public static final String PAGE_SHOPPING = "shopping.jsp"; - public static final String PAGE_BACKADMIN = "backorderadmin.jsp"; - public static final String PAGE_SUPPLIERCFG = "supplierconfig.jsp"; - public static final String PAGE_ADMINHOME = "admin.html"; - public static final String PAGE_ADMINACTIONS = "adminactions.html"; - // Request and session attributes. - public static final String ATTR_ACTION = "action"; - public static final String ATTR_CART = "ShoppingCart"; -// public static final String ATTR_CART_CONTENTS = "CartContents"; - public static final String ATTR_CARTITEMS = "cartitems"; - public static final String ATTR_CATEGORY = "Category"; - public static final String ATTR_CHECKOUT = "CheckingOut"; - public static final String ATTR_CUSTOMER = "CustomerInfo"; - public static final String ATTR_EDITACCOUNTINFO = "EditAccountInfo"; - public static final String ATTR_INVITEM = "invitem"; - public static final String ATTR_INVITEMS = "invitems"; - public static final String ATTR_ORDERID = "OrderID"; - public static final String ATTR_ORDERINFO = "OrderInfo"; - public static final String ATTR_ORDERKEY = "OrderKey"; - public static final String ATTR_RESULTS = "results"; - public static final String ATTR_UPDATING = "updating"; - public static final int ATTR_SFTIMEOUT = 10; // if this is changed, updated session timeout - // in the PlantsByWebSphere web.xml - public static final String ATTR_SUPPLIER = "SupplierInfo"; - // Admin type actions - public static final String ATTR_ADMINTYPE = "admintype"; - public static final String ADMIN_BACKORDER = "backorder"; - public static final String ADMIN_SUPPLIERCFG = "supplierconfig"; - public static final String ADMIN_POPULATE = "populate"; - // Servlet action codes. - // Supplier Config actions - public static final String ACTION_GETSUPPLIER = "getsupplier"; - public static final String ACTION_UPDATESUPPLIER = "updatesupplier"; - // Backorder actions - public static final String ACTION_ORDERSTOCK = "orderstock"; - public static final String ACTION_UPDATESTOCK = "updatestock"; - public static final String ACTION_GETBACKORDERS = "getbackorders"; - public static final String ACTION_UPDATEQUANTITY = "updatequantity"; - public static final String ACTION_ORDERSTATUS = "orderstatus"; - public static final String ACTION_CANCEL = "cancel"; - public static final String STATUS_ORDERSTOCK = "Order Stock"; - public static final String STATUS_ORDEREDSTOCK = "Ordered Stock"; - public static final String STATUS_RECEIVEDSTOCK = "Received Stock"; - public static final String STATUS_ADDEDSTOCK = "Added Stock"; - public static final String DEFAULT_SUPPLIERID = "Supplier"; - private static InitialContext initCtx = null; - private static final String[] CATEGORY_STRINGS = { "Flowers", "Fruits & Vegetables", "Trees", "Accessories" }; - private static final String[] SHIPPING_METHOD_STRINGS = { "Standard Ground", "Second Day Air", "Next Day Air" }; - private static final String[] SHIPPING_METHOD_TIMES = { "( 3 to 6 business days )", "( 2 to 3 business days )", "( 1 to 2 business days )" }; - private static final float[] SHIPPING_METHOD_PRICES = { 4.99f, 8.99f, 12.99f }; - public static final String ZERO_14 = "00000000000000"; - /** - * Return the cached Initial Context. - * - * @return InitialContext, or null if a naming exception. - */ - static public InitialContext getInitialContext() { - try { - // Get InitialContext if it has not been gotten yet. - if (initCtx == null) { - // properties are in the system properties - initCtx = new InitialContext(); - } - } - // Naming Exception will cause a null return. - catch (NamingException e) {} - return initCtx; - } - - /** - * Get the displayable name of a category. - * @param index The int representation of a category. - * @return The category as a String (null, if an invalid index given). - */ - static public String getCategoryString(int index) { - if ((index >= 0) && (index < CATEGORY_STRINGS.length)) - return CATEGORY_STRINGS[index]; - else - return null; - } - /** - * Get the category strings in an array. - * - * @return The category strings in an array. - */ - static public String[] getCategoryStrings() { - return CATEGORY_STRINGS; - } - /** - * Get the shipping method. - * @param index The int representation of a shipping method. - * @return The shipping method (null, if an invalid index given). - */ - static public String getShippingMethod(int index) { - if ((index >= 0) && (index < SHIPPING_METHOD_STRINGS.length)) - return SHIPPING_METHOD_STRINGS[index]; - else - return null; - } - /** - * Get the shipping method price. - * @param index The int representation of a shipping method. - * @return The shipping method price (-1, if an invalid index given). - */ - static public float getShippingMethodPrice(int index) { - if ((index >= 0) && (index < SHIPPING_METHOD_PRICES.length)) - return SHIPPING_METHOD_PRICES[index]; - else - return -1; - } - /** - * Get the shipping method price. - * @param index The int representation of a shipping method. - * @return The shipping method time (null, if an invalid index given). - */ - static public String getShippingMethodTime(int index) { - if ((index >= 0) && (index < SHIPPING_METHOD_TIMES.length)) - return SHIPPING_METHOD_TIMES[index]; - else - return null; - } - /** - * Get the shipping method strings in an array. - * @return The shipping method strings in an array. - */ - static public String[] getShippingMethodStrings() { - return SHIPPING_METHOD_STRINGS; - } - /** - * Get the shipping method strings, including prices and times, in an array. - * @return The shipping method strings, including prices and times, in an array. - */ - static public String[] getFullShippingMethodStrings() { - String[] shippingMethods = new String[SHIPPING_METHOD_STRINGS.length]; - for (int i = 0; i < shippingMethods.length; i++) { - shippingMethods[i] = SHIPPING_METHOD_STRINGS[i] + " " + SHIPPING_METHOD_TIMES[i] + " " + NumberFormat.getCurrencyInstance(java.util.Locale.US).format(new Float(SHIPPING_METHOD_PRICES[i])); - } - return shippingMethods; - } - private static final String PBW_PROPERTIES = "pbw.properties"; - private static ListProperties PBW_Properties = null; - /** - * Method readProperties. - */ - public static void readProperties() throws FileNotFoundException { - if (PBW_Properties == null) { - // Try to read the properties file. - ListProperties prop = new ListProperties(); - try { - String PBW_Properties_File = PBW_PROPERTIES; - debug("Util.readProperties(): Loading PBW Properties from file: " + PBW_Properties_File); - prop.load(Util.class.getClassLoader().getResourceAsStream(PBW_Properties_File)); - } catch (Exception e) { - debug("Util.readProperties(): Exception: " + e); - // Reset properties to retry loading next time. - PBW_Properties = null; - e.printStackTrace(); - throw new FileNotFoundException(); - } - PBW_Properties = prop; - } - } - /** - * Method getProperty. - * @param name - * @return value - */ - public static String getProperty(String name) { - String value = ""; - try { - if (PBW_Properties == null) { - readProperties(); - } - value = PBW_Properties.getProperty(name); - } catch (Exception e) { - debug("Util.getProperty(): Exception: " + e); - } - return (value); - } - /** - * Method readTokens. - * @param text - * @param token - * @return list - */ - public static String[] readTokens(String text, String token) { - StringTokenizer parser = new StringTokenizer(text, token); - int numTokens = parser.countTokens(); - String[] list = new String[numTokens]; - for (int i = 0; i < numTokens; i++) { - list[i] = parser.nextToken(); - } - return list; - } - /** - * Method getProperties. - * @param name - * @return values - */ - public static String[] getProperties(String name) { - String[] values = { "" }; - try { - if (PBW_Properties == null) { - readProperties(); - } - values = PBW_Properties.getProperties(name); - debug("Util.getProperties: property (" + name + ") -> " + values.toString()); - //for (Enumeration e = PBW_Properties.propertyNames() ; e.hasMoreElements() ;) { - // debug((String)e.nextElement()); - //} - } catch (Exception e) { - debug("Util.getProperties(): Exception: " + e); - } - return (values); - } - static private boolean debug = false; - /** Set debug setting to on or off. - * @param val True or false. - */ - static final public void setDebug(boolean val) { - debug = val; - } - /** Is debug turned on? */ - static final public boolean debugOn() { - return debug; - } - /** - * Output RAS message. - * @param msg Message to be output. - */ - static final public void debug(String msg) { - FacesContext context = FacesContext.getCurrentInstance(); - if (context != null) { - Application app = context.getApplication(); - if (app != null) { - ProjectStage stage = app.getProjectStage(); - if (stage == ProjectStage.Development || stage == ProjectStage.UnitTest) { - setDebug(true); - } - } - if (debug) { - System.out.println(msg); - } - } - } - - /** - * Utilty functions for validating user input. - * validateString will return false if any of the invalid characters appear in the input string. - * - * In general, we do not want to allow special characters in user input, - * because this can open us to a XSS security vulnerability. - * For example, a user should not be allowed to enter javascript in an input field. - */ - static final char[] invalidCharList={'|','&',';','$','%','\'','\"','\\','<','>',','}; - - public static boolean validateString(String input){ - if (input==null) return true; - for (int i=0;i backOrders = backOrderStock.findBackOrders(); - ArrayList backOrderItems = new ArrayList(); - for (BackOrder bo : backOrders) { - BackOrderItem boi = new BackOrderItem(bo); - backOrderItems.add(boi); - } - Util.debug("AdminServlet.getBackOrders() - BackOrders found!"); - Iterator i = backOrderItems.iterator(); - while (i.hasNext()) { - BackOrderItem backOrderItem = (BackOrderItem) i.next(); - String backOrderID = backOrderItem.getBackOrderID(); - String inventoryID = backOrderItem.getInventory().getInventoryId(); - // Get the inventory quantity and name for the back order item - // information. - Inventory item = catalog.getItemInventory(inventoryID); - int quantity = item.getQuantity(); - backOrderItem.setInventoryQuantity(quantity); - String name = item.getName(); - backOrderItem.setName(name); - // Don't include backorders that have been completed. - if (!(backOrderItem.getStatus().equals(Util.STATUS_ADDEDSTOCK))) { - String invID = backOrderItem.getInventory().getInventoryId(); - String supplierOrderID = backOrderItem.getSupplierOrderID(); - String status = backOrderItem.getStatus(); - String lowDate = new Long(backOrderItem.getLowDate()).toString(); - String orderDate = new Long(backOrderItem.getOrderDate()).toString(); - Util.debug("AdminServlet.getBackOrders() - backOrderID = " + backOrderID); - Util.debug("AdminServlet.getBackOrders() - supplierOrderID = " + supplierOrderID); - Util.debug("AdminServlet.getBackOrders() - invID = " + invID); - Util.debug("AdminServlet.getBackOrders() - name = " + name); - Util.debug("AdminServlet.getBackOrders() - quantity = " + quantity); - Util.debug("AdminServlet.getBackOrders() - status = " + status); - Util.debug("AdminServlet.getBackOrders() - lowDate = " + lowDate); - Util.debug("AdminServlet.getBackOrders() - orderDate = " + orderDate); - } - } - session.setAttribute("backorderitems", backOrderItems); - } catch (Exception e) { - e.printStackTrace(); - Util.debug("AdminServlet.getBackOrders() - RemoteException: " + e); - } - } - - /** - * Method sendRedirect. - * - * @param resp - * @param page - * @throws ServletException - * @throws IOException - */ - private void sendRedirect(HttpServletResponse resp, String page) throws ServletException, IOException { - resp.sendRedirect(resp.encodeRedirectURL(page)); - } - - /** - * Method requestDispatch. - * - * @param ctx - * @param req - * @param resp - * @param page - * @throws ServletException - * @throws IOException - */ - /** - * Request dispatch - */ - private void requestDispatch(ServletContext ctx, - HttpServletRequest req, - HttpServletResponse resp, - String page) throws ServletException, IOException { - resp.setContentType("text/html"); - ctx.getRequestDispatcher(page).forward(req, resp); - } -} diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/java/com/ibm/websphere/samples/pbw/war/BackOrderItem.java b/src/test/resources/test-applications/plantsbywebsphere/src/main/java/com/ibm/websphere/samples/pbw/war/BackOrderItem.java deleted file mode 100755 index 2db881d1..00000000 --- a/src/test/resources/test-applications/plantsbywebsphere/src/main/java/com/ibm/websphere/samples/pbw/war/BackOrderItem.java +++ /dev/null @@ -1,209 +0,0 @@ -// -// COPYRIGHT LICENSE: This information contains sample code provided in source code form. You may copy, -// modify, and distribute these sample programs in any form without payment to IBM for the purposes of -// developing, using, marketing or distributing application programs conforming to the application -// programming interface for the operating platform for which the sample code is written. -// Notwithstanding anything to the contrary, IBM PROVIDES THE SAMPLE SOURCE CODE ON AN "AS IS" BASIS -// AND IBM DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, ANY IMPLIED -// WARRANTIES OR CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A PARTICULAR PURPOSE, -// TITLE, AND ANY WARRANTY OR CONDITION OF NON-INFRINGEMENT. IBM SHALL NOT BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR OPERATION OF THE -// SAMPLE SOURCE CODE. IBM HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS -// OR MODIFICATIONS TO THE SAMPLE SOURCE CODE. -// -// (C) COPYRIGHT International Business Machines Corp., 2003,2011 -// All Rights Reserved * Licensed Materials - Property of IBM -// -package com.ibm.websphere.samples.pbw.war; - -import com.ibm.websphere.samples.pbw.jpa.BackOrder; -import com.ibm.websphere.samples.pbw.jpa.Inventory; -import com.ibm.websphere.samples.pbw.utils.Util; - -/** - * A class to hold a back order item's data. - */ -public class BackOrderItem implements java.io.Serializable { - /** - * - */ - private static final long serialVersionUID = 1L; - private String name; - private int inventoryQuantity; - private String backOrderID; // from BackOrder - private int quantity; // from BackOrder - private String status; // from BackOrder - private long lowDate; // from BackOrder - private long orderDate; // from BackOrder - private String supplierOrderID; // from BackOrder - private Inventory inventory; // from BackOrder - - /** - * @see java.lang.Object#Object() - */ - /** Default constructor. */ - public BackOrderItem() { - } - - /** - * Method BackOrderItem. - * - * @param backOrderID - * @param inventoryID - * @param name - * @param quantity - * @param status - */ - public BackOrderItem(String backOrderID, Inventory inventoryID, String name, int quantity, String status) { - this.backOrderID = backOrderID; - this.inventory = inventoryID; - this.name = name; - this.quantity = quantity; - this.status = status; - } - - /** - * Method BackOrderItem. - * - * @param backOrder - */ - public BackOrderItem(BackOrder backOrder) { - try { - this.backOrderID = backOrder.getBackOrderID(); - this.inventory = backOrder.getInventory(); - this.quantity = backOrder.getQuantity(); - this.status = backOrder.getStatus(); - this.lowDate = backOrder.getLowDate(); - this.orderDate = backOrder.getOrderDate(); - this.supplierOrderID = backOrder.getSupplierOrderID(); - } catch (Exception e) { - Util.debug("BackOrderItem - Exception: " + e); - } - } - - /** - * Method getBackOrderID. - * - * @return String - */ - public String getBackOrderID() { - return backOrderID; - } - - /** - * Method setBackOrderID. - * - * @param backOrderID - */ - public void setBackOrderID(String backOrderID) { - this.backOrderID = backOrderID; - } - - /** - * Method getSupplierOrderID. - * - * @return String - */ - public String getSupplierOrderID() { - return supplierOrderID; - } - - /** - * Method setSupplierOrderID. - * - * @param supplierOrderID - */ - public void setSupplierOrderID(String supplierOrderID) { - this.supplierOrderID = supplierOrderID; - } - - /** - * Method setQuantity. - * - * @param quantity - */ - public void setQuantity(int quantity) { - this.quantity = quantity; - } - - /** - * Method getInventoryID. - * - * @return String - */ - public Inventory getInventory() { - return inventory; - } - - /** - * Method getName. - * - * @return String - */ - public String getName() { - return name; - } - - /** - * Method setName. - * - * @param name - */ - public void setName(String name) { - this.name = name; - } - - /** - * Method getQuantity. - * - * @return int - */ - public int getQuantity() { - return quantity; - } - - /** - * Method getInventoryQuantity. - * - * @return int - */ - public int getInventoryQuantity() { - return inventoryQuantity; - } - - /** - * Method setInventoryQuantity. - * - * @param quantity - */ - public void setInventoryQuantity(int quantity) { - this.inventoryQuantity = quantity; - } - - /** - * Method getStatus. - * - * @return String - */ - public String getStatus() { - return status; - } - - /** - * Method getLowDate. - * - * @return long - */ - public long getLowDate() { - return lowDate; - } - - /** - * Method getOrderDate. - * - * @return long - */ - public long getOrderDate() { - return orderDate; - } -} diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/java/com/ibm/websphere/samples/pbw/war/HelpBean.java b/src/test/resources/test-applications/plantsbywebsphere/src/main/java/com/ibm/websphere/samples/pbw/war/HelpBean.java deleted file mode 100755 index bbc6e070..00000000 --- a/src/test/resources/test-applications/plantsbywebsphere/src/main/java/com/ibm/websphere/samples/pbw/war/HelpBean.java +++ /dev/null @@ -1,84 +0,0 @@ -// -// COPYRIGHT LICENSE: This information contains sample code provided in source code form. You may copy, -// modify, and distribute these sample programs in any form without payment to IBM for the purposes of -// developing, using, marketing or distributing application programs conforming to the application -// programming interface for the operating platform for which the sample code is written. -// Notwithstanding anything to the contrary, IBM PROVIDES THE SAMPLE SOURCE CODE ON AN "AS IS" BASIS -// AND IBM DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, ANY IMPLIED -// WARRANTIES OR CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A PARTICULAR PURPOSE, -// TITLE, AND ANY WARRANTY OR CONDITION OF NON-INFRINGEMENT. IBM SHALL NOT BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR OPERATION OF THE -// SAMPLE SOURCE CODE. IBM HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS -// OR MODIFICATIONS TO THE SAMPLE SOURCE CODE. -// -// (C) COPYRIGHT International Business Machines Corp., 2011 -// All Rights Reserved * Licensed Materials - Property of IBM -// - -package com.ibm.websphere.samples.pbw.war; - -import com.ibm.websphere.samples.pbw.bean.ResetDBBean; -import com.ibm.websphere.samples.pbw.utils.Util; -import java.io.Serializable; -import javax.enterprise.context.Dependent; -import javax.inject.Inject; -import javax.inject.Named; - -/** - * JSF action bean for the help page. - * - */ -@Named("help") -public class HelpBean implements Serializable { - - @Inject - private ResetDBBean rdb; - - private String dbDumpFile; - - private static final String ACTION_HELP = "help"; - private static final String ACTION_HOME = "promo"; - - public String performHelp() { - return ACTION_HELP; - } - - public String performDBReset() { - rdb.resetDB(); - return ACTION_HOME; - } - - /** - * @return the dbDumpFile - */ - public String getDbDumpFile() { - return dbDumpFile; - } - - /** - * @param dbDumpFile - * the dbDumpFile to set - */ - public void setDbDumpFile(String dbDumpFile) { - this.dbDumpFile = dbDumpFile; - } - - /** - * @return whether debug is on or not - */ - public boolean isDebug() { - return Util.debugOn(); - } - - /** - * Debugging is currently tied to the JavaServer Faces project stage. Any change here is likely - * to be automatically reset. - * - * @param debug - * Sets whether debug is on or not. - */ - public void setDebug(boolean debug) { - Util.setDebug(debug); - } - -} diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/java/com/ibm/websphere/samples/pbw/war/ImageServlet.java b/src/test/resources/test-applications/plantsbywebsphere/src/main/java/com/ibm/websphere/samples/pbw/war/ImageServlet.java deleted file mode 100755 index a0824e84..00000000 --- a/src/test/resources/test-applications/plantsbywebsphere/src/main/java/com/ibm/websphere/samples/pbw/war/ImageServlet.java +++ /dev/null @@ -1,102 +0,0 @@ -// -// COPYRIGHT LICENSE: This information contains sample code provided in source code form. You may copy, -// modify, and distribute these sample programs in any form without payment to IBM for the purposes of -// developing, using, marketing or distributing application programs conforming to the application -// programming interface for the operating platform for which the sample code is written. -// Notwithstanding anything to the contrary, IBM PROVIDES THE SAMPLE SOURCE CODE ON AN "AS IS" BASIS -// AND IBM DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, ANY IMPLIED -// WARRANTIES OR CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A PARTICULAR PURPOSE, -// TITLE, AND ANY WARRANTY OR CONDITION OF NON-INFRINGEMENT. IBM SHALL NOT BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR OPERATION OF THE -// SAMPLE SOURCE CODE. IBM HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS -// OR MODIFICATIONS TO THE SAMPLE SOURCE CODE. -// -// (C) COPYRIGHT International Business Machines Corp., 2001,2011 -// All Rights Reserved * Licensed Materials - Property of IBM -// -package com.ibm.websphere.samples.pbw.war; - -import com.ibm.websphere.samples.pbw.bean.CatalogMgr; -import com.ibm.websphere.samples.pbw.utils.Util; -import java.io.IOException; -import javax.inject.Inject; -import javax.inject.Named; -import javax.servlet.ServletConfig; -import javax.servlet.ServletException; -import javax.servlet.annotation.WebServlet; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -/** - * Servlet to handle image actions. - */ -@Named(value = "image") -@WebServlet("/servlet/ImageServlet") -public class ImageServlet extends HttpServlet { - /** - * - */ - private static final long serialVersionUID = 1L; - - @Inject - private CatalogMgr catalog; - - /** - * Servlet initialization. - */ - public void init(ServletConfig config) throws ServletException { - super.init(config); - } - - /** - * Process incoming HTTP GET requests - * - * @param request - * Object that encapsulates the request to the servlet - * @param response - * Object that encapsulates the response from the servlet - */ - public void doGet(javax.servlet.http.HttpServletRequest request, - javax.servlet.http.HttpServletResponse response) throws ServletException, IOException { - performTask(request, response); - } - - /** - * Process incoming HTTP POST requests - * - * @param request - * Object that encapsulates the request to the servlet - * @param response - * Object that encapsulates the response from the servlet - */ - public void doPost(javax.servlet.http.HttpServletRequest request, - javax.servlet.http.HttpServletResponse response) throws ServletException, IOException { - performTask(request, response); - } - - /** - * Main service method for ImageServlet - * - * @param request - * Object that encapsulates the request to the servlet - * @param response - * Object that encapsulates the response from the servlet - */ - private void performTask(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { - String action = null; - - action = req.getParameter("action"); - Util.debug("action=" + action); - - if (action.equals("getimage")) { - String inventoryID = req.getParameter("inventoryID"); - - byte[] buf = catalog.getItemImageBytes(inventoryID); - if (buf != null) { - resp.setContentType("image/jpeg"); - resp.getOutputStream().write(buf); - } - } - } -} diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/java/com/ibm/websphere/samples/pbw/war/LoginInfo.java b/src/test/resources/test-applications/plantsbywebsphere/src/main/java/com/ibm/websphere/samples/pbw/war/LoginInfo.java deleted file mode 100755 index 6eed4cad..00000000 --- a/src/test/resources/test-applications/plantsbywebsphere/src/main/java/com/ibm/websphere/samples/pbw/war/LoginInfo.java +++ /dev/null @@ -1,72 +0,0 @@ -// -// COPYRIGHT LICENSE: This information contains sample code provided in source code form. You may copy, -// modify, and distribute these sample programs in any form without payment to IBM for the purposes of -// developing, using, marketing or distributing application programs conforming to the application -// programming interface for the operating platform for which the sample code is written. -// Notwithstanding anything to the contrary, IBM PROVIDES THE SAMPLE SOURCE CODE ON AN "AS IS" BASIS -// AND IBM DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, ANY IMPLIED -// WARRANTIES OR CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A PARTICULAR PURPOSE, -// TITLE, AND ANY WARRANTY OR CONDITION OF NON-INFRINGEMENT. IBM SHALL NOT BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR OPERATION OF THE -// SAMPLE SOURCE CODE. IBM HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS -// OR MODIFICATIONS TO THE SAMPLE SOURCE CODE. -// -// (C) COPYRIGHT International Business Machines Corp., 2003,2011 -// All Rights Reserved * Licensed Materials - Property of IBM -// - -package com.ibm.websphere.samples.pbw.war; - -import javax.validation.constraints.Pattern; -import javax.validation.constraints.Size; - -/** - * A JSF backing bean used to store information for the login web page. It is accessed via the - * account bean. - * - */ -public class LoginInfo { - private String checkPassword; - - @Pattern(regexp = "[a-zA-Z0-9_-]+@[a-zA-Z0-9.-]+") - private String email; - private String message; - - @Size(min = 6, max = 10, message = "Password must be between 6 and 10 characters.") - private String password; - - public LoginInfo() { - } - - public String getCheckPassword() { - return this.checkPassword; - } - - public String getEmail() { - return this.email; - } - - public String getMessage() { - return this.message; - } - - public String getPassword() { - return this.password; - } - - public void setCheckPassword(String checkPassword) { - this.checkPassword = checkPassword; - } - - public void setEmail(String email) { - this.email = email; - } - - public void setMessage(String message) { - this.message = message; - } - - public void setPassword(String password) { - this.password = password; - } -} diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/java/com/ibm/websphere/samples/pbw/war/MailAction.java b/src/test/resources/test-applications/plantsbywebsphere/src/main/java/com/ibm/websphere/samples/pbw/war/MailAction.java deleted file mode 100755 index ffd6a4c2..00000000 --- a/src/test/resources/test-applications/plantsbywebsphere/src/main/java/com/ibm/websphere/samples/pbw/war/MailAction.java +++ /dev/null @@ -1,63 +0,0 @@ -// -// COPYRIGHT LICENSE: This information contains sample code provided in source code form. You may copy, -// modify, and distribute these sample programs in any form without payment to IBM for the purposes of -// developing, using, marketing or distributing application programs conforming to the application -// programming interface for the operating platform for which the sample code is written. -// Notwithstanding anything to the contrary, IBM PROVIDES THE SAMPLE SOURCE CODE ON AN "AS IS" BASIS -// AND IBM DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, ANY IMPLIED -// WARRANTIES OR CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A PARTICULAR PURPOSE, -// TITLE, AND ANY WARRANTY OR CONDITION OF NON-INFRINGEMENT. IBM SHALL NOT BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR OPERATION OF THE -// SAMPLE SOURCE CODE. IBM HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS -// OR MODIFICATIONS TO THE SAMPLE SOURCE CODE. -// -// (C) COPYRIGHT International Business Machines Corp., 2001,2011 -// All Rights Reserved * Licensed Materials - Property of IBM -// -package com.ibm.websphere.samples.pbw.war; - -import com.ibm.websphere.samples.pbw.bean.MailerAppException; -import com.ibm.websphere.samples.pbw.bean.MailerBean; -import com.ibm.websphere.samples.pbw.jpa.Customer; -import com.ibm.websphere.samples.pbw.utils.Util; -import javax.inject.Inject; -import javax.inject.Named; - -/** - * This class sends the email confirmation message. - */ -@Named("mailaction") -public class MailAction implements java.io.Serializable { - /** - * - */ - private static final long serialVersionUID = 1L; - - @Inject - private MailerBean mailer; - - /** Public constructor */ - public MailAction() { - } - - /** - * Send the email order confirmation message. - * - * @param customer - * The customer information. - * @param orderKey - * The order number. - */ - public final void sendConfirmationMessage(Customer customer, - String orderKey) { - try { - System.out.println("mailer=" + mailer); - mailer.createAndSendMail(customer, orderKey); - } - // The MailerAppException will be ignored since mail may not be configured. - catch (MailerAppException e) { - Util.debug("Mailer threw exception, mail may not be configured. Exception:" + e); - } - } - -} diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/java/com/ibm/websphere/samples/pbw/war/OrderInfo.java b/src/test/resources/test-applications/plantsbywebsphere/src/main/java/com/ibm/websphere/samples/pbw/war/OrderInfo.java deleted file mode 100755 index 59797179..00000000 --- a/src/test/resources/test-applications/plantsbywebsphere/src/main/java/com/ibm/websphere/samples/pbw/war/OrderInfo.java +++ /dev/null @@ -1,517 +0,0 @@ -// -// COPYRIGHT LICENSE: This information contains sample code provided in source code form. You may copy, -// modify, and distribute these sample programs in any form without payment to IBM for the purposes of -// developing, using, marketing or distributing application programs conforming to the application -// programming interface for the operating platform for which the sample code is written. -// Notwithstanding anything to the contrary, IBM PROVIDES THE SAMPLE SOURCE CODE ON AN "AS IS" BASIS -// AND IBM DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, ANY IMPLIED -// WARRANTIES OR CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A PARTICULAR PURPOSE, -// TITLE, AND ANY WARRANTY OR CONDITION OF NON-INFRINGEMENT. IBM SHALL NOT BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR OPERATION OF THE -// SAMPLE SOURCE CODE. IBM HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS -// OR MODIFICATIONS TO THE SAMPLE SOURCE CODE. -// -// (C) COPYRIGHT International Business Machines Corp., 2001,2011 -// All Rights Reserved * Licensed Materials - Property of IBM -// -package com.ibm.websphere.samples.pbw.war; - -import com.ibm.websphere.samples.pbw.jpa.Order; -import com.ibm.websphere.samples.pbw.utils.Util; -import java.util.Calendar; -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Pattern; -import javax.validation.constraints.Size; - -/** - * A class to hold an order's data. - */ -public class OrderInfo implements java.io.Serializable { - private static final long serialVersionUID = 1L; - private String orderID; - @NotNull - @Size(min = 1, message = "Name for billing must include at least one letter.") - private String billName; - @NotNull - @Size(min = 1, message = "Billing address must include at least one letter.") - private String billAddr1; - private String billAddr2; - @NotNull - @Size(min = 1, message = "Billing city must include at least one letter.") - private String billCity; - @NotNull - @Size(min = 1, message = "Billing state must include at least one letter.") - private String billState; - - @Pattern(regexp = "\\d{5}", message = "Billing zip code does not have 5 digits.") - private String billZip; - - @Pattern(regexp = "\\d{3}-\\d{3}-\\d{4}", message = "Billing phone number does not match xxx-xxx-xxxx.") - private String billPhone; - @NotNull - @Size(min = 1, message = "Name for shipping must include at least one letter.") - private String shipName; - @NotNull - @Size(min = 1, message = "Shipping address must include at least one letter.") - private String shipAddr1; - private String shipAddr2; - @NotNull - @Size(min = 1, message = "Shipping city must include at least one letter.") - private String shipCity; - @NotNull - @Size(min = 1, message = "Shipping state must include at least one letter.") - private String shipState; - - @Pattern(regexp = "[0-9][0-9][0-9][0-9][0-9]", message = "Shipping zip code does not have 5 digits.") - private String shipZip; - - @Pattern(regexp = "\\d{3}-\\d{3}-\\d{4}", message = "Shipping phone number does not match xxx-xxx-xxxx.") - private String shipPhone; - private int shippingMethod; - @NotNull - @Size(min = 1, message = "Card holder name must include at least one letter.") - private String cardholderName; - private String cardName; - - @Pattern(regexp = "\\d{4} \\d{4} \\d{4} \\d{4}", message = "Credit card numbers must be entered as XXXX XXXX XXXX XXXX.") - private String cardNum; - private String cardExpMonth; - private String cardExpYear; - private String[] cardExpYears; - private boolean shipisbill = false; - - /** - * Constructor to create an OrderInfo by passing each field. - */ - public OrderInfo(String billName, String billAddr1, String billAddr2, String billCity, String billState, - String billZip, String billPhone, String shipName, String shipAddr1, String shipAddr2, String shipCity, - String shipState, String shipZip, String shipPhone, int shippingMethod, String orderID) { - this.orderID = orderID; - this.billName = billName; - this.billAddr1 = billAddr1; - this.billAddr2 = billAddr2; - this.billCity = billCity; - this.billState = billState; - this.billZip = billZip; - this.billPhone = billPhone; - this.shipName = shipName; - this.shipAddr1 = shipAddr1; - this.shipAddr2 = shipAddr2; - this.shipCity = shipCity; - this.shipState = shipState; - this.shipZip = shipZip; - this.shipPhone = shipPhone; - this.shippingMethod = shippingMethod; - initLists(); - cardholderName = ""; - cardNum = ""; - } - - /** - * Constructor to create an OrderInfo using an Order. - * - * @param order - */ - public OrderInfo(Order order) { - orderID = order.getOrderID(); - billName = order.getBillName(); - billAddr1 = order.getBillAddr1(); - billAddr2 = order.getBillAddr2(); - billCity = order.getBillCity(); - billState = order.getBillState(); - billZip = order.getBillZip(); - billPhone = order.getBillPhone(); - shipName = order.getShipName(); - shipAddr1 = order.getShipAddr1(); - shipAddr2 = order.getShipAddr2(); - shipCity = order.getShipCity(); - shipState = order.getShipState(); - shipZip = order.getShipZip(); - shipPhone = order.getShipPhone(); - shippingMethod = order.getShippingMethod(); - } - - /** - * Get the shipping method name. - */ - public String getShippingMethodName() { - return getShippingMethods()[shippingMethod]; - } - - /** - * Set the shipping method by name - */ - public void setShippingMethodName(String name) { - String[] methodNames = Util.getShippingMethodStrings(); - for (int i = 0; i < methodNames.length; i++) { - if (methodNames[i].equals(name)) - shippingMethod = i; - } - } - - /** - * Get shipping methods that are possible. - * - * @return String[] of method names - */ - public String[] getShippingMethods() { - return Util.getFullShippingMethodStrings(); - } - - public int getShippingMethodCount() { - return Util.getShippingMethodStrings().length; - } - - private void initLists() { - int i = Calendar.getInstance().get(1); - cardExpYears = new String[5]; - for (int j = 0; j < 5; j++) - cardExpYears[j] = (new Integer(i + j)).toString(); - } - - /** - * @return the orderID - */ - public String getID() { - return orderID; - } - - /** - * @param orderID - * the orderID to set - */ - public void setID(String orderID) { - this.orderID = orderID; - } - - /** - * @return the billName - */ - public String getBillName() { - return billName; - } - - /** - * @param billName - * the billName to set - */ - public void setBillName(String billName) { - this.billName = billName; - } - - /** - * @return the billAddr1 - */ - public String getBillAddr1() { - return billAddr1; - } - - /** - * @param billAddr1 - * the billAddr1 to set - */ - public void setBillAddr1(String billAddr1) { - this.billAddr1 = billAddr1; - } - - /** - * @return the billAddr2 - */ - public String getBillAddr2() { - return billAddr2; - } - - /** - * @param billAddr2 - * the billAddr2 to set - */ - public void setBillAddr2(String billAddr2) { - this.billAddr2 = billAddr2; - } - - /** - * @return the billCity - */ - public String getBillCity() { - return billCity; - } - - /** - * @param billCity - * the billCity to set - */ - public void setBillCity(String billCity) { - this.billCity = billCity; - } - - /** - * @return the billState - */ - public String getBillState() { - return billState; - } - - /** - * @param billState - * the billState to set - */ - public void setBillState(String billState) { - this.billState = billState; - } - - /** - * @return the billZip - */ - public String getBillZip() { - return billZip; - } - - /** - * @param billZip - * the billZip to set - */ - public void setBillZip(String billZip) { - this.billZip = billZip; - } - - /** - * @return the billPhone - */ - public String getBillPhone() { - return billPhone; - } - - /** - * @param billPhone - * the billPhone to set - */ - public void setBillPhone(String billPhone) { - this.billPhone = billPhone; - } - - /** - * @return the shipName - */ - public String getShipName() { - return shipName; - } - - /** - * @param shipName - * the shipName to set - */ - public void setShipName(String shipName) { - this.shipName = shipName; - } - - /** - * @return the shipAddr1 - */ - public String getShipAddr1() { - return shipAddr1; - } - - /** - * @param shipAddr1 - * the shipAddr1 to set - */ - public void setShipAddr1(String shipAddr1) { - this.shipAddr1 = shipAddr1; - } - - /** - * @return the shipAddr2 - */ - public String getShipAddr2() { - return shipAddr2; - } - - /** - * @param shipAddr2 - * the shipAddr2 to set - */ - public void setShipAddr2(String shipAddr2) { - this.shipAddr2 = shipAddr2; - } - - /** - * @return the shipCity - */ - public String getShipCity() { - return shipCity; - } - - /** - * @param shipCity - * the shipCity to set - */ - public void setShipCity(String shipCity) { - this.shipCity = shipCity; - } - - /** - * @return the shipState - */ - public String getShipState() { - return shipState; - } - - /** - * @param shipState - * the shipState to set - */ - public void setShipState(String shipState) { - this.shipState = shipState; - } - - /** - * @return the shipZip - */ - public String getShipZip() { - return shipZip; - } - - /** - * @param shipZip - * the shipZip to set - */ - public void setShipZip(String shipZip) { - this.shipZip = shipZip; - } - - /** - * @return the shipPhone - */ - public String getShipPhone() { - return shipPhone; - } - - /** - * @param shipPhone - * the shipPhone to set - */ - public void setShipPhone(String shipPhone) { - this.shipPhone = shipPhone; - } - - /** - * @return the shippingMethod - */ - public int getShippingMethod() { - return shippingMethod; - } - - /** - * @param shippingMethod - * the shippingMethod to set - */ - public void setShippingMethod(int shippingMethod) { - this.shippingMethod = shippingMethod; - } - - /** - * @return the cardholderName - */ - public String getCardholderName() { - return cardholderName; - } - - /** - * @param cardholderName - * the cardholderName to set - */ - public void setCardholderName(String cardholderName) { - this.cardholderName = cardholderName; - } - - /** - * @return the cardName - */ - public String getCardName() { - return cardName; - } - - /** - * @param cardName - * the cardName to set - */ - public void setCardName(String cardName) { - this.cardName = cardName; - } - - /** - * @return the cardNum - */ - public String getCardNum() { - return cardNum; - } - - /** - * @param cardNum - * the cardNum to set - */ - public void setCardNum(String cardNum) { - this.cardNum = cardNum; - } - - /** - * @return the cardExpMonth - */ - public String getCardExpMonth() { - return cardExpMonth; - } - - /** - * @param cardExpMonth - * the cardExpMonth to set - */ - public void setCardExpMonth(String cardExpMonth) { - this.cardExpMonth = cardExpMonth; - } - - /** - * @return the cardExpYear - */ - public String getCardExpYear() { - return cardExpYear; - } - - /** - * @param cardExpYear - * the cardExpYear to set - */ - public void setCardExpYear(String cardExpYear) { - this.cardExpYear = cardExpYear; - } - - /** - * @return the cardExpYears - */ - public String[] getCardExpYears() { - return cardExpYears; - } - - /** - * @param cardExpYears - * the cardExpYears to set - */ - public void setCardExpYears(String[] cardExpYears) { - this.cardExpYears = cardExpYears; - } - - /** - * @return the shipisbill - */ - public boolean isShipisbill() { - return shipisbill; - } - - /** - * @param shipisbill - * the shipisbill to set - */ - public void setShipisbill(boolean shipisbill) { - this.shipisbill = shipisbill; - } - -} diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/java/com/ibm/websphere/samples/pbw/war/Populate.java b/src/test/resources/test-applications/plantsbywebsphere/src/main/java/com/ibm/websphere/samples/pbw/war/Populate.java deleted file mode 100755 index ff3b49d8..00000000 --- a/src/test/resources/test-applications/plantsbywebsphere/src/main/java/com/ibm/websphere/samples/pbw/war/Populate.java +++ /dev/null @@ -1,302 +0,0 @@ -// -// COPYRIGHT LICENSE: This information contains sample code provided in source code form. You may copy, -// modify, and distribute these sample programs in any form without payment to IBM for the purposes of -// developing, using, marketing or distributing application programs conforming to the application -// programming interface for the operating platform for which the sample code is written. -// Notwithstanding anything to the contrary, IBM PROVIDES THE SAMPLE SOURCE CODE ON AN "AS IS" BASIS -// AND IBM DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, ANY IMPLIED -// WARRANTIES OR CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A PARTICULAR PURPOSE, -// TITLE, AND ANY WARRANTY OR CONDITION OF NON-INFRINGEMENT. IBM SHALL NOT BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR OPERATION OF THE -// SAMPLE SOURCE CODE. IBM HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS -// OR MODIFICATIONS TO THE SAMPLE SOURCE CODE. -// -// (C) COPYRIGHT International Business Machines Corp., 2004,2011 -// All Rights Reserved * Licensed Materials - Property of IBM -// -package com.ibm.websphere.samples.pbw.war; - -import com.ibm.websphere.samples.pbw.bean.BackOrderMgr; -import com.ibm.websphere.samples.pbw.bean.CatalogMgr; -import com.ibm.websphere.samples.pbw.bean.CustomerMgr; -import com.ibm.websphere.samples.pbw.bean.ResetDBBean; -import com.ibm.websphere.samples.pbw.bean.ShoppingCartBean; -import com.ibm.websphere.samples.pbw.bean.SuppliersBean; -import com.ibm.websphere.samples.pbw.jpa.Inventory; -import com.ibm.websphere.samples.pbw.utils.Util; -import java.io.DataInputStream; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.net.URL; -import java.util.Vector; - -/** - * A basic POJO class for resetting the database. - */ -public class Populate { - - private ResetDBBean resetDB; - - private CatalogMgr catalog; - - private CustomerMgr login; - - private ShoppingCartBean cart; - - private BackOrderMgr backOrderStock; - - private SuppliersBean suppliers; - - /** - * - */ - public Populate() { - } - - public Populate(ResetDBBean resetDB, CatalogMgr c, CustomerMgr l, BackOrderMgr b, SuppliersBean s) { - this.resetDB = resetDB; - this.catalog = c; - this.login = l; - this.backOrderStock = b; - this.suppliers = s; - } - - /** - * @param itemID - * @param fileName - * @param catalog - * @throws FileNotFoundException - * @throws IOException - */ - public static void addImage(String itemID, - String fileName, - CatalogMgr catalog) throws FileNotFoundException, IOException { - URL url = Thread.currentThread().getContextClassLoader().getResource("resources/images/" + fileName); - Util.debug("URL: " + url); - fileName = url.getPath(); - Util.debug("Fully-qualified Filename: " + fileName); - File imgFile = new File(fileName); - // Open the input file as a stream of bytes - FileInputStream fis = new FileInputStream(imgFile); - DataInputStream dis = new DataInputStream(fis); - int dataSize = dis.available(); - byte[] data = new byte[dataSize]; - dis.readFully(data); - catalog.setItemImageBytes(itemID, data); - } - - /** - * - */ - public void doPopulate() { - try { - resetDB.deleteAll(); - } catch (Exception e) { - Util.debug("Populate:doPopulate() - Exception deleting data in database: " + e); - e.printStackTrace(); - } - /** - * Populate INVENTORY table with text - */ - Util.debug("Populating INVENTORY table with text..."); - try { - String[] values = Util.getProperties("inventory"); - for (int index = 0; index < values.length; index++) { - Util.debug("Found INVENTORY property values: " + values[index]); - String[] fields = Util.readTokens(values[index], "|"); - String id = fields[0]; - String name = fields[1]; - String heading = fields[2]; - String descr = fields[3]; - String pkginfo = fields[4]; - String image = fields[5]; - float price = new Float(fields[6]).floatValue(); - float cost = new Float(fields[7]).floatValue(); - int quantity = new Integer(fields[8]).intValue(); - int category = new Integer(fields[9]).intValue(); - String notes = fields[10]; - boolean isPublic = new Boolean(fields[11]).booleanValue(); - Util.debug("Populating INVENTORY with following values: "); - Util.debug(fields[0]); - Util.debug(fields[1]); - Util.debug(fields[2]); - Util.debug(fields[3]); - Util.debug(fields[4]); - Util.debug(fields[5]); - Util.debug(fields[6]); - Util.debug(fields[7]); - Util.debug(fields[8]); - Util.debug(fields[9]); - Util.debug(fields[10]); - Util.debug(fields[11]); - Inventory storeItem = new Inventory(id, name, heading, descr, pkginfo, image, price, cost, quantity, - category, notes, isPublic); - catalog.addItem(storeItem); - addImage(id, image, catalog); - } - Util.debug("INVENTORY table populated with text..."); - } catch (Exception e) { - Util.debug("Unable to populate INVENTORY table with text data: " + e); - } - /** - * Populate CUSTOMER table with text - */ - Util.debug("Populating CUSTOMER table with default values..."); - try { - String[] values = Util.getProperties("customer"); - Util.debug("Found CUSTOMER properties: " + values[0]); - for (int index = 0; index < values.length; index++) { - String[] fields = Util.readTokens(values[index], "|"); - String customerID = fields[0]; - String password = fields[1]; - String firstName = fields[2]; - String lastName = fields[3]; - String addr1 = fields[4]; - String addr2 = fields[5]; - String addrCity = fields[6]; - String addrState = fields[7]; - String addrZip = fields[8]; - String phone = fields[9]; - Util.debug("Populating CUSTOMER with following values: "); - Util.debug(fields[0]); - Util.debug(fields[1]); - Util.debug(fields[2]); - Util.debug(fields[3]); - Util.debug(fields[4]); - Util.debug(fields[5]); - Util.debug(fields[6]); - Util.debug(fields[7]); - Util.debug(fields[8]); - Util.debug(fields[9]); - login.createCustomer(customerID, password, firstName, lastName, addr1, addr2, addrCity, addrState, addrZip, phone); - } - } catch (Exception e) { - Util.debug("Unable to populate CUSTOMER table with text data: " + e); - } - /** - * Populate ORDER table with text - */ - Util.debug("Populating ORDER table with default values..."); - try { - String[] values = Util.getProperties("order"); - Util.debug("Found ORDER properties: " + values[0]); - if (values[0] != null && values.length > 0) { - for (int index = 0; index < values.length; index++) { - String[] fields = Util.readTokens(values[index], "|"); - if (fields != null && fields.length >= 21) { - String customerID = fields[0]; - String billName = fields[1]; - String billAddr1 = fields[2]; - String billAddr2 = fields[3]; - String billCity = fields[4]; - String billState = fields[5]; - String billZip = fields[6]; - String billPhone = fields[7]; - String shipName = fields[8]; - String shipAddr1 = fields[9]; - String shipAddr2 = fields[10]; - String shipCity = fields[11]; - String shipState = fields[12]; - String shipZip = fields[13]; - String shipPhone = fields[14]; - int shippingMethod = Integer.parseInt(fields[15]); - String creditCard = fields[16]; - String ccNum = fields[17]; - String ccExpireMonth = fields[18]; - String ccExpireYear = fields[19]; - String cardHolder = fields[20]; - Vector items = new Vector(); - Util.debug("Populating ORDER with following values: "); - Util.debug(fields[0]); - Util.debug(fields[1]); - Util.debug(fields[2]); - Util.debug(fields[3]); - Util.debug(fields[4]); - Util.debug(fields[5]); - Util.debug(fields[6]); - Util.debug(fields[7]); - Util.debug(fields[8]); - Util.debug(fields[9]); - Util.debug(fields[10]); - Util.debug(fields[11]); - Util.debug(fields[12]); - Util.debug(fields[13]); - Util.debug(fields[14]); - Util.debug(fields[15]); - Util.debug(fields[16]); - Util.debug(fields[17]); - Util.debug(fields[18]); - Util.debug(fields[19]); - Util.debug(fields[20]); - cart.createOrder(customerID, billName, billAddr1, billAddr2, billCity, billState, billZip, billPhone, shipName, shipAddr1, shipAddr2, shipCity, shipState, shipZip, shipPhone, creditCard, ccNum, ccExpireMonth, ccExpireYear, cardHolder, shippingMethod, items); - } else { - Util.debug("Property does not contain enough fields: " + values[index]); - Util.debug("Fields found were: " + fields); - } - } - } - // stmt.executeUpdate(" INSERT INTO ORDERITEM(INVENTORYID, NAME, PKGINFO, PRICE, COST, - // CATEGORY, QUANTITY, SELLDATE, ORDER_ORDERID) VALUES ('A0001', 'Bulb Digger', - // 'Assembled', 12.0, 5.0, 3, 900, '01054835419625', '1')"); - } catch (Exception e) { - Util.debug("Unable to populate ORDERITEM table with text data: " + e); - e.printStackTrace(); - } - /** - * Populate BACKORDER table with text - */ - Util.debug("Populating BACKORDER table with default values..."); - try { - String[] values = Util.getProperties("backorder"); - Util.debug("Found BACKORDER properties: " + values[0]); - // Inserting backorders - for (int index = 0; index < values.length; index++) { - String[] fields = Util.readTokens(values[index], "|"); - String inventoryID = fields[0]; - int amountToOrder = new Integer(fields[1]).intValue(); - int maximumItems = new Integer(fields[2]).intValue(); - Util.debug("Populating BACKORDER with following values: "); - Util.debug(inventoryID); - Util.debug("amountToOrder -> " + amountToOrder); - Util.debug("maximumItems -> " + maximumItems); - backOrderStock.createBackOrder(inventoryID, amountToOrder, maximumItems); - } - } catch (Exception e) { - Util.debug("Unable to populate BACKORDER table with text data: " + e); - } - /** - * Populate SUPPLIER table with text - */ - Util.debug("Populating SUPPLIER table with default values..."); - try { - String[] values = Util.getProperties("supplier"); - Util.debug("Found SUPPLIER properties: " + values[0]); - // Inserting Suppliers - for (int index = 0; index < values.length; index++) { - String[] fields = Util.readTokens(values[index], "|"); - String supplierID = fields[0]; - String name = fields[1]; - String address = fields[2]; - String city = fields[3]; - String state = fields[4]; - String zip = fields[5]; - String phone = fields[6]; - String url = fields[7]; - Util.debug("Populating SUPPLIER with following values: "); - Util.debug(fields[0]); - Util.debug(fields[1]); - Util.debug(fields[2]); - Util.debug(fields[3]); - Util.debug(fields[4]); - Util.debug(fields[5]); - Util.debug(fields[6]); - Util.debug(fields[7]); - suppliers.createSupplier(supplierID, name, address, city, state, zip, phone, url); - } - } catch (Exception e) { - Util.debug("Unable to populate SUPPLIER table with text data: " + e); - } - } -} diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/java/com/ibm/websphere/samples/pbw/war/ProductBean.java b/src/test/resources/test-applications/plantsbywebsphere/src/main/java/com/ibm/websphere/samples/pbw/war/ProductBean.java deleted file mode 100755 index 8dc36ee2..00000000 --- a/src/test/resources/test-applications/plantsbywebsphere/src/main/java/com/ibm/websphere/samples/pbw/war/ProductBean.java +++ /dev/null @@ -1,81 +0,0 @@ -// -// COPYRIGHT LICENSE: This information contains sample code provided in source code form. You may copy, -// modify, and distribute these sample programs in any form without payment to IBM for the purposes of -// developing, using, marketing or distributing application programs conforming to the application -// programming interface for the operating platform for which the sample code is written. -// Notwithstanding anything to the contrary, IBM PROVIDES THE SAMPLE SOURCE CODE ON AN "AS IS" BASIS -// AND IBM DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, ANY IMPLIED -// WARRANTIES OR CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A PARTICULAR PURPOSE, -// TITLE, AND ANY WARRANTY OR CONDITION OF NON-INFRINGEMENT. IBM SHALL NOT BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR OPERATION OF THE -// SAMPLE SOURCE CODE. IBM HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS -// OR MODIFICATIONS TO THE SAMPLE SOURCE CODE. -// -// (C) COPYRIGHT International Business Machines Corp., 2001,2011 -// All Rights Reserved * Licensed Materials - Property of IBM -// - -package com.ibm.websphere.samples.pbw.war; - -import com.ibm.websphere.samples.pbw.jpa.Inventory; -import com.ibm.websphere.samples.pbw.utils.Util; -import java.io.Serializable; -import java.text.NumberFormat; -import java.util.Locale; -import java.util.Objects; - -/** - * Provides backing bean support for the product web page. Accessed via the shopping bean. - * - */ -public class ProductBean implements Serializable { - private static final long serialVersionUID = 1L; - private Inventory inventory; - private int quantity; - - protected ProductBean(Inventory inventory) { - Objects.requireNonNull(inventory, "Inventory cannot be null"); - this.inventory = inventory; - this.quantity = 1; - } - - public String getCategoryName() { - return Util.getCategoryString(this.inventory.getCategory()); - } - - public Inventory getInventory() { - return this.inventory; - } - - public String getMenuString() { - String categoryString = getCategoryName(); - - if (categoryString.equals("Flowers")) { - return "banner:menu1"; - } - - else if (categoryString.equals("Fruits & Vegetables")) { - return "banner:menu2"; - } - - else if (categoryString.equals("Trees")) { - return "banner:menu3"; - } - - else { - return "banner:menu4"; - } - } - - public String getPrice() { - return NumberFormat.getCurrencyInstance(Locale.US).format(new Float(this.inventory.getPrice())); - } - - public int getQuantity() { - return this.quantity; - } - - public void setQuantity(int quantity) { - this.quantity = quantity; - } -} diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/java/com/ibm/websphere/samples/pbw/war/ShoppingBean.java b/src/test/resources/test-applications/plantsbywebsphere/src/main/java/com/ibm/websphere/samples/pbw/war/ShoppingBean.java deleted file mode 100755 index 22a77ac2..00000000 --- a/src/test/resources/test-applications/plantsbywebsphere/src/main/java/com/ibm/websphere/samples/pbw/war/ShoppingBean.java +++ /dev/null @@ -1,179 +0,0 @@ -// -// COPYRIGHT LICENSE: This information contains sample code provided in source code form. You may copy, -// modify, and distribute these sample programs in any form without payment to IBM for the purposes of -// developing, using, marketing or distributing application programs conforming to the application -// programming interface for the operating platform for which the sample code is written. -// Notwithstanding anything to the contrary, IBM PROVIDES THE SAMPLE SOURCE CODE ON AN "AS IS" BASIS -// AND IBM DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, ANY IMPLIED -// WARRANTIES OR CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A PARTICULAR PURPOSE, -// TITLE, AND ANY WARRANTY OR CONDITION OF NON-INFRINGEMENT. IBM SHALL NOT BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR OPERATION OF THE -// SAMPLE SOURCE CODE. IBM HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS -// OR MODIFICATIONS TO THE SAMPLE SOURCE CODE. -// -// (C) COPYRIGHT International Business Machines Corp., 2001,2011 -// All Rights Reserved * Licensed Materials - Property of IBM -// -package com.ibm.websphere.samples.pbw.war; - -import com.ibm.websphere.samples.pbw.bean.CatalogMgr; -import com.ibm.websphere.samples.pbw.bean.ShoppingCartBean; -import com.ibm.websphere.samples.pbw.jpa.Inventory; -import java.io.Serializable; -import java.text.NumberFormat; -import java.util.ArrayList; -import java.util.Collection; -import java.util.LinkedList; -import java.util.Locale; -import java.util.Map; -import java.util.Vector; -import javax.enterprise.context.SessionScoped; -import javax.faces.context.ExternalContext; -import javax.faces.context.FacesContext; -import javax.inject.Inject; -import javax.inject.Named; - -/** - * A combination JSF action bean and backing bean for the shopping web page. - * - */ -@Named(value = "shopping") -@SessionScoped -public class ShoppingBean implements Serializable { - private static final long serialVersionUID = 1L; - private static final String ACTION_CART = "cart"; - private static final String ACTION_PRODUCT = "product"; - private static final String ACTION_SHOPPING = "shopping"; - - // keep an independent list of items so we can add pricing methods - private ArrayList cartItems; - - @Inject - private CatalogMgr catalog; - - private ProductBean product; - private LinkedList products; - private float shippingCost; - - @Inject - private ShoppingCartBean shoppingCart; - - public String performAddToCart() { - Inventory item = new Inventory(this.product.getInventory()); - - item.setQuantity(this.product.getQuantity()); - - shoppingCart.addItem(item); - - return performCart(); - } - - public String performCart() { - cartItems = wrapInventoryItems(shoppingCart.getItems()); - - return ShoppingBean.ACTION_CART; - } - - public String performProductDetail() { - FacesContext facesContext = FacesContext.getCurrentInstance(); - ExternalContext externalContext = facesContext.getExternalContext(); - Map requestParams = externalContext.getRequestParameterMap(); - - this.product = new ProductBean(this.catalog.getItemInventory(requestParams.get("itemID"))); - - return ShoppingBean.ACTION_PRODUCT; - } - - public String performRecalculate() { - - shoppingCart.removeZeroQuantityItems(); - - this.cartItems = wrapInventoryItems(shoppingCart.getItems()); - - return performCart(); - } - - public String performShopping() { - int category = 0; - FacesContext facesContext = FacesContext.getCurrentInstance(); - ExternalContext externalContext = facesContext.getExternalContext(); - Vector inventories; - Map requestParams = externalContext.getRequestParameterMap(); - - try { - category = Integer.parseInt(requestParams.get("category")); - } - - catch (Throwable e) { - if (this.products != null) { - // No category specified, so just use the last one. - - return ShoppingBean.ACTION_SHOPPING; - } - } - - inventories = this.catalog.getItemsByCategory(category); - - this.products = new LinkedList(); - - // Have to convert all the inventory objects into product beans. - - for (Object obj : inventories) { - Inventory inventory = (Inventory) obj; - - if (inventory.isPublic()) { - this.products.add(new ProductBean(inventory)); - } - } - - return ShoppingBean.ACTION_SHOPPING; - } - - public Collection getCartItems() { - return this.cartItems; - } - - public ProductBean getProduct() { - return this.product; - } - - public Collection getProducts() { - return this.products; - } - - public String getShippingCostString() { - return NumberFormat.getCurrencyInstance(Locale.US).format(this.shippingCost); - } - - /** - * @return the shippingCost - */ - public float getShippingCost() { - return shippingCost; - } - - public void setShippingCost(float shippingCost) { - this.shippingCost = shippingCost; - - } - - public float getTotalCost() { - return shoppingCart.getSubtotalCost() + this.shippingCost; - } - - public String getTotalCostString() { - return NumberFormat.getCurrencyInstance(Locale.US).format(getTotalCost()); - } - - public ShoppingCartBean getCart() { - return shoppingCart; - } - - private ArrayList wrapInventoryItems(Collection invItems) { - ArrayList shoppingList = new ArrayList(); - for (Inventory i : invItems) { - shoppingList.add(new ShoppingItem(i)); - } - return shoppingList; - } -} diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/java/com/ibm/websphere/samples/pbw/war/ShoppingItem.java b/src/test/resources/test-applications/plantsbywebsphere/src/main/java/com/ibm/websphere/samples/pbw/war/ShoppingItem.java deleted file mode 100755 index 43184468..00000000 --- a/src/test/resources/test-applications/plantsbywebsphere/src/main/java/com/ibm/websphere/samples/pbw/war/ShoppingItem.java +++ /dev/null @@ -1,372 +0,0 @@ -// -// COPYRIGHT LICENSE: This information contains sample code provided in source code form. You may copy, -// modify, and distribute these sample programs in any form without payment to IBM for the purposes of -// developing, using, marketing or distributing application programs conforming to the application -// programming interface for the operating platform for which the sample code is written. -// Notwithstanding anything to the contrary, IBM PROVIDES THE SAMPLE SOURCE CODE ON AN "AS IS" BASIS -// AND IBM DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, ANY IMPLIED -// WARRANTIES OR CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A PARTICULAR PURPOSE, -// TITLE, AND ANY WARRANTY OR CONDITION OF NON-INFRINGEMENT. IBM SHALL NOT BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR OPERATION OF THE -// SAMPLE SOURCE CODE. IBM HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS -// OR MODIFICATIONS TO THE SAMPLE SOURCE CODE. -// -// (C) COPYRIGHT International Business Machines Corp., 2003,2011 -// All Rights Reserved * Licensed Materials - Property of IBM -// - -package com.ibm.websphere.samples.pbw.war; - -import com.ibm.websphere.samples.pbw.jpa.BackOrder; -import com.ibm.websphere.samples.pbw.jpa.Inventory; -import java.io.Serializable; -import javax.validation.constraints.Min; - -/** - * ShoppingItem wraps the JPA Inventory entity class to provide additional methods needed by the web - * app. - */ -public class ShoppingItem implements Cloneable, Serializable { - - private static final long serialVersionUID = 1L; - private Inventory item; - - public ShoppingItem() { - - } - - public ShoppingItem(Inventory i) { - item = i; - } - - public ShoppingItem(String key, String name, String heading, String desc, String pkginfo, String image, float price, - float cost, int quantity, int category, String notes, boolean isPublic) { - item = new Inventory(key, name, heading, desc, pkginfo, image, price, cost, quantity, category, notes, - isPublic); - } - - /** - * Subtotal price calculates a cost based on price and quantity. - */ - public float getSubtotalPrice() { - return getPrice() * getQuantity(); - } - - /** - * @param o - * @return boolean true if object equals this - * @see java.lang.Object#equals(java.lang.Object) - */ - public boolean equals(Object o) { - return item.equals(o); - } - - /** - * @return int hashcode for this object - * @see java.lang.Object#hashCode() - */ - public int hashCode() { - return item.hashCode(); - } - - /** - * @return String String representation of this object - * @see java.lang.Object#toString() - */ - public String toString() { - return item.toString(); - } - - /** - * @param quantity - * @see com.ibm.websphere.samples.pbw.jpa.Inventory#increaseInventory(int) - */ - public void increaseInventory(int quantity) { - item.increaseInventory(quantity); - } - - /** - * @return int category enum int value - * @see com.ibm.websphere.samples.pbw.jpa.Inventory#getCategory() - */ - public int getCategory() { - return item.getCategory(); - } - - /** - * @param category - * @see com.ibm.websphere.samples.pbw.jpa.Inventory#setCategory(int) - */ - public void setCategory(int category) { - item.setCategory(category); - } - - /** - * @return float cost of the item - * @see com.ibm.websphere.samples.pbw.jpa.Inventory#getCost() - */ - public float getCost() { - return item.getCost(); - } - - /** - * @param cost - * @see com.ibm.websphere.samples.pbw.jpa.Inventory#setCost(float) - */ - public void setCost(float cost) { - item.setCost(cost); - } - - /** - * @return String description of the item - * @see com.ibm.websphere.samples.pbw.jpa.Inventory#getDescription() - */ - public String getDescription() { - return item.getDescription(); - } - - /** - * @param description - * @see com.ibm.websphere.samples.pbw.jpa.Inventory#setDescription(java.lang.String) - */ - public void setDescription(String description) { - item.setDescription(description); - } - - /** - * @return String item heading - * @see com.ibm.websphere.samples.pbw.jpa.Inventory#getHeading() - */ - public String getHeading() { - return item.getHeading(); - } - - /** - * @param heading - * @see com.ibm.websphere.samples.pbw.jpa.Inventory#setHeading(java.lang.String) - */ - public void setHeading(String heading) { - item.setHeading(heading); - } - - /** - * @return String image URI - * @see com.ibm.websphere.samples.pbw.jpa.Inventory#getImage() - */ - public String getImage() { - return item.getImage(); - } - - /** - * @param image - * @see com.ibm.websphere.samples.pbw.jpa.Inventory#setImage(java.lang.String) - */ - public void setImage(String image) { - item.setImage(image); - } - - /** - * @return String name of the item - * @see com.ibm.websphere.samples.pbw.jpa.Inventory#getName() - */ - public String getName() { - return item.getName(); - } - - /** - * @param name - * @see com.ibm.websphere.samples.pbw.jpa.Inventory#setName(java.lang.String) - */ - public void setName(String name) { - item.setName(name); - } - - /** - * @return String item notes - * @see com.ibm.websphere.samples.pbw.jpa.Inventory#getNotes() - */ - public String getNotes() { - return item.getNotes(); - } - - /** - * @param notes - * @see com.ibm.websphere.samples.pbw.jpa.Inventory#setNotes(java.lang.String) - */ - public void setNotes(String notes) { - item.setNotes(notes); - } - - /** - * @return String package information - * @see com.ibm.websphere.samples.pbw.jpa.Inventory#getPkginfo() - */ - public String getPkginfo() { - return item.getPkginfo(); - } - - /** - * @param pkginfo - * @see com.ibm.websphere.samples.pbw.jpa.Inventory#setPkginfo(java.lang.String) - */ - public void setPkginfo(String pkginfo) { - item.setPkginfo(pkginfo); - } - - /** - * @return float Price of the item - * @see com.ibm.websphere.samples.pbw.jpa.Inventory#getPrice() - */ - public float getPrice() { - return item.getPrice(); - } - - /** - * @param price - * @see com.ibm.websphere.samples.pbw.jpa.Inventory#setPrice(float) - */ - public void setPrice(float price) { - item.setPrice(price); - } - - /** - * Property accessor for quantity of items ordered. Quantity may not be less than zero. Bean - * Validation will ensure this is true. - * - * @return int quantity of items - * @see com.ibm.websphere.samples.pbw.jpa.Inventory#getQuantity() - */ - @Min(value = 0, message = "Quantity must be a number greater than or equal to zero.") - public int getQuantity() { - return item.getQuantity(); - } - - /** - * @param quantity - * @see com.ibm.websphere.samples.pbw.jpa.Inventory#setQuantity(int) - */ - public void setQuantity(int quantity) { - item.setQuantity(quantity); - } - - /** - * @return int maximum threshold - * @see com.ibm.websphere.samples.pbw.jpa.Inventory#getMaxThreshold() - */ - public int getMaxThreshold() { - return item.getMaxThreshold(); - } - - /** - * @param maxThreshold - * @see com.ibm.websphere.samples.pbw.jpa.Inventory#setMaxThreshold(int) - */ - public void setMaxThreshold(int maxThreshold) { - item.setMaxThreshold(maxThreshold); - } - - /** - * @return int minimum threshold - * @see com.ibm.websphere.samples.pbw.jpa.Inventory#getMinThreshold() - */ - public int getMinThreshold() { - return item.getMinThreshold(); - } - - /** - * @param minThreshold - * @see com.ibm.websphere.samples.pbw.jpa.Inventory#setMinThreshold(int) - */ - public void setMinThreshold(int minThreshold) { - item.setMinThreshold(minThreshold); - } - - /** - * @return String item ID in the inventory - * @see com.ibm.websphere.samples.pbw.jpa.Inventory#getInventoryId() - */ - public String getInventoryId() { - return item.getInventoryId(); - } - - /** - * @param id - * @see com.ibm.websphere.samples.pbw.jpa.Inventory#setInventoryId(java.lang.String) - */ - public void setInventoryId(String id) { - item.setInventoryId(id); - } - - /** - * @return String item ID - * @see com.ibm.websphere.samples.pbw.jpa.Inventory#getID() - */ - public String getID() { - return item.getID(); - } - - /** - * @param id - * @see com.ibm.websphere.samples.pbw.jpa.Inventory#setID(java.lang.String) - */ - public void setID(String id) { - item.setID(id); - } - - /** - * @return boolean true if this is a public item - * @see com.ibm.websphere.samples.pbw.jpa.Inventory#isPublic() - */ - public boolean isPublic() { - return item.isPublic(); - } - - /** - * @param isPublic - * @see com.ibm.websphere.samples.pbw.jpa.Inventory#setIsPublic(boolean) - */ - public void setIsPublic(boolean isPublic) { - item.setIsPublic(isPublic); - } - - /** - * @param isPublic - * @see com.ibm.websphere.samples.pbw.jpa.Inventory#setPrivacy(boolean) - */ - public void setPrivacy(boolean isPublic) { - item.setPrivacy(isPublic); - } - - /** - * @return byte[] item image as a byte array - * @see com.ibm.websphere.samples.pbw.jpa.Inventory#getImgbytes() - */ - public byte[] getImgbytes() { - return item.getImgbytes(); - } - - /** - * @param imgbytes - * @see com.ibm.websphere.samples.pbw.jpa.Inventory#setImgbytes(byte[]) - */ - public void setImgbytes(byte[] imgbytes) { - item.setImgbytes(imgbytes); - } - - /** - * @return BackOrder item is on back order - * @see com.ibm.websphere.samples.pbw.jpa.Inventory#getBackOrder() - */ - public BackOrder getBackOrder() { - return item.getBackOrder(); - } - - /** - * @param backOrder - * @see com.ibm.websphere.samples.pbw.jpa.Inventory#setBackOrder(com.ibm.websphere.samples.pbw.jpa.BackOrder) - */ - public void setBackOrder(BackOrder backOrder) { - item.setBackOrder(backOrder); - } - -} diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/java/com/ibm/websphere/samples/pbw/war/ValidatePasswords.java b/src/test/resources/test-applications/plantsbywebsphere/src/main/java/com/ibm/websphere/samples/pbw/war/ValidatePasswords.java deleted file mode 100755 index acbbec25..00000000 --- a/src/test/resources/test-applications/plantsbywebsphere/src/main/java/com/ibm/websphere/samples/pbw/war/ValidatePasswords.java +++ /dev/null @@ -1,49 +0,0 @@ -// -// COPYRIGHT LICENSE: This information contains sample code provided in source code form. You may copy, -// modify, and distribute these sample programs in any form without payment to IBM for the purposes of -// developing, using, marketing or distributing application programs conforming to the application -// programming interface for the operating platform for which the sample code is written. -// Notwithstanding anything to the contrary, IBM PROVIDES THE SAMPLE SOURCE CODE ON AN "AS IS" BASIS -// AND IBM DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, ANY IMPLIED -// WARRANTIES OR CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A PARTICULAR PURPOSE, -// TITLE, AND ANY WARRANTY OR CONDITION OF NON-INFRINGEMENT. IBM SHALL NOT BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR OPERATION OF THE -// SAMPLE SOURCE CODE. IBM HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS -// OR MODIFICATIONS TO THE SAMPLE SOURCE CODE. -// -// (C) COPYRIGHT International Business Machines Corp., 2003,2011 -// All Rights Reserved * Licensed Materials - Property of IBM -// - -package com.ibm.websphere.samples.pbw.war; - -import javax.faces.component.UIComponent; -import javax.faces.component.UIInput; -import javax.faces.context.FacesContext; -import javax.faces.validator.FacesValidator; -import javax.faces.validator.Validator; -import javax.faces.validator.ValidatorException; - -/** - * A JSF validator class, not implemented in Bean Validation since validation is only required - * during GUI interaction. - */ -@FacesValidator(value = "validatePasswords") -public class ValidatePasswords implements Validator { - - @Override - public void validate(FacesContext context, UIComponent component, Object value) throws ValidatorException { - UIInput otherComponent; - String otherID = (String) component.getAttributes().get("otherPasswordID"); - String otherStr; - String str = (String) value; - - otherComponent = (UIInput) context.getViewRoot().findComponent(otherID); - otherStr = (String) otherComponent.getValue(); - - if (!otherStr.equals(str)) { - ValidatorUtils.addErrorMessage(context, "Passwords do not match."); - } - } - -} diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/java/com/ibm/websphere/samples/pbw/war/ValidatorUtils.java b/src/test/resources/test-applications/plantsbywebsphere/src/main/java/com/ibm/websphere/samples/pbw/war/ValidatorUtils.java deleted file mode 100755 index cc85bbf6..00000000 --- a/src/test/resources/test-applications/plantsbywebsphere/src/main/java/com/ibm/websphere/samples/pbw/war/ValidatorUtils.java +++ /dev/null @@ -1,43 +0,0 @@ -// -// COPYRIGHT LICENSE: This information contains sample code provided in source code form. You may copy, -// modify, and distribute these sample programs in any form without payment to IBM for the purposes of -// developing, using, marketing or distributing application programs conforming to the application -// programming interface for the operating platform for which the sample code is written. -// Notwithstanding anything to the contrary, IBM PROVIDES THE SAMPLE SOURCE CODE ON AN "AS IS" BASIS -// AND IBM DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, ANY IMPLIED -// WARRANTIES OR CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A PARTICULAR PURPOSE, -// TITLE, AND ANY WARRANTY OR CONDITION OF NON-INFRINGEMENT. IBM SHALL NOT BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR OPERATION OF THE -// SAMPLE SOURCE CODE. IBM HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS -// OR MODIFICATIONS TO THE SAMPLE SOURCE CODE. -// -// (C) COPYRIGHT International Business Machines Corp., 2003,2011 -// All Rights Reserved * Licensed Materials - Property of IBM -// - -package com.ibm.websphere.samples.pbw.war; - -import javax.faces.application.FacesMessage; -import javax.faces.component.UIComponent; -import javax.faces.context.FacesContext; -import javax.faces.validator.ValidatorException; - -/** - * Simple helper class for JSF validators to handle error messages. - * - */ -public class ValidatorUtils { - protected static void addErrorMessage(FacesContext context, String message) { - FacesMessage facesMessage = new FacesMessage(); - facesMessage.setDetail(message); - facesMessage.setSummary(message); - facesMessage.setSeverity(FacesMessage.SEVERITY_ERROR); - throw new ValidatorException(facesMessage); - } - - protected static void addErrorMessage(FacesContext context, UIComponent component) { - String errorMessage = (String) component.getAttributes().get("errorMessage"); - - addErrorMessage(context, errorMessage); - } -} diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/liberty/config/server.xml b/src/test/resources/test-applications/plantsbywebsphere/src/main/liberty/config/server.xml deleted file mode 100644 index 7288548d..00000000 --- a/src/test/resources/test-applications/plantsbywebsphere/src/main/liberty/config/server.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - javaee-7.0 - localConnector-1.0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/resources/META-INF/persistence.xml b/src/test/resources/test-applications/plantsbywebsphere/src/main/resources/META-INF/persistence.xml deleted file mode 100755 index 3269f800..00000000 --- a/src/test/resources/test-applications/plantsbywebsphere/src/main/resources/META-INF/persistence.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - jdbc/PlantsByWebSphereDataSource - jdbc/PlantsByWebSphereDataSourceNONJTA - false - - - - - - - \ No newline at end of file diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/resources/pbw.properties b/src/test/resources/test-applications/plantsbywebsphere/src/main/resources/pbw.properties deleted file mode 100644 index 1a2858e9..00000000 --- a/src/test/resources/test-applications/plantsbywebsphere/src/main/resources/pbw.properties +++ /dev/null @@ -1,58 +0,0 @@ -# -# Row Values for Inventory Table -# -inventory=F0001|African Orchid|Rare Delicate Beauty|African orchids are some of the most endangered and rare kinds of orchids grown today. This variety is medium yellow with varigated salmon and pink insides. Height: 18 to 28 inches.|per plant|flower_african_orchid.jpg|250.00|145.00|100|0|NOTES and stuff|true -inventory=F0002|Baby Breath|Ethereal White Elegance|(Gypsophila muralis). Small, delicate Baby Breath flowers create clouds of accents in floral arrangements or beautiful lacy designs when used alone. Can be used fresh or dried. Height: 12 to 18 inches.|2 plants|flower_bbreath.jpg|6.00|2.00|100|0|NOTES and stuff|true -inventory=F0003|Black-eyed Susan|Radiant, like the Sun|(Rudbeckia hirta). The Black-Eyed Susan was made the official Maryland flower in 1918. Typically they grow wild -- and bloom between May and August -- but you can purchase them as a permanent addition to your own garden. Height: 2 to 3 feet.|2 plants|flower_black-eyed_susan.jpg|9.00|2.00|100|0|NOTES and stuff|true -inventory=F0004|Coleus|Colorful Accent|(Coleus blumei). An attractive foliage plant, the Coleus is especially suited for containers and underplantings. While it can tolerate the sun, the color of leaves is enhanced in partial to full shade. Height: 12 inches to 36 inches.|4 plants|flower_coleus.jpg|8.00|3.00|100|0|NOTES and stuff|true -inventory=F0005|Yellow Shasta Daisy|Charming Simple Beauty|(Bellis perenis). Oversized blossoms in bright yellow with a very long bloom period. For extra decoration, cut the stems and place in food coloring and water to make vibrantly colored cut flowers. Height: 1 to 3 feet.|2 plants|flower_daisies.jpg|16.00|2.50|100|0|NOTES and stuff|true -inventory=F0006|Perennial Foxglove|Showy Thimble-like Blooms|(Digitalis). Foxglove grows best in shade and works well as a tall, showy flower that lights up a dark garden area. The individual flowers are sized and shaped like thimbles. Height: 2 to 3 feet.|3 plants|flower_foxglove.jpg|12.00|2.75|100|0|NOTES and stuff|true -inventory=F0007|Geranium|Red and Flowery|(Geranium sanguineum). This bright red version of the Bloody Cranesbill Geranium has small, bright green foliage that adds dimension and sets off the vibrant colored flowers. Assembled. Height: 8 inches.|per plant|flower_geranium.jpg|8.00|2.30|100|0|NOTES and stuff|true -inventory=F0008|Goodnight Moon Iris|Fluorescent Bloomer|Iris provides lovely cut flowers which brighten rainy spring days. When the Iris has stopped blossoming, cut off dead blossoms and dead bloom stalks, but do not cut back the leaves until they begin to turn brown in the Fall.|5 bulbs|flower_goodnight_moon_iris.jpg|7.50|3.60|100|0|NOTES and stuff|true -inventory=F0009|Impatiens|Tangerine Dream|(Impatiens walleriana). Vibrant tangerine-orange flowers coordinate nicely with green foliage. Impatiens is a great annual for beds, borders, containers and hanging baskets. Grow in full sun to partial shade. Height: 15 to 20 inches.|2 plants|flower_impatiens.jpg|9.95|1.25|100|0|NOTES and stuff|true -inventory=F0010|Lily|Purple Summer Glory|(Hemerocallis fulva) Magnificent flowers up to 3 inches or more across. Blooms start June through August, depending on variety, and have a subtle fragrance. Tolerates dry soil but it is wise to water deeply during periods of dry weather.|4 bulbs|flower_lily.jpg|6.50|3.25|100|0|NOTES and stuff|true -inventory=F0011|Pansy|Autumn Mix|(Viola tricolor). Reminiscent of the colors of fall. Our Pansies will bloom from fall to early winter, and again in the spring! They prefer part shade to full sun. Height 6 to 8 inches.|1 pkt. (25 seeds)|flower_pansies.jpg|2.00|1.25|100|0|NOTES and stuff|true -inventory=F0012|Petunia|Striped Brightness|(Petunia x hybrida). Striking, large magenta flowers with contrasting white trumpet stripes. Excellent for borders, window boxes, planters and bouquets. Petunias do best in full sun but will tolerate light shade. Height: 1 foot.|1 pkt. (50 seeds)|flower_petunias.jpg|3.00|1.25|100|0|NOTES and stuff|true -inventory=F0013|Primrose|Means: I Cannot Live Without You|(Primula). Large, fragrant blooms in wide-eyed spring like yellow. Plants thrive despite heat and drought and require good drainage. Height: 12 inches.|6 plants|flower_primrose.jpg|10.00|4.75|100|0|NOTES and stuff|true -inventory=F0014|Red Poinsettia|Seasonal Beauty|(Euphorbia pulcherrima). Lush red flowers float atop deep green leaves. They were first developed in Mexico and need warm temperatures and full sun. Height: 2 to 3 feet.|per plant|flower_red_poinsettia.jpg|11.00|4.50|100|0|NOTES and stuff|true -inventory=F0015|Red Rose|Always in Bloom|(Rosa Floribunda). Created in France (1956), this rose continually produces boldly colored, medium-sized red blooms. Intensely fragrant. Includes thorns and songs about lost love. Height: 10 - 12 feet.|per vine|flower_red_rose.jpg|32.00|15.00|100|0|NOTES and stuff|true -inventory=F0016|Sparkler Celosia|Brilliant Flames of Red Fire|(Celosia plumosa). Excellent for cutting, these Sparkler Celosia have brilliant 6 inch plumes. They are a perfect companion for full-sun garden beds or in fresh or dried bouquets. Height: 2 to 2.5 feet.|4 plants|flower_sparkler_celosia.jpg|7.00|3.25|100|0|NOTES and stuff|true -inventory=F0017|Tulip|Mixed Dutch Delight|(Tulipa). Out famous tulip bulbs are supplied by one of the finest Dutch bulb growers. Mixed colors resonate on even the cloudiest of days. These bulbs are of the highest quality and are guaranteed. Height: 10 to 12 inches.|10 bulbs|flower_tulips.jpg|17.00|9.00|100|0|NOTES and stuff|true -inventory=F0018|White Poinsettia|Seasonal Simplicity|(Euphorbia pulcherrima). A rich color of deep green leaves support large bright white blossoms. Poinsettias were first developed in Mexico and need full sun. Height: 2 to 3 feet.|per plant|flower_white_poinsettia.jpg|14.00|5.50|100|0|NOTES and stuff|true -inventory=F0019|White Rose|A Classic Beauty|(Rosa Floribunda). Classic, white buds open into double blooms of palest pink to white on this rose created in 1888 France. Thornless. Height: 4 to 5 feet.|per vine|flower_white_rose.jpg|37.00|17.00|100|0|NOTES and stuff|true -inventory=F0020|Zinnia|You cut more, they bloom more!|(Zinnia elegans). Zinnias add bold, vibrant color to gardens. They are heat loving and prefer full-sun. Perfect for beds and cut floral arrangements. They even attract butterflies! Height: 12 to 18 inches.|12 plants|flower_zinnia.jpg|7.95|3.95|100|0|NOTES and stuff|true -inventory=A0001|Bulb Digger|Pick The Right Tool For The Right Job|Simplifies digging holes for poles, posts, and many other jobs. Tempered steel even breaks through rock. Long, coated 54 inch hardwood handle.|Assembled|accessories_bulbdigger.jpg|12.00|5.00|100|3|NOTES and stuff|true -inventory=A0002|Birdfeeder|Birds of a Feather Feed Together|Hexagon shaped bird feeder stores food upright which allows more birds to feed and gives you the best view! Natural wood base supports clear plastic lenses on all 5 sides. Ready to be hung or mounted on a pole (not included).|Pole not included|accessories_birdfeeder.jpg|16.00|7.00|100|3|NOTES and stuff|true -inventory=A0003|Birdhouse|Ideal for Nesting Birds|Wooden birdhouse perfect for nesting birds and their companions. Made of naturally weather resistant pine with a sloped roof. Mounting hardware and instructions included. Height: 18 inches. Width: 10 inches.|Assembled|accessories_birdhouse.jpg|12.00|6.00|100|3|NOTES and stuff|true -inventory=A0004|Finch Food|Attracts Fabulous Finches|Bird feed especially formulated for finches, as well as other small birds. No seeds are wasted; birds will like them all.|20 lb. bag|accessories_finchfood.jpg|6.50|2.00|100|3|NOTES and stuff|true -inventory=A0005|Grass Rake|Put the Kids to Work|Welded bow rake is heat treated for strength. Long, coated 54 inch hardwood handle. Use it to level and break up clumps of soil, remove debris, and spread topsoil or compost. 5 year limited warranty.|Assembled|accessories_grassrake.jpg|6.00|2.50|100|3|NOTES and stuff|true -inventory=A0006|Leaf Rake|The Ultimate Backscratcher|Wooden polyurethene coated handle adjusts is 32 inches long. Comfortable grip. Fully heat treated head and chip resistant carbon dioxide coating make this rake last for years.|Assembled|accessories_leafrake.jpg|10.00|4.50|100|3|NOTES and stuff|true -inventory=A0007|Shovel|Dig it, Man!|Open back tempered steel blade attached to sturdy hardwood handle with 6 inch lead. Uses include: planting shrubs, trees, and general digging or cutting through sod or soil. Handle Length: 46 inches|Assembled|accessories_shovel.jpg|7.00|3.00|100|3|NOTES and stuff|true -inventory=A0008|Gloves|If The Gloves Fit, You Must Plant It|One size fits all. Each carefully sewn left glove comes with an accompanying right glove. Comes in pack of 3, with colors red, green, and blue.|3 pairs per pack|accessories_gloves.jpg|4.50|1.00|100|3|NOTES and stuff|true -inventory=A0009|Hand Rake|A Real Humdinger|Sometimes you have to work on your hands and knees. This tool is great for raking, digging, whatever. Handle is cushioned with rubber.|Assembled|accessories_handrake.jpg|4.50|1.50|100|3|NOTES and stuff|true -inventory=A0010|Large Pot|Large and, well, just Large|Large ceramic pot perfect for bigger plants that need to be moved in during frosts. Diameter of 18 inches - holds 5 gallon plants.|N/A|accessories_pot.jpg|10.00|3.00|100|3|NOTES and stuff|true -inventory=A0011|Wheelbarrow|Just like Grandpa used to have!|Shiny red wheelbarrow with epoxy coated steel bin and wooden handles. Tire is solid with thick treads that grip rough, wet surfaces. Large capacity - 3 Cu.Ft. capacity, 150 Lb. maximum load|Assembled|accessories_wheelbarrow.jpg|29.00|12.00|100|3|NOTES and stuff|true -inventory=T0001|Ash|Full and Leafy like a Lollipop|Large, round, summer shade leads to yellow leaves that burst through dreary Fall days! Excellent for yards. Mature height: up to 20 feet.|10 gallon seedling|trees_ash.jpg|50.00|20.00|100|2|NOTES and stuff|true -inventory=T0002|Aspen|Tall, Slender Grace|White barked Aspens are particularly beautiful during white winters. Close your eyes and imagine a light breeze sailing over the trunk and the crinkling of the colliding leaves. Mature height: up to 28 feet.|10 gallon seedling|trees_aspen.jpg|53.00|21.00|100|2|NOTES and stuff|true -inventory=T0003|Bonsai|Tabletop Fun|Bonsais are great miniature replicas of your favorite yard tree. They can be indoors or out -- and their size makes them perfect for tabletop decoration.|0.5 gallon mature tree|trees_bonsai.jpg|30.00|12.00|100|2|NOTES and stuff|true -inventory=T0004|Crabapple|Short but beautiful|These trees light up Springtime with pink, fragrant flowers that change into crabapples. Perfect for Maryland residents. Mature height: up to 20 feet.|10 gallon seedling|trees_crab.jpg|57.00|19.00|100|2|NOTES and stuff|true -inventory=T0005|Maple|Traditional Shade Producer|Famous for their syrup, you will be able to tap into your own endless supply in just a few years. Not suitable for diabetics. Mature height: up to 24 feet.|10 gallon seedling|trees_maple.jpg|45.00|22.00|100|2|NOTES and stuff|true -inventory=V0001|Cabbage|Crispy|Crispy green cabbage will poke through summer gardens about 3-4 weeks after springtime planting of seedlings. An excellent source of Vitamin A and D.|1 pkt. (100 seeds)|veggies_cabbage.jpg|2.00|.70|100|1|NOTES and stuff|true -inventory=V0002|Ornamental Gourd|Gourd-geous!|OrNAMEntal gourds are a staple for Autumn flowerbeds, door decorations, floral arrangements and tabletop centerpieces. Grow your own this year to give to your neighbors and family.|1 pkt. (100 seeds)|veggies_gourds.jpg|1.50|.70|100|1|NOTES and stuff|true -inventory=V0003|Grapes|Be Your Own Winemaker|Join others who are fermenting their own small, personal batches of wine! These vines were developed in France and their grapes make a fruity, medium white wine or a fruity Beaujolais when pressed with the skins.|1 vine|veggies_grapes.jpg|49.00|20.50|100|1|NOTES and stuff|true -inventory=V0004|Onion|Fresh and Tasty from your Garden|Pure white onions are sweetest when grown at home and left in the ground until picking. Tissues not included.|4 bulbs|veggies_onion.jpg|9.00|4.75|100|1|NOTES and stuff|true -inventory=V0005|Pineapple|Tropical Delight|Pineapples can be grown at home with this frost-bearing breed. Yields 4 - 5 fruits annually, more in warmer climates. Fertilize with organic compost regularly for best results. Be careful of maurading neighbors.|8 gallon potted plant|veggies_pineapple.jpg|87.00|34.50|100|1|NOTES and stuff|true -inventory=V0006|Strawberries|Sweet Berry Scrumptiousness|Our brand is known for producing plump, sweet strawberries by the mid-June bucketful. Now you can grow them easily, with relatively little care, due to our patented version. Dental floss not included.|1 pkt. (50 seeds)|veggies_strawberries.jpg|3.50|1.50|100|1|NOTES and stuff|true -inventory=V0007|Watermelon|Seedless Summer |Plant our seeds indoors in late winter and transfer outside after threat of frost recedes; our seeds will produce huge, round, ripe melons by mid-June. Guaranteed not to contain active Acidophilous cultures.|1 pkt. (100 seeds)|veggies_watermelon.jpg|2.00|.50|50|1|NOTES and stuff|true -# -# Row Values for Idgenerator Table -# -idgenerator=ORDER|1 -idgenerator=BACKORDER|2 -# -# Row Values for Customer Table -# -customer=plants@plantsbywebsphere.ibm.com|plants|David|Grover|123 Main Street|Apt. C|Raleigh|NC|27604|919-555-1234 -# -# Row Values for Supplier Table -supplier=Supplier|Greenhouse By WebSphere|4205 Miami Blvd.|Durham|NC|27709|919-555-1212|http://localhost:9080/OrderProcessorEJB/services/FrontGate?wsdl \ No newline at end of file diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/WEB-INF/PlantTemplate.xhtml b/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/WEB-INF/PlantTemplate.xhtml deleted file mode 100755 index d3b63c0b..00000000 --- a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/WEB-INF/PlantTemplate.xhtml +++ /dev/null @@ -1,139 +0,0 @@ - - - - - - - - - ${title} - - - - - -
    - -
    - - - \ No newline at end of file diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/WEB-INF/beans.xml b/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/WEB-INF/beans.xml deleted file mode 100755 index d8a87307..00000000 --- a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/WEB-INF/beans.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - \ No newline at end of file diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/WEB-INF/faces-config.xml b/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/WEB-INF/faces-config.xml deleted file mode 100755 index 9c84443c..00000000 --- a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/WEB-INF/faces-config.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - pc_Help - pagecode.Help - request - - - - \ No newline at end of file diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/WEB-INF/ibm-ejb-jar-bnd.xml b/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/WEB-INF/ibm-ejb-jar-bnd.xml deleted file mode 100755 index b790daa7..00000000 --- a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/WEB-INF/ibm-ejb-jar-bnd.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/WEB-INF/ibm-web-bnd.xml b/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/WEB-INF/ibm-web-bnd.xml deleted file mode 100755 index d191ed33..00000000 --- a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/WEB-INF/ibm-web-bnd.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/WEB-INF/ibm-web-ext.xml b/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/WEB-INF/ibm-web-ext.xml deleted file mode 100755 index a214742c..00000000 --- a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/WEB-INF/ibm-web-ext.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/WEB-INF/web.xml b/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/WEB-INF/web.xml deleted file mode 100755 index 1d486eea..00000000 --- a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/WEB-INF/web.xml +++ /dev/null @@ -1,69 +0,0 @@ - - - PlantsByWebSphere - - javax.faces.PROJECT_STAGE - - Development - - - javax.faces.VALIDATE_EMPTY_FIELDS - false - - - index.html - - - FacesServlet - javax.faces.webapp.FacesServlet - - - javax.faces.application.ViewExpiredException - /viewExpired.xhtml - - - /error.jsp - - - FacesServlet - *.jsf - - - - SampAdmin - Sample Admin - /adminactions.html - /adminbanner.html - /backorderadmin.jsp - /servlet/AdminServlet - /supplierconfig.jsp - GET - PUT - HEAD - TRACE - POST - DELETE - OPTIONS - - - Samples Administrator - SampAdmin - - - NONE - - - - BASIC - Default - - - Samples Administrator - SampAdmin - - - 10 - - diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/account.xhtml b/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/account.xhtml deleted file mode 100755 index 47d3da47..00000000 --- a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/account.xhtml +++ /dev/null @@ -1,254 +0,0 @@ - - - - - - - - - - - - - - - - - -
    -

    - - > - -

    -
    - - - - - - - - - - - - - - - -

    Account - Update

    - Enter the information below to update your account. This - information will not be shared without your permission. With - your permission we will only share your name and email address - with our trusted business partners.

    -

    -

    - Required fields are denoted with a red asterisk ( - - ).

    -

    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Contact - Information
       

    - -

    -

    - -    - -

    -

    - -

    -

    - -    - -

    -

    - -

    -

    - -    - -

    -

    - -

    -

    - -

    -

    - -

    -

    - -    - -

    -

    - -

    -

    - -    - -

    -

    - -

    -

    - -    - -

    -

    - -

    -

    - -    - -

    -

    - -

    -

    -
    - - - - -
    -
    -
    -
    -
    - \ No newline at end of file diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/admin.html b/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/admin.html deleted file mode 100755 index fda304e2..00000000 --- a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/admin.html +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - -Plants by WebSphere Administration - - - - - - - - - - - \ No newline at end of file diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/adminactions.html b/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/adminactions.html deleted file mode 100755 index 3a3aa673..00000000 --- a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/adminactions.html +++ /dev/null @@ -1,74 +0,0 @@ - - - - - - - - - - -Plants by WebSphere Administration - - - - - - - - - - - - - - - - - - - - -
    Manage - BackOrders - View backorder inventory, order from suppliers, add - new stock to inventory.
    Supplier - Configuration - Configure the Supplier.
    -
    - - - - - -
    Powered by WebSphere - -
    - - \ No newline at end of file diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/adminbanner.html b/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/adminbanner.html deleted file mode 100755 index 5467bec3..00000000 --- a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/adminbanner.html +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - - - - - - - - - - - - - - - -
    Plants by WebSphere Administration
    - - - - - - -
      HOME  :  ADMIN HOME  :  - HELP  
    - - \ No newline at end of file diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/applycss.js b/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/applycss.js deleted file mode 100755 index 49132df1..00000000 --- a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/applycss.js +++ /dev/null @@ -1,27 +0,0 @@ -// -// COPYRIGHT LICENSE: This information contains sample code provided in source code form. You may copy, -// modify, and distribute these sample programs in any form without payment to IBM for the purposes of -// developing, using, marketing or distributing application programs conforming to the application -// programming interface for the operating platform for which the sample code is written. -// Notwithstanding anything to the contrary, IBM PROVIDES THE SAMPLE SOURCE CODE ON AN "AS IS" BASIS -// AND IBM DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, ANY IMPLIED -// WARRANTIES OR CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A PARTICULAR PURPOSE, -// TITLE, AND ANY WARRANTY OR CONDITION OF NON-INFRINGEMENT. IBM SHALL NOT BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR OPERATION OF THE -// SAMPLE SOURCE CODE. IBM HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS -// OR MODIFICATIONS TO THE SAMPLE SOURCE CODE. -// -// (C) COPYRIGHT International Business Machines Corp., 2001,2011 -// All Rights Reserved * Licensed Materials - Property of IBM -// - -var i = navigator.appVersion.indexOf('MSIE 6'); - -if ((navigator.appName == "Microsoft Internet Explorer") - && (parseInt(navigator.appVersion) >= 4)) { - document - .write(''); -} else { - document - .write(''); -} \ No newline at end of file diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/backorderadmin.jsp b/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/backorderadmin.jsp deleted file mode 100755 index f8475f90..00000000 --- a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/backorderadmin.jsp +++ /dev/null @@ -1,526 +0,0 @@ - - - - -<%@ page language="java" contentType="text/html; charset=ISO-8859-1" - pageEncoding="ISO-8859-1"%> - - - - -backorderadmin.jsp - - - - - - - - - <%@page - import="com.ibm.websphere.samples.pbw.war.BackOrderItem,com.ibm.websphere.samples.pbw.jpa.Inventory,com.ibm.websphere.samples.pbw.utils.Util,java.text.SimpleDateFormat,java.util.*" - session="true" isThreadSafe="true" isErrorPage="false"%> - - <% - Collection backOrderItems = (Collection) session.getAttribute("backorderitems"); - %> - - - - - - - - - - -
    -

    - Admin - Home -

    -
    - - - - - - - - - - - - - - <% - if (backOrderItems != null) { - %> - - - - - - - - - - -
    -

    BackOrder Administration

    -
    <% - String results; - results = (String) request.getAttribute(Util.ATTR_RESULTS); - if (results != null) - out.print(results); - %> -
    -

    Here are the inventory items that have been back - ordered. -

    - -
    -


    -
    -
    - Back Order Items
    -
    -

    - The Back Order Items list shows the inventory items - that may be ordered from a supplier. Select one or more - ordered items and click the Order Stock to send an - order to the supplier. The QUANTITY TO ORDER may be - changed before the order is submitted. -


    - - - - - - - - - - - - - - <% - Util.debug("BackOrders Found in backorderadmin.jsp"); - Iterator i = backOrderItems.iterator(); - while (i.hasNext()) { - BackOrderItem backOrderItem = (BackOrderItem) i.next(); - String status = backOrderItem.getStatus(); - if (status.equals(Util.STATUS_ORDERSTOCK)) { - String backOrderID = backOrderItem.getBackOrderID(); - String invID = backOrderItem.getInventory().getInventoryId(); - String name = backOrderItem.getName(); - int quantity = backOrderItem.getQuantity(); - int inventoryQuantity = backOrderItem.getInventoryQuantity(); - - Date lowDateRaw = new Date(backOrderItem.getLowDate()); - SimpleDateFormat formatter = new SimpleDateFormat("MM/dd/yyyy hh:mm:ss a zzz"); - String lowDate = formatter.format(lowDateRaw); - %> - - - - - - - - - - - - - - - - - - - - - <% - } // if (status.equals(Utils.STATUS_ORDERSTOCK()) - } // End while (i.hasNext() - } // if (backOrderItems != null) - else { - Util.debug("NO BackOrders Found in backorderadmin.jsp"); - } - %> - - - - - - - - -
    BACK - ORDER #ITEM - #ITEM - DESCRIPTIONQUANTITY TO ORDERCURRENT INVENTORY - QUANTITYLOW INVENTORY DATE
    - -
    -

    <%=backOrderID%>

    -
    -

    <%=invID%>

    -
    -

    <%=name%>

    -
    -

    <%=inventoryQuantity%>

    -
    -

    <%=lowDate%>

    -
    - -
    -
    -
    - Ordered Items

    -
    -

    - The Ordered Items list shows the inventory items that - have already been ordered from a supplier but have not been - received yet. Select one or more ordered items and click the Check - Status to check the status from the supplier. -

    - - - - - - - - - - - - - - - <% - if (backOrderItems != null) { - Util.debug("BackOrders Found in backorderadmin.jsp"); - Iterator i = backOrderItems.iterator(); - while (i.hasNext()) { - BackOrderItem backOrderItem = (BackOrderItem) i.next(); - String status = backOrderItem.getStatus(); - if (status.equals(Util.STATUS_ORDEREDSTOCK)) { - String backOrderID = backOrderItem.getBackOrderID(); - String supplierOrderID = backOrderItem.getSupplierOrderID(); - String invID = backOrderItem.getInventory().getInventoryId(); - String name = backOrderItem.getName(); - int quantity = backOrderItem.getQuantity(); - int inventoryQuantity = backOrderItem.getInventoryQuantity(); - - Date lowDateRaw = new Date(backOrderItem.getLowDate()); - Date orderedDateRaw = new Date(backOrderItem.getOrderDate()); - - SimpleDateFormat formatter = new SimpleDateFormat("MM/dd/yyyy hh:mm:ss a zzz"); - String lowDate = formatter.format(lowDateRaw); - String orderedDate = formatter.format(orderedDateRaw); - %> - - - - - - - - - - - - <% - } // if (status.equals(Utils.STATUS_ORDEREDSTOCK()) - } // End while (i.hasNext() - } // if (backOrderItems != null) - else { - Util.debug("NO BackOrders Found in backorderadmin.jsp"); - } - %> - - - - - - - -
    BACK - ORDER #SUPPLIER - ORDER #ITEM - #ITEM - DESCRIPTIONQUANTITY ORDEREDCURRENT INVENTORY - QUANTITYLOW INVENTORY DATEORDERED DATE
    -

    <%=backOrderID%>

    -
    -

    <%=supplierOrderID%>

    -
    -

    <%=invID%>

    -
    -

    <%=name%>

    -
    -

    <%=quantity%>

    -
    -

    <%=inventoryQuantity%>

    -
    -

    <%=lowDate%>

    -
    -

    <%=orderedDate%>

    -
    - - -
    -
    -
    - Received Items

    -
    -

    - The Received Items list shows the inventory items that - have been received from a supplier but have not been added to - the inventory. Select one or more ordered items and click the - Update Stock to add the inventory received from the - supplier. -

    - - - - - - - - - - - - - - - <% - if (backOrderItems != null) { - Util.debug("BackOrders Found in backorderadmin.jsp"); - Iterator i = backOrderItems.iterator(); - while (i.hasNext()) { - BackOrderItem backOrderItem = (BackOrderItem) i.next(); - String status = backOrderItem.getStatus(); - if (status.equals(Util.STATUS_RECEIVEDSTOCK)) { - String backOrderID = backOrderItem.getBackOrderID(); - String supplierOrderID = backOrderItem.getSupplierOrderID(); - String invID = backOrderItem.getInventory().getInventoryId(); - String name = backOrderItem.getName(); - int quantity = backOrderItem.getQuantity(); - int inventoryQuantity = backOrderItem.getInventoryQuantity(); - - Date lowDateRaw = new Date(backOrderItem.getLowDate()); - Date orderedDateRaw = new Date(backOrderItem.getOrderDate()); - - SimpleDateFormat formatter = new SimpleDateFormat("MM/dd/yyyy hh:mm:ss a zzz"); - String lowDate = formatter.format(lowDateRaw); - String orderedDate = formatter.format(orderedDateRaw); - %> - - - - - - - - - - - - - <% - } // if (status.equals(Util.STATUS_RECEIVEDSTOCK)) - } // End while (i.hasNext() - } // if (backOrderItems != null) - else { - Util.debug("NO BackOrders Found in backorderadmin.jsp"); - } - %> - - - - - - - - -
    BACK - ORDER #SUPPLIER - ORDER #ITEM - #ITEM - DESCRIPTIONQUANTITY RECEIVEDCURRENT INVENTORY - QUANTITYLOW INVENTORY DATEORDERED DATE
    -

    <%=backOrderID%>

    -
    -

    <%=supplierOrderID%>

    -
    -

    <%=invID%>

    -
    -

    <%=name%>

    -
    -

    <%=quantity%>

    -
    -

    <%=inventoryQuantity%>

    -
    -

    <%=lowDate%>

    -
    -

    <%=orderedDate%>

    -
    - -
    -

    -
    - - - - - - -
    -

    -
    -

    - - - - - -
    Powered by WebSphere - -
    - - diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/cart.xhtml b/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/cart.xhtml deleted file mode 100755 index 4694d0be..00000000 --- a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/cart.xhtml +++ /dev/null @@ -1,171 +0,0 @@ - - - - - - - - - - - - - - - - -

    Here are the items you have selected. To recalculate your - total after changing the quantity of an item, select the - 'Recalculate' button. To remove an item from your cart, enter "0" - as the quantity. Select 'Checkout Now' to begin the checkout - process.

    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - -

    - Order Subtotal:   - - - -

    -
    - - - - - - - - - - - - - - - - - - - -
    - -
    -
    -
    -
    -
    - diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/checkout_final.xhtml b/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/checkout_final.xhtml deleted file mode 100755 index 72516243..00000000 --- a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/checkout_final.xhtml +++ /dev/null @@ -1,339 +0,0 @@ - - - - - - - - - - - - - - - - - -
    -

    - - > - - > - -

    -
    - - - - - - - - - - - - -
    Review - Your Order

    - Review your order below and select 'Submit Order' at the - bottom to place your order. You can also add more items to - your order by selecting 'Continue Shopping'.
    -
    -

    - - - - - - - - - - - -
    Order Information
    - - - - - - - -
    ORDER TOTAL
    -

    - - - - -

    -
    -
    - - - - - - - -
    SHIPPING ADDRESS
    -

    - -
    - -
    - -
    - -
    - -
    -

    -
    -
    - - - - - - - -
    BILLING ADDRESS
    -

    - -
    - -
    - -
    - -
    - -
    -

    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Order Details
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    Order - Subtotal:

    -

    - - - -

    -
    -

    - -

    -
    -

    - - - -

    -

    - Order Total: -

    -

    - - - - -

    -
     
    - - - - - -
    - - - -
    -
    -
    -
    -
    - - - - -
    -
    -
    -
    - \ No newline at end of file diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/collectionform.js b/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/collectionform.js deleted file mode 100755 index f5811db5..00000000 --- a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/collectionform.js +++ /dev/null @@ -1,188 +0,0 @@ -// -// COPYRIGHT LICENSE: This information contains sample code provided in source code form. You may copy, -// modify, and distribute these sample programs in any form without payment to IBM for the purposes of -// developing, using, marketing or distributing application programs conforming to the application -// programming interface for the operating platform for which the sample code is written. -// Notwithstanding anything to the contrary, IBM PROVIDES THE SAMPLE SOURCE CODE ON AN "AS IS" BASIS -// AND IBM DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, ANY IMPLIED -// WARRANTIES OR CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A PARTICULAR PURPOSE, -// TITLE, AND ANY WARRANTY OR CONDITION OF NON-INFRINGEMENT. IBM SHALL NOT BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR OPERATION OF THE -// SAMPLE SOURCE CODE. IBM HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS -// OR MODIFICATIONS TO THE SAMPLE SOURCE CODE. -// -// (C) COPYRIGHT International Business Machines Corp., 2001,2011 -// All Rights Reserved * Licensed Materials - Property of IBM -// - -var isNav4, isIE; -var coll = ""; -var styleObj = ""; -if (parseInt(navigator.appVersion) >= 4) { - if (navigator.appName == "Netscape") { - isNav4 = true; - } else { - isIE = true; - coll = "all."; - styleObj = ".style"; - } -} - -function refresh() { - if (refreshTree.value == "true") - parent.navigation_tree.location.reload(true); -} - -var numchecks = 0; -var allchecked = false; -var multiall = new Array(); -function updateCheckAll(theForm, chkname) { - var temp; - var alltemp = 0; - var formlen = theForm.length; - if (chkname != null) { - var allchkname = chkname.substring(0, chkname.indexOf("CheckBox")); - allchkname = "allchecked" + allchkname; - } - for (var i = 0; i < formlen; i++) { - var theitem = theForm.elements[i].name; - var ischeck = theitem.indexOf("selectedObjectIds", 0) + 1; /* simple string search on checkbox consistent name, you change it to deleteID or whatever */ - var allcurcheck = theitem.indexOf(allchkname, 0) + 1; - if (allcurcheck > 0) { - alltemp = i; - } - if (chkname == null) { - - if (ischeck > 0) { - if (allchecked != true) { - theForm.elements[i].checked = true; - temp = true; - } else { - theForm.elements[i].checked = false; - temp = false; - - } - } - - var appitem = theForm.elements[i].name; - var appcheck = appitem.indexOf("checkBoxes", 0) + 1; - if ((appitem == "checkBoxes1") || (appitem == "checkBoxes2")) { - appcheck = 0; - } - - if (appcheck > 0) { - if (allchecked != true) { - theForm.elements[i].checked = true; - temp = true; - - } else { - theForm.elements[i].checked = false; - temp = false; - - } - } - - } else { - - var curitem = theForm.elements[i].name; - //var curcheck = curitem.indexOf(chkname[0].name,0) + 1; - - var curcheck = curitem.indexOf(chkname, 0) + 1; - - if (curcheck > 0) { - if ((allchecked != true) && (multiall[allchkname] != true)) { - theForm.elements[i].checked = true; - temp = true; - - } else { - theForm.elements[i].checked = false; - temp = false; - - } - } - - } - - } - - if (temp == true) { - if (chkname == null) { - allchecked = true; - theForm.allchecked.checked = true; - } else { - multiall[allchkname] = true; - theForm.elements[alltemp].checked = true; - } - } else { - if (chkname == null) { - allchecked = false; - theForm.allchecked.checked = false; - } else { - multiall[allchkname] = false; - theForm.elements[alltemp].checked = false; - } - } - -} - -function checkChecks(theForm, chkname) { - var checkednum = 0; - var uncheckednum = 0; - var formlen = theForm.length; - - for (var i = 0; i < formlen; i++) { - var theitem = theForm.elements[i].name; - var ischeck = theitem.indexOf("selectedObjectIds", 0) + 1; - var appitem = theForm.elements[i].name; - var appcheck = appitem.indexOf("checkBoxes", 0) + 1; - if ((appitem == "checkBoxes1") || (appitem == "checkBoxes2")) { - appcheck = 0; - } - - if (chkname != null) { - var curcheck = theitem.indexOf(chkname.name, 0) + 1; - - } - - if (ischeck > 0) { - if (theForm.elements[i].checked == true) { - checkednum += 1; - } else { - uncheckednum += 1; - } - } - if (curcheck > 0) { - if (theForm.elements[i].checked == true) { - checkednum += 1; - } else { - uncheckednum += 1; - - } - - } - if (appcheck > 0) { - if (theForm.elements[i].checked == true) { - checkednum += 1; - } else { - uncheckednum += 1; - } - - } - - } - - if (allchecked == true) { - - if (uncheckednum > 0) { - allchecked = false; - theForm.allchecked.checked = false; - } - } else { - if (uncheckednum == 0) { - allchecked = true; - theForm.allchecked.checked = true; - - } - } - -} diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/error.jsp b/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/error.jsp deleted file mode 100755 index 61baf092..00000000 --- a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/error.jsp +++ /dev/null @@ -1,156 +0,0 @@ - - - - - - - - - - - - - <%@ page import="java.io.*, java.lang.reflect.*"%> - - - - - - - - - - - - - - - - - - - - - -
    -
    -
    An Error has occured - during PlantsByWebSphere processing.
    - <% - String message = null; - int status_code = -1; - String exception_info = null; - String url = null; - String method = null; - - Object myReport = null; - - //ErrorReport is an attribute that is set in WebSphere - //if it exists we will use it to get information about the error - //if it does not exist we will use the attributes specified by - //Servlet 2.2 - myReport = request.getAttribute("ErrorReport"); - - int needInfo = 1; - if (myReport != null) { - try { - //Using reflection here so that if the class com.ibm.websphere.servlet.error.ServletErrorReport - //does not exist at compile time there will not be a problem - //if this class does not exist we will juse use the attributes specified by Servlet 2.2 - - Class myClass = Class.forName("com.ibm.websphere.servlet.error.ServletErrorReport"); - Method myMethod = myClass.getMethod("getErrorCode", (Class[]) null); - Object o = myMethod.invoke(myReport, (Object[]) null); - status_code = ((Integer) o).intValue(); - - myMethod = myClass.getMethod("getMessage", (Class[]) null); - o = myMethod.invoke(myReport, (Object[]) null); - message = (java.lang.String) o; - - myMethod = myClass.getMethod("getStackTrace", (Class[]) null); - o = myMethod.invoke(myReport, (Object[]) null); - exception_info = (java.lang.String) o; - needInfo = 0; - method = "Using attribute of type com.ibm.websphere.servlet.error.ServletErrorReport to get information."; - - } catch (Exception e) { - needInfo = 1; - } - - } - //if needInfo is set to 1 it means that using the WebSphere ServletErrorReport class has failed - //and we must get the information in the standard manner. - if (needInfo == 1) { - //this means that could not find ibm class. - - Exception theException = null; - Integer status = null; - method = "Using attributes javax.servlet.error.message ...status_code ...exception as specified by Servlet 2.2 to get information"; - //these attribute names are specified by Servlet 2.2 - message = (String) request.getAttribute("javax.servlet.error.message"); - status = ((Integer) request.getAttribute("javax.servlet.error.status_code")); - theException = (Exception) request.getAttribute("javax.servlet.error.exception"); - if (message == null) { - message = "not available"; - } - - if (status == null) { - status_code = -1; - } else { - status_code = status.intValue(); - } - if (theException == null) { - exception_info = "not available"; - } else { - exception_info = theException.toString(); - } - } - - try { - url = request.getRequestURL().toString(); - } catch (Exception e) { - url = "information not available"; - } - - //output is all done here. - - out.println("

    Jsp Error Page

    " + method); - out.println("

    Processing request:" + url); - out.println("
    StatusCode: " + status_code); - out.println("
    Message:" - + message.replace("<", "<").replace(">", ">").replace("\"", """)); - out.println("
    Exception:" - + exception_info.replace("<", "<").replace(">", ">").replace("\"", """)); - %> -
    Please Check the application server log files - for details...
    -
    -
    - - - - - -
    Plants by WebSphere
    - - diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/help.xhtml b/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/help.xhtml deleted file mode 100755 index d27f39c5..00000000 --- a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/help.xhtml +++ /dev/null @@ -1,100 +0,0 @@ - - - - - - - - - - - - - - - - - -
    -

    - - > -

    -
    - - - - - - - - - - - - - - - - - - - -

    Help

    Plants By WebSphere provides - limited help support. See the sample docs directory for - documentation on the design, building, and installation of - the sample.

    -

    Debug mode has been tied to the JSF project stage - declaration. Debug messages will be displayed when the web - app's javax.faces.PROJECT_STAGE context param is set to - either Development or UnitTest. A value of SystemTest or - Production will turn off debug output. The current state of - debugging is indicated in the check box below.

    Debug messages - enabled
    -

    If the database becomes corrupted for some reason, the - button below can be used to delete all data currently in the - database and populate it with a fresh set of data. If this - does not work, stop the server and repeat the prerequisite - steps found in the docs directory to unzip the Derby - database.

    -

    - -

    -
    -
    - - - - -
    -
    -
    -
    - - \ No newline at end of file diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/index.html b/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/index.html deleted file mode 100755 index 43371796..00000000 --- a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/index.html +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/login.xhtml b/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/login.xhtml deleted file mode 100755 index 334f3c38..00000000 --- a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/login.xhtml +++ /dev/null @@ -1,135 +0,0 @@ - - - - - - - - - - - - - - - - - -
    -

    - -

    -
    - - - - - - - - - -

    Login or - Register

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    - If you are a returning customer and previously set up an - account, please enter your e-mail - address and password below. -

    -

    - -

    -

    - -    - -

    -

    - -

    -

    - -

    -
    - -
    -
    -

    - If you are a New customer you can - - . -


    -
    -
    -
    -
    - - - - -
    -
    -
    -
    -
    - \ No newline at end of file diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/orderdone.xhtml b/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/orderdone.xhtml deleted file mode 100755 index c87f14ba..00000000 --- a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/orderdone.xhtml +++ /dev/null @@ -1,80 +0,0 @@ - - - - - - - - - - - - - - - - - -
    -

    - -

    -
    - - - - - - - - - -
    Order - Completion
    -

    Thank you for making your Plants By WebSphere purchase!

    -
    -

    - Order number - -

    -
    -

    Expected arrival in 5-7 business days.

    -
    -
    -
    -
    - - - - -
    -
    -
    -
    -
    - \ No newline at end of file diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/orderinfo.xhtml b/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/orderinfo.xhtml deleted file mode 100755 index 709f9b57..00000000 --- a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/orderinfo.xhtml +++ /dev/null @@ -1,516 +0,0 @@ - - - - - - - - - - - - - - - - - - - -
    -

    - - > - -

    -
    - - - - - - - - - - - - - - - - - - - -
    Checkout

    Enter the billing and shipping - information for your order below. Select 'Continue' to review - and place your final order.

    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Billing Address

    - -

    -

    - -    - -

    -

    - -

    -

    - -    - -

    -

    - -

    -

    - -

    -

    - -

    -

    - -    - -

    -

    - -

    -

    - -    - -

    -

    - -

    -

    - -    - -

    -

    - -

    -

    - -    - -

    -
     
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Shipping - Information
    - - - - - -
    -

    - -   -

    -

    Check here if the - shipping address is the same as the billing address.

    -

    - -

    -

    - -    - -

    -

    - -

    -

    - -    - -

    -

    - -

    -

    - -

    -

    - -

    -

    - -    - -

    -

    - -

    -

    - -    - -

    -

    - -

    -

    - -    - -

    -

    - -

    -

    - -    - -

    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Shipping Method

    Select a shipping method below. - Your order total will be updated on the next page.

    -

    - -

    - - - -
     
    -

    - -

    -
    -

    - - - - - - -

    -
    -

    - -

    -
    -   
    -

    - -

    -
    -

    - - - - - - - - - - - - - - -

    -
    -

    - -

    -
    -

    - - - - - -

    -
    -

    - -

    -
    -

    - -    - -

    -
    -

     

    -
    -

     

    -
    - -
    -
    -
    -
    - - - - - -
    -
    -
    -
    - diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/product.xhtml b/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/product.xhtml deleted file mode 100755 index 8647dc73..00000000 --- a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/product.xhtml +++ /dev/null @@ -1,138 +0,0 @@ - - - - - - - - - - - - - - - - - -
    -

    - - > - - - -

    -
    - - - - - - - - - - - - - - -
    -

    - -

    -



    -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - -

    ITEM#DESCRIPTIONPRICEQUANTITY
    -
      -
    - - -
    -
    -
    -
    -
    - - - - -
    -
    -
    -
    -
    - \ No newline at end of file diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/promo.xhtml b/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/promo.xhtml deleted file mode 100755 index ff63de80..00000000 --- a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/promo.xhtml +++ /dev/null @@ -1,170 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - - - - -
    -
    - -
    -
    - -
    - - - - - - -
    - - - - - - - -
    Tips

    Preserve - extra grass seed by keeping it dry. Tape boxes and bags - closed, or seal them into plastic bags. Be sure to remove - extra air from the bags. Store all seed in a cool, dry area - such as a garage or basement.

    -
    - - - - - - - - - - - -
    Specials
    - - - -

    - - - - Bonsai Tree -
    - $30.00 each -
    -
    -

    - - - -

    - - - - Red Delicious Strawberries -
    - $3.50 (50 seeds) -
    -
    -

    - - - -

    - - - - Tulips -
    - $17.00 (10 bulbs) -
    -
    -

    -
    -
    -
    -
    -
    -
    - \ No newline at end of file diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/register.xhtml b/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/register.xhtml deleted file mode 100755 index 528d1663..00000000 --- a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/register.xhtml +++ /dev/null @@ -1,332 +0,0 @@ - - - - - - - - - - - - - - - - - -
    -

    - - > - -

    -
    - - - - - - - - - - - - - - - -

    Registration

    - Enter the information below to set up your account. This - information will not be shared without your permission. With - your permission we will only share your name and email address - with our trusted business partners.
    -
    -

    -

    - Required fields are denoted with a red asterisk ( - - ).
    -
    -

    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Login Information
       

    - -

    -

    - - - -    - -

    -

    - -

    -

    - -

    -

    - -

    -

    - - - -    - -

    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Contact - Information
       

    - -

    -

    - -    - -

    -

    - -

    -

    - -    - -

    -

    - -

    -

    - -    - -

    -

    - -

    -

    - -

    -

    - -

    -

    - -    - -

    -

    - -

    -

    - -    - -

    -

    - -

    -

    - -    - -

    -

    - -

    -

    - -    - -

    -

    - -

    -

    -
    - - - - -
    -
    -
    -
    -
    - \ No newline at end of file diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/1x1_trans.gif b/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/1x1_trans.gif deleted file mode 100755 index d6e9b014..00000000 Binary files a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/1x1_trans.gif and /dev/null differ diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/accessories_birdfeeder.jpg b/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/accessories_birdfeeder.jpg deleted file mode 100755 index 9b99836a..00000000 Binary files a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/accessories_birdfeeder.jpg and /dev/null differ diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/accessories_birdhouse.jpg b/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/accessories_birdhouse.jpg deleted file mode 100755 index c062089a..00000000 Binary files a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/accessories_birdhouse.jpg and /dev/null differ diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/accessories_bulbdigger.jpg b/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/accessories_bulbdigger.jpg deleted file mode 100755 index e156f93c..00000000 Binary files a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/accessories_bulbdigger.jpg and /dev/null differ diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/accessories_finchfood.jpg b/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/accessories_finchfood.jpg deleted file mode 100755 index bd9559d3..00000000 Binary files a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/accessories_finchfood.jpg and /dev/null differ diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/accessories_gloves.jpg b/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/accessories_gloves.jpg deleted file mode 100755 index fcbd878a..00000000 Binary files a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/accessories_gloves.jpg and /dev/null differ diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/accessories_grassrake.jpg b/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/accessories_grassrake.jpg deleted file mode 100755 index 0adf7d29..00000000 Binary files a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/accessories_grassrake.jpg and /dev/null differ diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/accessories_handrake.jpg b/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/accessories_handrake.jpg deleted file mode 100755 index 9d6a59e5..00000000 Binary files a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/accessories_handrake.jpg and /dev/null differ diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/accessories_leafrake.jpg b/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/accessories_leafrake.jpg deleted file mode 100755 index 09f832a9..00000000 Binary files a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/accessories_leafrake.jpg and /dev/null differ diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/accessories_pot.jpg b/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/accessories_pot.jpg deleted file mode 100755 index 30f7bfc9..00000000 Binary files a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/accessories_pot.jpg and /dev/null differ diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/accessories_shovel.jpg b/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/accessories_shovel.jpg deleted file mode 100755 index 5bd8caa1..00000000 Binary files a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/accessories_shovel.jpg and /dev/null differ diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/accessories_wheelbarrow.jpg b/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/accessories_wheelbarrow.jpg deleted file mode 100755 index 2302d40e..00000000 Binary files a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/accessories_wheelbarrow.jpg and /dev/null differ diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/add_to_cart.jpg b/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/add_to_cart.jpg deleted file mode 100755 index 51b0dd32..00000000 Binary files a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/add_to_cart.jpg and /dev/null differ diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/button_add_to_cart.gif b/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/button_add_to_cart.gif deleted file mode 100755 index d46ee435..00000000 Binary files a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/button_add_to_cart.gif and /dev/null differ diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/button_change.gif b/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/button_change.gif deleted file mode 100755 index 82bca2c9..00000000 Binary files a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/button_change.gif and /dev/null differ diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/button_checkout.gif b/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/button_checkout.gif deleted file mode 100755 index cf3405e1..00000000 Binary files a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/button_checkout.gif and /dev/null differ diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/button_checkout_now.gif b/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/button_checkout_now.gif deleted file mode 100755 index d8db2088..00000000 Binary files a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/button_checkout_now.gif and /dev/null differ diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/button_continue.gif b/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/button_continue.gif deleted file mode 100755 index b10e0a8a..00000000 Binary files a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/button_continue.gif and /dev/null differ diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/button_continue_shopping.gif b/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/button_continue_shopping.gif deleted file mode 100755 index 068db8e3..00000000 Binary files a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/button_continue_shopping.gif and /dev/null differ diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/button_go.gif b/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/button_go.gif deleted file mode 100755 index b3eb969c..00000000 Binary files a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/button_go.gif and /dev/null differ diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/button_more.gif b/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/button_more.gif deleted file mode 100755 index c20f0f30..00000000 Binary files a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/button_more.gif and /dev/null differ diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/button_previous.gif b/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/button_previous.gif deleted file mode 100755 index e9e7d97a..00000000 Binary files a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/button_previous.gif and /dev/null differ diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/button_recalculate.gif b/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/button_recalculate.gif deleted file mode 100755 index d5ff1181..00000000 Binary files a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/button_recalculate.gif and /dev/null differ diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/button_register.gif b/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/button_register.gif deleted file mode 100755 index 046a9fb2..00000000 Binary files a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/button_register.gif and /dev/null differ diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/button_sign_in.gif b/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/button_sign_in.gif deleted file mode 100755 index 5c2a9b25..00000000 Binary files a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/button_sign_in.gif and /dev/null differ diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/button_submit_order.gif b/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/button_submit_order.gif deleted file mode 100755 index d0b3f1ff..00000000 Binary files a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/button_submit_order.gif and /dev/null differ diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/button_update.gif b/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/button_update.gif deleted file mode 100755 index 1e2bda89..00000000 Binary files a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/button_update.gif and /dev/null differ diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/creditcards.bmp b/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/creditcards.bmp deleted file mode 100755 index 7314a9e1..00000000 Binary files a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/creditcards.bmp and /dev/null differ diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/flower_african_orchid.jpg b/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/flower_african_orchid.jpg deleted file mode 100755 index 7604aa77..00000000 Binary files a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/flower_african_orchid.jpg and /dev/null differ diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/flower_bbreath.jpg b/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/flower_bbreath.jpg deleted file mode 100755 index c1178a08..00000000 Binary files a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/flower_bbreath.jpg and /dev/null differ diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/flower_black-eyed_susan.jpg b/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/flower_black-eyed_susan.jpg deleted file mode 100755 index 61724b69..00000000 Binary files a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/flower_black-eyed_susan.jpg and /dev/null differ diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/flower_coleus.jpg b/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/flower_coleus.jpg deleted file mode 100755 index c2afcaaf..00000000 Binary files a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/flower_coleus.jpg and /dev/null differ diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/flower_daisies.jpg b/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/flower_daisies.jpg deleted file mode 100755 index 1445aa23..00000000 Binary files a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/flower_daisies.jpg and /dev/null differ diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/flower_foxglove.jpg b/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/flower_foxglove.jpg deleted file mode 100755 index 5c70aa00..00000000 Binary files a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/flower_foxglove.jpg and /dev/null differ diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/flower_geranium.jpg b/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/flower_geranium.jpg deleted file mode 100755 index dac06e51..00000000 Binary files a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/flower_geranium.jpg and /dev/null differ diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/flower_goodnight_moon_iris.jpg b/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/flower_goodnight_moon_iris.jpg deleted file mode 100755 index 565c69ed..00000000 Binary files a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/flower_goodnight_moon_iris.jpg and /dev/null differ diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/flower_impatiens.jpg b/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/flower_impatiens.jpg deleted file mode 100755 index 96d2e675..00000000 Binary files a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/flower_impatiens.jpg and /dev/null differ diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/flower_lily.jpg b/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/flower_lily.jpg deleted file mode 100755 index c1303c5f..00000000 Binary files a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/flower_lily.jpg and /dev/null differ diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/flower_pansies.jpg b/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/flower_pansies.jpg deleted file mode 100755 index dc795ad3..00000000 Binary files a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/flower_pansies.jpg and /dev/null differ diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/flower_petunias.jpg b/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/flower_petunias.jpg deleted file mode 100755 index 3da1328c..00000000 Binary files a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/flower_petunias.jpg and /dev/null differ diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/flower_primrose.jpg b/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/flower_primrose.jpg deleted file mode 100755 index b592e2da..00000000 Binary files a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/flower_primrose.jpg and /dev/null differ diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/flower_red_poinsettia.jpg b/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/flower_red_poinsettia.jpg deleted file mode 100755 index 57f8e9a3..00000000 Binary files a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/flower_red_poinsettia.jpg and /dev/null differ diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/flower_red_rose.jpg b/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/flower_red_rose.jpg deleted file mode 100755 index d88781a5..00000000 Binary files a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/flower_red_rose.jpg and /dev/null differ diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/flower_sparkler_celosia.jpg b/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/flower_sparkler_celosia.jpg deleted file mode 100755 index f66a6554..00000000 Binary files a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/flower_sparkler_celosia.jpg and /dev/null differ diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/flower_tulips.jpg b/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/flower_tulips.jpg deleted file mode 100755 index b9dbf24e..00000000 Binary files a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/flower_tulips.jpg and /dev/null differ diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/flower_tulips_48.jpg b/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/flower_tulips_48.jpg deleted file mode 100755 index f5c2fa97..00000000 Binary files a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/flower_tulips_48.jpg and /dev/null differ diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/flower_white_poinsettia.jpg b/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/flower_white_poinsettia.jpg deleted file mode 100755 index ec02a0de..00000000 Binary files a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/flower_white_poinsettia.jpg and /dev/null differ diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/flower_white_rose.jpg b/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/flower_white_rose.jpg deleted file mode 100755 index 3fea521b..00000000 Binary files a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/flower_white_rose.jpg and /dev/null differ diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/flower_zinnia.jpg b/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/flower_zinnia.jpg deleted file mode 100755 index 297b64cc..00000000 Binary files a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/flower_zinnia.jpg and /dev/null differ diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/go.gif b/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/go.gif deleted file mode 100755 index 8d2d079a..00000000 Binary files a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/go.gif and /dev/null differ diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/item_selection.jpg b/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/item_selection.jpg deleted file mode 100755 index 32e462da..00000000 Binary files a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/item_selection.jpg and /dev/null differ diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/more_btn.gif b/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/more_btn.gif deleted file mode 100755 index 6e7bde4d..00000000 Binary files a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/more_btn.gif and /dev/null differ diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/pbw.jpg b/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/pbw.jpg deleted file mode 100755 index 7de65b3a..00000000 Binary files a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/pbw.jpg and /dev/null differ diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/poweredby_WebSphere.gif b/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/poweredby_WebSphere.gif deleted file mode 100755 index ddbae468..00000000 Binary files a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/poweredby_WebSphere.gif and /dev/null differ diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/required.gif b/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/required.gif deleted file mode 100755 index bda06255..00000000 Binary files a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/required.gif and /dev/null differ diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/sapling_whitepine_48.jpg b/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/sapling_whitepine_48.jpg deleted file mode 100755 index 60a85afd..00000000 Binary files a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/sapling_whitepine_48.jpg and /dev/null differ diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/seeds_promo.gif b/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/seeds_promo.gif deleted file mode 100755 index ada56ed5..00000000 Binary files a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/seeds_promo.gif and /dev/null differ diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/strawberries_48.jpg b/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/strawberries_48.jpg deleted file mode 100755 index fed000e0..00000000 Binary files a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/strawberries_48.jpg and /dev/null differ diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/tab_accessories_s.gif b/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/tab_accessories_s.gif deleted file mode 100755 index 73d056c9..00000000 Binary files a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/tab_accessories_s.gif and /dev/null differ diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/tab_accessories_u.gif b/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/tab_accessories_u.gif deleted file mode 100755 index 9aeaeb47..00000000 Binary files a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/tab_accessories_u.gif and /dev/null differ diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/tab_flowers_s.gif b/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/tab_flowers_s.gif deleted file mode 100755 index 56699893..00000000 Binary files a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/tab_flowers_s.gif and /dev/null differ diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/tab_flowers_u.gif b/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/tab_flowers_u.gif deleted file mode 100755 index 21f25fac..00000000 Binary files a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/tab_flowers_u.gif and /dev/null differ diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/tab_trees_s.gif b/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/tab_trees_s.gif deleted file mode 100755 index 0ad57fcf..00000000 Binary files a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/tab_trees_s.gif and /dev/null differ diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/tab_trees_u.gif b/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/tab_trees_u.gif deleted file mode 100755 index cc478e37..00000000 Binary files a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/tab_trees_u.gif and /dev/null differ diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/tab_veggies_s.gif b/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/tab_veggies_s.gif deleted file mode 100755 index efb55efa..00000000 Binary files a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/tab_veggies_s.gif and /dev/null differ diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/tab_veggies_u.gif b/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/tab_veggies_u.gif deleted file mode 100755 index 072737e5..00000000 Binary files a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/tab_veggies_u.gif and /dev/null differ diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/tabs_background.jpg b/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/tabs_background.jpg deleted file mode 100755 index 9f3738e7..00000000 Binary files a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/tabs_background.jpg and /dev/null differ diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/tabs_background_a.gif b/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/tabs_background_a.gif deleted file mode 100755 index eb2d540a..00000000 Binary files a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/tabs_background_a.gif and /dev/null differ diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/tabs_background_b.gif b/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/tabs_background_b.gif deleted file mode 100755 index 5d4e3c24..00000000 Binary files a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/tabs_background_b.gif and /dev/null differ diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/theme_summer1.gif b/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/theme_summer1.gif deleted file mode 100755 index 648b0797..00000000 Binary files a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/theme_summer1.gif and /dev/null differ diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/theme_summer2.gif b/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/theme_summer2.gif deleted file mode 100755 index c239e0cf..00000000 Binary files a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/theme_summer2.gif and /dev/null differ diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/theme_summer_text.gif b/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/theme_summer_text.gif deleted file mode 100755 index 22b8bdbe..00000000 Binary files a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/theme_summer_text.gif and /dev/null differ diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/trees_ash.jpg b/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/trees_ash.jpg deleted file mode 100755 index 36a5da9d..00000000 Binary files a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/trees_ash.jpg and /dev/null differ diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/trees_aspen.jpg b/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/trees_aspen.jpg deleted file mode 100755 index 51628da3..00000000 Binary files a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/trees_aspen.jpg and /dev/null differ diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/trees_bonsai.jpg b/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/trees_bonsai.jpg deleted file mode 100755 index 628a9b3e..00000000 Binary files a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/trees_bonsai.jpg and /dev/null differ diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/trees_bonsai_48.jpg b/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/trees_bonsai_48.jpg deleted file mode 100755 index 7ce5fe8e..00000000 Binary files a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/trees_bonsai_48.jpg and /dev/null differ diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/trees_crab.jpg b/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/trees_crab.jpg deleted file mode 100755 index d1b6e5b0..00000000 Binary files a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/trees_crab.jpg and /dev/null differ diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/trees_maple.jpg b/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/trees_maple.jpg deleted file mode 100755 index 36a9b608..00000000 Binary files a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/trees_maple.jpg and /dev/null differ diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/tulips_48.jpg b/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/tulips_48.jpg deleted file mode 100755 index f5c2fa97..00000000 Binary files a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/tulips_48.jpg and /dev/null differ diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/veggies_cabbage.jpg b/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/veggies_cabbage.jpg deleted file mode 100755 index 778f2883..00000000 Binary files a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/veggies_cabbage.jpg and /dev/null differ diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/veggies_gourds.jpg b/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/veggies_gourds.jpg deleted file mode 100755 index 3a3ab7a1..00000000 Binary files a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/veggies_gourds.jpg and /dev/null differ diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/veggies_grapes.jpg b/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/veggies_grapes.jpg deleted file mode 100755 index 5b5fb81b..00000000 Binary files a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/veggies_grapes.jpg and /dev/null differ diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/veggies_onion.jpg b/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/veggies_onion.jpg deleted file mode 100755 index bc4371ad..00000000 Binary files a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/veggies_onion.jpg and /dev/null differ diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/veggies_pineapple.jpg b/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/veggies_pineapple.jpg deleted file mode 100755 index 117ed2d6..00000000 Binary files a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/veggies_pineapple.jpg and /dev/null differ diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/veggies_strawberries.jpg b/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/veggies_strawberries.jpg deleted file mode 100755 index 2dc87789..00000000 Binary files a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/veggies_strawberries.jpg and /dev/null differ diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/veggies_strawberries_48.jpg b/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/veggies_strawberries_48.jpg deleted file mode 100755 index fed000e0..00000000 Binary files a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/veggies_strawberries_48.jpg and /dev/null differ diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/veggies_watermelon.jpg b/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/veggies_watermelon.jpg deleted file mode 100755 index f79f088d..00000000 Binary files a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/images/veggies_watermelon.jpg and /dev/null differ diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/javascript/PlantsScripts.js b/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/javascript/PlantsScripts.js deleted file mode 100755 index ca191218..00000000 --- a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/javascript/PlantsScripts.js +++ /dev/null @@ -1,88 +0,0 @@ -// -// COPYRIGHT LICENSE: This information contains sample code provided in source code form. You may copy, -// modify, and distribute these sample programs in any form without payment to IBM for the purposes of -// developing, using, marketing or distributing application programs conforming to the application -// programming interface for the operating platform for which the sample code is written. -// Notwithstanding anything to the contrary, IBM PROVIDES THE SAMPLE SOURCE CODE ON AN "AS IS" BASIS -// AND IBM DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, ANY IMPLIED -// WARRANTIES OR CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A PARTICULAR PURPOSE, -// TITLE, AND ANY WARRANTY OR CONDITION OF NON-INFRINGEMENT. IBM SHALL NOT BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR OPERATION OF THE -// SAMPLE SOURCE CODE. IBM HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS -// OR MODIFICATIONS TO THE SAMPLE SOURCE CODE. -// -// (C) COPYRIGHT International Business Machines Corp., 2011 -// All Rights Reserved * Licensed Materials - Property of IBM -// - -if (document.images) { - menu1s = new Image(); - menu1s.src = "resources/images/tab_flowers_s.gif"; - menu2s = new Image(); - menu2s.src = "resources/images/tab_veggies_s.gif"; - menu3s = new Image(); - menu3s.src = "resources/images/tab_trees_s.gif"; - menu4s = new Image(); - menu4s.src = "resources/images/tab_accessories_s.gif"; - - menu1u = new Image(); - menu1u.src = "resources/images/tab_flowers_u.gif"; - menu2u = new Image(); - menu2u.src = "resources/images/tab_veggies_u.gif"; - menu3u = new Image(); - menu3u.src = "resources/images/tab_trees_u.gif"; - menu4u = new Image(); - menu4u.src = "resources/images/tab_accessories_u.gif"; - - } - - function selectMenu (imgName) { - if (top.banner.document.images) { - top.banner.document[imgName].src = eval(imgName + "s.src"); - } - } - - function deselectMenu (imgName) { - if (top.banner.document.images) { - top.banner.document[imgName].src = eval(imgName + "u.src"); - } - } - - function useBill() - { - var billName = document.getElementById ("orderinfo:bname"); - var billAddr1 = document.getElementById ("orderinfo:baddr1"); - var billAddr2 = document.getElementById ("orderinfo:baddr2"); - var billCity = document.getElementById ("orderinfo:bcity"); - var billState = document.getElementById ("orderinfo:bstate"); - var billZip = document.getElementById ("orderinfo:bzip"); - var billPhone = document.getElementById ("orderinfo:bphone"); - var shipName = document.getElementById ("orderinfo:sname"); - var shipAddr1 = document.getElementById ("orderinfo:saddr1"); - var shipAddr2 = document.getElementById ("orderinfo:saddr2"); - var shipCity = document.getElementById ("orderinfo:scity"); - var shipState = document.getElementById ("orderinfo:sstate"); - var shipZip = document.getElementById ("orderinfo:szip"); - var shipPhone = document.getElementById ("orderinfo:sphone"); - var shipIsBill = document.getElementById ("orderinfo:shipisbill"); - - if (shipIsBill.checked) { - shipName.value = billName.value; - shipAddr1.value = billAddr1.value; - shipAddr2.value = billAddr2.value; - shipCity.value = billCity.value; - shipState.value = billState.value; - shipZip.value = billZip.value; - shipPhone.value = billPhone.value; - } - - else { - shipName.value = ""; - shipAddr1.value = ""; - shipAddr2.value = ""; - shipCity.value = ""; - shipState.value = ""; - shipZip.value = ""; - shipPhone.value = ""; - } - } \ No newline at end of file diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/theme/PlantMain.css b/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/theme/PlantMain.css deleted file mode 100755 index 4ff5b50d..00000000 --- a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/theme/PlantMain.css +++ /dev/null @@ -1,321 +0,0 @@ - -/* -------------------------------- */ - -/* - * COPYRIGHT LICENSE: This information contains sample code provided in source code form. You may copy, - * modify, and distribute these sample programs in any form without payment to IBM for the purposes of - * developing, using, marketing or distributing application programs conforming to the application - * programming interface for the operating platform for which the sample code is written. - * Notwithstanding anything to the contrary, IBM PROVIDES THE SAMPLE SOURCE CODE ON AN "AS IS" BASIS - * AND IBM DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, ANY IMPLIED - * WARRANTIES OR CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A PARTICULAR PURPOSE, - * TITLE, AND ANY WARRANTY OR CONDITION OF NON-INFRINGEMENT. IBM SHALL NOT BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR OPERATION OF THE - * SAMPLE SOURCE CODE. IBM HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS - * OR MODIFICATIONS TO THE SAMPLE SOURCE CODE. - * - * (C) COPYRIGHT International Business Machines Corp., 2000,2011 - * All Rights Reserved * Licensed Materials - Property of IBM - */ - -/* -------------------------------- */ - - - -/* MAIN FRAME STYLE FOR HELP CONTENT: DO NOT use a class reference */ - -BODY { font-family : Arial, Helvetica, sans-serif; - margin-left:0; margin-right:0; margin-top:0; margin-bottom:0;width:100%;height:100%;overflow:auto } - -BODY.banner { - margin-left: 0px; -} - -DIV { font-family : Arial, Helvetica, sans-serif;} - -DIV.banner { - margin-left: 0px; -} - - -/* Header Properties */ - -H1 { font-size : 14pt; - - font-family : Verdana, Arial, Helvetica, sans-serif; - - margin-bottom : 0; - color : #669966;} - -H2 { font-size : 15pt; - - font-family : Verdana, Arial, Helvetica, sans-serif; - - margin-bottom : 0; - color : #669966;} - -H3 { font-size : 12pt; - - font-family : Verdana, Arial, Helvetica, sans-serif; - - font-style : italic; - - margin-bottom : 0; - color : #669966;} - -H4 { font-size : 11pt; - - font-family : Verdana, Arial, Helvetica, sans-serif; - - margin-bottom : 0; - color : #669966;} - -H5 { font-size : 10pt; - - font-family : Verdana, Arial, Helvetica, sans-serif; - - font-style : italic; - - margin-bottom : 0; - color : #669966;} - - -/* Paragraph Properties */ - - -P { font-family : Verdana, Arial, Helvetica, sans-serif; - - margin-top : 0em; - - margin-bottom : 0; - font-size : .8em;} -P.global { font-family : Verdana, Arial, Helvetica, sans-serif; - - font-size : .6em; - margin-top : 4px; - - color : "#ffffff";} -P.search { font-family : Verdana, Arial, Helvetica, sans-serif; - - font-size : .6em;} -P.tips { font-family : Verdana, Arial, Helvetica, sans-serif; - - font-size : .7em; - color : #333333;} -P.footer { font-family : Verdana, Arial, Helvetica, sans-serif; - - font-size : .7em; - color : #666666;} -P.trail { font-family : Verdana, Arial, Helvetica, sans-serif; - - font-size : .7em; - color : #666666;} - - -/* Anchor Properties */ - -A { font-family : Verdana, Arial, Helvetica, sans-serif; - - text-decoration : underline; - - font-weight : normal;} - - -A.global { color: #ffffff;text-decoration: none;font-weight:normal;} - -A:link.global { color: #ffffff;font-weight:normal;text-decoration: none;} - -A:visited.global { color: #ffffff;font-weight:normal;text-decoration: none;} -A:active.global { color: #ffffff;font-weight:normal;text-decoration: none;} - - - -A:hover.global { color: #ffffff;font-weight:normal;text-decoration: underline;} - - - - -A.promos { color: #000000;text-decoration: none;font-weight:normal;} - -A:link.promos { color: #000000;font-weight:normal;text-decoration: none;} - -A:visited.promos { color: #000000;font-weight:normal;text-decoration: none;} -A:active.promos { color: #000000;font-weight:normal;text-decoration: none;} - - - -A:hover.promos { color: #000000;font-weight:normal;text-decoration: none;} - - - - -A.footer { color: #666666;text-decoration: none;font-weight:normal;} - -A:link.footer { color: #666666;font-weight:normal;text-decoration: none;} - -A:visited.footer { color: #666666;font-weight:normal;text-decoration: none;} -A:active.footer { color: #666666;font-weight:normal;text-decoration: none;} - - - -A:hover.footer { color: #666666;font-weight:normal;text-decoration: underline;} - - - - -A.trail { color: #666666;text-decoration: none;font-weight:normal;} - -A:link.trail { color: #666666;font-weight:normal;text-decoration: none;} - -A:visited.trail { color: #666666;font-weight:normal;text-decoration: none;} -A:active.trail { color: #666666;font-weight:normal;text-decoration: none;} - - - -A:hover.trail { color: #666666;font-weight:normal;text-decoration: underline;} - - - - - - - -/* Table Properties */ - -TABLE { font-family : Verdana, Arial, Helvetica, sans-serif; - border : 0; - - margin-top : 0px; - - margin : 0px; - - padding : 0px; - - spacing : 0px - float : none; - - clear : none;} - -TABLE.banner { - border: 0px; - border-spacing: 0px; - padding: 0px; - width: 100%; -} - -TABLE.footer { - border-spacing: 0px; - padding: 5px; - width: 100%; -} - -TH { font-family : Verdana, Arial, Helvetica, sans-serif; - font-size : .7em; - - font-weight : bold; - text-align : left;} - - - -TH.item { font-family : Verdana, Arial, Helvetica, sans-serif; - font-size : .6em; - - font-weight : bold; - color : #666666; - text-align : left;} - -TH.cartitemleft { font-family : Verdana, Arial, Helvetica, sans-serif; - font-size : .6em; - - font-weight : bold; - color : #666666; - text-align : left; - background-color : #eeeecc; - white-space : nowrap;} - -TH.cartitemright { font-family : Verdana, Arial, Helvetica, sans-serif; - font-size : .6em; - - font-weight : bold; - color : #666666; - text-align : right; - background-color : #eeeecc; - white-space : nowrap;} - -TH.promos { font-family : Verdana, Arial, Helvetica, sans-serif; - font-size : .7em; - color: white; - font-weight : bold; - padding : 2px; - padding-left : 4px; - color : "#ffffff"; - text-align : left; - - background-color: #669966;} - - -TH.space { background-color: #ffffff; - padding : 0px;} - - -TD { font-family : Verdana, Arial, Helvetica, sans-serif;} - -TD.item { font-family : Verdana, Arial, Helvetica, sans-serif; - font-size : .6em; - - font-weight : normal; - color : #666666; - text-align : left;} - -TD.cartitemleft { font-family : Verdana, Arial, Helvetica, sans-serif; - font-size : .6em; - - font-weight : normal; - color : #666666; - text-align : left; - background-color : #ffffdd; - white-space : nowrap;} - -TD.cartitemright { font-family : Verdana, Arial, Helvetica, sans-serif; - font-size : .6em; - - font-weight : normal; - color : #666666; - text-align : right; - background-color : #ffffdd; - white-space : nowrap;} - -TD.promos { padding : 2px; - padding-left : 4px; - padding-bottom : 4px; - - background-color: #DCEBCD;} - -TD.trail { padding-left : 14px;} - - -TR.cartitem { background-color : #ffffdd;} -TH.cartitem { background-color : #eeeecc;} -TR.carttitle { font-size : 14pt; - font-family : Verdana, Arial, Helvetica, sans-serif; - margin-bottom : 0; - color : #669966;} -TR.cartsubtotal { background-color: #ffffdd; - font-weight: bold; - text-align: right; - align: right } - - -/* Text Formatting Properties */ - -STRONG { font-family : Verdana, Arial, Helvetica, sans-serif; - - font-weight : bold;} - - -TT { font-family : Courier;} - - -CENTER { text-align : center;} - -HR {width: 100%; color: black; height: 1px; shade:no-shade; position: relative} diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/theme/PlantMain_ns.css b/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/theme/PlantMain_ns.css deleted file mode 100755 index 70ddf157..00000000 --- a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/resources/theme/PlantMain_ns.css +++ /dev/null @@ -1,254 +0,0 @@ -/* -------------------------------- */ - -/* - * COPYRIGHT LICENSE: This information contains sample code provided in source code form. You may copy, - * modify, and distribute these sample programs in any form without payment to IBM for the purposes of - * developing, using, marketing or distributing application programs conforming to the application - * programming interface for the operating platform for which the sample code is written. - * Notwithstanding anything to the contrary, IBM PROVIDES THE SAMPLE SOURCE CODE ON AN "AS IS" BASIS - * AND IBM DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, ANY IMPLIED - * WARRANTIES OR CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A PARTICULAR PURPOSE, - * TITLE, AND ANY WARRANTY OR CONDITION OF NON-INFRINGEMENT. IBM SHALL NOT BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR OPERATION OF THE - * SAMPLE SOURCE CODE. IBM HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS - * OR MODIFICATIONS TO THE SAMPLE SOURCE CODE. - * - * (C) COPYRIGHT International Business Machines Corp., 2000,2011 - * All Rights Reserved * Licensed Materials - Property of IBM - */ - -/* -------------------------------- */ - - - -/* MAIN FRAME STYLE FOR HELP CONTENT: DO NOT use a class reference */ - -BODY { font-family : Arial, Helvetica, sans-serif;} - - - - - -/* Header Properties */ - -H1 { font-size : 14pt; - - font-family : Verdana, Arial, Helvetica, sans-serif; - - margin-bottom : 0; - color : #669966;} - -H2 { font-size : 15pt; - - font-family : Verdana, Arial, Helvetica, sans-serif; - - margin-bottom : 0; - color : #669966;} - -H3 { font-size : 12pt; - - font-family : Verdana, Arial, Helvetica, sans-serif; - - font-style : italic; - - margin-bottom : 0; - color : #669966;} - -H4 { font-size : 11pt; - - font-family : Verdana, Arial, Helvetica, sans-serif; - - margin-bottom : 0; - color : #669966;} - -H5 { font-size : 10pt; - - font-family : Verdana, Arial, Helvetica, sans-serif; - - font-style : italic; - - margin-bottom : 0; - color : #669966;} - - -/* Paragraph Properties */ - - -P { font-family : Verdana, Arial, Helvetica, sans-serif; - - margin-top : 0em; - - margin-bottom : 0; - font-size : .8em;} -P.global { font-family : Verdana, Arial, Helvetica, sans-serif; - - font-size : .6em; - margin-top : 4px; - - color : "#ffffff";} -P.search { font-family : Verdana, Arial, Helvetica, sans-serif; - - font-size : .6em;} -P.tips { font-family : Verdana, Arial, Helvetica, sans-serif; - - font-size : .7em; - color : #333333;} -P.footer { font-family : Verdana, Arial, Helvetica, sans-serif; - - font-size : .7em; - color : #666666;} -P.trail { font-family : Verdana, Arial, Helvetica, sans-serif; - - font-size : .7em; - color : #666666;} - - -/* Anchor Properties */ - -A { font-family : Verdana, Arial, Helvetica, sans-serif; - - text-decoration : underline; - - font-weight : normal;} - - -A.global { color: #ffffff;text-decoration: none;font-weight:normal;} - -A:link.global { color: #ffffff;font-weight:normal;text-decoration: none;} - -A:visited.global { color: #ffffff;font-weight:normal;text-decoration: none;} -A:active.global { color: #ffffff;font-weight:normal;text-decoration: none;} - - - -A:hover.global { color: #ffffff;font-weight:normal;text-decoration: underline;} - - - - -A.promos { color: #000000;text-decoration: none;font-weight:normal;} - -A:link.promos { color: #000000;font-weight:normal;text-decoration: none;} - -A:visited.promos { color: #000000;font-weight:normal;text-decoration: none;} -A:active.promos { color: #000000;font-weight:normal;text-decoration: none;} - - - -A:hover.promos { color: #000000;font-weight:normal;text-decoration: none;} - - - - -A.footer { color: #666666;text-decoration: none;font-weight:normal;} - -A:link.footer { color: #666666;font-weight:normal;text-decoration: none;} - -A:visited.footer { color: #666666;font-weight:normal;text-decoration: none;} -A:active.footer { color: #666666;font-weight:normal;text-decoration: none;} - - - -A:hover.footer { color: #666666;font-weight:normal;text-decoration: underline;} - - - - -A.trail { color: #666666;text-decoration: none;font-weight:normal;} - -A:link.trail { color: #666666;font-weight:normal;text-decoration: none;} - -A:visited.trail { color: #666666;font-weight:normal;text-decoration: none;} -A:active.trail { color: #666666;font-weight:normal;text-decoration: none;} - - - -A:hover.trail { color: #666666;font-weight:normal;text-decoration: underline;} - - - - - - - -/* Table Properties */ - -TABLE { font-family : Verdana, Arial, Helvetica, sans-serif; - border : 0; - - margin-top : 0px; - - margin : 0px; - - padding : 0px; - - spacing : 0px - float : none; - - clear : none;} - - -TH { font-family : Verdana, Arial, Helvetica, sans-serif; - font-size : .7em; - - font-weight : bold; - text-align : left;} - - - -TH.item { font-family : Verdana, Arial, Helvetica, sans-serif; - font-size : .6em; - - font-weight : bold; - color : #666666; - text-align : left;} - - - -TH.promos { font-family : Verdana, Arial, Helvetica, sans-serif; - font-size : .7em; - font-weight : bold; - padding : 2px; - padding-left : 4px; - color : #FFFFFF; - text-align : left; - background-color: #669966;} - - -TH.space { background-color: #ffffff; - padding : 0px;} - - -TD { font-family : Verdana, Arial, Helvetica, sans-serif;} - -TD.item { font-family : Verdana, Arial, Helvetica, sans-serif; - font-size : .6em; - - font-weight : normal; - color : #666666; - text-align : left;} - - -TD.promos { padding : 2px; - padding-left : 4px; - padding-bottom : 4px; - - background-color: #DCEBCD;} - -TD.trail { padding-left : 14px;} - -CAPTION { font-family : Verdana, Arial, Helvetica, sans-serif; - text-align : left;} - - -/* Text Formatting Properties */ - -STRONG { font-family : Verdana, Arial, Helvetica, sans-serif; - - font-weight : bold;} - - -TT { font-family : Courier;} - - -CENTER { text-align : center;} diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/shopping.xhtml b/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/shopping.xhtml deleted file mode 100755 index 0baa5912..00000000 --- a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/shopping.xhtml +++ /dev/null @@ -1,98 +0,0 @@ - - - - - - - - - - - - - - - - - -
    -

    - -

    -
    - - - - - -
    -

    - -

    -

    Page - 1 of 1

    -
    - - - - - - - -
    -

    - - - -

    -
    -
    -
    -
    - - - - - -
     

    Page - 1 of 1

    - - - - -
    -
    -
    -
    -
    - \ No newline at end of file diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/supplierconfig.jsp b/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/supplierconfig.jsp deleted file mode 100755 index 3ee5ee6b..00000000 --- a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/supplierconfig.jsp +++ /dev/null @@ -1,291 +0,0 @@ - - - - -<%@ page language="java" contentType="text/html; charset=ISO-8859-1" - pageEncoding="ISO-8859-1"%> - - - - -Supplier Configuration - - - - - - - - - <%@page - import="com.ibm.websphere.samples.pbw.jpa.Supplier,,com.ibm.websphere.samples.pbw.utils.Util,java.util.*" - session="true" isThreadSafe="true" isErrorPage="false"%> - <% - com.ibm.websphere.samples.pbw.jpa.Supplier supplierInfo = (com.ibm.websphere.samples.pbw.jpa.Supplier) session - .getAttribute(com.ibm.websphere.samples.pbw.utils.Util.ATTR_SUPPLIER); - String id = ""; - String name = ""; - String street = ""; - String city = ""; - String state = ""; - String zip = ""; - String phone = ""; - String url = ""; - if (supplierInfo != null) { - id = supplierInfo.getSupplierID(); - name = supplierInfo.getName(); - street = supplierInfo.getStreet(); - city = supplierInfo.getCity(); - state = supplierInfo.getUsstate(); - zip = supplierInfo.getZip(); - phone = supplierInfo.getPhone(); - url = supplierInfo.getUrl(); - } - %> - - - - - - - - - - -
    -

    - Admin - Home -

    -
    - - - - - - - - -
    -

    Supplier Configuration

    -

    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Enter the Supplier's Configuration Information
    -

    - -

    -
    -

    - -

    -
    -

    - -

    -
    -

    - -

    -
    -

    - -

    -
    -

    - -

    -
    -

    - -

    -
    -

    - -

    -
    -

    - -

    -
    -

    - -

    -
    -

    - -

    -
    -

    - -

    -
    -

    - -

    -
    -

    - -

    -
    - -
    -
    - - - - - - -
    -

    -
    -

    - - - - - - - -
    Powered by WebSphere - -
    - - diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/theme/stylesheet.css b/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/theme/stylesheet.css deleted file mode 100755 index fb54e566..00000000 --- a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/theme/stylesheet.css +++ /dev/null @@ -1,187 +0,0 @@ -/* - * COPYRIGHT LICENSE: This information contains sample code provided in source code form. You may copy, - * modify, and distribute these sample programs in any form without payment to IBM for the purposes of - * developing, using, marketing or distributing application programs conforming to the application - * programming interface for the operating platform for which the sample code is written. - * Notwithstanding anything to the contrary, IBM PROVIDES THE SAMPLE SOURCE CODE ON AN "AS IS" BASIS - * AND IBM DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, ANY IMPLIED - * WARRANTIES OR CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A PARTICULAR PURPOSE, - * TITLE, AND ANY WARRANTY OR CONDITION OF NON-INFRINGEMENT. IBM SHALL NOT BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR OPERATION OF THE - * SAMPLE SOURCE CODE. IBM HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS - * OR MODIFICATIONS TO THE SAMPLE SOURCE CODE. - * - * (C) COPYRIGHT International Business Machines Corp., 2000,2011 - * All Rights Reserved * Licensed Materials - Property of IBM - */ - - /******************************** - * Faces Components Stylesheet * - ********************************/ - -.form { -} - -.commandLink { -} - -.outputLink { -} - -.link { -} - -.graphicImage { -} - -.outputLabel { -} - -.inputText { -} - -.inputText_Error { - border-style: solid; - border-color: #DE5C5C; -} - -.inputTextarea { -} - -.inputSecret { -} - -.inputHidden { -} - -.outputText { -} - -.outputFormat { -} - -.commandButton { -} - -.button { -} - -.message { -} - -.messages { -} - -.selectBooleanCheckbox { -} - -.selectBooleanCheckbox_Error { -} - -.selectOneRadio { -} - -.selectOneRadio_Error { -} - -.selectOneRadio_Disabled { - color: GrayText; -} - -.selectManyCheckbox { -} - -.selectManyCheckbox_Error { -} - -.selectManyCheckbox_Disabled { - color: GrayText; -} - -.selectOneListbox { -} - -.selectOneListbox_Error { -} - -.selectManyListbox { -} - -.selectManyListbox_Error { -} - -.selectOneMenu { -} - -.selectOneMenu_Error { -} - -.selectManyMenu { -} - -.selectManyMenu_Error { -} - -.panelGroup { -} - -.panelGrid { -} - -.dataTable { - empty-cells:show; -} - -.headerClass { - background-color: ThreeDFace; - color: WindowText; - border-width: 1px; - border-style: solid; - border-color: ThreeDShadow; - margin:2px; - padding:0px; - padding-left:4pt; - padding-right:4pt; - padding-bottom:2px; - font-weight: 400; - overflow: -moz-scrollbars-none; -} - -.footerClass { - background-color: ThreeDFace; - color: WindowText; - border-width: 0px; - border-style: none; - padding:0px; - padding-left:4pt; - padding-right:4pt; - font-weight: 400; - overflow: -moz-scrollbars-none; -} - -.rowClass1 { - background-color: window; -} - -.rowClass2 { - background-color: ThreeDFace; -} - -.columnClass1 { - background-color: window; - margin:2px; - padding:0px; - padding-left:4pt; - padding-right:4pt; - padding-bottom:2px; - overflow: -moz-scrollbars-none; -} - -.columnClass2 { - background-color: ThreeDFace; - margin:2px; - padding:0px; - padding-left:4pt; - padding-right:4pt; - padding-bottom:2px; -} diff --git a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/viewExpired.xhtml b/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/viewExpired.xhtml deleted file mode 100755 index 8cb4cec3..00000000 --- a/src/test/resources/test-applications/plantsbywebsphere/src/main/webapp/viewExpired.xhtml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - Your shopping session has expired due to inactivity. Your shopping cart and all items in it has been lost. You may continue - to shop. Any new items placed in your shopping cart will be remembered. - - - \ No newline at end of file diff --git a/src/test/resources/test-applications/record-class-test/.gitattributes b/src/test/resources/test-applications/record-class-test/.gitattributes deleted file mode 100644 index f91f6460..00000000 --- a/src/test/resources/test-applications/record-class-test/.gitattributes +++ /dev/null @@ -1,12 +0,0 @@ -# -# https://help.github.com/articles/dealing-with-line-endings/ -# -# Linux start script should use lf -/gradlew text eol=lf - -# These are Windows script files and should use crlf -*.bat text eol=crlf - -# Binary files should be left untouched -*.jar binary - diff --git a/src/test/resources/test-applications/record-class-test/.gitignore b/src/test/resources/test-applications/record-class-test/.gitignore deleted file mode 100644 index 1b6985c0..00000000 --- a/src/test/resources/test-applications/record-class-test/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -# Ignore Gradle project-specific cache directory -.gradle - -# Ignore Gradle build output directory -build diff --git a/src/test/resources/test-applications/record-class-test/app/build.gradle.kts b/src/test/resources/test-applications/record-class-test/app/build.gradle.kts deleted file mode 100644 index 1a71397d..00000000 --- a/src/test/resources/test-applications/record-class-test/app/build.gradle.kts +++ /dev/null @@ -1,44 +0,0 @@ -/* - * This file was generated by the Gradle 'init' task. - * - * This generated file contains a sample Java application project to get you started. - * For more details on building Java & JVM projects, please refer to https://docs.gradle.org/8.12.1/userguide/building_java_projects.html in the Gradle documentation. - * This project uses @Incubating APIs which are subject to change. - */ - -plugins { - // Apply the application plugin to add support for building a CLI application in Java. - application -} - -repositories { - // Use Maven Central for resolving dependencies. - mavenCentral() -} - -dependencies { - // This dependency is used by the application. - implementation(libs.guava) -} - -testing { - suites { - // Configure the built-in test suite - val test by getting(JvmTestSuite::class) { - // Use JUnit Jupiter test framework - useJUnitJupiter("5.11.1") - } - } -} - -// Apply a specific Java toolchain to ease working on different environments. -java { - toolchain { - languageVersion = JavaLanguageVersion.of(17) - } -} - -application { - // Define the main class for the application. - mainClass = "org.example.App" -} diff --git a/src/test/resources/test-applications/record-class-test/app/src/main/java/org/example/App.java b/src/test/resources/test-applications/record-class-test/app/src/main/java/org/example/App.java deleted file mode 100644 index 7f59c338..00000000 --- a/src/test/resources/test-applications/record-class-test/app/src/main/java/org/example/App.java +++ /dev/null @@ -1,19 +0,0 @@ -/* - * This source file was generated by the Gradle 'init' task - */ -package org.example; - -public class App { - public static void main(String[] args) { - // Create instances of records - PersonRecord person = new PersonRecord("Alice", 30); - CarRecord car = new CarRecord("Tesla Model 3", 2023); - // Access public fields and methods - System.out.println(person.greet()); - System.out.println(car.getCarDetails()); - - // Access package-private method (allowed within the same package) - System.out.println("Person Internal Info: " + person.internalInfo()); - System.out.println("Car Internal VIN: " + car.getInternalVIN()); - } -} diff --git a/src/test/resources/test-applications/record-class-test/app/src/main/java/org/example/CarRecord.java b/src/test/resources/test-applications/record-class-test/app/src/main/java/org/example/CarRecord.java deleted file mode 100644 index 4db09d81..00000000 --- a/src/test/resources/test-applications/record-class-test/app/src/main/java/org/example/CarRecord.java +++ /dev/null @@ -1,19 +0,0 @@ -package org.example; - -public record CarRecord(String model, int year) { - - // Public method - public String getCarDetails() { - return "Car: " + model + " (Year: " + year + ")"; - } - - // Private method - private String internalVIN() { - return "VIN-123456"; - } - - // Package-private method - String getInternalVIN() { - return internalVIN(); - } -} diff --git a/src/test/resources/test-applications/record-class-test/app/src/main/java/org/example/PersonRecord.java b/src/test/resources/test-applications/record-class-test/app/src/main/java/org/example/PersonRecord.java deleted file mode 100644 index 278bb073..00000000 --- a/src/test/resources/test-applications/record-class-test/app/src/main/java/org/example/PersonRecord.java +++ /dev/null @@ -1,31 +0,0 @@ -package org.example; - -public record PersonRecord(String name, int age) { - - public PersonRecord { - // Constructor logic - if (name == null || name.isBlank()) { - name = "Unknown"; - } - if (age < 18) { - age = 18; - } - } - // Private field (Not directly possible in records, but can be mimicked with private static) - private static String secretIdentity = "Unknown"; - - // Public method - public String greet() { - return "Hello, my name is " + name + " and I am " + age + " years old."; - } - - // Private method (only accessible within this record) - private String getSecretIdentity() { - return secretIdentity; - } - - // Protected method (Not valid in records, using package-private as an alternative) - String internalInfo() { - return "Internal ID: " + hashCode(); - } -} diff --git a/src/test/resources/test-applications/record-class-test/app/src/test/java/org/example/AppTest.java b/src/test/resources/test-applications/record-class-test/app/src/test/java/org/example/AppTest.java deleted file mode 100644 index 3e45d032..00000000 --- a/src/test/resources/test-applications/record-class-test/app/src/test/java/org/example/AppTest.java +++ /dev/null @@ -1,15 +0,0 @@ -/* - * This source file was generated by the Gradle 'init' task - */ -package org.example; - -import static org.junit.jupiter.api.Assertions.*; - -import org.junit.jupiter.api.Test; - -class AppTest { - @Test void appHasAGreeting() { - App classUnderTest = new App(); - assertNotNull(classUnderTest.getGreeting(), "app should have a greeting"); - } -} diff --git a/src/test/resources/test-applications/record-class-test/gradle.properties b/src/test/resources/test-applications/record-class-test/gradle.properties deleted file mode 100644 index 51540088..00000000 --- a/src/test/resources/test-applications/record-class-test/gradle.properties +++ /dev/null @@ -1,7 +0,0 @@ -# This file was generated by the Gradle 'init' task. -# https://docs.gradle.org/current/userguide/build_environment.html#sec:gradle_configuration_properties - -org.gradle.configuration-cache=true -org.gradle.parallel=true -org.gradle.caching=true - diff --git a/src/test/resources/test-applications/record-class-test/gradle/libs.versions.toml b/src/test/resources/test-applications/record-class-test/gradle/libs.versions.toml deleted file mode 100644 index baed7db0..00000000 --- a/src/test/resources/test-applications/record-class-test/gradle/libs.versions.toml +++ /dev/null @@ -1,8 +0,0 @@ -# This file was generated by the Gradle 'init' task. -# https://docs.gradle.org/current/userguide/platforms.html#sub::toml-dependencies-format - -[versions] -guava = "33.3.1-jre" - -[libraries] -guava = { module = "com.google.guava:guava", version.ref = "guava" } diff --git a/src/test/resources/test-applications/record-class-test/gradle/wrapper/gradle-wrapper.jar b/src/test/resources/test-applications/record-class-test/gradle/wrapper/gradle-wrapper.jar deleted file mode 100644 index a4b76b95..00000000 Binary files a/src/test/resources/test-applications/record-class-test/gradle/wrapper/gradle-wrapper.jar and /dev/null differ diff --git a/src/test/resources/test-applications/record-class-test/gradle/wrapper/gradle-wrapper.properties b/src/test/resources/test-applications/record-class-test/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index e18bc253..00000000 --- a/src/test/resources/test-applications/record-class-test/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,7 +0,0 @@ -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.12.1-bin.zip -networkTimeout=10000 -validateDistributionUrl=true -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists diff --git a/src/test/resources/test-applications/record-class-test/gradlew b/src/test/resources/test-applications/record-class-test/gradlew deleted file mode 100755 index f3b75f3b..00000000 --- a/src/test/resources/test-applications/record-class-test/gradlew +++ /dev/null @@ -1,251 +0,0 @@ -#!/bin/sh - -# -# Copyright © 2015-2021 the original authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# SPDX-License-Identifier: Apache-2.0 -# - -############################################################################## -# -# Gradle start up script for POSIX generated by Gradle. -# -# Important for running: -# -# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is -# noncompliant, but you have some other compliant shell such as ksh or -# bash, then to run this script, type that shell name before the whole -# command line, like: -# -# ksh Gradle -# -# Busybox and similar reduced shells will NOT work, because this script -# requires all of these POSIX shell features: -# * functions; -# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», -# «${var#prefix}», «${var%suffix}», and «$( cmd )»; -# * compound commands having a testable exit status, especially «case»; -# * various built-in commands including «command», «set», and «ulimit». -# -# Important for patching: -# -# (2) This script targets any POSIX shell, so it avoids extensions provided -# by Bash, Ksh, etc; in particular arrays are avoided. -# -# The "traditional" practice of packing multiple parameters into a -# space-separated string is a well documented source of bugs and security -# problems, so this is (mostly) avoided, by progressively accumulating -# options in "$@", and eventually passing that to Java. -# -# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, -# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; -# see the in-line comments for details. -# -# There are tweaks for specific operating systems such as AIX, CygWin, -# Darwin, MinGW, and NonStop. -# -# (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt -# within the Gradle project. -# -# You can find Gradle at https://github.com/gradle/gradle/. -# -############################################################################## - -# Attempt to set APP_HOME - -# Resolve links: $0 may be a link -app_path=$0 - -# Need this for daisy-chained symlinks. -while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] -do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac -done - -# This is normally unused -# shellcheck disable=SC2034 -APP_BASE_NAME=${0##*/} -# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) -APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit - -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD=maximum - -warn () { - echo "$*" -} >&2 - -die () { - echo - echo "$*" - echo - exit 1 -} >&2 - -# OS specific support (must be 'true' or 'false'). -cygwin=false -msys=false -darwin=false -nonstop=false -case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; -esac - -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar - - -# Determine the Java command to use to start the JVM. -if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -else - JAVACMD=java - if ! command -v java >/dev/null 2>&1 - then - die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -fi - -# Increase the maximum file descriptors if we can. -if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC2039,SC3045 - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC2039,SC3045 - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac -fi - -# Collect all arguments for the java command, stacking in reverse order: -# * args from the command line -# * the main class name -# * -classpath -# * -D...appname settings -# * --module-path (only if needed) -# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. - -# For Cygwin or MSYS, switch paths to Windows format before running java -if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - - JAVACMD=$( cygpath --unix "$JAVACMD" ) - - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done -fi - - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' - -# Collect all arguments for the java command: -# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, -# and any embedded shellness will be escaped. -# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be -# treated as '${Hostname}' itself on the command line. - -set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" - -# Stop when "xargs" is not available. -if ! command -v xargs >/dev/null 2>&1 -then - die "xargs is not available" -fi - -# Use "xargs" to parse quoted args. -# -# With -n1 it outputs one arg per line, with the quotes and backslashes removed. -# -# In Bash we could simply go: -# -# readarray ARGS < <( xargs -n1 <<<"$var" ) && -# set -- "${ARGS[@]}" "$@" -# -# but POSIX shell has neither arrays nor command substitution, so instead we -# post-process each arg (as a line of input to sed) to backslash-escape any -# character that might be a shell metacharacter, then use eval to reverse -# that process (while maintaining the separation between arguments), and wrap -# the whole thing up as a single "set" statement. -# -# This will of course break if any of these variables contains a newline or -# an unmatched quote. -# - -eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' - -exec "$JAVACMD" "$@" diff --git a/src/test/resources/test-applications/record-class-test/gradlew.bat b/src/test/resources/test-applications/record-class-test/gradlew.bat deleted file mode 100644 index 9d21a218..00000000 --- a/src/test/resources/test-applications/record-class-test/gradlew.bat +++ /dev/null @@ -1,94 +0,0 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem -@rem SPDX-License-Identifier: Apache-2.0 -@rem - -@if "%DEBUG%"=="" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -set DIRNAME=%~dp0 -if "%DIRNAME%"=="" set DIRNAME=. -@rem This is normally unused -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if %ERRORLEVEL% equ 0 goto execute - -echo. 1>&2 -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 -echo. 1>&2 -echo Please set the JAVA_HOME variable in your environment to match the 1>&2 -echo location of your Java installation. 1>&2 - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto execute - -echo. 1>&2 -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 -echo. 1>&2 -echo Please set the JAVA_HOME variable in your environment to match the 1>&2 -echo location of your Java installation. 1>&2 - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* - -:end -@rem End local scope for the variables with windows NT shell -if %ERRORLEVEL% equ 0 goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -set EXIT_CODE=%ERRORLEVEL% -if %EXIT_CODE% equ 0 set EXIT_CODE=1 -if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% -exit /b %EXIT_CODE% - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega diff --git a/src/test/resources/test-applications/record-class-test/settings.gradle.kts b/src/test/resources/test-applications/record-class-test/settings.gradle.kts deleted file mode 100644 index c99b9d1a..00000000 --- a/src/test/resources/test-applications/record-class-test/settings.gradle.kts +++ /dev/null @@ -1,15 +0,0 @@ -/* - * This file was generated by the Gradle 'init' task. - * - * The settings file is used to specify which projects to include in your build. - * For more detailed information on multi-project builds, please refer to https://docs.gradle.org/8.12.1/userguide/multi_project_builds.html in the Gradle documentation. - * This project uses @Incubating APIs which are subject to change. - */ - -plugins { - // Apply the foojay-resolver plugin to allow automatic download of JDKs - id("org.gradle.toolchains.foojay-resolver-convention") version "0.8.0" -} - -rootProject.name = "record-class-test" -include("app") diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 00000000..8bf91d3b --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,5 @@ +{ + "extends": "astro/tsconfigs/strict", + "include": [".astro/types.d.ts", "**/*"], + "exclude": ["dist"] +}