Package com.google.api.adwords.v201306.cm

Examples of com.google.api.adwords.v201306.cm.CampaignServiceInterface


  public void testRemoveServiceRemote() throws Exception {
    ServiceAccountantManager instance = ServiceAccountantManager.getInstance();
    instance.setAutoCreateAccountant(true);
    AdWordsUser testUser = new AdWordsUser("test_data/test.properties");

    CampaignServiceInterface campaignService =
        testUser.getService(AdWordsService.V200909.CAMPAIGN_SERVICE);
    campaignService.get(new CampaignSelector());

    instance.removeService(campaignService);
    assertTrue("Service was not removed.", instance.getNumberRegisteredServices() == 0);
  }
View Full Code Here


  public void testRemoveServiceStub() throws Exception {
    ServiceAccountantManager instance = ServiceAccountantManager.getInstance();
    instance.setAutoCreateAccountant(true);
    AdWordsUser testUser = new AdWordsUser("test_data/test.properties");

    CampaignServiceInterface campaignService =
        testUser.getService(AdWordsService.V200909.CAMPAIGN_SERVICE);
    campaignService.get(new CampaignSelector());

    instance.removeService((Stub) campaignService);
    assertTrue("Service was not removed.", instance.getNumberRegisteredServices() == 0);
  }
View Full Code Here

  public void testRemoveServiceService() throws Exception {
    ServiceAccountantManager instance = ServiceAccountantManager.getInstance();
    instance.setAutoCreateAccountant(true);
    AdWordsUser testUser = new AdWordsUser("test_data/test.properties");

    CampaignServiceInterface campaignService =
        testUser.getService(AdWordsService.V200909.CAMPAIGN_SERVICE);
    campaignService.get(new CampaignSelector());

    instance.removeService(((Stub) campaignService)._getService());
    assertTrue("Service was not removed.", instance.getNumberRegisteredServices() == 0);
  }
View Full Code Here

  public void testClear() throws Exception {
    ServiceAccountantManager instance = ServiceAccountantManager.getInstance();
    instance.setAutoCreateAccountant(true);
    AdWordsUser testUser = new AdWordsUser("test_data/test.properties");

    CampaignServiceInterface campaignService =
        testUser.getService(AdWordsService.V200909.CAMPAIGN_SERVICE);
    campaignService.get(new CampaignSelector());
    campaignService = testUser.getService(AdWordsService.V200909.CAMPAIGN_SERVICE);
    campaignService.get(new CampaignSelector());

    instance.clear();

    assertTrue("Services were not removed.", instance.getNumberRegisteredServices() == 0);
    assertTrue("Services were not removed.", instance.getNumberRegisteredServices(testUser) == 0);
View Full Code Here

        instance.getNumberRegisteredServices() == 0);

    AdWordsUser testUser1 = new AdWordsUser("test_data/test.properties");
    AdWordsUser testUser2 = new AdWordsUser("test_data/test.properties");
    AdWordsUser testUser3 = new AdWordsUser("test_data/test.properties");
    CampaignServiceInterface campaignService1 =
        testUser1.getService(AdWordsService.V200909.CAMPAIGN_SERVICE);
    CampaignServiceInterface campaignService2 =
        testUser2.getService(AdWordsService.V200909.CAMPAIGN_SERVICE);
    campaignService1.get(new CampaignSelector());
    campaignService2.get(new CampaignSelector());

    assertEquals(2, instance.getNumberRegisteredServices());
    instance.removeAllServicesForUser(testUser1);
    assertEquals(1, instance.getNumberRegisteredServices());
    instance.removeAllServicesForUser(testUser2);
View Full Code Here

    assertTrue("No services should be registered yet.",
        instance.getNumberRegisteredServices() == 0);

    AdWordsUser testUser1 = new AdWordsUser("test_data/test.properties");
    AdWordsUser testUser2 = new AdWordsUser("test_data/test.properties");
    CampaignServiceInterface campaignService1 =
        testUser1.getService(AdWordsService.V200909.CAMPAIGN_SERVICE);
    CampaignServiceInterface campaignService2 =
        testUser2.getService(AdWordsService.V200909.CAMPAIGN_SERVICE);
    campaignService1.get(new CampaignSelector());
    campaignService2.get(new CampaignSelector());

    assertEquals(2, instance.getNumberRegisteredServices());
  }
View Full Code Here

    assertTrue("No services should be registered yet.",
        instance.getNumberRegisteredServices() == 0);

    AdWordsUser testUser1 = new AdWordsUser("test_data/test.properties");
    AdWordsUser testUser2 = new AdWordsUser("test_data/test.properties");
    CampaignServiceInterface campaignService1 =
        testUser1.getService(AdWordsService.V200909.CAMPAIGN_SERVICE);
    CampaignServiceInterface campaignService2 =
        testUser2.getService(AdWordsService.V200909.CAMPAIGN_SERVICE);
    campaignService1.get(new CampaignSelector());
    campaignService2.get(new CampaignSelector());

    assertEquals(2, instance.getNumberRegisteredServices());
    assertEquals(1, instance.getNumberRegisteredServices(testUser1));
    assertEquals(1, instance.getNumberRegisteredServices(testUser2));
  }
View Full Code Here

    assertTrue("No services should be registered yet.",
        instance.getNumberRegisteredServices() == 0);

    AdWordsUser testUser1 = new AdWordsUser("test_data/test.properties");
    AdWordsUser testUser2 = new AdWordsUser("test_data/test.properties");
    CampaignServiceInterface campaignService1 =
        testUser1.getService(AdWordsService.V200909.CAMPAIGN_SERVICE);
    CampaignServiceInterface campaignService2 =
        testUser2.getService(AdWordsService.V200909.CAMPAIGN_SERVICE);
    campaignService1.get(new CampaignSelector());
    campaignService2.get(new CampaignSelector());

    instance.setRetainServices(true);

    CampaignServiceInterface campaignService3 =
        testUser1.getService(AdWordsService.V200909.CAMPAIGN_SERVICE);
    CampaignServiceInterface campaignService4 =
        testUser2.getService(AdWordsService.V200909.CAMPAIGN_SERVICE);
    campaignService3.get(new CampaignSelector());
    campaignService4.get(new CampaignSelector());

    assertEquals(4, instance.getNumberRegisteredServices());
    assertEquals(2, instance.getNumberRetainedServices());
    assertEquals(campaignService3, instance.getRetainedServicesForUser(testUser1)[0]);
    assertEquals(campaignService4, instance.getRetainedServicesForUser(testUser2)[0]);
View Full Code Here

        instance.getNumberRegisteredServices() == 0);
    assertTrue(instance.getAllRetainedServices().isEmpty());

    AdWordsUser testUser1 = new AdWordsUser("test_data/test.properties");
    AdWordsUser testUser2 = new AdWordsUser("test_data/test.properties");
    CampaignServiceInterface campaignService1 =
        testUser1.getService(AdWordsService.V200909.CAMPAIGN_SERVICE);
    CampaignServiceInterface campaignService2 =
        testUser2.getService(AdWordsService.V200909.CAMPAIGN_SERVICE);
    campaignService1.get(new CampaignSelector());
    campaignService2.get(new CampaignSelector());

    assertEquals(2, instance.getAllRetainedServices().keySet().size());
    instance.setRetainServices(true);

    CampaignServiceInterface campaignService3 =
        testUser1.getService(AdWordsService.V200909.CAMPAIGN_SERVICE);
    CampaignServiceInterface campaignService4 =
        testUser2.getService(AdWordsService.V200909.CAMPAIGN_SERVICE);
    campaignService3.get(new CampaignSelector());
    campaignService4.get(new CampaignSelector());

    assertEquals(4, instance.getNumberRegisteredServices());
    assertEquals(2, instance.getNumberRetainedServices());

    Map<AdWordsUser, Stub[]> allRetainedServices = instance.getAllRetainedServices();
View Full Code Here

  public void testCreateServiceAccountantStub() throws Exception {
    ServiceAccountantManager instance = ServiceAccountantManager.getInstance();
    instance.setAutoCreateAccountant(false);

    AdWordsUser testUser = new AdWordsUser("test_data/test.properties");
    CampaignServiceInterface campaignService =
        testUser.getService(AdWordsService.V200909.CAMPAIGN_SERVICE);
    campaignService.get(new CampaignSelector());

    assertNull("No service accountant should be created.", instance
        .getServiceAccountant(campaignService));

    ServiceAccountant serviceAccountant =
        ServiceAccountantManager.createServiceAccountant((Stub) campaignService);
    assertTrue("Service accountant should be empty.", serviceAccountant.getTotalUnitCount() == 0);

    campaignService.get(new CampaignSelector());

    long totalUnits = serviceAccountant.getTotalUnitCount();
    assertTrue("Service accountant not used.", totalUnits > 0);

    instance.clear();

    campaignService.get(new CampaignSelector());

    assertEquals("Service accountant still used.", totalUnits, serviceAccountant
        .getTotalUnitCount());
  }
View Full Code Here

TOP

Related Classes of com.google.api.adwords.v201306.cm.CampaignServiceInterface

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.