From cdf1df19960a08d54abf4480ee64bda17395f2ae Mon Sep 17 00:00:00 2001 From: Ezequiel Valencia Date: Wed, 2 Oct 2024 07:19:25 -0400 Subject: [PATCH] Fix N5 Tests --- .../src/main/java/cbit/vcell/export/server/N5Exporter.java | 3 +++ .../src/test/java/cbit/vcell/export/N5ExporterTest.java | 6 ++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/vcell-core/src/main/java/cbit/vcell/export/server/N5Exporter.java b/vcell-core/src/main/java/cbit/vcell/export/server/N5Exporter.java index 504e64599e..209f1dece7 100644 --- a/vcell-core/src/main/java/cbit/vcell/export/server/N5Exporter.java +++ b/vcell-core/src/main/java/cbit/vcell/export/server/N5Exporter.java @@ -66,6 +66,9 @@ public class N5Exporter implements ExportConstants { public N5Exporter(ExportServiceImpl exportServiceImpl, User user, DataServerImpl dataServer, VCSimulationDataIdentifier vcSimulationDataIdentifier) { this.exportServiceImpl = exportServiceImpl; + this.user = user; + this.dataServer = dataServer; + this.vcDataID = vcSimulationDataIdentifier; } private ExportOutput exportToN5(OutputContext outputContext, long jobID, N5Specs n5Specs, ExportSpecs exportSpecs, FileDataContainerManager fileDataContainerManager) throws Exception { diff --git a/vcell-core/src/test/java/cbit/vcell/export/N5ExporterTest.java b/vcell-core/src/test/java/cbit/vcell/export/N5ExporterTest.java index ae26485fe4..4a6fee1aff 100644 --- a/vcell-core/src/test/java/cbit/vcell/export/N5ExporterTest.java +++ b/vcell-core/src/test/java/cbit/vcell/export/N5ExporterTest.java @@ -60,6 +60,7 @@ enum TestModels{ private User testUser; private CartesianMesh modelMesh; private double[] times; + private ExportServiceImpl exportService = new ExportServiceImpl(); private ArrayList dataIdentifiers; @@ -129,8 +130,6 @@ public void setUp() throws IOException { previousSimCacheSize = PropertyLoader.getProperty(PropertyLoader.simdataCacheSizeProperty, null); PropertyLoader.setProperty(PropertyLoader.simdataCacheSizeProperty, "100000"); - ExportServiceImpl exportService = new ExportServiceImpl(); - Cachetable cachetable = new Cachetable(10 * Cachetable.minute, Long.parseLong(PropertyLoader.getRequiredProperty(PropertyLoader.simdataCacheSizeProperty))); File primaryDir = new File(PropertyLoader.getRequiredProperty(PropertyLoader.primarySimDataDirInternalProperty)); File secodaryDir = new File(PropertyLoader.getRequiredProperty(PropertyLoader.secondarySimDataDirInternalProperty)); @@ -138,7 +137,6 @@ public void setUp() throws IOException { DataServerImpl dataServer = new DataServerImpl(dataSetController, exportService); testUser = new User("ezequiel23", new KeyValue("258925427")); - n5Exporter = new N5Exporter(exportService); this.dataServer = dataServer; } @@ -202,7 +200,7 @@ private void setExportTestState(TestModels simModel) throws IOException, DataAcc VCSimulationIdentifier vcSimulationIdentifier = new VCSimulationIdentifier(new KeyValue(simModel.simID), testUser); vcDataID = new VCSimulationDataIdentifier(vcSimulationIdentifier, 0); - n5Exporter.initalizeDataControllers(testUser, dataServer, vcDataID); + n5Exporter = new N5Exporter(exportService, testUser, dataServer, vcDataID); dataIdentifiers = new ArrayList<>(Arrays.asList(dataServer.getDataIdentifiers(new OutputContext(new AnnotatedFunction[0]), testUser, vcDataID))); modelMesh = dataServer.getMesh(testUser, vcDataID);