Skip to content

Commit 7668d32

Browse files
authored
Merge pull request #25 from openworm/feature/batch_loading_mechanism
Feature/batch loading mechanism
2 parents acda1bd + f3f8c35 commit 7668d32

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

src/test/java/org/geppetto/datasources/DataSourcesGeppettoManagerTest.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -184,10 +184,13 @@ public void test05LoadExperiment() throws GeppettoExecutionException, GeppettoAc
184184
@Test
185185
public void test06FetchVariable() throws GeppettoExecutionException, GeppettoAccessException, GeppettoDataSourceException, GeppettoModelException
186186
{
187+
// the duplicates are intentional, the RunTimeProject class will check if duplicates want to be fetched or if they are already in the current model.
188+
String[] idsList = {"testVariable", "testVariable", "testVariable2", "testVariable2", "testVariable"};
187189
GeppettoModel geppettoModel = runtimeProject.getGeppettoModel();
188190
Assert.assertEquals(1, geppettoModel.getVariables().size()); // only "time" //FIXME Should time be there without a simulation?
189-
GeppettoModel model = manager.fetchVariable("testDataSource", "testVariable", geppettoProject);
191+
GeppettoModel model = manager.fetchVariable("testDataSource", idsList, geppettoProject);
190192
Assert.assertEquals("testVariable", model.getVariables().get(1).getId());
193+
Assert.assertEquals("testVariable2", model.getVariables().get(2).getId());
191194
}
192195

193196
/**
@@ -201,15 +204,15 @@ public void test07ResolveImportType() throws GeppettoExecutionException, Geppett
201204
{
202205
GeppettoModel geppettoModel = runtimeProject.getGeppettoModel();
203206
Type type = geppettoModel.getLibraries().get(0).getTypes().get(0);
204-
Assert.assertEquals(1, geppettoModel.getLibraries().get(0).getTypes().size());
207+
Assert.assertEquals(2, geppettoModel.getLibraries().get(0).getTypes().size());
205208
Assert.assertEquals("testImportType", type.getId());
206209
Assert.assertTrue(type instanceof ImportType);
207210
List<String> types=new ArrayList<String>();
208211
types.add("testLibrary.testImportType");
209212
GeppettoModel model = manager.resolveImportType(types, geppettoProject);
210-
type = model.getLibraries().get(0).getTypes().get(0);
213+
type = model.getLibraries().get(0).getTypes().get(1);
211214
Assert.assertTrue(type instanceof CompositeType);
212-
Assert.assertEquals(1, model.getLibraries().get(0).getTypes().size()); //still only one type but this time it's a composite
215+
Assert.assertEquals(2, model.getLibraries().get(0).getTypes().size()); //still only one type but this time it's a composite
213216
Assert.assertEquals(5, ((CompositeType) type).getVariables().size());
214217

215218
}

0 commit comments

Comments
 (0)