package fitnesse.junit;

import java.io.File;
import java.lang.Exception;

import fitnesse.junit.FitNesseRunner;
import org.junit.Test;
import org.junit.runners.model.InitializationError;
import fitnesse.junit.FitNesseSuite;

import static org.junit.Assert.*;
public class FitNesseSuiteArgumentsTest {

  @Test
  public void argumentsAreParsedCorrectly() throws Exception {
	System.setProperty("fitnesse.root.dir.parent", ".");
    FitNesseRunner suite = new FitNesseRunner(FitNesseSuiteExampleTest.class);
    assertEquals(".", suite.getFitNesseDir(FitNesseSuiteExampleTest.class));
    assertEquals(new File(System.getProperty("fitnesse.root.dir.parent")).getAbsolutePath(), suite.getFitNesseDir(FitNesseSuiteExampleFromPropertiesTest.class));
    assertEquals("FitNesse.SuiteAcceptanceTests.SuiteSlimTests", suite.getSuiteName(FitNesseSuiteExampleTest.class));
    assertEquals("tmp",suite.getOutputDir(FitNesseSuiteExampleTest.class));
    assertEquals(new File(System.getProperty("java.io.tmpdir"),"fitnesse").getAbsolutePath(),suite.getOutputDir(FitNesseSuiteExampleFromPropertiesTest.class));
    assertNull("null filter allowed", suite.getSuiteFilter(FitNesseSuiteExampleTest.class));
    assertNull("null exclude filter allowed", suite.getExcludeSuiteFilter(FitNesseSuiteExampleTest.class));
    assertEquals("testSuite", suite.getSuiteFilter(FitNesseSuiteWithFilterExampleTest.class));
    assertEquals("excludedSuite", suite.getExcludeSuiteFilter(FitNesseSuiteWithFilterExampleTest.class));
    assertEquals(true, suite.useDebugMode(FitNesseSuiteExampleTest.class));
    assertEquals(true, suite.useDebugMode(FitNesseSuiteWithFilterExampleTest.class));
    assertEquals(false, suite.useDebugMode(FitNesseSuiteExampleTestNoDebug.class));
  }
}

@@ -43,185 +43,30 @@
 le;%0A
-import java.lang.Exception;%0A%0Aimport fitnesse.junit.FitNesseRunner;%0Aimport org.junit.Test;%0Aimport org.junit.runners.model.InitializationError;%0Aimport fitnesse.junit.FitNesseSuite
+%0Aimport org.junit.Test
 ;%0A%0Ai
@@ -278,22 +278,21 @@
 FitNesse
-Runner
+Suite
  suite =
@@ -308,14 +308,13 @@
 esse
-Runner
+Suite
 (Fit
@@ -315,39 +315,32 @@
 te(FitNesseSuite
-Example
 Test.class);%0A   

Fix test