Commit 88743a95 authored by Stephen Bennett's avatar Stephen Bennett

Initial commit of boilerplate code

parent 35a4898e
.idea/
target/
*.iml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.alfresco</groupId>
<artifactId>coding-puzzle</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>coding-puzzle</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>net.sf.opencsv</groupId>
<artifactId>opencsv</artifactId>
<version>2.3</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
package com.alfresco;
import java.util.List;
/**
* Hello world!
*
*/
public class App {
public static void main( String[] args ) {
List<String[]> rows = new MovieDatabaseReader().readMovieDatabase();
}
}
package com.alfresco;
import au.com.bytecode.opencsv.CSVReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.List;
public class MovieDatabaseReader {
private static final String MOVIE_DATABASE_CSV = "/movie_metadata.csv";
public List<String[]> readMovieDatabase() {
CSVReader reader = new CSVReader(new InputStreamReader(MovieDatabaseReader.class.getResourceAsStream(MOVIE_DATABASE_CSV)));
try {
return reader.readAll();
} catch (IOException e) {
throw new RuntimeException("Failed to read movie database", e);
}
}
}
This diff is collapsed.
package com.alfresco;
import org.junit.Test;
import static org.junit.Assert.assertTrue;
public class AppTest {
/**
* Rigourous Test :-)
*/
@Test
public void testApp()
{
assertTrue( true );
}
}
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