Search in sources :

Example 1 with TestUtil

use of com.blackducksoftware.integration.hub.detect.testutils.TestUtil in project hub-detect by blackducksoftware.

the class VndrParserTest method vndrParserTest.

@Test
public void vndrParserTest() throws IOException {
    final TestUtil testUtil = new TestUtil();
    final VndrParser vndrParser = new VndrParser(new ExternalIdFactory());
    final String text = testUtil.getResourceAsUTF8String("/go/vendor.conf");
    final List<String> vendorConfContents = Arrays.asList(text.split("\r?\n"));
    final DependencyGraph dependencyGraph = vndrParser.parseVendorConf(vendorConfContents);
    Assert.assertNotNull(dependencyGraph);
    DependencyGraphResourceTestUtil.assertGraph("/go/Go_VndrExpected_graph.json", dependencyGraph);
}
Also used : DependencyGraphResourceTestUtil(com.blackducksoftware.integration.hub.detect.testutils.DependencyGraphResourceTestUtil) TestUtil(com.blackducksoftware.integration.hub.detect.testutils.TestUtil) ExternalIdFactory(com.synopsys.integration.bdio.model.externalid.ExternalIdFactory) DependencyGraph(com.synopsys.integration.bdio.graph.DependencyGraph) Test(org.junit.Test)

Example 2 with TestUtil

use of com.blackducksoftware.integration.hub.detect.testutils.TestUtil in project hub-detect by blackducksoftware.

the class RebarParserTest method setup.

@BeforeClass
public static void setup() {
    externalIdFactory = new ExternalIdFactory();
    rebar3TreeParser = new Rebar3TreeParser(externalIdFactory);
    testUtil = new TestUtil();
}
Also used : TestUtil(com.blackducksoftware.integration.hub.detect.testutils.TestUtil) ExternalIdFactory(com.synopsys.integration.bdio.model.externalid.ExternalIdFactory) BeforeClass(org.junit.BeforeClass)

Example 3 with TestUtil

use of com.blackducksoftware.integration.hub.detect.testutils.TestUtil in project hub-detect by blackducksoftware.

the class NpmLockfileParserTest method init.

@Before
public void init() {
    testUtil = new TestUtil();
    npmLockfileParser = new NpmLockfileParser(new GsonBuilder().setPrettyPrinting().create(), new ExternalIdFactory());
}
Also used : DependencyGraphResourceTestUtil(com.blackducksoftware.integration.hub.detect.testutils.DependencyGraphResourceTestUtil) TestUtil(com.blackducksoftware.integration.hub.detect.testutils.TestUtil) GsonBuilder(com.google.gson.GsonBuilder) ExternalIdFactory(com.synopsys.integration.bdio.model.externalid.ExternalIdFactory) Before(org.junit.Before)

Example 4 with TestUtil

use of com.blackducksoftware.integration.hub.detect.testutils.TestUtil in project hub-detect by blackducksoftware.

the class PearDependencyTest method init.

@Before
public void init() {
    detectConfiguration = Mockito.mock(DetectConfiguration.class);
    pearParser = new PearParser(new ExternalIdFactory(), detectConfiguration);
    testUtil = new TestUtil();
}
Also used : DetectConfiguration(com.blackducksoftware.integration.hub.detect.configuration.DetectConfiguration) DependencyGraphResourceTestUtil(com.blackducksoftware.integration.hub.detect.testutils.DependencyGraphResourceTestUtil) TestUtil(com.blackducksoftware.integration.hub.detect.testutils.TestUtil) ExternalIdFactory(com.synopsys.integration.bdio.model.externalid.ExternalIdFactory) Before(org.junit.Before)

Example 5 with TestUtil

use of com.blackducksoftware.integration.hub.detect.testutils.TestUtil in project hub-detect by blackducksoftware.

the class BitbakeListTasksParserTest method parseTargetArchitectureTest.

@Test
public void parseTargetArchitectureTest() {
    final TestUtil testUtil = new TestUtil();
    final String listtaskOutput = testUtil.getResourceAsUTF8String("/bitbake/listtasks_output.txt");
    final BitbakeListTasksParser bitbakeListTasksParser = new BitbakeListTasksParser();
    final Optional<String> architecture = bitbakeListTasksParser.parseTargetArchitecture(listtaskOutput);
    assert architecture.isPresent();
    System.out.println(architecture.get());
    assert architecture.get().equals("i586-poky-linux");
}
Also used : TestUtil(com.blackducksoftware.integration.hub.detect.testutils.TestUtil) Test(org.junit.Test)

Aggregations

TestUtil (com.blackducksoftware.integration.hub.detect.testutils.TestUtil)5 ExternalIdFactory (com.synopsys.integration.bdio.model.externalid.ExternalIdFactory)4 DependencyGraphResourceTestUtil (com.blackducksoftware.integration.hub.detect.testutils.DependencyGraphResourceTestUtil)3 Before (org.junit.Before)2 Test (org.junit.Test)2 DetectConfiguration (com.blackducksoftware.integration.hub.detect.configuration.DetectConfiguration)1 GsonBuilder (com.google.gson.GsonBuilder)1 DependencyGraph (com.synopsys.integration.bdio.graph.DependencyGraph)1 BeforeClass (org.junit.BeforeClass)1