<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="src" output="target/classes" path="src/main/java">
- <attributes>
- <attribute name="optional" value="true"/>
- <attribute name="maven.pomderived" value="true"/>
- </attributes>
- </classpathentry>
- <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
- <attributes>
- <attribute name="maven.pomderived" value="true"/>
- </attributes>
- </classpathentry>
- <classpathentry kind="src" output="target/test-classes" path="src/test/java">
- <attributes>
- <attribute name="optional" value="true"/>
- <attribute name="maven.pomderived" value="true"/>
- </attributes>
- </classpathentry>
- <classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
- <attributes>
- <attribute name="maven.pomderived" value="true"/>
- </attributes>
- </classpathentry>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5">
- <attributes>
- <attribute name="maven.pomderived" value="true"/>
- </attributes>
- </classpathentry>
+ <classpathentry kind="src" output="target/classes" path="src/main/java"/>
+ <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>
+ <classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
+ <classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
+ <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>
<arguments>
</arguments>
</buildCommand>
+ <buildCommand>
+ <name>org.maven.ide.eclipse.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
</buildSpec>
<natures>
+ <nature>org.maven.ide.eclipse.maven2Nature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
</natures>
--- /dev/null
+activeProfiles=
+eclipse.preferences.version=1
+fullBuildGoals=process-test-resources
+resolveWorkspaceProjects=true
+resourceFilterGoals=process-resources resources\:testResources
+skipCompilerPlugin=true
+version=1
<groupId>doraku-plus</groupId>
<artifactId>doraku-plus</artifactId>
<version>0.0.1-SNAPSHOT</version>
+ <dependencies>
+ </dependencies>
</project>
\ No newline at end of file
package jp.co.dorakuplus;
public class Masquerade {
-
+ final String zodiac[] = {"申年", "酉年", "戌年", "亥年", "子年", "丑年", "寅年", "卯年", "辰年", "巳年", "午年", "未年"};
/**
* @param args
*/
}
+ public String findZodiac(int i) {
+ return zodiac[i % 12];
+ }
+
}
--- /dev/null
+package jp.co.dorakuplus;
+
+import static org.hamcrest.CoreMatchers.*;
+import static org.junit.Assert.*;
+
+import java.util.logging.Logger;
+
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.TestName;
+
+public class MasqueradeTest {
+
+ Masquerade sut;
+ Logger logger = Logger.getLogger(MasqueradeTest.class.getName());
+
+ @Rule public TestName name = new TestName();
+
+ @BeforeClass
+ public static void setupClass() {
+ // 最初のテストケースの実行前に1回のみ実行する
+
+ }
+
+ @Before
+ public void setup() {
+ // テストケース毎に、開始前に実行する
+ // インスタンス生成
+ logger.info(name.getMethodName() + "start!!!");
+ sut = new Masquerade();
+ }
+
+ @After
+ public void tearDown() {
+ // テストケースごとに、実行後に実施する
+ // ログ出力など
+ logger.info(name.getMethodName() + "end!!!");
+ }
+
+ @AfterClass
+ public static void tearDownClass() {
+ // 最後のテストケースの後に1回だけ実施する
+ // セッションクローズなど
+ }
+
+ @Test
+ public void findZodiacに2008年を指定すると子年を返す() {
+ String expected = "子年";
+ String actual = sut.findZodiac(2008);
+ assertThat(actual, is(expected));
+ }
+
+ @Test
+ public void findZodiacに1999年を指定すると卯年を返す() {
+ String expected = "卯年";
+ String actual = sut.findZodiac(1999);
+ assertThat(actual, is(expected));
+ }
+
+ @Test
+ public void findZodiacに2013年を指定すると寅年を返さない() {
+ String expected = "寅年";
+ String actual = sut.findZodiac(2013);
+ assertThat(actual, is(not(expected)));
+ }
+
+ @Test
+ public void testName() throws Exception {
+
+ }
+}