当前位置: 首页>>代码示例>>Java>>正文


Java ProjectInstance.setName方法代码示例

本文整理汇总了Java中org.apache.kylin.metadata.project.ProjectInstance.setName方法的典型用法代码示例。如果您正苦于以下问题:Java ProjectInstance.setName方法的具体用法?Java ProjectInstance.setName怎么用?Java ProjectInstance.setName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.kylin.metadata.project.ProjectInstance的用法示例。


在下文中一共展示了ProjectInstance.setName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testAddUpdateProject

import org.apache.kylin.metadata.project.ProjectInstance; //导入方法依赖的package包/类
@Test
public void testAddUpdateProject() throws IOException {
    int originalProjectCount = projectController.getProjects(null, null).size();

    //test add project
    ProjectInstance project = new ProjectInstance();
    project.setName("new_project");
    ProjectInstance ret = projectController.saveProject(getProjectRequest(project, null));

    Assert.assertEquals(ret.getOwner(), "ADMIN");
    Assert.assertEquals(ProjectManager.getInstance(getTestConfig()).listAllProjects().size(), originalProjectCount + 1);

    //test update project description only
    ProjectInstance newProject2 = new ProjectInstance();
    newProject2.setName("new_project");
    newProject2.setDescription("hello world");
    projectController.updateProject(getProjectRequest(newProject2, "new_project"));

    Assert.assertEquals(ProjectManager.getInstance(getTestConfig()).listAllProjects().size(), originalProjectCount + 1);
    Assert.assertNotEquals(ProjectManager.getInstance(getTestConfig()).getProject("new_project"), null);
    Assert.assertEquals(ProjectManager.getInstance(getTestConfig()).getProject("new_project").getDescription(), "hello world");
}
 
开发者ID:apache,项目名称:kylin,代码行数:23,代码来源:ProjectControllerTest.java

示例2: testAddExistingProject

import org.apache.kylin.metadata.project.ProjectInstance; //导入方法依赖的package包/类
@Test(expected = InternalErrorException.class)
public void testAddExistingProject() throws IOException {
    ProjectInstance newProject = new ProjectInstance();
    newProject.setName("default");

    projectController.saveProject(getProjectRequest(newProject, null));
}
 
开发者ID:apache,项目名称:kylin,代码行数:8,代码来源:ProjectControllerTest.java

示例3: generateKylinProjectInstance

import org.apache.kylin.metadata.project.ProjectInstance; //导入方法依赖的package包/类
public static ProjectInstance generateKylinProjectInstance(String owner, List<TableDesc> kylinTables,
        List<DataModelDesc> kylinModels, List<CubeDesc> kylinCubeDescs) {
    ProjectInstance projectInstance = new ProjectInstance();

    projectInstance.setName(MetricsManager.SYSTEM_PROJECT);
    projectInstance.setOwner(owner);
    projectInstance.setDescription(SYSTEM_PROJECT_DESC);
    projectInstance.setStatus(ProjectStatusEnum.ENABLED);
    projectInstance.setCreateTimeUTC(0L);
    projectInstance.updateRandomUuid();

    if (kylinTables != null)
        projectInstance.setTables(Sets.newHashSet(Lists.transform(kylinTables, new Function<TableDesc, String>() {
            @Nullable
            @Override
            public String apply(@Nullable TableDesc tableDesc) {
                if (tableDesc != null) {
                    return tableDesc.getIdentity();
                }
                return null;
            }
        })));
    else
        projectInstance.setTables(Sets.<String> newHashSet());

    if (kylinModels != null)
        projectInstance.setModels(Lists.transform(kylinModels, new Function<DataModelDesc, String>() {
            @Nullable
            @Override
            public String apply(@Nullable DataModelDesc modelDesc) {
                if (modelDesc != null) {
                    return modelDesc.getName();
                }
                return null;
            }
        }));
    else
        projectInstance.setModels(Lists.<String> newArrayList());

    if (kylinCubeDescs != null)
        projectInstance
                .setRealizationEntries(Lists.transform(kylinCubeDescs, new Function<CubeDesc, RealizationEntry>() {
                    @Nullable
                    @Override
                    public RealizationEntry apply(@Nullable CubeDesc cubeDesc) {
                        if (cubeDesc != null) {
                            RealizationEntry entry = new RealizationEntry();
                            entry.setRealization(cubeDesc.getName());
                            entry.setType(RealizationType.CUBE);
                            return entry;
                        }
                        return null;
                    }
                }));
    else
        projectInstance.setRealizationEntries(Lists.<RealizationEntry> newArrayList());

    return projectInstance;
}
 
开发者ID:apache,项目名称:kylin,代码行数:60,代码来源:ProjectCreator.java


注:本文中的org.apache.kylin.metadata.project.ProjectInstance.setName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。