I'm using Netty 4.1.58 [Update: and I also tried Netty 4.1.60]
Closing a channel that includes the SslHandler in its pipeline using the following methodology:
channel.writeAndFlush(Unpooled.EMPTY_BUFFER).addListener(ChannelFutureListener.CLOSE);
Sometimes (about 10% of the time) triggers an IllegalReferenceCountException with the following stack:
io.netty.util.IllegalReferenceCountException: refCnt: 0, decrement: 1
at io.netty.util.internal.ReferenceCountUpdater.toLiveRealRefCnt(ReferenceCountUpdater.java:74) ~[baffle-client-local-shaded-INTERNAL.jar:tier0-mvp]
at io.netty.util.internal.ReferenceCountUpdater.release(ReferenceCountUpdater.java:138) ~[baffle-client-local-shaded-INTERNAL.jar:tier0-mvp]
at io.netty.buffer.AbstractReferenceCountedByteBuf.release(AbstractReferenceCountedByteBuf.java:100) ~[baffle-client-local-shaded-INTERNAL.jar:tier0-mvp]
at io.netty.util.ReferenceCountUtil.release(ReferenceCountUtil.java:88) ~[baffle-client-local-shaded-INTERNAL.jar:tier0-mvp]
at io.netty.util.ReferenceCountUtil.safeRelease(ReferenceCountUtil.java:113) ~[baffle-client-local-shaded-INTERNAL.jar:tier0-mvp]
at io.netty.channel.ChannelOutboundBuffer.remove0(ChannelOutboundBuffer.java:306) ~[baffle-client-local-shaded-INTERNAL.jar:tier0-mvp]
at io.netty.channel.ChannelOutboundBuffer.failFlushed(ChannelOutboundBuffer.java:660) ~[baffle-client-local-shaded-INTERNAL.jar:tier0-mvp]
at io.netty.channel.AbstractChannel$AbstractUnsafe.closeOutboundBufferForShutdown(AbstractChannel.java:678) ~[baffle-client-local-shaded-INTERNAL.jar:tier0-mvp]
at io.netty.channel.AbstractChannel$AbstractUnsafe.shutdownOutput(AbstractChannel.java:671) ~[baffle-client-local-shaded-INTERNAL.jar:tier0-mvp]
at io.netty.channel.AbstractChannel$AbstractUnsafe.handleWriteError(AbstractChannel.java:963) ~[baffle-client-local-shaded-INTERNAL.jar:tier0-mvp]
at io.netty.channel.AbstractChannel$AbstractUnsafe.flush0(AbstractChannel.java:943) ~[baffle-client-local-shaded-INTERNAL.jar:tier0-mvp]
at io.netty.channel.epoll.AbstractEpollChannel$AbstractEpollUnsafe.flush0(AbstractEpollChannel.java:520) ~[baffle-client-local-shaded-INTERNAL.jar:tier0-mvp]
at io.netty.channel.AbstractChannel$AbstractUnsafe.flush(AbstractChannel.java:905) ~[baffle-client-local-shaded-INTERNAL.jar:tier0-mvp]
at io.netty.channel.DefaultChannelPipeline$HeadContext.flush(DefaultChannelPipeline.java:1372) ~[baffle-client-local-shaded-INTERNAL.jar:tier0-mvp]
at io.netty.channel.AbstractChannelHandlerContext.invokeFlush0(AbstractChannelHandlerContext.java:750) ~[baffle-client-local-shaded-INTERNAL.jar:tier0-mvp]
at io.netty.channel.AbstractChannelHandlerContext.invokeFlush(AbstractChannelHandlerContext.java:742) ~[baffle-client-local-shaded-INTERNAL.jar:tier0-mvp]
at io.netty.channel.AbstractChannelHandlerContext.flush(AbstractChannelHandlerContext.java:728) ~[baffle-client-local-shaded-INTERNAL.jar:tier0-mvp]
at io.netty.handler.ssl.SslHandler.forceFlush(SslHandler.java:2099) ~[baffle-client-local-shaded-INTERNAL.jar:tier0-mvp]
at io.netty.handler.ssl.SslHandler.wrapAndFlush(SslHandler.java:815) ~[baffle-client-local-shaded-INTERNAL.jar:tier0-mvp]
at io.netty.handler.ssl.SslHandler.flush(SslHandler.java:792) ~[baffle-client-local-shaded-INTERNAL.jar:tier0-mvp]
at io.netty.handler.ssl.SslHandler.flush(SslHandler.java:1953) ~[baffle-client-local-shaded-INTERNAL.jar:tier0-mvp]
at io.netty.handler.ssl.SslHandler.closeOutboundAndChannel(SslHandler.java:1921) ~[baffle-client-local-shaded-INTERNAL.jar:tier0-mvp]
at io.netty.handler.ssl.SslHandler.close(SslHandler.java:743) ~[baffle-client-local-shaded-INTERNAL.jar:tier0-mvp]
at io.netty.channel.AbstractChannelHandlerContext.invokeClose(AbstractChannelHandlerContext.java:622) ~[baffle-client-local-shaded-INTERNAL.jar:tier0-mvp]
at io.netty.channel.AbstractChannelHandlerContext.close(AbstractChannelHandlerContext.java:606) ~[baffle-client-local-shaded-INTERNAL.jar:tier0-mvp]
at io.netty.channel.AbstractChannelHandlerContext.close(AbstractChannelHandlerContext.java:472) ~[baffle-client-local-shaded-INTERNAL.jar:tier0-mvp]
at io.netty.channel.DefaultChannelPipeline.close(DefaultChannelPipeline.java:957) ~[baffle-client-local-shaded-INTERNAL.jar:tier0-mvp]
at io.netty.channel.AbstractChannel.close(AbstractChannel.java:232) ~[baffle-client-local-shaded-INTERNAL.jar:tier0-mvp]
at io.netty.channel.ChannelFutureListener$1.operationComplete(ChannelFutureListener.java:44) ~[baffle-client-local-shaded-INTERNAL.jar:tier0-mvp]
at io.netty.channel.ChannelFutureListener$1.operationComplete(ChannelFutureListener.java:41) ~[baffle-client-local-shaded-INTERNAL.jar:tier0-mvp]
at io.netty.util.concurrent.DefaultPromise.notifyListener0(DefaultPromise.java:578) ~[baffle-client-local-shaded-INTERNAL.jar:tier0-mvp]
at io.netty.util.concurrent.DefaultPromise.notifyListenersNow(DefaultPromise.java:552) ~[baffle-client-local-shaded-INTERNAL.jar:tier0-mvp]
at io.netty.util.concurrent.DefaultPromise.notifyListeners(DefaultPromise.java:491) ~[baffle-client-local-shaded-INTERNAL.jar:tier0-mvp]
at io.netty.util.concurrent.DefaultPromise.addListener(DefaultPromise.java:184) ~[baffle-client-local-shaded-INTERNAL.jar:tier0-mvp]
at io.netty.channel.DefaultChannelPromise.addListener(DefaultChannelPromise.java:95) ~[baffle-client-local-shaded-INTERNAL.jar:tier0-mvp]
at io.netty.channel.DefaultChannelPromise.addListener(DefaultChannelPromise.java:30) ~[baffle-client-local-shaded-INTERNAL.jar:tier0-mvp]
at io.baffle.shield.sql.mssql.ProxySession$ChannelConfiguration.close(ProxySession.java:582) ~[main/:?]
at io.baffle.shield.sql.mssql.ProxySession.release(ProxySession.java:290) ~[main/:?]
at io.baffle.shield.sql.mssql.SslUtil.lambda$configureSsl$0(SslUtil.java:248) ~[main/:?]
at io.netty.util.concurrent.DefaultPromise.notifyListener0(DefaultPromise.java:578) [baffle-client-local-shaded-INTERNAL.jar:tier0-mvp]
at io.netty.util.concurrent.DefaultPromise.notifyListeners0(DefaultPromise.java:571) [baffle-client-local-shaded-INTERNAL.jar:tier0-mvp]
at io.netty.util.concurrent.DefaultPromise.notifyListenersNow(DefaultPromise.java:550) [baffle-client-local-shaded-INTERNAL.jar:tier0-mvp]
at io.netty.util.concurrent.DefaultPromise.notifyListeners(DefaultPromise.java:491) [baffle-client-local-shaded-INTERNAL.jar:tier0-mvp]
at io.netty.util.concurrent.DefaultPromise.setValue0(DefaultPromise.java:616) [baffle-client-local-shaded-INTERNAL.jar:tier0-mvp]
at io.netty.util.concurrent.DefaultPromise.setFailure0(DefaultPromise.java:609) [baffle-client-local-shaded-INTERNAL.jar:tier0-mvp]
at io.netty.util.concurrent.DefaultPromise.tryFailure(DefaultPromise.java:117) [baffle-client-local-shaded-INTERNAL.jar:tier0-mvp]
at io.netty.handler.ssl.SslHandler$5.run(SslHandler.java:2079) [baffle-client-local-shaded-INTERNAL.jar:tier0-mvp]
at io.netty.util.concurrent.PromiseTask.runTask(PromiseTask.java:98) [baffle-client-local-shaded-INTERNAL.jar:tier0-mvp]
at io.netty.util.concurrent.ScheduledFutureTask.run(ScheduledFutureTask.java:170) [baffle-client-local-shaded-INTERNAL.jar:tier0-mvp]
at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:164) [baffle-client-local-shaded-INTERNAL.jar:tier0-mvp]
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:472) [baffle-client-local-shaded-INTERNAL.jar:tier0-mvp]
at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:384) [baffle-client-local-shaded-INTERNAL.jar:tier0-mvp]
at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989) [baffle-client-local-shaded-INTERNAL.jar:tier0-mvp]
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) [baffle-client-local-shaded-INTERNAL.jar:tier0-mvp]
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) [baffle-client-local-shaded-INTERNAL.jar:tier0-mvp]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_252]
I have a word document that has a 4 level deep multilevel list. I would like to modify the list styles (temporarily) to show the entire depth of the numbers. For instance, rather than just showing (iii), I want to modify it to show 1.1(a)(iii). I have seen instructions of attaching the style to the list, but I'm not sure how to write the style to show what I want.
So, all of the searching and the replies have not resulted in a working solution, yet, but I did discover that the .docx file is a zipped collection of xml files. So, after looking inside the docx file and the numbering.xml sub-file, I found the following section that seems to define the style for the numbering I am looking to change:
<w:abstractNum w:abstractNumId="93" w15:restartNumberingAfterBreak="0">
<w:nsid w:val="5FE75E67"/>
<w:multiLevelType w:val="multilevel"/>
<w:tmpl w:val="9C366D9C"/>
<w:lvl w:ilvl="0">
<w:start w:val="1"/>
<w:numFmt w:val="decimal"/>
<w:pStyle w:val="ArticleCL1"/>
<w:lvlText w:val="%1"/>
<w:lvlJc w:val="left"/>
<w:pPr>
<w:tabs>
<w:tab w:val="num" w:pos="720"/>
</w:tabs>
<w:ind w:left="0" w:firstLine="0"/>
</w:pPr>
<w:rPr>
<w:rFonts w:ascii="Calibri" w:hAnsi="Calibri" w:cs="Times New Roman"/>
<w:b/>
<w:i w:val="0"/>
<w:caps/>
<w:smallCaps w:val="0"/>
<w:sz w:val="22"/>
<w:u w:val="none"/>
</w:rPr>
</w:lvl>
<w:lvl w:ilvl="1">
<w:start w:val="1"/>
<w:numFmt w:val="decimal"/>
<w:pStyle w:val="ArticleCL2"/>
<w:lvlText w:val="%1.%2"/>
<w:lvlJc w:val="left"/>
<w:pPr>
<w:tabs>
<w:tab w:val="num" w:pos="720"/>
</w:tabs>
<w:ind w:left="720" w:hanging="720"/>
</w:pPr>
<w:rPr>
<w:rFonts w:ascii="Calibri" w:hAnsi="Calibri" w:cs="Times New Roman"/>
<w:b w:val="0"/>
<w:i w:val="0"/>
<w:caps w:val="0"/>
<w:sz w:val="22"/>
<w:u w:val="none"/>
</w:rPr>
</w:lvl>
<w:lvl w:ilvl="2">
<w:start w:val="1"/>
<w:numFmt w:val="lowerLetter"/>
<w:pStyle w:val="ArticleCL3"/>
<w:lvlText w:val="(%3)"/>
<w:lvlJc w:val="left"/>
<w:pPr>
<w:tabs>
<w:tab w:val="num" w:pos="720"/>
</w:tabs>
<w:ind w:left="720" w:hanging="720"/>
</w:pPr>
<w:rPr>
<w:rFonts w:ascii="Calibri" w:hAnsi="Calibri" w:cs="Times New Roman"/>
<w:b w:val="0"/>
<w:i w:val="0"/>
<w:caps w:val="0"/>
<w:sz w:val="22"/>
<w:u w:val="none"/>
</w:rPr>
</w:lvl>
<w:lvl w:ilvl="3">
<w:start w:val="1"/>
<w:numFmt w:val="lowerRoman"/>
<w:pStyle w:val="ArticleCL4"/>
<w:lvlText w:val="(%4)"/>
<w:lvlJc w:val="left"/>
<w:pPr>
<w:tabs>
<w:tab w:val="num" w:pos="1440"/>
</w:tabs>
<w:ind w:left="1440" w:hanging="720"/>
</w:pPr>
<w:rPr>
<w:rFonts w:ascii="Calibri" w:hAnsi="Calibri" w:cs="Times New Roman"/>
<w:b w:val="0"/>
<w:i w:val="0"/>
<w:caps w:val="0"/>
<w:sz w:val="22"/>
<w:u w:val="none"/>
</w:rPr>
</w:lvl>
<w:lvl w:ilvl="4">
<w:start w:val="1"/>
<w:numFmt w:val="lowerLetter"/>
<w:pStyle w:val="ArticleCL5"/>
<w:lvlText w:val="%5."/>
<w:lvlJc w:val="left"/>
<w:pPr>
<w:tabs>
<w:tab w:val="num" w:pos="2160"/>
</w:tabs>
<w:ind w:left="2160" w:hanging="720"/>
</w:pPr>
<w:rPr>
<w:rFonts w:ascii="Calibri" w:hAnsi="Calibri" w:cs="Times New Roman"/>
<w:b w:val="0"/>
<w:i w:val="0"/>
<w:caps w:val="0"/>
<w:sz w:val="24"/>
<w:u w:val="none"/>
</w:rPr>
</w:lvl>
<w:lvl w:ilvl="5">
<w:start w:val="1"/>
<w:numFmt w:val="decimal"/>
<w:pStyle w:val="ArticleCL6"/>
<w:lvlText w:val="%6."/>
<w:lvlJc w:val="left"/>
<w:pPr>
<w:tabs>
<w:tab w:val="num" w:pos="2160"/>
</w:tabs>
<w:ind w:left="2160" w:hanging="720"/>
</w:pPr>
<w:rPr>
<w:rFonts w:ascii="Calibri" w:hAnsi="Calibri" w:cs="Times New Roman" w:hint="default"/>
<w:b w:val="0"/>
<w:i w:val="0"/>
<w:caps w:val="0"/>
<w:sz w:val="22"/>
<w:u w:val="none"/>
</w:rPr>
</w:lvl>
<w:lvl w:ilvl="6">
<w:start w:val="1"/>
<w:numFmt w:val="bullet"/>
<w:lvlRestart w:val="0"/>
<w:pStyle w:val="ArticleCL7"/>
<w:lvlText w:val="·"/>
<w:lvlJc w:val="left"/>
<w:pPr>
<w:tabs>
<w:tab w:val="num" w:pos="1440"/>
</w:tabs>
<w:ind w:left="1440" w:hanging="720"/>
</w:pPr>
<w:rPr>
<w:rFonts w:ascii="Symbol" w:hAnsi="Symbol" w:hint="default"/>
<w:b w:val="0"/>
<w:i w:val="0"/>
<w:caps w:val="0"/>
<w:sz w:val="24"/>
<w:u w:val="none"/>
</w:rPr>
</w:lvl>
<w:lvl w:ilvl="7">
<w:start w:val="1"/>
<w:numFmt w:val="bullet"/>
<w:lvlRestart w:val="0"/>
<w:pStyle w:val="ArticleCL8"/>
<w:lvlText w:val="·"/>
<w:lvlJc w:val="left"/>
<w:pPr>
<w:tabs>
<w:tab w:val="num" w:pos="2160"/>
</w:tabs>
<w:ind w:left="2160" w:hanging="720"/>
</w:pPr>
<w:rPr>
<w:rFonts w:ascii="Symbol" w:hAnsi="Symbol" w:hint="default"/>
<w:b w:val="0"/>
<w:i w:val="0"/>
<w:caps w:val="0"/>
<w:sz w:val="24"/>
<w:u w:val="none"/>
</w:rPr>
</w:lvl>
<w:lvl w:ilvl="8">
<w:start w:val="1"/>
<w:numFmt w:val="bullet"/>
<w:pStyle w:val="ArticleCL9"/>
<w:lvlText w:val="·"/>
<w:lvlJc w:val="left"/>
<w:pPr>
<w:tabs>
<w:tab w:val="num" w:pos="2880"/>
</w:tabs>
<w:ind w:left="2880" w:hanging="720"/>
</w:pPr>
<w:rPr>
<w:rFonts w:ascii="Symbol" w:hAnsi="Symbol" w:hint="default"/>
<w:b w:val="0"/>
<w:i w:val="0"/>
<w:caps w:val="0"/>
<w:color w:val="auto"/>
<w:sz w:val="24"/>
<w:u w:val="none"/>
</w:rPr>
</w:lvl>
Hopefully, this means that I can change the w:lvlText w:val="(%3) for w:ilvl="2" using VBA. Still investigating.
Thanks!
Rod
Well, it turns out that you can, indeed, directly modify a multiLevelList style at any level if you know how to refer to it. Using the xml file I referenced, I found that the third level style, ArticleC_L3, had it's number format set to "(%3)" which is what I wanted to change. It was in an abstract with AbstractNumId="93". The following code changes that setting:
wDoc.ListTemplates(94).ListLevels(3).NumberFormat = "%1.%2.%3"
You will notice that the ListTemplates number is one higher, and the ListLevels ID is likewise one higher. In either case, to find the precise place you need to refer to, the best workflow I have found is:
1. In the word doc, click on the number/bullet for the level you are trying to change.
2. Click the little dropdown arrow in the styles box so you can see what the style name is for that level.
3. Look in numbering.xml to see which number style is using that style name. For me the line read <w:pStyle w:val="ArticleCL3"/>
4. Follow the xml tree up to find out what level of the numbering style this is. For me the line read <w:lvl w:ilvl="2">
5. Continue to follow the xml tree up to find out what Template number the level is in. For me the line read <w:abstractNum w:abstractNumId="93" w15:restartNumberingAfterBreak="0">
6. Now you can refer to the exact level format as in the line I shared at the start.
Thanks for eveyone's help!
Rod
Presumably, something based on:
Sub ApplyMultiLevelStyleNumbers()
Dim LT As ListTemplate, i As Long
Set LT = ActiveDocument.ListTemplates.Add(OutlineNumbered:=True)
For i = 1 To 4
With LT.ListLevels(i)
.NumberFormat = Choose(i, "%1", "%1.%2", "%1.%2.%3", "%1.%2.%3.%4")
.Font.Bold = True
.ResetOnHigher = True
.StartAt = 1
.LinkedStyle = "ArticleC_L" & i
End With
Next
End Sub
The above assumes your four styles are named ArticleC_L1 - ArticleC_L4.
Our server generates the data and then the client generates charts using HighCharts which is SVG. We are struggling to write an automated test in order to verify that the generated chart is correct.
This is what the SVG HighCharts generates
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="347" height="450"><desc>Created with Highcharts 3.0.2</desc><defs><clipPath id="highcharts-1"><rect fill="none" x="0" y="0" width="272" height="275"></rect></clipPath></defs><rect rx="5" ry="5" fill="#FFFFFF" x="0" y="0" width="347" height="450"></rect><g class="highcharts-button" style="cursor:default;" title="Chart context menu" stroke-linecap="round" transform="translate(313,10)"><title>Chart context menu</title><rect rx="2" ry="2" fill="white" x="0.5" y="0.5" width="24" height="22" stroke="none" stroke-width="1"></rect><path fill="#E0E0E0" d="M 6 6.5 L 20 6.5 M 6 11.5 L 20 11.5 M 6 16.5 L 20 16.5" stroke="#666" stroke-width="3" zIndex="1"></path><text x="0" y="13" style="font-family:"HelveticaNeue-Roman", "HelveticaNeue", "Helvetica Neue", "Helvetica", "Arial", sans-serif;font-size:12px;color:black;fill:black;" zIndex="1"></text></g><g class="highcharts-grid" zIndex="1"></g><g class="highcharts-grid" zIndex="1"><path fill="none" d="M 65 211.5 L 337 211.5" stroke="#C0C0C0" stroke-width="1" zIndex="1" opacity="1"></path><path fill="none" d="M 65 106.5 L 337 106.5" stroke="#C0C0C0" stroke-width="1" zIndex="1" opacity="1"></path><path fill="none" d="M 65 315.5 L 337 315.5" stroke="#C0C0C0" stroke-width="1" zIndex="1" opacity="1"></path></g><g class="highcharts-axis" zIndex="2"><path fill="none" d="M 142.5 316 L
142.5 321" stroke="#C0D0E0" stroke-width="1" opacity="1"></path><path fill="none" d="M 181.5 316 L 181.5 321" stroke="#C0D0E0" stroke-width="1" opacity="1"></path><path fill="none" d="M 219.5 316 L
219.5 321" stroke="#C0D0E0" stroke-width="1" opacity="1"></path><path fill="none" d="M 258.5 316 L 258.5 321" stroke="#C0D0E0" stroke-width="1" opacity="1"></path><path fill="none" d="M 297.5 316 L
297.5 321" stroke="#C0D0E0" stroke-width="1" opacity="1"></path><path fill="none" d="M 336.5 316 L 336.5 321" stroke="#C0D0E0" stroke-width="1" opacity="1"></path><path fill="none" d="M 103.5 316 L
103.5 321" stroke="#C0D0E0" stroke-width="1" opacity="1"></path><path fill="none" d="M 65.5 316 L 65.5 321" stroke="#C0D0E0" stroke-width="1"></path><text x="201" y="373" style="font-family:Tahoma, Arial, sans-serif;font-size:9pt;color:#505050;font-weight:bold;fill:#505050;" zIndex="7" text-anchor="middle" transform="translate(0,0)" visibility="visible"><tspan x="201">Project</tspan></text><path fill="none" d="M 65 315.5 L 337 315.5" stroke="#505050" stroke-width="1" zIndex="7" visibility="visible"></path></g><g class="highcharts-axis" zIndex="2"><text x="24.9375" y="178" style="font-family:Tahoma, Arial, sans-serif;font-size:9pt;color:#505050;font-weight:bold;fill:#505050;" zIndex="7" text-anchor="middle" transform="translate(0,0) rotate(270
24.9375 178)" visibility="visible"><tspan x="24.9375">Percent Complete (%)</tspan></text></g><g class="highcharts-series-group" zIndex="3"><g class="highcharts-series highcharts-tracker highcharts-tracker highcharts-tracker highcharts-tracker" visibility="visible" zIndex="0.1" transform="translate(65,40) scale(1 1)" style="" clip-path="url(#highcharts-1)"><rect fill="#9F2727" x="3.5" y="275.5" width="31" height="0" stroke="#FFFFFF" stroke-width="1" rx="0" ry="0"></rect><rect fill="#9F2727" x="42.5" y="275.5" width="31" height="0" stroke="#FFFFFF" stroke-width="1" rx="0" ry="0"></rect><rect fill="#9F2727" x="81.5" y="59.5" width="31" height="216" stroke="#FFFFFF" stroke-width="1" rx="0" ry="0"></rect><rect fill="#9F2727" x="120.5" y="144.5" width="31" height="131" stroke="#FFFFFF" stroke-width="1" rx="0" ry="0"></rect><rect fill="#9F2727" x="159.5" y="13.5" width="31" height="262" stroke="#FFFFFF" stroke-width="1" rx="0" ry="0"></rect><rect fill="#9F2727" x="198.5" y="236.5" width="31" height="39" stroke="#FFFFFF" stroke-width="1" rx="0" ry="0"></rect><rect fill="#9F2727" x="237.5" y="72.5" width="31" height="203" stroke="#FFFFFF" stroke-width="1" rx="0" ry="0"></rect></g><g class="highcharts-markers" visibility="visible" zIndex="0.1" transform="translate(65,40) scale(1 1)"></g></g><g class="highcharts-data-labels highcharts-tracker highcharts-tracker highcharts-tracker highcharts-tracker" visibility="visible" zIndex="6" transform="translate(65,40) scale(1 1)" style=""><g zIndex="1" style="cursor:default;" transform="translate(16,256)" visibility="inherit"><text x="3" y="15" style="font-family:"HelveticaNeue-Roman", "HelveticaNeue", "Helvetica Neue", "Helvetica", "Arial", sans-serif;font-size:11px;color:#000000;line-height:14px;fill:#000000;" zIndex="1"></text></g><g zIndex="1" style="cursor:default;" transform="translate(55,256)" visibility="inherit"><text x="3" y="15" style="font-family:"HelveticaNeue-Roman", "HelveticaNeue", "Helvetica Neue", "Helvetica", "Arial", sans-serif;font-size:11px;color:#000000;line-height:14px;fill:#000000;" zIndex="1"></text></g><g zIndex="1" style="cursor:default;" transform="translate(82,40)" visibility="inherit"><text x="3" y="15" style="font-family:"HelveticaNeue-Roman", "HelveticaNeue", "Helvetica Neue", "Helvetica", "Arial", sans-serif;font-size:11px;color:#000000;line-height:14px;fill:#000000;" zIndex="1"><tspan x="3">41%</tspan></text></g><g zIndex="1" style="cursor:default;" transform="translate(121,125)" visibility="inherit"><text x="3" y="15" style="font-family:"HelveticaNeue-Roman", "HelveticaNeue", "Helvetica Neue", "Helvetica", "Arial", sans-serif;font-size:11px;color:#000000;line-height:14px;fill:#000000;" zIndex="1"><tspan x="3">25%</tspan></text></g><g zIndex="1" style="cursor:default;" transform="translate(160,-6)" visibility="inherit"><text x="3" y="15" style="font-family:"HelveticaNeue-Roman", "HelveticaNeue", "Helvetica Neue", "Helvetica", "Arial", sans-serif;font-size:11px;color:#000000;line-height:14px;fill:#000000;" zIndex="1"><tspan x="3">50%</tspan></text></g><g zIndex="1" style="cursor:default;" transform="translate(202,217)" visibility="inherit"><text x="3" y="15" style="font-family:"HelveticaNeue-Roman", "HelveticaNeue", "Helvetica Neue", "Helvetica", "Arial", sans-serif;font-size:11px;color:#000000;line-height:14px;fill:#000000;" zIndex="1"><tspan x="3">8%</tspan></text></g><g zIndex="1" style="cursor:default;" transform="translate(238,53)" visibility="inherit"><text x="3" y="15" style="font-family:"HelveticaNeue-Roman", "HelveticaNeue", "Helvetica Neue", "Helvetica", "Arial", sans-serif;font-size:11px;color:#000000;line-height:14px;fill:#000000;" zIndex="1"><tspan x="3">39%</tspan></text></g></g><g class="highcharts-legend" zIndex="7" transform="translate(94,404)"><rect rx="5" ry="5" fill="#FFFFFF" x="0" y="0" width="158" height="31" visibility="visible"></rect><g zIndex="1"><g><g class="highcharts-legend-item" zIndex="1" transform="translate(8,3)"><text x="21" y="15" style="font-family:Tahoma, Arial, sans-serif;font-size:9pt;cursor:pointer;color:#274b6d;fill:#274b6d;" text-anchor="start" zIndex="2"><tspan x="21">Percent Complete-Sum</tspan></text><rect rx="2" ry="2" fill="#9F2727" x="0" y="4" width="16" height="12" zIndex="3"></rect></g></g></g></g><g class="highcharts-axis-labels" zIndex="7"></g><g class="highcharts-axis-labels" zIndex="7"><text x="57" y="322.3421875" style="font-family:Tahoma, Arial, sans-serif;font-size:8pt;width:116px;color:#666;cursor:default;line-height:14px;fill:#666;" text-anchor="end" opacity="1"><tspan x="57">0</tspan></text><text x="57" y="217.19933035714288" style="font-family:Tahoma, Arial, sans-serif;font-size:8pt;width:116px;color:#666;cursor:default;line-height:14px;fill:#666;" text-anchor="end" opacity="1"><tspan x="57">20%</tspan></text><text x="57" y="112.05647321428572" style="font-family:Tahoma, Arial, sans-serif;font-size:8pt;width:116px;color:#666;cursor:default;line-height:14px;fill:#666;" text-anchor="end" opacity="1"><tspan x="57">40%</tspan></text></g><g class="highcharts-tooltip" zIndex="8" style="cursor:default;padding:0;white-space:nowrap;" visibility="hidden" transform="translate(46,45)" opacity="0"><rect rx="3" ry="3" fill="none" x="0.5" y="0.5" width="182" height="31" fill-opacity="0.85" isShadow="true" stroke="black" stroke-opacity="0.049999999999999996" stroke-width="5" transform="translate(1, 1)"></rect><rect rx="3" ry="3" fill="none" x="0.5" y="0.5" width="182" height="31" fill-opacity="0.85" isShadow="true" stroke="black" stroke-opacity="0.09999999999999999" stroke-width="3" transform="translate(1, 1)"></rect><rect rx="3" ry="3" fill="none" x="0.5" y="0.5" width="182" height="31" fill-opacity="0.85" isShadow="true" stroke="black" stroke-opacity="0.15" stroke-width="1" transform="translate(1, 1)"></rect><rect rx="3" ry="3" fill="rgb(255,255,255)" x="0.5" y="0.5" width="182" height="31" fill-opacity="0.85" stroke="#9F2727" stroke-width="1" anchorX="194.5" anchorY="8"></rect></g></svg>
Our current strategy is to generate the SVG baselines in all browsers, save them, rerun the SVG generation using selenium driver and compare the two XML response naively.
However we noticed that the DPI and the browser heavily affects height and width of the svg, which makes the tests brittle. We also tried taking screenshots of the two charts and comparing however it was very resolution dependent.
Currently we complement the UI tests with unit tests that makes sures the input to highcharts is correct, but we want to make sure we cover all the bases.
Please help us determine the correct strategy to test SVG elements generated by libraries like highcharts and d3.js.
Thank you very much.
I think you're on the right path, using Selenium to verify the dimensions of the various elements of the chart. The key is to verify their relative dimensions compared to the <svg>'s size, maybe allowing a small margin of error, and not their absolute ones.
Any ideas on how to get rid of this error.
Started GET "/favicon.ico" for 132.175.48.49 at 2012-12-18 11:20:59 +0000
ActionController::RoutingError (No route matches [GET] "/favicon.ico"):
actionpack (3.2.8) lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
actionpack (3.2.8) lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
railties (3.2.8) lib/rails/rack/logger.rb:26:in `call_app'
railties (3.2.8) lib/rails/rack/logger.rb:16:in `call'
actionpack (3.2.8) lib/action_dispatch/middleware/request_id.rb:22:in `call'
rack (1.4.1) lib/rack/methodoverride.rb:21:in `call'
rack (1.4.1) lib/rack/runtime.rb:17:in `call'
You probably have such a line (most likely in your application.html.erb, or some other template):
<link href="/favicon.ico" rel="shortcut icon" />
If you do, just change it to:
<link href="/assets/favicon.ico" rel="shortcut icon" />
I'm trying to create a simple profile tab which includes a gravatar using Devise, however I keep getting an undefined methodemail' for nil:NilClass` cant' see where I'm going wrong
tab_check.html.erb
<div class="tabbable"> <!-- Only required for left/right tabs -->
<ul class="nav nav-tabs">
<li class="active">Dashboard</li>
<li>Inbox</li>
<li>Three</li>
<li>Four</li>
<li>Profile</li>
<li>Account</li>
</ul>
<div class="tab-content">
<div class="tab-pane active" id="tab1">
<p>This will be the Dashboard</p>
</div>
<div class="tab-pane" id="tab2">
<p>This will be the Inbox</p>
</div>
<div class="tab-pane" id="tab3">
<p>This will be tab 3</p>
</div>
<div class="tab-pane" id="tab4">
<p>This will be tab 4/p>
</div>
<div class="tab-pane" id="tab5">
<%= render 'users/show' %>
</div>
<div class="tab-pane" id="tab6">
<p>Account settings sections email etc</p>
</div>
</div>
</div>
users_controller.rb
class UsersController < ApplicationController
def index
#users = User.all
end
def show
#user = User.find(params[:id])
end
end
user.rb
class User < ActiveRecord::Base
# Include default devise modules. Others available are:
# :token_authenticatable, :confirmable,
# :lockable, :timeoutable and :omniauthable
devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :trackable, :validatable
# Setup accessible (or protected) attributes for your model
attr_accessible :email, :password, :password_confirmation, :remember_me,
:first_name, :last_name
# attr_accessible :title, :body
has_many :items
end
users_helper.rb
module UsersHelper
def gravatar_for(user, options = { size: 50})
gravatar_id = Digest::MD5::hexdigest(user.email.downcase)
size = options[:size]
gravatar_url = "http://gravatar.com/avatar/#{gravatar_id}.png?s=#{size}"
image_tag(gravatar_url, alt: user.name, class: "gravatar")
end
end
finally the _show.heml.erb
<div class="row">
<aside class="span4">
<section>
<h1>
<%= gravatar_for #user %>
<%= #user.first_name %>
</h1>
</section>
</aside>
</div>
EDIT: Full Stack trace:
app/helpers/users_helper.rb:3:in `gravatar_for'
app/views/users/_show.html.erb:5:in `_app_views_users__show_html_erb__248270508__620770878'
actionpack (3.2.3) lib/action_view/template.rb:143:in `block in render'
activesupport (3.2.3) lib/active_support/notifications.rb:125:in `instrument'
actionpack (3.2.3) lib/action_view/template.rb:141:in `render'
actionpack (3.2.3) lib/action_view/renderer/partial_renderer.rb:265:in `render_partial'
actionpack (3.2.3) lib/action_view/renderer/partial_renderer.rb:238:in `block in render'
actionpack (3.2.3) lib/action_view/renderer/abstract_renderer.rb:38:in `block in instrument'
activesupport (3.2.3) lib/active_support/notifications.rb:123:in `block in instrument'
activesupport (3.2.3) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
activesupport (3.2.3) lib/active_support/notifications.rb:123:in `instrument'
actionpack (3.2.3) lib/action_view/renderer/abstract_renderer.rb:38:in `instrument'
actionpack (3.2.3) lib/action_view/renderer/partial_renderer.rb:237:in `render'
actionpack (3.2.3) lib/action_view/renderer/renderer.rb:41:in `render_partial'
actionpack (3.2.3) lib/action_view/helpers/rendering_helper.rb:27:in `render'
app/views/static_pages/tab_check.html.erb:25:in `_app_views_static_pages_tab_check_html_erb___410072822_92462190'
actionpack (3.2.3) lib/action_view/template.rb:143:in `block in render'
activesupport (3.2.3) lib/active_support/notifications.rb:125:in `instrument'
actionpack (3.2.3) lib/action_view/template.rb:141:in `render'
actionpack (3.2.3) lib/action_view/renderer/template_renderer.rb:47:in `block (2 levels) in render_template'
actionpack (3.2.3) lib/action_view/renderer/abstract_renderer.rb:38:in `block in instrument'
activesupport (3.2.3) lib/active_support/notifications.rb:123:in `block in instrument'
activesupport (3.2.3) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
activesupport (3.2.3) lib/active_support/notifications.rb:123:in `instrument'
actionpack (3.2.3) lib/action_view/renderer/abstract_renderer.rb:38:in `instrument'
actionpack (3.2.3) lib/action_view/renderer/template_renderer.rb:46:in `block in render_template'
actionpack (3.2.3) lib/action_view/renderer/template_renderer.rb:54:in `render_with_layout'
actionpack (3.2.3) lib/action_view/renderer/template_renderer.rb:45:in `render_template'
actionpack (3.2.3) lib/action_view/renderer/template_renderer.rb:18:in `render'
actionpack (3.2.3) lib/action_view/renderer/renderer.rb:36:in `render_template'
actionpack (3.2.3) lib/action_view/renderer/renderer.rb:17:in `render'
actionpack (3.2.3) lib/abstract_controller/rendering.rb:110:in `_render_template'
actionpack (3.2.3) lib/action_controller/metal/streaming.rb:225:in `_render_template'
actionpack (3.2.3) lib/abstract_controller/rendering.rb:103:in `render_to_body'
actionpack (3.2.3) lib/action_controller/metal/renderers.rb:28:in `render_to_body'
actionpack (3.2.3) lib/action_controller/metal/compatibility.rb:50:in `render_to_body'
actionpack (3.2.3) lib/abstract_controller/rendering.rb:88:in `render'
actionpack (3.2.3) lib/action_controller/metal/rendering.rb:16:in `render'
actionpack (3.2.3) lib/action_controller/metal/instrumentation.rb:40:in `block (2 levels) in render'
activesupport (3.2.3) lib/active_support/core_ext/benchmark.rb:5:in `block in ms'
/home/toaksie/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/benchmark.rb:295:in `realtime'
activesupport (3.2.3) lib/active_support/core_ext/benchmark.rb:5:in `ms'
actionpack (3.2.3) lib/action_controller/metal/instrumentation.rb:40:in `block in render'
actionpack (3.2.3) lib/action_controller/metal/instrumentation.rb:83:in `cleanup_view_runtime'
activerecord (3.2.3) lib/active_record/railties/controller_runtime.rb:24:in `cleanup_view_runtime'
actionpack (3.2.3) lib/action_controller/metal/instrumentation.rb:39:in `render'
actionpack (3.2.3) lib/action_controller/metal/implicit_render.rb:10:in `default_render'
actionpack (3.2.3) lib/action_controller/metal/implicit_render.rb:4:in `send_action'
actionpack (3.2.3) lib/abstract_controller/base.rb:167:in `process_action'
actionpack (3.2.3) lib/action_controller/metal/rendering.rb:10:in `process_action'
actionpack (3.2.3) lib/abstract_controller/callbacks.rb:18:in `block in process_action'
activesupport (3.2.3) lib/active_support/callbacks.rb:414:in `_run__447462369__process_action__180978766__callbacks'
activesupport (3.2.3) lib/active_support/callbacks.rb:405:in `__run_callback'
activesupport (3.2.3) lib/active_support/callbacks.rb:385:in `_run_process_action_callbacks'
activesupport (3.2.3) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (3.2.3) lib/abstract_controller/callbacks.rb:17:in `process_action'
actionpack (3.2.3) lib/action_controller/metal/rescue.rb:29:in `process_action'
actionpack (3.2.3) lib/action_controller/metal/instrumentation.rb:30:in `block in process_action'
activesupport (3.2.3) lib/active_support/notifications.rb:123:in `block in instrument'
activesupport (3.2.3) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
activesupport (3.2.3) lib/active_support/notifications.rb:123:in `instrument'
actionpack (3.2.3) lib/action_controller/metal/instrumentation.rb:29:in `process_action'
actionpack (3.2.3) lib/action_controller/metal/params_wrapper.rb:205:in `process_action'
activerecord (3.2.3) lib/active_record/railties/controller_runtime.rb:18:in `process_action'
actionpack (3.2.3) lib/abstract_controller/base.rb:121:in `process'
actionpack (3.2.3) lib/abstract_controller/rendering.rb:45:in `process'
actionpack (3.2.3) lib/action_controller/metal.rb:203:in `dispatch'
actionpack (3.2.3) lib/action_controller/metal/rack_delegation.rb:14:in `dispatch'
actionpack (3.2.3) lib/action_controller/metal.rb:246:in `block in action'
actionpack (3.2.3) lib/action_dispatch/routing/route_set.rb:73:in `call'
actionpack (3.2.3) lib/action_dispatch/routing/route_set.rb:73:in `dispatch'
actionpack (3.2.3) lib/action_dispatch/routing/route_set.rb:36:in `call'
journey (1.0.3) lib/journey/router.rb:68:in `block in call'
journey (1.0.3) lib/journey/router.rb:56:in `each'
journey (1.0.3) lib/journey/router.rb:56:in `call'
actionpack (3.2.3) lib/action_dispatch/routing/route_set.rb:600:in `call'
warden (1.1.1) lib/warden/manager.rb:35:in `block in call'
warden (1.1.1) lib/warden/manager.rb:34:in `catch'
warden (1.1.1) lib/warden/manager.rb:34:in `call'
actionpack (3.2.3) lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
rack (1.4.1) lib/rack/etag.rb:23:in `call'
rack (1.4.1) lib/rack/conditionalget.rb:25:in `call'
actionpack (3.2.3) lib/action_dispatch/middleware/head.rb:14:in `call'
actionpack (3.2.3) lib/action_dispatch/middleware/params_parser.rb:21:in `call'
actionpack (3.2.3) lib/action_dispatch/middleware/flash.rb:242:in `call'
rack (1.4.1) lib/rack/session/abstract/id.rb:205:in `context'
rack (1.4.1) lib/rack/session/abstract/id.rb:200:in `call'
actionpack (3.2.3) lib/action_dispatch/middleware/cookies.rb:338:in `call'
activerecord (3.2.3) lib/active_record/query_cache.rb:64:in `call'
activerecord (3.2.3) lib/active_record/connection_adapters/abstract/connection_pool.rb:467:in `call'
actionpack (3.2.3) lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
activesupport (3.2.3) lib/active_support/callbacks.rb:405:in `_run__496782642__call__984513863__callbacks'
activesupport (3.2.3) lib/active_support/callbacks.rb:405:in `__run_callback'
activesupport (3.2.3) lib/active_support/callbacks.rb:385:in `_run_call_callbacks'
activesupport (3.2.3) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (3.2.3) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
actionpack (3.2.3) lib/action_dispatch/middleware/reloader.rb:65:in `call'
actionpack (3.2.3) lib/action_dispatch/middleware/remote_ip.rb:31:in `call'
actionpack (3.2.3) lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call'
actionpack (3.2.3) lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
railties (3.2.3) lib/rails/rack/logger.rb:26:in `call_app'
railties (3.2.3) lib/rails/rack/logger.rb:16:in `call'
actionpack (3.2.3) lib/action_dispatch/middleware/request_id.rb:22:in `call'
rack (1.4.1) lib/rack/methodoverride.rb:21:in `call'
rack (1.4.1) lib/rack/runtime.rb:17:in `call'
activesupport (3.2.3) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
rack (1.4.1) lib/rack/lock.rb:15:in `call'
actionpack (3.2.3) lib/action_dispatch/middleware/static.rb:62:in `call'
railties (3.2.3) lib/rails/engine.rb:479:in `call'
railties (3.2.3) lib/rails/application.rb:220:in `call'
rack (1.4.1) lib/rack/content_length.rb:14:in `call'
railties (3.2.3) lib/rails/rack/log_tailer.rb:14:in `call'
rack (1.4.1) lib/rack/handler/webrick.rb:59:in `service'
/home/toaksie/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/webrick/httpserver.rb:138:in `service'
/home/toaksie/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/webrick/httpserver.rb:94:in `run'
/home/toaksie/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/webrick/server.rb:191:in `block in start_thread'
Any pointers very much appreciated. Thanks
Your prbolem is that you render the show template in your tab_check.html.erb, but the user is not initialized. Your show action is not running if you use partial rendering on the show view, the user must be set in the tab_check action also.
Add #user = User.find(params[:id]) to your tab_check action.