Monday, 15 June 2015

java - Test cases are not running in JUnit -



java - Test cases are not running in JUnit -

dateadaptertest test class dateadapter responsible test marshalling/unmarshalling date type string info type , it's vise versa. test cases not running.

public class dateadaptertest { /* date adapter class marshall date type string , unmarshall viseversa. */ dateadapter dateadapter; private static final string date_format = "2014-01-01"; private static final localdate date = new localdate(2014, 01, 01); @beforeclass public void setup(){ dateadapter = new dateadapter(); } /* * @param date date type * @return string string info type date * @throw exception */ @test public void testmarshal() throws exception{ string datestring = dateadapter.marshal(date) ; assertequals(date_format, datestring); } /* * @param string string info type * @return date localdate type date * @throw exception */ @test public void testunmarshal() throws exception{ localdate date = dateadapter.unmarshal(date_format); assertequals(date , date); } }

getting output

=============================================== default test tests run: 0, failures: 0, skips: 0 =============================================== =============================================== default suite total tests run: 0, failures: 0, skips: 0 ===============================================

agreed durron597 comment. problem seems related way running test , junit test configuration.

if using eclipse seek right click on test method , press on run junit test check if test runs well. if have configuration problem them.

by way, add together more details tool using run junit tests , i'll update reply according it.

java java-ee junit testng

No comments:

Post a Comment