package org.junitdoclet.demo; import org.junit.Test; import org.junit.After; import org.junit.Before; import org.junit.AfterClass; import org.junit.BeforeClass; import static junit.framework.Assert.assertEquals; // JUnitDoclet begin import // make sure to add your own imports here // JUnitDoclet end import /** * Generated by JUnitDoclet, a tool provided by * ObjectFab GmbH under LGPL. * Please see www.junitdoclet.org, www.gnu.org * and www.objectfab.de for informations about * the tool, the licence and the authors. */ public class SampleClassTest // JUnitDoclet begin extends_implements // JUnitDoclet end extends_implements { // JUnitDoclet begin class org.junitdoclet.demo.SampleClass sampleclass = null; // JUnitDoclet end class public SampleClassTest() { // JUnitDoclet begin method SampleClassTest // JUnitDoclet end method SampleClassTest } public org.junitdoclet.demo.SampleClass createInstance() throws Exception { // JUnitDoclet begin method testcase.createInstance return new org.junitdoclet.demo.SampleClass(); // JUnitDoclet end method testcase.createInstance } @Before public void before() throws Exception { // JUnitDoclet begin method testcase.before sampleclass = createInstance(); // JUnitDoclet end method testcase.before } @After public void after() throws Exception { // JUnitDoclet begin method testcase.after sampleclass = null; // JUnitDoclet end method testcase.after } @BeforeClass public static void beforeClass() throws Exception { // JUnitDoclet begin method testcase.beforeClass // JUnitDoclet end method testcase.beforeClass } @AfterClass public static void afterClass() throws Exception { // JUnitDoclet begin method testcase.afterClass // JUnitDoclet end method testcase.afterClass } @Test public void testSetGetValue() throws Exception { // JUnitDoclet begin method setValue getValue int[] tests = {Integer.MIN_VALUE, -1, 0, 1, Integer.MAX_VALUE}; for (int i = 0; i < tests.length; i++) { sampleclass.setValue(tests[i]); assertEquals(tests[i], sampleclass.getValue()); } // JUnitDoclet end method setValue getValue } @Test public void testSetIsFlag() throws Exception { // JUnitDoclet begin method setFlag isFlag boolean[] tests = {true, false}; for (int i = 0; i < tests.length; i++) { sampleclass.setFlag(tests[i]); assertEquals(tests[i], sampleclass.isFlag()); } // JUnitDoclet end method setFlag isFlag } @Test public void testSetGetName() throws Exception { // JUnitDoclet begin method setName getName String[] tests = {new String(), null}; for (int i = 0; i < tests.length; i++) { sampleclass.setName(tests[i]); assertEquals(tests[i], sampleclass.getName()); } // JUnitDoclet end method setName getName } @Test public void testToString() throws Exception { // JUnitDoclet begin method toString // JUnitDoclet end method toString } /** * JUnitDoclet moves marker to this method, if there is not match * for them in the regenerated code and if the marker is not empty. * This way, no test gets lost when regenerating after renaming. * Method testVault is supposed to be empty. * @throws Exception Any exception the enclosed code may throw. */ @Test public void testVault() throws Exception { // JUnitDoclet begin method testcase.testVault // JUnitDoclet end method testcase.testVault } }