Skip to content
Permalink
Browse files

Use Travis CI

  • Loading branch information...
incubos committed Nov 7, 2017
1 parent e599992 commit 33be90a3d9236cbe38c0babe99c6927edce099c5
Showing with 26 additions and 7 deletions.
  1. +6 −0 .travis.yml
  2. +1 −1 README.md
  3. +19 −6 test/one/nio/http/HttpRequestBodyTest.java
@@ -0,0 +1,6 @@
language: java
dist: trusty
jdk:
- oraclejdk8
- openjdk8
install: mvn install -DskipTests=true -Dgpg.skip=true -B -V
@@ -1,4 +1,4 @@
[![one-nio](https://maven-badges.herokuapp.com/maven-central/ru.odnoklassniki/one-nio/badge.svg)](https://maven-badges.herokuapp.com/maven-central/ru.odnoklassniki/one-nio)
[![one-nio](https://maven-badges.herokuapp.com/maven-central/ru.odnoklassniki/one-nio/badge.svg)](https://maven-badges.herokuapp.com/maven-central/ru.odnoklassniki/one-nio) [![Build Status](https://travis-ci.org/odnoklassniki/one-nio.svg?branch=master)](https://travis-ci.org/odnoklassniki/one-nio) [![Javadocs](http://www.javadoc.io/badge/ru.odnoklassniki/one-nio.svg)](http://www.javadoc.io/doc/ru.odnoklassniki/one-nio)

one-nio
=======
@@ -7,6 +7,7 @@
import org.junit.Test;

import java.io.IOException;
import java.net.SocketException;
import java.util.concurrent.ThreadLocalRandom;

import static org.junit.Assert.assertArrayEquals;
@@ -52,8 +53,12 @@ public void tooBigPostBody() throws Exception {
final byte[] body = new byte[HttpSession.MAX_REQUEST_BODY_LENGTH + 1];
ThreadLocalRandom.current().nextBytes(body);

final Response response = client.post(ENDPOINT, body);
assertEquals(413, response.getStatus());
try {
final Response response = client.post(ENDPOINT, body);
assertEquals(413, response.getStatus());
} catch (SocketException e) {
assertEquals("Broken pipe", e.getMessage());
}
}

@Test
@@ -78,8 +83,12 @@ public void tooBigPutBody() throws Exception {
final byte[] body = new byte[HttpSession.MAX_REQUEST_BODY_LENGTH + 1];
ThreadLocalRandom.current().nextBytes(body);

final Response response = client.put(ENDPOINT, body);
assertEquals(413, response.getStatus());
try {
final Response response = client.put(ENDPOINT, body);
assertEquals(413, response.getStatus());
} catch (SocketException e) {
assertEquals("Broken pipe", e.getMessage());
}
}

@Test
@@ -104,8 +113,12 @@ public void tooBigPatchBody() throws Exception {
final byte[] body = new byte[HttpSession.MAX_REQUEST_BODY_LENGTH + 1];
ThreadLocalRandom.current().nextBytes(body);

final Response response = client.patch(ENDPOINT, body);
assertEquals(413, response.getStatus());
try {
final Response response = client.patch(ENDPOINT, body);
assertEquals(413, response.getStatus());
} catch (SocketException e) {
assertEquals("Broken pipe", e.getMessage());
}
}

@Test

0 comments on commit 33be90a

Please sign in to comment.
You can’t perform that action at this time.