Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions _template/build.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +0,0 @@
apply plugin: "java"
apply plugin: "eclipse"
apply plugin: "idea"

repositories {
mavenCentral()
}

dependencies {
testCompile "junit:junit:4.10"
}
11 changes: 0 additions & 11 deletions accumulate/build.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +0,0 @@
apply plugin: "java"
apply plugin: "eclipse"
apply plugin: "idea"

repositories {
mavenCentral()
}

dependencies {
testCompile "junit:junit:4.10"
}
11 changes: 0 additions & 11 deletions allergies/build.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +0,0 @@
apply plugin: "java"
apply plugin: "eclipse"
apply plugin: "idea"

repositories {
mavenCentral()
}

dependencies {
testCompile "junit:junit:4.10"
}
11 changes: 0 additions & 11 deletions anagram/build.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +0,0 @@
apply plugin: "java"
apply plugin: "eclipse"
apply plugin: "idea"

repositories {
mavenCentral()
}

dependencies {
testCompile "junit:junit:4.10"
}
29 changes: 14 additions & 15 deletions anagram/src/test/java/AnagramTest.java
Original file line number Diff line number Diff line change
@@ -1,77 +1,76 @@
import static org.hamcrest.CoreMatchers.*;
import static org.junit.matchers.JUnitMatchers.*;
import static org.junit.Assert.*;
import static org.assertj.core.api.Assertions.assertThat;

import java.util.*;
import org.junit.*;
import java.util.Arrays;
import java.util.List;
import org.junit.Test;

public class AnagramTest {

@Test
public void testNoMatches() {
Anagram detector = new Anagram("diaper");
assertTrue(detector.match(Arrays.asList("hello", "world", "zombies", "pants")).isEmpty());
assertThat(detector.match(Arrays.asList("hello", "world", "zombies", "pants"))).isEmpty();
}

@Test
public void testSimpleAnagram() {
Anagram detector = new Anagram("ant");
List<String> anagram = detector.match(Arrays.asList("tan", "stand", "at"));
assertThat(anagram, hasItems("tan"));
assertThat(anagram).containsExactly("tan");
}

@Test
public void testDetectMultipleAnagrams() {
Anagram detector = new Anagram("master");
List<String> anagrams = detector.match(Arrays.asList("stream", "pigeon", "maters"));
assertThat(anagrams, hasItems("maters", "stream"));
assertThat(anagrams).contains("maters", "stream");
}

@Test
public void testDoesNotConfuseDifferentDuplicates() {
Anagram detector = new Anagram("galea");
List<String> anagrams = detector.match(Arrays.asList("eagle"));
assertTrue(anagrams.isEmpty());
assertThat(anagrams).isEmpty();
}

@Test
public void testIdenticalWordIsNotAnagram() {
Anagram detector = new Anagram("corn");
List<String> anagrams = detector.match(Arrays.asList("corn", "dark", "Corn", "rank", "CORN", "cron", "park"));
assertEquals(anagrams, Arrays.asList("cron"));
assertThat(anagrams).containsExactly("cron");
}

@Test
public void testEliminateAnagramsWithSameChecksum() {
Anagram detector = new Anagram("mass");
assertTrue(detector.match(Arrays.asList("last")).isEmpty());
assertThat(detector.match(Arrays.asList("last")).isEmpty());
}

@Test
public void testEliminateAnagramSubsets() {
Anagram detector = new Anagram("good");
assertTrue(detector.match(Arrays.asList("dog", "goody")).isEmpty());
assertThat(detector.match(Arrays.asList("dog", "goody"))).isEmpty();
}

@Test
public void testDetectAnagrams() {
Anagram detector = new Anagram("listen");
List<String> anagrams = detector.match(Arrays.asList("enlists", "google", "inlets", "banana"));
assertThat(anagrams, hasItems("inlets"));
assertThat(anagrams).contains("inlets");
}

@Test
public void testMultipleAnagrams() {
Anagram detector = new Anagram("allergy");
List<String> anagrams = detector.match(Arrays.asList("gallery", "ballerina", "regally", "clergy", "largely", "leading"));
assertThat(anagrams, hasItems("gallery", "largely", "regally"));
assertThat(anagrams).contains("gallery", "largely", "regally");
}

@Test
public void testAnagramsAreCaseInsensitive() {
Anagram detector = new Anagram("Orchestra");
List<String> anagrams = detector.match(Arrays.asList("cashregister", "Carthorse", "radishes"));
assertThat(anagrams, hasItems("Carthorse"));
assertThat(anagrams).contains("Carthorse");
}

}
11 changes: 0 additions & 11 deletions atbash-cipher/build.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +0,0 @@
apply plugin: "java"
apply plugin: "eclipse"
apply plugin: "idea"

repositories {
mavenCentral()
}

dependencies {
testCompile "junit:junit:4.10"
}
11 changes: 0 additions & 11 deletions binary/build.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +0,0 @@
apply plugin: "java"
apply plugin: "eclipse"
apply plugin: "idea"

repositories {
mavenCentral()
}

dependencies {
testCompile "junit:junit:4.10"
}
11 changes: 0 additions & 11 deletions bob/build.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +0,0 @@
apply plugin: "java"
apply plugin: "eclipse"
apply plugin: "idea"

repositories {
mavenCentral()
}

dependencies {
testCompile "junit:junit:4.10"
}
11 changes: 11 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
subprojects { project ->
apply plugin: "java"
apply plugin: "eclipse"
apply plugin: "idea"

repositories {
mavenCentral()
}

dependencies {
testCompile "junit:junit:4.12"
testCompile 'org.assertj:assertj-core:2.2.0'
}

sourceSets {
// Verify that the tests are working by running them against the example code.
Expand Down
11 changes: 0 additions & 11 deletions crypto-square/build.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +0,0 @@
apply plugin: "java"
apply plugin: "eclipse"
apply plugin: "idea"

repositories {
mavenCentral()
}

dependencies {
testCompile "junit:junit:4.10"
}
10 changes: 0 additions & 10 deletions etl/build.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
apply plugin: "java"
apply plugin: "eclipse"
apply plugin: "idea"

repositories {
mavenCentral()
}

dependencies {
testCompile "junit:junit:4.10"
testCompile "org.easytesting:fest-assert-core:2.0M10"
testCompile "com.google.guava:guava:16+"
}
2 changes: 1 addition & 1 deletion etl/src/test/java/EtlTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import java.util.List;
import java.util.Map;

import static org.fest.assertions.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThat;

public class EtlTest {
private final Etl etl = new Etl();
Expand Down
11 changes: 0 additions & 11 deletions gigasecond/build.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +0,0 @@
apply plugin: "java"
apply plugin: "eclipse"
apply plugin: "idea"

repositories {
mavenCentral()
}

dependencies {
testCompile "junit:junit:4.10"
}
12 changes: 0 additions & 12 deletions grade-school/build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +0,0 @@
apply plugin: "java"
apply plugin: "eclipse"
apply plugin: "idea"

repositories {
mavenCentral()
}

dependencies {
testCompile "junit:junit:4.10"
testCompile "org.easytesting:fest-assert-core:2.0M10"
}
2 changes: 1 addition & 1 deletion grade-school/src/test/java/SchoolTest.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import static org.fest.assertions.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThat;

import org.junit.Test;

Expand Down
11 changes: 0 additions & 11 deletions hamming/build.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +0,0 @@
apply plugin: "java"
apply plugin: "eclipse"
apply plugin: "idea"

repositories {
mavenCentral()
}

dependencies {
testCompile "junit:junit:4.10"
}
12 changes: 0 additions & 12 deletions hello-world/build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +0,0 @@
apply plugin: "java"
apply plugin: "eclipse"
apply plugin: "idea"

repositories {
mavenCentral()
}

dependencies {
testCompile "junit:junit:4.10"
}

11 changes: 0 additions & 11 deletions luhn/build.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +0,0 @@
apply plugin: "java"
apply plugin: "eclipse"
apply plugin: "idea"

repositories {
mavenCentral()
}

dependencies {
testCompile "junit:junit:4.10"
}
10 changes: 0 additions & 10 deletions meetup/build.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
apply plugin: "java"
apply plugin: "eclipse"
apply plugin: "idea"

repositories {
mavenCentral()
}

dependencies {
compile "joda-time:joda-time:2.3+"
testCompile "junit:junit:4.10"
testCompile "org.easytesting:fest-assert-core:2.0M10"
}
2 changes: 1 addition & 1 deletion meetup/src/test/java/MeetupTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import org.joda.time.DateTimeConstants;
import org.junit.Test;

import static org.fest.assertions.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThat;
import static org.joda.time.DateTimeConstants.*;

/*
Expand Down
12 changes: 0 additions & 12 deletions nucleotide-count/build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +0,0 @@
apply plugin: "java"
apply plugin: "eclipse"
apply plugin: "idea"

repositories {
mavenCentral()
}

dependencies {
testCompile "junit:junit:4.10"
testCompile "org.easytesting:fest-assert-core:2.0M10"
}
4 changes: 2 additions & 2 deletions nucleotide-count/src/test/java/NucleotideTest.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import static org.fest.assertions.api.Assertions.assertThat;
import static org.fest.assertions.api.Assertions.entry;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.entry;

import org.junit.Test;

Expand Down
11 changes: 0 additions & 11 deletions octal/build.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +0,0 @@
apply plugin: "java"
apply plugin: "eclipse"
apply plugin: "idea"

repositories {
mavenCentral()
}

dependencies {
testCompile "junit:junit:4.10"
}
11 changes: 0 additions & 11 deletions pangram/build.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +0,0 @@
apply plugin: "java"
apply plugin: "eclipse"
apply plugin: "idea"

repositories {
mavenCentral()
}

dependencies {
testCompile "junit:junit:4.10"
}
11 changes: 0 additions & 11 deletions pascals-triangle/build.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +0,0 @@
apply plugin: "java"
apply plugin: "eclipse"
apply plugin: "idea"

repositories {
mavenCentral()
}

dependencies {
testCompile "junit:junit:4.10"
}
11 changes: 0 additions & 11 deletions phone-number/build.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +0,0 @@
apply plugin: "java"
apply plugin: "eclipse"
apply plugin: "idea"

repositories {
mavenCentral()
}

dependencies {
testCompile "junit:junit:4.10"
}
11 changes: 0 additions & 11 deletions pig-latin/build.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +0,0 @@
apply plugin: "java"
apply plugin: "eclipse"
apply plugin: "idea"

repositories {
mavenCentral()
}

dependencies {
testCompile "junit:junit:4.10"
}
Loading