Package org.easymock

Examples of org.easymock.MockControl.replay()


    public void testRegisterCombinedService()
    {
        MockControl control = MockControl.createNiceControl(Bundle.class);
        Bundle b = (Bundle) control.getMock();
        control.replay();

        MockControl controlContext = MockControl.createNiceControl(BundleContext.class);
        BundleContext c = (BundleContext) controlContext.getMock();
        controlContext.expectAndReturn(c.getBundle(), b);
        controlContext.replay();
View Full Code Here


        control.replay();

        MockControl controlContext = MockControl.createNiceControl(BundleContext.class);
        BundleContext c = (BundleContext) controlContext.getMock();
        controlContext.expectAndReturn(c.getBundle(), b);
        controlContext.replay();

        ServiceRegistry sr = new ServiceRegistry(new Logger(), null);
        class CombinedService implements ListenerHook, FindHook, EventHook, Runnable
        {
            public void added(Collection listeners)
View Full Code Here

    public void testRegisterPlainService()
    {
        MockControl control = MockControl.createNiceControl(Bundle.class);
        Bundle b = (Bundle) control.getMock();
        control.replay();

        MockControl controlContext = MockControl.createNiceControl(BundleContext.class);
        BundleContext c = (BundleContext) controlContext.getMock();
        controlContext.expectAndReturn(c.getBundle(), b);
        controlContext.replay();
View Full Code Here

        control.replay();

        MockControl controlContext = MockControl.createNiceControl(BundleContext.class);
        BundleContext c = (BundleContext) controlContext.getMock();
        controlContext.expectAndReturn(c.getBundle(), b);
        controlContext.replay();

        ServiceRegistry sr = new ServiceRegistry(new Logger(), null);
        String svcObj = "hello";
        assertEquals("Precondition failed", 0, sr.getHooks(EventHook.class).size());
        assertEquals("Precondition failed", 0, sr.getHooks(FindHook.class).size());
View Full Code Here

   
    indexReader.close();
    indexReaderControl.setVoidCallable(1);
   
    indexFactoryControl.replay();
    indexReaderControl.replay();
   
    //Lucene template
    LuceneIndexTemplate template = new DefaultLuceneIndexTemplate(indexFactory, analyzer);
    boolean deletions = template.hasDeletions();
View Full Code Here

      documentHandler.getDocument(description, "test");
      fail();
    } catch (DocumentHandlerException ex) {
    }

    resultSetControl.replay();
   
    description.put(SqlRequest.SQL_REQUEST, "sql");
    documentHandler.getDocument(description, resultSet);

    resultSetControl.verify();
View Full Code Here

  final public void testIndexStringIfDirectoryNotExist() throws Exception {
    SimpleAnalyzer analyzer = new SimpleAnalyzer();
    MockControl indexFactoryControl = MockControl.createControl(IndexFactory.class);
    IndexFactory indexFactory = (IndexFactory)indexFactoryControl.getMock();

    indexFactoryControl.replay();
   
    //Indexer
    DefaultDirectoryIndexer indexer = new DefaultDirectoryIndexer(indexFactory);
    File baseDirectory = getBaseDirectoryToIndex();
    File wrongBaseDirectory = new File(baseDirectory.getCanonicalPath()+"/test");
View Full Code Here

        sqlRequests[0] = request;
        return null;
      }
    };
 
    resultSetControl.replay();
   
    Map description = new HashMap();
    description.put(SqlRequest.SQL_REQUEST, sql);
    description.put(SqlRequest.REQUEST_PARAMETERS, params);
    description.put(SqlRequest.REQUEST_PARAMETER_TYPES, paramTypes);
View Full Code Here

   
    indexReader.close();
    indexReaderControl.setVoidCallable(1);
   
    indexFactoryControl.replay();
    indexReaderControl.replay();
   
    //Lucene template
    LuceneIndexTemplate template = new DefaultLuceneIndexTemplate(indexFactory, analyzer);
    int maxDoc = template.getMaxDoc();
View Full Code Here

   
    indexReader.close();
    indexReaderControl.setVoidCallable(1);
   
    indexFactoryControl.replay();
    indexReaderControl.replay();
   
    //Lucene template
    LuceneIndexTemplate template = new DefaultLuceneIndexTemplate(indexFactory, analyzer);
    int numDoc = template.getNumDocs();
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.