package com.adobe.epubcheck.test;

import org.junit.*;

public class xhtml_Test
{
  private SecurityManager originalManager;

  @Before
  public void setUp() throws Exception
  {
    this.originalManager = System.getSecurityManager();
    System.setSecurityManager(new NoExitSecurityManager());
  }

  @After
  public void tearDown() throws Exception
  {
    System.setSecurityManager(this.originalManager);
  }

  @Test
  public void hyperlinksTest() throws Exception
  {
    runXhtmlTest("hyperlinks", 1);
  }

  @Test
  public void nestingTest() throws Exception
  {
    runXhtmlTest("nesting", 0);
  }

  @Test
  public void html5_epub2Test() throws Exception
  {
    runXhtmlTest("html5_epub2", 1);
  }

  @Test
  public void html5_epub3Test() throws Exception
  {
    runXhtmlTest("html5_epub3", 1);
  }

  @Test
  public void html5_deprecated_epub3Test() throws Exception
  {
    runXhtmlTest("html5_deprecated_epub3", 1);
  }

  @Test
  public void lang_Test() throws Exception
  {
    runXhtmlTest("lang", 1);
  }

  @Test
  public void epubcfi_Test() throws Exception
  {
    runXhtmlTest("epubcfi", 0);
  }

  @Test
  public void external_media_test()
  {
    runXhtmlTest("External_media", 0);
  }

  @Test
  public void dtd_test()
  {
    runXhtmlTest("dtd", 1);
  }

  @Test
  public void media_overlays_test()
  {
    runXhtmlTest("media_overlays", 1);
  }

  @Test
  public void accessibility_test()
  {
    runXhtmlTest("accessibility", 1);
  }

  @Test
  public void namespaces_test()
  {
    runXhtmlTest("namespaces", 1);
  }

  @Test
  public void singleline_test()
  {
    runXhtmlTest("singleline", 1);
  }

  private void runXhtmlTest(String testName, int expectedReturnCode)
  {
    common.runExpTest("xhtml", testName, expectedReturnCode, true);
  }
}

@@ -47,16 +47,41 @@
 junit.*;
+%0Aimport java.util.Locale;
 %0A%0Apublic
@@ -142,16 +142,49 @@
 Manager;
+%0A  private Locale originalLocale;
 %0A%0A  @Bef
@@ -346,16 +346,97 @@
 ger());%0A
+    this.originalLocale = Locale.getDefault();%0A    Locale.setDefault(Locale.US);%0A
   %7D%0A%0A  @
@@ -540,16 +540,60 @@
 nager);%0A
+    Locale.setDefault(this.originalLocale);%0A
   %7D%0A%0A  @

fix locale-sensitive test; set locale as Locale.US in com.adobe.epubcheck.test.xhtml_Test