From: Bryan T. <tho...@us...> - 2007-12-05 16:41:32
|
Update of /cvsroot/cweb/generic-test/src/java/org/CognitiveWeb/generic In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv8411/src/java/org/CognitiveWeb/generic Modified Files: IObjectManagerProxyTestCase.java ILinkSetIndexProxyTestCase.java Log Message: updated dependency version for junit-ext. Index: ILinkSetIndexProxyTestCase.java =================================================================== RCS file: /cvsroot/cweb/generic-test/src/java/org/CognitiveWeb/generic/ILinkSetIndexProxyTestCase.java,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** ILinkSetIndexProxyTestCase.java 2 Jun 2006 18:01:01 -0000 1.18 --- ILinkSetIndexProxyTestCase.java 5 Dec 2007 16:41:27 -0000 1.19 *************** *** 54,79 **** /** ! * Tests for the {@link ILinkSetIndex} interface.<p> ! * ! * @todo Develop variant of test suite for unique indices, for indices ! * over the date and number generic value types, and for at least one ! * unicode collation sequence. Note that there is no mechanisms in ! * the API to request such indices at this time. ! * ! * @todo Develop tests when all objects in the link set are being ! * indexed (so duplicate keys are supported) that checks the correct ! * ordering of the objects lacking a binding on the value property to ! * the start (or end) of the index ("sort nulls to end?"). ! * ! * @todo Add examples in which the application key is coerced into the ! * natural data type for the index. For example, a String ! * representation of a date is parsed to get a {@link Date} for a date ! * index or a {@link Number} and {@link Date} are converted into a ! * Unicode representation for a unicode index. ! * ! * @todo Can we have tests for heterogeneous key types here (a ! * DWIMIndex) or should we only test for homogeneous key types, in ! * which case we still need tests for the following core generic ! * types: number and date. */ --- 54,84 ---- /** ! * Tests for the {@link ILinkSetIndex} interface. ! * <p> ! * <p> ! * Note: These tests are not super aware of Unicode collation ordering. They ! * were originally written to use "\0" to create the successor of a String, but ! * the trailing nul is typically ignored when a sort key is created from Unicode ! * text by a collator. ! * ! * @todo Develop variant of test suite for unique indices, for indices over the ! * date and number generic value types, and for at least one unicode ! * collation sequence. Note that there is no mechanisms in the API to ! * request such indices at this time. ! * ! * @todo Develop tests when all objects in the link set are being indexed (so ! * duplicate keys are supported) that checks the correct ordering of the ! * objects lacking a binding on the value property to the start (or end) ! * of the index ("sort nulls to end?"). ! * ! * @todo Add examples in which the application key is coerced into the natural ! * data type for the index. For example, a String representation of a date ! * is parsed to get a {@link Date} for a date index or a {@link Number} ! * and {@link Date} are converted into a Unicode representation for a ! * unicode index. ! * ! * @todo Can we have tests for heterogeneous key types here (a DWIMIndex) or ! * should we only test for homogeneous key types, in which case we still ! * need tests for the following core generic types: number and date. */ *************** *** 1397,1402 **** assertSameIndexRanges // {a,a} ( new IGeneric[][]{new IGeneric[]{g2,g4}}, ! ndx.getRangeCount( "a", "a\0" ), // successor idiom ! ndx.getRange( "a", "a\0" ) // successor idiom ); --- 1402,1413 ---- assertSameIndexRanges // {a,a} ( new IGeneric[][]{new IGeneric[]{g2,g4}}, ! /* ! * Note: Unicode successor semantics may be based on a collation ! * order in which case appending \0 is typically ignored. ! */ ! // ndx.getRangeCount( "a", "a\0" ), // successor idiom ! // ndx.getRange( "a", "a\0" ) // successor idiom ! ndx.getRangeCount( "a", "aa" ), // successor idiom ! ndx.getRange( "a", "aa" ) // successor idiom ); *************** *** 1418,1429 **** ( new IGeneric[][]{new IGeneric[]{g3}, new IGeneric[]{g5,g6}}, ! ndx.getRangeCount( "b", "c\0" ), // successor idiom. ! ndx.getRange( "b", "c\0" ) // successor idiom ); assertSameIndexRanges // { { c, c } } ( new IGeneric[][]{new IGeneric[]{g5,g6}}, ! ndx.getRangeCount( "c", "c\0" ), // successor idiom. ! ndx.getRange( "c", "c\0" ) // successor idiom ); --- 1429,1452 ---- ( new IGeneric[][]{new IGeneric[]{g3}, new IGeneric[]{g5,g6}}, ! /* ! * Note: Unicode successor semantics may be based on a collation ! * order in which case appending \0 is typically ignored. ! */ ! // ndx.getRangeCount( "b", "c\0" ), // successor idiom. ! // ndx.getRange( "b", "c\0" ) // successor idiom ! ndx.getRangeCount( "b", "ca" ), // successor idiom. ! ndx.getRange( "b", "ca" ) // successor idiom ); assertSameIndexRanges // { { c, c } } ( new IGeneric[][]{new IGeneric[]{g5,g6}}, ! /* ! * Note: Unicode successor semantics may be based on a collation ! * order in which case appending \0 is typically ignored. ! */ ! // ndx.getRangeCount( "c", "c\0" ), // successor idiom. ! // ndx.getRange( "c", "c\0" ) // successor idiom ! ndx.getRangeCount( "c", "ca" ), // successor idiom. ! ndx.getRange( "c", "ca" ) // successor idiom ); *************** *** 1493,1498 **** assertSameIndexRanges // {a,a} ( new IGeneric[][]{new IGeneric[]{g2,g4}}, ! ndx.getHeadCount( "a\0" ), // successor idiom ! ndx.getHead( "a\0" ) // successor idiom ); --- 1516,1527 ---- assertSameIndexRanges // {a,a} ( new IGeneric[][]{new IGeneric[]{g2,g4}}, ! /* ! * Note: Unicode successor semantics may be based on a collation ! * order in which case appending \0 is typically ignored. ! */ ! // ndx.getHeadCount( "a\0" ), // successor idiom ! // ndx.getHead( "a\0" ) // successor idiom ! ndx.getHeadCount( "aa" ), // successor idiom ! ndx.getHead( "aa" ) // successor idiom ); *************** *** 1509,1514 **** new IGeneric[]{g3}, new IGeneric[]{g5,g6}}, ! ndx.getHeadCount( "c\0" ), // successor idiom. ! ndx.getHead( "c\0" ) // successor idiom ); --- 1538,1549 ---- new IGeneric[]{g3}, new IGeneric[]{g5,g6}}, ! /* ! * Note: Unicode successor semantics may be based on a collation ! * order in which case appending \0 is typically ignored. ! */ ! // ndx.getHeadCount( "c\0" ), // successor idiom. ! // ndx.getHead( "c\0" ) // successor idiom ! ndx.getHeadCount( "ca" ), // successor idiom. ! ndx.getHead( "ca" ) // successor idiom ); *************** *** 1574,1579 **** assertSameIndexRanges // { { c, c } } ( new IGeneric[][]{new IGeneric[]{g5,g6}}, ! ndx.getTailCount( "b\0" ), // successor idiom ! ndx.getTail( "b\0" ) // successor idiom ); --- 1609,1620 ---- assertSameIndexRanges // { { c, c } } ( new IGeneric[][]{new IGeneric[]{g5,g6}}, ! /* ! * Note: Unicode successor semantics may be based on a collation ! * order in which case appending \0 is typically ignored. ! */ ! // ndx.getTailCount( "b\0" ), // successor idiom ! // ndx.getTail( "b\0" ) // successor idiom ! ndx.getTailCount( "ba" ), // successor idiom ! ndx.getTail( "ba" ) // successor idiom ); *************** *** 1586,1591 **** assertSameIndexRanges // { } ( new IGeneric[][]{}, ! ndx.getTailCount( "c\0" ), // successor idiom ! ndx.getTail( "c\0" ) // successor idiom ); --- 1627,1638 ---- assertSameIndexRanges // { } ( new IGeneric[][]{}, ! /* ! * Note: Unicode successor semantics may be based on a collation ! * order in which case appending \0 is typically ignored. ! */ ! // ndx.getTailCount( "c\0" ), // successor idiom ! // ndx.getTail( "c\0" ) // successor idiom ! ndx.getTailCount( "ca" ), // successor idiom ! ndx.getTail( "ca" ) // successor idiom ); Index: IObjectManagerProxyTestCase.java =================================================================== RCS file: /cvsroot/cweb/generic-test/src/java/org/CognitiveWeb/generic/IObjectManagerProxyTestCase.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** IObjectManagerProxyTestCase.java 20 May 2006 13:18:45 -0000 1.11 --- IObjectManagerProxyTestCase.java 5 Dec 2007 16:41:27 -0000 1.12 *************** *** 310,323 **** ILinkSet ls2 = g2.getLinkSet( linkProperty ); - ILinkSetIndex ndx2 = ls2.getExistingIndex - ( valueProperty - ); - - assertNotNull - ( "Expecting index to be registered for new link set"+ - ": linkSet(ls2)="+ls2, - ndx2 - ); - IGeneric g2a = addGeneric(); g2a.set( valueProperty, "a" ); IGeneric g2b = addGeneric(); g2b.set( valueProperty, "b" ); --- 310,313 ---- *************** *** 325,331 **** ls2.add( g2a ); ls2.add( g2b ); ls2.add( g2c ); ! ILinkSetProxyTestCase.assertLinkSet ( new IGeneric[]{g2a,g2b,g2c}, --- 315,329 ---- ls2.add( g2a ); + /* + * Note: The index may be lazily created so we don't test until we add an + * object to the link set with an attribute that is used by the index. At + * that point the index MUST exist since it was registered in advance. + */ + assertNotNull("Expecting index to be registered for new link set" + + ": linkSet(ls2)=" + ls2, ls2.getExistingIndex(valueProperty)); + // ls2.add( g2b ); ls2.add( g2c ); ! ILinkSetProxyTestCase.assertLinkSet ( new IGeneric[]{g2a,g2b,g2c}, *************** *** 333,336 **** --- 331,337 ---- ); + // index is known to exist. + ILinkSetIndex ndx2 = ls2.getExistingIndex(valueProperty); + ILinkSetIndexProxyTestCase.assertSameIndexRanges ( new IGeneric[][]{new IGeneric[]{g2a}, |