Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DatamanagerFacility.createDataset() #7

Closed
dominikl opened this issue May 3, 2019 · 1 comment
Closed

DatamanagerFacility.createDataset() #7

dominikl opened this issue May 3, 2019 · 1 comment

Comments

@dominikl
Copy link
Member

dominikl commented May 3, 2019

Noticed a problem with the DatamanagerFacility.createDataset method. If you call it passing in a project to attach the dataset to, you have to reload the project before calling it again with another dataset, otherwise the previous dataset will be detached from the project again.

This integration test will fail:

ProjectData proj1 = new ProjectData();
proj1.setName("MyProject");
proj1 = (ProjectData) datamanagerFacility.saveAndReturnObject(rootCtx, proj1);

DatasetData ds = new DatasetData();
ds.setName("Dataset1");
ds = datamanagerFacility.createDataset(rootCtx, ds, proj1);

DatasetData ds2 = new DatasetData();
ds2.setName("Dataset2");
ds2 = datamanagerFacility.createDataset(rootCtx, ds2, proj1);

proj1 = browseFacility.getProjects(rootCtx, Collections.singleton(proj1.getId())).iterator().next();
Assert.assertEquals(proj1.getDatasets().size(), 2);

Where as by adding proj1 = browseFacility.getProjects(rootCtx, Collections.singleton(proj1.getId())).iterator().next(); after the first dataset is created it will pass.

@dominikl
Copy link
Member Author

Fixed by #10 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant