AREX auto-instrumentation for Java.

Overview

Arex Icon AREX

An Open Source Testing Framework with Real World Data

Introduction

As your application evolves more complex, the effort required to thoroughly test against it also becomes tremendous. Arex is a framework designed around a quite straightforward principle of leveraging your real world data(i.e. database record, service payload, cache items etc.) for regression testing. Simple is powerful. The idea behind makes it incredibly powerful.

Arex provides an out-of-box agent file that could be attached to any applications with Java 8+ and dynamically weaves solid bytecode into your existing code to record the real data of live traffic, and further use and replay it for mocking, testing, and debugging purpose.

Arex is implemented with an unique mechanism for recording. Instead of being a proxy like other similar framework, Arex sits in the background without awareness of your application to record realistic data in live traffic which means that no intrusive code changes are required when integrating it to your existing application.

Arex utilizes the advanced Java technique, Instrument API, and is capable of instrumenting various libraries and frameworks which are widely used.

Libraries and frameworks supported by Arex (to be added...)

  • Java Executors
  • Apache HttpAsyncClient 4.x
  • Apache HttpClient 4.x
  • Hibernate 5.x
  • MyBatis 3.x
  • Spring Boot 1.4+-2.x+, Servlet API 3+

Installation

Simply download the latest binary from github or compile it by yourself.
There are two agent files provided in the arex-agent-jar folder like below. They must be placed in the same directory.

arex-agent-<version>.jar
arex-agent-bootstrap-<version>.jar

Getting Started

You can get arex started by:

Enable the instrumentation agent by configuring a javaagent flag to the JVM to run arex in local mode:

 java -javaagent:/path/to/arex-agent-<version>.jar
      -Darex.service.name=your-service-name (should be unique)
      -Darex.storge.model=local
      -jar your-application.jar

By default, Arex uses H2 as a local storage to save the recorded data for testing purpose.

Run with CLI

Simply click the script in the arex-agent-java/bin directory to start the command line tool, or run it by following java command

java -cp "/path/to/arex-cli-parent/arex-cli/target/arex-cli.jar" io.arex.cli.ArexCli

The supported commands are as follows:

  • record- choose a running application and start recording live traffic
  • replay- replay recorded data and view differences
    [option: -n/--num] replay numbers, default the latest 10
  • watch- view replay result and differences
    [option: -r/--replayId] replay id, multiple are separated by spaces
  • debug- local debugging of specific cases
    [option: -r/--recordId] record id, required Option

AREX agent works along with the AREX config service and the AREX storage service. You could just configure the host and port of them respectively, like below

java -javaagent:/path/to/arex-agent-<version>.jar
     -Darex.service.name=your-service-name
     -Darex.storage.service.host=[storage.service.host:port](storage.service.host:port) 
     -Darex.config.service.host=[config.service.host:port](config.service.host:port)
     -jar your-application.jar

Alternatively, you can put those configuration item in arex.agent.conf file, like below

arex.service.name=your-service-name  
arex.storage.service.host=<storage.service.host:port> 
arex.config.service.host=<config.service.host:port> 

Then simply run:

java -javaagent:/path/to/arex-agent-<version>.jar
     -Darex.config.path=/path/to/arex.agent.conf
     -jar your-application.jar

Contributing

  1. Fork it
  2. Create your feature branch
  3. Commit your code changes and push to your feature branch
  4. Create a new Pull Request

License

You might also like...

Changelog-java-version - Eine Auflistung der Änderungen in Java aus Sicht eines Entwicklers.

Changelog Java Versions Eine Auflistung der Änderungen in Java aus Sicht eines Entwicklers. Inhaltsverzeichnis Zugehörige Präsentation Homepage des Au

Jan 4, 2022

Bank Statement Analyzer Application that currently runs in terminal with the commands: javac Application.java java Application [file-name].csv GUI coming soon...

Bank Statement Analyzer Application that currently runs in terminal with the commands: javac Application.java java Application [file-name].csv GUI coming soon...

May 21, 2022

Library for converting from one Java class to a dissimilar Java class with similar names based on the Bean convention

Library for converting from one Java class to a dissimilar Java class with similar names based on the Bean convention

Beanmapper Beanmapper is a Java library for mapping dissimilar Java classes with similar names. The use cases for Beanmapper are the following: mappin

Nov 15, 2022

Free and 100% open source Progressive Java Runtime for modern Java™ deployments supported by a leading OpenJDK contributor

BellSoft Liberica JDK is a build of OpenJDK that is tested and verified to be compliant with the Java SE specification using OpenJDK Technology Compat

Dec 22, 2022

ActiveJ is an alternative Java platform built from the ground up. ActiveJ redefines web, high load, and cloud programming in Java, featuring ultimate performance and scalability!

Introduction ActiveJ is a full-featured modern Java platform, created from the ground up as an alternative to Spring/Micronauts/Netty/Jetty. It is des

Jan 7, 2023

Short Java programs for practice (OCP) Oracle Certified Professional Java SE 11

OCP-study Short Java programs to practice for (OCP) Oracle Certified Professional Java SE 11 Exam Google document with notes: https://docs.google.com/

May 24, 2022

Professional Java Developer Career Starter: Java Foundations Course Exercise Solutions

java-foundations-solutions Professional Java Developer Career Starter: Java Foundations Course Exercise Solutions The solutions are generally to be fo

Dec 28, 2022

Team 5468's 2022 FRC robot code. This code is written in Java and is based off of WPILib's Java control system and utilizes a command based system

FRC 2022 Team 5468's 2022 FRC robot code. This code is written in Java and is based off of WPILib's Java control system and utilizes a command based s

Oct 4, 2022

ijrd - internal java runtime debugger (loads through java agents LOL)

ijrd ijrd - internal java runtime debugger (loads through java agents LOL) this actually requires brain to build and then setup little guide to setup

Jan 28, 2022
Comments
  • 2022 Q2 Roadmap

    2022 Q2 Roadmap

    Version: 0.5

    • [x] Instrumentation: jedis2
    • [x] Instrumentation: redission
    • [x] Instrumentation: lettuce
    • [x] Instrumentation: okhttp 2/3
    • [x] Instrumentation: dynamic type
    • [ ] Instrumentation: gRPC (low priority)
    • [x] Instrumentation: Servlet3, Servlet5
    • [x] Instrumentation: Time machine (low priority)
    • [x] Framework: Ignore
    • [ ] CLI: Config
    enhancement :star: waiting-for-triage :mag: 
    opened by mengqcc 3
  • fix: record servlet request full url

    fix: record servlet request full url

    FUll URL example: http://localhost:8080/commutity/httpClientTest/okHttp?k1=v1&k2=v2

    The URL required for replay is /commutity/httpClientTest/okHttp?k1=v1&k2=v2, need to contain queryString

    request.getContextPath() -> /commutity request.getServletPath() -> /httpClientTest/okHttp request.getRequestURI() -> /commutity/httpClientTest/okHttp request.getQueryString() -> k1=v1&k2=v2

    bug :lady_beetle: 
    opened by mr3 2
  • refactor: modules change class loader

    refactor: modules change class loader

    • arex-agent(AppClassLoader)
    • arex-agent-bootstrap (BootstrapClassLoader)
    • arex-agent-core (AgentClassLoader)
    • arex-instrumentation (UserClassLoader)
      • XXX Instrumentation & Module & Advice (AgentClassLoader)
    • arex-instrumentation-api
      • extension (AgentClassLoader)
      • runtime (AppClassLoader)
    • arex-instrumentation-foundation (AgentClassLoader), backend
    refactoring :hammer: 
    opened by mr3 2
  • fix: httpclient header serialization

    fix: httpclient header serialization

    When starting with Tomcat, StringTuple is loaded by ParallelWebappClassLoader, JacksonSerializer is loaded by AppClassLoader, so @JsonProperty("f") is invalid, I gonna fix with this temporary solution.

    bug :lady_beetle: 
    opened by mr3 2
Releases(v0.1.0)
  • v0.1.0(Aug 29, 2022)

    :star: New Features

    Libraries and frameworks supported by Arex (to be added...)

    • Java Executors
    • System time
    • Apache HttpAsyncClient 4.x
    • Apache HttpClient 4.x
    • OkHttp 3+ #18
    • Hibernate 5.x
    • MyBatis 3.x
    • Redisson 3.x #19
    • Lettuce 6+ #11
    • Jedis 2.10+, 4+ #3 #4 #16
    • Spring Boot 1.4+-2.x+, Servlet API 3+、5+ #9
    • Custom type #12
    • Netty server 4.1+ #20

    :lady_beetle: Bug fixes

    • fix: class not found #40
    • fix: loadClass advice for support multiple versions of JDK #10
    • fix: change servlet headers type to string #39
    • fix: arex-cli.sh start failed #34
    • fix: build failure with oracle jdk #33

    :blue_book: Documentation

    • Update README.md #8
    • Update readme and remove some unused code #2

    ⚙️ Testing

    • feat: add arex-cli-parent module unit test #36
    • feat: add Codecov and jacoco for UT coverage #37
    Source code(tar.gz)
    Source code(zip)
Owner
ArexTest
An Open Source Testing Framework with Real World Data
ArexTest
Auto-Unit-Test-Case-Generator automatically generates high-level code-coverage JUnit test suites for Java, widely used within the ANT Group.

中文README传送门 What is Auto-Unit-Test-Case-Generator Auto-Unit-Test-Case-Generator generates JUnit test suites for Java class just as its name. During te

TRaaS 108 Dec 22, 2022
这是一个自动化的托管系统,目前支持网易云,bilibili,米游社原神签到,测试地址https://auto.oldwu.top

AutoPlan_Helper 这是一个自动化的托管系统,目前支持网易云签到刷歌,bilibili,米游社原神签到 目前项目属于测试阶段,可能会有些莫名其妙的bug,敬请谅解 如果觉得好用,点个star吧 开源地址 wyt1215819315 / autoplan 目前已经实现 b站每日自动经验任务

null 501 Jan 1, 2023
A spring cloud infrastructure provides various of commonly used cloud components and auto-configurations for high project consistency

A spring cloud infrastructure provides various of commonly used cloud components and auto-configurations for high project consistency.

Project-Hephaestus 2 Feb 8, 2022
Photo live wallpaper with auto dark mode and power-efficient animations

Pallax Android: Photo Live Wallpaper Pallax Android is an Android app that lets you convert your current static home screen background into a stunning

Patrick Zedler 13 Dec 17, 2022
OpenAPI JSON Schema Generator allows auto-generation of API client libraries with a focus on JSON schema given an OpenAPI Spec

OpenAPI JSON Schema Generator IMPORTANT: before the first release, one will need to build the project locally to use the enhancements, bug fixes in th

OpenAPI Tools 5 Dec 31, 2022
"Some" Utilities you can use for your Java projects "freely"! Files are compiled with Java-8 and above, but mostly Java-11.

✨ Java-SomeUtils ?? "Some" Utilities you can use for your Java projects "freely"! *"Freely"* forcing you to include the license into your program. Fil

JumperBot_ 2 Jan 6, 2023
Java-Programs---For-Practice is one of the Java Programming Practice Series By Shaikh Minhaj ( minhaj-313 ). This Series will help you to level up your Programming Skills. This Java Programs are very much helpful for Beginners.

Java-Programs---For-Practice is one of the Java Programming Practice Series By Shaikh Minhaj ( minhaj-313 ). This Series will help you to level up your Programming Skills. This Java Programs are very much helpful for Beginners. If You Have any doubt or query you can ask me here or you can also ask me on My LinkedIn Profile

Shaikh Minhaj 3 Nov 8, 2022
(Java & React) Yazılım Geliştirici Yetiştirme Kampı Java kısmına ait yazılan kaynak kodlar ve ödev çalışmalarım.

JavaCamp Kamp sürecinde yazılan kaynak kodlar ve ödev çalışmalarım. Day 1 1)Intro Day 2 2)oopIntro 2.1)oopIntro ~ Homework Day 3 3)oopIntro2 3.1)inher

Melih Çelik 17 Jun 26, 2022
☁ Tencent Cloud IM Server SDK in Java | 腾讯云 IM 服务端 SDK Java 版

Tencent Cloud IM Server SDK in Java The Tencent Cloud IM Server SDK for Java enables Java developers to easily work with Tencent Cloud IM. Requirement

Doocs 64 Dec 23, 2022
Trust-java - Test Results Verification library for Java

TRUST - Test Results Verification library for Java The TRUST's primary goal is to provide the simple way of different test results verification. Gener

Serhii Shymkiv 2 Nov 19, 2017