Study study = new Study(id, name, alias, type, creationDate, description, status, TimeUtils.getTime(), 0, cipher, Arrays.asList(new Group(MEMBERS, Collections.emptyList()), new Group(ADMINS, Collections.emptyList())), experiments, files, jobs, new LinkedList<>(), new LinkedList<>(), new LinkedList<>(), new LinkedList<>(),
/*** * The test will check whether it is possible to create a new study using an alias that is already being used, but on a different * project. */ @Test public void createStudySameAliasDifferentProject() throws CatalogException { QueryResult<Study> ph1 = catalogStudyDBAdaptor.insert(user1.getProjects().get(0), new Study("Phase 1", "ph1", Study.Type.CASE_CONTROL, "", new Status(), null, 1), null); assertTrue("It is impossible creating an study with an existing alias on a different project.", ph1.getNumResults() == 1); }
@Test public void FamilyToSolrTest() { Study study = new Study().setFqn("user@project:study").setAttributes(new HashMap<>()); Family family = new Family("id", "family", null, null, Arrays.asList(new Individual().setId("I1"), new Individual().setId("I2")), "test", 1000, AnnotationHelper.createAnnotation(), null); family.setUid(100).setStatus(new Family.FamilyStatus("READY")).setRelease(1).setVersion(2); FamilySolrModel familySolrModel = new CatalogFamilyToSolrFamilyConverter(study).convertToStorageType(family); assertEquals(familySolrModel.getUid(), family.getUid()); assertEquals(familySolrModel.getStatus(), family.getStatus().getName()); assertEquals(familySolrModel.getNumMembers(), family.getMembers().size()); assertEquals(familySolrModel.getRelease(), family.getRelease()); assertEquals(familySolrModel.getVersion(), family.getVersion()); assertEquals(familySolrModel.getPhenotypes().size(), 0); assertEquals(familySolrModel.getAnnotations().get("annotations__o__annotName.vsId.a.ab2.ab2c1.ab2c1d1"), Arrays.asList(1, 2, 3, 4, 11, 12, 13, 14, 21)); assertEquals(familySolrModel.getAnnotations().get("annotations__o__annotName.vsId.a.ab1.ab1c1"), Arrays.asList(true, false, false)); assertEquals(familySolrModel.getAnnotations().get("annotations__s__annotName.vsId.a.ab1.ab1c2"), "hello world"); assertEquals(familySolrModel.getAnnotations().get("annotations__o__annotName.vsId.a.ab2.ab2c1.ab2c1d2"), Arrays.asList("hello ab2c1d2 1", "hello ab2c1d2 2")); assertEquals(familySolrModel.getAnnotations().get("annotations__o__annotName.vsId.a.ab3.ab3c1.ab3c1d1"), Arrays.asList(Arrays.asList("hello"), Arrays.asList("hello2", "bye2"), Arrays.asList("byeee2", "hellooo2"))); assertEquals(familySolrModel.getAnnotations().get("annotations__o__annotName.vsId.a.ab3.ab3c1.ab3c1d2"), Arrays.asList(2.0, 4.0, 24.0)); assertNull(familySolrModel.getAnnotations().get("nothing")); assertEquals(familySolrModel.getAnnotations().keySet().size(), 6); } }
Collections.emptyMap(), Collections.emptyMap() ), new Study("mineco", "MINECO", "mineco", Study.Type.COLLECTION, "", "", new Status(), "", 0, "", Arrays.asList(new Group("@members", Collections.emptyList())), null, Arrays.asList(
@Test public void CohortToSolrTest() { Study study = new Study().setFqn("user@project:study").setAttributes(new HashMap<>()); Cohort cohort = new Cohort("id", Study.Type.CASE_SET, TimeUtils.getTime(), "test", Arrays.asList(new Sample().setId("1"), new Sample().setId("2")), 2, null)
@Test public void FileToSolrTest() { Study study = new Study().setFqn("user@project:study").setAttributes(new HashMap<>()); File file = new File("name", File.Type.FILE, File.Format.BAM, File.Bioformat.MICROARRAY_EXPRESSION_ONECHANNEL_AGILENT, "test/base", "convertorTest", new File.FileStatus("READY"), 1111L, 2);
@Test public void SampleToSolrTest() { Study study = new Study().setFqn("user@project:study").setAttributes(new HashMap<>()); Individual individual = new Individual(); individual.setUuid("uuid").setEthnicity("spanish").setKaryotypicSex(IndividualProperty.KaryotypicSex.XX).
@Test public void IndividualToSolrTest() { Study study = new Study().setFqn("user@project:study").setAttributes(new HashMap<>()); Individual individual = new Individual("Id", "individual", IndividualProperty.Sex.MALE, "Spanish", new Individual.Population("valencian", "", ""), 2, AnnotationHelper.createAnnotation(), null);