package org.apache.solr.core;

import java.io.IOException;

import org.apache.lucene.index.IndexWriter;
import org.apache.lucene.index.LogDocMergePolicy;
import org.apache.lucene.index.SerialMergeScheduler;
import org.apache.solr.update.DirectUpdateHandler2;
import org.apache.solr.util.AbstractSolrTestCase;

public class TestLegacyMergeSchedulerPolicyConfig extends AbstractSolrTestCase {
  public String getSchemaFile() {
    return "schema.xml";
  }

  public String getSolrConfigFile() {
    return "solrconfig-legacy.xml";
  }
  
  public void testLegacy() throws Exception {
    IndexWriter writer = new ExposeWriterHandler().getWriter();
    assertTrue(writer.getMergePolicy().getClass().getName().equals(LogDocMergePolicy.class.getName()));
    assertTrue(writer.getMergeScheduler().getClass().getName().equals(SerialMergeScheduler.class.getName()));
  }
  
  class ExposeWriterHandler extends DirectUpdateHandler2 {
    public ExposeWriterHandler() throws IOException {
      super(h.getCore());
    }

    public IndexWriter getWriter() throws IOException {
      forceOpenWriter();
      return writer;
    }
  }
}

@@ -196,24 +196,63 @@
 eScheduler;%0A
+import org.apache.solr.SolrTestCaseJ4;%0A
 import org.a
@@ -306,45 +306,48 @@
 org.
-apache.solr.util.AbstractSolrTestCase
+junit.BeforeClass;%0Aimport org.junit.Test
 ;%0A%0Ap
@@ -407,16 +407,8 @@
 nds 
-Abstract
 Solr
@@ -419,124 +419,95 @@
 Case
+J4
  %7B%0A  
-public String getSchemaFile() %7B%0A    return %22schema.xml%22;%0A  %7D%0A%0A  public String getSolrConfigFile() %7B%0A    return 
+@BeforeClass%0A  public static void beforeClass() throws Exception %7B%0A    initCore(
 %22sol
@@ -525,24 +525,45 @@
 acy.xml%22
+, %22schema.xml%22)
 ;%0A  %7D%0A
+%0A
   
+@Test
 %0A  publi

convert to junit4