blob: ce601e0f198811ec84f3e433ae1e631cfabbf993 [file] [log] [blame]
<HTML><HEAD><META CONTENT="text/html; charset=UTF-8" HTTP-EQUIV="Content-Type"/><TITLE>EMMA Coverage Report</TITLE><STYLE TYPE="text/css"> TABLE,TD,TH {border-style:solid; border-color:black;} TD,TH {background:white;margin:0;line-height:100%;padding-left:0.5em;padding-right:0.5em;} TD {border-width:0 1px 0 0;} TH {border-width:1px 1px 1px 0;} TR TD.h {color:red;} TABLE {border-spacing:0; border-collapse:collapse;border-width:0 0 1px 1px;} P,H1,H2,H3,TH {font-family:verdana,arial,sans-serif;font-size:10pt;} TD {font-family:courier,monospace;font-size:10pt;} TABLE.hdft {border-spacing:0;border-collapse:collapse;border-style:none;} TABLE.hdft TH,TABLE.hdft TD {border-style:none;line-height:normal;} TABLE.hdft TH.tl,TABLE.hdft TD.tl {background:#6699CC;color:white;} TABLE.hdft TD.nv {background:#6633DD;color:white;} .nv A:link {color:white;} .nv A:visited {color:white;} .nv A:active {color:yellow;} TABLE.hdft A:link {color:white;} TABLE.hdft A:visited {color:white;} TABLE.hdft A:active {color:yellow;} .in {color:#356085;} TABLE.s TD {padding-left:0.25em;padding-right:0.25em;} TABLE.s TD.l {padding-left:0.25em;padding-right:0.25em;text-align:right;background:#F0F0F0;} TABLE.s TR.z TD {background:#FF9999;} TABLE.s TR.p TD {background:#FFFF88;} TABLE.s TR.c TD {background:#CCFFCC;} A:link {color:#0000EE;text-decoration:none;} A:visited {color:#0000EE;text-decoration:none;} A:hover {color:#0000EE;text-decoration:underline;} TABLE.cn {border-width:0 0 1px 0;} TABLE.s {border-width:1px 0 1px 1px;} TD.h {color:red;border-width:0 1px 0 0;} TD.f {border-width:0 1px 0 1px;} TD.hf {color:red;border-width:0 1px 0 1px;} TH.f {border-width:1px 1px 1px 1px;} TR.cis TD {background:#F0F0F0;} TR.cis TD {border-width:1px 1px 1px 0;} TR.cis TD.h {color:red;border-width:1px 1px 1px 0;} TR.cis TD.f {border-width:1px 1px 1px 1px;} TR.cis TD.hf {color:red;border-width:1px 1px 1px 1px;} TD.b {border-style:none;background:transparent;line-height:50%;} TD.bt {border-width:1px 0 0 0;background:transparent;line-height:50%;} TR.o TD {background:#F0F0F0;}TABLE.it {border-style:none;}TABLE.it TD,TABLE.it TH {border-style:none;}</STYLE></HEAD><BODY><TABLE CLASS="hdft" CELLSPACING="0" WIDTH="100%"><TR><TH CLASS="tl"><A HREF="http://www.eclemma.org/">EMMA</A> Coverage Report (generated Fri Feb 20 18:44:54 GMT 2009)</TH></TR><TR><TD CLASS="nv">[<A HREF="../xslUnitTestCoverage.html">all classes</A>][<A HREF="d3.html">org.eclipse.wst.xsl.ui.tests.contentassist</A>]</TD></TR></TABLE><H2>COVERAGE SUMMARY FOR SOURCE FILE [<SPAN CLASS="in">TestExcludeResultPrefixesCompletionProposal.java</SPAN>]</H2><TABLE CELLSPACING="0" WIDTH="100%"><TR><TH>name</TH><TH>class, %</TH><TH>method, %</TH><TH>block, %</TH><TH>line, %</TH></TR><TR><TD>TestExcludeResultPrefixesCompletionProposal.java</TD><TD>100% (1/1)</TD><TD>100% (6/6)</TD><TD>89%  (293/330)</TD><TD>84%  (75.6/90)</TD></TR></TABLE><H3>COVERAGE BREAKDOWN BY CLASS AND METHOD</H3><TABLE CLASS="cn" CELLSPACING="0" WIDTH="100%"><TR><TH CLASS="f">name</TH><TH>class, %</TH><TH>method, %</TH><TH>block, %</TH><TH>line, %</TH></TR><TR><TD CLASS="b"> </TD><TD CLASS="b"> </TD><TD CLASS="b"> </TD><TD CLASS="b"> </TD><TD CLASS="b"> </TD></TR><TR CLASS="cis"><TD CLASS="f">class <A HREF="#0">TestExcludeResultPrefixesCompletionProposal</A></TD><TD>100% (1/1)</TD><TD>100% (6/6)</TD><TD>89%  (293/330)</TD><TD>84%  (75.6/90)</TD></TR><TR><TD CLASS="f"><A HREF="#1">testExcludeXHTMLProposal (): void</A></TD><TD> </TD><TD>100% (1/1)</TD><TD>85%  (64/75)</TD><TD CLASS="h">76%  (14.5/19)</TD></TR><TR CLASS="o"><TD CLASS="f"><A HREF="#2">testTestProposal (): void</A></TD><TD> </TD><TD>100% (1/1)</TD><TD>89%  (63/71)</TD><TD>87%  (16.5/19)</TD></TR><TR><TD CLASS="f"><A HREF="#3">testAllDefaultValueNoProposals (): void</A></TD><TD> </TD><TD>100% (1/1)</TD><TD>89%  (51/57)</TD><TD>85%  (13.5/16)</TD></TR><TR CLASS="o"><TD CLASS="f"><A HREF="#4">testAllPropsoalAvailable (): void</A></TD><TD> </TD><TD>100% (1/1)</TD><TD>90%  (56/62)</TD><TD>85%  (14.5/17)</TD></TR><TR><TD CLASS="f"><A HREF="#5">testXHTMLNamespacePropsoalAvailable (): void</A></TD><TD> </TD><TD>100% (1/1)</TD><TD>90%  (56/62)</TD><TD>85%  (14.5/17)</TD></TR><TR CLASS="o"><TD CLASS="f"><A HREF="#0">TestExcludeResultPrefixesCompletionProposal (): void</A></TD><TD> </TD><TD>100% (1/1)</TD><TD>100% (3/3)</TD><TD>100% (2/2)</TD></TR></TABLE><P></P><TABLE CLASS="s" CELLSPACING="0" WIDTH="100%"><TR><TD CLASS="l">1</TD><TD>/*******************************************************************************</TD></TR><TR><TD CLASS="l">2</TD><TD> * Copyright (c) Standards for Technology in Automotive Retail and others</TD></TR><TR><TD CLASS="l">3</TD><TD> * All rights reserved. This program and the accompanying materials </TD></TR><TR><TD CLASS="l">4</TD><TD> * are made available under the terms of the Eclipse Public License v1.0</TD></TR><TR><TD CLASS="l">5</TD><TD> * which accompanies this distribution, and is available at</TD></TR><TR><TD CLASS="l">6</TD><TD> * http://www.eclipse.org/legal/epl-v10.html</TD></TR><TR><TD CLASS="l">7</TD><TD> * </TD></TR><TR><TD CLASS="l">8</TD><TD> * Contributors:</TD></TR><TR><TD CLASS="l">9</TD><TD> *     David Carver - STAR - bug 230136 - intial API and implementation</TD></TR><TR><TD CLASS="l">10</TD><TD> *******************************************************************************/</TD></TR><TR><TD CLASS="l">11</TD><TD> </TD></TR><TR><TD CLASS="l">12</TD><TD>package org.eclipse.wst.xsl.ui.tests.contentassist;</TD></TR><TR><TD CLASS="l">13</TD><TD> </TD></TR><TR><TD CLASS="l">14</TD><TD>import java.io.File;</TD></TR><TR><TD CLASS="l">15</TD><TD> </TD></TR><TR><TD CLASS="l">16</TD><TD>import org.eclipse.jface.text.contentassist.ICompletionProposal;</TD></TR><TR><TD CLASS="l">17</TD><TD>import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;</TD></TR><TR><TD CLASS="l">18</TD><TD> </TD></TR><TR><TD CLASS="l">19</TD><TD>/**</TD></TR><TR><TD CLASS="l">20</TD><TD> * Tests everything about code completion and code assistance.</TD></TR><TR><TD CLASS="l">21</TD><TD> * </TD></TR><TR><TD CLASS="l"><A NAME="0">22</A></TD><TD> */</TD></TR><TR><TD CLASS="l">23</TD><TD>public class TestExcludeResultPrefixesCompletionProposal extends</TD></TR><TR><TD CLASS="l">24</TD><TD>                AbstractCompletionProposalTest {</TD></TR><TR><TD CLASS="l">25</TD><TD> </TD></TR><TR CLASS="c"><TD CLASS="l">26</TD><TD>        public TestExcludeResultPrefixesCompletionProposal() {</TD></TR><TR><TD CLASS="l"><A NAME="3">27</A></TD><TD>                </TD></TR><TR CLASS="c"><TD CLASS="l">28</TD><TD>        }</TD></TR><TR><TD CLASS="l">29</TD><TD> </TD></TR><TR><TD CLASS="l">30</TD><TD>        public void testAllDefaultValueNoProposals() throws Exception {</TD></TR><TR CLASS="c"><TD CLASS="l">31</TD><TD>                fileName = &#34;TestResultPrefixes.xsl&#34;;</TD></TR><TR CLASS="c"><TD CLASS="l">32</TD><TD>                String xslFilePath = projectName + File.separator + fileName;</TD></TR><TR CLASS="c"><TD CLASS="l">33</TD><TD>                loadFileForTesting(xslFilePath);</TD></TR><TR CLASS="c"><TD CLASS="l">34</TD><TD>                IStructuredDocument document = (IStructuredDocument) sourceViewer</TD></TR><TR CLASS="c"><TD CLASS="l">35</TD><TD>                                .getDocument();</TD></TR><TR><TD CLASS="l">36</TD><TD>                // Column is off by one when calculating for the offset position</TD></TR><TR CLASS="c"><TD CLASS="l">37</TD><TD>                int column = 29;</TD></TR><TR CLASS="c"><TD CLASS="l">38</TD><TD>                int line = 2;</TD></TR><TR><TD CLASS="l">39</TD><TD> </TD></TR><TR><TD CLASS="l">40</TD><TD>                try {</TD></TR><TR CLASS="c"><TD CLASS="l">41</TD><TD>                        int offset = document.getLineOffset(line) + column;</TD></TR><TR><TD CLASS="l">42</TD><TD> </TD></TR><TR CLASS="c"><TD CLASS="l">43</TD><TD>                        ICompletionProposal[] proposals = getProposals(offset);</TD></TR><TR CLASS="c"><TD CLASS="l">44</TD><TD>                        assertEquals(&#34;Found proposals when #all already in result value.&#34;,</TD></TR><TR CLASS="c"><TD CLASS="l">45</TD><TD>                                        0, proposals.length);</TD></TR><TR CLASS="z"><TD CLASS="l">46</TD><TD>                } finally {</TD></TR><TR CLASS="p"><TD CLASS="l" TITLE="54% line coverage (7 out of 13 instructions)">47</TD><TD TITLE="54% line coverage (7 out of 13 instructions)">                        model.releaseFromEdit();</TD></TR><TR CLASS="z"><TD CLASS="l">48</TD><TD>                }</TD></TR><TR CLASS="c"><TD CLASS="l"><A NAME="5">49</A></TD><TD>                sourceViewer = null;</TD></TR><TR CLASS="c"><TD CLASS="l">50</TD><TD>        }</TD></TR><TR><TD CLASS="l">51</TD><TD> </TD></TR><TR><TD CLASS="l">52</TD><TD>        public void testXHTMLNamespacePropsoalAvailable() throws Exception {</TD></TR><TR CLASS="c"><TD CLASS="l">53</TD><TD>                fileName = &#34;TestResultPrefixesEmpty.xsl&#34;;</TD></TR><TR CLASS="c"><TD CLASS="l">54</TD><TD>                String xslFilePath = projectName + File.separator + fileName;</TD></TR><TR CLASS="c"><TD CLASS="l">55</TD><TD>                loadFileForTesting(xslFilePath);</TD></TR><TR CLASS="c"><TD CLASS="l">56</TD><TD>                IStructuredDocument document = (IStructuredDocument) sourceViewer</TD></TR><TR CLASS="c"><TD CLASS="l">57</TD><TD>                                .getDocument();</TD></TR><TR><TD CLASS="l">58</TD><TD>                // Column is off by one when calculating for the offset position</TD></TR><TR CLASS="c"><TD CLASS="l">59</TD><TD>                int column = 29;</TD></TR><TR CLASS="c"><TD CLASS="l">60</TD><TD>                int line = 2;</TD></TR><TR><TD CLASS="l">61</TD><TD> </TD></TR><TR><TD CLASS="l">62</TD><TD>                try {</TD></TR><TR CLASS="c"><TD CLASS="l">63</TD><TD>                        ICompletionProposal[] proposals = getProposals(line, column);</TD></TR><TR CLASS="c"><TD CLASS="l">64</TD><TD>                        assertNotNull(&#34;Did not find proposals.&#34;, proposals);</TD></TR><TR CLASS="c"><TD CLASS="l">65</TD><TD>                        assertEquals(&#34;Proposal length not 2.&#34;, 2, proposals.length);</TD></TR><TR CLASS="c"><TD CLASS="l">66</TD><TD>                        assertEquals(&#34;Proposal did not find xhtml as proposal value.&#34;,</TD></TR><TR CLASS="c"><TD CLASS="l">67</TD><TD>                                        &#34;xhtml&#34;, proposals[1].getDisplayString());</TD></TR><TR CLASS="z"><TD CLASS="l">68</TD><TD>                } finally {</TD></TR><TR CLASS="p"><TD CLASS="l" TITLE="54% line coverage (7 out of 13 instructions)">69</TD><TD TITLE="54% line coverage (7 out of 13 instructions)">                        model.releaseFromEdit();</TD></TR><TR CLASS="z"><TD CLASS="l">70</TD><TD>                }</TD></TR><TR CLASS="c"><TD CLASS="l">71</TD><TD>                sourceViewer = null;</TD></TR><TR><TD CLASS="l"><A NAME="4">72</A></TD><TD> </TD></TR><TR CLASS="c"><TD CLASS="l">73</TD><TD>        }</TD></TR><TR><TD CLASS="l">74</TD><TD> </TD></TR><TR><TD CLASS="l">75</TD><TD>        public void testAllPropsoalAvailable() throws Exception {</TD></TR><TR CLASS="c"><TD CLASS="l">76</TD><TD>                fileName = &#34;TestResultPrefixesEmpty.xsl&#34;;</TD></TR><TR CLASS="c"><TD CLASS="l">77</TD><TD>                String xslFilePath = projectName + File.separator + fileName;</TD></TR><TR CLASS="c"><TD CLASS="l">78</TD><TD>                loadFileForTesting(xslFilePath);</TD></TR><TR CLASS="c"><TD CLASS="l">79</TD><TD>                IStructuredDocument document = (IStructuredDocument) sourceViewer</TD></TR><TR CLASS="c"><TD CLASS="l">80</TD><TD>                                .getDocument();</TD></TR><TR><TD CLASS="l">81</TD><TD>                // Column is off by one when calculating for the offset position</TD></TR><TR CLASS="c"><TD CLASS="l">82</TD><TD>                int column = 29;</TD></TR><TR CLASS="c"><TD CLASS="l">83</TD><TD>                int line = 2;</TD></TR><TR><TD CLASS="l">84</TD><TD> </TD></TR><TR><TD CLASS="l">85</TD><TD>                try {</TD></TR><TR CLASS="c"><TD CLASS="l">86</TD><TD>                        ICompletionProposal[] proposals = getProposals(line,column);</TD></TR><TR CLASS="c"><TD CLASS="l">87</TD><TD>                        assertNotNull(&#34;Did not find proposals.&#34;, proposals);</TD></TR><TR CLASS="c"><TD CLASS="l">88</TD><TD>                        assertEquals(&#34;Proposal length not 2.&#34;, 2, proposals.length);</TD></TR><TR CLASS="c"><TD CLASS="l">89</TD><TD>                        assertEquals(&#34;Proposal did not find xhtml as proposal value.&#34;,</TD></TR><TR CLASS="c"><TD CLASS="l">90</TD><TD>                                        &#34;#all&#34;, proposals[0].getDisplayString());</TD></TR><TR CLASS="z"><TD CLASS="l">91</TD><TD>                } finally {</TD></TR><TR CLASS="p"><TD CLASS="l" TITLE="54% line coverage (7 out of 13 instructions)">92</TD><TD TITLE="54% line coverage (7 out of 13 instructions)">                        model.releaseFromEdit();</TD></TR><TR CLASS="z"><TD CLASS="l">93</TD><TD>                }</TD></TR><TR CLASS="c"><TD CLASS="l">94</TD><TD>                sourceViewer = null;</TD></TR><TR><TD CLASS="l"><A NAME="1">95</A></TD><TD> </TD></TR><TR CLASS="c"><TD CLASS="l">96</TD><TD>        }</TD></TR><TR><TD CLASS="l">97</TD><TD> </TD></TR><TR><TD CLASS="l">98</TD><TD>        public void testExcludeXHTMLProposal() throws Exception {</TD></TR><TR CLASS="c"><TD CLASS="l">99</TD><TD>                fileName = &#34;TestResultPrefixesWithXhtml.xsl&#34;;</TD></TR><TR CLASS="c"><TD CLASS="l">100</TD><TD>                String xslFilePath = projectName + File.separator + fileName;</TD></TR><TR CLASS="c"><TD CLASS="l">101</TD><TD>                loadFileForTesting(xslFilePath);</TD></TR><TR CLASS="c"><TD CLASS="l">102</TD><TD>                IStructuredDocument document = (IStructuredDocument) sourceViewer</TD></TR><TR CLASS="c"><TD CLASS="l">103</TD><TD>                                .getDocument();</TD></TR><TR><TD CLASS="l">104</TD><TD>                // Column is off by one when calculating for the offset position</TD></TR><TR CLASS="c"><TD CLASS="l">105</TD><TD>                int column = 35;</TD></TR><TR CLASS="c"><TD CLASS="l">106</TD><TD>                int line = 2;</TD></TR><TR><TD CLASS="l">107</TD><TD> </TD></TR><TR><TD CLASS="l">108</TD><TD>                try {</TD></TR><TR CLASS="c"><TD CLASS="l">109</TD><TD>                        int offset = document.getLineOffset(line) + column;</TD></TR><TR><TD CLASS="l">110</TD><TD> </TD></TR><TR CLASS="c"><TD CLASS="l">111</TD><TD>                        ICompletionProposal[] proposals = getProposals(offset);</TD></TR><TR CLASS="c"><TD CLASS="l">112</TD><TD>                        assertNotNull(&#34;Did not find proposals.&#34;, proposals);</TD></TR><TR><TD CLASS="l">113</TD><TD> </TD></TR><TR CLASS="c"><TD CLASS="l">114</TD><TD>                        for (int cnt = 0; cnt &lt; proposals.length; cnt++) {</TD></TR><TR CLASS="c"><TD CLASS="l">115</TD><TD>                                if (proposals[cnt].getDisplayString().equals(&#34;xhtml&#34;)) {</TD></TR><TR CLASS="z"><TD CLASS="l">116</TD><TD>                                        sourceViewer = null;</TD></TR><TR CLASS="z"><TD CLASS="l">117</TD><TD>                                        fail(&#34;XHTML Proposal found, when it should not have been!&#34;);</TD></TR><TR><TD CLASS="l">118</TD><TD>                                }</TD></TR><TR><TD CLASS="l">119</TD><TD>                        }</TD></TR><TR CLASS="z"><TD CLASS="l">120</TD><TD>                } finally {</TD></TR><TR CLASS="p"><TD CLASS="l" TITLE="54% line coverage (7 out of 13 instructions)">121</TD><TD TITLE="54% line coverage (7 out of 13 instructions)">                        model.releaseFromEdit();</TD></TR><TR CLASS="z"><TD CLASS="l">122</TD><TD>                }</TD></TR><TR CLASS="c"><TD CLASS="l"><A NAME="2">123</A></TD><TD>                sourceViewer = null;</TD></TR><TR CLASS="c"><TD CLASS="l">124</TD><TD>        }</TD></TR><TR><TD CLASS="l">125</TD><TD> </TD></TR><TR><TD CLASS="l">126</TD><TD>        public void testTestProposal() throws Exception {</TD></TR><TR CLASS="c"><TD CLASS="l">127</TD><TD>                fileName = &#34;TestResultPrefixesWithXhtml.xsl&#34;;</TD></TR><TR CLASS="c"><TD CLASS="l">128</TD><TD>                String xslFilePath = projectName + File.separator + fileName;</TD></TR><TR CLASS="c"><TD CLASS="l">129</TD><TD>                loadFileForTesting(xslFilePath);</TD></TR><TR CLASS="c"><TD CLASS="l">130</TD><TD>                IStructuredDocument document = (IStructuredDocument) sourceViewer</TD></TR><TR CLASS="c"><TD CLASS="l">131</TD><TD>                                .getDocument();</TD></TR><TR><TD CLASS="l">132</TD><TD>                // Column is off by one when calculating for the offset position</TD></TR><TR CLASS="c"><TD CLASS="l">133</TD><TD>                int column = 35;</TD></TR><TR CLASS="c"><TD CLASS="l">134</TD><TD>                int line = 2;</TD></TR><TR><TD CLASS="l">135</TD><TD>                try {</TD></TR><TR CLASS="c"><TD CLASS="l">136</TD><TD>                        int offset = document.getLineOffset(line) + column;</TD></TR><TR><TD CLASS="l">137</TD><TD> </TD></TR><TR CLASS="c"><TD CLASS="l">138</TD><TD>                        ICompletionProposal[] proposals = getProposals(offset);</TD></TR><TR CLASS="c"><TD CLASS="l">139</TD><TD>                        assertNotNull(&#34;Did not find proposals.&#34;, proposals);</TD></TR><TR CLASS="c"><TD CLASS="l">140</TD><TD>                        assertFalse(&#34;Proposals returned more than one.&#34;,</TD></TR><TR CLASS="p"><TD CLASS="l" TITLE="96% line coverage (47 out of 49 instructions)">141</TD><TD TITLE="96% line coverage (47 out of 49 instructions)">                                        proposals.length &gt; 1);</TD></TR><TR CLASS="c"><TD CLASS="l">142</TD><TD>                        assertEquals(&#34;Did not find test in proposal list&#34;, &#34;test&#34;,</TD></TR><TR CLASS="c"><TD CLASS="l">143</TD><TD>                                        proposals[0].getDisplayString());</TD></TR><TR CLASS="z"><TD CLASS="l">144</TD><TD>                } finally {</TD></TR><TR CLASS="p"><TD CLASS="l" TITLE="54% line coverage (7 out of 13 instructions)">145</TD><TD TITLE="54% line coverage (7 out of 13 instructions)">                        model.releaseFromEdit();</TD></TR><TR CLASS="z"><TD CLASS="l">146</TD><TD>                }</TD></TR><TR CLASS="c"><TD CLASS="l">147</TD><TD>                sourceViewer = null;</TD></TR><TR CLASS="c"><TD CLASS="l">148</TD><TD>        }</TD></TR><TR><TD CLASS="l">149</TD><TD> </TD></TR><TR><TD CLASS="l">150</TD><TD>}</TD></TR></TABLE><P></P><TABLE CLASS="hdft" CELLSPACING="0" WIDTH="100%"><TR><TD CLASS="nv">[<A HREF="../xslUnitTestCoverage.html">all classes</A>][<A HREF="d3.html">org.eclipse.wst.xsl.ui.tests.contentassist</A>]</TD></TR><TR><TD CLASS="tl"><A HREF="http://www.eclemma.org/support.html">EMMA 2.0.5312 EclEmma Fix 1</A> (C) Vladimir Roubtsov</TD></TR></TABLE></BODY></HTML>