Skip to content
Snippets Groups Projects
Commit b7d97a8d authored by Demian Katz's avatar Demian Katz
Browse files

Added integration tests for AlphaBrowse functionality (thanks to the National...

Added integration tests for AlphaBrowse functionality (thanks to the National Library of Ireland for providing test data).
parent ed3408fe
No related merge requests found
...@@ -114,6 +114,12 @@ ...@@ -114,6 +114,12 @@
<!-- import marc test records into vufind index (note: the marc test records have prefix "testsample#") --> <!-- import marc test records into vufind index (note: the marc test records have prefix "testsample#") -->
<exec command="find ${srcdir}/tests/data -name *.mrc -printf %p," outputProperty="buglist" /> <exec command="find ${srcdir}/tests/data -name *.mrc -printf %p," outputProperty="buglist" />
<foreach list="${buglist}" param="filename" delimiter="," target="importrec" /> <foreach list="${buglist}" param="filename" delimiter="," target="importrec" />
<exec command="find ${srcdir}/tests/data/authority -name *.mrc -printf %p," outputProperty="authlist" />
<foreach list="${authlist}" param="filename" delimiter="," target="importauthrec" />
<!-- build alphabrowse index -->
<exec command="VUFIND_HOME=${srcdir} VUFIND_LOCAL_DIR=${srcdir}/local ${srcdir}/index-alphabetic-browse.sh" outputProperty="LASTOUTPUT" />
<echo message="${LASTOUTPUT}" />
<!-- start Solr (use restart in case of old PID files) --> <!-- start Solr (use restart in case of old PID files) -->
<exec command="VUFIND_HOME=${srcdir} VUFIND_LOCAL_DIR=${srcdir}/local JETTY_PID=${tmp}/vufindtest.pid JETTY_CONSOLE=/dev/null ${srcdir}/vufind.sh restart" outputProperty="LASTOUTPUT" /> <exec command="VUFIND_HOME=${srcdir} VUFIND_LOCAL_DIR=${srcdir}/local JETTY_PID=${tmp}/vufindtest.pid JETTY_CONSOLE=/dev/null ${srcdir}/vufind.sh restart" outputProperty="LASTOUTPUT" />
...@@ -145,6 +151,7 @@ ...@@ -145,6 +151,7 @@
<echo message="${LASTOUTPUT}" /> <echo message="${LASTOUTPUT}" />
<!-- delete the configuration, sample index, logs and cache data --> <!-- delete the configuration, sample index, logs and cache data -->
<delete dir="${srcdir}/solr/alphabetic_browse" includeemptydirs="true" failonerror="true" />
<delete dir="${srcdir}/solr/stats/index" includeemptydirs="true" failonerror="true" /> <delete dir="${srcdir}/solr/stats/index" includeemptydirs="true" failonerror="true" />
<delete dir="${srcdir}/solr/authority/index" includeemptydirs="true" failonerror="true" /> <delete dir="${srcdir}/solr/authority/index" includeemptydirs="true" failonerror="true" />
<delete dir="${srcdir}/solr/biblio/index" includeemptydirs="true" failonerror="true" /> <delete dir="${srcdir}/solr/biblio/index" includeemptydirs="true" failonerror="true" />
...@@ -186,7 +193,20 @@ ...@@ -186,7 +193,20 @@
<echo message="Packages successfully generated in ${builddir}/packages" /> <echo message="Packages successfully generated in ${builddir}/packages" />
</target> </target>
<target name="importrec" description="import each of the bug marc test record"> <target name="importauthrec" description="import each of the MARC authority test records">
<if>
<istrue value="${filename}"/> <!-- To ignore the last token, as find command output list has ',' after last filename -->
<then>
<exec command="basename ${filename}" outputProperty="BASENAME" />
<!-- perform the import -->
<exec command="VUFIND_HOME=${srcdir} VUFIND_LOCAL_DIR=${srcdir}/local ${srcdir}/import-marc-auth.sh ${filename} marc_auth_ils.properties" outputProperty="LASTOUTPUT" />
<echo message="${LASTOUTPUT}" />
</then>
</if>
</target>
<target name="importrec" description="import each of the MARC bibliographic test records">
<if> <if>
<istrue value="${filename}"/> <!-- To ignore the last token, as find command output list has ',' after last filename --> <istrue value="${filename}"/> <!-- To ignore the last token, as find command output list has ',' after last filename -->
<then> <then>
......
###############################################################################
# marc_auth_ils.properties -- VuFind MARC mappings for authority records from #
# an ILS. #
###############################################################################
id = 001
\ No newline at end of file
<?php
/**
* Solr Connection Test Class
*
* PHP version 5
*
* Copyright (C) Villanova University 2010.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
* as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* @category VuFind2
* @package Tests
* @author Demian Katz <demian.katz@villanova.edu>
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License
* @link http://vufind.org/wiki/unit_tests Wiki
*/
namespace VuFind\IntegrationTest\Connection;
/**
* ResultFeed Test Class
*
* @category VuFind2
* @package Tests
* @author Demian Katz <demian.katz@villanova.edu>
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License
* @link http://vufind.org/wiki/unit_tests Wiki
*/
class SolrTest extends \VuFindTest\Unit\TestCase
{
/**
* Check AlphaBrowse "see also" functionality.
*
* @return void
*/
public function testAlphaBrowseSeeAlso()
{
$solr = \VuFind\Connection\Manager::connectToIndex();
$result = $solr->alphabeticBrowse('author', 'Dublin Society', 0, 1);
$item = $result['Browse']['items'][0];
$this->assertEquals($item['count'], count($item['ids']));
$this->assertTrue(empty($item['useInstead']));
$this->assertTrue(in_array('vtls000013187', $item['ids']));
$this->assertTrue(in_array('Royal Dublin Society', $item['seeAlso']));
$this->assertEquals('Dublin Society', $item['heading']);
}
/**
* Check AlphaBrowse "use instead" functionality.
*
* @return void
*/
public function testAlphaBrowseUseInstead()
{
$solr = \VuFind\Connection\Manager::connectToIndex();
$result = $solr->alphabeticBrowse('author', 'Dublin Society, Royal', 0, 1);
$item = $result['Browse']['items'][0];
$this->assertEquals(0, $item['count']);
$this->assertEquals($item['count'], count($item['ids']));
$this->assertEquals('Dublin Society, Royal', $item['heading']);
$this->assertTrue(empty($item['seeAlso']));
$this->assertTrue(in_array('Royal Dublin Society', $item['useInstead']));
}
}
\ No newline at end of file
00313nz a2200121o 4500001001400000003000700014005001700021008004100038039004500079110001900124510002500143999002300168vtls000001429IeDuNL20100514120226.0100514|| aznnnaab| un and |u 9a201005141202bVLOADy201005131507zVLOAD2 aDublin Society2 aRoyal Dublin Society aVIRTUA x00466nz a2200181o 4500001001400000003000700014005001700021008004100038039002400079110002500103410002600128410000800154510004200162510001900204670002600223901001200249999002300261vtls000001427IeDuNL20100513150732.0100513 f acnnnaabn ub aac d 9y201005131507zVLOAD2 aRoyal Dublin Society2 aDublin Society, Royal2 aRDS2 aRoyal Agricultural Society of Ireland2 aDublin Society aLCNAF, 14 April 2010.00aREINDEX aVIRTUA x00336nz a2200121o 4500001001400000003000700014005001700021008004100038039004500079110004200124510002500166999002300191vtls000001428IeDuNL20100514120226.0100514|| aznnnaab| un and |u 9a201005141202bVLOADy201005132122zVLOAD2 aRoyal Agricultural Society of Ireland2 aRoyal Dublin Society aVIRTUA x
\ No newline at end of file
00749nam a2200241 4500001001400000003000700014005001700021008003900038035001800077039004500095040001100140049000700151110001900158245008200177260006300259300002500322504001000347650002600357650003200383911001000415949007500425955000700500vtls000013187IeDuNL20100731125200.0 s1787 ie 001 0 eng a(IeDuNL)29995 9a201007311252bVLOADy201005141450zVLOAD aDB/N-1 bbk2 aDublin Society10aPremiums offered by the Dublin Society, for manufactures and fine arts.b1787 aDublinbPrinted by W. Sleater, No. 28, Dame-streetc[1787] a[4], 16, [2] p.c8vo aIndex 0aArtszIrelandxAwards 0aIndustrieszIrelandxAwards a29995 AVIRTUAITEMD90000F1X18634444000147447aIr 506 r9/23oITEM TYPE : bk aPK00749nam a2200229 4500001001400000003000700014005001700021008003900038035001800077039004500095040001100140049000700151110001900158245008000177260010200257300002500359504001000384650003300394911001000427949007500437955000700512vtls000013186IeDuNL20100731125200.0 s1787 ie 001 0 eng a(IeDuNL)29994 9a201007311252bVLOADy201005141450zVLOAD aDB/N-1 bbk2 aDublin Society10aPremiums offered by the Dublin Society, for agriculture and planting.b1787 aDublinbPrinted by W. Sleater, No. 28, New-Buildings Dame-Street, (opposite Crow-Street.)c[1787] a[4], 24, [2] p.c8vo aIndex 0aAgriculturezIrelandxAwards a29994 AVIRTUAITEMD90000F1X18634444000147439aIr 506 r9/23oITEM TYPE : bk aPK00749nam a2200241 4500001001400000003000700014005001700021008003900038035001800077039004500095040001100140049000700151110001900158245008200177260006300259300002500322504001000347650002600357650003200383911001000415949007500425955000700500vtls000013185IeDuNL20100731125100.0 s1788 ie 001 0 eng a(IeDuNL)29993 9a201007311251bVLOADy201005141450zVLOAD aDB/N-1 bbk2 aDublin Society10aPremiums offered by the Dublin Society, for manufactures and fine arts.b1788 aDublinbPrinted by W. Sleater, No. 28, Dame-streetc[1788] a[4], 19, [1] p.c8vo aIndex 0aArtszIrelandxAwards 0aIndustrieszIrelandxAwards a29993 AVIRTUAITEMD90000F1X18634444000147413aIr 506 r9/24oITEM TYPE : bk aPK00714nam a2200229 4500001001400000003000700014005001700021008003900038035001800077039004500095040001100140049000700151110001900158245008000177260006300257300002900320504001000349650003300359911001000392949007500402955000700477vtls000013184IeDuNL20100731125100.0 s1788 ie 001 0 eng a(IeDuNL)29990 9a201007311251bVLOADy201005141450zVLOAD aDB/N-1 bbk2 aDublin Society10aPremiums offered by the Dublin Society, for agriculture and planting.b1788 aDublinbPrinted by W. Sleater, No. 28, Dame-streetc[1788] a[2], ii, 28, [2] p.c8vo aIndex 0aAgriculturezIrelandxAwards a29990 AVIRTUAITEMD90000F1X18634444000147405aIr 506 r9/24oITEM TYPE : bk aPK01067nam a2200229 4500001001400000003000700014005001700021008003900038035001800077039004500095040001100140049000700151100004100158245035600199260003300555500005300588650002400641650003200665710004200697911001000739949008800749vtls000003884IeDuNL20100731114700.0 s1874 ie 000 0 eng a(IeDuNL)12895 9a201007311147bVLOADy201005141416zVLOAD aDB/N-1 bbk1 aCameron, Charles Alexander,db. 183010aOn the culture of the Silesian beet, in relation to the production of sugar, and the feeding of the animals of the farmbincluding directions for the cultivation of the crop, and results of the analyses of sugar beets grown in Ireland. A paper read before the Royal Agricultural Society of Ireland, 11th November, 1873, ...cby Charles A. Cameron, ... aDublinbFannin and Co.c1874 a"Reprinted from the Transactions of the Society" 0aSugar beetzIreland 0aSugar beet as feedzIreland2 aRoyal Agricultural Society of Ireland a12895 AVIRTUAITEMD90000F1X29634444000042275aP 1644(3)oITEM TYPE : bkqO'Hegarty gift01360nam a2200349 4500001001400000003000700014005001700021008004100038020002000079020001500099035001800114039004500132040001900177049000700196111006300203245016600266260003900432300002500471504001900496650005300515650003800568650005300606650004300659650004000702650003200742700003200774710002500806830004700831911001000878946004800888949007400936vtls000013412IeDuNL20100731125400.0 s1993 ie b 101 0 eng  a0860270351(pbk) a0860270343 a(IeDuNL)30492 9a201007311254bVLOADy201005141451zVLOAD aDB/U-1dDB/N-1 bbk0 aConference on the Inland Waters of Irelandd(1992cDublin)10aWater of lifebthe proceedings of a Conference on the Inland Waters of Ireland, held in the Royal Dublin Society from October 7-9, 1992cedited by Charles Mollan aDublinbRoyal Dublin Societyc1993 a224 p.bill.c26 cm. aIncludes index 0aWater resources developmentzIrelandxCongresses 0aWater-supplyzIrelandxCongresses 0aInland water transportationzIrelandxCongresses 0aInland navigationzIrelandxCongresses 0aAquatic sportszIrelandxCongresses 0aCanalszIrelandxCongresses1 aMollan, R. C.q(R. Charles)2 aRoyal Dublin Society 0aSeminar proceedings (Royal Dublin Society) a30492 aRoyal Dublin SocietybBallsbridge, Dublin 4 AVIRTUAITEMD90000F1X18634444000152397aIr 3381 w 7oITEM TYPE : bk01042nam a2200265 4500001001400000003000700014005001700021008004100038020001500079035001800094039004500112040001900157049000700176245019400183260003900377300002600416650005000442650003700492700002100529710002500550830006900575911001000644946004800654949007400702vtls000013282IeDuNL20100731125200.0 s1993 ie 100 0 eng  a0860270335 a(IeDuNL)30147 9a201007311252bVLOADy201005141450zVLOAD aDB/U-1dDB/N-1 bbk00aAgricultural development for the 21st centurybadvice, research & education : the proceedings of a conference held in the Royal Dublin Society on November 6, 1992cedited by Michael Maloney aDublinbRoyal Dublin Societyc1993 a96 p.btablesc30 cm. 0aAgricultural development projectsxCongresses 0aAgriculturezIrelandvCongresses1 aMaloney, Michael2 aRoyal Dublin Society 0aAgricultural conference proceedings (Royal Dublin Society)vno.1 a30147 aRoyal Dublin SocietybBallsbridge, Dublin 4 AVIRTUAITEMD90000F1X18634444000173005aIr 630 i 41oITEM TYPE : bk00819 am a2200229 4500001001400000003000700014005001700021008004100038020002000079035001800099039004500117049000700162245016400169260003900333300002400372650002900396650002300425700003200448710002500480911001000505949007400515vtls000009763IeDuNL20100731122400.0900117s1989 ie a 101 0 eng  a0860270246(pbk) a(IeDuNL)23438 9a201007311224bVLOADy201005141437zVLOAD bbk04aThe Utilisation of Irish Midland peatlandsbthe proceedings of a workshop held in the Royal Dublin Society from September 21-24, 1988cedited by Charles Mollan aDublinbRoyal Dublin Societyc1989 a78 p.bill.c27 cm. 0aLand use, RuralzIreland 0aPeat bogszIreland1 aMollan, R. C.q(R. Charles)2 aRoyal Dublin Society a23438 AVIRTUAITEMD90000F1X18634444000106385aIr 631 m 16oITEM TYPE : bk01122nam a2200325 4500001001400000003000700014005001700021008004100038020001500079035001700094039004500111040001900156049000700175100003200182245010100214260004600315300001900361500004100380504002400421650007100445650003000516650003000546650003300576710002500609710004000634740003300674911000900707949007300716955000700789vtls000000329IeDuNL20100731111000.0 s1990 ie c 001 0 eng  a0860270300 a(IeDuNL)1048 9a201007311110bVLOADy201005141405zVLOAD aDB/U-1dDB/N-1 bbk1 aMollan, R. C.q(R. Charles)10aIrish national inventory of historic scientific instrumentsbinterim report 1990cCharles Mollan aDublinbRoyal Dublin SocietybEOLASc1990 a809 p.c25 cm. aCover title: Irish interim inventory aBibliography. Index 0aScientific apparatus and instrumentszIrelandxPrivate collections 0aSciencezIrelandxHistory 0aSciencezIrelandxMuseums 0aTechnologyzIrelandxHistory2 aRoyal Dublin Society2 aIrish Science and Technology Agency0 aIrish interim inventory 1990 a1048 AVIRTUAITEMD90000F1X18634444000007294aIr 506 m 4oITEM TYPE : bk a25
\ No newline at end of file
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment