ak47-parent

Ak47 - an easy Network Service Testing Framework

License

License

GroupId

GroupId

com.wangyin
ArtifactId

ArtifactId

ak47-parent
Last Version

Last Version

0.1.2
Release Date

Release Date

Type

Type

pom
Description

Description

ak47-parent
Ak47 - an easy Network Service Testing Framework
Project URL

Project URL

https://github.com/JD-wangyin/Ak47
Project Organization

Project Organization

JD-wangyin
Source Code Management

Source Code Management

https://github.com/JD-wangyin/Ak47

Download ak47-parent

Filename Size
ak47-parent-0.1.2.pom 3 KB
Browse

How to add to project

<!-- https://jarcasting.com/artifacts/com.wangyin/ak47-parent/ -->
<dependency>
    <groupId>com.wangyin</groupId>
    <artifactId>ak47-parent</artifactId>
    <version>0.1.2</version>
    <type>pom</type>
</dependency>
// https://jarcasting.com/artifacts/com.wangyin/ak47-parent/
implementation 'com.wangyin:ak47-parent:0.1.2'
// https://jarcasting.com/artifacts/com.wangyin/ak47-parent/
implementation ("com.wangyin:ak47-parent:0.1.2")
'com.wangyin:ak47-parent:pom:0.1.2'
<dependency org="com.wangyin" name="ak47-parent" rev="0.1.2">
  <artifact name="ak47-parent" type="pom" />
</dependency>
@Grapes(
@Grab(group='com.wangyin', module='ak47-parent', version='0.1.2')
)
libraryDependencies += "com.wangyin" % "ak47-parent" % "0.1.2"
[com.wangyin/ak47-parent "0.1.2"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

  • core
  • example
  • autotest
  • mocklet
  • pipe-http
  • pipe-dubbo

Ak47

Ak47 is an easy Network Service Testing Framework. It is a Test-Specific Framework, designed for better Automation-Testing, Performance-Testing, Mock-Testing and with the same code style.

Ak47 can support almost all network protocols, such as HTTP, Hession, ISO8583, Dubbo, Thrift, and other RPC protocols, only if there is a corresponding Pipe.

Ak47 is base on Netty/NIO, and its design philosophy is simple to use, scalable, and high performance.

Examples

A Simple Http Driver

// new a Pipe
SimpleHttpPipe pipe = new SimpleHttpPipe();

// create a simple driver
SimpleDriver<SimpleHttpRequest, SimpleHttpResponse> driver = 
        pipe.createSimpleDriver("www.jd.com", 80);

// prepare a request
SimpleHttpRequest httpreq = new SimpleHttpRequest("GET", "/");

// send it, and get a response
SimpleHttpResponse httpres = driver.send(httpreq);

// finally check the res.
System.out.println(httpres.getStatusCode());
System.out.println(httpres.getContent().length);

A Simple Http Stub

// new a Pipe
SimpleHttpPipe pipe = new SimpleHttpPipe();

// create a stub
SimpleStub<SimpleHttpRequest, SimpleHttpResponse> stub = pipe.createSimpleStub(8055);

// add a service
stub.addService("myservice", new Service<SimpleHttpRequest, SimpleHttpResponse>(){
    @Override
    public void doService(Request<SimpleHttpRequest> request,
            Response<SimpleHttpResponse> response) throws Exception {
        SimpleHttpRequest httpreq = request.pojo();
        
        SimpleHttpResponse httpres = new SimpleHttpResponse();
        String content = "Hello Ak47! Your request url is "+httpreq.getUrl();
        httpres.setContent(content.getBytes());
        response.pojo(httpres);
    }
});

// finally start and hold it.
stub.start();
stub.hold();

How to build

You require the following to build AK47:

Note that this is build-time requirement. JDK 6 is enough to run your AK47-based application.

Contributing

Ak47 is free software/open source, and is distributed under the Apache License 2.0.

Please feel free to contribute code or documentation. Welcome to Pull Requests.

Here is the code contributors so fa: hannyu, xwliang, nabokil.

Questions?

You can try creating an issue, or searching issues, or email to hannyu.

WIKI

Welcome to the AK47 wiki. Please head to [User Guide].

欢迎来到Ak47主页,请转到[用户指南]

com.wangyin

京东网银

JD&Wangyin

Versions

Version
0.1.2
0.1.1
0.1.0