當前位置: 首頁>>代碼示例>>Java>>正文


Java ExternalPaths類代碼示例

本文整理匯總了Java中org.apache.solr.util.ExternalPaths的典型用法代碼示例。如果您正苦於以下問題:Java ExternalPaths類的具體用法?Java ExternalPaths怎麽用?Java ExternalPaths使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


ExternalPaths類屬於org.apache.solr.util包,在下文中一共展示了ExternalPaths類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: setUp

import org.apache.solr.util.ExternalPaths; //導入依賴的package包/類
@Override
@Before
public void setUp() throws Exception {
  super.setUp();
  dataDir1 = createTempDir();
  dataDir2  = createTempDir();

  home = ExternalPaths.EXAMPLE_MULTICORE_HOME;
  System.setProperty("solr.solr.home", home);
  System.setProperty( "solr.core0.data.dir", dataDir1.getCanonicalPath() ); 
  System.setProperty( "solr.core1.data.dir", dataDir2.getCanonicalPath() ); 
  
  zkDir = dataDir1.getAbsolutePath() + File.separator
      + "zookeeper/server1/data";
  zkServer = new ZkTestServer(zkDir);
  zkServer.run();
  
  SolrZkClient zkClient = new SolrZkClient(zkServer.getZkHost(), AbstractZkTestCase.TIMEOUT);
  zkClient.makePath("/solr", false, true);
  zkClient.close();
  
  System.setProperty("zkHost", zkServer.getZkAddress());
}
 
開發者ID:europeana,項目名稱:search,代碼行數:24,代碼來源:TestMultiCoreConfBootstrap.java

示例2: testBootstrap

import org.apache.solr.util.ExternalPaths; //導入依賴的package包/類
@Test
public void testBootstrap() throws Exception {
  // test bootstrap_conf
  String[] args = new String[] {"-zkhost", zkServer.getZkAddress(), "-cmd",
      "bootstrap", "-solrhome", this.solrHome};
  ZkCLI.main(args);
  
  assertTrue(zkClient.exists(ZkController.CONFIGS_ZKNODE + "/collection1", true));
  
  args = new String[] {"-zkhost", zkServer.getZkAddress(), "-cmd",
      "bootstrap", "-solrhome", ExternalPaths.EXAMPLE_MULTICORE_HOME};
  ZkCLI.main(args);
  
  assertTrue(zkClient.exists(ZkController.CONFIGS_ZKNODE + "/core0", true));
  assertTrue(zkClient.exists(ZkController.CONFIGS_ZKNODE + "/core1", true));
}
 
開發者ID:europeana,項目名稱:search,代碼行數:17,代碼來源:ZkCLITest.java

示例3: setUp

import org.apache.solr.util.ExternalPaths; //導入依賴的package包/類
@Override
@Before
public void setUp() throws Exception {
  super.setUp();
  
  createTempDir();
  dataDir2 = new File(TEMP_DIR, getSimpleClassName() + "-core1-"
      + System.currentTimeMillis());
  dataDir2.mkdirs();

  home = ExternalPaths.EXAMPLE_MULTICORE_HOME;
  System.setProperty("solr.solr.home", home);
  System.setProperty( "solr.core0.data.dir", dataDir.getCanonicalPath() ); 
  System.setProperty( "solr.core1.data.dir", dataDir2.getCanonicalPath() ); 
  
  zkDir = dataDir.getAbsolutePath() + File.separator
      + "zookeeper/server1/data";
  zkServer = new ZkTestServer(zkDir);
  zkServer.run();
  
  SolrZkClient zkClient = new SolrZkClient(zkServer.getZkHost(), AbstractZkTestCase.TIMEOUT);
  zkClient.makePath("/solr", false, true);
  zkClient.close();
  
  System.setProperty("zkHost", zkServer.getZkAddress());
}
 
開發者ID:pkarmstr,項目名稱:NYBC,代碼行數:27,代碼來源:TestMultiCoreConfBootstrap.java

示例4: testBootstrap

import org.apache.solr.util.ExternalPaths; //導入依賴的package包/類
@Test
public void testBootstrap() throws Exception {
  // test bootstrap_conf
  String[] args = new String[] {"-zkhost", zkServer.getZkAddress(), "-cmd",
      "bootstrap", "-solrhome", ExternalPaths.EXAMPLE_HOME};
  ZkCLI.main(args);
  
  assertTrue(zkClient.exists(ZkController.CONFIGS_ZKNODE + "/collection1", true));
  
  args = new String[] {"-zkhost", zkServer.getZkAddress(), "-cmd",
      "bootstrap", "-solrhome", ExternalPaths.EXAMPLE_MULTICORE_HOME};
  ZkCLI.main(args);
  
  assertTrue(zkClient.exists(ZkController.CONFIGS_ZKNODE + "/core0", true));
  assertTrue(zkClient.exists(ZkController.CONFIGS_ZKNODE + "/core1", true));
}
 
開發者ID:pkarmstr,項目名稱:NYBC,代碼行數:17,代碼來源:ZkCLITest.java

示例5: setUp

import org.apache.solr.util.ExternalPaths; //導入依賴的package包/類
@Override
public void setUp() throws Exception 
{
  super.setUp();
  System.setProperty("solr.solr.home", ExternalPaths.EXAMPLE_HOME);
  System.setProperty("tests.shardhandler.randomSeed", Long.toString(random().nextLong()));

  File dataDir = createTempDir();
  dataDir.mkdirs();

  System.setProperty("solr.data.dir", dataDir.getCanonicalPath());
  String path = ExternalPaths.WEBAPP_HOME;

  server = new Server(port);
  // insecure: only use for tests!!!!
  server.setSessionIdManager(new HashSessionIdManager(new Random(random().nextLong())));
  new WebAppContext(server, path, context );

  SocketConnector connector = new SocketConnector();
  connector.setMaxIdleTime(1000 * 60 * 60);
  connector.setSoLingerTime(-1);
  connector.setPort(0);
  server.setConnectors(new Connector[]{connector});
  server.setStopAtShutdown( true );
  
  server.start();
  port = connector.getLocalPort();
}
 
開發者ID:europeana,項目名稱:search,代碼行數:29,代碼來源:JettyWebappTest.java

示例6: beforeTest

import org.apache.solr.util.ExternalPaths; //導入依賴的package包/類
@BeforeClass
public static void beforeTest() throws Exception {
  createJetty(ExternalPaths.EXAMPLE_HOME, null, null);
  jetty.getDispatchFilter().getServletHandler()
      .addServletWithMapping(RedirectServlet.class, "/redirect/*");
  jetty.getDispatchFilter().getServletHandler()
      .addServletWithMapping(SlowServlet.class, "/slow/*");
  jetty.getDispatchFilter().getServletHandler()
      .addServletWithMapping(DebugServlet.class, "/debug/*");
}
 
開發者ID:europeana,項目名稱:search,代碼行數:11,代碼來源:BasicHttpSolrServerTest.java

示例7: setUp

import org.apache.solr.util.ExternalPaths; //導入依賴的package包/類
@Override
@Before
public void setUp() throws Exception {
  super.setUp();

  zkDir = createTempDir("zkData").getAbsolutePath();
  zkServer = new ZkTestServer(zkDir);
  zkServer.run();
  home = ExternalPaths.EXAMPLE_HOME;
  
}
 
開發者ID:europeana,項目名稱:search,代碼行數:12,代碼來源:TestZkChroot.java

示例8: setUp

import org.apache.solr.util.ExternalPaths; //導入依賴的package包/類
@Override
public void setUp() throws Exception {
  super.setUp();
  log.info("####SETUP_START " + getTestName());
  
  boolean useNewSolrXml = random().nextBoolean();
  File tmpDir = createTempDir();
  if (useNewSolrXml) {
    solrHome = ExternalPaths.EXAMPLE_HOME;
  } else {
    File tmpSolrHome = new File(tmpDir, "tmp-solr-home");
    FileUtils.copyDirectory(new File(ExternalPaths.EXAMPLE_HOME), tmpSolrHome);
    FileUtils.copyFile(getFile("old-solr-example/solr.xml"), new File(tmpSolrHome, "solr.xml"));
    solrHome = tmpSolrHome.getAbsolutePath();
  }
  
  
  zkDir = tmpDir.getAbsolutePath() + File.separator
      + "zookeeper/server1/data";
  log.info("ZooKeeper dataDir:" + zkDir);
  zkServer = new ZkTestServer(zkDir);
  zkServer.run();
  System.setProperty("zkHost", zkServer.getZkAddress());
  SolrZkClient zkClient = new SolrZkClient(zkServer.getZkHost(), AbstractZkTestCase.TIMEOUT);
  zkClient.makePath("/solr", false, true);
  zkClient.close();

  
  this.zkClient = new SolrZkClient(zkServer.getZkAddress(),
      AbstractZkTestCase.TIMEOUT);
  
  log.info("####SETUP_END " + getTestName());
}
 
開發者ID:europeana,項目名稱:search,代碼行數:34,代碼來源:ZkCLITest.java

示例9: setUp

import org.apache.solr.util.ExternalPaths; //導入依賴的package包/類
@Override
public void setUp() throws Exception 
{
  super.setUp();
  System.setProperty("solr.solr.home", ExternalPaths.EXAMPLE_HOME);
  
  File dataDir = new File(LuceneTestCase.TEMP_DIR,
      getClass().getName() + "-" + System.currentTimeMillis());
  dataDir.mkdirs();
  System.setProperty("solr.data.dir", dataDir.getCanonicalPath());
  String path = ExternalPaths.WEBAPP_HOME;

  server = new Server(port);
  // insecure: only use for tests!!!!
  server.setSessionIdManager(new HashSessionIdManager(new Random(random().nextLong())));
  new WebAppContext(server, path, context );

  SocketConnector connector = new SocketConnector();
  connector.setMaxIdleTime(1000 * 60 * 60);
  connector.setSoLingerTime(-1);
  connector.setPort(0);
  server.setConnectors(new Connector[]{connector});
  server.setStopAtShutdown( true );
  
  server.start();
  port = connector.getLocalPort();
}
 
開發者ID:pkarmstr,項目名稱:NYBC,代碼行數:28,代碼來源:JettyWebappTest.java

示例10: setUp

import org.apache.solr.util.ExternalPaths; //導入依賴的package包/類
@Override
@Before
public void setUp() throws Exception {
  super.setUp();
  createTempDir();
  zkDir = dataDir.getAbsolutePath() + File.separator
      + "zookeeper/server1/data";
  zkServer = new ZkTestServer(zkDir);
  zkServer.run();
  home = ExternalPaths.EXAMPLE_HOME;
  
}
 
開發者ID:pkarmstr,項目名稱:NYBC,代碼行數:13,代碼來源:TestZkChroot.java

示例11: testBootstrapWithChroot

import org.apache.solr.util.ExternalPaths; //導入依賴的package包/類
@Test
public void testBootstrapWithChroot() throws Exception {
  String chroot = "/foo/bar";
  assertFalse(zkClient.exists(chroot, true));
  
  String[] args = new String[] {"-zkhost", zkServer.getZkAddress() + chroot,
      "-cmd", "bootstrap", "-solrhome", ExternalPaths.EXAMPLE_HOME};
  
  ZkCLI.main(args);
  
  assertTrue(zkClient.exists(chroot + ZkController.CONFIGS_ZKNODE
      + "/collection1", true));
}
 
開發者ID:pkarmstr,項目名稱:NYBC,代碼行數:14,代碼來源:ZkCLITest.java

示例12: beforeTest

import org.apache.solr.util.ExternalPaths; //導入依賴的package包/類
@BeforeClass
public static void beforeTest() throws Exception {
  createJetty(ExternalPaths.EXAMPLE_HOME, null, null);
}
 
開發者ID:europeana,項目名稱:search,代碼行數:5,代碼來源:SolrExampleBinaryTest.java

示例13: beforeTest

import org.apache.solr.util.ExternalPaths; //導入依賴的package包/類
@BeforeClass
public static void beforeTest() throws Exception {
  initCore(ExternalPaths.EXAMPLE_CONFIG, ExternalPaths.EXAMPLE_SCHEMA,
      ExternalPaths.EXAMPLE_HOME);
}
 
開發者ID:europeana,項目名稱:search,代碼行數:6,代碼來源:LargeVolumeEmbeddedTest.java

示例14: beforeTest

import org.apache.solr.util.ExternalPaths; //導入依賴的package包/類
@BeforeClass
public static void beforeTest() throws Exception {
  initCore(ExternalPaths.EXAMPLE_CONFIG, ExternalPaths.EXAMPLE_SCHEMA, ExternalPaths.EXAMPLE_HOME);
}
 
開發者ID:europeana,項目名稱:search,代碼行數:5,代碼來源:SolrExampleEmbeddedTest.java

示例15: beforeTest

import org.apache.solr.util.ExternalPaths; //導入依賴的package包/類
@BeforeClass
public static void beforeTest() throws Exception {
  createJetty(ExternalPaths.EXAMPLE_SCHEMALESS_HOME, null, null);
}
 
開發者ID:europeana,項目名稱:search,代碼行數:5,代碼來源:SolrSchemalessExampleTests.java


注:本文中的org.apache.solr.util.ExternalPaths類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。