Demonstration of some simple ways to use the base class
()
| 37 | |
| 38 | /** Demonstration of some simple ways to use the base class */ |
| 39 | @Test |
| 40 | public void testSimple() { |
| 41 | assertU( |
| 42 | "Simple assertion that adding a document works", |
| 43 | adoc( |
| 44 | "id", "4055", |
| 45 | "subject", "Hoss the Hoss man Hostetter")); |
| 46 | |
| 47 | /* alternate syntax, no label */ |
| 48 | assertU( |
| 49 | adoc( |
| 50 | "id", "4056", |
| 51 | "subject", "Some Other Guy")); |
| 52 | |
| 53 | assertU(commit()); |
| 54 | assertU(optimize()); |
| 55 | |
| 56 | assertQ( |
| 57 | "couldn't find subject hoss", |
| 58 | req("subject:Hoss"), |
| 59 | "//result[@numFound=1]", |
| 60 | "//str[@name='id'][.='4055']"); |
| 61 | } |
| 62 | |
| 63 | /** Demonstration of some of the more complex ways to use the base class */ |
| 64 | @Test |