StorageModels implements IModelManager, ModelCreator, ModelManipulator { public StorageModels() { this.models = new ArrayList<>(); this.columnNameOverrideRule = new HashMap<>(); this.listeners = new ArrayList<>(); } StorageModels(); @Override Model add(Class<?> aClass, int scopeId, Storage storage, boolean record); @Override void addModelListener(final CreatingListener listener); @Override void overrideColumnName(String columnName, String newName); @Override List<Model> allModels();  }
@Test public void testStorageModels() throws StorageException { StorageModels models = new StorageModels(); models.add(TestModel.class, -1, new Storage("StorageModelsTest", DownSampling.Hour), false ); final List<Model> allModules = models.allModels(); Assert.assertEquals(1, allModules.size()); final Model model = allModules.get(0); Assert.assertEquals(4, model.getColumns().size()); Assert.assertEquals(false, model.getColumns().get(0).isStorageOnly()); Assert.assertEquals(false, model.getColumns().get(1).isStorageOnly()); Assert.assertEquals(false, model.getColumns().get(2).isStorageOnly()); Assert.assertEquals(true, model.getColumns().get(3).isStorageOnly()); final List<ExtraQueryIndex> extraQueryIndices = model.getExtraQueryIndices(); Assert.assertEquals(3, extraQueryIndices.size()); Assert.assertArrayEquals(new String[] { "column2", "column" }, extraQueryIndices.get(2).getColumns()); }