Skip to content
This repository has been archived by the owner on Apr 24, 2020. It is now read-only.

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
amihaiemil committed Jan 29, 2017
1 parent a4650ba commit f11fb62
Showing 1 changed file with 19 additions and 4 deletions.
23 changes: 19 additions & 4 deletions src/test/java/com/amihaiemil/charles/GraphCrawlITCase.java
Expand Up @@ -27,9 +27,13 @@
package com.amihaiemil.charles;

import static org.junit.Assert.assertTrue;

import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;

import org.hamcrest.MatcherAssert;
import org.hamcrest.Matchers;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
Expand Down Expand Up @@ -71,12 +75,23 @@ public void crawlsWithNoMoreLinks() throws Exception {
InMemoryRepository inmr = new InMemoryRepository();
GraphCrawl graph = new GraphCrawl("http://eva.amihaiemil.com/index.html", this.driver, inmr);
graph.crawl();
assertTrue(inmr.getCrawledPages().size() == 1);
MatcherAssert.assertThat(
inmr.getCrawledPages().size(), Matchers.is(1)
);
WebPage index = inmr.getCrawledPages().get(0);
assertTrue(index.getTextContent().contains("changing and combining the existing ones until finally, a solution is chosen to be the answer"));
assertTrue(index.getName().equals("index"));
assertTrue(index.getTitle().equals("EvA project"));

MatcherAssert.assertThat(
index.getTextContent(),
Matchers.containsString("changing and combining the existing ones")
);
MatcherAssert.assertThat(
index.getName(),
Matchers.equalTo("index.html")
);
MatcherAssert.assertThat(
index.getTitle(),
Matchers.equalTo("EvA project")
);
}

/**
Expand Down

0 comments on commit f11fb62

Please sign in to comment.