Ver código fonte

Revert "build: Extract common config to top-level build.gradle"

This reverts commit 3fdc2d1b9c8749bee26140c359d93fc3a2681889.

Individual exercises must include a stand-alone build.grade, today.
John S. Ryan 10 anos atrás
pai
commit
f5bc0da655

+ 11
- 0
_template/build.gradle Ver arquivo

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
+}

+ 11
- 0
accumulate/build.gradle Ver arquivo

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
+}

+ 11
- 0
allergies/build.gradle Ver arquivo

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
+}

+ 11
- 0
anagram/build.gradle Ver arquivo

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
+}

+ 15
- 14
anagram/src/test/java/AnagramTest.java Ver arquivo

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.*;
2
 
4
 
3
-import java.util.Arrays;
4
-import java.util.List;
5
-import org.junit.Test;
5
+import java.util.*;
6
+import org.junit.*;
6
 
7
 
7
 public class AnagramTest {
8
 public class AnagramTest {
8
 
9
 
9
     @Test
10
     @Test
10
     public void testNoMatches() {
11
     public void testNoMatches() {
11
         Anagram detector = new Anagram("diaper");
12
         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());
13
     }
14
     }
14
 
15
 
15
     @Test
16
     @Test
16
     public void testSimpleAnagram() {
17
     public void testSimpleAnagram() {
17
         Anagram detector = new Anagram("ant");
18
         Anagram detector = new Anagram("ant");
18
         List<String> anagram = detector.match(Arrays.asList("tan", "stand", "at"));
19
         List<String> anagram = detector.match(Arrays.asList("tan", "stand", "at"));
19
-        assertThat(anagram).containsExactly("tan");
20
+        assertThat(anagram, hasItems("tan"));
20
     }
21
     }
21
 
22
 
22
     @Test
23
     @Test
23
     public void testDetectMultipleAnagrams() {
24
     public void testDetectMultipleAnagrams() {
24
         Anagram detector = new Anagram("master");
25
         Anagram detector = new Anagram("master");
25
         List<String> anagrams = detector.match(Arrays.asList("stream", "pigeon", "maters"));
26
         List<String> anagrams = detector.match(Arrays.asList("stream", "pigeon", "maters"));
26
-        assertThat(anagrams).contains("maters", "stream");
27
+        assertThat(anagrams, hasItems("maters", "stream"));
27
     }
28
     }
28
 
29
 
29
     @Test
30
     @Test
30
     public void testDoesNotConfuseDifferentDuplicates() {
31
     public void testDoesNotConfuseDifferentDuplicates() {
31
         Anagram detector = new Anagram("galea");
32
         Anagram detector = new Anagram("galea");
32
         List<String> anagrams = detector.match(Arrays.asList("eagle"));
33
         List<String> anagrams = detector.match(Arrays.asList("eagle"));
33
-        assertThat(anagrams).isEmpty();
34
+        assertTrue(anagrams.isEmpty());
34
     }
35
     }
35
 
36
 
36
     @Test
37
     @Test
37
     public void testIdenticalWordIsNotAnagram() {
38
     public void testIdenticalWordIsNotAnagram() {
38
         Anagram detector = new Anagram("corn");
39
         Anagram detector = new Anagram("corn");
39
         List<String> anagrams = detector.match(Arrays.asList("corn", "dark", "Corn", "rank", "CORN", "cron", "park"));
40
         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"));
41
     }
42
     }
42
 
43
 
43
     @Test
44
     @Test
44
     public void testEliminateAnagramsWithSameChecksum() {
45
     public void testEliminateAnagramsWithSameChecksum() {
45
         Anagram detector = new Anagram("mass");
46
         Anagram detector = new Anagram("mass");
46
-        assertThat(detector.match(Arrays.asList("last")).isEmpty());
47
+        assertTrue(detector.match(Arrays.asList("last")).isEmpty());
47
     }
48
     }
48
 
49
 
49
     @Test
50
     @Test
50
     public void testEliminateAnagramSubsets() {
51
     public void testEliminateAnagramSubsets() {
51
         Anagram detector = new Anagram("good");
52
         Anagram detector = new Anagram("good");
52
-        assertThat(detector.match(Arrays.asList("dog", "goody"))).isEmpty();
53
+        assertTrue(detector.match(Arrays.asList("dog", "goody")).isEmpty());
53
     }
54
     }
54
 
55
 
55
     @Test
56
     @Test
56
     public void testDetectAnagrams() {
57
     public void testDetectAnagrams() {
57
         Anagram detector = new Anagram("listen");
58
         Anagram detector = new Anagram("listen");
58
         List<String> anagrams = detector.match(Arrays.asList("enlists", "google", "inlets", "banana"));
59
         List<String> anagrams = detector.match(Arrays.asList("enlists", "google", "inlets", "banana"));
59
-        assertThat(anagrams).contains("inlets");
60
+        assertThat(anagrams, hasItems("inlets"));
60
     }
61
     }
61
 
62
 
62
     @Test
63
     @Test
63
     public void testMultipleAnagrams() {
64
     public void testMultipleAnagrams() {
64
         Anagram detector = new Anagram("allergy");
65
         Anagram detector = new Anagram("allergy");
65
         List<String> anagrams = detector.match(Arrays.asList("gallery", "ballerina", "regally", "clergy", "largely", "leading"));
66
         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"));
67
     }
68
     }
68
 
69
 
69
     @Test
70
     @Test
70
     public void testAnagramsAreCaseInsensitive() {
71
     public void testAnagramsAreCaseInsensitive() {
71
         Anagram detector = new Anagram("Orchestra");
72
         Anagram detector = new Anagram("Orchestra");
72
         List<String> anagrams = detector.match(Arrays.asList("cashregister", "Carthorse", "radishes"));
73
         List<String> anagrams = detector.match(Arrays.asList("cashregister", "Carthorse", "radishes"));
73
-        assertThat(anagrams).contains("Carthorse");
74
+        assertThat(anagrams, hasItems("Carthorse"));
74
     }
75
     }
75
 
76
 
76
 }
77
 }

+ 11
- 0
atbash-cipher/build.gradle Ver arquivo

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
+}

+ 11
- 0
binary/build.gradle Ver arquivo

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
+}

+ 11
- 0
bob/build.gradle Ver arquivo

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
- 11
build.gradle Ver arquivo

1
 subprojects { project ->
1
 subprojects { project ->
2
   apply plugin: "java"
2
   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
-  }
14
 
3
 
15
   sourceSets {
4
   sourceSets {
16
     // Verify that the tests are working by running them against the example code.
5
     // Verify that the tests are working by running them against the example code.

+ 11
- 0
crypto-square/build.gradle Ver arquivo

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
+}

+ 10
- 0
etl/build.gradle Ver arquivo

1
+apply plugin: "java"
2
+apply plugin: "eclipse"
3
+apply plugin: "idea"
4
+
5
+repositories {
6
+  mavenCentral()
7
+}
8
+
1
 dependencies {
9
 dependencies {
10
+  testCompile "junit:junit:4.10"
11
+  testCompile "org.easytesting:fest-assert-core:2.0M10"
2
   testCompile "com.google.guava:guava:16+"
12
   testCompile "com.google.guava:guava:16+"
3
 }
13
 }

+ 11
- 0
gigasecond/build.gradle Ver arquivo

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
+}

+ 13
- 0
grade-school/build.gradle Ver arquivo

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
+  testCompile "org.easytesting:fest-assert-core:2.0M10"
12
+}
13
+

+ 11
- 0
hamming/build.gradle Ver arquivo

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
+}

+ 12
- 0
hello-world/build.gradle Ver arquivo

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
+}
12
+

+ 11
- 0
luhn/build.gradle Ver arquivo

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
+}

+ 10
- 0
meetup/build.gradle Ver arquivo

1
+apply plugin: "java"
2
+apply plugin: "eclipse"
3
+apply plugin: "idea"
4
+
5
+repositories {
6
+  mavenCentral()
7
+}
8
+
1
 dependencies {
9
 dependencies {
2
   compile "joda-time:joda-time:2.3+"
10
   compile "joda-time:joda-time:2.3+"
11
+  testCompile "junit:junit:4.10"
12
+  testCompile "org.easytesting:fest-assert-core:2.0M10"
3
 }
13
 }

+ 13
- 0
nucleotide-count/build.gradle Ver arquivo

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
+  testCompile "org.easytesting:fest-assert-core:2.0M10"
12
+}
13
+

+ 11
- 0
octal/build.gradle Ver arquivo

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
+}

+ 11
- 0
pangram/build.gradle Ver arquivo

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
+}

+ 11
- 0
pascals-triangle/build.gradle Ver arquivo

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
+}

+ 11
- 0
phone-number/build.gradle Ver arquivo

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
+}

+ 11
- 0
pig-latin/build.gradle Ver arquivo

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
+}

+ 12
- 0
prime-factors/build.gradle Ver arquivo

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.12"
11
+}
12
+

+ 11
- 0
raindrops/build.gradle Ver arquivo

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
+}

+ 11
- 0
rna-transcription/build.gradle Ver arquivo

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
+}

+ 12
- 0
robot-name/build.gradle Ver arquivo

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
+}
12
+

+ 11
- 0
roman-numerals/build.gradle Ver arquivo

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
+}

+ 11
- 0
scrabble-score/build.gradle Ver arquivo

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
+}

+ 11
- 0
sieve/build.gradle Ver arquivo

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
+}

+ 11
- 0
simple-cipher/build.gradle Ver arquivo

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
+}

+ 11
- 0
space-age/build.gradle Ver arquivo

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
+}

+ 11
- 0
strain/build.gradle Ver arquivo

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
+}

+ 11
- 0
triangle/build.gradle Ver arquivo

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
+}

+ 11
- 0
trinary/build.gradle Ver arquivo

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
+}

+ 11
- 0
word-count/build.gradle Ver arquivo

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
+}