use of org.commonjava.indy.model.core.StoreType in project indy by Commonjava.
the class AffectedStoreRecordTest method dontRecordNullUpload.
@Test
public void dontRecordNullUpload() throws Exception {
final StoreType type = StoreType.group;
final String name = "test-group";
final AffectedStoreRecord record = new AffectedStoreRecord(new StoreKey(type, name));
record.add(null, StoreEffect.UPLOAD);
assertThat(record.getUploadedPaths(), nullValue());
}
use of org.commonjava.indy.model.core.StoreType in project indy by Commonjava.
the class AffectedStoreRecordTest method dontRecordNullDownload.
@Test
public void dontRecordNullDownload() throws Exception {
final StoreType type = StoreType.group;
final String name = "test-group";
final AffectedStoreRecord record = new AffectedStoreRecord(new StoreKey(type, name));
record.add(null, StoreEffect.DOWNLOAD);
assertThat(record.getDownloadedPaths(), nullValue());
}
use of org.commonjava.indy.model.core.StoreType in project indy by Commonjava.
the class MemoryArtifactStoreQuery method recurseGroup.
private void recurseGroup(final Group master, final Map<StoreKey, ArtifactStore> stores, final List<ArtifactStore> result, final Set<StoreKey> seen, final boolean includeGroups, final boolean recurseGroups) {
if (master == null || master.isDisabled() && enabled) {
return;
}
List<StoreKey> members = new ArrayList<>(master.getConstituents());
if (includeGroups) {
result.add(master);
}
members.forEach((key) -> {
if (!seen.contains(key)) {
seen.add(key);
final StoreType type = key.getType();
if (recurseGroups && type == StoreType.group) {
// if we're here, we're definitely recursing groups...
recurseGroup((Group) stores.get(key), stores, result, seen, includeGroups, true);
} else {
final ArtifactStore store = stores.get(key);
if (store != null && !(store.isDisabled() && enabled)) {
result.add(store);
}
}
}
});
}
Aggregations