Search in sources :

Example 1 with VendorHandler

use of org.eclipse.sw360.vendors.VendorHandler in project sw360portal by sw360.

the class VendorHandlerTest method setUp.

@Before
public void setUp() throws Exception {
    // Create the database
    TestUtils.createDatabase(DatabaseSettings.getConfiguredHttpClient(), dbName);
    // Prepare the database
    DatabaseConnector databaseConnector = new DatabaseConnector(DatabaseSettings.getConfiguredHttpClient(), dbName);
    vendorList = new ArrayList<>();
    vendorList.add(new Vendor().setShortname("Microsoft").setFullname("Microsoft Corporation").setUrl("http://www.microsoft.com"));
    vendorList.add(new Vendor().setShortname("Apache").setFullname("The Apache Software Foundation").setUrl("http://www.apache.org"));
    for (Vendor vendor : vendorList) {
        databaseConnector.add(vendor);
    }
    vendorHandler = new VendorHandler();
}
Also used : DatabaseConnector(org.eclipse.sw360.datahandler.couchdb.DatabaseConnector) Vendor(org.eclipse.sw360.datahandler.thrift.vendors.Vendor) Before(org.junit.Before)

Example 2 with VendorHandler

use of org.eclipse.sw360.vendors.VendorHandler in project sw360portal by sw360.

the class ComponentAndAttachmentAwareDBTest method getThriftClients.

protected static ThriftClients getThriftClients() throws TException, IOException {
    assertTestDbNames();
    ThriftClients thriftClients = failingMock(ThriftClients.class);
    ComponentHandler componentHandler = new ComponentHandler(thriftClients);
    VendorHandler vendorHandler = new VendorHandler();
    AttachmentHandler attachmentHandler = new AttachmentHandler();
    ModerationService.Iface moderationService = failingMock(ModerationService.Iface.class);
    doNothing().when(moderationService).deleteRequestsOnDocument(anyString());
    doReturn(componentHandler).when(thriftClients).makeComponentClient();
    doReturn(vendorHandler).when(thriftClients).makeVendorClient();
    doReturn(attachmentHandler).when(thriftClients).makeAttachmentClient();
    doReturn(moderationService).when(thriftClients).makeModerationClient();
    return thriftClients;
}
Also used : ModerationService(org.eclipse.sw360.datahandler.thrift.moderation.ModerationService) AttachmentHandler(org.eclipse.sw360.attachments.AttachmentHandler) ComponentHandler(org.eclipse.sw360.components.ComponentHandler) VendorHandler(org.eclipse.sw360.vendors.VendorHandler) ThriftClients(org.eclipse.sw360.datahandler.thrift.ThriftClients)

Aggregations

AttachmentHandler (org.eclipse.sw360.attachments.AttachmentHandler)1 ComponentHandler (org.eclipse.sw360.components.ComponentHandler)1 DatabaseConnector (org.eclipse.sw360.datahandler.couchdb.DatabaseConnector)1 ThriftClients (org.eclipse.sw360.datahandler.thrift.ThriftClients)1 ModerationService (org.eclipse.sw360.datahandler.thrift.moderation.ModerationService)1 Vendor (org.eclipse.sw360.datahandler.thrift.vendors.Vendor)1 VendorHandler (org.eclipse.sw360.vendors.VendorHandler)1 Before (org.junit.Before)1