Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hexUnit - test support java #277

Open
aliokan opened this issue Mar 18, 2018 · 0 comments
Open

hexUnit - test support java #277

aliokan opened this issue Mar 18, 2018 · 0 comments

Comments

@aliokan
Copy link
Contributor

aliokan commented Mar 18, 2018

Timer.delay is crashing in TestRunner._endTestMethodCall

MacBook-Pro:bin ali_o_kan$ java -jar java/MainUnitTest-Debug.jar 
TraceNotifier.hx:73: <<< Start hex.HexUnitSuite tests run >>>
TraceNotifier.hx:73:   Suite class 'HexUnit suite'
TraceNotifier.hx:73:     Suite class 'Assertion'
TraceNotifier.hx:73:       Test class 'hex.unittest.assertion.AssertionTest'
TraceNotifier.hx:73:         * [testAssertIsTrue] test Assert.isTrue 0ms
MethodRunner.hx:121: TClass(class java.lang.IllegalArgumentException)
MethodRunner.hx:122: []
TraceNotifier.hx:73:         FAILURE!!!	* [testAssertIsTrue] test Assert.isTrue
TraceNotifier.hx:73:           hex.error.Exception at hex.unittest.runner.MethodRunner#_notifyError line:126 in file 'MethodRunner.hx' | java.lang.IllegalArgumentException: Non-positive period.
TraceNotifier.hx:73:           java.lang.IllegalArgumentException: Non-positive period.: 
Exception in thread "main" java.lang.IllegalArgumentException: Non-positive period.
	at java.util.Timer.scheduleAtFixedRate(Timer.java:327)
	at haxe.Timer.__hx_ctor_haxe_Timer(Timer.java:28)
	at haxe.Timer.<init>(Timer.java:17)
	at haxe.Timer.delay(Timer.java:35)
	at hex.unittest.runner.TestRunner._endTestMethodCall(TestRunner.java:385)
	at hex.unittest.runner.TestRunner.onFail(TestRunner.java:336)
	at hex.unittest.runner.Trigger.onFail(Trigger.java:117)
	at hex.unittest.runner.MethodRunner._notifyError(MethodRunner.java:330)
	at hex.unittest.runner.MethodRunner.run(MethodRunner.java:198)
	at hex.unittest.runner.TestRunner._runTestClass(TestRunner.java:180)
	at hex.unittest.runner.TestRunner._runClassDescriptor(TestRunner.java:109)
	at hex.unittest.runner.TestRunner._runSuiteClass(TestRunner.java:138)
	at hex.unittest.runner.TestRunner._runClassDescriptor(TestRunner.java:91)
	at hex.unittest.runner.TestRunner._runSuiteClass(TestRunner.java:138)
	at hex.unittest.runner.TestRunner._runClassDescriptor(TestRunner.java:91)
	at hex.unittest.runner.TestRunner.run(TestRunner.java:69)
	at hex.unittest.runner.ExMachinaUnitCore._runNext(ExMachinaUnitCore.java:216)
	at hex.unittest.runner.ExMachinaUnitCore.run(ExMachinaUnitCore.java:49)
	at haxe.root.MainUnitTest.main(MainUnitTest.java:873)
	at haxe.root.MainUnitTest.main(MainUnitTest.java:13)

Need to fix MethodRunner._notifyError (line 118) before to get this Timer error:

if ( !Std.is( e, Exception ) )
{
	var err : Exception = null;
	trace(Type.typeof(e));
	trace(Reflect.fields(e));
	#if php
	err = new Exception( "" + e, e.p );
	#elseif java
	err = new Exception( e.toString() );
	#elseif flash
	err = new Exception( cast( e ).message );
	#else
	err = new Exception( e.toString(), e.posInfos );
	#end
	this._trigger.onFail( Date.now().getTime() - this._startTime, err );
	Assert._logFailedAssertion();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant