コード例 #1
0
 // This is in fact a DOMUtil test, but it is here for completeness
 @Test
 public void testNameRequired() throws Exception {
   Node nodeWithNoName = getNode("<plugin></plugin>", "plugin");
   AbstractSolrTestCase.ignoreException("missing mandatory attribute");
   try {
     PluginInfo pi = new PluginInfo(nodeWithNoName, "Node with No name", true, false);
     fail("Exception should have been thrown");
   } catch (RuntimeException e) {
     assertTrue(e.getMessage().contains("missing mandatory attribute"));
   } finally {
     AbstractSolrTestCase.resetExceptionIgnores();
   }
   Node nodeWithAName = getNode("<plugin name=\"myName\" />", "plugin");
   PluginInfo pi2 = new PluginInfo(nodeWithAName, "Node with a Name", true, false);
   assertTrue(pi2.name.equals("myName"));
 }
コード例 #2
0
 @Override
 public void setUp() throws Exception {
   super.setUp();
   clearIndex();
   // reload the core to clear stats
   h.getCoreContainer().reload(h.getCore().getName());
 }
コード例 #3
0
 @Test
 public void testClassRequired() throws Exception {
   Node nodeWithNoClass = getNode("<plugin></plugin>", "plugin");
   AbstractSolrTestCase.ignoreException("missing mandatory attribute");
   try {
     @SuppressWarnings("unused")
     PluginInfo pi = new PluginInfo(nodeWithNoClass, "Node with No Class", false, true);
     fail("Exception should have been thrown");
   } catch (RuntimeException e) {
     assertTrue(e.getMessage().contains("missing mandatory attribute"));
   } finally {
     AbstractSolrTestCase.resetExceptionIgnores();
   }
   Node nodeWithAClass = getNode("<plugin class=\"myName\" />", "plugin");
   PluginInfo pi2 = new PluginInfo(nodeWithAClass, "Node with a Class", false, true);
   assertTrue(pi2.className.equals("myName"));
 }
コード例 #4
0
 @Override
 public void setUp() throws Exception {
   super.setUp();
   lrf = h.getRequestFactory("standard", 0, 20);
 }
コード例 #5
0
ファイル: ZkSolrClientTest.java プロジェクト: PATRIC3/p3_solr
 @Override
 public void tearDown() throws Exception {
   super.tearDown();
 }
コード例 #6
0
 public void tearDown() throws Exception {
   // if you override setUp or tearDown, you better call
   // the super classes version
   super.tearDown();
 }
コード例 #7
0
 public void setUp() throws Exception {
   super.setUp();
 }