congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
RecoveryException.getMessage
Code IndexAdd Tabnine to your IDE (free)

How to use
getMessage
method
in
bitronix.tm.recovery.RecoveryException

Best Java code snippets using bitronix.tm.recovery.RecoveryException.getMessage (Showing top 6 results out of 315)

origin: com.github.marcus-nl.btm/btm

public void testReEnteringRecovery() throws Exception {
  if (log.isDebugEnabled()) { log.debug("*** Starting testReEnteringRecovery"); }
  pds.startRecovery();
  try {
    pds.startRecovery();
    fail("expected RecoveryException");
  } catch (RecoveryException ex) {
    assertEquals("recovery already in progress on a PoolingDataSource containing an XAPool of resource pds with 1 connection(s) (0 still available)", ex.getMessage());
  }
  // make sure startRecovery() can be called again once endRecovery() has been called
  pds.endRecovery();
  pds.startRecovery();
  pds.endRecovery();
}
origin: bitronix/btm

public void testReEnteringRecovery() throws Exception {
  if (log.isDebugEnabled()) { log.debug("*** Starting testReEnteringRecovery"); }
  pds.startRecovery();
  try {
    pds.startRecovery();
    fail("expected RecoveryException");
  } catch (RecoveryException ex) {
    assertEquals("recovery already in progress on a PoolingDataSource containing an XAPool of resource pds with 1 connection(s) (0 still available)", ex.getMessage());
  }
  // make sure startRecovery() can be called again once endRecovery() has been called
  pds.endRecovery();
  pds.startRecovery();
  pds.endRecovery();
}
origin: com.github.marcus-nl.btm/btm

public void testReEnteringRecovery() throws Exception {
  pcf.startRecovery();
  try {
    pcf.startRecovery();
    fail("excpected RecoveryException");
  } catch (RecoveryException ex) {
    assertEquals("recovery already in progress on a PoolingConnectionFactory with an XAPool of resource pcf with 1 connection(s) (0 still available)", ex.getMessage());
  }
  // make sure startRecovery() can be called again once endRecovery() has been called
  pcf.endRecovery();
  pcf.startRecovery();
  pcf.endRecovery();
}
origin: bitronix/btm

public void testReEnteringRecovery() throws Exception {
  pcf.startRecovery();
  try {
    pcf.startRecovery();
    fail("excpected RecoveryException");
  } catch (RecoveryException ex) {
    assertEquals("recovery already in progress on a PoolingConnectionFactory with an XAPool of resource pcf with 1 connection(s) (0 still available)", ex.getMessage());
  }
  // make sure startRecovery() can be called again once endRecovery() has been called
  pcf.endRecovery();
  pcf.startRecovery();
  pcf.endRecovery();
}
origin: bitronix/btm

  public void testSuccessfulRecoveryMarksAsNotFailed() throws Exception {
    MockitoXADataSource.setStaticGetXAConnectionException(new SQLException("creating a new connection does not work"));

    PoolingDataSource poolingDataSource = new PoolingDataSource();
    poolingDataSource.setClassName(MockitoXADataSource.class.getName());
    poolingDataSource.setUniqueName("ds1");
    poolingDataSource.setMaxPoolSize(1);
    poolingDataSource.init();

    try {
      IncrementalRecoverer.recover(poolingDataSource);
      fail("expected RecoveryException");
    } catch (RecoveryException ex) {
      assertEquals("cannot start recovery on a PoolingDataSource containing an XAPool of resource ds1 with 0 connection(s) (0 still available)", ex.getMessage());
    }

    assertEquals("a PoolingDataSource containing an XAPool of resource ds1 with 0 connection(s) (0 still available) -failed-", poolingDataSource.toString());

    MockitoXADataSource.setStaticGetXAConnectionException(null);

    Recoverer recoverer = new Recoverer();
    recoverer.run();
    assertEquals("a PoolingDataSource containing an XAPool of resource ds1 with 1 connection(s) (1 still available)", poolingDataSource.toString());
    // recoverer must not unregister the resource
    assertSame(poolingDataSource, ResourceRegistrar.get("ds1"));

    poolingDataSource.close();
  }
}
origin: com.github.marcus-nl.btm/btm

  public void testSuccessfulRecoveryMarksAsNotFailed() throws Exception {
    MockitoXADataSource.setStaticGetXAConnectionException(new SQLException("creating a new connection does not work"));

    PoolingDataSource poolingDataSource = new PoolingDataSource();
    poolingDataSource.setClassName(MockitoXADataSource.class.getName());
    poolingDataSource.setUniqueName("ds1");
    poolingDataSource.setMaxPoolSize(1);
    poolingDataSource.init();

    try {
      IncrementalRecoverer.recover(poolingDataSource);
      fail("expected RecoveryException");
    } catch (RecoveryException ex) {
      assertEquals("cannot start recovery on a PoolingDataSource containing an XAPool of resource ds1 with 0 connection(s) (0 still available)", ex.getMessage());
    }

    assertEquals("a PoolingDataSource containing an XAPool of resource ds1 with 0 connection(s) (0 still available) -failed-", poolingDataSource.toString());

    MockitoXADataSource.setStaticGetXAConnectionException(null);

    Recoverer recoverer = new Recoverer();
    recoverer.run();
    assertEquals("a PoolingDataSource containing an XAPool of resource ds1 with 1 connection(s) (1 still available)", poolingDataSource.toString());
    // recoverer must not unregister the resource
    assertSame(poolingDataSource, ResourceRegistrar.get("ds1"));

    poolingDataSource.close();
  }
}
bitronix.tm.recoveryRecoveryExceptiongetMessage

Popular methods of RecoveryException

  • <init>

Popular in Java

  • Reactive rest calls using spring rest template
  • onCreateOptionsMenu (Activity)
  • getApplicationContext (Context)
  • runOnUiThread (Activity)
  • Kernel (java.awt.image)
  • BufferedWriter (java.io)
    Wraps an existing Writer and buffers the output. Expensive interaction with the underlying reader is
  • DateFormat (java.text)
    Formats or parses dates and times.This class provides factories for obtaining instances configured f
  • Set (java.util)
    A Set is a data structure which does not allow duplicate elements.
  • SortedSet (java.util)
    SortedSet is a Set which iterates over its elements in a sorted order. The order is determined eithe
  • JButton (javax.swing)
  • 21 Best IntelliJ Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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