use of com.synopsys.integration.detectable.detectables.clang.packagemanager.ClangPackageManagerInfo in project synopsys-detect by blackducksoftware.
the class ClangPackageManagerRunnerTest method testDpkgPkgBuriedArchitecture.
@Test
public void testDpkgPkgBuriedArchitecture() throws ExecutableRunnerException {
ClangPackageManagerInfoFactory factory = ClangPackageManagerInfoFactory.standardFactory();
ClangPackageManagerInfo packageManagerInfo = factory.dpkg();
DpkgPkgDetailsResolver versionResolver = new DpkgPkgDetailsResolver();
ClangPackageManagerResolver packageResolver = new DpkgPackageManagerResolver(versionResolver);
String pkgOwnerPattern = "libxt-dev: %s\n";
String pkgDetailsPattern = "Package: %s\n" + "Architecture: amd64\n" + "Version: 1:1.1.5-1\n" + "Status: install ok installed\n";
testSuccessCase(packageManagerInfo, packageResolver, "libxt-dev", "amd64", true, "1:1.1.5-1", pkgOwnerPattern, pkgDetailsPattern);
}
use of com.synopsys.integration.detectable.detectables.clang.packagemanager.ClangPackageManagerInfo in project synopsys-detect by blackducksoftware.
the class ClangPackageManagerRunnerTest method testRpmNonPkgOwnedIncludeFile.
@Test
public void testRpmNonPkgOwnedIncludeFile() throws ExecutableRunnerException {
ClangPackageManagerInfoFactory factory = ClangPackageManagerInfoFactory.standardFactory();
ClangPackageManagerInfo packageManagerInfo = factory.rpm();
ClangPackageManagerResolver packageResolver = new RpmPackageManagerResolver(new Gson());
String pkgOwnerPattern = "%s is not owned by any package";
testNonPkgOwnedIncludeFile(packageManagerInfo, packageResolver, pkgOwnerPattern);
}
use of com.synopsys.integration.detectable.detectables.clang.packagemanager.ClangPackageManagerInfo in project synopsys-detect by blackducksoftware.
the class ClangPackageManagerRunnerTest method testApkNonPkgOwnedIncludeFile.
@Test
public void testApkNonPkgOwnedIncludeFile() throws ExecutableRunnerException {
ClangPackageManagerInfoFactory factory = ClangPackageManagerInfoFactory.standardFactory();
ClangPackageManagerInfo packageManagerInfo = factory.apk();
ApkArchitectureResolver archResolver = new ApkArchitectureResolver();
ClangPackageManagerResolver packageResolver = new ApkPackageManagerResolver(archResolver);
String pkgOwnerPattern = "ERROR: %s: Could not find owner package";
testNonPkgOwnedIncludeFile(packageManagerInfo, packageResolver, pkgOwnerPattern);
}
use of com.synopsys.integration.detectable.detectables.clang.packagemanager.ClangPackageManagerInfo in project synopsys-detect by blackducksoftware.
the class ClangPackageManagerRunnerTest method testDpkgPkg.
@Test
public void testDpkgPkg() throws ExecutableRunnerException {
ClangPackageManagerInfoFactory factory = ClangPackageManagerInfoFactory.standardFactory();
ClangPackageManagerInfo packageManagerInfo = factory.dpkg();
DpkgPkgDetailsResolver versionResolver = new DpkgPkgDetailsResolver();
ClangPackageManagerResolver packageResolver = new DpkgPackageManagerResolver(versionResolver);
String pkgOwnerPattern = "libxt-dev:amd64: %s\n";
String pkgDetailsPattern = "Package: %s\n" + "Architecture: amd64\n" + "Version: 1:1.1.5-1\n" + "Status: install ok installed\n";
testSuccessCase(packageManagerInfo, packageResolver, "libxt-dev", "amd64", false, "1:1.1.5-1", pkgOwnerPattern, pkgDetailsPattern);
}
use of com.synopsys.integration.detectable.detectables.clang.packagemanager.ClangPackageManagerInfo in project synopsys-detect by blackducksoftware.
the class RpmPackageManagerTest method testResolve.
@Test
public void testResolve() throws ExecutableRunnerException, NotOwnedByAnyPkgException {
RpmPackageManagerResolver resolver = new RpmPackageManagerResolver(new Gson());
ClangPackageManagerInfo currentPackageManager = null;
DetectableExecutableRunner executableRunner = null;
File workingDirectory = null;
final String queryPackageOutput = "{ epoch: \"(none)\", name: \"glibc-headers\", version: \"2.17-222.el7\", arch: \"x86_64\" }\n" + "{ epoch: \"3\", name: \"test-package\", version: \"test-version\", arch: \"test_arch\" }\n";
List<PackageDetails> pkgs = resolver.resolvePackages(currentPackageManager, executableRunner, workingDirectory, queryPackageOutput);
assertEquals(2, pkgs.size());
boolean foundGLibcHeaders = false;
boolean foundTestPkg = false;
for (PackageDetails pkg : pkgs) {
if (pkg.getPackageName().equals("glibc-headers")) {
foundGLibcHeaders = true;
assertEquals("2.17-222.el7", pkg.getPackageVersion());
assertEquals("x86_64", pkg.getPackageArch());
}
if (pkg.getPackageName().equals("test-package")) {
foundTestPkg = true;
assertEquals("3:test-version", pkg.getPackageVersion());
assertEquals("test_arch", pkg.getPackageArch());
}
}
assertTrue(foundGLibcHeaders);
assertTrue(foundTestPkg);
}
Aggregations