Skip to content

Commit

Permalink
intial checkin with simple impl with ant build setup
Browse files Browse the repository at this point in the history
  • Loading branch information
hahan committed Mar 15, 2013
1 parent ab7e1da commit d251a4f
Show file tree
Hide file tree
Showing 4 changed files with 103 additions and 1 deletion.
16 changes: 15 additions & 1 deletion 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.
47 changes: 47 additions & 0 deletions 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>
25 changes: 25 additions & 0 deletions 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;
}
}
16 changes: 16 additions & 0 deletions 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.