You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by cd...@apache.org on 2016/09/29 08:35:49 UTC
[1/3] git commit: [flex-asjs]
[refs/heads/feature-autobuild/maven-archetypes] - Tidy up, removed dead files
Repository: flex-asjs
Updated Branches:
refs/heads/feature-autobuild/maven-archetypes da7d1ac90 -> db1eda0a5
Tidy up, removed dead files
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/5b6f4ec9
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/5b6f4ec9
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/5b6f4ec9
Branch: refs/heads/feature-autobuild/maven-archetypes
Commit: 5b6f4ec9ac9dca542683077a631cb4167cc72154
Parents: 0960376
Author: greg-dove <gr...@gmail.com>
Authored: Thu Sep 29 06:01:03 2016 +1300
Committer: greg-dove <gr...@gmail.com>
Committed: Thu Sep 29 06:01:03 2016 +1300
----------------------------------------------------------------------
.../testsview/src/GenericTestsContainer.mxml | 32 -----
.../testsview/src/MyInitialView.mxml | 96 --------------
.../testsview/src/controllers/MyController.as | 52 --------
.../testsview/src/models/MyModel.as | 125 -------------------
.../testsview/src/models/TestResultsModel.as | 40 ------
5 files changed, 345 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/5b6f4ec9/manualtests/GenericTests/testsview/src/GenericTestsContainer.mxml
----------------------------------------------------------------------
diff --git a/manualtests/GenericTests/testsview/src/GenericTestsContainer.mxml b/manualtests/GenericTests/testsview/src/GenericTestsContainer.mxml
deleted file mode 100644
index 9f86bb6..0000000
--- a/manualtests/GenericTests/testsview/src/GenericTestsContainer.mxml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!---
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
--->
-<js:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
- xmlns:local="*"
- xmlns:js="library://ns.apache.org/flexjs/basic"
- >
-
- <js:valuesImpl>
- <js:SimpleCSSValuesImpl />
- </js:valuesImpl>
- <js:initialView>
- <local:MyInitialView />
- </js:initialView>
-</js:Application>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/5b6f4ec9/manualtests/GenericTests/testsview/src/MyInitialView.mxml
----------------------------------------------------------------------
diff --git a/manualtests/GenericTests/testsview/src/MyInitialView.mxml b/manualtests/GenericTests/testsview/src/MyInitialView.mxml
deleted file mode 100644
index bee6823..0000000
--- a/manualtests/GenericTests/testsview/src/MyInitialView.mxml
+++ /dev/null
@@ -1,96 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-
-Licensed to the Apache Software Foundation (ASF) under one or more
-contributor license agreements. See the NOTICE file distributed with
-this work for additional information regarding copyright ownership.
-The ASF licenses this file to You under the Apache License, Version 2.0
-(the "License"); you may not use this file except in compliance with
-the License. You may obtain a copy of the License at
-
-http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-
--->
-<js:View xmlns:fx="http://ns.adobe.com/mxml/2009"
- xmlns:js="library://ns.apache.org/flexjs/basic"
- xmlns:local="*"
- xmlns:acc="org.apache.flex.html.accessories.*"
- className="viewStyles">
-
- <fx:Style>
- .title {
- font-size: 14pt;
- font-weight: bold;
- }
-
- .viewStyles {
- font-family: Arial,sans-serif;
- color: #333;
- background: #f5f5f5;
- font-size: 14px;
- line-height: 1.5;
- }
-
- .h1 {
- font-size: 28px;
- line-height: 1.25;
- font-weight: normal;
- }
-
- </fx:Style>
-
- <fx:Script>
- <![CDATA[
- import org.apache.flex.core.IPopUpHost;
- import org.apache.flex.events.Event;
- import org.apache.flex.utils.UIUtils;
- import org.apache.flex.events.EventDispatcher;
-
- import org.apache.flex.reflection.describeType;
- import org.apache.flex.reflection.getDefinitionByName;
- import org.apache.flex.reflection.MetaDataArgDefinition;
- import org.apache.flex.reflection.MetaDataDefinition;
- import org.apache.flex.reflection.MethodDefinition;
- import org.apache.flex.reflection.TypeDefinition;
- import org.apache.flex.reflection.VariableDefinition;
-
- import testclasses.TestClass1;
- import testclasses.TestClass2;
- import testclasses.ITestInterface;
- import testclasses.ITestInterface2;
- import testclasses.ITestInterface3;
-
-
-
-
- ]]>
- </fx:Script>
- <js:beads>
- <js:ViewDataBinding/>
- <js:HorizontalLayout />
- </js:beads>
- <js:Container id="cont" width="100%" height="700" x="0" y="0">
- <js:beads>
- <js:VerticalLayout />
- </js:beads>
- <js:Container id="header" width="100%" height="100" x="0" y="0">
- <js:beads>
- <js:HorizontalLayout />
- </js:beads>
- <js:Label text="FlexJS Framework Development Unit Tests" className="h1" />
- </js:Container>
- <js:Container id="tests" width="100%" height="100%" x="0" y="100">
- <js:beads>
- <js:HorizontalLayout />
- </js:beads>
-
- </js:Container>
- </js:Container>
-
-</js:View>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/5b6f4ec9/manualtests/GenericTests/testsview/src/controllers/MyController.as
----------------------------------------------------------------------
diff --git a/manualtests/GenericTests/testsview/src/controllers/MyController.as b/manualtests/GenericTests/testsview/src/controllers/MyController.as
deleted file mode 100644
index 43622ff..0000000
--- a/manualtests/GenericTests/testsview/src/controllers/MyController.as
+++ /dev/null
@@ -1,52 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package controllers
-{
- import org.apache.flex.events.Event;
-
- import org.apache.flex.core.Application;
- import org.apache.flex.core.IDocument;
-
- import models.MyModel;
-
- public class MyController implements IDocument
- {
- public function MyController(app:Application = null)
- {
- if (app)
- {
- this.app = app as GenericTests;
- app.addEventListener("viewChanged", viewChangeHandler);
- }
- }
-
- private var app:GenericTests;
-
- private function viewChangeHandler(event:Event):void
- {
- }
-
- public function setDocument(document:Object, id:String = null):void
- {
- this.app = document as GenericTests;
- app.addEventListener("viewChanged", viewChangeHandler);
- }
-
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/5b6f4ec9/manualtests/GenericTests/testsview/src/models/MyModel.as
----------------------------------------------------------------------
diff --git a/manualtests/GenericTests/testsview/src/models/MyModel.as b/manualtests/GenericTests/testsview/src/models/MyModel.as
deleted file mode 100644
index 5a16d02..0000000
--- a/manualtests/GenericTests/testsview/src/models/MyModel.as
+++ /dev/null
@@ -1,125 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package models
-{
- import org.apache.flex.events.Event;
- import org.apache.flex.events.EventDispatcher;
-
- public class MyModel extends EventDispatcher
- {
- public function MyModel()
- {
- }
-
- private var _requestedField:String = "Ask";
-
- [Bindable("requestedFieldChanged")]
- public function get requestedField():String
- {
- return _requestedField;
- }
-
- public function set requestedField(value:String):void
- {
- if (value != _requestedField)
- {
- _requestedField = value;
- dispatchEvent(new Event("requestedFieldChanged"));
- if (_responseData)
- dispatchEvent(new Event("responseTextChanged"));
- }
- }
-
- [Bindable("responseTextChanged")]
- public function get responseText():String
- {
- if (_responseData == null)
- return "";
- if (_responseData == "No Data")
- return _responseData as String;
- var s:String = _responseData[_requestedField];
- if (s == null)
- {
- if (_requestedField == "Ask")
- s = _responseData["Bid"];
- }
- return s;
- }
-
- private var _responseData:Object;
-
- [Bindable("responseDataChanged")]
- public function get responseData():Object
- {
- return _responseData;
- }
-
- public function set responseData(value:Object):void
- {
- if (value != _responseData)
- {
- _responseData = value;
- _allData = "";
- dispatchEvent(new Event("responseDataChanged"));
- dispatchEvent(new Event("responseTextChanged"));
- }
- }
-
- private var _allData:String = "";
-
- [Bindable("responseDataChanged")]
- public function get allData():String
- {
- if (_allData == "" && _responseData != null)
- {
- for (var p:String in _responseData)
- {
- _allData += p + ": " + _responseData[p] + "\n";
- }
- }
- return _allData;
- }
-
-
- private var _stockSymbol:String;
-
- [Bindable("stockSymbolChanged")]
- public function get stockSymbol():String
- {
- return _stockSymbol;
- }
-
- public function set stockSymbol(value:String):void
- {
- if (value != _stockSymbol)
- {
- _stockSymbol = value;
- dispatchEvent(new Event("stockSymbolChanged"));
- }
- }
-
- private var _strings:Array = ["AAPL", "ADBE", "GOOG", "MSFT", "YHOO"];
- [Bindable("__NoChangeEvent__")]
- public function get strings():Array
- {
- return _strings;
- }
-
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/5b6f4ec9/manualtests/GenericTests/testsview/src/models/TestResultsModel.as
----------------------------------------------------------------------
diff --git a/manualtests/GenericTests/testsview/src/models/TestResultsModel.as b/manualtests/GenericTests/testsview/src/models/TestResultsModel.as
deleted file mode 100644
index eedbf54..0000000
--- a/manualtests/GenericTests/testsview/src/models/TestResultsModel.as
+++ /dev/null
@@ -1,40 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package models
-{
- import org.apache.flex.events.Event;
- import org.apache.flex.events.EventDispatcher;
-
- public class TestResultsModel extends EventDispatcher
- {
- public function TestResultsModel()
- {
- }
-
- [Bindable]
- public var completedTests:ArrayList = new ArrayList([]);
-
- public function addCompletedTest(testObj:Object):void{
- completedTests.
- }
-
-
-
- }
-}
\ No newline at end of file
[3/3] git commit: [flex-asjs]
[refs/heads/feature-autobuild/maven-archetypes] - Merge branches 'develop'
and 'feature-autobuild/maven-archetypes' of
https://git-wip-us.apache.org/repos/asf/flex-asjs into
feature-autobuild/maven-archetypes
Posted by cd...@apache.org.
Merge branches 'develop' and 'feature-autobuild/maven-archetypes' of https://git-wip-us.apache.org/repos/asf/flex-asjs into feature-autobuild/maven-archetypes
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/db1eda0a
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/db1eda0a
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/db1eda0a
Branch: refs/heads/feature-autobuild/maven-archetypes
Commit: db1eda0a5685f1d6c5b7da7bdfecaf1b2766b312
Parents: da7d1ac 58e255c
Author: Christofer Dutz <ch...@codecentric.de>
Authored: Thu Sep 29 10:35:16 2016 +0200
Committer: Christofer Dutz <ch...@codecentric.de>
Committed: Thu Sep 29 10:35:16 2016 +0200
----------------------------------------------------------------------
RELEASE_NOTES | 12 +-
.../apache/flex/reflection/TypeDefinition.as | 13 +-
.../apache/flex/reflection/getAliasByClass.as | 8 +-
.../apache/flex/reflection/getClassByAlias.as | 1 +
.../flex/reflection/registerClassAlias.as | 2 +-
.../src/flexUnitTests/ReflectionTester.as | 6 +
.../reflection/ReflectionTesterTest.as | 7 +-
.../reflection/ReflectionTesterTestAlias.as | 90 +++++++++++++
.../reflection/ReflectionTesterTestUseCache.as | 93 ++++++++++++++
.../testsview/src/GenericTestsContainer.mxml | 32 -----
.../testsview/src/MyInitialView.mxml | 96 --------------
.../testsview/src/controllers/MyController.as | 52 --------
.../testsview/src/models/MyModel.as | 125 -------------------
.../testsview/src/models/TestResultsModel.as | 40 ------
14 files changed, 220 insertions(+), 357 deletions(-)
----------------------------------------------------------------------
[2/3] git commit: [flex-asjs]
[refs/heads/feature-autobuild/maven-archetypes] - [FIXES] Fixed interfaces
getter in TypeDefinition, added extra tests,
and fixed issues with Alias support
Posted by cd...@apache.org.
[FIXES] Fixed interfaces getter in TypeDefinition, added extra tests, and fixed issues with Alias support
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/58e255cd
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/58e255cd
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/58e255cd
Branch: refs/heads/feature-autobuild/maven-archetypes
Commit: 58e255cd9790666ff3a54ac4b4b6dc1ed73b5b91
Parents: 5b6f4ec
Author: greg-dove <gr...@gmail.com>
Authored: Thu Sep 29 17:57:31 2016 +1300
Committer: greg-dove <gr...@gmail.com>
Committed: Thu Sep 29 17:57:31 2016 +1300
----------------------------------------------------------------------
RELEASE_NOTES | 12 ++-
.../apache/flex/reflection/TypeDefinition.as | 13 +--
.../apache/flex/reflection/getAliasByClass.as | 8 +-
.../apache/flex/reflection/getClassByAlias.as | 1 +
.../flex/reflection/registerClassAlias.as | 2 +-
.../src/flexUnitTests/ReflectionTester.as | 6 ++
.../reflection/ReflectionTesterTest.as | 7 +-
.../reflection/ReflectionTesterTestAlias.as | 90 +++++++++++++++++++
.../reflection/ReflectionTesterTestUseCache.as | 93 ++++++++++++++++++++
9 files changed, 220 insertions(+), 12 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/58e255cd/RELEASE_NOTES
----------------------------------------------------------------------
diff --git a/RELEASE_NOTES b/RELEASE_NOTES
index ea1ea2d..f768112 100644
--- a/RELEASE_NOTES
+++ b/RELEASE_NOTES
@@ -1,4 +1,4 @@
-Apache FlexJS 0.7.0
+Apache FlexJS 0.8.0
=================
Apache FlexJS is a next-generation Flex SDK that provides the capability
@@ -10,7 +10,17 @@ It is an \u2018beta\u2019 type of release. Expect to find lots of bugs and missing
features.
New Features
+=================
+-more complete Reflection implementation with access to static members, kept metadata and method parameters
+-added cross-platform registerClassAlias/getAliasByClass/getClassByAlias implementations (reflection package)
+
+
+Bug Fixes
---------
+
+
+Apache FlexJS 0.7.0
+=================
- Support for XML contructors and literals as well as E4X.
See here for limitations: https://cwiki.apache.org/confluence/display/FLEX/Using+XML+in+FlexJS
- Support for Typed Node.js
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/58e255cd/frameworks/projects/Reflection/src/main/flex/org/apache/flex/reflection/TypeDefinition.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Reflection/src/main/flex/org/apache/flex/reflection/TypeDefinition.as b/frameworks/projects/Reflection/src/main/flex/org/apache/flex/reflection/TypeDefinition.as
index 7070e5a..346c6ed 100755
--- a/frameworks/projects/Reflection/src/main/flex/org/apache/flex/reflection/TypeDefinition.as
+++ b/frameworks/projects/Reflection/src/main/flex/org/apache/flex/reflection/TypeDefinition.as
@@ -33,17 +33,18 @@ COMPILE::SWF {
public class TypeDefinition extends DefinitionWithMetaData
{
- COMPILE::JS {
+ COMPILE::JS
//js storage support for class aliases
private static var _aliasMappings:Object={};
+ COMPILE::JS
/**
* @private
* @param aliasName
* @param classObject
*/
internal static function registerClassAlias(aliasName:String, classObject:Class ) :void{
- var info:* = classObject.FLEXJS_CLASS_INFO;
+ var info:* = classObject.prototype.FLEXJS_CLASS_INFO;
if (info) {
//a class may have more than one alias point to it, but only the most recently registered
//alias is retained for reflection (applying same approach as swf)
@@ -57,14 +58,16 @@ COMPILE::SWF {
//from the other class's FLEXJS_CLASS_INFO
var altClass:Class = _aliasMappings[aliasName];
if (altClass) {
- var altInfo:* = altClass.FLEXJS_CLASS_INFO;
+ var altInfo:* = altClass.prototype.FLEXJS_CLASS_INFO;
delete altInfo.alias;
}
_aliasMappings[aliasName] = classObject;
info.alias = aliasName;
+
} else throw new Error("registerClassAlias error: classObject is not Reflectable "+classObject);
}
+ COMPILE::JS
/**
* @private
* @param aliasName
@@ -74,8 +77,6 @@ COMPILE::SWF {
return _aliasMappings[aliasName];
}
- }
-
//special cases
@@ -392,7 +393,7 @@ COMPILE::SWF {
var i:uint, n:int;
if (data !== undefined)
{
- var collect:Array = data.interfaces || [];
+ var collect:Array = data.interfaces ? data.interfaces.slice() : [];
var qname:String = data.names[0].qName;
var def:Object = getDefinitionByName(qname);
if ((_kind || kind) == "interface") {
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/58e255cd/frameworks/projects/Reflection/src/main/flex/org/apache/flex/reflection/getAliasByClass.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Reflection/src/main/flex/org/apache/flex/reflection/getAliasByClass.as b/frameworks/projects/Reflection/src/main/flex/org/apache/flex/reflection/getAliasByClass.as
index aebb4c6..6a0f85b 100644
--- a/frameworks/projects/Reflection/src/main/flex/org/apache/flex/reflection/getAliasByClass.as
+++ b/frameworks/projects/Reflection/src/main/flex/org/apache/flex/reflection/getAliasByClass.as
@@ -34,13 +34,15 @@ COMPILE::SWF {
if (classObject == null) throw new TypeError("Parameter classObject must be non-null.");
COMPILE::SWF {
ret= flash.utils.describeType(classObject).@alias;
+ if (ret.length==0) ret = null;
}
COMPILE::JS {
- var info:* = classObject.FLEXJS_CLASS_INFO;
+ var info:* = classObject.prototype.FLEXJS_CLASS_INFO;
if (info) {
- ret = info.alias || "";
- } else ret="";
+ ret = info.alias;
+ if (ret == '') ret = null;
+ } else ret=null;
}
return ret;
}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/58e255cd/frameworks/projects/Reflection/src/main/flex/org/apache/flex/reflection/getClassByAlias.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Reflection/src/main/flex/org/apache/flex/reflection/getClassByAlias.as b/frameworks/projects/Reflection/src/main/flex/org/apache/flex/reflection/getClassByAlias.as
index e59a61b..52604a4 100644
--- a/frameworks/projects/Reflection/src/main/flex/org/apache/flex/reflection/getClassByAlias.as
+++ b/frameworks/projects/Reflection/src/main/flex/org/apache/flex/reflection/getClassByAlias.as
@@ -35,6 +35,7 @@ COMPILE::SWF {
COMPILE::JS {
if (aliasName == null) throw new TypeError("Parameter aliasName must be non-null.");
+ if (aliasName.length==0) throw new TypeError("Parameter aliasName must be non-empty string.");
var klazz:Class = TypeDefinition.getClassByAlias(aliasName);
if (!klazz) throw new ReferenceError("Class "+aliasName+" could not be found.");
return klazz;
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/58e255cd/frameworks/projects/Reflection/src/main/flex/org/apache/flex/reflection/registerClassAlias.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Reflection/src/main/flex/org/apache/flex/reflection/registerClassAlias.as b/frameworks/projects/Reflection/src/main/flex/org/apache/flex/reflection/registerClassAlias.as
index c06bd42..7d2cf16 100644
--- a/frameworks/projects/Reflection/src/main/flex/org/apache/flex/reflection/registerClassAlias.as
+++ b/frameworks/projects/Reflection/src/main/flex/org/apache/flex/reflection/registerClassAlias.as
@@ -31,13 +31,13 @@ COMPILE::SWF {
*/
public function registerClassAlias(aliasName:String, classObject:Class):void {
COMPILE::SWF {
-
flash.net.registerClassAlias(aliasName,classObject);
}
COMPILE::JS {
if (classObject == null) throw new TypeError("Parameter classObject must be non-null.");
if (aliasName == null) throw new TypeError("Parameter aliasName must be non-null.");
+ if (aliasName.length==0) throw new TypeError("Parameter aliasName must be non-empty string.");
TypeDefinition.registerClassAlias(aliasName , classObject);
}
}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/58e255cd/manualtests/GenericTests/src/flexUnitTests/ReflectionTester.as
----------------------------------------------------------------------
diff --git a/manualtests/GenericTests/src/flexUnitTests/ReflectionTester.as b/manualtests/GenericTests/src/flexUnitTests/ReflectionTester.as
index 2feaa14..14a7aa6 100644
--- a/manualtests/GenericTests/src/flexUnitTests/ReflectionTester.as
+++ b/manualtests/GenericTests/src/flexUnitTests/ReflectionTester.as
@@ -24,6 +24,12 @@ package flexUnitTests
[RunWith("org.flexunit.runners.Suite")]
public class ReflectionTester
{
+
+
+ public var reflectionTesterCacheTest:ReflectionTesterTestUseCache;
+
public var reflectionTesterTest:ReflectionTesterTest;
+
+ public var reflectionTesterAliasTest:ReflectionTesterTestAlias;
}
}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/58e255cd/manualtests/GenericTests/src/flexUnitTests/reflection/ReflectionTesterTest.as
----------------------------------------------------------------------
diff --git a/manualtests/GenericTests/src/flexUnitTests/reflection/ReflectionTesterTest.as b/manualtests/GenericTests/src/flexUnitTests/reflection/ReflectionTesterTest.as
index 0ea5126..951e782 100644
--- a/manualtests/GenericTests/src/flexUnitTests/reflection/ReflectionTesterTest.as
+++ b/manualtests/GenericTests/src/flexUnitTests/reflection/ReflectionTesterTest.as
@@ -52,6 +52,8 @@ package flexUnitTests.reflection
[Before]
public function setUp():void
{
+ TestClass2.testStaticVar = "testStaticVar_val";
+ TestClass2.testStaticWriteOnly = "staticAccessor_initial_value";
}
[After]
@@ -284,6 +286,7 @@ package flexUnitTests.reflection
/** static vars **/
variables = def.staticVariables;
+
variable = variables[0];
Assert.assertEquals("unexpected variable name","testStaticVar",variable.name);
meta = variable.retrieveMetaDataByName("TestMeta")[0];
@@ -298,6 +301,8 @@ package flexUnitTests.reflection
/** static accessors **/
accessors = def.staticAccessors;
+
+
testReadOnly = retrieveItemWithName(accessors,"testStaticReadOnly") as AccessorDefinition;
meta = testReadOnly.retrieveMetaDataByName("TestMeta")[0];
Assert.assertEquals("unexpected meta name","TestMeta",meta.name);
@@ -348,7 +353,7 @@ package flexUnitTests.reflection
[Test]
- public function testIntefaceReflection():void{
+ public function testInterfaceReflection():void{
var def:TypeDefinition = describeType(ITestInterface4);
Assert.assertEquals("unexpected kind value","interface",def.kind);
Assert.assertEquals("unexpected interfaces length",3,def.interfaces.length);
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/58e255cd/manualtests/GenericTests/src/flexUnitTests/reflection/ReflectionTesterTestAlias.as
----------------------------------------------------------------------
diff --git a/manualtests/GenericTests/src/flexUnitTests/reflection/ReflectionTesterTestAlias.as b/manualtests/GenericTests/src/flexUnitTests/reflection/ReflectionTesterTestAlias.as
new file mode 100644
index 0000000..7fd5984
--- /dev/null
+++ b/manualtests/GenericTests/src/flexUnitTests/reflection/ReflectionTesterTestAlias.as
@@ -0,0 +1,90 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package flexUnitTests.reflection
+{
+ import flexunit.framework.Assert;
+ import flexUnitTests.reflection.support.*;
+ import org.apache.flex.reflection.*;
+
+ public class ReflectionTesterTestAlias
+ {
+
+ public static var isJS:Boolean;
+ [BeforeClass]
+ public static function setUpBeforeClass():void
+ {
+ var js:Boolean = false;
+ try {
+ var check:* = getDefinitionByName("flash.system.Capabilities");
+ } catch (e:Error) {
+ js = true;
+ }
+ //if this next reference to 'check' is not included, then the above try/catch code
+ //appears to be optimized away in js-release mode
+ //a separate test has been created for this
+ if (check == null) {
+ js = true;
+ }
+ isJS = js;
+ }
+
+ [AfterClass]
+ public static function tearDownAfterClass():void
+ {
+ }
+
+ [Before]
+ public function setUp():void
+ {
+
+ }
+
+ [After]
+ public function tearDown():void
+ {
+
+ }
+
+
+
+
+ [Test]
+ public function testBasicAlias():void {
+ //no initial alias
+ Assert.assertNull(getAliasByClass(TestClass2));
+ registerClassAlias("fjsTest", TestClass2);
+ //alias is registered
+ Assert.assertEquals("unexpected Alias value","fjsTest",getAliasByClass(TestClass2));
+ //register same alias for another class
+ registerClassAlias("fjsTest", TestClass3);
+ //original alias mapping is deregistered
+ Assert.assertNull(getAliasByClass(TestClass2));
+ //alias is registered for new class
+ Assert.assertEquals("unexpected Alias value","fjsTest",getAliasByClass(TestClass3));
+
+ //class is retrievable by alias
+ Assert.assertEquals("unexpected Class value",TestClass3,getClassByAlias("fjsTest"));
+
+
+ }
+
+
+
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/58e255cd/manualtests/GenericTests/src/flexUnitTests/reflection/ReflectionTesterTestUseCache.as
----------------------------------------------------------------------
diff --git a/manualtests/GenericTests/src/flexUnitTests/reflection/ReflectionTesterTestUseCache.as b/manualtests/GenericTests/src/flexUnitTests/reflection/ReflectionTesterTestUseCache.as
new file mode 100644
index 0000000..9722647
--- /dev/null
+++ b/manualtests/GenericTests/src/flexUnitTests/reflection/ReflectionTesterTestUseCache.as
@@ -0,0 +1,93 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package flexUnitTests.reflection
+{
+ import flexunit.framework.Assert;
+ import flexUnitTests.reflection.support.*;
+ import org.apache.flex.reflection.*;
+
+ public class ReflectionTesterTestUseCache
+ {
+
+ public static var isJS:Boolean;
+ [BeforeClass]
+ public static function setUpBeforeClass():void
+ {
+ var js:Boolean = false;
+ try {
+ var check:* = getDefinitionByName("flash.system.Capabilities");
+ } catch (e:Error) {
+ js = true;
+ }
+ //if this next reference to 'check' is not included, then the above try/catch code
+ //appears to be optimized away in js-release mode
+ //a separate test has been created for this
+ if (check == null) {
+ js = true;
+ }
+ isJS = js;
+ }
+
+ [AfterClass]
+ public static function tearDownAfterClass():void
+ {
+ }
+
+ [Before]
+ public function setUp():void
+ {
+ TypeDefinition.useCache = true;
+ TestClass2.testStaticVar = "testStaticVar_val";
+ TestClass2.testStaticWriteOnly = "staticAccessor_initial_value";
+ }
+
+ [After]
+ public function tearDown():void
+ {
+ TypeDefinition.useCache = false;
+ }
+
+ private static function retrieveItemWithName(collection:Array, name:String):DefinitionBase {
+ var ret:DefinitionBase;
+ var i:uint=0,l:uint=collection.length;
+ for (;i<l;i++) {
+ if (collection[i].name==name) {
+ ret = collection[i];
+ break;
+ }
+ }
+
+ return ret;
+ }
+
+
+ [Test]
+ public function testBasicCache():void {
+ var def:TypeDefinition = describeType(TestClass2);
+
+ var def2:TypeDefinition = describeType(TestClass2);
+
+ Assert.assertEquals("cache not working",def,def2);
+
+ }
+
+
+
+ }
+}