You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by jm...@apache.org on 2014/07/27 07:06:52 UTC
[1/2] git commit: [flex-utilities] [refs/heads/develop] - added tests
for istrue and isfalse
Repository: flex-utilities
Updated Branches:
refs/heads/develop 2d9ca31c6 -> 861b586fe
added tests for istrue and isfalse
Project: http://git-wip-us.apache.org/repos/asf/flex-utilities/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-utilities/commit/cdc7e987
Tree: http://git-wip-us.apache.org/repos/asf/flex-utilities/tree/cdc7e987
Diff: http://git-wip-us.apache.org/repos/asf/flex-utilities/diff/cdc7e987
Branch: refs/heads/develop
Commit: cdc7e9876197cd6416c6a68f1ff2040be0f2b888
Parents: 2d9ca31
Author: Justin Mclean <jm...@apache.org>
Authored: Sun Jul 27 15:04:24 2014 +1000
Committer: Justin Mclean <jm...@apache.org>
Committed: Sun Jul 27 15:04:24 2014 +1000
----------------------------------------------------------------------
ant_on_air/tests/test.xml | 53 ++++++++++++++++++++++++++++++++++++++----
1 file changed, 48 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/cdc7e987/ant_on_air/tests/test.xml
----------------------------------------------------------------------
diff --git a/ant_on_air/tests/test.xml b/ant_on_air/tests/test.xml
index 9523536..fa4ea4d 100644
--- a/ant_on_air/tests/test.xml
+++ b/ant_on_air/tests/test.xml
@@ -49,7 +49,7 @@
<os family="windows"/>
</condition>
- <target name="test" depends="copy-test,confirm-delete,delete-test,freespace-test">
+ <target name="test" depends="copy-test,confirm-delete,delete-test,freespace-test,true-false-test">
<tstamp />
<echo>${DSTAMP}</echo>
<echo>${TSTAMP}</echo>
@@ -65,7 +65,7 @@
<echo>Test is complete</echo>
</target>
- <target name="copy-test" >
+ <target name="copy-test">
<echo>FLEX_HOME is ${FLEX_HOME}. DEBUG is ${DEBUG_FLAG}. The OS is ${theOS}</echo>
<mkdir dir="${basedir}/temp" />
<copy file="${basedir}/test.xml" tofile="${basedir}/temp/copied.xml" />
@@ -245,11 +245,10 @@
</not>
</condition>
</fail>
- <echo>Touch test ${touch.test}. Should say: passed</echo>
-
+ <echo>Touch test ${touch.test}. Should say: passed</echo>
</target>
- <target name="delete-test" >
+ <target name="delete-test">
<fail message="you were supposed to hit 'y'" >
<condition>
<equals arg1="n" arg2="${oktodelete}" />
@@ -286,6 +285,50 @@
</condition>
</fail>
</target>
+
+ <target name="true-false-test">
+ <fail message="istrue isn't true">
+ <condition>
+ <not>
+ <and>
+ <istrue value="true" />
+ <istrue value="on" />
+ <istrue value="yes" />
+ </and>
+ </not>
+ </condition>
+ </fail>
+ <fail message="istrue is false">
+ <condition>
+ <or>
+ <istrue value="false" />
+ <istrue value="off" />
+ <istrue value="no" />
+ </or>
+ </condition>
+ </fail>
+ <fail message="isfalse isn't false">
+ <condition>
+ <not>
+ <and>
+ <isfalse value="false" />
+ <isfalse value="off" />
+ <isfalse value="no" />
+ </and>
+ </not>
+ </condition>
+ </fail>
+ <fail message="isfalse is true">
+ <condition>
+ <or>
+ <isfalse value="true" />
+ <isfalse value="on" />
+ <isfalse value="yes" />
+ </or>
+ </condition>
+ </fail>
+ <echo>All istrue / isfalse tests pass</echo>
+ </target>
<target name="macunzip" unless="isWindows">
<mkdir dir="${basedir}/temp/untar" />
[2/2] git commit: [flex-utilities] [refs/heads/develop] - added
istrue and isfalse
Posted by jm...@apache.org.
added istrue and isfalse
Project: http://git-wip-us.apache.org/repos/asf/flex-utilities/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-utilities/commit/861b586f
Tree: http://git-wip-us.apache.org/repos/asf/flex-utilities/tree/861b586f
Diff: http://git-wip-us.apache.org/repos/asf/flex-utilities/diff/861b586f
Branch: refs/heads/develop
Commit: 861b586fe839fd23088c6f72b180c56745d246f9
Parents: cdc7e98
Author: Justin Mclean <jm...@apache.org>
Authored: Sun Jul 27 15:06:33 2014 +1000
Committer: Justin Mclean <jm...@apache.org>
Committed: Sun Jul 27 15:06:33 2014 +1000
----------------------------------------------------------------------
ant_on_air/src/AntClasses.as | 2 +
.../src/org/apache/flex/ant/tags/IsFalse.as | 53 ++++++++++++++++++++
.../src/org/apache/flex/ant/tags/IsTrue.as | 53 ++++++++++++++++++++
3 files changed, 108 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/861b586f/ant_on_air/src/AntClasses.as
----------------------------------------------------------------------
diff --git a/ant_on_air/src/AntClasses.as b/ant_on_air/src/AntClasses.as
index e9ab7de..aa60c73 100644
--- a/ant_on_air/src/AntClasses.as
+++ b/ant_on_air/src/AntClasses.as
@@ -43,8 +43,10 @@ package
import org.apache.flex.ant.tags.Get; Get;
import org.apache.flex.ant.tags.HasFreeSpace; HasFreeSpace;
import org.apache.flex.ant.tags.Input; Input;
+ import org.apache.flex.ant.tags.IsFalse; IsFalse;
import org.apache.flex.ant.tags.IsReference; IsReference;
import org.apache.flex.ant.tags.IsSet; IsSet;
+ import org.apache.flex.ant.tags.IsTrue; IsTrue;
import org.apache.flex.ant.tags.LoadProperties; LoadProperties;
import org.apache.flex.ant.tags.Matches; Matches;
import org.apache.flex.ant.tags.Mkdir; Mkdir;
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/861b586f/ant_on_air/src/org/apache/flex/ant/tags/IsFalse.as
----------------------------------------------------------------------
diff --git a/ant_on_air/src/org/apache/flex/ant/tags/IsFalse.as b/ant_on_air/src/org/apache/flex/ant/tags/IsFalse.as
new file mode 100644
index 0000000..7019d35
--- /dev/null
+++ b/ant_on_air/src/org/apache/flex/ant/tags/IsFalse.as
@@ -0,0 +1,53 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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 org.apache.flex.ant.tags
+{
+ import mx.core.IFlexModuleFactory;
+
+ import org.apache.flex.ant.Ant;
+ import org.apache.flex.ant.tags.supportClasses.IValueTagHandler;
+ import org.apache.flex.ant.tags.supportClasses.TagHandler;
+
+ [Mixin]
+ public class IsFalse extends TagHandler implements IValueTagHandler
+ {
+ public static function init(mf:IFlexModuleFactory):void
+ {
+ Ant.antTagProcessors["isfalse"] = IsFalse;
+ }
+
+ public function IsFalse()
+ {
+ super();
+ }
+
+ private function get value():String
+ {
+ return getAttributeValue("@value");
+ }
+
+ public function getValue(context:Object):Object
+ {
+ this.context = context;
+
+ return !(value == "true" || value == "on" || value == "yes");
+ }
+
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/861b586f/ant_on_air/src/org/apache/flex/ant/tags/IsTrue.as
----------------------------------------------------------------------
diff --git a/ant_on_air/src/org/apache/flex/ant/tags/IsTrue.as b/ant_on_air/src/org/apache/flex/ant/tags/IsTrue.as
new file mode 100644
index 0000000..9234be4
--- /dev/null
+++ b/ant_on_air/src/org/apache/flex/ant/tags/IsTrue.as
@@ -0,0 +1,53 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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 org.apache.flex.ant.tags
+{
+ import mx.core.IFlexModuleFactory;
+
+ import org.apache.flex.ant.Ant;
+ import org.apache.flex.ant.tags.supportClasses.IValueTagHandler;
+ import org.apache.flex.ant.tags.supportClasses.TagHandler;
+
+ [Mixin]
+ public class IsTrue extends TagHandler implements IValueTagHandler
+ {
+ public static function init(mf:IFlexModuleFactory):void
+ {
+ Ant.antTagProcessors["istrue"] = IsTrue;
+ }
+
+ public function IsTrue()
+ {
+ super();
+ }
+
+ private function get value():String
+ {
+ return getAttributeValue("@value");
+ }
+
+ public function getValue(context:Object):Object
+ {
+ this.context = context;
+
+ return (value == "true" || value == "on" || value == "yes");
+ }
+
+ }
+}
\ No newline at end of file