Skip to content

Commit f5bc0da

Browse files
committed
Revert "build: Extract common config to top-level build.gradle"
This reverts commit 3fdc2d1. Individual exercises must include a stand-alone build.grade, today.
1 parent d0784c4 commit f5bc0da

36 files changed

Lines changed: 394 additions & 25 deletions

File tree

_template/build.gradle

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
apply plugin: "java"
2+
apply plugin: "eclipse"
3+
apply plugin: "idea"
4+
5+
repositories {
6+
mavenCentral()
7+
}
8+
9+
dependencies {
10+
testCompile "junit:junit:4.10"
11+
}

accumulate/build.gradle

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
apply plugin: "java"
2+
apply plugin: "eclipse"
3+
apply plugin: "idea"
4+
5+
repositories {
6+
mavenCentral()
7+
}
8+
9+
dependencies {
10+
testCompile "junit:junit:4.10"
11+
}

allergies/build.gradle

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
apply plugin: "java"
2+
apply plugin: "eclipse"
3+
apply plugin: "idea"
4+
5+
repositories {
6+
mavenCentral()
7+
}
8+
9+
dependencies {
10+
testCompile "junit:junit:4.10"
11+
}

anagram/build.gradle

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
apply plugin: "java"
2+
apply plugin: "eclipse"
3+
apply plugin: "idea"
4+
5+
repositories {
6+
mavenCentral()
7+
}
8+
9+
dependencies {
10+
testCompile "junit:junit:4.10"
11+
}
Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,76 +1,77 @@
1-
import static org.assertj.core.api.Assertions.assertThat;
1+
import static org.hamcrest.CoreMatchers.*;
2+
import static org.junit.matchers.JUnitMatchers.*;
3+
import static org.junit.Assert.*;
24

3-
import java.util.Arrays;
4-
import java.util.List;
5-
import org.junit.Test;
5+
import java.util.*;
6+
import org.junit.*;
67

78
public class AnagramTest {
89

910
@Test
1011
public void testNoMatches() {
1112
Anagram detector = new Anagram("diaper");
12-
assertThat(detector.match(Arrays.asList("hello", "world", "zombies", "pants"))).isEmpty();
13+
assertTrue(detector.match(Arrays.asList("hello", "world", "zombies", "pants")).isEmpty());
1314
}
1415

1516
@Test
1617
public void testSimpleAnagram() {
1718
Anagram detector = new Anagram("ant");
1819
List<String> anagram = detector.match(Arrays.asList("tan", "stand", "at"));
19-
assertThat(anagram).containsExactly("tan");
20+
assertThat(anagram, hasItems("tan"));
2021
}
2122

2223
@Test
2324
public void testDetectMultipleAnagrams() {
2425
Anagram detector = new Anagram("master");
2526
List<String> anagrams = detector.match(Arrays.asList("stream", "pigeon", "maters"));
26-
assertThat(anagrams).contains("maters", "stream");
27+
assertThat(anagrams, hasItems("maters", "stream"));
2728
}
2829

2930
@Test
3031
public void testDoesNotConfuseDifferentDuplicates() {
3132
Anagram detector = new Anagram("galea");
3233
List<String> anagrams = detector.match(Arrays.asList("eagle"));
33-
assertThat(anagrams).isEmpty();
34+
assertTrue(anagrams.isEmpty());
3435
}
3536

3637
@Test
3738
public void testIdenticalWordIsNotAnagram() {
3839
Anagram detector = new Anagram("corn");
3940
List<String> anagrams = detector.match(Arrays.asList("corn", "dark", "Corn", "rank", "CORN", "cron", "park"));
40-
assertThat(anagrams).containsExactly("cron");
41+
assertEquals(anagrams, Arrays.asList("cron"));
4142
}
4243

4344
@Test
4445
public void testEliminateAnagramsWithSameChecksum() {
4546
Anagram detector = new Anagram("mass");
46-
assertThat(detector.match(Arrays.asList("last")).isEmpty());
47+
assertTrue(detector.match(Arrays.asList("last")).isEmpty());
4748
}
4849

4950
@Test
5051
public void testEliminateAnagramSubsets() {
5152
Anagram detector = new Anagram("good");
52-
assertThat(detector.match(Arrays.asList("dog", "goody"))).isEmpty();
53+
assertTrue(detector.match(Arrays.asList("dog", "goody")).isEmpty());
5354
}
5455

5556
@Test
5657
public void testDetectAnagrams() {
5758
Anagram detector = new Anagram("listen");
5859
List<String> anagrams = detector.match(Arrays.asList("enlists", "google", "inlets", "banana"));
59-
assertThat(anagrams).contains("inlets");
60+
assertThat(anagrams, hasItems("inlets"));
6061
}
6162

6263
@Test
6364
public void testMultipleAnagrams() {
6465
Anagram detector = new Anagram("allergy");
6566
List<String> anagrams = detector.match(Arrays.asList("gallery", "ballerina", "regally", "clergy", "largely", "leading"));
66-
assertThat(anagrams).contains("gallery", "largely", "regally");
67+
assertThat(anagrams, hasItems("gallery", "largely", "regally"));
6768
}
6869

6970
@Test
7071
public void testAnagramsAreCaseInsensitive() {
7172
Anagram detector = new Anagram("Orchestra");
7273
List<String> anagrams = detector.match(Arrays.asList("cashregister", "Carthorse", "radishes"));
73-
assertThat(anagrams).contains("Carthorse");
74+
assertThat(anagrams, hasItems("Carthorse"));
7475
}
7576

7677
}

atbash-cipher/build.gradle

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
apply plugin: "java"
2+
apply plugin: "eclipse"
3+
apply plugin: "idea"
4+
5+
repositories {
6+
mavenCentral()
7+
}
8+
9+
dependencies {
10+
testCompile "junit:junit:4.10"
11+
}

binary/build.gradle

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
apply plugin: "java"
2+
apply plugin: "eclipse"
3+
apply plugin: "idea"
4+
5+
repositories {
6+
mavenCentral()
7+
}
8+
9+
dependencies {
10+
testCompile "junit:junit:4.10"
11+
}

bob/build.gradle

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
apply plugin: "java"
2+
apply plugin: "eclipse"
3+
apply plugin: "idea"
4+
5+
repositories {
6+
mavenCentral()
7+
}
8+
9+
dependencies {
10+
testCompile "junit:junit:4.10"
11+
}

build.gradle

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,5 @@
11
subprojects { project ->
22
apply plugin: "java"
3-
apply plugin: "eclipse"
4-
apply plugin: "idea"
5-
6-
repositories {
7-
mavenCentral()
8-
}
9-
10-
dependencies {
11-
testCompile "junit:junit:4.12"
12-
testCompile 'org.assertj:assertj-core:2.2.0'
13-
}
143

154
sourceSets {
165
// Verify that the tests are working by running them against the example code.

crypto-square/build.gradle

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
apply plugin: "java"
2+
apply plugin: "eclipse"
3+
apply plugin: "idea"
4+
5+
repositories {
6+
mavenCentral()
7+
}
8+
9+
dependencies {
10+
testCompile "junit:junit:4.10"
11+
}

0 commit comments

Comments
 (0)