Search in sources :

Example 46 with ExternalIdFactory

use of com.synopsys.integration.bdio.model.externalid.ExternalIdFactory in project hub-detect by blackducksoftware.

the class CodeLocationNameGeneratorTest method testLongCodeLocationNames.

@Test
public void testLongCodeLocationNames() {
    final String expected = "hub-common-rest/hub...esthub-common-rest/group/name/version npm/bom";
    final ExternalIdFactory factory = new ExternalIdFactory();
    final ExternalId externalId = factory.createMavenExternalId("group", "name", "version");
    final DetectFileFinder detectFileFinder = new DetectFileFinder();
    final CodeLocationNameGenerator codeLocationNameGenerator = new CodeLocationNameGenerator(detectFileFinder);
    final String sourcePath = "/Users/ekerwin/Documents/source/integration/hub-common-rest";
    final String codeLocationPath = "/Users/ekerwin/Documents/source/integration/hub-common-rest/hub-common-resthub-common-resthub-common-resthub-common-resthub-common-resthub-common-resthub-common-resthub-common-resthub-common-resthub-common-resthub-common-resthub-common-resthub-common-resthub-common-resthub-common-resthub-common-resthub-common-resthub-common-resthub-common-resthub-common-rest";
    final String prefix = "";
    final String suffix = "";
    final String actual = codeLocationNameGenerator.createBomCodeLocationName(sourcePath, codeLocationPath, externalId, DetectCodeLocationType.NPM, prefix, suffix);
    assertEquals(expected, actual);
}
Also used : ExternalIdFactory(com.synopsys.integration.bdio.model.externalid.ExternalIdFactory) ExternalId(com.synopsys.integration.bdio.model.externalid.ExternalId) DetectFileFinder(com.blackducksoftware.integration.hub.detect.workflow.file.DetectFileFinder) Test(org.junit.Test)

Aggregations

ExternalIdFactory (com.synopsys.integration.bdio.model.externalid.ExternalIdFactory)46 Test (org.junit.Test)33 DependencyGraph (com.synopsys.integration.bdio.graph.DependencyGraph)17 File (java.io.File)13 ArrayList (java.util.ArrayList)12 Dependency (com.synopsys.integration.bdio.model.dependency.Dependency)11 ExternalId (com.synopsys.integration.bdio.model.externalid.ExternalId)10 DetectCodeLocation (com.blackducksoftware.integration.hub.detect.workflow.codelocation.DetectCodeLocation)8 DetectFileFinder (com.blackducksoftware.integration.hub.detect.workflow.file.DetectFileFinder)7 Extraction (com.blackducksoftware.integration.hub.detect.workflow.extraction.Extraction)5 ExtractionId (com.blackducksoftware.integration.hub.detect.detector.ExtractionId)4 TestUtil (com.blackducksoftware.integration.hub.detect.testutils.TestUtil)4 ExecutableOutput (com.blackducksoftware.integration.hub.detect.util.executable.ExecutableOutput)4 DependencyGraphResourceTestUtil (com.blackducksoftware.integration.hub.detect.testutils.DependencyGraphResourceTestUtil)3 ExecutableRunner (com.blackducksoftware.integration.hub.detect.util.executable.ExecutableRunner)3 DirectoryManager (com.blackducksoftware.integration.hub.detect.workflow.file.DirectoryManager)3 Gson (com.google.gson.Gson)3 GsonBuilder (com.google.gson.GsonBuilder)3 HashSet (java.util.HashSet)3 Set (java.util.Set)3