Return-Path: X-Original-To: apmail-shindig-commits-archive@www.apache.org Delivered-To: apmail-shindig-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id AE89699B5 for ; Thu, 8 Dec 2011 23:09:36 +0000 (UTC) Received: (qmail 48391 invoked by uid 500); 8 Dec 2011 23:09:36 -0000 Delivered-To: apmail-shindig-commits-archive@shindig.apache.org Received: (qmail 48371 invoked by uid 500); 8 Dec 2011 23:09:36 -0000 Mailing-List: contact commits-help@shindig.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@shindig.apache.org Delivered-To: mailing list commits@shindig.apache.org Received: (qmail 48364 invoked by uid 99); 8 Dec 2011 23:09:36 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Dec 2011 23:09:36 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Dec 2011 23:09:28 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 4E2D72388A64; Thu, 8 Dec 2011 23:09:05 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1212179 [3/3] - in /shindig/trunk: ./ config/ extras/src/main/javascript/features-extras/analytics/ features/src/main/javascript/features/ features/src/main/javascript/features/auth-refresh/ features/src/main/javascript/features/caja/ feat... Date: Thu, 08 Dec 2011 23:08:57 -0000 To: commits@shindig.apache.org From: bhofmann@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20111208230905.4E2D72388A64@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Modified: shindig/trunk/php/test/social/ActivityTest.php URL: http://svn.apache.org/viewvc/shindig/trunk/php/test/social/ActivityTest.php?rev=1212179&r1=1212178&r2=1212179&view=diff ============================================================================== --- shindig/trunk/php/test/social/ActivityTest.php (original) +++ shindig/trunk/php/test/social/ActivityTest.php Thu Dec 8 23:08:47 2011 @@ -1,4 +1,7 @@ curlRest($url, $postData, $postDataFormat); $album = json_decode($ret, true); $album = $album['entry']; - + $ret = $this->curlRest($url . '/' . urlencode($album['id']), '', 'application/json', 'GET'); $this->assertFalse(empty($ret)); $fetched = json_decode($ret, true); @@ -35,7 +37,7 @@ class AlbumRestTest extends RestBase { $this->assertEquals('Example Album', $fetched['title'], "Title should be same."); $this->assertEquals('This is an example album, and this text is an example description', $fetched['description'], "Description should be same."); $this->assertEquals('VIDEO', $fetched['mediaType'], "mediaType should be same."); - + $fetched['thumbnailUrl'] = 'http://changed.com/tn.png'; $ret = $this->curlRest($url . '/' . urlencode($album['id']), json_encode($fetched), 'application/json', 'PUT'); $ret = $this->curlRest($url . '/' . urlencode($album['id']), '', 'application/json', 'GET'); @@ -46,16 +48,16 @@ class AlbumRestTest extends RestBase { $this->assertEquals('Example Album', $fetched['title'], "Title should be same."); $this->assertEquals('This is an example album, and this text is an example description', $fetched['description'], "Description should be same."); $this->assertEquals('VIDEO', $fetched['mediaType'], "mediaType should be same."); - + $ret = $this->curlRest($url . '/' . urlencode($album['id']), '', 'application/json', 'DELETE'); $this->assertTrue(empty($ret), "Delete the created album failed. Response: $ret"); - + $ret = $this->curlRest($url . '/' . urlencode($album['id']), '', 'application/json', 'GET'); $fetched = json_decode($ret, true); $fetched = $fetched['entry']; $this->assertTrue(empty($fetched)); } - + public function testLifeCycleInJson() { $postData = '{ "id" : "44332211", "thumbnailUrl" : "http://pages.example.org/albums/4433221-tn.png", @@ -65,10 +67,10 @@ class AlbumRestTest extends RestBase { "ownerId" : "example.org:55443322", "mediaType" : "VIDEO" }'; - + $this->verifyLifeCycle($postData, 'application/json'); } - + public function testLifeCycleInXml() { $postData = ' 44332211 @@ -84,7 +86,7 @@ class AlbumRestTest extends RestBase { '; $this->verifyLifeCycle($postData, 'application/xml'); } - + public function testLifeCycleInAtom() { $postData = ' Modified: shindig/trunk/php/test/social/ApiCollectionTest.php URL: http://svn.apache.org/viewvc/shindig/trunk/php/test/social/ApiCollectionTest.php?rev=1212179&r1=1212178&r2=1212179&view=diff ============================================================================== --- shindig/trunk/php/test/social/ApiCollectionTest.php (original) +++ shindig/trunk/php/test/social/ApiCollectionTest.php Thu Dec 8 23:08:47 2011 @@ -1,4 +1,7 @@ curlRest('/appdata/1/@self/1?fields=pokes,last_poke', '', 'application/json', 'DELETE'); - $this->assertTrue(empty($ret), "Delete app data failed. $ret"); + $this->assertTrue(empty($ret), "Delete app data failed. $ret"); } - + public function testAppDataLifeCycleInXml() { $postData = ' @@ -57,7 +59,7 @@ class AppDataRestTest extends RestBase { // Creates or update the app data. $ret = $this->curlRest('/appdata/1/@self/1', $postData, 'application/xml'); $this->assertTrue(empty($ret), "Create app data failed. $ret"); - + // Verifies data was written correctly. $ret = $this->curlRest('/appdata/1/@self/1?fields=pokes,last_poke', '', 'application/json', 'GET'); $retDecoded = json_decode($ret, true); @@ -66,7 +68,7 @@ class AppDataRestTest extends RestBase { && isset($retDecoded['entry'][1]['last_poke']) && isset($retDecoded['entry'][1]['pokes']) && $retDecoded['entry'][1]['last_poke'] == '2008-02-13T18:30:02Z' && $retDecoded['entry'][1]['pokes'] == '1', "Unexpected return value: $ret."); - + // Updates the app data. $updateData = ' @@ -80,7 +82,7 @@ class AppDataRestTest extends RestBase { '; $ret = $this->curlRest('/appdata/1/@self/1', $updateData, 'application/xml'); $this->assertTrue(empty($ret), "Update app data failed. $ret"); - + // Verifies data was written correctly. $ret = $this->curlRest('/appdata/1/@self/1?fields=pokes,last_poke', '', 'application/json', 'GET'); $retDecoded = json_decode($ret, true); @@ -89,16 +91,16 @@ class AppDataRestTest extends RestBase { && isset($retDecoded['entry'][1]['last_poke']) && isset($retDecoded['entry'][1]['pokes']) && $retDecoded['entry'][1]['last_poke'] == '2009-02-13T18:30:02Z' && $retDecoded['entry'][1]['pokes'] == '100', "Unexpected return value: $ret."); - + // Deletes the app data. $ret = $this->curlRest('/appdata/1/@self/1?fields=pokes,last_poke', '', 'application/json', 'DELETE'); - $this->assertTrue(empty($ret), "Delete app data failed. $ret"); + $this->assertTrue(empty($ret), "Delete app data failed. $ret"); } - + public function testAppDataLifeCycleInAtom() { $postData = ' - + 2 2003-12-14T18:30:02Z @@ -121,6 +123,6 @@ class AppDataRestTest extends RestBase { && $retDecoded['entry'][1]['pokes'] == '2', "Unexpected return value: $ret\n"); // Deletes the app data. $ret = $this->curlRest('/appdata/1/@self/1?fields=pokes,last_poke', '', 'application/json', 'DELETE'); - $this->assertTrue(empty($ret), "Delete app data failed. $ret"); + $this->assertTrue(empty($ret), "Delete app data failed. $ret"); } } Modified: shindig/trunk/php/test/social/BodyTypeTest.php URL: http://svn.apache.org/viewvc/shindig/trunk/php/test/social/BodyTypeTest.php?rev=1212179&r1=1212178&r2=1212179&view=diff ============================================================================== --- shindig/trunk/php/test/social/BodyTypeTest.php (original) +++ shindig/trunk/php/test/social/BodyTypeTest.php Thu Dec 8 23:08:47 2011 @@ -1,4 +1,7 @@ cache = Cache::createCache('CacheStorageFile', 'TestCache'); + $this->cache = Cache::createCache('apache\shindig\common\sample\CacheStorageFile', 'TestCache'); $this->service = new DefaultInvalidateService($this->cache); } @@ -70,7 +77,7 @@ class DefaultInvalidateServiceTest exten $this->assertFalse($this->cache->get($request1->toHash())); $this->assertFalse($this->cache->get($request2->toHash())); } - + public function testInvalidateUserResources() { $token = BasicSecurityToken::createFromValues('owner', 'viewer', 'app', 'domain', 'appUrl', '1', 'default'); $token->setAuthenticationMode(AuthenticationMode::$OAUTH_CONSUMER_REQUEST); Modified: shindig/trunk/php/test/social/EmailTest.php URL: http://svn.apache.org/viewvc/shindig/trunk/php/test/social/EmailTest.php?rev=1212179&r1=1212178&r2=1212179&view=diff ============================================================================== --- shindig/trunk/php/test/social/EmailTest.php (original) +++ shindig/trunk/php/test/social/EmailTest.php Thu Dec 8 23:08:47 2011 @@ -1,4 +1,7 @@ curlRest('/groups/john.doe', '', 'application/json', 'GET'); $retDecoded = json_decode($ret, true); $this->assertTrue($ret != $retDecoded && $ret != null, "Invalid json string in return: $ret."); $this->assertTrue(isset($retDecoded['entry']) && isset($retDecoded['entry']["john.doe"]) - && isset($retDecoded['entry']["john.doe"][0]) - && $retDecoded['entry']["john.doe"][0] == '1', "Unexpected return value: $ret."); + && isset($retDecoded['entry']["john.doe"][0]) + && $retDecoded['entry']["john.doe"][0] == '1', "Unexpected return value: $ret."); } } Modified: shindig/trunk/php/test/social/IdSpecTest.php URL: http://svn.apache.org/viewvc/shindig/trunk/php/test/social/IdSpecTest.php?rev=1212179&r1=1212178&r2=1212179&view=diff ============================================================================== --- shindig/trunk/php/test/social/IdSpecTest.php (original) +++ shindig/trunk/php/test/social/IdSpecTest.php Thu Dec 8 23:08:47 2011 @@ -1,4 +1,7 @@ curlRest($url, $postData, 'application/json'); $this->assertFalse(empty($ret)); $album = json_decode($ret, true); $this->album = $album['entry']; } - + protected function tearDown() { // $url = '/albums/1/@self'; // $ret = $this->curlRest($url . '/' . urlencode($this->album['id']), '', 'application/json', 'DELETE'); // $this->assertTrue(empty($ret), "Delete the created album failed. Response: $ret"); } - + private function verifyLifeCycle($postData, $postDataFormat) { $url = '/mediaitems/1/@self/' . $this->album['id']; $ret = $this->curlRest($url, $postData, $postDataFormat); $mediaItem = json_decode($ret, true); $mediaItem = $mediaItem['entry']; - + $ret = $this->curlRest($url . '/' . urlencode($mediaItem['id']), '', 'application/json', 'GET'); $this->assertFalse(empty($ret)); $fetched = json_decode($ret, true); @@ -67,16 +69,16 @@ class MediaItemRestTest extends RestBase $this->assertEquals('http://changed.com/tn.png', $fetched['thumbnailUrl'], "thumbnailUrl should be same."); $this->assertEquals('image/png', $fetched['mimeType'], "mimeType should be same."); $this->assertEquals('IMAGE', $fetched['type'], "type should be same."); - + $ret = $this->curlRest($url . '/' . urlencode($mediaItem['id']), '', 'application/json', 'DELETE'); $this->assertTrue(empty($ret), "Delete the created mediaItem failed. Response: $ret"); - + $ret = $this->curlRest($url . '/' . urlencode($mediaItem['id']), '', 'application/json', 'GET'); $fetched = json_decode($ret, true); $fetched = $fetched['entry']; $this->assertTrue(empty($fetched)); } - + public function testLifeCycleInJson() { $postData = '{ "id" : "11223344", "thumbnailUrl" : "http://www.libpng.org/pub/png/img_png/pngnow.png", @@ -87,7 +89,7 @@ class MediaItemRestTest extends RestBase }'; $this->verifyLifeCycle($postData, 'application/json'); } - + public function testLifeCycleInXml() { $postData = ' @@ -100,7 +102,7 @@ class MediaItemRestTest extends RestBase '; $this->verifyLifeCycle($postData, 'application/xml'); } - + public function testLifeCycleInAtom() { $postData = ' @@ -120,7 +122,7 @@ class MediaItemRestTest extends RestBase '; $this->verifyLifeCycle($postData, 'application/atom+xml'); } - + public function testLifeCycleWithActivity() { // Creates the media item. $postData = '{ "id" : "11223344", @@ -167,10 +169,10 @@ class MediaItemRestTest extends RestBase } $this->assertNotNull($activityId, "Couldn't find created activity."); - + $ret = $this->curlRest($activityUrl . "/@app/$activityId", '', 'application/json', 'DELETE'); $this->assertTrue(empty($ret), "Delete activity failed. Repsonse: $ret"); - + $ret = $this->curlRest($url . '/' . urlencode($mediaItem['id']), '', 'application/json', 'DELETE'); $this->assertTrue(empty($ret), "Delete the created mediaItem failed. Response: $ret"); } Modified: shindig/trunk/php/test/social/MediaItemTest.php URL: http://svn.apache.org/viewvc/shindig/trunk/php/test/social/MediaItemTest.php?rev=1212179&r1=1212178&r2=1212179&view=diff ============================================================================== --- shindig/trunk/php/test/social/MediaItemTest.php (original) +++ shindig/trunk/php/test/social/MediaItemTest.php Thu Dec 8 23:08:47 2011 @@ -1,4 +1,7 @@ getAllEntities($url)); - + // Creates the message. $ret = $this->curlRest($url, $postData, $postDataFormat, 'POST'); $this->assertTrue(empty($ret), "Create message failed. Response: $ret"); - + // Gets the message. $messages = $this->getAllEntities($url); $this->assertEquals($cnt + 1, count($messages), "Size of the messages is not right."); @@ -57,15 +59,15 @@ class MessageRestTest extends RestBase { } } $this->assertNotNull($fetchedMessage, "Couldn't find the created message with title $randomTitle"); - + // Deletes the message. $ret = $this->curlRest($url . '/' . urlencode($fetchedMessage['id']), '', 'application/json', 'DELETE'); $this->assertTrue(empty($ret), "Delete the created message failed. Response: $ret"); - + $messages = $this->getAllEntities($url, $randomTitle); $this->assertEquals($cnt, count($messages), "Size of the messages is not right after deletion."); } - + public function testLifeCycleInJson() { $randomTitle = "[" . rand(0, 2048) . "] message test title."; $postData = '{ @@ -92,7 +94,7 @@ class MessageRestTest extends RestBase { '; $this->verifyLifeCycle($postData, 'application/xml', $randomTitle); } - + public function testLifeCycleInAtom() { $randomTitle = "[" . rand(0, 2048) . "] message test title."; $postData = ''; $this->verifyLifeCycle($postData, 'application/atom+xml', $randomTitle); } - + public function testMessageCollectionLifeCycle() { $url = '/messages/1'; // Gets number of message collections in the repository. $cnt = count($this->getAllEntities($url)); - + // Creates a message collection. $createData = array(); $createData['title'] = "[" . rand(0, 2048) . "] message collection test title."; $createData['urls'] = array("http://abc.com/abc", "http://xyz.com/xyz"); $ret = $this->curlRest($url, json_encode($createData), 'application/json', 'POST'); - + // Verifies that whether the message collection is created. $retDecoded = json_decode($ret, true); $id = $retDecoded['entry']['id']; $this->assertEquals($cnt + 1, count($this->getAllEntities($url)), "Wrong size of the collections. $ret"); - + // Updates the created message collection. $newUrls = array("http://123.com/123"); $newTitle = 'new title'; @@ -130,7 +132,7 @@ class MessageRestTest extends RestBase { $updateData['id'] = $id; $updateData['title'] = $newTitle; $updateData['urls'] = $newUrls; - + $ret = $this->curlRest($url . "/$id", json_encode($updateData), 'application/json', 'PUT'); $this->assertTrue(empty($ret), "Update should return empty. $ret <$id>"); @@ -145,10 +147,10 @@ class MessageRestTest extends RestBase { } } $this->assertTrue($found, "Created message not found."); - + // Deletes the message collection. $ret = $this->curlRest($url . "/$id", '', 'application/json', 'DELETE'); - + // Verifies that the message collection is deleted. $this->assertEquals($cnt, count($this->getAllEntities($url)), "Wrong size of the collections. $ret"); } Modified: shindig/trunk/php/test/social/MessageTest.php URL: http://svn.apache.org/viewvc/shindig/trunk/php/test/social/MessageTest.php?rev=1212179&r1=1212178&r2=1212179&view=diff ============================================================================== --- shindig/trunk/php/test/social/MessageTest.php (original) +++ shindig/trunk/php/test/social/MessageTest.php Thu Dec 8 23:08:47 2011 @@ -1,4 +1,7 @@ RestFulCollection = new RestfulCollection($entry, 1, 1); + $this->restfulCollection = new RestfulCollection($entry, 1, 1); } /** * Cleans up the environment after running a test. */ protected function tearDown() { - $this->RestFulCollection = null; + $this->restfulCollection = null; parent::tearDown(); } @@ -51,46 +54,46 @@ class RestFulCollectionTest extends PHPU public function __construct() {} /** - * Tests RestFulCollection->__construct() + * Tests RestfulCollection->__construct() */ public function test__construct() { $entry = array('Entry'); - $this->RestFulCollection->__construct($entry, 1, 1); + $this->restfulCollection->__construct($entry, 1, 1); } /** - * Tests RestFulCollection->getEntry() + * Tests RestfulCollection->getEntry() */ public function testGetEntry() { $entry = array('Entry'); - $this->RestFulCollection->setEntry($entry); - $this->assertEquals($entry, $this->RestFulCollection->getEntry()); + $this->restfulCollection->setEntry($entry); + $this->assertEquals($entry, $this->restfulCollection->getEntry()); } /** - * Tests RestFulCollection->getStartIndex() + * Tests RestfulCollection->getStartIndex() */ public function testGetStartIndex() { - $this->RestFulCollection->setStartIndex(1); - $this->assertEquals(1, $this->RestFulCollection->getStartIndex()); + $this->restfulCollection->setStartIndex(1); + $this->assertEquals(1, $this->restfulCollection->getStartIndex()); } /** - * Tests RestFulCollection->getTotalResults() + * Tests RestfulCollection->getTotalResults() */ public function testGetTotalResults() { - $this->RestFulCollection->setTotalResults(1); - $this->assertEquals(1, $this->RestFulCollection->getTotalResults()); + $this->restfulCollection->setTotalResults(1); + $this->assertEquals(1, $this->restfulCollection->getTotalResults()); } /** - * Tests RestFulCollection->createFromEntry() + * Tests RestfulCollection->createFromEntry() */ public function testCreateFromEntry() { $entry = array('Entry'); - $restFulCollection = RestFulCollection::createFromEntry($entry); - $this->assertEquals(1, $restFulCollection->getTotalResults()); - $this->assertEquals($entry, $restFulCollection->getEntry()); - $this->assertEquals(0, $restFulCollection->getStartIndex()); + $restfulCollection = RestfulCollection::createFromEntry($entry); + $this->assertEquals(1, $restfulCollection->getTotalResults()); + $this->assertEquals($entry, $restfulCollection->getEntry()); + $this->assertEquals(0, $restfulCollection->getStartIndex()); } } Modified: shindig/trunk/php/test/social/RestRequestItemTest.php URL: http://svn.apache.org/viewvc/shindig/trunk/php/test/social/RestRequestItemTest.php?rev=1212179&r1=1212178&r2=1212179&view=diff ============================================================================== --- shindig/trunk/php/test/social/RestRequestItemTest.php (original) +++ shindig/trunk/php/test/social/RestRequestItemTest.php Thu Dec 8 23:08:47 2011 @@ -1,4 +1,9 @@