本文整理汇总了Java中com.stacksync.commons.models.Workspace.setLatestRevision方法的典型用法代码示例。如果您正苦于以下问题:Java Workspace.setLatestRevision方法的具体用法?Java Workspace.setLatestRevision怎么用?Java Workspace.setLatestRevision使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.stacksync.commons.models.Workspace
的用法示例。
在下文中一共展示了Workspace.setLatestRevision方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: mapWorkspace
import com.stacksync.commons.models.Workspace; //导入方法依赖的package包/类
private Workspace mapWorkspace(ResultSet result) throws SQLException {
Workspace workspace = new Workspace();
workspace.setId(UUID.fromString(result.getString("id")));
workspace.setLatestRevision(result.getInt("latest_revision"));
workspace.setShared(result.getBoolean("is_shared"));
workspace.setEncrypted(result.getBoolean("is_encrypted"));
workspace.setName(result.getString("workspace_name"));
workspace.setSwiftContainer(result.getString("swift_container"));
workspace.setSwiftUrl(result.getString("swift_url"));
Long parentItemId = result.getLong("parent_item_id");
if (parentItemId == 0L){
parentItemId = null;
}
workspace.setParentItem(new Item(parentItemId));
User owner = new User();
owner.setId(UUID.fromString(result.getString("owner_id")));
workspace.setOwner(owner);
return workspace;
}
示例2: testCreateNewWorkspaceValidOwner
import com.stacksync.commons.models.Workspace; //导入方法依赖的package包/类
@Test
public void testCreateNewWorkspaceValidOwner() throws IllegalArgumentException, DAOException {
User user = new User();
user.setName(nextString());
user.setId(UUID.randomUUID());
user.setEmail(nextString());
user.setQuotaLimit(2048L);
user.setQuotaUsedLogical(1403L);
user.setQuotaUsedReal(1024L);
userDao.add(user);
Workspace workspace = new Workspace();
workspace.setLatestRevision(0);
workspace.setOwner(user);
try {
workspaceDAO.add(workspace);
assertTrue(true);
} catch (DAOException e) {
assertTrue(e.toString(), false);
}
}
示例3: testCreateObjectInvalidWorkspace
import com.stacksync.commons.models.Workspace; //导入方法依赖的package包/类
@Test
public void testCreateObjectInvalidWorkspace() throws IllegalArgumentException, DAOException {
User user = new User();
user.setName(nextString());
user.setId(UUID.randomUUID());
user.setEmail(nextString());
user.setQuotaLimit(2048L);
user.setQuotaUsedLogical(1403L);
user.setQuotaUsedReal(1024L);
userDao.add(user);
Workspace workspace = new Workspace();
workspace.setOwner(user);
workspace.setLatestRevision(0);
Item object = new Item();
object.setWorkspace(workspace);
object.setLatestVersion(1L);
object.setParent(null);
object.setId(1331432L);
object.setFilename(nextString());
object.setMimetype("image/jpeg");
object.setIsFolder(false);
object.setClientParentFileVersion(1L);
try {
objectDao.put(object);
assertTrue("Object should not have been created", false);
} catch (DAOException e) {
assertTrue(e.toString(), true);
}
}