Java Doc for AbstractSolrTestCase.java in  » Search-Engine » apache-solr-1.2.0 » org » apache » solr » util » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Search Engine » apache solr 1.2.0 » org.apache.solr.util 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.apache.solr.util.AbstractSolrTestCase

All known Subclasses:   org.apache.solr.schema.BadIndexSchemaTest,  org.apache.solr.search.TestQueryUtils,  org.apache.solr.core.SolrCoreTest,  org.apache.solr.servlet.DirectSolrConnectionTest,  org.apache.solr.handler.TestCSVLoader,  org.apache.solr.servlet.SolrRequestParserTest,  org.apache.solr.schema.IndexSchemaTest,  org.apache.solr.EchoParamsTest,  org.apache.solr.core.TestBadConfig,  org.apache.solr.handler.StandardRequestHandlerTest,  org.apache.solr.update.DirectUpdateHandlerTest,  org.apache.solr.schema.RequiredFieldsTest,  org.apache.solr.SampleTest,  org.apache.solr.update.AutoCommitTest,  org.apache.solr.core.RequestHandlersTest,  org.apache.solr.OutputWriterTest,  org.apache.solr.BasicFunctionalityTest,  org.apache.solr.core.TestConfig,  org.apache.solr.DisMaxRequestHandlerTest,  org.apache.solr.schema.NotRequiredUniqueKeyTest,  org.apache.solr.analysis.TestWordDelimiterFilter,  org.apache.solr.ConvertedLegacyTest,  org.apache.solr.HighlighterTest,  org.apache.solr.util.SolrPluginUtilsTest,
AbstractSolrTestCase
abstract public class AbstractSolrTestCase extends TestCase (Code)
An Abstract base class that makes writing Solr JUnit tests "easier"

Test classes that subclass this need only specify the path to the schema.xml file (:TODO: the solrconfig.xml as well) and write some testMethods. This class takes care of creating/destroying the index, and provides several assert methods to assist you.


See Also:   AbstractSolrTestCase.setUp
See Also:   AbstractSolrTestCase.tearDown

Inner Class :public static class Doc

Field Summary
protected  FiledataDir
    
protected  TestHarnessh
     Harness initialized by initTestHarness.
protected  TestHarness.LocalRequestFactorylrf
     LocalRequestFactory initialized by initTestHarness using sensible defaults.


Method Summary
public  Stringadd(Doc doc, String... args)
     Generates an <add><doc>...
public  Stringadoc(String... fieldsAndValues)
     Generates a simple <add><doc>...
public  voidassertFailedU(String update)
    
public  voidassertFailedU(String message, String update)
    
public  voidassertQ(SolrQueryRequest req, String... tests)
    
public  voidassertQ(String message, SolrQueryRequest req, String... tests)
    
public  voidassertQEx(String message, SolrQueryRequest req, int code)
    
public  voidassertU(String update)
    
public  voidassertU(String message, String update)
    
public  Stringcommit(String... args)
    
public  StringdelI(String id)
     Generates a <delete>...
public  StringdelQ(String q)
     Generates a <delete>...
public  Docdoc(String... fieldsAndValues)
     Generates a simple <doc>...
abstract public  StringgetSchemaFile()
     Subclasses must define this method to return the name of the schema.xml they wish to use.
abstract public  StringgetSolrConfigFile()
     Subclasses must define this method to return the name of the solrconfig.xml they wish to use.
public  Stringoptimize(String... args)
    
public static  booleanrecurseDelete(File f)
    
public  SolrQueryRequestreq(String... q)
    
public  SolrQueryRequestreq(String[] params, String... moreParams)
    
public  voidsetUp()
    
public  voidtearDown()
     Shuts down the test harness, and makes the best attempt possible to delete dataDir, unless the system property "solr.test.leavedatadir" is set.

Field Detail
dataDir
protected File dataDir(Code)
The directory used to story the index managed by the TestHarness h



h
protected TestHarness h(Code)
Harness initialized by initTestHarness.

For use in test methods as needed.




lrf
protected TestHarness.LocalRequestFactory lrf(Code)
LocalRequestFactory initialized by initTestHarness using sensible defaults.

For use in test methods as needed.






Method Detail
add
public String add(Doc doc, String... args)(Code)
Generates an <add><doc>... XML String with options on the add.
Parameters:
  doc - the Document to add
Parameters:
  args - 0th and Even numbered args are param names, Odds are param values.
See Also:   AbstractSolrTestCase.add
See Also:   AbstractSolrTestCase.doc



adoc
public String adoc(String... fieldsAndValues)(Code)
Generates a simple <add><doc>... XML String with no options
Parameters:
  fieldsAndValues - 0th and Even numbered args are fields names odds are field values.
See Also:   AbstractSolrTestCase.add
See Also:   AbstractSolrTestCase.doc



assertFailedU
public void assertFailedU(String update)(Code)
Validates an update XML String failed



assertFailedU
public void assertFailedU(String message, String update)(Code)
Validates an update XML String failed



assertQ
public void assertQ(SolrQueryRequest req, String... tests)(Code)
Validates a query matches some XPath test expressions and closes the query



assertQ
public void assertQ(String message, SolrQueryRequest req, String... tests)(Code)
Validates a query matches some XPath test expressions and closes the query



assertQEx
public void assertQEx(String message, SolrQueryRequest req, int code)(Code)
Makes sure a query throws a SolrException with the listed response code



assertU
public void assertU(String update)(Code)
Validates an update XML String is successful



assertU
public void assertU(String message, String update)(Code)
Validates an update XML String is successful



commit
public String commit(String... args)(Code)

See Also:   TestHarness.commit



delI
public String delI(String id)(Code)
Generates a <delete>... XML string for an ID
See Also:   TestHarness.deleteById



delQ
public String delQ(String q)(Code)
Generates a <delete>... XML string for an query
See Also:   TestHarness.deleteByQuery



doc
public Doc doc(String... fieldsAndValues)(Code)
Generates a simple <doc>... XML String with no options
Parameters:
  fieldsAndValues - 0th and Even numbered args are fields names, Odds are field values.
See Also:   TestHarness.makeSimpleDoc



getSchemaFile
abstract public String getSchemaFile()(Code)
Subclasses must define this method to return the name of the schema.xml they wish to use.



getSolrConfigFile
abstract public String getSolrConfigFile()(Code)
Subclasses must define this method to return the name of the solrconfig.xml they wish to use.



optimize
public String optimize(String... args)(Code)

See Also:   TestHarness.optimize



recurseDelete
public static boolean recurseDelete(File f)(Code)



req
public SolrQueryRequest req(String... q)(Code)
Generates a SolrQueryRequest using the LocalRequestFactory
See Also:   AbstractSolrTestCase.lrf



req
public SolrQueryRequest req(String[] params, String... moreParams)(Code)
Generates a SolrQueryRequest using the LocalRequestFactory
See Also:   AbstractSolrTestCase.lrf



setUp
public void setUp() throws Exception(Code)
Initializes things your test might need
  • Creates a dataDir in the "java.io.tmpdir"
  • initializes the TestHarness h using this data directory, and getSchemaPath()
  • initializes the LocalRequestFactory lrf using sensible defaults.



tearDown
public void tearDown() throws Exception(Code)
Shuts down the test harness, and makes the best attempt possible to delete dataDir, unless the system property "solr.test.leavedatadir" is set.



www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.