-
Notifications
You must be signed in to change notification settings - Fork 213
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Correction of Service loading to load the entire parent definition …
…while loading a child application. - Added functional test ParentFunctions to check parent functions inheritance.
- Loading branch information
1 parent
788956f
commit dce13da
Showing
7 changed files
with
129 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
package | ||
{ | ||
import flash.events.NetStatusEvent; | ||
import flash.events.TimerEvent; | ||
import flash.net.NetConnection; | ||
import flash.net.Responder; | ||
import flash.utils.Timer; | ||
|
||
import mx.controls.Alert; | ||
|
||
public class ParentFunctions extends Test | ||
{ | ||
private var _host:String; | ||
private var _url:String; | ||
private var _connection:NetConnection; | ||
|
||
public function ParentFunctions(app:FunctionalTests, host:String, url:String) | ||
{ | ||
super(app, "ParentFunctions", "Check heritage of sub applications"); | ||
_host=host; | ||
_url=url; | ||
} | ||
|
||
override public function run(onFinished:Function):void { | ||
|
||
super.run(onFinished); | ||
|
||
_connection = new NetConnection(); | ||
_connection.addEventListener(NetStatusEvent.NET_STATUS, onStatus); | ||
_connection.connect("rtmfp://" + _host + _url + "subapp/subsubapp"); | ||
} | ||
|
||
// 1st response | ||
public function onRealNameApp(response:String):void { | ||
if (response=="subsubapp") { | ||
_connection.call("getNameParentApp", new Responder(onNameParentApp)); | ||
} else { | ||
onResult({err:"onRealNameApp : Expected 'subsubapp' and received '"+response+"'"}); | ||
_connection.close(); | ||
} | ||
} | ||
|
||
// 2nd response | ||
public function onNameParentApp(response:String):void { | ||
if (response=="subapp") { | ||
// getNameApp doesn't exists in subsubApp => so it will fail | ||
_connection.call("getNameApp", new Responder(null, onErrorNameApp)); | ||
} else { | ||
onResult({err:"onNameParentApp : Expected 'subapp' and received '"+response+"'"}); | ||
_connection.close(); | ||
} | ||
} | ||
|
||
// 3rd response | ||
public function onErrorNameApp(error:Object):void { | ||
if (error.description=="Method 'getNameApp' not found on application /FunctionalTests/subapp/subsubapp") { | ||
_connection.call("getNameSuperParentApp", new Responder(onNameSuperParentApp)); | ||
} else { | ||
onResult({err:"onErrorNameApp : Unexpected error '"+error.description+"'"}); | ||
_connection.close(); | ||
} | ||
} | ||
|
||
// Last response | ||
public function onNameSuperParentApp(response:String):void { | ||
if (response=="FunctionalTests") { | ||
_connection.close(); | ||
onResult({}); // Test Terminated! | ||
} else { | ||
onResult({err:"onNameSuperParentApp : Expected 'subapp' and received '"+response+"'"}); | ||
_connection.close(); | ||
} | ||
} | ||
|
||
public function onStatus(event:NetStatusEvent):void { | ||
|
||
switch(event.info.code) { | ||
case "NetConnection.Connect.Success": | ||
_connection.call("getRealNameApp", new Responder(onRealNameApp)); | ||
break; | ||
case "NetConnection.Connect.Closed": | ||
break; | ||
default: | ||
onResult({err:event.info.code}); | ||
} | ||
} | ||
|
||
} | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
FunctionalTests/www/FunctionalTests/subapp/subsubapp/main.lua
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
|
||
function onConnection(client,...) | ||
|
||
INFO("New client on FunctionalTests/subapp/subapp (protocol : ", client.protocol, ")") | ||
|
||
function client:getRealNameApp() | ||
INFO("getRealNameApp called") | ||
return "subsubapp" | ||
end | ||
|
||
function client:getNameParentApp() | ||
INFO("getNameParentApp called") | ||
return super:getNameApp() | ||
end | ||
|
||
function client:getNameSuperParentApp() | ||
INFO("getNameSuperParentApp called") | ||
return super.super:getNameApp() | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters