Skip to content

Commit

Permalink
Merge pull request #89 from DoclerLabs/develop
Browse files Browse the repository at this point in the history
prepare 0.35.0
  • Loading branch information
aliokan authored Feb 19, 2018
2 parents e7d82cf + 46310a4 commit d680c28
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 12 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ install:
#hexInject
- git clone --recursive -b $DEPENDENCIES_BRANCH https://github.com/DoclerLabs/hexInject.git ./hexinject
- haxelib dev hexinject ./hexinject
#tink_macro
- haxelib install tink_macro 0.16.1
#hexMVC
- haxelib dev hexmvc .
- export DISPLAY=:99.0;
Expand Down
2 changes: 1 addition & 1 deletion test/hex/control/command/MockCommand.hx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import hex.control.payload.ExecutionPayload;
*/
class MockCommand extends BasicCommand
{
static public var executionCount : UInt;
static public var executionCount : UInt = 0;

public function new()
{
Expand Down
2 changes: 1 addition & 1 deletion test/hex/control/macro/MacroExecutorTest.hx
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class MacroExecutorTest
this._macroExecutor.add( MockBasicAsyncCommand );
Assert.isFalse( this._macroExecutor.hasRunEveryCommand, "'hasRunEveryCommand' should return false" );
this._macroExecutor.executeNextCommand();
Timer.delay( MethodRunner.asyncHandler( this._onTestHasRunEveryCommand ), 100 );
Timer.delay( MethodRunner.asyncHandler.bind( this._onTestHasRunEveryCommand.bind() ), 100 );
}

@Test( "Test executeNextCommand" )
Expand Down
4 changes: 2 additions & 2 deletions test/hex/control/macro/MacroTest.hx
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ class MacroTest
myMacro.add( MockCommand );

Assert.equals( 0, MockCommand.executeCallCount, "'execute' method shoud not been called" );
myMacro.addCompleteHandler( MethodRunner.asyncHandler( this._onTestSequenceModeComplete, [ myMacro ] ) );
myMacro.addCompleteHandler( function(command) MethodRunner.asyncHandler( this._onTestSequenceModeComplete.bind( command, myMacro ) ) );
myMacro.execute();
Assert.equals( 0, MockCommand.executeCallCount, "'execute' method should not been called" );
}
Expand All @@ -244,7 +244,7 @@ class MacroTest
macroExecutor.injector = new MockDependencyInjector();
myMacro.macroExecutor = macroExecutor;

myMacro.addCompleteHandler( MethodRunner.asyncHandler( this._onMacroWithHandlerComplete, [ myMacro ] ) );
myMacro.addCompleteHandler( function(command) MethodRunner.asyncHandler( this._onMacroWithHandlerComplete.bind(command, myMacro) ) );

myMacro.isInSequenceMode = true;
myMacro.preExecute();
Expand Down
14 changes: 12 additions & 2 deletions test/hex/control/trigger/CommandTriggerTest.hx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,12 @@ class CommandTriggerTest
Assert.isNull( MockCommandClassWithParameters.ignored, 'Last parameter should be ignored' );
}

this._controller.say( "hola mundo", this, "ignore that", new Locator<String, Bool>() ).onComplete( MethodRunner.asyncHandler( f ) );
this._controller.say( "hola mundo", this, "ignore that", new Locator<String, Bool>() ).onComplete(
function( message : String )
{
MethodRunner.asyncHandler( f.bind( message ) );
}
);
}

@Test( "test controller call without mapping" )
Expand Down Expand Up @@ -106,7 +111,12 @@ class CommandTriggerTest
Assert.isNull( MockCommandClassWithParameters.ignored, 'Last parameter should be ignored' );
}

controller.say( "hola mundo", this, new Locator<String, Bool>() ).onComplete( MethodRunner.asyncHandler( f ) );
controller.say( "hola mundo", this, new Locator<String, Bool>() ).onComplete(
function( message : String )
{
MethodRunner.asyncHandler( f.bind( message ) );
}
);

//doSomething
var vos : Array<Dynamic> = [];
Expand Down
16 changes: 12 additions & 4 deletions test/hex/control/trigger/CommandTriggerUserCaseTest.hx
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,12 @@ class CommandTriggerUserCaseTest
{
var ageProvider = function() return 46;

this._controller.getUserVO( ageProvider )
.onComplete( MethodRunner.asyncHandler( this._onGetUser ) );
this._controller.getUserVO( ageProvider ).onComplete(
function( userVO )
{
MethodRunner.asyncHandler( this._onGetUser.bind( userVO ) );
}
);
}

function _onGetUser( userVO : MockUserVO ) : Void
Expand All @@ -64,8 +68,12 @@ class CommandTriggerUserCaseTest

this._injector.mapDependencyToValue( new Dependency<TemperatureService>(), service );

this._controller.getTemperature( 'Luxembourg' )
.onComplete( MethodRunner.asyncHandler( this._onGetTemperature ) );
this._controller.getTemperature( 'Luxembourg' ).onComplete(
function( temperature )
{
MethodRunner.asyncHandler( this._onGetTemperature.bind( temperature ) );
}
);
}

function _onGetTemperature( temperature : Int ) : Void
Expand Down
2 changes: 1 addition & 1 deletion test/hex/control/trigger/MacroCommandTest.hx
Original file line number Diff line number Diff line change
Expand Up @@ -2112,7 +2112,7 @@ class MacroCommandTest

var userOutcome : MockUserVO;
macroCommand.onComplete( function( result ) userOutcome = result );
macroCommand.onComplete( MethodRunner.asyncHandler( this._onUserCaseComplete ) );
macroCommand.onComplete( function( userVO ) MethodRunner.asyncHandler( this._onUserCaseComplete.bind( userVO ) ) );
}

function _onUserCaseComplete( userVO : MockUserVO ) : Void
Expand Down
2 changes: 1 addition & 1 deletion test/hex/event/MacroAdapterStrategyTest.hx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class MacroAdapterStrategyTest
var params : Array<Dynamic> = [ new MockRequest(), "test" ];
this._classAdapter.getCallbackAdapter()( params );

Timer.delay( MethodRunner.asyncHandler( this._onTestEnd ), 100 );
Timer.delay( MethodRunner.asyncHandler.bind( this._onTestEnd.bind() ), 100 );
}

function factoryForMacroClass( adapterClass : Class<IAdapterStrategy> ) : IAdapterStrategy
Expand Down

0 comments on commit d680c28

Please sign in to comment.