Commit f9a4b24c authored by mirako's avatar mirako
Browse files

PomUpdate

parent 10bb9cf8
# CC Assigment 1
## Run
java -jar cc-assignment-1-0.1.0.jar --u $URL$ --d $DEPTH$
##Build
mvn compile
mcn package
##Test
mvn test
......@@ -42,6 +42,11 @@
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
......
......@@ -4,7 +4,6 @@ import java.util.List;
public class Report {
private String url;
private Integer deph;
private Integer imageCount;
private Integer videoCount;
private Integer wordCount;
......
......@@ -4,6 +4,7 @@ import org.jsoup.nodes.Document;
import org.junit.Assert;
import org.junit.jupiter.api.*;
import java.io.ByteArrayOutputStream;
import java.nio.file.Path;
import java.nio.file.Paths;
......@@ -11,6 +12,7 @@ import java.nio.file.Paths;
public class CrawlerTest {
public static Crawler crawler;
public static String testFilePath;
public static Report report;
@BeforeAll
public static void init(){
......@@ -45,7 +47,6 @@ public class CrawlerTest {
@Test
public void testWordCount(){
Report report;
Document webpage = crawler.getDocumentFromURL(testFilePath);
report = crawler.analyze(webpage, 0);
Assert.assertEquals(305,report.getWordCount().longValue());
......@@ -53,7 +54,6 @@ public class CrawlerTest {
@Test
public void testImageCount(){
Report report;
Document webpage = crawler.getDocumentFromURL(testFilePath);
report = crawler.analyze(webpage, 0);
Assert.assertEquals(2,report.getImageCount().longValue());
......@@ -61,7 +61,6 @@ public class CrawlerTest {
@Test
public void testVideoCount(){
Report report;
Document webpage = crawler.getDocumentFromURL(testFilePath);
report = crawler.analyze(webpage, 0);
Assert.assertEquals(1,report.getVideoCount().longValue());
......@@ -69,7 +68,6 @@ public class CrawlerTest {
@Test
public void testLinkCount(){
Report report;
Document webpage = crawler.getDocumentFromURL(testFilePath);
report = crawler.analyze(webpage, 0);
Assert.assertEquals(3,report.getLinks().size());
......@@ -77,7 +75,6 @@ public class CrawlerTest {
@Test
public void testBrokenLinkCount(){
Report report;
Document webpage = crawler.getDocumentFromURL(testFilePath);
report = crawler.analyze(webpage, 0);
Assert.assertEquals(1, report.getBrokenLinks().size());
......@@ -86,6 +83,7 @@ public class CrawlerTest {
@AfterAll
public static void tearDown(){
crawler = null;
report = null;
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment