[Javamatch-cvs] javamatch/src/net/sourceforge/javamatch/query/test NotQueryTest.java,NONE,1.1 TestAl
Status: Pre-Alpha
Brought to you by:
iterson
From: Walter v. I. <it...@us...> - 2004-09-09 14:19:10
|
Update of /cvsroot/javamatch/javamatch/src/net/sourceforge/javamatch/query/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24523/query/test Modified Files: TestAll.java Added Files: NotQueryTest.java Log Message: Added NotQuery, fix javadoc --- NEW FILE: NotQueryTest.java --- /* JavaMatch: Matching engine for Java runtime data structures * Copyright (C) 2004 Walter van Iterson * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ package net.sourceforge.javamatch.query.test; import junit.framework.*; import net.sourceforge.javamatch.engine.*; import net.sourceforge.javamatch.query.*; /** * Class NotQueryTest tests the NotQuery query */ public class NotQueryTest extends TestCase { public NotQueryTest(String name) { super(name); } public void testGetMatchValue() { try { MatchQuery query = new ConstantMatch(0.3f); NotQuery notQuery = new NotQuery(query); assertEquals(0.7f, notQuery.getMatchValue(new DataObject(0)), 0.001f); } catch (MatchException me) { fail("unable to match"); } } public void testNullNestedQuery() { try { new NotQuery(null); fail("Shouldn't be able to create NotQuery with null nested query"); } catch (NullPointerException npe) { // should occur } } } Index: TestAll.java =================================================================== RCS file: /cvsroot/javamatch/javamatch/src/net/sourceforge/javamatch/query/test/TestAll.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** TestAll.java 3 Sep 2004 08:21:23 -0000 1.1.1.1 --- TestAll.java 9 Sep 2004 14:18:59 -0000 1.2 *************** *** 45,48 **** --- 45,49 ---- suite.addTestSuite(StringEqualsTest.class); suite.addTestSuite(ContainsTest.class); + suite.addTestSuite(NotQueryTest.class); // ... and others return suite; |