congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
PluginDispatcher.dispatchWithAccountLockAndTimeout
Code IndexAdd Tabnine to your IDE (free)

How to use
dispatchWithAccountLockAndTimeout
method
in
com.ning.billing.payment.dispatcher.PluginDispatcher

Best Java code snippets using com.ning.billing.payment.dispatcher.PluginDispatcher.dispatchWithAccountLockAndTimeout (Showing top 4 results out of 315)

origin: com.ning.billing/killbill-payment

public T dispatchWithAccountLock(final Callable<T> task)
    throws PaymentApiException, TimeoutException {
  return dispatchWithAccountLockAndTimeout(task, timeoutSeconds, DEEFAULT_PLUGIN_TIMEOUT_UNIT);
}
origin: com.ning.billing/killbill-payment

@Test(groups = "fast")
public void testDispatchWithPaymentApiException() throws TimeoutException, PaymentApiException {
  boolean gotIt = false;
  try {
    voidPluginDispatcher.dispatchWithAccountLockAndTimeout(new Callable<Void>() {
      @Override
      public Void call() throws Exception {
        throw new PaymentApiException(ErrorCode.PAYMENT_ADD_PAYMENT_METHOD, "foo", "foo");
      }
    }, 100, TimeUnit.MILLISECONDS);
    Assert.fail("Failed : should have had Timeout exception");
  } catch (TimeoutException e) {
    Assert.fail("Failed : should have had PaymentApiException exception");
  } catch (PaymentApiException e) {
    gotIt = true;
  }
  Assert.assertTrue(gotIt);
}
origin: com.ning.billing/killbill-payment

@Test(groups = "fast")
public void testDispatchWithTimeout() throws TimeoutException, PaymentApiException {
  boolean gotIt = false;
  try {
    voidPluginDispatcher.dispatchWithAccountLockAndTimeout(new Callable<Void>() {
      @Override
      public Void call() throws Exception {
        Thread.sleep(1000);
        return null;
      }
    }, 100, TimeUnit.MILLISECONDS);
    Assert.fail("Failed : should have had Timeout exception");
  } catch (TimeoutException e) {
    gotIt = true;
  } catch (PaymentApiException e) {
    Assert.fail("Failed : should have had Timeout exception");
  }
  Assert.assertTrue(gotIt);
}
origin: com.ning.billing/killbill-payment

  @Test(groups = "fast")
  public void testDispatchWithRuntimeExceptionWrappedInPaymentApiException() throws TimeoutException, PaymentApiException {
    boolean gotIt = false;
    try {
      voidPluginDispatcher.dispatchWithAccountLockAndTimeout(new Callable<Void>() {
        @Override
        public Void call() throws Exception {
          throw new RuntimeException("whatever");
        }
      }, 100, TimeUnit.MILLISECONDS);
      Assert.fail("Failed : should have had Timeout exception");
    } catch (TimeoutException e) {
      Assert.fail("Failed : should have had RuntimeException exception");
    } catch (PaymentApiException e) {
      gotIt = true;
    } catch (RuntimeException e) {
    }
    Assert.assertTrue(gotIt);
  }
}
com.ning.billing.payment.dispatcherPluginDispatcherdispatchWithAccountLockAndTimeout

Popular methods of PluginDispatcher

  • <init>
  • dispatchWithAccountLock

Popular in Java

  • Making http requests using okhttp
  • setScale (BigDecimal)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • onCreateOptionsMenu (Activity)
  • Callable (java.util.concurrent)
    A task that returns a result and may throw an exception. Implementors define a single method with no
  • ExecutorService (java.util.concurrent)
    An Executor that provides methods to manage termination and methods that can produce a Future for tr
  • Semaphore (java.util.concurrent)
    A counting semaphore. Conceptually, a semaphore maintains a set of permits. Each #acquire blocks if
  • ZipFile (java.util.zip)
    This class provides random read access to a zip file. You pay more to read the zip file's central di
  • XPath (javax.xml.xpath)
    XPath provides access to the XPath evaluation environment and expressions. Evaluation of XPath Expr
  • Options (org.apache.commons.cli)
    Main entry-point into the library. Options represents a collection of Option objects, which describ
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now