Commit f6e7573f authored by Piotr Gawron's avatar Piotr Gawron
Browse files

single column data doesn't use columns

parent 11936eac
......@@ -819,6 +819,7 @@ public class ColorSchemaReader {
line = br.readLine();
}
String[] columns = line.split("\t");
if (columns.length > 1) {
Map<ColorSchemaColumn, Integer> schemaColumns = new HashMap<>();
parseColumns(columns, schemaColumns, ColorSchemaType.GENERIC);
......@@ -833,6 +834,7 @@ public class ColorSchemaReader {
}
}
}
}
return result;
}
......
......@@ -2,11 +2,10 @@ package lcsb.mapviewer.services.utils;
import static org.junit.Assert.*;
import java.awt.*;
import java.awt.Color;
import java.io.*;
import java.nio.charset.StandardCharsets;
import java.util.*;
import java.util.List;
import org.apache.commons.io.output.ByteArrayOutputStream;
import org.apache.logging.log4j.LogManager;
......@@ -16,6 +15,7 @@ import org.junit.*;
import lcsb.mapviewer.commands.ColorExtractor;
import lcsb.mapviewer.commands.ColorModelCommand;
import lcsb.mapviewer.common.TextFileUtils;
import lcsb.mapviewer.model.cache.UploadedFileEntry;
import lcsb.mapviewer.model.map.MiriamData;
import lcsb.mapviewer.model.map.layout.*;
import lcsb.mapviewer.model.map.model.Model;
......@@ -326,4 +326,12 @@ public class ColorSchemaReaderTest extends ServiceTestFunctions {
assertNotNull(schemas.iterator().next().getModelName());
}
@Test
public void testGetDeprecatedColumns() throws Exception {
Layout overlay = new Layout();
UploadedFileEntry file = new UploadedFileEntry();
file.setFileContent("blabla\nbasd\n".getBytes("UTF-8"));
overlay.setInputData(file);
assertEquals(0, reader.getDeprecatedColumns(overlay).size());
}
}
Markdown is supported
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