autoprops setup

git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@809516 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Noble Paul 2009-08-31 09:25:54 +00:00
parent 325f20fc50
commit aad563a397
1 changed files with 47 additions and 52 deletions

View File

@ -28,7 +28,6 @@ import org.apache.commons.io.IOUtils;
import java.io.*; import java.io.*;
import java.util.Properties; import java.util.Properties;
import junit.framework.TestCase;
/** /**
* <p> Test for Loading core properties from a properties file </p> * <p> Test for Loading core properties from a properties file </p>
@ -43,8 +42,6 @@ public class TestSolrCoreProperties extends AbstractSolrTestCase {
@Override @Override
public void setUp() throws Exception { public void setUp() throws Exception {
// System.setProperty("foo.foo1", "f1");
// System.setProperty("foo.foo2", "f2");
setUpMe(); setUpMe();
System.setProperty("solr.solr.home", getHomeDir()); System.setProperty("solr.solr.home", getHomeDir());
System.setProperty("solr.data.dir", getDataDir()); System.setProperty("solr.data.dir", getDataDir());
@ -71,7 +68,6 @@ public class TestSolrCoreProperties extends AbstractSolrTestCase {
} }
File homeDir; File homeDir;
File confDir; File confDir;
@ -125,17 +121,16 @@ public class TestSolrCoreProperties extends AbstractSolrTestCase {
f = new File(confDir, "schema.xml"); f = new File(confDir, "schema.xml");
copyFile(new File(getSchemaFile()), f); copyFile(new File(getSchemaFile()), f);
Properties p = new Properties(); Properties p = new Properties();
p.setProperty("foo.foo1","f1"); p.setProperty("foo.foo1", "f1");
p.setProperty("foo.foo2","f2"); p.setProperty("foo.foo2", "f2");
FileOutputStream fos = new FileOutputStream(confDir + File.separator + "solrcore.properties"); FileOutputStream fos = new FileOutputStream(confDir + File.separator + "solrcore.properties");
p.store(fos,null); p.store(fos, null);
fos.close(); fos.close();
IOUtils.closeQuietly(fos); IOUtils.closeQuietly(fos);
} }
private void copyFile(File src, File dst) throws IOException { private void copyFile(File src, File dst) throws IOException {
BufferedReader in = new BufferedReader(new FileReader(src)); BufferedReader in = new BufferedReader(new FileReader(src));
Writer out = new FileWriter(dst); Writer out = new FileWriter(dst);