Package org.easymock

Examples of org.easymock.MockControl.verify()


    } catch(Exception ex) {
      //Check if a writer has been opened
      //Check if the writer calls the addDocument method
      //Check if the writer of the template is closed
      indexFactoryControl.verify();
      indexWriterControl.verify();
     
      //Check if the writer calls the getResourceName, getResourceDescription and
      //createInputStream methods
      assertFalse(called[0]);
      assertFalse(called[1]);
View Full Code Here


    LuceneIndexTemplate template = new DefaultLuceneIndexTemplate(indexFactory,analyzer);
    template.addDocuments(documentsCreator);

    indexFactoryControl.verify();
    indexWriterControl.verify();
    documentsCreatorControl.verify();
  }

  final public void testUpdateDocument() throws Exception {
    SimpleAnalyzer analyzer = new SimpleAnalyzer();
    MockControl indexFactoryControl = MockControl.createStrictControl(IndexFactory.class);
View Full Code Here

    indexFactoryControl.verify();
    indexReaderControl.verify();
    indexWriterControl.verify();
    searcherControl.verify();
    documentModifierControl.verify();
    hitsControl.verify();
  }

  final public void testUpdateDocuments() throws Exception {
    SimpleAnalyzer analyzer = new SimpleAnalyzer();
    MockControl indexFactoryControl = MockControl.createStrictControl(IndexFactory.class);
View Full Code Here

    factory.afterPropertiesSet();

    factory.destroy();

    nrCtrl.verify();
    wsCtrl.verify();
    sessionCtrl.verify();
  }

  public void testSkipRegisteredNamespaces() throws Exception {
View Full Code Here

    factory.afterPropertiesSet();

    factory.destroy();

    nrCtrl.verify();
    wsCtrl.verify();
    sessionCtrl.verify();
  }

  public void testDefaultSesionHolder() throws Exception {
View Full Code Here

    Session sess = factory.getSession();
    assertSame(session, sess);
    assertSame(CustomSessionHolder.class, factory.getSessionHolder(sess).getClass());

    repoCtrl.verify();
    sessionCtrl.verify();
  }

  /**
   * Used for testing.
   *
 
View Full Code Here

    assertTrue("Hasn't thread session", !TransactionSynchronizationManager.hasResource(sf));
    assertTrue("JTA synchronizations not active", !TransactionSynchronizationManager.isSynchronizationActive());

    sfControl.verify();
    sessionControl.verify();
    xaResControl.verify();
  }

  public void testTransactionRollback() throws Exception {
    MockControl sfControl = MockControl.createControl(SessionFactory.class);
    final SessionFactory sf = (SessionFactory) sfControl.getMock();
View Full Code Here

    assertTrue("Hasn't thread session", !TransactionSynchronizationManager.hasResource(sf));
    assertTrue("JTA synchronizations not active", !TransactionSynchronizationManager.isSynchronizationActive());

    sfControl.verify();
    sessionControl.verify();
    xaResControl.verify();
  }

  public void testTransactionRollbackOnly() throws Exception {
    MockControl sfControl = MockControl.createControl(SessionFactory.class);
    final SessionFactory sf = (SessionFactory) sfControl.getMock();
View Full Code Here

    assertTrue("Hasn't thread session", !TransactionSynchronizationManager.hasResource(sf));
    assertTrue("JTA synchronizations not active", !TransactionSynchronizationManager.isSynchronizationActive());

    sfControl.verify();
    sessionControl.verify();
    xaResControl.verify();
  }

  public void testInvalidIsolation() throws Exception {
    MockControl sfControl = MockControl.createControl(SessionFactory.class);
    final SessionFactory sf = (SessionFactory) sfControl.getMock();
View Full Code Here

    }

    assertTrue("Hasn't thread session", !TransactionSynchronizationManager.hasResource(sf));
    assertTrue("JTA synchronizations not active", !TransactionSynchronizationManager.isSynchronizationActive());

    sfControl.verify();
  }

  public void testTransactionCommitWithPrebound() throws Exception {
    MockControl sfControl = MockControl.createControl(SessionFactory.class);
    final SessionFactory sf = (SessionFactory) sfControl.getMock();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.