当前位置: 首页>>代码示例>>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;未经允许,请勿转载。