From 68684855cb62ec8c7fad768744620fe0ff928460 Mon Sep 17 00:00:00 2001 From: "Christian P. MOMON" Date: Mon, 2 Aug 2010 16:00:11 +0200 Subject: [PATCH] Cleaning. --- demo/XidDemo.java | 2 -- test/XidTest.java | 48 +++++++++++++++++++++++++++++++++++------------ 2 files changed, 36 insertions(+), 14 deletions(-) diff --git a/demo/XidDemo.java b/demo/XidDemo.java index ab72782..c514389 100644 --- a/demo/XidDemo.java +++ b/demo/XidDemo.java @@ -31,8 +31,6 @@ class XidDemo // Data datas; - IdData tag; - diff --git a/test/XidTest.java b/test/XidTest.java index 18361e8..d005008 100644 --- a/test/XidTest.java +++ b/test/XidTest.java @@ -60,15 +60,20 @@ class XidTest String htmlSource; StringBuffer html; - StringBuffer errorMessage; // Populate attributes of Test 03. System.out.println ("----------------------------"); datas = new Data (); datas.setContent ("name", "Superman"); - errorMessage = new StringBuffer (); - - html = StringPresenter.doXid ("
a name
", datas, errorMessage); + try + { + html = StringPresenter.doXid ("
a name
", datas); + } + catch (Exception exception) + { + System.out.println(exception.getMessage()); + html = null; + } System.out.println (check ("only content change", html, "
Superman
")); @@ -81,8 +86,15 @@ class XidTest datas.appendAttribute ("lastname", "style", "foreground: red;"); datas.setAttribute ("lastname", "class", "nameClass"); - errorMessage = new StringBuffer (); - html = StringPresenter.doXid ("
a last name
", datas, errorMessage); + try + { + html = StringPresenter.doXid ("
a last name
", datas); + } + catch (Exception exception) + { + System.out.println(exception.getMessage()); + html = null; + } System.out.println (check ("content and attributes", html, "
Spiderman
")); // Populate attributes of Test 03. @@ -95,9 +107,15 @@ class XidTest datas.setContent ("words", 4, "echo"); datas.setContent ("words", 5, "fox"); - - errorMessage = new StringBuffer (); - html = StringPresenter.doXid ("", datas, errorMessage); + try + { + html = StringPresenter.doXid ("", datas); + } + catch (Exception exception) + { + System.out.println(exception.getMessage()); + html = null; + } System.out.println (check ("list assertion 1", html, "
  • alpha
  • ")); System.out.println (check ("list assertion 2", html, "
  • bravo
  • ")); @@ -116,14 +134,20 @@ class XidTest datas.setContent ("identity", 2, "nom", "Tronche"); datas.setContent ("identity", 2, "prenom", "Christophe"); - - errorMessage = new StringBuffer (); StringBuffer source = new StringBuffer (); source.append ("\n"); source.append (" \n"); source.append ("
    noidun nomun prenom
    "); htmlSource = source.toString (); - html = StringPresenter.doXid (htmlSource, datas, errorMessage); + try + { + html = StringPresenter.doXid (htmlSource, datas); + } + catch (Exception exception) + { + System.out.println(exception.getMessage()); + html = null; + } System.out.println (check ("table 1 assertion 1", html, "noidJembaEpo")); System.out.println (check ("table 1 assertion 2", html, "noidMomonChristian"));