Package cloudloop.test.storage

Examples of cloudloop.test.storage.MockFileStream


    {
  CloudStoreAdapterBase store = getCloudStoreAdapter( );
  CloudStorePath dirPath = new CloudStorePath( "/foo/bar/" );
  store.createDirectory( store.getDirectory( "/foo/bar/" ) );
  CloudStoreFile fileToUpload = store.getFile( "/foo/bar/some_file.txt" );
  fileToUpload.setStreamToStore( new MockFileStream( 50 ) );
  fileToUpload.write( null );
  // HACK!! (AL) For some reason, Nirvanix needs time to process the file
  // before it can be copied. I'm not sure why this is, and I can't
  // find anything in the docs.
  // TODO: Perhaps put in a retry for the copy command?
View Full Code Here


    public void testSendUploadDownloadRequest( )
    {
  CloudStoreAdapterBase store = getCloudStoreAdapter( );
  store.createDirectory( store.getDirectory( "/foo/bar/" ) );
  CloudStoreFile fileToUpload = store.getFile( "/foo/bar/some_file.txt" );
  fileToUpload.setStreamToStore( new MockFileStream( 50 ) );
  fileToUpload.write( null );
  FileStreamComparer.areStreamsEqual( new MockFileStream( 50 ),
              fileToUpload.read( null ) );
    }
View Full Code Here

    public void testSendRemoveFileRequest( )
    {
  CloudStoreAdapterBase store = getCloudStoreAdapter( );
  store.createDirectory( store.getDirectory( "/foo/bar/" ) );
  CloudStoreFile fileToUpload = store.getFile( "/foo/bar/some_file.txt" );
  fileToUpload.setStreamToStore( new MockFileStream( 50 ) );
  fileToUpload.write( null );
  fileToUpload.remove( );
  assertFalse( store.contains( fileToUpload ) );
    }
View Full Code Here

      + "sub_dir_" + j + "/" );
    store.createDirectory( subDir );
   
    CloudStoreFile subFile = store.getFile( dirPath + "sub_file_"
      + j );
    subFile.setStreamToStore( new MockFileStream( 50 ) );
    subFile.write( null );
      }
  }
 
  for ( int i = 0; i < numFiles; i++ )
  {
      String filePath = baseDir + "file_" + i;
      CloudStoreFile file = store.getFile( filePath );
      file.setStreamToStore( new MockFileStream( 50 ) );
      file.write( null );
  }
    }
View Full Code Here

    public void testSendWriteMetadataRequest( )
    {
  CloudStoreAdapterBase store = getCloudStoreAdapter( );
  store.createDirectory( store.getDirectory( "/foo/bar/" ) );
  CloudStoreFile fileToUpload = store.getFile( "/foo/bar/some_file.txt" );
  fileToUpload.setStreamToStore( new MockFileStream( 50 ) );
  fileToUpload.setCustomMetaTag( "foo", "bar" );
  fileToUpload.write( null );
 
  CloudStoreFile uploaded = store.getFile( fileToUpload.getPath( )
    .getAbsolutePath( ) );
View Full Code Here

  // create a random file directly in root dir
  String randomFileName = "adqsflkj82u88y8y8fjahdsfjheydjskl.foo";
  String randomDirName = "238787878ewafhjsdhagq7yuhasdo909";
  CloudStoreFile file = _cloudStore.getFile( randomFileName );
  assertFalse( file.existsInStore( ) );
  file.setStreamToStore( new MockFileStream( 50 ) );
  file.write( null );
  assertTrue( file.existsInStore( ) );
  CloudStoreDirectory dir = _cloudStore.getDirectory( randomDirName );
  assertFalse( dir.existsInStore( ) );
  _cloudStore.createDirectory( _cloudStore.getDirectory( dir.getPath( )
View Full Code Here

TOP

Related Classes of cloudloop.test.storage.MockFileStream

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.