as3corelib 0.1.0 → 0.85.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (115) hide show
  1. data/Gemfile +1 -4
  2. data/Gemfile.lock +7 -4
  3. data/README.textile +20 -10
  4. data/Rakefile +32 -2
  5. data/as3corelib.gemspec +13 -11
  6. data/lib/as3corelib.rb +10 -4
  7. data/lib/as3corelib/version.rb +4 -0
  8. metadata +31 -121
  9. data/build/build.properties +0 -48
  10. data/build/build.xml +0 -104
  11. data/examples/JSONExample/JSONExample.mxml +0 -73
  12. data/src/com/adobe/air/crypto/EncryptionKeyGenerator.as +0 -313
  13. data/src/com/adobe/air/filesystem/FileMonitor.as +0 -245
  14. data/src/com/adobe/air/filesystem/FileUtil.as +0 -63
  15. data/src/com/adobe/air/filesystem/VolumeMonitor.as +0 -184
  16. data/src/com/adobe/air/filesystem/events/FileMonitorEvent.as +0 -61
  17. data/src/com/adobe/air/logging/FileTarget.as +0 -95
  18. data/src/com/adobe/air/net/ResourceCache.as +0 -165
  19. data/src/com/adobe/air/net/events/ResourceCacheEvent.as +0 -70
  20. data/src/com/adobe/crypto/HMAC.as +0 -127
  21. data/src/com/adobe/crypto/MD5.as +0 -281
  22. data/src/com/adobe/crypto/MD5Stream.as +0 -402
  23. data/src/com/adobe/crypto/SHA1.as +0 -289
  24. data/src/com/adobe/crypto/SHA224.as +0 -257
  25. data/src/com/adobe/crypto/SHA256.as +0 -261
  26. data/src/com/adobe/crypto/WSSEUsernameToken.as +0 -114
  27. data/src/com/adobe/errors/IllegalStateError.as +0 -63
  28. data/src/com/adobe/fileformats/vcard/Address.as +0 -47
  29. data/src/com/adobe/fileformats/vcard/Email.as +0 -39
  30. data/src/com/adobe/fileformats/vcard/Phone.as +0 -39
  31. data/src/com/adobe/fileformats/vcard/VCard.as +0 -54
  32. data/src/com/adobe/fileformats/vcard/VCardParser.as +0 -246
  33. data/src/com/adobe/images/BitString.as +0 -39
  34. data/src/com/adobe/images/JPGEncoder.as +0 -648
  35. data/src/com/adobe/images/PNGEncoder.as +0 -141
  36. data/src/com/adobe/net/DynamicURLLoader.as +0 -55
  37. data/src/com/adobe/net/IURIResolver.as +0 -76
  38. data/src/com/adobe/net/MimeTypeMap.as +0 -200
  39. data/src/com/adobe/net/URI.as +0 -2466
  40. data/src/com/adobe/net/URIEncodingBitmap.as +0 -139
  41. data/src/com/adobe/net/proxies/RFC2817Socket.as +0 -198
  42. data/src/com/adobe/protocols/dict/Database.as +0 -66
  43. data/src/com/adobe/protocols/dict/Definition.as +0 -71
  44. data/src/com/adobe/protocols/dict/Dict.as +0 -360
  45. data/src/com/adobe/protocols/dict/DictionaryServer.as +0 -60
  46. data/src/com/adobe/protocols/dict/MatchStrategy.as +0 -66
  47. data/src/com/adobe/protocols/dict/Response.as +0 -71
  48. data/src/com/adobe/protocols/dict/events/ConnectedEvent.as +0 -53
  49. data/src/com/adobe/protocols/dict/events/DatabaseEvent.as +0 -67
  50. data/src/com/adobe/protocols/dict/events/DefinitionEvent.as +0 -70
  51. data/src/com/adobe/protocols/dict/events/DefinitionHeaderEvent.as +0 -69
  52. data/src/com/adobe/protocols/dict/events/DictionaryServerEvent.as +0 -69
  53. data/src/com/adobe/protocols/dict/events/DisconnectedEvent.as +0 -55
  54. data/src/com/adobe/protocols/dict/events/ErrorEvent.as +0 -80
  55. data/src/com/adobe/protocols/dict/events/MatchEvent.as +0 -67
  56. data/src/com/adobe/protocols/dict/events/MatchStrategiesEvent.as +0 -70
  57. data/src/com/adobe/protocols/dict/events/NoMatchEvent.as +0 -54
  58. data/src/com/adobe/protocols/dict/util/CompleteResponseEvent.as +0 -68
  59. data/src/com/adobe/protocols/dict/util/SocketHelper.as +0 -81
  60. data/src/com/adobe/serialization/json/JSON.as +0 -86
  61. data/src/com/adobe/serialization/json/JSONDecoder.as +0 -327
  62. data/src/com/adobe/serialization/json/JSONEncoder.as +0 -312
  63. data/src/com/adobe/serialization/json/JSONParseError.as +0 -87
  64. data/src/com/adobe/serialization/json/JSONToken.as +0 -104
  65. data/src/com/adobe/serialization/json/JSONTokenType.as +0 -69
  66. data/src/com/adobe/serialization/json/JSONTokenizer.as +0 -702
  67. data/src/com/adobe/utils/ArrayUtil.as +0 -187
  68. data/src/com/adobe/utils/DateUtil.as +0 -701
  69. data/src/com/adobe/utils/DictionaryUtil.as +0 -87
  70. data/src/com/adobe/utils/IntUtil.as +0 -99
  71. data/src/com/adobe/utils/NumberFormatter.as +0 -74
  72. data/src/com/adobe/utils/StringUtil.as +0 -239
  73. data/src/com/adobe/utils/XMLUtil.as +0 -168
  74. data/src/com/adobe/webapis/ServiceBase.as +0 -48
  75. data/src/com/adobe/webapis/URLLoaderBase.as +0 -108
  76. data/src/com/adobe/webapis/events/ServiceEvent.as +0 -82
  77. data/tests/src/CoreLibTestRunner-app.xml +0 -135
  78. data/tests/src/CoreLibTestRunner.as +0 -138
  79. data/tests/src/CoreLibTestRunner.mxml +0 -46
  80. data/tests/src/com/adobe/air/crypto/EncryptionKeyGeneratorTest.as +0 -176
  81. data/tests/src/com/adobe/air/filesystem/FileMonitorTest.as +0 -63
  82. data/tests/src/com/adobe/air/filesystem/VolumeMonitorTest.as +0 -57
  83. data/tests/src/com/adobe/air/filesystem/events/FileMonitorEventTest.as +0 -59
  84. data/tests/src/com/adobe/air/net/events/ResourceCacheEventTest.as +0 -72
  85. data/tests/src/com/adobe/crypto/HMACMD5Test.as +0 -134
  86. data/tests/src/com/adobe/crypto/HMACSHA1Test.as +0 -138
  87. data/tests/src/com/adobe/crypto/MD5Test.as +0 -82
  88. data/tests/src/com/adobe/crypto/SHA1Test.as +0 -151
  89. data/tests/src/com/adobe/crypto/SHA224Test.as +0 -104
  90. data/tests/src/com/adobe/crypto/SHA256Test.as +0 -116
  91. data/tests/src/com/adobe/crypto/WSSEUsernameTokenTest.as +0 -87
  92. data/tests/src/com/adobe/images/JPGEncoderTest.as +0 -54
  93. data/tests/src/com/adobe/images/PNGEncoderTest.as +0 -54
  94. data/tests/src/com/adobe/net/URITest.as +0 -589
  95. data/tests/src/com/adobe/protocols/events/ConnectedEventTest.as +0 -59
  96. data/tests/src/com/adobe/protocols/events/DatabaseEventTest.as +0 -62
  97. data/tests/src/com/adobe/protocols/events/DefinitionEventTest.as +0 -61
  98. data/tests/src/com/adobe/protocols/events/DefinitionHeaderEventTest.as +0 -61
  99. data/tests/src/com/adobe/protocols/events/DictionaryServerEventTest.as +0 -61
  100. data/tests/src/com/adobe/protocols/events/DisconnectedEventTest.as +0 -59
  101. data/tests/src/com/adobe/protocols/events/ErrorEventTest.as +0 -63
  102. data/tests/src/com/adobe/protocols/events/MatchEventTest.as +0 -61
  103. data/tests/src/com/adobe/protocols/events/MatchStrategiesEventTest.as +0 -61
  104. data/tests/src/com/adobe/protocols/events/NoMatchEventTest.as +0 -58
  105. data/tests/src/com/adobe/protocols/util/CompletedResponseEventTest.as +0 -60
  106. data/tests/src/com/adobe/serialization/json/JSONTest.as +0 -522
  107. data/tests/src/com/adobe/serialization/json/SimpleClass.as +0 -85
  108. data/tests/src/com/adobe/utils/ArrayUtilTest.as +0 -173
  109. data/tests/src/com/adobe/utils/DateUtilTest.as +0 -436
  110. data/tests/src/com/adobe/utils/DictionaryUtilTest.as +0 -93
  111. data/tests/src/com/adobe/utils/IntUtilTest.as +0 -73
  112. data/tests/src/com/adobe/utils/NumberFormatterTest.as +0 -70
  113. data/tests/src/com/adobe/utils/StringUtilTest.as +0 -304
  114. data/tests/src/com/adobe/utils/XMLUtilTest.as +0 -101
  115. data/tests/src/com/adobe/webapis/events/ServiceEventTest.as +0 -66
@@ -1,138 +0,0 @@
1
- /*
2
- Copyright (c) 2008, Adobe Systems Incorporated
3
- All rights reserved.
4
-
5
- Redistribution and use in source and binary forms, with or without
6
- modification, are permitted provided that the following conditions are
7
- met:
8
-
9
- * Redistributions of source code must retain the above copyright notice,
10
- this list of conditions and the following disclaimer.
11
-
12
- * Redistributions in binary form must reproduce the above copyright
13
- notice, this list of conditions and the following disclaimer in the
14
- documentation and/or other materials provided with the distribution.
15
-
16
- * Neither the name of Adobe Systems Incorporated nor the names of its
17
- contributors may be used to endorse or promote products derived from
18
- this software without specific prior written permission.
19
-
20
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
21
- IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22
- THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23
- PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
24
- CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25
- EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26
- PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
27
- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
28
- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
29
- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
30
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31
- */
32
-
33
- import com.adobe.air.crypto.EncryptionKeyGeneratorTest;
34
- import com.adobe.crypto.HMACMD5Test;
35
- import com.adobe.crypto.HMACSHA1Test;
36
- import com.adobe.crypto.MD5Test;
37
- import com.adobe.crypto.SHA1Test;
38
- import com.adobe.crypto.SHA224Test;
39
- import com.adobe.crypto.SHA256Test;
40
- import com.adobe.crypto.WSSEUsernameTokenTest;
41
- import com.adobe.images.JPGEncoderTest;
42
- import com.adobe.images.PNGEncoderTest;
43
- import com.adobe.net.URITest;
44
- import com.adobe.serialization.json.JSONTest;
45
- import com.adobe.utils.ArrayUtilTest;
46
- import com.adobe.utils.DateUtilTest;
47
- import com.adobe.utils.DictionaryUtilTest;
48
- import com.adobe.utils.IntUtilTest;
49
- import com.adobe.utils.NumberFormatterTest;
50
- import com.adobe.utils.StringUtilTest;
51
- import com.adobe.utils.XMLUtilTest;
52
-
53
- import flexunit.framework.TestSuite;
54
- import com.adobe.air.filesystem.VolumeMonitorTest;
55
- import com.adobe.air.filesystem.events.FileMonitorEventTest;
56
- import com.adobe.air.net.events.ResourceCacheEventTest;
57
- import com.adobe.protocols.events.ConnectedEventTest;
58
- import com.adobe.protocols.events.DatabaseEventTest;
59
- import com.adobe.protocols.events.DefinitionEventTest;
60
- import com.adobe.protocols.events.DefinitionHeaderEventTest;
61
- import com.adobe.protocols.events.DictionaryServerEventTest;
62
- import com.adobe.protocols.events.DisconnectedEventTest;
63
- import com.adobe.protocols.events.ErrorEventTest;
64
- import com.adobe.protocols.events.MatchEventTest;
65
- import com.adobe.protocols.events.MatchStrategiesEventTest;
66
- import com.adobe.protocols.events.NoMatchEventTest;
67
- import com.adobe.protocols.util.CompletedResponseEventTest;
68
- import com.adobe.webapis.events.ServiceEventTest;
69
- import com.adobe.air.filesystem.FileMonitorTest;
70
-
71
-
72
- private function onCreationComplete():void
73
- {
74
- testRunner.test = createSuite();
75
- testRunner.startTest();
76
- }
77
-
78
- private function createSuite():TestSuite
79
- {
80
- var ts:TestSuite = new TestSuite();
81
-
82
- // utils
83
- ts.addTestSuite( StringUtilTest );
84
- ts.addTestSuite( NumberFormatterTest );
85
- ts.addTestSuite( ArrayUtilTest );
86
- ts.addTestSuite( DateUtilTest );
87
- ts.addTestSuite( IntUtilTest );
88
- ts.addTestSuite( XMLUtilTest );
89
- ts.addTestSuite( DictionaryUtilTest );
90
-
91
- // crypto
92
- ts.addTestSuite( HMACSHA1Test );
93
- ts.addTestSuite( HMACMD5Test );
94
- ts.addTestSuite( MD5Test );
95
- ts.addTestSuite( SHA1Test );
96
- ts.addTestSuite( SHA224Test );
97
- ts.addTestSuite( SHA256Test );
98
- ts.addTestSuite( WSSEUsernameTokenTest );
99
-
100
- // net
101
- ts.addTestSuite( URITest );
102
-
103
- // serialization
104
- ts.addTestSuite( JSONTest );
105
-
106
- //images
107
- ts.addTestSuite( JPGEncoderTest );
108
- ts.addTestSuite( PNGEncoderTest );
109
-
110
- //protocols.dict
111
- ts.addTestSuite(ConnectedEventTest);
112
- ts.addTestSuite(DatabaseEventTest);
113
- ts.addTestSuite(DefinitionEventTest);
114
- ts.addTestSuite(DefinitionHeaderEventTest);
115
- ts.addTestSuite(DictionaryServerEventTest);
116
- ts.addTestSuite(DisconnectedEventTest);
117
- ts.addTestSuite(ErrorEventTest);
118
- ts.addTestSuite(MatchEventTest);
119
- ts.addTestSuite(MatchStrategiesEventTest);
120
- ts.addTestSuite(NoMatchEventTest);
121
- ts.addTestSuite(CompletedResponseEventTest);
122
-
123
- //webapis
124
- ts.addTestSuite(ServiceEventTest);
125
-
126
- // air.crypto
127
- ts.addTestSuite( EncryptionKeyGeneratorTest );
128
-
129
- //air.filesystem
130
- ts.addTestSuite(VolumeMonitorTest);
131
- ts.addTestSuite(FileMonitorTest);
132
- ts.addTestSuite(FileMonitorEventTest);
133
-
134
- //air.net
135
- ts.addTestSuite(ResourceCacheEventTest);
136
-
137
- return ts;
138
- }
@@ -1,46 +0,0 @@
1
- <?xml version="1.0" encoding="utf-8"?>
2
-
3
- <!--
4
- Copyright (c) 2008, Adobe Systems Incorporated
5
- All rights reserved.
6
-
7
- Redistribution and use in source and binary forms, with or without
8
- modification, are permitted provided that the following conditions are
9
- met:
10
-
11
- * Redistributions of source code must retain the above copyright notice,
12
- this list of conditions and the following disclaimer.
13
-
14
- * Redistributions in binary form must reproduce the above copyright
15
- notice, this list of conditions and the following disclaimer in the
16
- documentation and/or other materials provided with the distribution.
17
-
18
- * Neither the name of Adobe Systems Incorporated nor the names of its
19
- contributors may be used to endorse or promote products derived from
20
- this software without specific prior written permission.
21
-
22
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
23
- IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
24
- THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
25
- PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
26
- CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
27
- EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
28
- PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
29
- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
30
- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
31
- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33
- -->
34
-
35
- <mx:Application
36
- xmlns:mx="http://www.adobe.com/2006/mxml" xmlns="*"
37
- xmlns:flexunit="flexunit.flexui.*"
38
- creationComplete="onCreationComplete()">
39
-
40
- <mx:Script source="CoreLibTestRunner.as" />
41
-
42
- <mx:Canvas width="100%" height="100%">
43
- <flexunit:TestRunnerBase id="testRunner" width="100%" height="100%" />
44
-
45
- </mx:Canvas>
46
- </mx:Application>
@@ -1,176 +0,0 @@
1
- /*
2
- Copyright (c) 2008, Adobe Systems Incorporated
3
- All rights reserved.
4
-
5
- Redistribution and use in source and binary forms, with or without
6
- modification, are permitted provided that the following conditions are
7
- met:
8
-
9
- * Redistributions of source code must retain the above copyright notice,
10
- this list of conditions and the following disclaimer.
11
-
12
- * Redistributions in binary form must reproduce the above copyright
13
- notice, this list of conditions and the following disclaimer in the
14
- documentation and/or other materials provided with the distribution.
15
-
16
- * Neither the name of Adobe Systems Incorporated nor the names of its
17
- contributors may be used to endorse or promote products derived from
18
- this software without specific prior written permission.
19
-
20
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
21
- IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22
- THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23
- PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
24
- CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25
- EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26
- PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
27
- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
28
- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
29
- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
30
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31
- */
32
-
33
- package com.adobe.air.crypto
34
- {
35
-
36
- import flash.data.EncryptedLocalStore;
37
- import flash.utils.ByteArray;
38
-
39
- import flexunit.framework.TestCase;
40
-
41
- import mx.utils.Base64Encoder;
42
-
43
- public class EncryptionKeyGeneratorTest extends TestCase {
44
-
45
- private const ELS_KEY:String = "EncryptionKeyGeneratorTest";
46
- private const DEFAULT_ELS_KEY:String = "com.adobe.air.crypto::EncryptedDBSalt$$$";
47
-
48
- public function EncryptionKeyGeneratorTest( methodName:String = null ) {
49
- super( methodName );
50
- }
51
-
52
- override public function setUp():void
53
- {
54
- var salt:ByteArray = new ByteArray();
55
- salt.writeUnsignedInt(1989196088);
56
- salt.writeUnsignedInt(4188830919);
57
- salt.writeUnsignedInt(3631556863);
58
- salt.writeUnsignedInt(2543121849);
59
- salt.writeUnsignedInt(3166585847);
60
- salt.writeUnsignedInt(4225038051);
61
- salt.writeUnsignedInt(3182011233);
62
- salt.writeUnsignedInt(152503506);
63
-
64
- EncryptedLocalStore.setItem(ELS_KEY, salt);
65
- }
66
-
67
- override public function tearDown():void
68
- {
69
- EncryptedLocalStore.removeItem(ELS_KEY);
70
- EncryptedLocalStore.removeItem(DEFAULT_ELS_KEY);
71
- }
72
-
73
- public function test_validateStrongPassword():void
74
- {
75
- var keyGen:EncryptionKeyGenerator = new EncryptionKeyGenerator();
76
- assertTrue(keyGen.validateStrongPassword("ABcd95$bal"));
77
- assertFalse(keyGen.validateStrongPassword("password"));
78
- assertFalse(keyGen.validateStrongPassword("PassWord"));
79
- assertTrue(keyGen.validateStrongPassword("pa$$Word"));
80
- }
81
-
82
- public function test_getEncryptionKey():void
83
- {
84
- var keyGen:EncryptionKeyGenerator = new EncryptionKeyGenerator();
85
- var encoder:Base64Encoder = new Base64Encoder();
86
- encoder.encodeBytes(keyGen.getEncryptionKey("pa$$Word", ELS_KEY));
87
- assertEquals(encoder.toString(), "oy1N2GAxVFC7vCa0A2wP+Q==");
88
- }
89
-
90
- public function test_getEncryptionKeyAgain():void
91
- {
92
- var keyGen:EncryptionKeyGenerator = new EncryptionKeyGenerator();
93
- var attempt1:ByteArray = keyGen.getEncryptionKey("ABcd95$bal");
94
- var attempt2:ByteArray = keyGen.getEncryptionKey("ABcd95$bal");
95
-
96
- var encoder1:Base64Encoder = new Base64Encoder();
97
- encoder1.encodeBytes(attempt1);
98
- var encoder2:Base64Encoder = new Base64Encoder();
99
- encoder2.encodeBytes(attempt2);
100
-
101
- assertEquals(encoder1.toString(), encoder2.toString());
102
- }
103
-
104
-
105
-
106
-
107
-
108
- // public function testSHA256():void {
109
- //
110
- //
111
- // // from the spec ( http://csrc.nist.gov/publications/fips/fips180-2/fips180-2withchangenotice.pdf )
112
- // assertSHA256( "abc", "ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad" );
113
- // assertSHA256( "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq", "248d6a61d20638b8e5c026930c3e6039a33ce45964ff2167f6ecedd419db06c1");
114
- //
115
- // var millionAs:String = new String("");
116
- // for ( var i:int = 0; i < 1000000; i++ ) {
117
- // millionAs += "a";
118
- // }
119
- // assertSHA256( millionAs, "cdc76e5c9914fb9281a1c7e284d73e67f1809a48a497200e046d39ccc7112cd0" );
120
- //
121
- // // from wikipedia
122
- // assertSHA256( "The quick brown fox jumps over the lazy dog", "d7a8fbb307d7809469ca9abcb0082e4f8d5651e46d3cdb762d02d0bf37c9e592" );
123
- // assertSHA256( "The quick brown fox jumps over the lazy cog", "e4c4d8f3bf76b692de791a173e05321150f7a345b46484fe427f6acc7ecc81be" );
124
- // assertSHA256( "", "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" );
125
- //
126
- // }
127
- //
128
- // public function testSHA256Binary():void {
129
- //
130
- // // from the spec ( http://csrc.nist.gov/publications/fips/fips180-2/fips180-2withchangenotice.pdf )
131
- // assertSHA256Binary( "abc", "ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad" );
132
- // assertSHA256Binary( "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq", "248d6a61d20638b8e5c026930c3e6039a33ce45964ff2167f6ecedd419db06c1");
133
- //
134
- // var millionAs:String = new String("");
135
- // for ( var i:int = 0; i < 1000000; i++ ) {
136
- // millionAs += "a";
137
- // }
138
- // assertSHA256Binary( millionAs, "cdc76e5c9914fb9281a1c7e284d73e67f1809a48a497200e046d39ccc7112cd0" );
139
- //
140
- // // from wikipedia
141
- // assertSHA256Binary( "The quick brown fox jumps over the lazy dog", "d7a8fbb307d7809469ca9abcb0082e4f8d5651e46d3cdb762d02d0bf37c9e592" );
142
- // assertSHA256Binary( "The quick brown fox jumps over the lazy cog", "e4c4d8f3bf76b692de791a173e05321150f7a345b46484fe427f6acc7ecc81be" );
143
- // assertSHA256Binary( "", "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" );
144
- //
145
- // }
146
- //
147
- // public function testSHA256Base64():void {
148
- //
149
- // }
150
- //
151
- // private function assertSHA256( value:String, expected:String ):void {
152
- // var result:String = SHA256.hash( value );
153
- //
154
- // assertTrue( "Hash of '" + value + "' returned wrong value ('" + result + "')",
155
- // result == expected );
156
- // }
157
- //
158
- // private function assertSHA256Binary(value:String, expected:String):void {
159
- //
160
- // var byteArray:ByteArray = new ByteArray();
161
- // byteArray.writeUTFBytes(value);
162
- //
163
- // var result:String = SHA256.hashBytes( byteArray );
164
- // assertTrue( "Hash of '" + value + "' returned wrong value ('" + result + "')",
165
- // result == expected );
166
- // }
167
- //
168
- // private function assertSHA256Base64( value:String, expected:String ):void {
169
- // var result:String = SHA256.hashToBase64( value );
170
- //
171
- // assertTrue( "Hash of '" + value + "' returned wrong value ('" + result + "')",
172
- // result == expected );
173
- // }
174
- //
175
- }
176
- }
@@ -1,63 +0,0 @@
1
- /*
2
- Copyright (c) 2009, Adobe Systems Incorporated
3
- All rights reserved.
4
-
5
- Redistribution and use in source and binary forms, with or without
6
- modification, are permitted provided that the following conditions are
7
- met:
8
-
9
- * Redistributions of source code must retain the above copyright notice,
10
- this list of conditions and the following disclaimer.
11
-
12
- * Redistributions in binary form must reproduce the above copyright
13
- notice, this list of conditions and the following disclaimer in the
14
- documentation and/or other materials provided with the distribution.
15
-
16
- * Neither the name of Adobe Systems Incorporated nor the names of its
17
- contributors may be used to endorse or promote products derived from
18
- this software without specific prior written permission.
19
-
20
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
21
- IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22
- THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23
- PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
24
- CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25
- EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26
- PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
27
- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
28
- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
29
- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
30
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31
- */
32
-
33
- package com.adobe.air.filesystem
34
- {
35
- import flexunit.framework.TestCase;
36
- import flash.filesystem.File;
37
-
38
- public class FileMonitorTest extends TestCase
39
- {
40
- public function FileMonitorTest(methodName:String=null)
41
- {
42
- super(methodName);
43
- }
44
-
45
- public function test_interval():void
46
- {
47
- var vm1:FileMonitor = new FileMonitor();
48
- assertTrue("2000 == vm1.interval", FileMonitor.DEFAULT_MONITOR_INTERVAL == vm1.interval);
49
-
50
- var vm2:FileMonitor = new FileMonitor(null, 3000);
51
- assertTrue("3000 == vm2.interval", 3000 == vm2.interval);
52
-
53
- var vm3:FileMonitor = new FileMonitor(null, 500);
54
- assertTrue("1000 == vm3.interval", 1000 == vm3.interval);
55
-
56
- var f:File = File.desktopDirectory;
57
-
58
- var vm4:FileMonitor = new FileMonitor(f);
59
- assertTrue("f == vm4.file", f == vm4.file);
60
- }
61
-
62
- }
63
- }
@@ -1,57 +0,0 @@
1
- /*
2
- Copyright (c) 2009, Adobe Systems Incorporated
3
- All rights reserved.
4
-
5
- Redistribution and use in source and binary forms, with or without
6
- modification, are permitted provided that the following conditions are
7
- met:
8
-
9
- * Redistributions of source code must retain the above copyright notice,
10
- this list of conditions and the following disclaimer.
11
-
12
- * Redistributions in binary form must reproduce the above copyright
13
- notice, this list of conditions and the following disclaimer in the
14
- documentation and/or other materials provided with the distribution.
15
-
16
- * Neither the name of Adobe Systems Incorporated nor the names of its
17
- contributors may be used to endorse or promote products derived from
18
- this software without specific prior written permission.
19
-
20
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
21
- IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22
- THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23
- PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
24
- CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25
- EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26
- PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
27
- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
28
- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
29
- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
30
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31
- */
32
-
33
- package com.adobe.air.filesystem
34
- {
35
- import flexunit.framework.TestCase;
36
-
37
- public class VolumeMonitorTest extends TestCase
38
- {
39
- public function VolumeMonitorTest(methodName:String=null)
40
- {
41
- super(methodName);
42
- }
43
-
44
- public function test_interval():void
45
- {
46
-
47
- var vm1:VolumeMonitor = new VolumeMonitor();
48
- assertTrue("2000 == vm1.interval", 2000 == vm1.interval);
49
-
50
- var vm2:VolumeMonitor = new VolumeMonitor(3000);
51
- assertTrue("3000 == vm2.interval", 3000 == vm2.interval);
52
-
53
- var vm3:VolumeMonitor = new VolumeMonitor(500);
54
- assertTrue("1000 == vm3.interval", 1000 == vm3.interval);
55
- }
56
- }
57
- }