My favorites | Sign in
Project Logo
                
Search
for
Updated Sep 21, 2008 by javamon...@163.com
UserCase  

use case for fileengine

Introduction

here are cases for FileSystemConnection

Details

Add your content here. Format your content with:

1 singele user

1.1

FileSystemConnection.addFile("file1",content1);
FileSystemConnection.addFile("file12",content2);
FileSystemConnection.commit();

both files are saved successfully

1.2

FileSystemConnection.addFile("file1",content1);
FileSystemConnection.addFile("file12",content2);
FileSystemConnection.rollback();

both files are not saved

1.3

FileSystemConnection.addFile("c:/temp/file1",content1);
FileSystemConnection.addFile("c:/temp/file2",content2);
String[] files = FileSystemConnection.listFiles("c:/temp/")
System.out.println(new String(FileSystemConnection.getContent(files[0])));
FileSystemConnection.rollback();

both files are not saved and content1 is displayed on the console

1.4

FileSystemConnection.addFile("file1",content1);
FileSystemConnection.removeFile("file11");
FileSystemConnection.rollback();//or commit

file1 are not saved

2 concurrent user

2.1

conn1.addFile("file1",content1);
conn2.addFile("file1",content1);

conn2 is locked until conn1.commit() or conn1.rollback();

2.2

conn1.removeFile("file1",content1);
conn2.removeFile("file1",content1);

conn2 is locked until conn1.commit() or conn1.rollback();

2.2

conn1.getContent("file1");
      conn2.removeFile("file1",content1);
      conn2.commit();

file's read successfully and file1 are removed with noblock


Sign in to add a comment
Hosted by Google Code