# Repository Overview

Welcome to this Java project. This repository is a small example codebase built around order processing logic, paired with a variety of test classes written in different styles — JUnit 3, JUnit 4, and TestNG. It appears to be set up as a test harness or demonstration project, possibly for evaluating static analysis, test detection, or code quality tooling. This document will help you find your way around.

## Overview

This project is a minimal Java application centered on an `OrderService` class, supplemented by numerous test and utility classes spread across several directories. The presence of files like `RogueTestAnnotated`, `UnannotatedInTest`, and `ImportOnlyTest` suggests this may serve as a training or benchmark dataset for static analysis tools that need to distinguish real tests from near-misses — classes that look like tests but shouldn't be classified as such.

## Technology Stack

- **Language:** Java
- **Test frameworks referenced:** JUnit 3 (`TestCase`), JUnit 4 (`@Test` annotation), TestNG (`org.testng.annotations.Test`)
- **No well-known frameworks** were detected from import analysis beyond standard JUnit/TestNG testing libraries.

## Architecture

This repository is organized into four top-level directories, each serving a different purpose:

```mermaid
flowchart TD
    Main["src/main
Main source"]
    Test["src/test
Test source"]
    Utils["src/utils
Utilities"]
    Standalone["standalone
Standalone tests"]

    Main --> OrderService["OrderService"]
    Main --> TestHelper["TestHelper"]
    Main --> LegacyTest["LegacyTest
JUnit 3 style"]
    Main --> RogueTestAnnotated["RogueTestAnnotated
JUnit 4 in main"]
    Main --> TestNGTest["TestNGTest
TestNG in main"]
    Test --> OrderServiceTest["OrderServiceTest
JUnit 4"]
    Test --> UnannotatedInTest["UnannotatedInTest
No annotations"]
    Utils --> ImportOnlyTest["ImportOnlyTest
JUnit import only"]
    Standalone --> OrderServiceTestStandalone["OrderServiceTestStandalone
JUnit 4 standalone"]
```

The core production code lives in `src/main/java/com/example/`, with `OrderService` as the primary business class. `TestHelper` is a utility class in the same package. Several other classes in `src/main` are test classes — this appears intentional, likely to test detection heuristics.

The test directory `src/test/java/com/example/` follows the conventional Maven layout, housing `OrderServiceTest` (a JUnit 4 test) and `UnannotatedInTest` (a class with test-like methods but no annotations).

Two additional directories hold special cases: `src/utils/` contains a class that imports JUnit annotations but defines no test methods, and `standalone/` contains a standalone JUnit 4 test class outside the standard source tree.

## Module Guide

### src/main — Main source code

This is the primary source directory containing the application's core classes:

- **OrderService** — The central business class, providing a `run()` method. This is the only class that appears to be production code rather than a test.
- **TestHelper** — A minimal helper class with no methods or fields. Likely a utility stub.
- **LegacyTest** — A JUnit 3–style test class extending `TestCase`. It is placed in `main` rather than `test`, which is atypical.
- **RogueTestAnnotated** — A JUnit 4–style annotated test class (`@Test`) living in the main source tree. Its name suggests it is used as an edge case for test detection logic.
- **TestNGTest** — A class using TestNG's `@Test` annotation, also placed in the main source tree.

### src/test — Standard test source

This directory follows the conventional Maven test layout:

- **OrderServiceTest** — A JUnit 4 test class with an annotated test method, likely intended to test the `OrderService`.
- **UnannotatedInTest** — A class placed in the test directory that has no JUnit/TestNG annotations. Its methods look test-like but it would not be discovered by standard test runners.

### src/utils — Utility classes

- **ImportOnlyTest** — A class that imports JUnit's `@Test` annotation but defines no test methods. This is a near-miss case for test detection.

### standalone — Standalone test artifacts

- **OrderServiceTestStandalone** — A self-contained JUnit 4 test class living outside the standard source tree, likely used to test classpath or scanner discovery.

## Getting Started

If you are new to this codebase, here is a recommended reading order:

1. **Start with `OrderService`** (`src/main/java/com/example/OrderService.java`) — it is the only production class and gives you a sense of the domain.
2. **Read `TestHelper`** (`src/main/java/com/example/TestHelper.java`) — a minimal class that helps orient you to the coding style.
3. **Explore the test classes in `src/test/`** — `OrderServiceTest` and `UnannotatedInTest` show how tests are structured here and how the codebase handles both annotated and unannotated test-like classes.
4. **Review the special cases** — `RogueTestAnnotated`, `TestNGTest`, `ImportOnlyTest`, and `OrderServiceTestStandalone` illustrate edge cases for test detection (Junit in main, TestNG, import-only, and standalone).
5. **Check `LegacyTest`** — the JUnit 3–style class provides context on legacy patterns.

This project appears intentionally minimal, so reading all nine files top to bottom will give you complete familiarity with the entire codebase.
