Cleaning.
This commit is contained in:
parent
172d1ab333
commit
68684855cb
2 changed files with 36 additions and 14 deletions
|
@ -31,8 +31,6 @@ class XidDemo
|
|||
|
||||
//
|
||||
Data datas;
|
||||
IdData tag;
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -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 ("<div id='name'>a name</div >", datas, errorMessage);
|
||||
try
|
||||
{
|
||||
html = StringPresenter.doXid ("<div id='name'>a name</div >", datas);
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
System.out.println(exception.getMessage());
|
||||
html = null;
|
||||
}
|
||||
|
||||
System.out.println (check ("only content change", html, "<div id=\"name\">Superman</div>"));
|
||||
|
||||
|
@ -81,8 +86,15 @@ class XidTest
|
|||
datas.appendAttribute ("lastname", "style", "foreground: red;");
|
||||
datas.setAttribute ("lastname", "class", "nameClass");
|
||||
|
||||
errorMessage = new StringBuffer ();
|
||||
html = StringPresenter.doXid ("<div id='lastname'>a last name</div >", datas, errorMessage);
|
||||
try
|
||||
{
|
||||
html = StringPresenter.doXid ("<div id='lastname'>a last name</div >", datas);
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
System.out.println(exception.getMessage());
|
||||
html = null;
|
||||
}
|
||||
System.out.println (check ("content and attributes", html, "<div id=\"lastname\" style=\"background: blue;foreground: red;\" class=\"nameClass\">Spiderman</div>"));
|
||||
|
||||
// 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 ("<ul>\n <li id='words'>a word</li>\n</ul>", datas, errorMessage);
|
||||
try
|
||||
{
|
||||
html = StringPresenter.doXid ("<ul>\n <li id='words'>a word</li>\n</ul>", datas);
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
System.out.println(exception.getMessage());
|
||||
html = null;
|
||||
}
|
||||
|
||||
System.out.println (check ("list assertion 1", html, "<li id=\"words_0\">alpha</li>"));
|
||||
System.out.println (check ("list assertion 2", html, "<li id=\"words_1\">bravo</li>"));
|
||||
|
@ -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 ("<table>\n");
|
||||
source.append (" <tr id='identity'><td>noid</td><td id='nom'>un nom</td><td id='prenom'>un prenom</td></tr>\n");
|
||||
source.append ("</table>");
|
||||
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, "<tr id=\"identity_0\"><td>noid</td><td id=\"nom_0\">Jemba</td><td id=\"prenom_0\">Epo</td></tr>"));
|
||||
System.out.println (check ("table 1 assertion 2", html, "<tr id=\"identity_1\"><td>noid</td><td id=\"nom_1\">Momon</td><td id=\"prenom_1\">Christian</td></tr>"));
|
||||
|
|
Loading…
Reference in a new issue