@Test(expected = DDFException.class) public void testDDFManagerSetUUID() throws DDFException { DDF ddf = this.getTestDDF(); UUID uuid = ddf.getUUID(); DDFManager manager = getDDFManager(); UUID newUUID = UUID.randomUUID(); manager.setDDFUUID(ddf, newUUID); manager.getDDF(uuid); }
@Test public void testDDFMAnager() throws DDFException { DDF ddf = this.getTestDDF(); DDFManager manager = this.getDDFManager(); manager.setDDFName(ddf, "myddf"); UUID newUUID = UUID.randomUUID(); manager.setDDFUUID(ddf, newUUID); DDF ddf1 = manager.getDDFByName(ddf.getName()); Assert.assertEquals(ddf1.getUUID(), ddf.getUUID()); Assert.assertEquals(ddf1.getUUID(), newUUID); }
/** * Initialization to be done after constructor assignments, such as setting of the all-important DDFManager. */ protected void initialize(DDFManager manager, Object data, Class<?>[] typeSpecs, String name, Schema schema) throws DDFException { this.validateSchema(schema); this.setManager(manager); // this must be done first in case later stuff needs a manager if (typeSpecs != null) { this.getRepresentationHandler().set(data, typeSpecs); } this.getSchemaHandler().setSchema(schema); if(schema!= null && schema.getTableName() == null) { String tableName = this.getSchemaHandler().newTableName(); schema.setTableName(tableName); } manager.setDDFUUID(this, UUID.randomUUID()); if(!Strings.isNullOrEmpty(name)) manager.setDDFName(this, name); // Facades this.ML = new MLFacade(this, this.getMLSupporter()); this.VIEWS = new ViewsFacade(this, this.getViewHandler()); this.Transform = new TransformFacade(this, this.getTransformationHandler()); this.R = new RFacade(this, this.getAggregationHandler()); }