Permalink
Browse files

Merge pull request #1 from jeanlaurent/master

Here's come java & js goodness for coderetreat.
  • Loading branch information...
2 parents 61b6b97 + 5061b24 commit 4202b72d06c55f9c5abdbd1d88010ca4b8ed333c @coreyhaines coreyhaines committed Sep 20, 2011
View
@@ -1 +1,3 @@
*.gem
+target
+.idea
@@ -0,0 +1,11 @@
+## Simple Java Setup using Maven
+
+Adding popular testing libs :
+
+* junit
+* fest-assert
+* mockito
+
+to run testsuites just run "mvn clean test"
+
+Project load into popular IDE (Idea, Eclipse, NetBeans) by importing the files as a maven project.
@@ -0,0 +1,56 @@
+<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/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>coderetreat</groupId>
+ <artifactId>conway</artifactId>
+ <packaging>jar</packaging>
+ <version>1.0-SNAPSHOT</version>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.8.2</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-all</artifactId>
+ <version>1.8.5</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.easytesting</groupId>
+ <artifactId>fest-assert</artifactId>
+ <version>1.4</version>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <plugins>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-resources-plugin</artifactId>
+ <version>2.5</version>
+ <configuration>
+ <encoding>UTF-8</encoding>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>2.3.2</version>
+ <configuration>
+ <source>1.6</source>
+ <target>1.6</target>
+ <encoding>UTF-8</encoding>
+ </configuration>
+ </plugin>
+
+ </plugins>
+ </build>
+</project>
@@ -0,0 +1,8 @@
+package coderetreat;
+
+public class GameOfLife {
+
+ public String foo() {
+ return "qix";
+ }
+}
@@ -0,0 +1,13 @@
+package coderetreat;
+
+import org.junit.Test;
+
+import static org.fest.assertions.Assertions.assertThat;
+
+public class GameOfLifeTest {
+
+ @Test
+ public void whenFooIsCalled_thenItReturnsBar() {
+ assertThat(new GameOfLife().foo()).isEqualTo("bar");
+ }
+}
@@ -0,0 +1,3 @@
+## Simple JavaScript Setup using QUnit
+
+to run testsuites just open coderetreat.html in a capable browser.
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>coderetreat Test Suite</title>
+ <script src="http://code.jquery.com/jquery-latest.js"></script>
+ <link rel="stylesheet" href="http://code.jquery.com/qunit/git/qunit.css" type="text/css" media="screen"/>
+ <script type="text/javascript" src="http://code.jquery.com/qunit/git/qunit.js"></script>
+ <!-- Your project file goes here -->
+ <script type="text/javascript" src="coderetreat.js"></script>
+ <!-- Your tests file goes here -->
+ <script type="text/javascript" src="coderetreatTest.js"></script>
+</head>
+<body>
+ <h1 id="qunit-header">coderetreat</h1>
+ <h2 id="qunit-banner"></h2>
+ <div id="qunit-testrunner-toolbar"></div>
+ <h2 id="qunit-userAgent"></h2>
+ <ol id="qunit-tests"></ol>
+ <div id="qunit-fixture">test markup, will be hidden</div>
+</body>
+</html>
@@ -0,0 +1,3 @@
+function foo() {
+ return "qix";
+}
@@ -0,0 +1,4 @@
+test('is foo "bar" ?', function() {
+ equals(foo(), "bar");
+})
+

0 comments on commit 4202b72

Please sign in to comment.