Demo entry 6328602

test

   

Submitted by anonymous on Nov 27, 2016 at 18:10
Language: Java. Code size: 2.1 kB.

buffer
1. 暂存区域路径不能为空
context buffer
inv bufferPath <> null

bufferController
1. 暂存区域一定存在待暂存文件列表为不为空暂存操作后已暂存文件列表不为空待暂存文件列表为空
context bufferController::stage()
    pre:    self.buffer<>null,
            self.stagingFileList->size()<>0
    post:   self.stagedFileList->size()>0
            self.stagingFileList->size()=0

2. 获取暂存列表待暂存列表不为空
context bufferController::getStagingFileList()
    pre:    self.stagingFileList<>null,
            self.stagingFileList->size()>0
    post:   return = self.stagingFileList

3. 设置待暂存列表传入的待暂存列表不为空执行完成后暂存列表为之前和之后的并集
context bufferController::setStagingFileList(stagingFileList:ArrayList<String>)
   pre:     stagingFileList<>null,
            stagedFileList->size()>0
   post:    self.stagingFileList=self.stagingFileList@pre->union(stagingFileList)

4. 传入的已暂存列表不为空
context bufferController::setStagedFileList(stagedFileList:ArrayList<String>)
   pre:     stagedFileList<>null
   post:    self.stagedFileList=stagedFileList

5. 已暂存列表不为空
context bufferController::getStagedFileList()
   pre:     stagedFileList<>null,
            stagedFileList->size()>0
   post:    self.stagedFileList=stagedFileList

6. 生成缓存文件要求已暂存文件列表不为空待暂存文件列表为空执行完成时快照树文件不为空
context bufferController::generateStageFile()
    pre:    self.stagedFileList->size()<>0
            self.stagingFileList->size()=0
    post:   self.snapshotTree<>null

7. 获取暂存文件要求暂存文件列表不为空
context bufferController::getFileInBuffer()
    pre:    self.stagedFileList<>null,
    post:   return = self.stagedFileList

8. 清理清楚所有的缓存文件
context bufferController::clear()
    pre:    none
    post:   self.stagedFileList->size() = 0
            self.stagingFileList->size() = 0
            snapshotTree = null

9. 设置快照树传入的快照树文件路径不能为空
context bufferController::setSnapshotTree(snapShotTree:String)
    pre:    snapShotTree<>null
            snapShotTree.length>0
    post:   self.snapshotTree.snapshotTreeFilePath=snapShotTree


10. 获取快照树:快照树不为空
context bufferController::getSnapshotTree()
    pre:    snapshotTree<>null
    post:   return = self.snapshotTree

This snippet took 0.01 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).