Search in sources :

Example 6 with EntityDelegator

use of ubic.gemma.web.remote.EntityDelegator in project Gemma by PavlidisLab.

the class ExperimentalDesignControllerTest method testCreateExperimentalFactor.

@Test
public void testCreateExperimentalFactor() throws Exception {
    ExpressionExperiment ee = this.getTestPersistentCompleteExpressionExperiment(false);
    ee = this.eeService.thawLite(ee);
    ExperimentalFactorValueObject evvo = new ExperimentalFactorValueObject(-1L);
    evvo.setCategory("foo");
    experimentalDesignController.createExperimentalFactor(new EntityDelegator(ee.getExperimentalDesign()), evvo);
}
Also used : EntityDelegator(ubic.gemma.web.remote.EntityDelegator) Test(org.junit.Test) BaseSpringWebTest(ubic.gemma.web.util.BaseSpringWebTest)

Example 7 with EntityDelegator

use of ubic.gemma.web.remote.EntityDelegator in project Gemma by PavlidisLab.

the class ExperimentalDesignControllerTest method testAddCharacteristicToFactorValue.

@Test
public void testAddCharacteristicToFactorValue() throws Exception {
    ExpressionExperiment ee = this.getTestPersistentCompleteExpressionExperiment(false);
    ee = this.eeService.thawLite(ee);
    ExperimentalFactor ef = ee.getExperimentalDesign().getExperimentalFactors().iterator().next();
    EntityDelegator e = new EntityDelegator(ef.getFactorValues().iterator().next());
    VocabCharacteristic vc = VocabCharacteristic.Factory.newInstance();
    vc.setValue("foo");
    vc.setCategory("bar");
    vc.setCategoryUri("bar");
    vc.setValueUri("foo");
    experimentalDesignController.createFactorValueCharacteristic(e, vc);
    assertEquals(2, ef.getFactorValues().size());
    // new empty
    experimentalDesignController.createFactorValue(new EntityDelegator(ef));
    experimentalDesignController.createFactorValue(new EntityDelegator(ef));
    experimentalDesignController.createFactorValue(new EntityDelegator(ef));
    ef = experimentalFactorService.load(ef.getId());
    assertEquals(5, ef.getFactorValues().size());
}
Also used : VocabCharacteristic(ubic.gemma.model.common.description.VocabCharacteristic) EntityDelegator(ubic.gemma.web.remote.EntityDelegator) Test(org.junit.Test) BaseSpringWebTest(ubic.gemma.web.util.BaseSpringWebTest)

Aggregations

EntityDelegator (ubic.gemma.web.remote.EntityDelegator)7 Test (org.junit.Test)4 BaseSpringWebTest (ubic.gemma.web.util.BaseSpringWebTest)4 GeneDifferentialExpressionMetaAnalysis (ubic.gemma.model.analysis.expression.diff.GeneDifferentialExpressionMetaAnalysis)2 Securable (gemma.gsec.model.Securable)1 Before (org.junit.Before)1 AccessDeniedException (org.springframework.security.access.AccessDeniedException)1 DifferentialExpressionEvidence (ubic.gemma.model.association.phenotype.DifferentialExpressionEvidence)1 VocabCharacteristic (ubic.gemma.model.common.description.VocabCharacteristic)1