本文整理汇总了Java中org.wso2.carbon.registry.core.Collection.setDescription方法的典型用法代码示例。如果您正苦于以下问题:Java Collection.setDescription方法的具体用法?Java Collection.setDescription怎么用?Java Collection.setDescription使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.wso2.carbon.registry.core.Collection
的用法示例。
在下文中一共展示了Collection.setDescription方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testSetCollectionDetails
import org.wso2.carbon.registry.core.Collection; //导入方法依赖的package包/类
public void testSetCollectionDetails() throws Exception {
Collection r1 = registry.newCollection();
r1.setDescription("C3 collection description");
r1.setProperty("key1", "value5");
r1.setProperty("key2", "value3");
String path_collection = "/c1/c2/c3";
registry.put(path_collection, r1);
Resource r1_actual = registry.get("/c1/c2/c3");
assertTrue(r1_actual instanceof Collection);
assertEquals("LastUpdatedUser is not Equal", "admin", r1_actual.getLastUpdaterUserName());
assertEquals("Can not get Resource path", path_collection, r1_actual.getPath());
assertEquals("Can not get Resource parent path", "/c1/c2", r1_actual.getParentPath());
assertEquals("Resource description is not equal", r1.getDescription(),
r1_actual.getDescription());
assertEquals("Authour is not equal", "admin", r1_actual.getAuthorUserName());
assertEquals("Resource properties are not equal", r1.getProperty("key1"),
r1_actual.getProperty("key1"));
assertEquals("Resource properties are not equal", r1.getProperty("key2"),
r1_actual.getProperty("key2"));
}
示例2: addDefaultHandlersIfNotAvailable
import org.wso2.carbon.registry.core.Collection; //导入方法依赖的package包/类
public static boolean addDefaultHandlersIfNotAvailable(Registry configSystemRegistry)
throws RegistryException, FileNotFoundException, XMLStreamException {
if (!configSystemRegistry.resourceExists(RegistryConstants.HANDLER_CONFIGURATION_PATH)) {
Collection handlerConfigurationCollection = new CollectionImpl();
String description = "Handler configurations are stored here.";
handlerConfigurationCollection.setDescription(description);
configSystemRegistry.put(RegistryConstants.HANDLER_CONFIGURATION_PATH,
handlerConfigurationCollection);
// We don't have any default handler configuration as in lifecycles.
}
else {
// configue all handlers
Resource handlerRoot = configSystemRegistry.get(getContextRoot());
if (!(handlerRoot instanceof Collection)) {
String msg = "Failed to continue as the handler configuration root: " +
getContextRoot() + " is not a collection.";
log.error(msg);
throw new RegistryException(msg);
}
Collection handlerRootCol = (Collection)handlerRoot;
String[] handlerConfigPaths = handlerRootCol.getChildren();
if (handlerConfigPaths != null) {
for (String handlerConfigPath: handlerConfigPaths) {
generateHandler(configSystemRegistry, handlerConfigPath);
}
}
}
return true;
}
示例3: testAddSpacesinCollName
import org.wso2.carbon.registry.core.Collection; //导入方法依赖的package包/类
public void testAddSpacesinCollName() throws Exception {
Collection c1 = registry.newCollection();
c1.setDescription("this is a collection name with spaces");
c1.setProperty("key1", "value5");
c1.setProperty("key2", "value3");
String path = "/col1/col2/col30 space45";
String actualPath = null;
try {
actualPath = registry.put(path, c1);
} catch (Exception e) {
fail("Couldn't put collection /col1/col2/col3 space");
}
// Resource r1_actual = null;
// try {
// r1_actual = registry.get(path);
// } catch (Exception e) {
// fail("Couldn't get collecion of path " + path);
// }
// assertEquals("LastUpdatedUser is not Equal", "admin", r1_actual.getLastUpdaterUserName());
// assertEquals("Can not get Resource path", actualPath, r1_actual.getPath());
// assertEquals("Can not get Resource parent path", "/col1/col2", r1_actual.getParentPath());
// assertEquals("Resource description is not equal", c1.getDescription(),
// r1_actual.getDescription());
// assertEquals("Authour is not equal", "admin", r1_actual.getAuthorUserName());
// assertEquals("Resource properties are equal", c1.getProperty("key1"),
// r1_actual.getProperty("key1"));
// assertEquals("Resource properties are equal", c1.getProperty("key2"),
// r1_actual.getProperty("key2"));
}