Package org.easymock

Examples of org.easymock.MockControl.verify()


    TransactionSynchronizationManager.unbindResource(sf);
    assertTrue("JTA synchronizations not active", !TransactionSynchronizationManager.isSynchronizationActive());

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

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


    TransactionSynchronizationManager.unbindResource(sf);
    assertTrue("JTA synchronizations not active", !TransactionSynchronizationManager.isSynchronizationActive());

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

  /**
   * Simple mock which overrides equals.
   *
 
View Full Code Here

      assertNotNull(indexer.getDocumentHandler("test"));
    } catch(Exception ex) {
      fail();
    }

    indexFactoryControl.verify();
  }

  final public void testUnregisterDocumentHandler() {
    SimpleAnalyzer analyzer = new SimpleAnalyzer();
    MockControl indexFactoryControl = MockControl.createControl(IndexFactory.class);
View Full Code Here

    try {
      assertNull(indexer.getDocumentHandler("test"));
      fail();
    } catch(Exception ex) {}

    indexFactoryControl.verify();
  }

  final public void testAddListener() {
    SimpleAnalyzer analyzer = new SimpleAnalyzer();
    MockControl indexFactoryControl = MockControl.createControl(IndexFactory.class);
View Full Code Here

    indexer.addListener(listener);
    assertEquals(indexer.getListeners().size(), 1);
    FileDocumentIndexingListener tmpListener = (FileDocumentIndexingListener)indexer.getListeners().get(0);
    assertEquals(listener, tmpListener);

    indexFactoryControl.verify();
  }

  final public void testRemoveListener() {
    SimpleAnalyzer analyzer = new SimpleAnalyzer();
    MockControl indexFactoryControl = MockControl.createControl(IndexFactory.class);
View Full Code Here

    //Unregister a document handler
    indexer.removeListener(listener);
    assertEquals(indexer.getListeners().size(), 0);

    indexFactoryControl.verify();
  }

  private File getBaseDirectoryToIndex() {
    URL url = getClass().getClassLoader().getResource(
          "org/springmodules/lucene/index/object/files/");
View Full Code Here

    File baseDirectory = getBaseDirectoryToIndex();
    indexer.index(baseDirectory.getAbsolutePath());

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

  /*
   * Test for void index(String) with document handler registered
   */
 
View Full Code Here

    //Lucene template
    LuceneIndexTemplate template = new DefaultLuceneIndexTemplate(indexFactory, analyzer);
    template.deleteDocument(0);

    indexFactoryControl.verify();
    indexReaderControl.verify();
  }

  /*
   * Test for void deleteDocument(Term)
   */
 
View Full Code Here

    File baseDirectory = getBaseDirectoryToIndex();
    indexer.index(baseDirectory.getAbsolutePath());

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

  /*
   * Test pour void index(String) with document handler registered
   */
 
View Full Code Here

    //Lucene template
    LuceneIndexTemplate template = new DefaultLuceneIndexTemplate(indexFactory, analyzer);
    template.deleteDocuments(new Term("field","lucene"));

    indexFactoryControl.verify();
    indexReaderControl.verify();
  }

  final public void testUndeleteDocuments() throws Exception {
    SimpleAnalyzer analyzer = new SimpleAnalyzer();
    MockControl indexFactoryControl = MockControl.createStrictControl(IndexFactory.class);
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.