@Test public void createInstallationPanelNoOverwrite() throws CatalogException, IOException { Panel panel = Panel.load(getClass().getResource("/disease_panels/panel1.json").openStream()); panelManager.create(panel, false, adminToken); thrown.expect(CatalogDBException.class); thrown.expectMessage("already exists"); panelManager.create(panel, false, adminToken); }
diseasePanel.getDiseasePanel().setAttributes(attributes); create(diseasePanel, overwrite, token);
@Test public void createInstallationPanelNoAdmin() throws CatalogException, IOException { Panel panel = Panel.load(getClass().getResource("/disease_panels/panel1.json").openStream()); thrown.expect(CatalogAuthorizationException.class); panelManager.create(panel, false, sessionIdUser); }
@Test public void createInstallationPanelOverwrite() throws CatalogException, IOException { Panel panel = Panel.load(getClass().getResource("/disease_panels/panel1.json").openStream()); panelManager.create(panel, false, adminToken); QueryResult<Panel> diseasePanelQueryResult = panelManager.get(PanelManager.INSTALLATION_PANELS, panel.getDiseasePanel().getId(), QueryOptions.empty(), null); panelManager.create(panel, true, adminToken); QueryResult<Panel> diseasePanelQueryResult2 = panelManager.get(PanelManager.INSTALLATION_PANELS, panel.getDiseasePanel().getId(), QueryOptions.empty(), null); assertNotEquals(diseasePanelQueryResult.first().getUuid(), diseasePanelQueryResult2.first().getUuid()); }
@Test public void createTest() throws IOException, CatalogException { Panel panel = Panel.load(getClass().getResource("/disease_panels/panel1.json").openStream()); QueryResult<Panel> diseasePanelQueryResult = panelManager.create(studyFqn, panel, null, sessionIdUser); assertEquals(1, diseasePanelQueryResult.getNumResults()); assertEquals(panel.getDiseasePanel().getId(), diseasePanelQueryResult.first().getDiseasePanel().getId()); assertEquals(panel.toString(), diseasePanelQueryResult.first().toString()); }
@Test public void importGlobalPanel() throws CatalogException, IOException { Panel panel = Panel.load(getClass().getResource("/disease_panels/panel1.json").openStream()); panelManager.create(panel, false, adminToken); Panel installationPanel = panelManager.get(PanelManager.INSTALLATION_PANELS, panel.getDiseasePanel().getId(), QueryOptions.empty(), null).first(); QueryResult<Panel> diseasePanelQueryResult = panelManager.importInstallationPanel(studyFqn, panel.getDiseasePanel().getId(), QueryOptions.empty(), sessionIdUser); assertEquals(1, diseasePanelQueryResult.getNumResults()); assertNotEquals(installationPanel.getUuid(), diseasePanelQueryResult.first().getUuid()); }
@Test public void createInstallationPanel() throws CatalogException, IOException { Panel panel = Panel.load(getClass().getResource("/disease_panels/panel1.json").openStream()); panelManager.create(panel, false, adminToken); QueryResult<Panel> diseasePanelQueryResult = panelManager.get(PanelManager.INSTALLATION_PANELS, panel.getDiseasePanel().getId(), QueryOptions.empty(), null); assertEquals(1, diseasePanelQueryResult.getNumResults()); assertEquals(panel.getDiseasePanel().getId(), diseasePanelQueryResult.first().getDiseasePanel().getId()); assertEquals(panel.toString(), diseasePanelQueryResult.first().toString()); }
@Test public void updateTest() throws IOException, CatalogException { Panel panel = Panel.load(getClass().getResource("/disease_panels/panel1.json").openStream()); panelManager.create(panel, false, adminToken); Panel diseasePanelQueryResult = panelManager.importInstallationPanel(studyFqn, panel.getDiseasePanel().getId(), null, sessionIdUser).first();
)); catalog.getPanelManager().create("s1", panel, null, sessionId);