ak47-pipe-dubbo

Ak47 - an easy Network Service Testing Framework

License

License

Categories

Categories

Dubbo Net Networking
GroupId

GroupId

com.wangyin
ArtifactId

ArtifactId

ak47-pipe-dubbo
Last Version

Last Version

0.1.2
Release Date

Release Date

Type

Type

jar
Description

Description

ak47-pipe-dubbo
Ak47 - an easy Network Service Testing Framework
Project Organization

Project Organization

JD-wangyin

Download ak47-pipe-dubbo

How to add to project

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

Dependencies

compile (3)

Group / Artifact Type Version
com.wangyin : ak47-core jar 0.1.2
com.alibaba : dubbo jar 2.4.10
com.caucho : hessian jar 4.0.33

Project Modules

There are no modules declared in this project.

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.0