Skip to content

Commit

Permalink
Add Travis CI build
Browse files Browse the repository at this point in the history
  • Loading branch information
adamvoss committed Jun 3, 2017
1 parent cbab07e commit e55f8b7
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 15 deletions.
2 changes: 2 additions & 0 deletions .idea/modules/languagetool-languageserver_test.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
language: java
jdk:
- oraclejdk8
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ repositories {
dependencies {
testCompile group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: '5.0.0-M4'

// Enabling makes the Gradle plugin work but breaks IDEA
// testRuntime group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: '5.0.0-M4'
// Enabling makes the Gradle plugin work but breaks IDEA
testRuntime group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: '5.0.0-M4'

compile group: 'org.languagetool', name: 'language-all', version: '3.7'

Expand Down
26 changes: 13 additions & 13 deletions src/test/java/DocumentPositionCalculatorTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,41 +5,41 @@
public class DocumentPositionCalculatorTest {

public final DocumentPositionCalculator sut = new DocumentPositionCalculator("Hello\n" +
"Enthusiastic\r\n" +
"Reader!");
"Enthusiastic\r\n" +
"Reader!");

@Test
public void testGetPosition_first_character(){
public void testGetPosition_first_character() {
Position position = sut.getPosition(0);

Assertions.assertEquals(new Position(0, 0),position);
Assertions.assertEquals(new Position(0, 0), position);
}

@Test
public void testGetPosition_starts_with_newline(){
Position position = sut.getPosition(1);
public void testGetPosition_starts_with_newline() {
Position position = new DocumentPositionCalculator("\nHi").getPosition(1);

Assertions.assertEquals(new Position(1, 0),position);
Assertions.assertEquals(new Position(1, 0), position);
}

@Test
public void testGetPosition_second_start(){
public void testGetPosition_second_line_start() {
Position position = sut.getPosition(6);

Assertions.assertEquals(new Position(1, 0),position);
Assertions.assertEquals(new Position(1, 0), position);
}

@Test
public void testGetPosition_second_line_second_character(){
public void testGetPosition_second_line_second_character() {
Position position = sut.getPosition(7);

Assertions.assertEquals(new Position(1, 1),position);
Assertions.assertEquals(new Position(1, 1), position);
}

@Test
public void testGetPosition(){
public void testGetPosition_arbitrary_position() {
Position position = sut.getPosition(12);

Assertions.assertEquals(new Position(1, 6),position);
Assertions.assertEquals(new Position(1, 6), position);
}
}

0 comments on commit e55f8b7

Please sign in to comment.