You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by rm...@apache.org on 2010/10/02 23:03:00 UTC
svn commit: r1003885 [5/6] - in /lucene/dev/branches/branch_3x: ./ lucene/
lucene/backwards/src/ lucene/backwards/src/test/org/apache/lucene/analysis/
lucene/backwards/src/test/org/apache/lucene/document/
lucene/backwards/src/test/org/apache/lucene/ind...
Propchange: lucene/dev/branches/branch_3x/solr/src/maven/solr-core-pom.xml.template
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat Oct 2 21:02:57 2010
@@ -1,3 +1,3 @@
/lucene/dev/branches/preflexfixes/solr/src/maven/solr-core-pom.xml.template:967125-979432
-/lucene/dev/trunk/solr/src/maven/solr-core-pom.xml.template:931298,931337,931502,932129-932131,932163,932304,932369,932374,932398,932417,932541,932576,932587,932698,932731-932749,932752,932773,932795,932828,932856-932857,932862,932864,932878,932963,932998-932999,933541-933575,933598,933613,933679,933879,934339,934954,935014-935048,935065,935186-935513,935521-935522,935553-935962,936522,936544,936605,936657-936726,937039,937360,938582-938646,938989,939111,939611,939649,940433,940447,940451-940452,940556,940666,940699,940730,940878-940892,940994,941270,941363,942166,942235,942288,942676,942719,943142,943493,943931,944516,944528,945057,945090,945130,945245,945343,945420,946139,946330,946338,946599,948011,948082,948429,949288,949311,949445,949976,949997,950008,950042,950125,950207,950458,950613,950723,950835,951126,951355,951397,951521,953628,953886,954336,955547,955613,955615,955796-955797,955809-955996,956097,956125,956173,956316,956715,957465,957520,957634,957707,960367,96037
4,960719,961821,961941,962555,962714,963372,963654,963720,963781,963873,963888,963906,963909,963920,964019,964054,964267,964312,964430,964459,964720,964753,964832,964856,965103,965222,965230,965327,965330,965585,965938,966354,966878,967080,979049,979453,979807,979809,980369,980428,980436,980501,980555,980592,980909,980911,980917,981265,981550,981598,981650,981661,981690,981857,981936,982073,982084,982201,982725,982824,983100,983212,983216,983313,983495,983500,983530,983632,983778,984187,984202,984232,984510,984968,985453,985455,985672,985875,986158,986612,986773,987005,987009,987122,988087,988206,988216,988259,988346,988478,988527,988543,988592,988613,988688,988710,988736,988739,989004,989010,989013,989030,989035,989315,989321,989334,990160-990161,990180,990189,990281,990301,990451,990459,990766,990781,990854,991053,991191,991497,992424,992469,992567,992571,992623,992913,993106,993194,993199,993287,993408,994935,994976,994979,995247,995250,995253,995264,995286,995376,995557,
995772,996268,996357,996416,996511,996611,996623,996647-996653,996720,996942,996978,997180,997230,998055,998505,998684,999016,999223,999545,999842,1000000,1000424,1000581,1000675,1001006,1001318,1001320,1001420,1001661,1001957,1003107,1003614,1003631,1003645,1003703,1003841-1003852,1003873
+/lucene/dev/trunk/solr/src/maven/solr-core-pom.xml.template:931298,931337,931502,932129-932131,932163,932304,932369,932374,932398,932417,932541,932576,932587,932698,932731-932749,932752,932773,932795,932828,932856-932857,932862,932864,932878,932963,932998-932999,933541-933575,933598,933613,933679,933879,934339,934954,935014-935048,935065,935186-935513,935521-935522,935553-935962,936522,936544,936605,936657-936726,937039,937360,938582-938646,938989,939111,939611,939649,940433,940447,940451-940452,940556,940666,940699,940730,940878-940892,940994,941270,941363,942166,942235,942288,942676,942719,943142,943493,943931,944516,944528,945057,945090,945130,945245,945343,945420,946139,946330,946338,946599,948011,948082,948429,949288,949311,949445,949976,949997,950008,950042,950125,950207,950458,950613,950723,950835,951126,951355,951397,951521,953628,953886,954336,955547,955613,955615,955796-955797,955809-955996,956097,956125,956173,956316,956715,957465,957520,957634,957707,960367,96037
4,960719,961821,961941,962555,962714,963372,963654,963720,963781,963873,963888,963906,963909,963920,964019,964054,964267,964312,964430,964459,964720,964753,964832,964856,965103,965222,965230,965327,965330,965585,965938,966354,966878,967080,979049,979453,979807,979809,980369,980428,980436,980501,980555,980592,980909,980911,980917,981265,981550,981598,981650,981661,981690,981857,981936,982073,982084,982201,982725,982824,983100,983212,983216,983313,983495,983500,983530,983632,983778,984187,984202,984232,984510,984968,985453,985455,985672,985875,986158,986612,986773,987005,987009,987122,988087,988206,988216,988259,988346,988478,988527,988543,988592,988613,988688,988710,988736,988739,989004,989010,989013,989030,989035,989315,989321,989334,990160-990161,990180,990189,990281,990301,990451,990459,990766,990781,990854,991053,991191,991497,992424,992469,992567,992571,992623,992913,993106,993194,993199,993287,993408,994935,994976,994979,995247,995250,995253,995264,995286,995376,995557,
995772,996268,996357,996416,996511,996611,996623,996647-996653,996720,996942,996978,997180,997230,998055,998505,998684,999016,999223,999545,999842,1000000,1000424,1000581,1000675,1001006,1001318,1001320,1001420,1001661,1001957,1003107,1003614,1003631,1003645,1003703,1003841-1003852,1003873,1003877
/lucene/solr/trunk/src/maven/solr-core-pom.xml.template:922950-923910,923912-925091
Propchange: lucene/dev/branches/branch_3x/solr/src/maven/solr-solrj-pom.xml.template
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat Oct 2 21:02:57 2010
@@ -1,3 +1,3 @@
/lucene/dev/branches/preflexfixes/solr/src/maven/solr-solrj-pom.xml.template:967125-979432
-/lucene/dev/trunk/solr/src/maven/solr-solrj-pom.xml.template:931298,931337,931502,932129-932131,932163,932304,932369,932374,932398,932417,932541,932576,932587,932698,932731-932749,932752,932773,932795,932828,932856-932857,932862,932864,932878,932963,932998-932999,933541-933575,933598,933613,933679,933879,934339,934954,935014-935048,935065,935186-935513,935521-935522,935553-935962,936522,936544,936605,936657-936726,937039,937360,938582-938646,938989,939111,939611,939649,940433,940447,940451-940452,940556,940666,940699,940730,940878-940892,940994,941270,941363,942166,942235,942288,942676,942719,943142,943493,943931,944516,944528,945057,945090,945130,945245,945343,945420,946139,946330,946338,946599,948011,948082,948429,949288,949311,949445,949976,949997,950008,950042,950125,950207,950458,950613,950723,950835,951126,951355,951397,951521,953628,953886,954336,955547,955613,955615,955796-955797,955809-955996,956097,956125,956173,956316,956715,957465,957520,957634,957707,960367,9603
74,960719,961821,961941,962555,962714,963372,963654,963720,963781,963873,963888,963906,963909,963920,964019,964054,964267,964312,964430,964459,964720,964753,964832,964856,965103,965222,965230,965327,965330,965585,965938,966354,966878,967080,979049,979453,979807,979809,980369,980428,980436,980501,980555,980592,980909,980911,980917,981265,981550,981598,981650,981661,981690,981857,981936,982073,982084,982201,982725,982824,983100,983212,983216,983313,983495,983500,983530,983632,983778,984187,984202,984232,984510,984968,985453,985455,985672,985875,986158,986612,986773,987005,987009,987122,988087,988206,988216,988259,988346,988478,988527,988543,988592,988613,988688,988710,988736,988739,989004,989010,989013,989030,989035,989315,989321,989334,990160-990161,990180,990189,990281,990301,990451,990459,990766,990781,990854,991053,991191,991497,992424,992469,992567,992571,992623,992913,993106,993194,993199,993287,993408,994935,994976,994979,995247,995250,995253,995264,995286,995376,995557
,995772,996268,996357,996416,996511,996611,996623,996647-996653,996720,996942,996978,997180,997230,998055,998505,998684,999016,999223,999545,999842,1000000,1000424,1000581,1000675,1001006,1001318,1001320,1001420,1001661,1001957,1003107,1003614,1003631,1003645,1003703,1003841-1003852,1003873
+/lucene/dev/trunk/solr/src/maven/solr-solrj-pom.xml.template:931298,931337,931502,932129-932131,932163,932304,932369,932374,932398,932417,932541,932576,932587,932698,932731-932749,932752,932773,932795,932828,932856-932857,932862,932864,932878,932963,932998-932999,933541-933575,933598,933613,933679,933879,934339,934954,935014-935048,935065,935186-935513,935521-935522,935553-935962,936522,936544,936605,936657-936726,937039,937360,938582-938646,938989,939111,939611,939649,940433,940447,940451-940452,940556,940666,940699,940730,940878-940892,940994,941270,941363,942166,942235,942288,942676,942719,943142,943493,943931,944516,944528,945057,945090,945130,945245,945343,945420,946139,946330,946338,946599,948011,948082,948429,949288,949311,949445,949976,949997,950008,950042,950125,950207,950458,950613,950723,950835,951126,951355,951397,951521,953628,953886,954336,955547,955613,955615,955796-955797,955809-955996,956097,956125,956173,956316,956715,957465,957520,957634,957707,960367,9603
74,960719,961821,961941,962555,962714,963372,963654,963720,963781,963873,963888,963906,963909,963920,964019,964054,964267,964312,964430,964459,964720,964753,964832,964856,965103,965222,965230,965327,965330,965585,965938,966354,966878,967080,979049,979453,979807,979809,980369,980428,980436,980501,980555,980592,980909,980911,980917,981265,981550,981598,981650,981661,981690,981857,981936,982073,982084,982201,982725,982824,983100,983212,983216,983313,983495,983500,983530,983632,983778,984187,984202,984232,984510,984968,985453,985455,985672,985875,986158,986612,986773,987005,987009,987122,988087,988206,988216,988259,988346,988478,988527,988543,988592,988613,988688,988710,988736,988739,989004,989010,989013,989030,989035,989315,989321,989334,990160-990161,990180,990189,990281,990301,990451,990459,990766,990781,990854,991053,991191,991497,992424,992469,992567,992571,992623,992913,993106,993194,993199,993287,993408,994935,994976,994979,995247,995250,995253,995264,995286,995376,995557
,995772,996268,996357,996416,996511,996611,996623,996647-996653,996720,996942,996978,997180,997230,998055,998505,998684,999016,999223,999545,999842,1000000,1000424,1000581,1000675,1001006,1001318,1001320,1001420,1001661,1001957,1003107,1003614,1003631,1003645,1003703,1003841-1003852,1003873,1003877
/lucene/solr/trunk/src/maven/solr-solrj-pom.xml.template:922950-923910,923912-925091
Propchange: lucene/dev/branches/branch_3x/solr/src/solrj/org/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat Oct 2 21:02:57 2010
@@ -1,3 +1,3 @@
/lucene/dev/branches/preflexfixes/solr/src/solrj/org:967125-979432
-/lucene/dev/trunk/solr/src/solrj/org:931298,931337,931502,932129-932131,932163,932304,932369,932374,932398,932417,932541,932576,932587,932698,932731-932749,932752,932773,932795,932828,932856-932857,932862,932864,932878,932963,932998-932999,933541-933575,933598,933613,933679,933879,934339,934954,935014-935048,935065,935186-935513,935521-935522,935553-935962,936522,936544,936605,936657-936726,937039,937360,938582-938646,938989,939111,939611,939649,940433,940447,940451-940452,940556,940666,940699,940730,940878-940892,940994,941270,941363,942166,942235,942288,942676,942719,943142,943493,943931,944516,944528,945057,945090,945130,945245,945343,945420,946139,946330,946338,946599,948011,948082,948429,949288,949311,949445,949976,949997,950008,950042,950125,950207,950458,950613,950723,950835,951126,951355,951397,951521,953628,953886,954336,955547,955613,955615,955796-955797,955809-955996,956097,956125,956173,956316,956715,957465,957520,957634,957707,960367,960374,960719,961821,961941,
962555,962714,963372,963654,963720,963781,963873,963888,963906,963909,963920,964019,964054,964267,964312,964430,964459,964720,964753,964832,964856,965103,965222,965230,965327,965330,965585,965938,966354,966878,967080,979049,979453,979807,979809,980369,980428,980436,980501,980555,980592,980909,980911,980917,981265,981550,981598,981650,981661,981690,981857,981936,982073,982084,982201,982725,982824,983100,983212,983216,983313,983495,983500,983530,983632,983778,984187,984202,984232,984510,984968,985453,985455,985672,985875,986158,986612,986773,987005,987009,987122,988087,988206,988216,988259,988346,988478,988527,988543,988592,988613,988688,988710,988736,988739,989004,989010,989013,989030,989035,989315,989321,989334,990160-990161,990180,990189,990281,990301,990451,990459,990766,990781,990854,991053,991191,991497,992424,992469,992567,992571,992623,992913,993106,993194,993199,993287,993408,994935,994976,994979,995247,995250,995253,995264,995286,995376,995557,995772,996268,996357,99
6416,996511,996611,996623,996647-996653,996720,996942,996978,997180,997230,998055,998505,998684,999016,999223,999545,999842,1000000,1000424,1000581,1000675,1001006,1001318,1001320,1001420,1001661,1001957,1002032,1003107,1003614,1003631,1003645,1003703,1003841-1003852,1003873
+/lucene/dev/trunk/solr/src/solrj/org:931298,931337,931502,932129-932131,932163,932304,932369,932374,932398,932417,932541,932576,932587,932698,932731-932749,932752,932773,932795,932828,932856-932857,932862,932864,932878,932963,932998-932999,933541-933575,933598,933613,933679,933879,934339,934954,935014-935048,935065,935186-935513,935521-935522,935553-935962,936522,936544,936605,936657-936726,937039,937360,938582-938646,938989,939111,939611,939649,940433,940447,940451-940452,940556,940666,940699,940730,940878-940892,940994,941270,941363,942166,942235,942288,942676,942719,943142,943493,943931,944516,944528,945057,945090,945130,945245,945343,945420,946139,946330,946338,946599,948011,948082,948429,949288,949311,949445,949976,949997,950008,950042,950125,950207,950458,950613,950723,950835,951126,951355,951397,951521,953628,953886,954336,955547,955613,955615,955796-955797,955809-955996,956097,956125,956173,956316,956715,957465,957520,957634,957707,960367,960374,960719,961821,961941,
962555,962714,963372,963654,963720,963781,963873,963888,963906,963909,963920,964019,964054,964267,964312,964430,964459,964720,964753,964832,964856,965103,965222,965230,965327,965330,965585,965938,966354,966878,967080,979049,979453,979807,979809,980369,980428,980436,980501,980555,980592,980909,980911,980917,981265,981550,981598,981650,981661,981690,981857,981936,982073,982084,982201,982725,982824,983100,983212,983216,983313,983495,983500,983530,983632,983778,984187,984202,984232,984510,984968,985453,985455,985672,985875,986158,986612,986773,987005,987009,987122,988087,988206,988216,988259,988346,988478,988527,988543,988592,988613,988688,988710,988736,988739,989004,989010,989013,989030,989035,989315,989321,989334,990160-990161,990180,990189,990281,990301,990451,990459,990766,990781,990854,991053,991191,991497,992424,992469,992567,992571,992623,992913,993106,993194,993199,993287,993408,994935,994976,994979,995247,995250,995253,995264,995286,995376,995557,995772,996268,996357,99
6416,996511,996611,996623,996647-996653,996720,996942,996978,997180,997230,998055,998505,998684,999016,999223,999545,999842,1000000,1000424,1000581,1000675,1001006,1001318,1001320,1001420,1001661,1001957,1002032,1003107,1003614,1003631,1003645,1003703,1003841-1003852,1003873,1003877
/lucene/solr/trunk/src/solrj/org:922950-923910,923912-925091
Propchange: lucene/dev/branches/branch_3x/solr/src/test/org/apache/solr/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat Oct 2 21:02:57 2010
@@ -1,4 +1,4 @@
-/lucene/dev/trunk/solr/src/test/org/apache/solr:931298,931337,931502,932129-932131,932163,932304,932369,932374,932398,932417,932541,932576,932587,932698,932731-932749,932752,932773,932795,932828,932856-932857,932862,932864,932878,932963,932998-932999,933541-933575,933598,933613,933679,933879,934339,934954,935014-935048,935065,935186-935513,935521-935522,935553-935962,936522,936544,936605,936657-936726,937039,937360,938582-938646,938989,939111,939611,939649,940433,940447,940451-940452,940556,940666,940699,940730,940878-940892,940994,941270,941363,942166,942235,942288,942676,942719,943142,943493,943931,944516,944528,945057,945090,945130,945245,945343,945420,946139,946330,946338,946599,948011,948082,948429,949288,949311,949445,949976,949997,950008,950042,950125,950207,950458,950613,950723,950835,951126,951355,951397,951521,953628,953886,954336,955547,955613,955615,955796-955797,955809-955996,956097,956125,956173,956316,956715,957465,957520,957634,957707,960367,960374,961821,961
941,962555,962714,963372,963654,963720,963781,963873,963888,963906,963909,963920,964019,964054,964267,964312,964430,964459,964720,964753,964832,964856,965103,965222,965230,965327,965330,965585,965938,966354,966878,967080,979049,979453,979807,979809,980369,980428,980436,980501,980555,980592,980909,980911,980917,981265,981550,981598,981650,981661,981690,981857,981936,982073,982084,982201,982725,982824,983100,983212,983216,983313,983495,983500,983530,983632,983778,984187,984202,984232,984510,984968,985453,985455,985672,985875,986158,986612,986773,987005,987009,987122,988087,988206,988216,988259,988346,988478,988527,988543,988592,988613,988688,988710,988736,988739,989004,989010,989013,989030,989035,989315,989321,989334,990160-990161,990180,990189,990281,990301,990451,990459,990766,990781,990854,991053,991191,991497,992424,992469,992567,992571,992623,992913,993106,993194,993199,993287,993408,994935,994976,994979,995247,995250,995253,995264,995286,995376,995557,995772,996268,99635
7,996416,996511,996611,996623,996647-996653,996720,996942,996978,997180,997230,998055,998505,998684,998707,999016,999223,999545,999842,1000000,1000424,1000581,1000675,1001006,1001420,1001661,1001957,1002032,1003614,1003631,1003645,1003703,1003841-1003852,1003873
+/lucene/dev/trunk/solr/src/test/org/apache/solr:931298,931337,931502,932129-932131,932163,932304,932369,932374,932398,932417,932541,932576,932587,932698,932731-932749,932752,932773,932795,932828,932856-932857,932862,932864,932878,932963,932998-932999,933541-933575,933598,933613,933679,933879,934339,934954,935014-935048,935065,935186-935513,935521-935522,935553-935962,936522,936544,936605,936657-936726,937039,937360,938582-938646,938989,939111,939611,939649,940433,940447,940451-940452,940556,940666,940699,940730,940878-940892,940994,941270,941363,942166,942235,942288,942676,942719,943142,943493,943931,944516,944528,945057,945090,945130,945245,945343,945420,946139,946330,946338,946599,948011,948082,948429,949288,949311,949445,949976,949997,950008,950042,950125,950207,950458,950613,950723,950835,951126,951355,951397,951521,953628,953886,954336,955547,955613,955615,955796-955797,955809-955996,956097,956125,956173,956316,956715,957465,957520,957634,957707,960367,960374,961821,961
941,962555,962714,963372,963654,963720,963781,963873,963888,963906,963909,963920,964019,964054,964267,964312,964430,964459,964720,964753,964832,964856,965103,965222,965230,965327,965330,965585,965938,966354,966878,967080,979049,979453,979807,979809,980369,980428,980436,980501,980555,980592,980909,980911,980917,981265,981550,981598,981650,981661,981690,981857,981936,982073,982084,982201,982725,982824,983100,983212,983216,983313,983495,983500,983530,983632,983778,984187,984202,984232,984510,984968,985453,985455,985672,985875,986158,986612,986773,987005,987009,987122,988087,988206,988216,988259,988346,988478,988527,988543,988592,988613,988688,988710,988736,988739,989004,989010,989013,989030,989035,989315,989321,989334,990160-990161,990180,990189,990281,990301,990451,990459,990766,990781,990854,991053,991191,991497,992424,992469,992567,992571,992623,992913,993106,993194,993199,993287,993408,994935,994976,994979,995247,995250,995253,995264,995286,995376,995557,995772,996268,99635
7,996416,996511,996611,996623,996647-996653,996720,996942,996978,997180,997230,998055,998505,998684,998707,999016,999223,999545,999842,1000000,1000424,1000581,1000675,1001006,1001420,1001661,1001957,1002032,1003614,1003631,1003645,1003703,1003841-1003852,1003873,1003877
/lucene/java/branches/lucene_2_4/solr/src/test/org/apache/solr:748824
/lucene/java/branches/lucene_2_9/solr/src/test/org/apache/solr:817269-818600,825998,829134,829881,831036,896850,909334
/lucene/java/branches/lucene_2_9_back_compat_tests/solr/src/test/org/apache/solr:818601-821336
Modified: lucene/dev/branches/branch_3x/solr/src/test/org/apache/solr/JSONTestUtil.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/solr/src/test/org/apache/solr/JSONTestUtil.java?rev=1003885&r1=1003884&r2=1003885&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/solr/src/test/org/apache/solr/JSONTestUtil.java (original)
+++ lucene/dev/branches/branch_3x/solr/src/test/org/apache/solr/JSONTestUtil.java Sat Oct 2 21:02:57 2010
@@ -1,330 +1,330 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.solr;
-
-import org.apache.noggit.JSONParser;
-import org.apache.noggit.ObjectBuilder;
-import org.apache.solr.common.util.StrUtils;
-
-import java.io.StringReader;
-import java.util.*;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-
-public class JSONTestUtil {
-
- public static String match(String input, String pathAndExpected) throws Exception {
- int pos = pathAndExpected.indexOf("==");
- String path = pos>=0 ? pathAndExpected.substring(0,pos) : null;
- String expected = pos>=0 ? pathAndExpected.substring(pos+2) : pathAndExpected;
- return match(path, input, expected);
- }
-
- public static String match(String path, String input, String expected) throws Exception {
- Object inputObj = ObjectBuilder.fromJSON(input);
- Object expectObj = ObjectBuilder.fromJSON(expected);
- return matchObj(path, inputObj, expectObj);
- }
-
- /**
- public static Object fromJSON(String json) {
- try {
- Object out = ObjectBuilder.fromJSON(json);
- } finally {
-
- }
- **/
-
- public static String matchObj(String path, Object input, Object expected) throws Exception {
- CollectionTester tester = new CollectionTester(input);
- if (!tester.seek(path)) {
- return "Path not found: " + path;
- }
- if (expected != null && !tester.match(expected)) {
- return tester.err + " @ " + tester.getPath();
- }
- return null;
- }
-}
-
-
-/** Tests simple object graphs, like those generated by the noggit JSON parser */
-class CollectionTester {
- public Object valRoot;
- public Object val;
- public Object expectedRoot;
- public Object expected;
- public List<Object> path;
- public String err;
-
- public CollectionTester(Object val) {
- this.val = val;
- this.valRoot = val;
- path = new ArrayList<Object>();
- }
-
- public String getPath() {
- StringBuilder sb = new StringBuilder();
- boolean first=true;
- for (Object seg : path) {
- if (seg==null) break;
- if (!first) sb.append('/');
- else first=false;
-
- if (seg instanceof Integer) {
- sb.append('[');
- sb.append(seg);
- sb.append(']');
- } else {
- sb.append(seg.toString());
- }
- }
- return sb.toString();
- }
-
- void setPath(Object lastSeg) {
- path.set(path.size()-1, lastSeg);
- }
- Object popPath() {
- return path.remove(path.size()-1);
- }
- void pushPath(Object lastSeg) {
- path.add(lastSeg);
- }
-
- void setErr(String msg) {
- err = msg;
- }
-
- public boolean match(Object expected) {
- this.expectedRoot = expected;
- this.expected = expected;
- return match();
- }
-
- boolean match() {
- if (expected == null && val == null) {
- return true;
- }
- if (expected instanceof List) {
- return matchList();
- }
- if (expected instanceof Map) {
- return matchMap();
- }
-
- // generic fallback
- if (!expected.equals(val)) {
- setErr("mismatch: '" + expected + "'!='" + val + "'");
- return false;
- }
-
- // setErr("unknown expected type " + expected.getClass().getName());
- return true;
- }
-
- boolean matchList() {
- List expectedList = (List)expected;
- List v = asList();
- if (v == null) return false;
- int a = 0;
- int b = 0;
- pushPath(null);
- for (;;) {
- if (a >= expectedList.size() && b >=v.size()) {
- break;
- }
-
- if (a >= expectedList.size() || b >=v.size()) {
- popPath();
- setErr("List size mismatch");
- return false;
- }
-
- expected = expectedList.get(a);
- val = v.get(b);
- setPath(b);
- if (!match()) return false;
-
- a++; b++;
- }
-
- popPath();
- return true;
- }
-
- private static Set<String> reserved = new HashSet<String>(Arrays.asList("_SKIP_","_MATCH_","_ORDERED_","_UNORDERED_"));
-
- boolean matchMap() {
- Map<String,Object> expectedMap = (Map<String,Object>)expected;
- Map<String,Object> v = asMap();
- if (v == null) return false;
-
- boolean ordered = false;
- String skipList = (String)expectedMap.get("_SKIP_");
- String matchList = (String)expectedMap.get("_MATCH_");
- Object orderedStr = expectedMap.get("_ORDERED_");
- Object unorderedStr = expectedMap.get("_UNORDERED_");
-
- if (orderedStr != null) ordered = true;
- if (unorderedStr != null) ordered = false;
-
- Set<String> match = null;
- if (matchList != null) {
- match = new HashSet(StrUtils.splitSmart(matchList,",",false));
- }
-
- Set<String> skips = null;
- if (skipList != null) {
- skips = new HashSet(StrUtils.splitSmart(skipList,",",false));
- }
-
- Set<String> keys = match != null ? match : expectedMap.keySet();
- Set<String> visited = new HashSet<String>();
-
- Iterator<Map.Entry<String,Object>> iter = ordered ? v.entrySet().iterator() : null;
-
- int numExpected=0;
-
- pushPath(null);
- for (String expectedKey : keys) {
- if (reserved.contains(expectedKey)) continue;
- numExpected++;
-
- setPath(expectedKey);
- if (!v.containsKey(expectedKey)) {
- popPath();
- setErr("expected key '" + expectedKey + "'");
- return false;
- }
-
- expected = expectedMap.get(expectedKey);
-
- if (ordered) {
- Map.Entry<String,Object> entry;
- String foundKey;
- for(;;) {
- if (!iter.hasNext()) {
- popPath();
- setErr("expected key '" + expectedKey + "' in ordered map");
- return false;
- }
- entry = iter.next();
- foundKey = entry.getKey();
- if (skips != null && skips.contains(foundKey))continue;
- if (match != null && !match.contains(foundKey)) continue;
- break;
- }
-
- if (!entry.getKey().equals(expectedKey)) {
- popPath();
- setErr("expected key '" + expectedKey + "' instead of '"+entry.getKey()+"' in ordered map");
- return false;
- }
- val = entry.getValue();
- } else {
- if (skips != null && skips.contains(expectedKey)) continue;
- val = v.get(expectedKey);
- }
-
- if (!match()) return false;
- }
-
- popPath();
-
- // now check if there were any extra keys in the value (as long as there wasn't a specific list to include)
- if (match == null) {
- int skipped = 0;
- if (skips != null) {
- for (String skipStr : skips)
- if (v.containsKey(skipStr)) skipped++;
- }
- if (numExpected != (v.size() - skipped)) {
- HashSet<String> set = new HashSet<String>(v.keySet());
- set.removeAll(expectedMap.keySet());
- setErr("unexpected map keys " + set);
- return false;
- }
- }
-
- return true;
- }
-
- public boolean seek(String seekPath) {
- if (path == null) return true;
- if (seekPath.startsWith("/")) {
- seekPath = seekPath.substring(1);
- }
- if (seekPath.endsWith("/")) {
- seekPath = seekPath.substring(0,seekPath.length()-1);
- }
- List<String> pathList = StrUtils.splitSmart(seekPath, "/", false);
- return seek(pathList);
- }
-
- List asList() {
- // TODO: handle native arrays
- if (val instanceof List) {
- return (List)val;
- }
- setErr("expected List");
- return null;
- }
-
- Map<String,Object> asMap() {
- // TODO: handle NamedList
- if (val instanceof Map) {
- return (Map<String,Object>)val;
- }
- setErr("expected Map");
- return null;
- }
-
- public boolean seek(List<String> seekPath) {
- if (seekPath.size() == 0) return true;
- String seg = seekPath.get(0);
-
- if (seg.charAt(0)=='[') {
- List listVal = asList();
- if (listVal==null) return false;
-
- int arrIdx = Integer.parseInt(seg.substring(1, seg.length()-1));
-
- if (arrIdx >= listVal.size()) return false;
-
- val = listVal.get(arrIdx);
- pushPath(arrIdx);
- } else {
- Map<String,Object> mapVal = asMap();
- if (mapVal==null) return false;
-
- // use containsKey rather than get to handle null values
- if (!mapVal.containsKey(seg)) return false;
-
- val = mapVal.get(seg);
- pushPath(seg);
- }
-
- // recurse after removing head of the path
- return seek(seekPath.subList(1,seekPath.size()));
- }
-
-
-
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.solr;
+
+import org.apache.noggit.JSONParser;
+import org.apache.noggit.ObjectBuilder;
+import org.apache.solr.common.util.StrUtils;
+
+import java.io.StringReader;
+import java.util.*;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+
+public class JSONTestUtil {
+
+ public static String match(String input, String pathAndExpected) throws Exception {
+ int pos = pathAndExpected.indexOf("==");
+ String path = pos>=0 ? pathAndExpected.substring(0,pos) : null;
+ String expected = pos>=0 ? pathAndExpected.substring(pos+2) : pathAndExpected;
+ return match(path, input, expected);
+ }
+
+ public static String match(String path, String input, String expected) throws Exception {
+ Object inputObj = ObjectBuilder.fromJSON(input);
+ Object expectObj = ObjectBuilder.fromJSON(expected);
+ return matchObj(path, inputObj, expectObj);
+ }
+
+ /**
+ public static Object fromJSON(String json) {
+ try {
+ Object out = ObjectBuilder.fromJSON(json);
+ } finally {
+
+ }
+ **/
+
+ public static String matchObj(String path, Object input, Object expected) throws Exception {
+ CollectionTester tester = new CollectionTester(input);
+ if (!tester.seek(path)) {
+ return "Path not found: " + path;
+ }
+ if (expected != null && !tester.match(expected)) {
+ return tester.err + " @ " + tester.getPath();
+ }
+ return null;
+ }
+}
+
+
+/** Tests simple object graphs, like those generated by the noggit JSON parser */
+class CollectionTester {
+ public Object valRoot;
+ public Object val;
+ public Object expectedRoot;
+ public Object expected;
+ public List<Object> path;
+ public String err;
+
+ public CollectionTester(Object val) {
+ this.val = val;
+ this.valRoot = val;
+ path = new ArrayList<Object>();
+ }
+
+ public String getPath() {
+ StringBuilder sb = new StringBuilder();
+ boolean first=true;
+ for (Object seg : path) {
+ if (seg==null) break;
+ if (!first) sb.append('/');
+ else first=false;
+
+ if (seg instanceof Integer) {
+ sb.append('[');
+ sb.append(seg);
+ sb.append(']');
+ } else {
+ sb.append(seg.toString());
+ }
+ }
+ return sb.toString();
+ }
+
+ void setPath(Object lastSeg) {
+ path.set(path.size()-1, lastSeg);
+ }
+ Object popPath() {
+ return path.remove(path.size()-1);
+ }
+ void pushPath(Object lastSeg) {
+ path.add(lastSeg);
+ }
+
+ void setErr(String msg) {
+ err = msg;
+ }
+
+ public boolean match(Object expected) {
+ this.expectedRoot = expected;
+ this.expected = expected;
+ return match();
+ }
+
+ boolean match() {
+ if (expected == null && val == null) {
+ return true;
+ }
+ if (expected instanceof List) {
+ return matchList();
+ }
+ if (expected instanceof Map) {
+ return matchMap();
+ }
+
+ // generic fallback
+ if (!expected.equals(val)) {
+ setErr("mismatch: '" + expected + "'!='" + val + "'");
+ return false;
+ }
+
+ // setErr("unknown expected type " + expected.getClass().getName());
+ return true;
+ }
+
+ boolean matchList() {
+ List expectedList = (List)expected;
+ List v = asList();
+ if (v == null) return false;
+ int a = 0;
+ int b = 0;
+ pushPath(null);
+ for (;;) {
+ if (a >= expectedList.size() && b >=v.size()) {
+ break;
+ }
+
+ if (a >= expectedList.size() || b >=v.size()) {
+ popPath();
+ setErr("List size mismatch");
+ return false;
+ }
+
+ expected = expectedList.get(a);
+ val = v.get(b);
+ setPath(b);
+ if (!match()) return false;
+
+ a++; b++;
+ }
+
+ popPath();
+ return true;
+ }
+
+ private static Set<String> reserved = new HashSet<String>(Arrays.asList("_SKIP_","_MATCH_","_ORDERED_","_UNORDERED_"));
+
+ boolean matchMap() {
+ Map<String,Object> expectedMap = (Map<String,Object>)expected;
+ Map<String,Object> v = asMap();
+ if (v == null) return false;
+
+ boolean ordered = false;
+ String skipList = (String)expectedMap.get("_SKIP_");
+ String matchList = (String)expectedMap.get("_MATCH_");
+ Object orderedStr = expectedMap.get("_ORDERED_");
+ Object unorderedStr = expectedMap.get("_UNORDERED_");
+
+ if (orderedStr != null) ordered = true;
+ if (unorderedStr != null) ordered = false;
+
+ Set<String> match = null;
+ if (matchList != null) {
+ match = new HashSet(StrUtils.splitSmart(matchList,",",false));
+ }
+
+ Set<String> skips = null;
+ if (skipList != null) {
+ skips = new HashSet(StrUtils.splitSmart(skipList,",",false));
+ }
+
+ Set<String> keys = match != null ? match : expectedMap.keySet();
+ Set<String> visited = new HashSet<String>();
+
+ Iterator<Map.Entry<String,Object>> iter = ordered ? v.entrySet().iterator() : null;
+
+ int numExpected=0;
+
+ pushPath(null);
+ for (String expectedKey : keys) {
+ if (reserved.contains(expectedKey)) continue;
+ numExpected++;
+
+ setPath(expectedKey);
+ if (!v.containsKey(expectedKey)) {
+ popPath();
+ setErr("expected key '" + expectedKey + "'");
+ return false;
+ }
+
+ expected = expectedMap.get(expectedKey);
+
+ if (ordered) {
+ Map.Entry<String,Object> entry;
+ String foundKey;
+ for(;;) {
+ if (!iter.hasNext()) {
+ popPath();
+ setErr("expected key '" + expectedKey + "' in ordered map");
+ return false;
+ }
+ entry = iter.next();
+ foundKey = entry.getKey();
+ if (skips != null && skips.contains(foundKey))continue;
+ if (match != null && !match.contains(foundKey)) continue;
+ break;
+ }
+
+ if (!entry.getKey().equals(expectedKey)) {
+ popPath();
+ setErr("expected key '" + expectedKey + "' instead of '"+entry.getKey()+"' in ordered map");
+ return false;
+ }
+ val = entry.getValue();
+ } else {
+ if (skips != null && skips.contains(expectedKey)) continue;
+ val = v.get(expectedKey);
+ }
+
+ if (!match()) return false;
+ }
+
+ popPath();
+
+ // now check if there were any extra keys in the value (as long as there wasn't a specific list to include)
+ if (match == null) {
+ int skipped = 0;
+ if (skips != null) {
+ for (String skipStr : skips)
+ if (v.containsKey(skipStr)) skipped++;
+ }
+ if (numExpected != (v.size() - skipped)) {
+ HashSet<String> set = new HashSet<String>(v.keySet());
+ set.removeAll(expectedMap.keySet());
+ setErr("unexpected map keys " + set);
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ public boolean seek(String seekPath) {
+ if (path == null) return true;
+ if (seekPath.startsWith("/")) {
+ seekPath = seekPath.substring(1);
+ }
+ if (seekPath.endsWith("/")) {
+ seekPath = seekPath.substring(0,seekPath.length()-1);
+ }
+ List<String> pathList = StrUtils.splitSmart(seekPath, "/", false);
+ return seek(pathList);
+ }
+
+ List asList() {
+ // TODO: handle native arrays
+ if (val instanceof List) {
+ return (List)val;
+ }
+ setErr("expected List");
+ return null;
+ }
+
+ Map<String,Object> asMap() {
+ // TODO: handle NamedList
+ if (val instanceof Map) {
+ return (Map<String,Object>)val;
+ }
+ setErr("expected Map");
+ return null;
+ }
+
+ public boolean seek(List<String> seekPath) {
+ if (seekPath.size() == 0) return true;
+ String seg = seekPath.get(0);
+
+ if (seg.charAt(0)=='[') {
+ List listVal = asList();
+ if (listVal==null) return false;
+
+ int arrIdx = Integer.parseInt(seg.substring(1, seg.length()-1));
+
+ if (arrIdx >= listVal.size()) return false;
+
+ val = listVal.get(arrIdx);
+ pushPath(arrIdx);
+ } else {
+ Map<String,Object> mapVal = asMap();
+ if (mapVal==null) return false;
+
+ // use containsKey rather than get to handle null values
+ if (!mapVal.containsKey(seg)) return false;
+
+ val = mapVal.get(seg);
+ pushPath(seg);
+ }
+
+ // recurse after removing head of the path
+ return seek(seekPath.subList(1,seekPath.size()));
+ }
+
+
+
+}
Propchange: lucene/dev/branches/branch_3x/solr/src/test/org/apache/solr/JSONTestUtil.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: lucene/dev/branches/branch_3x/solr/src/test/org/apache/solr/analysis/TestPatternTokenizerFactory.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat Oct 2 21:02:57 2010
@@ -1,5 +1,5 @@
/lucene/dev/trunk/modules/analysis/common/src/test/org/apache/lucene/analysis/pattern/TestPatternTokenizer.java:1003873
-/lucene/dev/trunk/solr/src/test/org/apache/solr/analysis/TestPatternTokenizerFactory.java:931298,931337,931502,932129-932131,932163,932304,932369,932374,932398,932417,932541,932576,932587,932698,932731-932749,932752,932773,932795,932828,932856-932857,932862,932864,932878,932963,932998-932999,933541-933575,933598,933613,933679,933879,934339,934954,935014-935048,935065,935186-935513,935521-935522,935553-935962,936522,936544,936605,936657-936726,937039,937360,938582-938646,938989,939111,939611,939649,940433,940447,940451-940452,940556,940666,940699,940730,940878-940892,940994,941270,941363,942166,942235,942288,942676,942719,943142,943493,943931,944516,944528,945057,945090,945130,945245,945343,945420,946139,946330,946338,946599,948011,948082,948429,949288,949311,949445,949976,949997,950008,950042,950125,950207,950458,950613,950723,950835,951126,951355,951397,951521,953628,953886,954336,955547,955613,955615,955796-955797,955809-955996,956097,956125,956173,956316,956715,957465,957
520,957634,957707,960367,960374,961821,961941,962555,962714,963372,963654,963720,963781,963873,963888,963906,963909,963920,964019,964054,964267,964312,964430,964459,964720,964753,964832,964856,965103,965222,965230,965327,965330,965585,965938,966354,966878,967080,979049,979453,979807,979809,980369,980428,980436,980501,980555,980592,980909,980911,980917,981265,981550,981598,981650,981661,981690,981857,981936,982073,982084,982201,982725,982824,983100,983212,983216,983313,983495,983500,983530,983632,983778,984187,984202,984232,984510,984968,985453,985455,985672,985875,986158,986612,986773,987005,987009,987122,988087,988206,988216,988259,988346,988478,988527,988543,988592,988613,988688,988710,988736,988739,989004,989010,989013,989030,989035,989315,989321,989334,990160-990161,990180,990189,990281,990301,990451,990459,990766,990781,990854,991053,991191,991497,992424,992469,992567,992571,992623,992913,993106,993194,993199,993287,993408,994935,994976,994979,995247,995250,995253,99526
4,995286,995376,995557,995772,996268,996357,996416,996511,996611,996623,996647-996653,996720,996942,996978,997180,997230,998055,998505,998684,998707,999016,999223,999545,999842,1000000,1000424,1000581,1000675,1001006,1001420,1001661,1001957,1002032,1003614,1003631,1003645,1003703,1003841-1003852,1003873
+/lucene/dev/trunk/solr/src/test/org/apache/solr/analysis/TestPatternTokenizerFactory.java:931298,931337,931502,932129-932131,932163,932304,932369,932374,932398,932417,932541,932576,932587,932698,932731-932749,932752,932773,932795,932828,932856-932857,932862,932864,932878,932963,932998-932999,933541-933575,933598,933613,933679,933879,934339,934954,935014-935048,935065,935186-935513,935521-935522,935553-935962,936522,936544,936605,936657-936726,937039,937360,938582-938646,938989,939111,939611,939649,940433,940447,940451-940452,940556,940666,940699,940730,940878-940892,940994,941270,941363,942166,942235,942288,942676,942719,943142,943493,943931,944516,944528,945057,945090,945130,945245,945343,945420,946139,946330,946338,946599,948011,948082,948429,949288,949311,949445,949976,949997,950008,950042,950125,950207,950458,950613,950723,950835,951126,951355,951397,951521,953628,953886,954336,955547,955613,955615,955796-955797,955809-955996,956097,956125,956173,956316,956715,957465,957
520,957634,957707,960367,960374,961821,961941,962555,962714,963372,963654,963720,963781,963873,963888,963906,963909,963920,964019,964054,964267,964312,964430,964459,964720,964753,964832,964856,965103,965222,965230,965327,965330,965585,965938,966354,966878,967080,979049,979453,979807,979809,980369,980428,980436,980501,980555,980592,980909,980911,980917,981265,981550,981598,981650,981661,981690,981857,981936,982073,982084,982201,982725,982824,983100,983212,983216,983313,983495,983500,983530,983632,983778,984187,984202,984232,984510,984968,985453,985455,985672,985875,986158,986612,986773,987005,987009,987122,988087,988206,988216,988259,988346,988478,988527,988543,988592,988613,988688,988710,988736,988739,989004,989010,989013,989030,989035,989315,989321,989334,990160-990161,990180,990189,990281,990301,990451,990459,990766,990781,990854,991053,991191,991497,992424,992469,992567,992571,992623,992913,993106,993194,993199,993287,993408,994935,994976,994979,995247,995250,995253,99526
4,995286,995376,995557,995772,996268,996357,996416,996511,996611,996623,996647-996653,996720,996942,996978,997180,997230,998055,998505,998684,998707,999016,999223,999545,999842,1000000,1000424,1000581,1000675,1001006,1001420,1001661,1001957,1002032,1003614,1003631,1003645,1003703,1003841-1003852,1003873,1003877
/lucene/java/branches/lucene_2_4/solr/src/test/org/apache/solr/analysis/TestPatternTokenizerFactory.java:748824
/lucene/java/branches/lucene_2_9/solr/src/test/org/apache/solr/analysis/TestPatternTokenizerFactory.java:817269-818600,825998,829134,829881,831036,896850,909334
/lucene/java/branches/lucene_2_9_back_compat_tests/solr/src/test/org/apache/solr/analysis/TestPatternTokenizerFactory.java:818601-821336
Propchange: lucene/dev/branches/branch_3x/solr/src/test/org/apache/solr/analysis/TestRemoveDuplicatesTokenFilter.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat Oct 2 21:02:57 2010
@@ -1,5 +1,5 @@
/lucene/dev/trunk/modules/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestRemoveDuplicatesTokenFilter.java:950008
-/lucene/dev/trunk/solr/src/test/org/apache/solr/analysis/TestRemoveDuplicatesTokenFilter.java:931298,931337,931502,932129-932131,932163,932304,932369,932374,932398,932417,932541,932576,932587,932698,932731-932749,932752,932773,932795,932828,932856-932857,932862,932864,932878,932963,932998-932999,933541-933575,933598,933613,933679,933879,934339,934954,935014-935048,935065,935186-935513,935521-935522,935553-935962,936522,936544,936605,936657-936726,937039,937360,938582-938646,938989,939111,939611,939649,940433,940447,940451-940452,940556,940666,940699,940730,940878-940892,940994,941270,941363,942166,942235,942288,942676,942719,943142,943493,943931,944516,944528,945057,945090,945130,945245,945343,945420,946139,946330,946338,946599,948011,948082,948429,949288,949311,949445,949976,949997,950008,950042,950125,950207,950458,950613,950723,950835,951126,951355,951397,951521,953628,953886,954336,955547,955613,955615,955796-955797,955809-955996,956097,956125,956173,956316,956715,957465
,957520,957634,957707,960367,960374,960719,961821,961941,962555,962714,963372,963654,963720,963781,963873,963888,963906,963909,963920,964019,964054,964267,964312,964430,964459,964720,964753,964832,964856,965103,965222,965230,965327,965330,965585,965938,966354,966878,967080,979049,979453,979807,979809,980369,980428,980436,980501,980555,980592,980909,980911,980917,981265,981550,981598,981650,981661,981690,981857,981936,982073,982084,982201,982725,982824,983100,983212,983216,983313,983495,983500,983530,983632,983778,984187,984202,984232,984510,984968,985453,985455,985672,985875,986158,986612,986773,987005,987009,987122,988087,988206,988216,988259,988346,988478,988527,988543,988592,988613,988688,988710,988736,988739,989004,989010,989013,989030,989035,989315,989321,989334,990160-990161,990180,990189,990281,990301,990451,990459,990766,990781,990854,991053,991191,991497,992424,992469,992567,992571,992623,992913,993106,993194,993199,993287,993408,994935,994976,994979,995247,995250,9
95253,995264,995286,995376,995557,995772,996268,996357,996416,996511,996611,996623,996647-996653,996720,996942,996978,997180,997230,998055,998505,998684,998707,999016,999223,999545,999842,1000000,1000424,1000581,1000675,1001006,1001318,1001320,1001420,1001661,1001957,1003107,1003614,1003631,1003645,1003703,1003841-1003852,1003873
+/lucene/dev/trunk/solr/src/test/org/apache/solr/analysis/TestRemoveDuplicatesTokenFilter.java:931298,931337,931502,932129-932131,932163,932304,932369,932374,932398,932417,932541,932576,932587,932698,932731-932749,932752,932773,932795,932828,932856-932857,932862,932864,932878,932963,932998-932999,933541-933575,933598,933613,933679,933879,934339,934954,935014-935048,935065,935186-935513,935521-935522,935553-935962,936522,936544,936605,936657-936726,937039,937360,938582-938646,938989,939111,939611,939649,940433,940447,940451-940452,940556,940666,940699,940730,940878-940892,940994,941270,941363,942166,942235,942288,942676,942719,943142,943493,943931,944516,944528,945057,945090,945130,945245,945343,945420,946139,946330,946338,946599,948011,948082,948429,949288,949311,949445,949976,949997,950008,950042,950125,950207,950458,950613,950723,950835,951126,951355,951397,951521,953628,953886,954336,955547,955613,955615,955796-955797,955809-955996,956097,956125,956173,956316,956715,957465
,957520,957634,957707,960367,960374,960719,961821,961941,962555,962714,963372,963654,963720,963781,963873,963888,963906,963909,963920,964019,964054,964267,964312,964430,964459,964720,964753,964832,964856,965103,965222,965230,965327,965330,965585,965938,966354,966878,967080,979049,979453,979807,979809,980369,980428,980436,980501,980555,980592,980909,980911,980917,981265,981550,981598,981650,981661,981690,981857,981936,982073,982084,982201,982725,982824,983100,983212,983216,983313,983495,983500,983530,983632,983778,984187,984202,984232,984510,984968,985453,985455,985672,985875,986158,986612,986773,987005,987009,987122,988087,988206,988216,988259,988346,988478,988527,988543,988592,988613,988688,988710,988736,988739,989004,989010,989013,989030,989035,989315,989321,989334,990160-990161,990180,990189,990281,990301,990451,990459,990766,990781,990854,991053,991191,991497,992424,992469,992567,992571,992623,992913,993106,993194,993199,993287,993408,994935,994976,994979,995247,995250,9
95253,995264,995286,995376,995557,995772,996268,996357,996416,996511,996611,996623,996647-996653,996720,996942,996978,997180,997230,998055,998505,998684,998707,999016,999223,999545,999842,1000000,1000424,1000581,1000675,1001006,1001318,1001320,1001420,1001661,1001957,1003107,1003614,1003631,1003645,1003703,1003841-1003852,1003873,1003877
/lucene/java/branches/lucene_2_4/solr/src/test/org/apache/solr/analysis/TestRemoveDuplicatesTokenFilter.java:748824
/lucene/java/branches/lucene_2_9/solr/src/test/org/apache/solr/analysis/TestRemoveDuplicatesTokenFilter.java:817269-818600,825998,829134,829881,831036,896850,909334
/lucene/java/branches/lucene_2_9_back_compat_tests/solr/src/test/org/apache/solr/analysis/TestRemoveDuplicatesTokenFilter.java:818601-821336
Propchange: lucene/dev/branches/branch_3x/solr/src/test/org/apache/solr/analysis/TestSynonymFilter.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat Oct 2 21:02:57 2010
@@ -1,5 +1,5 @@
/lucene/dev/trunk/modules/analysis/common/src/test/org/apache/lucene/analysis/synonym/TestSynonymFilter.java:1003873
-/lucene/dev/trunk/solr/src/test/org/apache/solr/analysis/TestSynonymFilter.java:931298,931337,931502,932129-932131,932163,932304,932369,932374,932398,932417,932541,932576,932587,932698,932731-932749,932752,932773,932795,932828,932856-932857,932862,932864,932878,932963,932998-932999,933541-933575,933598,933613,933679,933879,934339,934954,935014-935048,935065,935186-935513,935521-935522,935553-935962,936522,936544,936605,936657-936726,937039,937360,938582-938646,938989,939111,939611,939649,940433,940447,940451-940452,940556,940666,940699,940730,940878-940892,940994,941270,941363,942166,942235,942288,942676,942719,943142,943493,943931,944516,944528,945057,945090,945130,945245,945343,945420,946139,946330,946338,946599,948011,948082,948429,949288,949311,949445,949976,949997,950008,950042,950125,950207,950458,950613,950723,950835,951126,951355,951397,951521,953628,953886,954336,955547,955613,955615,955796-955797,955809-955996,956097,956125,956173,956316,956715,957465,957520,957634
,957707,960367,960374,961821,961941,962555,962714,963372,963654,963720,963781,963873,963888,963906,963909,963920,964019,964054,964267,964312,964430,964459,964720,964753,964832,964856,965103,965222,965230,965327,965330,965585,965938,966354,966878,967080,979049,979453,979807,979809,980369,980428,980436,980501,980555,980592,980909,980911,980917,981265,981550,981598,981650,981661,981690,981857,981936,982073,982084,982201,982725,982824,983100,983212,983216,983313,983495,983500,983530,983632,983778,984187,984202,984232,984510,984968,985453,985455,985672,985875,986158,986612,986773,987005,987009,987122,988087,988206,988216,988259,988346,988478,988527,988543,988592,988613,988688,988710,988736,988739,989004,989010,989013,989030,989035,989315,989321,989334,990160-990161,990180,990189,990281,990301,990451,990459,990766,990781,990854,991053,991191,991497,992424,992469,992567,992571,992623,992913,993106,993194,993199,993287,993408,994935,994976,994979,995247,995250,995253,995264,995286,9
95376,995557,995772,996268,996357,996416,996511,996611,996623,996647-996653,996720,996942,996978,997180,997230,998055,998505,998684,998707,999016,999223,999545,999842,1000000,1000424,1000581,1000675,1001006,1001420,1001661,1001957,1002032,1003614,1003631,1003645,1003703,1003841-1003852,1003873
+/lucene/dev/trunk/solr/src/test/org/apache/solr/analysis/TestSynonymFilter.java:931298,931337,931502,932129-932131,932163,932304,932369,932374,932398,932417,932541,932576,932587,932698,932731-932749,932752,932773,932795,932828,932856-932857,932862,932864,932878,932963,932998-932999,933541-933575,933598,933613,933679,933879,934339,934954,935014-935048,935065,935186-935513,935521-935522,935553-935962,936522,936544,936605,936657-936726,937039,937360,938582-938646,938989,939111,939611,939649,940433,940447,940451-940452,940556,940666,940699,940730,940878-940892,940994,941270,941363,942166,942235,942288,942676,942719,943142,943493,943931,944516,944528,945057,945090,945130,945245,945343,945420,946139,946330,946338,946599,948011,948082,948429,949288,949311,949445,949976,949997,950008,950042,950125,950207,950458,950613,950723,950835,951126,951355,951397,951521,953628,953886,954336,955547,955613,955615,955796-955797,955809-955996,956097,956125,956173,956316,956715,957465,957520,957634
,957707,960367,960374,961821,961941,962555,962714,963372,963654,963720,963781,963873,963888,963906,963909,963920,964019,964054,964267,964312,964430,964459,964720,964753,964832,964856,965103,965222,965230,965327,965330,965585,965938,966354,966878,967080,979049,979453,979807,979809,980369,980428,980436,980501,980555,980592,980909,980911,980917,981265,981550,981598,981650,981661,981690,981857,981936,982073,982084,982201,982725,982824,983100,983212,983216,983313,983495,983500,983530,983632,983778,984187,984202,984232,984510,984968,985453,985455,985672,985875,986158,986612,986773,987005,987009,987122,988087,988206,988216,988259,988346,988478,988527,988543,988592,988613,988688,988710,988736,988739,989004,989010,989013,989030,989035,989315,989321,989334,990160-990161,990180,990189,990281,990301,990451,990459,990766,990781,990854,991053,991191,991497,992424,992469,992567,992571,992623,992913,993106,993194,993199,993287,993408,994935,994976,994979,995247,995250,995253,995264,995286,9
95376,995557,995772,996268,996357,996416,996511,996611,996623,996647-996653,996720,996942,996978,997180,997230,998055,998505,998684,998707,999016,999223,999545,999842,1000000,1000424,1000581,1000675,1001006,1001420,1001661,1001957,1002032,1003614,1003631,1003645,1003703,1003841-1003852,1003873,1003877
/lucene/java/branches/lucene_2_4/solr/src/test/org/apache/solr/analysis/TestSynonymFilter.java:748824
/lucene/java/branches/lucene_2_9/solr/src/test/org/apache/solr/analysis/TestSynonymFilter.java:817269-818600,825998,829134,829881,831036,896850,909334
/lucene/java/branches/lucene_2_9_back_compat_tests/solr/src/test/org/apache/solr/analysis/TestSynonymFilter.java:818601-821336
Propchange: lucene/dev/branches/branch_3x/solr/src/test/org/apache/solr/analysis/TestTrimFilter.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat Oct 2 21:02:57 2010
@@ -1,5 +1,5 @@
/lucene/dev/trunk/modules/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestTrimFilter.java:950008,1003873
-/lucene/dev/trunk/solr/src/test/org/apache/solr/analysis/TestTrimFilter.java:931298,931337,931502,932129-932131,932163,932304,932369,932374,932398,932417,932541,932576,932587,932698,932731-932749,932752,932773,932795,932828,932856-932857,932862,932864,932878,932963,932998-932999,933541-933575,933598,933613,933679,933879,934339,934954,935014-935048,935065,935186-935513,935521-935522,935553-935962,936522,936544,936605,936657-936726,937039,937360,938582-938646,938989,939111,939611,939649,940433,940447,940451-940452,940556,940666,940699,940730,940878-940892,940994,941270,941363,942166,942235,942288,942676,942719,943142,943493,943931,944516,944528,945057,945090,945130,945245,945343,945420,946139,946330,946338,946599,948011,948082,948429,949288,949311,949445,949976,949997,950008,950042,950125,950207,950458,950613,950723,950835,951126,951355,951397,951521,953628,953886,954336,955547,955613,955615,955796-955797,955809-955996,956097,956125,956173,956316,956715,957465,957520,957634,95
7707,960367,960374,960719,961821,961941,962555,962714,963372,963654,963720,963781,963873,963888,963906,963909,963920,964019,964054,964267,964312,964430,964459,964720,964753,964832,964856,965103,965222,965230,965327,965330,965585,965938,966354,966878,967080,979049,979453,979807,979809,980369,980428,980436,980501,980555,980592,980909,980911,980917,981265,981550,981598,981650,981661,981690,981857,981936,982073,982084,982201,982725,982824,983100,983212,983216,983313,983495,983500,983530,983632,983778,984187,984202,984232,984510,984968,985453,985455,985672,985875,986158,986612,986773,987005,987009,987122,988087,988206,988216,988259,988346,988478,988527,988543,988592,988613,988688,988710,988736,988739,989004,989010,989013,989030,989035,989315,989321,989334,990160-990161,990180,990189,990281,990301,990451,990459,990766,990781,990854,991053,991191,991497,992424,992469,992567,992571,992623,992913,993106,993194,993199,993287,993408,994935,994976,994979,995247,995250,995253,995264,9952
86,995376,995557,995772,996268,996357,996416,996511,996611,996623,996647-996653,996720,996942,996978,997180,997230,998055,998505,998684,998707,999016,999223,999545,999842,1000000,1000424,1000581,1000675,1001006,1001318,1001320,1001420,1001661,1001957,1003107,1003614,1003631,1003645,1003703,1003841-1003852,1003873
+/lucene/dev/trunk/solr/src/test/org/apache/solr/analysis/TestTrimFilter.java:931298,931337,931502,932129-932131,932163,932304,932369,932374,932398,932417,932541,932576,932587,932698,932731-932749,932752,932773,932795,932828,932856-932857,932862,932864,932878,932963,932998-932999,933541-933575,933598,933613,933679,933879,934339,934954,935014-935048,935065,935186-935513,935521-935522,935553-935962,936522,936544,936605,936657-936726,937039,937360,938582-938646,938989,939111,939611,939649,940433,940447,940451-940452,940556,940666,940699,940730,940878-940892,940994,941270,941363,942166,942235,942288,942676,942719,943142,943493,943931,944516,944528,945057,945090,945130,945245,945343,945420,946139,946330,946338,946599,948011,948082,948429,949288,949311,949445,949976,949997,950008,950042,950125,950207,950458,950613,950723,950835,951126,951355,951397,951521,953628,953886,954336,955547,955613,955615,955796-955797,955809-955996,956097,956125,956173,956316,956715,957465,957520,957634,95
7707,960367,960374,960719,961821,961941,962555,962714,963372,963654,963720,963781,963873,963888,963906,963909,963920,964019,964054,964267,964312,964430,964459,964720,964753,964832,964856,965103,965222,965230,965327,965330,965585,965938,966354,966878,967080,979049,979453,979807,979809,980369,980428,980436,980501,980555,980592,980909,980911,980917,981265,981550,981598,981650,981661,981690,981857,981936,982073,982084,982201,982725,982824,983100,983212,983216,983313,983495,983500,983530,983632,983778,984187,984202,984232,984510,984968,985453,985455,985672,985875,986158,986612,986773,987005,987009,987122,988087,988206,988216,988259,988346,988478,988527,988543,988592,988613,988688,988710,988736,988739,989004,989010,989013,989030,989035,989315,989321,989334,990160-990161,990180,990189,990281,990301,990451,990459,990766,990781,990854,991053,991191,991497,992424,992469,992567,992571,992623,992913,993106,993194,993199,993287,993408,994935,994976,994979,995247,995250,995253,995264,9952
86,995376,995557,995772,996268,996357,996416,996511,996611,996623,996647-996653,996720,996942,996978,997180,997230,998055,998505,998684,998707,999016,999223,999545,999842,1000000,1000424,1000581,1000675,1001006,1001318,1001320,1001420,1001661,1001957,1003107,1003614,1003631,1003645,1003703,1003841-1003852,1003873,1003877
/lucene/java/branches/lucene_2_4/solr/src/test/org/apache/solr/analysis/TestTrimFilter.java:748824
/lucene/java/branches/lucene_2_9/solr/src/test/org/apache/solr/analysis/TestTrimFilter.java:817269-818600,825998,829134,829881,831036,896850,909334
/lucene/java/branches/lucene_2_9_back_compat_tests/solr/src/test/org/apache/solr/analysis/TestTrimFilter.java:818601-821336
Propchange: lucene/dev/branches/branch_3x/solr/src/test/org/apache/solr/client/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat Oct 2 21:02:57 2010
@@ -1,3 +1,3 @@
/lucene/dev/branches/preflexfixes/solr/src/test/org/apache/solr/client:967125-979432
-/lucene/dev/trunk/solr/src/test/org/apache/solr/client:931298,931337,931502,932129-932131,932163,932304,932369,932374,932398,932417,932541,932576,932587,932698,932731-932749,932752,932773,932795,932828,932856-932857,932862,932864,932878,932963,932998-932999,933541-933575,933598,933613,933679,933879,934339,934954,935014-935048,935065,935186-935513,935521-935522,935553-935962,936522,936544,936605,936657-936726,937039,937360,938582-938646,938989,939111,939611,939649,940433,940447,940451-940452,940556,940666,940699,940730,940878-940892,940994,941270,941363,942166,942235,942288,942676,942719,943142,943493,943931,944516,944528,945057,945090,945130,945245,945343,945420,946139,946330,946338,946599,948011,948082,948429,949288,949311,949445,949976,949997,950008,950042,950125,950207,950458,950613,950723,950835,951126,951355,951397,951521,953628,953886,954336,955547,955613,955615,955796-955797,955809-955996,956097,956125,956173,956316,956715,957465,957520,957634,957707,960367,960374,960
719,961821,961941,962555,962714,963372,963654,963720,963781,963873,963888,963906,963909,963920,964019,964054,964267,964312,964430,964459,964720,964753,964832,964856,965103,965222,965230,965327,965330,965585,965938,966354,966878,967080,979049,979453,979807,979809,980369,980428,980436,980501,980555,980592,980909,980911,980917,981265,981550,981598,981650,981661,981690,981857,981936,982073,982084,982201,982725,982824,983100,983212,983216,983313,983495,983500,983530,983632,983778,984187,984202,984232,984510,984968,985453,985455,985672,985875,986158,986612,986773,987005,987009,987122,988087,988206,988216,988259,988346,988478,988527,988543,988592,988613,988688,988710,988736,988739,989004,989010,989013,989030,989035,989315,989321,989334,990160-990161,990180,990189,990281,990301,990451,990459,990766,990781,990854,991053,991191,991497,992424,992469,992567,992571,992623,992913,993106,993194,993199,993287,993408,994935,994976,994979,995247,995250,995253,995264,995286,995376,995557,99577
2,996268,996357,996416,996511,996611,996623,996647-996653,996720,996942,996978,997180,997230,998055,998505,998684,998707,999016,999223,999545,999842,1000000,1000424,1000581,1000675,1001006,1001318,1001320,1001420,1001661,1001957,1002032,1003107,1003614,1003631,1003645,1003703,1003841-1003852,1003873
+/lucene/dev/trunk/solr/src/test/org/apache/solr/client:931298,931337,931502,932129-932131,932163,932304,932369,932374,932398,932417,932541,932576,932587,932698,932731-932749,932752,932773,932795,932828,932856-932857,932862,932864,932878,932963,932998-932999,933541-933575,933598,933613,933679,933879,934339,934954,935014-935048,935065,935186-935513,935521-935522,935553-935962,936522,936544,936605,936657-936726,937039,937360,938582-938646,938989,939111,939611,939649,940433,940447,940451-940452,940556,940666,940699,940730,940878-940892,940994,941270,941363,942166,942235,942288,942676,942719,943142,943493,943931,944516,944528,945057,945090,945130,945245,945343,945420,946139,946330,946338,946599,948011,948082,948429,949288,949311,949445,949976,949997,950008,950042,950125,950207,950458,950613,950723,950835,951126,951355,951397,951521,953628,953886,954336,955547,955613,955615,955796-955797,955809-955996,956097,956125,956173,956316,956715,957465,957520,957634,957707,960367,960374,960
719,961821,961941,962555,962714,963372,963654,963720,963781,963873,963888,963906,963909,963920,964019,964054,964267,964312,964430,964459,964720,964753,964832,964856,965103,965222,965230,965327,965330,965585,965938,966354,966878,967080,979049,979453,979807,979809,980369,980428,980436,980501,980555,980592,980909,980911,980917,981265,981550,981598,981650,981661,981690,981857,981936,982073,982084,982201,982725,982824,983100,983212,983216,983313,983495,983500,983530,983632,983778,984187,984202,984232,984510,984968,985453,985455,985672,985875,986158,986612,986773,987005,987009,987122,988087,988206,988216,988259,988346,988478,988527,988543,988592,988613,988688,988710,988736,988739,989004,989010,989013,989030,989035,989315,989321,989334,990160-990161,990180,990189,990281,990301,990451,990459,990766,990781,990854,991053,991191,991497,992424,992469,992567,992571,992623,992913,993106,993194,993199,993287,993408,994935,994976,994979,995247,995250,995253,995264,995286,995376,995557,99577
2,996268,996357,996416,996511,996611,996623,996647-996653,996720,996942,996978,997180,997230,998055,998505,998684,998707,999016,999223,999545,999842,1000000,1000424,1000581,1000675,1001006,1001318,1001320,1001420,1001661,1001957,1002032,1003107,1003614,1003631,1003645,1003703,1003841-1003852,1003873,1003877
/lucene/solr/trunk/src/test/org/apache/solr/client:922950-923910,923912-925091
Propchange: lucene/dev/branches/branch_3x/solr/src/test/org/apache/solr/request/SimpleFacetsTest.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat Oct 2 21:02:57 2010
@@ -1,4 +1,4 @@
-/lucene/dev/trunk/solr/src/test/org/apache/solr/request/SimpleFacetsTest.java:931183-980555,980592,980909,980911,980917,981265,981550,981598,981650,981661,981690,981857,981936,982073,982084,982201,982725,982824,983100,983212,983216,983313,983495,983500,983530,983632,983778,984187,984202,984232,984510,984968,985453,985455,985672,985875,986158,986612,986773,987005,987009,987122,988087,988206,988216,988259,988346,988478,988527,988543,988592,988613,988688,988710,988736,988739,989004,989010,989013,989030,989035,989315,989321,989334,989941,990160-990161,990180,990189,990281,990301,990451,990459,990766,990781,990854,991053,991191,991497,992424,992469,992567,992571,992623,992913,993106,993194,993199,993287,993408,994935,994976,994979,995247,995250,995253,995264,995286,995376,995557,995772,996268,996357,996416,996511,996611,996623,996647-996653,996720,996942,996978,997180,997230,998055,998505,998684,998707,999016,999223,999545,999842,1000000,1000424,1000581,1000675,1001006,1001318,10
01320,1001420,1001661,1001957,1003107,1003614,1003631,1003645,1003703,1003841-1003852,1003873
+/lucene/dev/trunk/solr/src/test/org/apache/solr/request/SimpleFacetsTest.java:931183-980555,980592,980909,980911,980917,981265,981550,981598,981650,981661,981690,981857,981936,982073,982084,982201,982725,982824,983100,983212,983216,983313,983495,983500,983530,983632,983778,984187,984202,984232,984510,984968,985453,985455,985672,985875,986158,986612,986773,987005,987009,987122,988087,988206,988216,988259,988346,988478,988527,988543,988592,988613,988688,988710,988736,988739,989004,989010,989013,989030,989035,989315,989321,989334,989941,990160-990161,990180,990189,990281,990301,990451,990459,990766,990781,990854,991053,991191,991497,992424,992469,992567,992571,992623,992913,993106,993194,993199,993287,993408,994935,994976,994979,995247,995250,995253,995264,995286,995376,995557,995772,996268,996357,996416,996511,996611,996623,996647-996653,996720,996942,996978,997180,997230,998055,998505,998684,998707,999016,999223,999545,999842,1000000,1000424,1000581,1000675,1001006,1001318,10
01320,1001420,1001661,1001957,1003107,1003614,1003631,1003645,1003703,1003841-1003852,1003873,1003877
/lucene/java/branches/lucene_2_4/solr/src/test/org/apache/solr/request/SimpleFacetsTest.java:748824
/lucene/java/branches/lucene_2_9/solr/src/test/org/apache/solr/request/SimpleFacetsTest.java:817269-818600,825998,829134,829881,831036,896850,909334
/lucene/java/branches/lucene_2_9_back_compat_tests/solr/src/test/org/apache/solr/request/SimpleFacetsTest.java:818601-821336
Modified: lucene/dev/branches/branch_3x/solr/src/test/org/apache/solr/response/TestCSVResponseWriter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/solr/src/test/org/apache/solr/response/TestCSVResponseWriter.java?rev=1003885&r1=1003884&r2=1003885&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/solr/src/test/org/apache/solr/response/TestCSVResponseWriter.java (original)
+++ lucene/dev/branches/branch_3x/solr/src/test/org/apache/solr/response/TestCSVResponseWriter.java Sat Oct 2 21:02:57 2010
@@ -1,165 +1,165 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.solr.response;
-
-import org.apache.solr.SolrTestCaseJ4;
-import org.apache.solr.common.SolrDocument;
-import org.apache.solr.common.SolrDocumentList;
-import org.apache.solr.common.util.DateUtil;
-import org.apache.solr.request.SolrQueryRequest;
-import org.apache.solr.util.SolrPluginUtils;
-import org.junit.*;
-
-import java.io.StringWriter;
-
-import static org.junit.Assert.*;
-
-import static org.junit.Assert.assertEquals;
-
-public class TestCSVResponseWriter extends SolrTestCaseJ4 {
- @BeforeClass
- public static void beforeClass() throws Exception {
- initCore("solrconfig.xml","schema12.xml");
- createIndex();
- }
-
- public static void createIndex() {
- assertU(adoc("id","1", "foo_i","-1", "foo_s","hi", "foo_l","12345678987654321", "foo_b","false", "foo_f","1.414","foo_d","-1.0E300","foo_dt","2000-01-02T03:04:05Z"));
- assertU(adoc("id","2", "v_ss","hi", "v_ss","there", "v2_ss","nice", "v2_ss","output"));
- assertU(commit());
- }
-
-
- @Test
- public void testCSVOutput() throws Exception {
- // test our basic types,and that fields come back in the requested order
- assertEquals("id,foo_s,foo_i,foo_l,foo_b,foo_f,foo_d,foo_dt\n1,hi,-1,12345678987654321,false,1.414,-1.0E300,2000-01-02T03:04:05Z\n"
- , h.query(req("q","id:1", "wt","csv", "fl","id,foo_s,foo_i,foo_l,foo_b,foo_f,foo_d,foo_dt")));
-
- // test retrieving score, csv.header
- assertEquals("1,0.0,hi\n"
- , h.query(req("q","id:1^0", "wt","csv", "csv.header","false", "fl","id,score,foo_s")));
-
- // test multivalued
- assertEquals("2,\"hi,there\"\n"
- , h.query(req("q","id:2", "wt","csv", "csv.header","false", "fl","id,v_ss")));
-
- // test separator change
- assertEquals("2|\"hi|there\"\n"
- , h.query(req("q","id:2", "wt","csv", "csv.header","false", "csv.separator","|", "fl","id,v_ss")));
-
- // test mv separator change
- assertEquals("2,hi|there\n"
- , h.query(req("q","id:2", "wt","csv", "csv.header","false", "csv.mv.separator","|", "fl","id,v_ss")));
-
- // test mv separator change for a single field
- assertEquals("2,hi|there,nice:output\n"
- , h.query(req("q","id:2", "wt","csv", "csv.header","false", "csv.mv.separator","|", "f.v2_ss.csv.separator",":", "fl","id,v_ss,v2_ss")));
-
- // test retrieving fields from index
- String result = h.query(req("q","*:*", "wt","csv", "csv.header","true", "fl","*,score"));
- for (String field : "id,foo_s,foo_i,foo_l,foo_b,foo_f,foo_d,foo_dt,v_ss,v2_ss,score".split(",")) {
- assertTrue(result.indexOf(field) >= 0);
- }
-
- // test null values
- assertEquals("2,,hi|there\n"
- , h.query(req("q","id:2", "wt","csv", "csv.header","false", "csv.mv.separator","|", "fl","id,foo_s,v_ss")));
-
- // test alternate null value
- assertEquals("2,NULL,hi|there\n"
- , h.query(req("q","id:2", "wt","csv", "csv.header","false", "csv.mv.separator","|", "csv.null","NULL","fl","id,foo_s,v_ss")));
-
- // test alternate newline
- assertEquals("2,\"hi,there\"\r\n"
- , h.query(req("q","id:2", "wt","csv", "csv.header","false", "csv.newline","\r\n", "fl","id,v_ss")));
-
- // test alternate encapsulator
- assertEquals("2,'hi,there'\n"
- , h.query(req("q","id:2", "wt","csv", "csv.header","false", "csv.encapsulator","'", "fl","id,v_ss")));
-
- // test using escape instead of encapsulator
- assertEquals("2,hi\\,there\n"
- , h.query(req("q","id:2", "wt","csv", "csv.header","false", "csv.escape","\\", "fl","id,v_ss")));
-
- // test multiple lines
- assertEquals("1,,hi\n2,\"hi,there\",\n"
- , h.query(req("q","id:[1 TO 2]", "wt","csv", "csv.header","false", "fl","id,v_ss,foo_s")));
-
-
- // now test SolrDocumentList
- SolrDocument d = new SolrDocument();
- SolrDocument d1 = d;
- d.addField("id","1");
- d.addField("foo_i",-1);
- d.addField("foo_s","hi");
- d.addField("foo_l","12345678987654321L");
- d.addField("foo_b",false);
- d.addField("foo_f",1.414f);
- d.addField("foo_d",-1.0E300);
- d.addField("foo_dt", DateUtil.parseDate("2000-01-02T03:04:05Z"));
- d.addField("score", "2.718");
-
- d = new SolrDocument();
- SolrDocument d2 = d;
- d.addField("id","2");
- d.addField("v_ss","hi");
- d.addField("v_ss","there");
- d.addField("v2_ss","nice");
- d.addField("v2_ss","output");
- d.addField("score", "89.83");
-
- SolrDocumentList sdl = new SolrDocumentList();
- sdl.add(d1);
- sdl.add(d2);
-
- SolrQueryRequest req = req("q","*:*");
- SolrQueryResponse rsp = new SolrQueryResponse();
- rsp.add("response", sdl);
- QueryResponseWriter w = new CSVResponseWriter();
-
- SolrPluginUtils.setReturnFields("id,foo_s", rsp);
- StringWriter buf = new StringWriter();
- w.write(buf, req, rsp);
- assertEquals("id,foo_s\n1,hi\n2,\n", buf.toString());
-
- // try scores
- SolrPluginUtils.setReturnFields("id,score,foo_s", rsp);
- buf = new StringWriter();
- w.write(buf, req, rsp);
- assertEquals("id,score,foo_s\n1,2.718,hi\n2,89.83,\n", buf.toString());
-
- // get field values from docs... should be ordered and not include score unless requested
- SolrPluginUtils.setReturnFields("*", rsp);
- buf = new StringWriter();
- w.write(buf, req, rsp);
- assertEquals("id,foo_i,foo_s,foo_l,foo_b,foo_f,foo_d,foo_dt,v_ss,v2_ss\n" +
- "1,-1,hi,12345678987654321L,false,1.414,-1.0E300,2000-01-02T03:04:05Z,,\n" +
- "2,,,,,,,,\"hi,there\",\"nice,output\"\n",
- buf.toString());
-
-
- // get field values and scores - just check that the scores are there... we don't guarantee where
- SolrPluginUtils.setReturnFields("*,score", rsp);
- buf = new StringWriter();
- w.write(buf, req, rsp);
- String s = buf.toString();
- assertTrue(s.indexOf("score") >=0 && s.indexOf("2.718") > 0 && s.indexOf("89.83") > 0 );
- }
-
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.solr.response;
+
+import org.apache.solr.SolrTestCaseJ4;
+import org.apache.solr.common.SolrDocument;
+import org.apache.solr.common.SolrDocumentList;
+import org.apache.solr.common.util.DateUtil;
+import org.apache.solr.request.SolrQueryRequest;
+import org.apache.solr.util.SolrPluginUtils;
+import org.junit.*;
+
+import java.io.StringWriter;
+
+import static org.junit.Assert.*;
+
+import static org.junit.Assert.assertEquals;
+
+public class TestCSVResponseWriter extends SolrTestCaseJ4 {
+ @BeforeClass
+ public static void beforeClass() throws Exception {
+ initCore("solrconfig.xml","schema12.xml");
+ createIndex();
+ }
+
+ public static void createIndex() {
+ assertU(adoc("id","1", "foo_i","-1", "foo_s","hi", "foo_l","12345678987654321", "foo_b","false", "foo_f","1.414","foo_d","-1.0E300","foo_dt","2000-01-02T03:04:05Z"));
+ assertU(adoc("id","2", "v_ss","hi", "v_ss","there", "v2_ss","nice", "v2_ss","output"));
+ assertU(commit());
+ }
+
+
+ @Test
+ public void testCSVOutput() throws Exception {
+ // test our basic types,and that fields come back in the requested order
+ assertEquals("id,foo_s,foo_i,foo_l,foo_b,foo_f,foo_d,foo_dt\n1,hi,-1,12345678987654321,false,1.414,-1.0E300,2000-01-02T03:04:05Z\n"
+ , h.query(req("q","id:1", "wt","csv", "fl","id,foo_s,foo_i,foo_l,foo_b,foo_f,foo_d,foo_dt")));
+
+ // test retrieving score, csv.header
+ assertEquals("1,0.0,hi\n"
+ , h.query(req("q","id:1^0", "wt","csv", "csv.header","false", "fl","id,score,foo_s")));
+
+ // test multivalued
+ assertEquals("2,\"hi,there\"\n"
+ , h.query(req("q","id:2", "wt","csv", "csv.header","false", "fl","id,v_ss")));
+
+ // test separator change
+ assertEquals("2|\"hi|there\"\n"
+ , h.query(req("q","id:2", "wt","csv", "csv.header","false", "csv.separator","|", "fl","id,v_ss")));
+
+ // test mv separator change
+ assertEquals("2,hi|there\n"
+ , h.query(req("q","id:2", "wt","csv", "csv.header","false", "csv.mv.separator","|", "fl","id,v_ss")));
+
+ // test mv separator change for a single field
+ assertEquals("2,hi|there,nice:output\n"
+ , h.query(req("q","id:2", "wt","csv", "csv.header","false", "csv.mv.separator","|", "f.v2_ss.csv.separator",":", "fl","id,v_ss,v2_ss")));
+
+ // test retrieving fields from index
+ String result = h.query(req("q","*:*", "wt","csv", "csv.header","true", "fl","*,score"));
+ for (String field : "id,foo_s,foo_i,foo_l,foo_b,foo_f,foo_d,foo_dt,v_ss,v2_ss,score".split(",")) {
+ assertTrue(result.indexOf(field) >= 0);
+ }
+
+ // test null values
+ assertEquals("2,,hi|there\n"
+ , h.query(req("q","id:2", "wt","csv", "csv.header","false", "csv.mv.separator","|", "fl","id,foo_s,v_ss")));
+
+ // test alternate null value
+ assertEquals("2,NULL,hi|there\n"
+ , h.query(req("q","id:2", "wt","csv", "csv.header","false", "csv.mv.separator","|", "csv.null","NULL","fl","id,foo_s,v_ss")));
+
+ // test alternate newline
+ assertEquals("2,\"hi,there\"\r\n"
+ , h.query(req("q","id:2", "wt","csv", "csv.header","false", "csv.newline","\r\n", "fl","id,v_ss")));
+
+ // test alternate encapsulator
+ assertEquals("2,'hi,there'\n"
+ , h.query(req("q","id:2", "wt","csv", "csv.header","false", "csv.encapsulator","'", "fl","id,v_ss")));
+
+ // test using escape instead of encapsulator
+ assertEquals("2,hi\\,there\n"
+ , h.query(req("q","id:2", "wt","csv", "csv.header","false", "csv.escape","\\", "fl","id,v_ss")));
+
+ // test multiple lines
+ assertEquals("1,,hi\n2,\"hi,there\",\n"
+ , h.query(req("q","id:[1 TO 2]", "wt","csv", "csv.header","false", "fl","id,v_ss,foo_s")));
+
+
+ // now test SolrDocumentList
+ SolrDocument d = new SolrDocument();
+ SolrDocument d1 = d;
+ d.addField("id","1");
+ d.addField("foo_i",-1);
+ d.addField("foo_s","hi");
+ d.addField("foo_l","12345678987654321L");
+ d.addField("foo_b",false);
+ d.addField("foo_f",1.414f);
+ d.addField("foo_d",-1.0E300);
+ d.addField("foo_dt", DateUtil.parseDate("2000-01-02T03:04:05Z"));
+ d.addField("score", "2.718");
+
+ d = new SolrDocument();
+ SolrDocument d2 = d;
+ d.addField("id","2");
+ d.addField("v_ss","hi");
+ d.addField("v_ss","there");
+ d.addField("v2_ss","nice");
+ d.addField("v2_ss","output");
+ d.addField("score", "89.83");
+
+ SolrDocumentList sdl = new SolrDocumentList();
+ sdl.add(d1);
+ sdl.add(d2);
+
+ SolrQueryRequest req = req("q","*:*");
+ SolrQueryResponse rsp = new SolrQueryResponse();
+ rsp.add("response", sdl);
+ QueryResponseWriter w = new CSVResponseWriter();
+
+ SolrPluginUtils.setReturnFields("id,foo_s", rsp);
+ StringWriter buf = new StringWriter();
+ w.write(buf, req, rsp);
+ assertEquals("id,foo_s\n1,hi\n2,\n", buf.toString());
+
+ // try scores
+ SolrPluginUtils.setReturnFields("id,score,foo_s", rsp);
+ buf = new StringWriter();
+ w.write(buf, req, rsp);
+ assertEquals("id,score,foo_s\n1,2.718,hi\n2,89.83,\n", buf.toString());
+
+ // get field values from docs... should be ordered and not include score unless requested
+ SolrPluginUtils.setReturnFields("*", rsp);
+ buf = new StringWriter();
+ w.write(buf, req, rsp);
+ assertEquals("id,foo_i,foo_s,foo_l,foo_b,foo_f,foo_d,foo_dt,v_ss,v2_ss\n" +
+ "1,-1,hi,12345678987654321L,false,1.414,-1.0E300,2000-01-02T03:04:05Z,,\n" +
+ "2,,,,,,,,\"hi,there\",\"nice,output\"\n",
+ buf.toString());
+
+
+ // get field values and scores - just check that the scores are there... we don't guarantee where
+ SolrPluginUtils.setReturnFields("*,score", rsp);
+ buf = new StringWriter();
+ w.write(buf, req, rsp);
+ String s = buf.toString();
+ assertTrue(s.indexOf("score") >=0 && s.indexOf("2.718") > 0 && s.indexOf("89.83") > 0 );
+ }
+
}
\ No newline at end of file
Propchange: lucene/dev/branches/branch_3x/solr/src/test/org/apache/solr/response/TestCSVResponseWriter.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: lucene/dev/branches/branch_3x/solr/src/test/org/apache/solr/search/SpatialFilterTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: lucene/dev/branches/branch_3x/solr/src/test/org/apache/solr/search/TestSolrQueryParser.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/solr/src/test/org/apache/solr/search/TestSolrQueryParser.java?rev=1003885&r1=1003884&r2=1003885&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/solr/src/test/org/apache/solr/search/TestSolrQueryParser.java (original)
+++ lucene/dev/branches/branch_3x/solr/src/test/org/apache/solr/search/TestSolrQueryParser.java Sat Oct 2 21:02:57 2010
@@ -1,53 +1,53 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.solr.search;
-
-import org.apache.solr.SolrTestCaseJ4;
-import org.junit.BeforeClass;
-import org.junit.After;
-import org.junit.Test;
-
-
-public class TestSolrQueryParser extends SolrTestCaseJ4 {
- @BeforeClass
- public static void beforeClass() throws Exception {
- initCore("solrconfig.xml", "schema12.xml");
- createIndex();
- }
-
- public static void createIndex() {
- String v;
- v="how now brown cow";
- assertU(adoc("id","1", "text",v, "text_np",v));
- v="now cow";
- assertU(adoc("id","2", "text",v, "text_np",v));
- assertU(commit());
- }
-
- @Test
- public void testPhrase() {
- // should generate a phrase of "now cow" and match only one doc
- assertQ(req("q","text:now-cow", "indent","true")
- ,"//*[@numFound='1']"
- );
- // should generate a query of (now OR cow) and match both docs
- assertQ(req("q","text_np:now-cow", "indent","true")
- ,"//*[@numFound='2']"
- );
- }
-
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.solr.search;
+
+import org.apache.solr.SolrTestCaseJ4;
+import org.junit.BeforeClass;
+import org.junit.After;
+import org.junit.Test;
+
+
+public class TestSolrQueryParser extends SolrTestCaseJ4 {
+ @BeforeClass
+ public static void beforeClass() throws Exception {
+ initCore("solrconfig.xml", "schema12.xml");
+ createIndex();
+ }
+
+ public static void createIndex() {
+ String v;
+ v="how now brown cow";
+ assertU(adoc("id","1", "text",v, "text_np",v));
+ v="now cow";
+ assertU(adoc("id","2", "text",v, "text_np",v));
+ assertU(commit());
+ }
+
+ @Test
+ public void testPhrase() {
+ // should generate a phrase of "now cow" and match only one doc
+ assertQ(req("q","text:now-cow", "indent","true")
+ ,"//*[@numFound='1']"
+ );
+ // should generate a query of (now OR cow) and match both docs
+ assertQ(req("q","text_np:now-cow", "indent","true")
+ ,"//*[@numFound='2']"
+ );
+ }
+
+}
Propchange: lucene/dev/branches/branch_3x/solr/src/test/org/apache/solr/search/TestSolrQueryParser.java
------------------------------------------------------------------------------
svn:eol-style = native