Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
intial checkin with simple impl with ant build setup
- Loading branch information
Showing
4 changed files
with
103 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); | ||
} | ||
|
||
} |