當前位置: 首頁>>代碼示例>>Java>>正文


Java Workspace.setLatestRevision方法代碼示例

本文整理匯總了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;
}
 
開發者ID:stacksync,項目名稱:sync-service,代碼行數:27,代碼來源:PostgresqlWorkspaceDAO.java

示例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);
	}
}
 
開發者ID:stacksync,項目名稱:sync-service,代碼行數:24,代碼來源:PostgresqlDAOTest.java

示例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);
	}

}
 
開發者ID:stacksync,項目名稱:sync-service,代碼行數:35,代碼來源:PostgresqlDAOTest.java


注:本文中的com.stacksync.commons.models.Workspace.setLatestRevision方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。