EXT2 view not displaying.

7 views
Skip to first unread message

John Whish

unread,
Oct 22, 2009, 5:58:55 AM10/22/09
to mxunit
Hi,

I hope you can shed some light on this. Is there any reason why a test
run in the browser shows correctly when using the HTML output, but
renders incorrectly when using the EXT2 version?

This shows correctly:
http://localhost/cb_skeleton/test/integration/generalTest.cfc?method=runTestRemote&output=html

Doesn't display properly:
http://localhost/cb_skeleton/test/integration/generalTest.cfc?method=runTestRemote

I have run http://localhost/mxunit/PluginDemoTests/HodgePodgeTest.cfc?method=RunTestRemote
which shows the EXT2 version correctly, so I don't know if there is
some weird variable in the test which is throwing it out.

This is the (first part) of HTML source, as you can see it's missing
the <script> tags between <body> and a_output[1].

<script src="/mxunit/resources/ext2/adapter/ext/ext-base.js"></
script>
<script src="/mxunit/resources/ext2/ext-all.js"></script>
<link rel="stylesheet" type="text/css" href="/mxunit/resources/
ext2/resources/css/ext-all.css" />
<style>
.failure{font-weight:bold;color:darkblue;}
.error{font-weight:bold;color:darkred;}
.success{font-weight:bold;color:darkgreen;}
.bodypad{padding-left:25px;padding-right:25px;;padding-top:10px;}
.x-grid3-header-offset{width:auto;}
.x-grid3-hd-inner{font-weight:bold;}
.header{padding-bottom: 5px; font-family: Verdana;}
h1{font-size: 1em; padding: 10px; color:darkblue; font-
weight:bold;}
.modelink{font-size: 10pt; font-family: Verdana;
position:relative; padding: 10px;}

</style>
<body>a_output[1] = ''; a_output[1] = a_output[1] + '<table class=
\"cfdump_array\"> <tr><th class=\"array\" colspan=\"2\" onClick=
\"cfdump_toggleTable(this);\" style=\"cursor:pointer;\" title=\"click
to collapse\">Debug Output - array </th></tr> <tr><td class=\"array\"
onClick=\"cfdump_toggleRow(this);\" style=\"cursor:pointer;\" title=
\"click to collapse\">1</td> <td> <table class=\"cfdump_struct\">
<tr><th class=\"struct\" colspan=\"2\" onClick=\"cfdump_toggleTable
(this);\" style=\"cursor:pointer;\" title=\"click to collapse\">Debug
Output - struct</th></tr> <tr> <td class=\"struct\" onClick=
\"cfdump_toggleRow(this);\" style=\"cursor:pointer;\" title=\"click to
collapse\">cbox_handler_results</td> <td> [empty string] </td> </tr>
<tr> <td class=\"struct\" onClick=\"cfdump_toggleRow(this);\" style=
\"cursor:pointer;\" title=\"click to collapse\">e</td> <td>
General.index </td> </tr> <tr> <td class=\"struct\" onClick=
\"cfdump_toggleRow(this);\" style=\"cursor:pointer;\" title=\"click to
collapse\">method</td> <td> runTestRemote </td> </tr> <tr> <td class=
\"struct\" onClick=\"cfdump_toggleRow(this);\" style=\"cursor:pointer;
\" title=\"click to collapse\">output</td> <td> extjs </td> </tr> <tr>
<td class=\"struct\" onClick=\"cfdump_toggleRow(this);\" style=
\"cursor:pointer;\" title=\"click to collapse\">setNextEvent</td> <td>
general.index </td> </tr> <tr> <td class=\"struct\" onClick=
\"cfdump_toggleRow(this);\" style=\"cursor:pointer;\" title=\"click to
collapse\">setNextEvent_addToken</td> <td> false </td> </tr> <tr> <td
class=\"struct\" onClick=\"cfdump_toggleRow(this);\" style=
\"cursor:pointer;\" title=\"click to collapse\">setNextEvent_baseURL</
td> <td> [empty string] </td> </tr> <tr> <td class=\"struct\" onClick=
\"cfdump_toggleRow(this);\" style=\"cursor:pointer;\" title=\"click to
collapse\">setNextEvent_persistKeys</td> <td> [empty string] </td> </
tr> <tr> <td class=\"struct\" onClick=\"cfdump_toggleRow(this);\"
style=\"cursor:pointer;\" title=\"click to collapse
\">setNextEvent_persistVarStruct</td> <td> <table class=\"cfdump_struct
\"> <tr><th class=\"struct\" colspan=\"2\" onClick=\"cfdump_toggleTable
(this);\" style=\"cursor:pointer;\" title=\"click to collapse\">Debug
Output - struct [empty]</th></tr> </table> </td> </tr> <tr> <td class=
\"struct\" onClick=\"cfdump_toggleRow(this);\" style=\"cursor:pointer;
\" title=\"click to collapse\">setNextEvent_postProcessExempt</td>
<td> false </td> </tr> <tr> <td class=\"struct\" onClick=
\"cfdump_toggleRow(this);\" style=\"cursor:pointer;\" title=\"click to
collapse\">setNextEvent_queryString</td> <td> [empty string] </td> </
tr> <tr> <td class=\"struct\" onClick=\"cfdump_toggleRow(this);\"
style=\"cursor:pointer;\" title=\"click to collapse
\">setNextEvent_ssl</td> <td> false </td> </tr> </table> </td></tr> </
table>';a_output[2] = ''; a_output[2] = a_output[2] + '<table class=
\"cfdump_array\"> <tr><th class=\"array\" colspan=\"2\" onClick=
\"cfdump_toggleTable(this);\" style=\"cursor:pointer;\" title=\"click
to collapse\">Debug Output - array </th></tr> <tr><td class=\"array\"
onClick=\"cfdump_toggleRow(this);\" style=\"cursor:pointer;\" title=
\"click to collapse\">1</td> <td> <table class=\"cfdump_struct\">
<tr><th class=\"struct\" colspan=\"2\" onClick=\"cfdump_toggleTable
(this);\" style=\"cursor:pointer;\" title=\"click to collapse\">Debug
Output - struct</th></tr> <tr> <td class=\"struct\" onClick=
\"cfdump_toggleRow(this);\" style=\"cursor:pointer;\" title=\"click to
collapse\">currentLayout</td> <td> Layout.Main.cfm </td> </tr> <tr>
<td class=\"struct\" onClick=\"cfdump_toggleRow(this);\" style=
\"cursor:pointer;\" title=\"click to collapse\">currentView</td> <td>
home </td> </tr> <tr> <td class=\"struct\" onClick=\"cfdump_toggleRow
(this);\" style=\"cursor:pointer;\" title=\"click to collapse\">e</td>
<td> General.index </td> </tr> <tr> <td class=\"struct\" onClick=
\"cfdump_toggleRow(this);\" style=\"cursor:pointer;\" title=\"click to
collapse\">method</td> <td> runTestRemote </td> </tr> <tr> <td class=
\"struct\" onClick=\"cfdump_toggleRow(this);\" style=\"cursor:pointer;
\" title=\"click to collapse\">output</td> <td> extjs </td> </tr> <tr>
<td class=\"struct\" onClick=\"cfdump_toggleRow(this);\" style=
\"cursor:pointer;\" title=\"click to collapse\">welcomeMessage</td>
<td> Welcome to ColdBox! </td> </tr> </table> </td></tr> </table>';/
mxunit/resources/ext2[1,'cb_skeleton.test.integration.generalTest','<a
href=\'/cb_skeleton/test/integration/generalTest.cfc?
testMethod=testdoSomething&method=runTestRemote&output=extjs
\'>testdoSomething</a>','Passed',266,'','<a href="javascript:showOutput
(1)">View output</a>'],
[2,'cb_skeleton.test.integration.generalTest','<a href=\'/cb_skeleton/
test/integration/generalTest.cfc?
testMethod=testindex&method=runTestRemote&output=extjs\'>testindex</
a>','Passed',250,'','<a href="javascript:showOutput(2)">View output</
a>']D484F784-1AA0-D8BE-7D7503B6C03B6BFE
<div id="modelink_D484F784-1AA0-D8BE-7D7503B6C03B6BFE"
class="modelink">

(<a href="?method=runTestRemote&output=html">view in normal html
mode</a>)
</div>

John Whish

unread,
Oct 22, 2009, 6:31:28 AM10/22/09
to mxunit
OK, After some step debugging I found out what it is. The HTML
returned from the getHTMLResults method in EXTTestResult is only
showing the code that has cfoutput tags around it. So I guess
somewhere in either the application or the ColdBox 3 MXunit
integration code, there is a cfsetting enablecfoutputonly tag which is
suppressing the output. To solve it I simply modified the
cfsavecontent so that all the code is wrapped in cfoutput tags.

Here is the modified method:

<cfsavecontent variable="strOutput">
<cfoutput>
<script language="javascript">
var a_output = new Array();
</cfoutput>
<cfloop from="1" to="#ArrayLen(results)#" index="i">
<cfoutput>a_output[#i#] = '#stripDump(results[i].content)#'; </
cfoutput>
<cfif ArrayLen(results[i].debug)>
<cfsavecontent variable="debugcontent">
<cfdump var="#results[i].debug#" label="Debug Output">
</cfsavecontent>
<cfoutput>a_output[#i#] = a_output[#i#] + '#stripDump
(debugcontent)#';</cfoutput>
</cfif>
</cfloop>

<cfoutput>
function showOutput(row){
win = new Ext.Window(
{
autoScroll:true,
modal:false,
maximizable:true,
title:"Debug Output",
constrain:true,
html:a_output[row]
}
);
win.show();
}


Ext.onReady(function(){
Ext.BLANK_IMAGE_URL = "#extroot#/resources/images/default/
s.gif";
Ext.QuickTips.init();
Ext.apply(Ext.QuickTips.getQuickTip(), {
maxWidth: 500,
minWidth: 100,
showDelay: 100,
trackMouse: true
});

var allData = [
#resultsToJS(testresult.getResults())#
];

var problemData = [
#resultsToJS(testresult.getResults(),true)#
];

var xg = Ext.grid;

var reader = new Ext.data.ArrayReader({}, [
{name: 'num', type: 'float'},
{name: 'component'},
{name: 'method'},
{name: 'result'},
{name: 'speed'},
{name: 'errordetails'},
{name: 'output'}
]);

var ds = new Ext.data.GroupingStore(
{ reader: reader,
data: allData,
sortInfo:{field: 'num', direction: "ASC"},
groupField:'component'
});

var view = new Ext.grid.GroupingView({
forceFit:true,
groupTextTpl: '{text} ({[values.rs.length]}
{[values.rs.length > 1 ? "Tests" : "Test"]})',
hideGroupedColumn:true
});

function toggleProblemView(btn, pressed){
if(pressed){
ds.loadData(problemData,false);
}else{
ds.loadData(allData,false);
}
}

function toggleExpandCollapse(btn, pressed){
if(pressed){
view.collapseAllGroups();
}else{
view.expandAllGroups();
}
}

var grid = new xg.GridPanel({
store: ds,
view: view,

columns: [
<!--- {id:'num',header: "No.", width: 15, sortable:
true, dataIndex: 'num', hidden:true} , --->
{header: "Component", width: 100, sortable: true,
dataIndex: 'component',renderer: renderComponent},
{header: "Method", width: 100, sortable: true,
dataIndex: 'method'},
{header: "Result", width: 40, sortable: true,
dataIndex: 'result', renderer: renderResult},
{header: "Error Info", width: 100, sortable: false,
dataIndex: 'errordetails'},
{header: "Speed (ms)", width:30, sortable: true,
dataIndex: 'speed', renderer: renderSpeed, align:'right'},
{header: "Output", width: 40, sortable: false,
dataIndex: 'output', align:'center'}
],

frame:true,
width: 'auto',
autoHeight: 'true',
maxHeight: 500,
autoExpandColumn: 'errordetails',
collapsible: true,
animCollapse: true,
title: 'Test Results: #jsStringFormat
(arguments.DirectoryName)#',
renderTo: "testresultsgrid_#UUID#",
tbar: [
{
text:'Show Problems Only',
enableToggle: true,
pressed: false,
toggleHandler: toggleProblemView,
tooltip: "Show failures and errors only"
},
'-',
{
text: "Collapse All",
enableToggle: true,
pressed: false,
toggleHandler: toggleExpandCollapse,
tooltip: "Collapse or expand all"
}
]
});
});

function renderComponent(val){
return "<span ext:qtip='"+val+"'>" + val + "</span>";
}
function renderResult(val){
var newVal = val.toLowerCase();
if(newVal.indexOf("error")>=0){
return "<span class='error'>" + val + "</span>";
}else if(newVal.indexOf("fail")>=0){
return "<span class='failure'>" + val + "</span>";
}
return val;
}
function renderSpeed(val){
if(val > 250){
return "<span style='color:red;font-weight:bold'
ext:qtip='This test is slow'>" + val + "</span>";
}
return val
}

</script>

<!--- begin body divs --->

<div id="modelink_#UUID#" class="modelink">
(<a href="?#normalizeQueryString(URL,'html')#">view in normal
html mode</a>)
</div>

<div align="center" id="header_#UUID#" class="header">
<h1>Test Results</h1>

<p>Failures: <span class="failure">#testresult.getFailures()#</
span> Errors: <span class="error">#testresult.getErrors()#</span>
Successes: <span class="success">#testresult.getSuccesses()#</span></
p>

</div>

<div id="testresultsgrid_#UUID#" class="bodypad"></div>
</cfoutput>
<!--- end body divs --->


<cfdump var=" "><!--- need this to get the js and css in the page
--->
</cfsavecontent>

<cfreturn strOutput>
</cffunction>

billy

unread,
Oct 22, 2009, 6:35:27 AM10/22/09
to mxunit
Hi John,

This may happen for one of two reasons (that I've experienced). One is
that there's a mapping and/or virtual directory discrepency between
ColdFusion and your web server - one may exist while the other does
not. Secondly, if on IIS, for example, the paths to the /mxunit/
resources* are somehow protected with authentication (usually
unintentionally).

Could provide your server configuration - type, mappings, and virtual
directories, etc?

Your HTML source is correct, but maybe the browser can't seem to find
the resources? You might want to check your webserver logs for 404s,
too, to verify.

In the context of your app, you want to make sure these resources are
available:
<script src="/mxunit/resources/ext2/adapter/ext/ext-base.js"></script>
<script src="/mxunit/resources/ext2/ext-all.js"></script>
<link rel="stylesheet" type="text/css" href="/mxunit/resources/ext2/
resources/css/ext-all.css" />


best,
bill

On Oct 22, 5:58 am, John Whish <john.wh...@googlemail.com> wrote:
> Hi,
>
> I hope you can shed some light on this. Is there any reason why a test
> run in the browser shows correctly when using the HTML output, but
> renders incorrectly when using the EXT2 version?
>
> This shows correctly:http://localhost/cb_skeleton/test/integration/generalTest.cfc?method=...
>
> Doesn't display properly:http://localhost/cb_skeleton/test/integration/generalTest.cfc?method=...
>
> I have runhttp://localhost/mxunit/PluginDemoTests/HodgePodgeTest.cfc?method=Run...

John Whish

unread,
Oct 22, 2009, 7:10:41 AM10/22/09
to mxu...@googlegroups.com
Hi Billy,

Thanks for the reply. The resources are available as I can run http://localhost/mxunit/PluginDemoTests/HodgePodgeTest.cfc?method=RunTestRemote

Did you see my second post where I got it working, about code outside the the cfoutput blocks not showing in the getHTMLResults() method?

Cheers,

- John

billy

unread,
Oct 22, 2009, 8:07:40 AM10/22/09
to mxunit
Hi John,

Yes. I think we were typing at the same time ... if this had been Wave
it might have turned out differently ;-)

And thanks for the debug info and workaround! There was some other
related discussions about the cfsetting issue. Would it be possible
that you enter this as an issue?

http://code.google.com/p/mxunit/issues/list

best,
bill

On Oct 22, 7:10 am, John Whish <john.wh...@googlemail.com> wrote:
> Hi Billy,
> Thanks for the reply. The resources are available as I can runhttp://localhost/mxunit/PluginDemoTests/HodgePodgeTest.cfc?method=Run...
>
> <http://localhost/mxunit/PluginDemoTests/HodgePodgeTest.cfc?method=Run...>Did

John Whish

unread,
Oct 22, 2009, 9:19:34 AM10/22/09
to mxu...@googlegroups.com
Well, if I had a wave account! :)

I've added this to the bug tracker: http://code.google.com/p/mxunit/issues/detail?id=164

Hopefully this is enough information. Let me know if I can help.

- John

Sean Corfield

unread,
Oct 22, 2009, 2:10:17 PM10/22/09
to mxu...@googlegroups.com
FWIW, I've also run into this with the ColdBox MXUnit integration but
wasn't inspired enough to try to fix it (since I prefer the HTML
output - I know, heresy!). So big thanx to John for tracking this down
and opening a ticket!

John Whish

unread,
Oct 23, 2009, 4:17:18 AM10/23/09
to mxu...@googlegroups.com
Sean, It's nice to be able to give something back for a change! I'm not clever like you guys to actually create these frameworks, so fixing a bug is the least I can do :)

2009/10/22 Sean Corfield <seanco...@gmail.com>

Sean Corfield

unread,
Oct 23, 2009, 7:53:27 PM10/23/09
to mxu...@googlegroups.com
You do yourself a huge disservice by being so modest my friend! I
know, you're British and it's in your genes... that's why I had to
emigrate and become one of those loud Yanks! :)

If this gets fixed I might start using the ExtJS view more I guess...

Marc Esher

unread,
Oct 23, 2009, 8:37:39 PM10/23/09
to mxu...@googlegroups.com
"if this gets fixed".... c'mon, Sean! we don't turn away fixes!  We've got a big release coming out within the next month I believe, and this will be in there.

It's funny: I wrote the EXT stuff while my wife was in premature labor with our second child. She was knocked  out on some drugs to keep her from having our baby, and I was in the hospital in some Godawfully uncomfortable chair thing, and so I thought, "well, I can't sleep, so I might as well write code". And instead of giving birth to Sidney (who would come a month later, thanks to modern medicine), I gave birth to the EXT grid view.

And I think I've used it maybe twice in the past 6 months.  And that's probably been just to test something to see if it broke the grid view or to figure out why something isn't running correctly in Eclipse.

For me, running stuff in a browser seems so damn slow compared with doing it in Eclipse. And now that I've got everything  running in Hudson, I have no need for the browser stuff.  And yet... viva la Browser Runner!

Thanks a million for figuring out the problem John. Those a-cursed cfoutputonly bugs will be the death of me, I swear.

cheers,

a 'umble yank

Sean Corfield

unread,
Oct 24, 2009, 12:30:55 AM10/24/09
to mxu...@googlegroups.com
On Fri, Oct 23, 2009 at 5:37 PM, Marc Esher <marc....@gmail.com> wrote:
> "if this gets fixed".... c'mon, Sean! we don't turn away fixes!  We've got a
> big release coming out within the next month I believe, and this will be in
> there.

Hahaha! Cool. Well, it wasn't meant to be a knock (and you know that).
Perhaps I should have said "when this gets fixed"...

What I do like about the Ext grid view is the ability to sort tests by
various criteria...
--
Sean A Corfield -- (904) 302-SEAN
Railo Technologies US -- http://getrailo.com/
An Architect's View -- http://corfield.org/

"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood

John Whish

unread,
Dec 5, 2009, 12:46:26 PM12/5/09
to mxunit
> > "if this gets fixed".... c'mon, Sean! we don't turn away fixes!  We've got a
> > big release coming out within the next month I believe, and this will be in
> > there.

Hey guys, I'm hurt - you didn't include my fix *grin*

BTW: The annotation stuff in the latest build is cool! :)

Marc Esher

unread,
Dec 5, 2009, 1:13:46 PM12/5/09
to mxu...@googlegroups.com
John,
I just replied to that bug report. If you can respond to it, I'll
push a release this weekend. Sorry for the oversight.

Marc
> --
>
> You received this message because you are subscribed to the Google Groups "mxunit" group.
> To post to this group, send email to mxu...@googlegroups.com.
> To unsubscribe from this group, send email to mxunit+un...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/mxunit?hl=en.
>
>
>

John Whish

unread,
Dec 5, 2009, 4:05:22 PM12/5/09
to mxu...@googlegroups.com
Thanks Marc! There's no hurry as I think it only affects Sean and I :)
Reply all
Reply to author
Forward
0 new messages