Commit 97411e82 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

data overlays are processed properly in zip file

parent 32647bee
Pipeline #42997 failed with stage
in 25 minutes
......@@ -16,9 +16,8 @@ import lcsb.mapviewer.api.BaseRestImpl;
import lcsb.mapviewer.commands.*;
import lcsb.mapviewer.common.Configuration;
import lcsb.mapviewer.common.Pair;
import lcsb.mapviewer.converter.Converter;
import lcsb.mapviewer.converter.ConverterException;
import lcsb.mapviewer.converter.graphics.AbstractImageGenerator.Params;
import lcsb.mapviewer.converter.*;
import lcsb.mapviewer.converter.graphics.DrawingException;
import lcsb.mapviewer.converter.graphics.ImageGenerators;
import lcsb.mapviewer.model.Project;
......@@ -36,7 +35,6 @@ import lcsb.mapviewer.services.ObjectNotFoundException;
import lcsb.mapviewer.services.QueryException;
import lcsb.mapviewer.services.interfaces.IDataOverlayService;
import lcsb.mapviewer.services.interfaces.IProjectBackgroundService;
import lcsb.mapviewer.services.utils.ColorSchemaReader;
import lcsb.mapviewer.services.utils.data.BuildInBackgrounds;
@Service
......
......@@ -18,6 +18,8 @@ import lcsb.mapviewer.commands.*;
import lcsb.mapviewer.common.Pair;
import lcsb.mapviewer.common.TextFileUtils;
import lcsb.mapviewer.common.exception.InvalidArgumentException;
import lcsb.mapviewer.converter.ColorSchemaColumn;
import lcsb.mapviewer.converter.ColorSchemaReader;
import lcsb.mapviewer.converter.zip.ZipEntryFileFactory;
import lcsb.mapviewer.model.Project;
import lcsb.mapviewer.model.cache.UploadedFileEntry;
......@@ -34,9 +36,7 @@ import lcsb.mapviewer.persist.dao.map.DataOverlayDao;
import lcsb.mapviewer.services.ObjectNotFoundException;
import lcsb.mapviewer.services.QueryException;
import lcsb.mapviewer.services.interfaces.*;
import lcsb.mapviewer.services.utils.ColorSchemaReader;
import lcsb.mapviewer.services.utils.EmailSender;
import lcsb.mapviewer.services.utils.data.ColorSchemaColumn;
@Transactional
@Service
......
......@@ -14,7 +14,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.annotation.Rollback;
import lcsb.mapviewer.common.Pair;
import lcsb.mapviewer.converter.ConverterParams;
import lcsb.mapviewer.converter.*;
import lcsb.mapviewer.converter.model.celldesigner.CellDesignerXmlParser;
import lcsb.mapviewer.model.Project;
import lcsb.mapviewer.model.map.BioEntity;
......@@ -24,8 +24,6 @@ import lcsb.mapviewer.model.overlay.*;
import lcsb.mapviewer.services.ServiceTestFunctions;
import lcsb.mapviewer.services.interfaces.IDataOverlayService;
import lcsb.mapviewer.services.interfaces.IDataOverlayService.CreateDataOverlayParams;
import lcsb.mapviewer.services.utils.ColorSchemaReader;
import lcsb.mapviewer.services.utils.data.ColorSchemaColumn;
@Rollback(true)
public class DataOverlayServiceTest extends ServiceTestFunctions {
......@@ -60,7 +58,7 @@ public class DataOverlayServiceTest extends ServiceTestFunctions {
assertEquals(0, dataOverlays.size());
CreateDataOverlayParams params = new CreateDataOverlayParams().name("Test").project(project)
.colorInputStream(new FileInputStream("testFiles/enricoData/ge001.txt"))
.colorInputStream(new FileInputStream("testFiles/coloring/ge001.txt"))
.user(userDao.getUserByLogin(ADMIN_BUILT_IN_LOGIN));
DataOverlay row = dataOverlayService.createDataOverlay(params);
......@@ -74,7 +72,7 @@ public class DataOverlayServiceTest extends ServiceTestFunctions {
@Test
public void testUpdateDataOverlay() throws Exception {
CreateDataOverlayParams params = new CreateDataOverlayParams().name("Test").project(project)
.colorInputStream(new FileInputStream("testFiles/enricoData/ge001.txt"))
.colorInputStream(new FileInputStream("testFiles/coloring/ge001.txt"))
.user(userDao.getUserByLogin(ADMIN_BUILT_IN_LOGIN));
DataOverlay row = dataOverlayService.createDataOverlay(params);
......@@ -110,7 +108,7 @@ public class DataOverlayServiceTest extends ServiceTestFunctions {
CreateDataOverlayParams params = new CreateDataOverlayParams().name("Test")
.project(localProject)
.colorInputStream(new FileInputStream("testFiles/enricoData/ge001.txt"))
.colorInputStream(new FileInputStream("testFiles/coloring/ge001.txt"))
.user(userDao.getUserByLogin(ADMIN_BUILT_IN_LOGIN));
dataOverlayService.createDataOverlay(params);
......@@ -124,7 +122,7 @@ public class DataOverlayServiceTest extends ServiceTestFunctions {
@Test
public void testInputDataInOverlay() throws Exception {
CreateDataOverlayParams params = new CreateDataOverlayParams().name("Test").project(project)
.colorInputStream(new FileInputStream("testFiles/enricoData/ge001.txt"))
.colorInputStream(new FileInputStream("testFiles/coloring/ge001.txt"))
.user(userDao.getUserByLogin(ADMIN_BUILT_IN_LOGIN));
DataOverlay row = dataOverlayService.createDataOverlay(params);
......@@ -134,7 +132,7 @@ public class DataOverlayServiceTest extends ServiceTestFunctions {
assertNotNull(row.getInputData());
byte[] inputData = row.getInputData().getFileContent();
assertNotNull(inputData);
byte[] originalData = IOUtils.toByteArray(new FileInputStream("testFiles/enricoData/ge001.txt"));
byte[] originalData = IOUtils.toByteArray(new FileInputStream("testFiles/coloring/ge001.txt"));
assertEquals(new String(originalData, StandardCharsets.UTF_8), new String(inputData, StandardCharsets.UTF_8));
}
......
......@@ -13,6 +13,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import lcsb.mapviewer.commands.ColorExtractor;
import lcsb.mapviewer.commands.ColorModelCommand;
import lcsb.mapviewer.common.TextFileUtils;
import lcsb.mapviewer.converter.ColorSchemaReader;
import lcsb.mapviewer.converter.ConverterParams;
import lcsb.mapviewer.converter.model.celldesigner.CellDesignerXmlParser;
import lcsb.mapviewer.model.Project;
......@@ -24,7 +25,6 @@ import lcsb.mapviewer.services.ServiceTestFunctions;
import lcsb.mapviewer.services.interfaces.IDataOverlayService.CreateDataOverlayParams;
import lcsb.mapviewer.services.interfaces.IProjectBackgroundService;
import lcsb.mapviewer.services.interfaces.IUserService;
import lcsb.mapviewer.services.utils.ColorSchemaReader;
import lcsb.mapviewer.services.utils.EmailSender;
public class ProjectBackgroundTest extends ServiceTestFunctions {
......
......@@ -5,7 +5,7 @@ import org.junit.runners.Suite;
import org.junit.runners.Suite.SuiteClasses;
@RunWith(Suite.class)
@SuiteClasses({ ColorSchemaReaderTest.class,
@SuiteClasses({
EmailSenderTest.class,
})
public class AllUtilsTests {
......
This diff is collapsed.
<?xml version="1.0" encoding="UTF-8"?>
<sbml xmlns="http://www.sbml.org/sbml/level2/version4" xmlns:celldesigner="http://www.sbml.org/2001/ns/celldesigner" level="2" version="4">
<model metaid="untitled" id="untitled">
<annotation>
<celldesigner:extension>
<celldesigner:modelVersion>4.0</celldesigner:modelVersion>
<celldesigner:modelDisplay sizeX="600" sizeY="400"/>
<celldesigner:listOfCompartmentAliases/>
<celldesigner:listOfComplexSpeciesAliases/>
<celldesigner:listOfSpeciesAliases>
<celldesigner:speciesAlias id="sa1" species="s1">
<celldesigner:activity>inactive</celldesigner:activity>
<celldesigner:bounds x="220.0" y="124.0" w="80.0" h="40.0"/>
<celldesigner:font size="12"/>
<celldesigner:view state="usual"/>
<celldesigner:usualView>
<celldesigner:innerPosition x="0.0" y="0.0"/>
<celldesigner:boxSize width="80.0" height="40.0"/>
<celldesigner:singleLine width="1.0"/>
<celldesigner:paint color="ffccffcc" scheme="Color"/>
</celldesigner:usualView>
<celldesigner:briefView>
<celldesigner:innerPosition x="0.0" y="0.0"/>
<celldesigner:boxSize width="80.0" height="60.0"/>
<celldesigner:singleLine width="0.0"/>
<celldesigner:paint color="3fff0000" scheme="Color"/>
</celldesigner:briefView>
<celldesigner:info state="empty" angle="-1.5707963267948966"/>
</celldesigner:speciesAlias>
</celldesigner:listOfSpeciesAliases>
<celldesigner:listOfGroups/>
<celldesigner:listOfProteins>
<celldesigner:protein id="pr1" name="NQO1" type="GENERIC"/>
</celldesigner:listOfProteins>
<celldesigner:listOfGenes/>
<celldesigner:listOfRNAs/>
<celldesigner:listOfAntisenseRNAs/>
<celldesigner:listOfLayers/>
<celldesigner:listOfBlockDiagrams/>
</celldesigner:extension>
</annotation>
<listOfUnitDefinitions>
<unitDefinition metaid="substance" id="substance" name="substance">
<listOfUnits>
<unit metaid="CDMT00001" kind="mole"/>
</listOfUnits>
</unitDefinition>
<unitDefinition metaid="volume" id="volume" name="volume">
<listOfUnits>
<unit metaid="CDMT00002" kind="litre"/>
</listOfUnits>
</unitDefinition>
<unitDefinition metaid="area" id="area" name="area">
<listOfUnits>
<unit metaid="CDMT00003" kind="metre" exponent="2"/>
</listOfUnits>
</unitDefinition>
<unitDefinition metaid="length" id="length" name="length">
<listOfUnits>
<unit metaid="CDMT00004" kind="metre"/>
</listOfUnits>
</unitDefinition>
<unitDefinition metaid="time" id="time" name="time">
<listOfUnits>
<unit metaid="CDMT00005" kind="second"/>
</listOfUnits>
</unitDefinition>
</listOfUnitDefinitions>
<listOfCompartments>
<compartment metaid="default" id="default" size="1" units="volume"/>
</listOfCompartments>
<listOfSpecies>
<species metaid="s1" id="s1" name="NQO1" compartment="default" initialAmount="0">
<annotation>
<celldesigner:extension>
<celldesigner:positionToCompartment>inside</celldesigner:positionToCompartment>
<celldesigner:speciesIdentity>
<celldesigner:class>PROTEIN</celldesigner:class>
<celldesigner:proteinReference>pr1</celldesigner:proteinReference>
</celldesigner:speciesIdentity>
</celldesigner:extension>
</annotation>
</species>
</listOfSpecies>
</model>
</sbml>
......@@ -42,6 +42,7 @@ import org.springframework.web.context.WebApplicationContext;
import lcsb.mapviewer.api.projects.chemicals.ChemicalRestImpl;
import lcsb.mapviewer.common.*;
import lcsb.mapviewer.converter.ColorSchemaReader;
import lcsb.mapviewer.converter.zip.ZipEntryFileFactory;
import lcsb.mapviewer.model.*;
import lcsb.mapviewer.model.cache.UploadedFileEntry;
......@@ -66,7 +67,6 @@ import lcsb.mapviewer.persist.dao.user.ResetPasswordTokenDao;
import lcsb.mapviewer.persist.dao.user.UserDao;
import lcsb.mapviewer.services.interfaces.IProjectService;
import lcsb.mapviewer.services.interfaces.IUserService;
import lcsb.mapviewer.services.utils.ColorSchemaReader;
import lcsb.mapviewer.web.config.SpringWebConfig;
import lcsb.mapviewer.web.utils.CommandFormatterWithReplacingPostFilenameHeader;
import lcsb.mapviewer.web.utils.CustomCurlRequestSnippet;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment