lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vladimir Djuzhev" <>
Subject RE: Problem: final modifier (e.g. Document) prevents Mocked Unit Tests
Date Fri, 01 Aug 2003 16:11:50 GMT

> Have you tried using RAMDirectory rather than FSDirectory for your 
> index during testing?

  No, I'll take a look on it, thanx.

> Yup, I use mocks myself.

  Hello, brother in arms! ;)

> If you can show a use case of where extensions are necessary beyond

  Do you think this one reason is not enough? ;/

  Well, I'll see what can I do with RAM/FS Directory, but
  really: how do you think can I test the following logic
  without using MockDocument and MockField?

            if( name.equals(Indexer.FIELD_RELATIVE_URL) ) {
            } else if( name.equals(Indexer.FIELD_CREATED) ) {
            } else if( name.equals(Indexer.FIELD_TEXT) ) {
            } else if( name.equals(Indexer.FIELD_CATEGORIES) ) {

            } else {
                // dozen: yes, I know it matches prev line; I'm not sure
this default is right
                // so it's subject to change

  In short: here I shall perform different actions depending on
  keys and (not implemented yet) types of objects (f.ex, for Date's
  I have to use dateToString()).

  Can it be achived without Mocks (and not running actual tests)?


View raw message