This repository has been archived by the owner on Mar 6, 2021. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
git-svn-id: https://www.dropr.org/svn/trunk@177 f77b8f78-39ad-454d-97bc-04c3ead53514
- Loading branch information
Soenke Ruempler
committed
Aug 16, 2008
1 parent
a690ecc
commit 7d1e9fd
Showing
4 changed files
with
125 additions
and
38 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
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 | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,98 @@ | |||
<?php | |||
/** | |||
* dropr | |||
* | |||
* Copyright (c) 2007 - 2008 by the dropr project https://www.dropr.org/ | |||
* All rights reserved. | |||
* | |||
* Redistribution and use in source and binary forms, with or without | |||
* modification, are permitted provided that the following conditions | |||
* are met: | |||
* | |||
* * Redistributions of source code must retain the above copyright | |||
* notice, this list of conditions and the following disclaimer. | |||
* | |||
* * Redistributions in binary form must reproduce the above copyright | |||
* notice, this list of conditions and the following disclaimer in | |||
* the documentation and/or other materials provided with the | |||
* distribution. | |||
* | |||
* * Neither the name of dropr nor the names of its | |||
* contributors may be used to endorse or promote products derived | |||
* from this software without specific prior written permission. | |||
* | |||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS | |||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE | |||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, | |||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, | |||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | |||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | |||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | |||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN | |||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |||
* POSSIBILITY OF SUCH DAMAGE. | |||
* | |||
* @package dropr | |||
* @author Soenke Ruempler <soenke@jimdo.com> | |||
* @author Boris Erdmann <boris@jimdo.com> | |||
* @copyright 2007-2008 Soenke Ruempler, Boris Erdmann | |||
* @license http://www.opensource.org/licenses/bsd-license.php BSD License | |||
*/ | |||
|
|||
/** | |||
* test example for bypassing the client queue for local delivery | |||
* | |||
* basically this is an inter process communication but with | |||
* durability (messages are written to a durable storage) | |||
* | |||
* @author Soenke Ruempler | |||
*/ | |||
|
|||
require dirname (__FILE__) . '/../../classes/dropr.php'; | |||
|
|||
class LocalFilesystemTransportTest extends PHPUnit_Framework_TestCase | |||
{ | |||
/** | |||
* @var dropr_Server_Storage_Filesystem | |||
*/ | |||
private $storage; | |||
|
|||
private $dir; | |||
|
|||
public function setUp() | |||
{ | |||
$this->dir = dirname (__FILE__) . '/testspool/server'; | |||
$this->storage = dropr_Server_Storage_Abstract::factory('Filesystem', $this->dir); | |||
} | |||
|
|||
public function testPut() | |||
{ | |||
$message = new dropr_Server_Message( | |||
'localhost', | |||
uniqid(null, true), | |||
$message = 'testmessage', | |||
'common', | |||
1, | |||
time() | |||
); | |||
|
|||
$this->storage->put($message); | |||
|
|||
$messages = $this->storage->getMessages('common'); | |||
|
|||
$this->assertEquals(1, count($messages)); | |||
$this->assertEquals('testmessage', (string)$messages[0]); | |||
|
|||
|
|||
} | |||
|
|||
protected function tearDown() | |||
{ | |||
// cleanup queue | |||
foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator($this->dir)) as $f) { | |||
unlink($f); | |||
} | |||
} | |||
} |
This file was deleted.
Oops, something went wrong.