From c1fa2e87b83b4642715adced0c67ad37b1a44922 Mon Sep 17 00:00:00 2001 From: Timothy Perrett Date: Tue, 18 Aug 2009 10:23:29 +0100 Subject: [PATCH] removed redundant test from lift sample --- .../eu/getintheloop/example/AppTest.scala | 75 ------------------- 1 file changed, 75 deletions(-) delete mode 100644 samples-lift/src/test/scala/eu/getintheloop/example/AppTest.scala diff --git a/samples-lift/src/test/scala/eu/getintheloop/example/AppTest.scala b/samples-lift/src/test/scala/eu/getintheloop/example/AppTest.scala deleted file mode 100644 index babdbdd638..0000000000 --- a/samples-lift/src/test/scala/eu/getintheloop/example/AppTest.scala +++ /dev/null @@ -1,75 +0,0 @@ -package eu.getintheloop.example - -import _root_.java.io.File -import _root_.junit.framework._ -import Assert._ -import _root_.scala.xml.XML -import _root_.net.liftweb.util._ - -object AppTest { - def suite: Test = { - val suite = new TestSuite(classOf[AppTest]) - suite - } - - def main(args : Array[String]) { - _root_.junit.textui.TestRunner.run(suite) - } -} - -/** - * Unit test for simple App. - */ -class AppTest extends TestCase("app") { - - /** - * Rigourous Tests :-) - */ - def testOK() = assertTrue(true) - // def testKO() = assertTrue(false); - - /** - * Tests to make sure the project's XML files are well-formed. - * - * Finds every *.html and *.xml file in src/main/webapp (and its - * subdirectories) and tests to make sure they are well-formed. - */ - def testXml() = { - var failed: List[File] = Nil - - def handledXml(file: String) = - file.endsWith(".xml") - - def handledXHtml(file: String) = - file.endsWith(".html") || file.endsWith(".htm") || file.endsWith(".xhtml") - - def wellFormed(file: File) { - if (file.isDirectory) - for (f <- file.listFiles) wellFormed(f) - - if (file.isFile && handledXml(file.getName)) { - try { - XML.loadFile(file) - } catch { - case e: _root_.org.xml.sax.SAXParseException => failed = file :: failed - } - } - if (file.isFile && handledXHtml(file.getName)) { - PCDataXmlParser(new java.io.FileInputStream(file.getAbsolutePath)) match { - case Full(_) => // file is ok - case _ => failed = file :: failed - } - } - } - - wellFormed(new File("src/main/webapp")) - - val numFails = failed.size - if (numFails > 0) { - val fileStr = if (numFails == 1) "file" else "files" - val msg = "Malformed XML in " + numFails + " " + fileStr + ": " + failed.mkString(", ") - println(msg) - fail(msg) - } - } -}