use of com.emc.metalnx.core.domain.entity.DataGridCollectionAndDataObject in project metalnx-web by irods-contrib.
the class TestAddMetadataToColls method setUp.
@Before
public void setUp() throws DataGridException {
parentPath = String.format("/%s/home/%s", zone, username);
path = String.format("%s/test-metadata-transfer", parentPath);
fos.deleteCollection(path, true);
cs.createCollection(new DataGridCollectionAndDataObject(path, parentPath, true));
expectedMetadataList = MetadataUtils.createRandomMetadataAsString(NUMBER_OF_METADATA_TAGS);
for (int i = 0; i < NUMBER_OF_COLLS; i++) {
String collname = BASE_COLL_NAME + i;
String collPath = String.format("%s/%s", path, collname);
cs.createCollection(new DataGridCollectionAndDataObject(collPath, path, true));
for (String metadataStr : expectedMetadataList) {
String[] metadata = metadataStr.split(" ");
String attr = metadata[0], val = metadata[1], unit = metadata[2];
metadataService.addMetadataToPath(collPath, attr, val, unit);
}
}
}
use of com.emc.metalnx.core.domain.entity.DataGridCollectionAndDataObject in project metalnx-web by irods-contrib.
the class TestCopyCollWithMetadata method setUp.
@Before
public void setUp() throws DataGridException {
parentPath = String.format("/%s/home/%s", zone, username);
srcPath = String.format("%s/test-metadata-transfer", parentPath);
dstPath = String.format("%s/dst-test-metadata-transfer", parentPath);
fos.deleteCollection(srcPath, true);
fos.deleteCollection(dstPath, true);
cs.createCollection(new DataGridCollectionAndDataObject(srcPath, parentPath, true));
cs.createCollection(new DataGridCollectionAndDataObject(dstPath, parentPath, true));
expectedMetadataList = new ArrayList<>();
expectedMetadataList.add("attr1 val1 unit1");
expectedMetadataList.add("attr2 val2 unit2");
expectedMetadataList.add("attr3 val3 unit3");
for (int i = 0; i < NUMBER_OF_COLLS; i++) {
String collname = BASE_COLL_NAME + i;
String collSrcPath = String.format("%s/%s", srcPath, collname);
cs.createCollection(new DataGridCollectionAndDataObject(collSrcPath, srcPath, true));
for (String s : expectedMetadataList) {
String[] metadata = s.split(" ");
String attr = metadata[0], val = metadata[1], unit = metadata[2];
metadataService.addMetadataToPath(collSrcPath, attr, val, unit);
}
}
}
use of com.emc.metalnx.core.domain.entity.DataGridCollectionAndDataObject in project metalnx-web by irods-contrib.
the class TestMetadataCase method assertMetadataSearch.
private void assertMetadataSearch(int expectedNumOfFiles, int expectedNumOfMatchesByFile) throws DataGridConnectionRefusedException {
objs = metadataService.findByMetadata(search, new DataGridPageContext(), 1, 100);
assertTrue(objs.size() >= expectedNumOfFiles);
for (DataGridCollectionAndDataObject obj : objs) {
assertTrue(obj.isVisibleToCurrentUser());
assertFalse(obj.isCollection());
assertEquals(expectedNumOfMatchesByFile, obj.getNumberOfMatches());
}
}
use of com.emc.metalnx.core.domain.entity.DataGridCollectionAndDataObject in project metalnx-web by irods-contrib.
the class TestMetadataCase method setUp.
@Before
public void setUp() throws DataGridException {
parentPath = String.format("/%s/home/%s", zone, username);
targetPath = String.format("%s/test-metadata-search", parentPath);
fos.deleteCollection(targetPath, true);
cs.createCollection(new DataGridCollectionAndDataObject(targetPath, parentPath, true));
for (int i = 0; i < NUMBER_OF_FILES; i++) {
String filename = BASE_FILE_NAME + i + ".txt";
MockMultipartFile file = new MockMultipartFile(filename, "Hello World".getBytes());
us.upload(file, targetPath, false, false, "", RESOURCE, false);
String filepath = String.format("%s/%s", targetPath, filename);
metadataService.addMetadataToPath(filepath, "TEST", "TEST", "TEST");
metadataService.addMetadataToPath(filepath, "test", "test", "test");
metadataService.addMetadataToPath(filepath, "TeSt", "tEsT", "teST");
}
attr = "test";
val = "TEST";
unit = "TEst";
search = new ArrayList<>();
}
use of com.emc.metalnx.core.domain.entity.DataGridCollectionAndDataObject in project metalnx-web by irods-contrib.
the class TestReadPermissionOnFiles method setUp.
@Before
public void setUp() throws DataGridException {
parentPath = String.format("/%s/home/%s", zone, username);
targetPath = String.format("%s/test-metadata-search-%d", parentPath, System.currentTimeMillis());
fos.deleteCollection(targetPath, true);
cs.createCollection(new DataGridCollectionAndDataObject(targetPath, parentPath, true));
uploadTestFiles();
}
Aggregations