Return-Path: Delivered-To: apmail-jakarta-lucene-dev-archive@apache.org Received: (qmail 1934 invoked from network); 1 Aug 2003 16:11:56 -0000 Received: from exchange.sun.com (192.18.33.10) by daedalus.apache.org with SMTP; 1 Aug 2003 16:11:56 -0000 Received: (qmail 13622 invoked by uid 97); 1 Aug 2003 16:14:31 -0000 Delivered-To: qmlist-jakarta-archive-lucene-dev@nagoya.betaversion.org Received: (qmail 13615 invoked from network); 1 Aug 2003 16:14:31 -0000 Received: from daedalus.apache.org (HELO apache.org) (208.185.179.12) by nagoya.betaversion.org with SMTP; 1 Aug 2003 16:14:31 -0000 Received: (qmail 1530 invoked by uid 500); 1 Aug 2003 16:11:51 -0000 Mailing-List: contact lucene-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Lucene Developers List" Reply-To: "Lucene Developers List" Delivered-To: mailing list lucene-dev@jakarta.apache.org Received: (qmail 1519 invoked from network); 1 Aug 2003 16:11:50 -0000 Received: from ip-67.dart.sp.ru (HELO fobos.marketsite.ru) (195.131.27.67) by daedalus.apache.org with SMTP; 1 Aug 2003 16:11:50 -0000 Received: from ip-168.dart.sp.ru ([195.131.27.168] helo=exchange.universe.dart.spb) by fobos.marketsite.ru with esmtp (Exim 4.14) id 19icVS-0000dZ-V3 for lucene-dev@jakarta.apache.org; Fri, 01 Aug 2003 20:11:50 +0400 content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-MimeOLE: Produced By Microsoft Exchange V6.0.6249.0 Subject: RE: Problem: final modifier (e.g. Document) prevents Mocked Unit Tests Date: Fri, 1 Aug 2003 20:11:50 +0400 Message-ID: <74077C8AA24C5047AA55164003DFBE88018C1ACD@exchange.universe.dart.spb> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Problem: final modifier (e.g. Document) prevents Mocked Unit Tests Thread-Index: AcNYQURV1Liv2O9XSu2i3jUkqyTxyQABVtvQ From: "Vladimir Djuzhev" To: "Lucene Developers List" X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N ehlo. > Have you tried using RAMDirectory rather than FSDirectory for your=20 > 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 testing 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? =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D if( name.equals(Indexer.FIELD_RELATIVE_URL) ) { document.add(Field.Keyword(name,value.toString())); } else if( name.equals(Indexer.FIELD_CREATED) ) { =20 document.add(Field.Keyword(name,DateField.dateToString((Date)value))); } else if( name.equals(Indexer.FIELD_TEXT) ) { document.add(Field.UnStored(name,value.toString())); } else if( name.equals(Indexer.FIELD_CATEGORIES) ) { document.add(Field.Text(name,value.toString())); } else { // dozen: yes, I know it matches prev line; I'm not sure this default is right // so it's subject to change document.add(Field.Keyword(name,value.toString())); } =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D 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)? dozen http://dozen.ru --------------------------------------------------------------------- To unsubscribe, e-mail: lucene-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: lucene-dev-help@jakarta.apache.org