use of org.sonatype.nexus.repository.browse.BrowsePaths in project nexus-repository-r by sonatype-nexus-community.
the class RBrowseNodeGeneratorTest method shouldComputeAssetAndComponentPathWithoutNameDuplication.
@Test
public void shouldComputeAssetAndComponentPathWithoutNameDuplication() {
final String commonPath = "src/contrib/Archive/ggplot2";
final String lastSegment = "ggplot2_0.9.0.tar.gz";
final String assetPath = commonPath + "/" + lastSegment;
final String componentName = "ggplot2";
final String componentVersion = "0.9.0";
// Browse path should not have name duplicates
final String componentBrowsePath = commonPath + "/" + componentVersion;
final String assetBrowsePath = componentBrowsePath + "/" + lastSegment;
Component component = createComponent(componentName, commonPath, componentVersion);
Asset asset = createAsset(assetPath);
List<BrowsePaths> pathsAsset = generator.computeAssetPaths(asset, component);
List<BrowsePaths> pathsComponent = generator.computeComponentPaths(asset, component);
assertPaths(Arrays.asList(assetBrowsePath.split("/")), pathsAsset);
assertPaths(Arrays.asList(componentBrowsePath.split("/")), pathsComponent, true);
}
use of org.sonatype.nexus.repository.browse.BrowsePaths in project nexus-repository-r by sonatype-nexus-community.
the class RBrowseNodeGeneratorTest method shouldComputeAssetAndComponentPath.
@Test
public void shouldComputeAssetAndComponentPath() {
final String commonPath = "bin/macosx/el-capitan/contrib/3.6";
final String lastSegment = "devtools_2.2.1.tgz";
final String assetPath = commonPath + "/" + lastSegment;
final String componentName = "devtools";
final String componentVersion = "2.2.1";
final String componentBrowsePath = commonPath + "/" + componentName + "/" + componentVersion;
final String assetBrowsePath = componentBrowsePath + "/" + lastSegment;
Component component = createComponent(componentName, commonPath, componentVersion);
Asset asset = createAsset(assetPath);
List<BrowsePaths> pathsAsset = generator.computeAssetPaths(asset, component);
List<BrowsePaths> pathsComponent = generator.computeComponentPaths(asset, component);
assertPaths(Arrays.asList(assetBrowsePath.split("/")), pathsAsset);
assertPaths(Arrays.asList(componentBrowsePath.split("/")), pathsComponent, true);
}
use of org.sonatype.nexus.repository.browse.BrowsePaths in project nexus-repository-r by sonatype-nexus-community.
the class RBrowseNodeGeneratorTest method shouldComputeAssetPathWithoutComponent.
@Test
public void shouldComputeAssetPathWithoutComponent() {
final String assetPath = "bin/macosx/el-capitan/contrib/3.6/devtools_2.2.1.tgz";
Asset asset = createAsset(assetPath);
List<BrowsePaths> pathsAsset = generator.computeAssetPaths(asset, null);
assertPaths(Arrays.asList(assetPath.split("/")), pathsAsset, false);
}
Aggregations