Skip to content
Browse files

intial checkin with simple impl with ant build setup

  • Loading branch information...
1 parent ab7e1da commit d251a4fc3d2675e5f7cbf7f23f08dcf55b6bb422 @hahan committed Mar 15, 2013
Showing with 103 additions and 1 deletion.
  1. +15 −1 README.md
  2. +47 −0 build.xml
  3. +25 −0 src/com/hahan/merbok/main/Merbok.java
  4. +16 −0 tst/com/hahan/merbok/main/MerbokTest.java
View
16 README.md
@@ -1,2 +1,16 @@
merbok
-======
+======
+
+Intended to be my own version of twitter (specifically the backend part).
+
+Q. What is in the name?
+- Merbok is translation for the 'tweet' bird in one of the Indian languages.
+
+Q. What is the merb?
+- As in a tweet in twitter.
+
+Q. The implementation is so naive and simple. Twitter can't be so simple!
+- Merbok will be designed and developed incrementally using TDD.
+
+Q. But..
+- Yes, I am starting with a twitter with just one tweet. That is extreme.
View
47 build.xml
@@ -0,0 +1,47 @@
+<project name="Merbok" basedir=".">
+ <property name="src.dir" value="src"/>
+ <property name="test.dir" value="tst"/>
+
+ <property name="build.dir" value="build"/>
+ <property name="classes.dir" value="${build.dir}/classes"/>
+ <property name="report.dir" value="${build.dir}/junitreport"/>
+ <property name="lib.dir" value="lib"/>
+
+ <path id="classpath">
+ <fileset dir="${lib.dir}" includes="**/*.jar"/>
+ </path>
+
+ <target name="clean">
+ <delete dir="${build.dir}"/>
+ </target>
+
+ <target name="compile">
+ <mkdir dir="${classes.dir}"/>
+ <javac srcdir="${src.dir}" destdir="${classes.dir}"/>
+ </target>
+
+ <path id="test.classpath">
+ <path refid="classpath"/>
+ <pathelement path="${test.dir}"/>
+ <pathelement path="${classes.dir}"/>
+ </path>
+
+ <target name="compile-test" depends="compile" description="Compile Test Classes">
+ <javac srcdir="${test.dir}" verbose="true">
+ <classpath refid="test.classpath"/>
+ </javac>
+ </target>
+
+ <target name="test" depends="compile-test">
+ <mkdir dir="${report.dir}"/>
+ <junit printsummary="yes" haltonfailure="yes" showoutput="yes">
+ <classpath refid="test.classpath"/>
+ <batchtest fork="yes" todir="${test.dir}">
+ <formatter type="xml"/>
+ <fileset dir="${test.dir}"/>
+ </batchtest>
+ </junit>
+ </target>
+
+ <target name="clean-build" depends="clean,compile"/>
+</project>
View
25 src/com/hahan/merbok/main/Merbok.java
@@ -0,0 +1,25 @@
+package com.hahan.merbok.main;
+
+/**
+ * A Twitter-like app with a new name.
+ */
+public class Merbok {
+
+ /**
+ * as in tweet for twitter
+ */
+ private final String merb;
+
+ /**
+ * Simplest Merbok with a single merb!
+ *
+ * @param merb A merb as in tweet.
+ */
+ public Merbok(String merb) {
+ this.merb = merb;
+ }
+
+ public String get() {
+ return merb;
+ }
+}
View
16 tst/com/hahan/merbok/main/MerbokTest.java
@@ -0,0 +1,16 @@
+package com.hahan.merbok.main;
+
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+
+public class MerbokTest {
+
+ @Test
+ public void merbokWithJustOneMerb() {
+ Merbok merbok = new Merbok("First Merb, guys!");
+ String actualMerb = merbok.get();
+ assertEquals("First Merb, guys!", actualMerb);
+ }
+
+}

0 comments on commit d251a4f

Please sign in to comment.
Something went wrong with that request. Please try again.