<!DOCTYPE html>
<html lang='en'>
<head>
<title>test - redmine.git - Mirror of redmine code source: https://github.com/redmine/redmine</title>
<meta name='generator' content='cgit v1.2.3'/>
<meta name='robots' content='index, nofollow'/>
<link rel='stylesheet' type='text/css' href='/cgit.css'/>
<link rel='shortcut icon' href='/favicon.ico'/>
<link rel='alternate' title='Atom feed' href='https://source.dussan.org/redmine.git/atom/test?h=2.6.0' type='application/atom+xml'/>
</head>
<body>
<div id='cgit'><table id='header'>
<tr>
<td class='logo' rowspan='2'><a href='/'><img src='/cgit.png' alt='cgit logo'/></a></td>
<td class='main'><a href='/'>index</a> : <a href='/redmine.git/'>redmine.git</a></td><td class='form'><form method='get'>
<select name='h' onchange='this.form.submit();'>
<option value='0.6-stable'>0.6-stable</option>
<option value='0.7-stable'>0.7-stable</option>
<option value='0.8-stable'>0.8-stable</option>
<option value='0.9-stable'>0.9-stable</option>
<option value='1.0-stable'>1.0-stable</option>
<option value='1.1-stable'>1.1-stable</option>
<option value='1.2-stable'>1.2-stable</option>
<option value='1.3-stable'>1.3-stable</option>
<option value='1.4-stable'>1.4-stable</option>
<option value='2.0-stable'>2.0-stable</option>
<option value='2.1-stable'>2.1-stable</option>
<option value='2.2-stable'>2.2-stable</option>
<option value='2.3-stable'>2.3-stable</option>
<option value='2.4-stable'>2.4-stable</option>
<option value='2.5-stable'>2.5-stable</option>
<option value='2.6-stable'>2.6-stable</option>
<option value='3.0-stable'>3.0-stable</option>
<option value='3.1-stable'>3.1-stable</option>
<option value='3.2-stable'>3.2-stable</option>
<option value='3.3-stable'>3.3-stable</option>
<option value='3.4-stable'>3.4-stable</option>
<option value='4.0-stable'>4.0-stable</option>
<option value='4.1-stable'>4.1-stable</option>
<option value='4.2-stable'>4.2-stable</option>
<option value='5.0-stable'>5.0-stable</option>
<option value='5.1-stable'>5.1-stable</option>
<option value='6.0-stable'>6.0-stable</option>
<option value='integration-to-svn-stable-1.0'>integration-to-svn-stable-1.0</option>
<option value='integration-to-svn-trunk'>integration-to-svn-trunk</option>
<option value='master'>master</option>
<option value='nbc'>nbc</option>
<option value='plugin-hooks'>plugin-hooks</option>
<option value='swistak'>swistak</option>
<option value='work'>work</option>
</select> <input type='submit' value='switch'/></form></td></tr>
<tr><td class='sub'>Mirror of redmine code source: https://github.com/redmine/redmine</td><td class='sub right'>www-data</td></tr></table>
<table class='tabs'><tr><td>
<a href='/redmine.git/?h=2.6.0'>summary</a><a href='/redmine.git/refs/?h=2.6.0'>refs</a><a href='/redmine.git/log/test?h=2.6.0'>log</a><a class='active' href='/redmine.git/tree/test?h=2.6.0'>tree</a><a href='/redmine.git/commit/test?h=2.6.0'>commit</a><a href='/redmine.git/diff/test?h=2.6.0'>diff</a><a href='/redmine.git/stats/test?h=2.6.0'>stats</a></td><td class='form'><form class='right' method='get' action='/redmine.git/log/test'>
<input type='hidden' name='h' value='2.6.0'/><select name='qt'>
<option value='grep'>log msg</option>
<option value='author'>author</option>
<option value='committer'>committer</option>
<option value='range'>range</option>
</select>
<input class='txt' type='search' size='10' name='q' value=''/>
<input type='submit' value='search'/>
</form>
</td></tr></table>
<div class='path'>path: <a href='/redmine.git/tree/?h=2.6.0'>root</a>/<a href='/redmine.git/tree/test?h=2.6.0'>test</a></div><div class='content'><table summary='tree listing' class='list'>
<tr class='nohover'><th class='left'>Mode</th><th class='left'>Name</th><th class='right'>Size</th><th/></tr>
<tr><td class='ls-mode'>d---------</td><td><a class='ls-dir' href='/redmine.git/tree/test/extra?h=2.6.0'>extra</a> / <a class='ls-dir' href='/redmine.git/tree/test/extra/redmine_pm?h=2.6.0'>redmine_pm</a></td><td class='ls-size'>37</td><td><a class='button' href='/redmine.git/log/test/extra?h=2.6.0'>log</a><a class='button' href='/redmine.git/stats/test/extra?h=2.6.0'>stats</a><a class='button' href='/redmine.git/plain/test/extra?h=2.6.0'>plain</a></td></tr>
<tr><td class='ls-mode'>d---------</td><td><a class='ls-dir' href='/redmine.git/tree/test/fixtures?h=2.6.0'>fixtures</a></td><td class='ls-size'>2041</td><td><a class='button' href='/redmine.git/log/test/fixtures?h=2.6.0'>log</a><a class='button' href='/redmine.git/stats/test/fixtures?h=2.6.0'>stats</a><a class='button' href='/redmine.git/plain/test/fixtures?h=2.6.0'>plain</a></td></tr>
<tr><td class='ls-mode'>d---------</td><td><a class='ls-dir' href='/redmine.git/tree/test/functional?h=2.6.0'>functional</a></td><td class='ls-size'>3401</td><td><a class='button' href='/redmine.git/log/test/functional?h=2.6.0'>log</a><a class='button' href='/redmine.git/stats/test/functional?h=2.6.0'>stats</a><a class='button' href='/redmine.git/plain/test/functional?h=2.6.0'>plain</a></td></tr>
<tr><td class='ls-mode'>d---------</td><td><a class='ls-dir' href='/redmine.git/tree/test/integration?h=2.6.0'>integration</a></td><td class='ls-size'>539</td><td><a class='button' href='/redmine.git/log/test/integration?h=2.6.0'>log</a><a class='button' href='/redmine.git/stats/test/integration?h=2.6.0'>stats</a><a class='button' href='/redmine.git/plain/test/integration?h=2.6.0'>plain</a></td></tr>
<tr><td class='ls-mode'>d---------</td><td><a class='ls-dir' href='/redmine.git/tree/test/mocks?h=2.6.0'>mocks</a></td><td class='ls-size'>58</td><td><a class='button' href='/redmine.git/log/test/mocks?h=2.6.0'>log</a><a class='button' href='/redmine.git/stats/test/mocks?h=2.6.0'>stats</a><a class='button' href='/redmine.git/plain/test/mocks?h=2.6.0'>plain</a></td></tr>
<tr><td class='ls-mode'>-rw-r--r--</td><td><a class='ls-blob rb' href='/redmine.git/tree/test/object_helpers.rb?h=2.6.0'>object_helpers.rb</a></td><td class='ls-size'>6143</td><td><a class='button' href='/redmine.git/log/test/object_helpers.rb?h=2.6.0'>log</a><a class='button' href='/redmine.git/stats/test/object_helpers.rb?h=2.6.0'>stats</a><a class='button' href='/redmine.git/plain/test/object_helpers.rb?h=2.6.0'>plain</a></td></tr>
<tr><td class='ls-mode'>-rw-r--r--</td><td><a class='ls-blob rb' href='/redmine.git/tree/test/test_helper.rb?h=2.6.0'>test_helper.rb</a></td><td class='ls-size'>18246</td><td><a class='button' href='/redmine.git/log/test/test_helper.rb?h=2.6.0'>log</a><a class='button' href='/redmine.git/stats/test/test_helper.rb?h=2.6.0'>stats</a><a class='button' href='/redmine.git/plain/test/test_helper.rb?h=2.6.0'>plain</a></td></tr>
<tr><td class='ls-mode'>d---------</td><td><a class='ls-dir' href='/redmine.git/tree/test/ui?h=2.6.0'>ui</a></td><td class='ls-size'>77</td><td><a class='button' href='/redmine.git/log/test/ui?h=2.6.0'>log</a><a class='button' href='/redmine.git/stats/test/ui?h=2.6.0'>stats</a><a class='button' href='/redmine.git/plain/test/ui?h=2.6.0'>plain</a></td></tr>
<tr><td class='ls-mode'>d---------</td><td><a class='ls-dir' href='/redmine.git/tree/test/unit?h=2.6.0'>unit</a></td><td class='ls-size'>3223</td><td><a class='button' href='/redmine.git/log/test/unit?h=2.6.0'>log</a><a class='button' href='/redmine.git/stats/test/unit?h=2.6.0'>stats</a><a class='button' href='/redmine.git/plain/test/unit?h=2.6.0'>plain</a></td></tr>
</table>
</div> <!-- class=content -->
<div class='footer'>generated by <a href='https://git.zx2c4.com/cgit/about/'>cgit v1.2.3</a> (<a href='https://git-scm.com/'>git 2.39.1</a>) at 2025-08-08 07:52:03 +0000</div>
</div> <!-- id=cgit -->
</body>
</html>
<a id='n52' href='#n52'>52</a>
<a id='n53' href='#n53'>53</a>
<a id='n54' href='#n54'>54</a>
<a id='n55' href='#n55'>55</a>
<a id='n56' href='#n56'>56</a>
<a id='n57' href='#n57'>57</a>
<a id='n58' href='#n58'>58</a>
<a id='n59' href='#n59'>59</a>
<a id='n60' href='#n60'>60</a>
<a id='n61' href='#n61'>61</a>
<a id='n62' href='#n62'>62</a>
<a id='n63' href='#n63'>63</a>
<a id='n64' href='#n64'>64</a>
<a id='n65' href='#n65'>65</a>
<a id='n66' href='#n66'>66</a>
<a id='n67' href='#n67'>67</a>
<a id='n68' href='#n68'>68</a>
<a id='n69' href='#n69'>69</a>
</pre></td>
<td class='lines'><pre><code><style>pre { line-height: 125%; }
td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
.highlight .hll { background-color: #ffffcc }
.highlight .c { color: #888888 } /* Comment */
.highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */
.highlight .k { color: #008800; font-weight: bold } /* Keyword */
.highlight .ch { color: #888888 } /* Comment.Hashbang */
.highlight .cm { color: #888888 } /* Comment.Multiline */
.highlight .cp { color: #cc0000; font-weight: bold } /* Comment.Preproc */
.highlight .cpf { color: #888888 } /* Comment.PreprocFile */
.highlight .c1 { color: #888888 } /* Comment.Single */
.highlight .cs { color: #cc0000; font-weight: bold; background-color: #fff0f0 } /* Comment.Special */
.highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */
.highlight .ge { font-style: italic } /* Generic.Emph */
.highlight .gr { color: #aa0000 } /* Generic.Error */
.highlight .gh { color: #333333 } /* Generic.Heading */
.highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */
.highlight .go { color: #888888 } /* Generic.Output */
.highlight .gp { color: #555555 } /* Generic.Prompt */
.highlight .gs { font-weight: bold } /* Generic.Strong */
.highlight .gu { color: #666666 } /* Generic.Subheading */
.highlight .gt { color: #aa0000 } /* Generic.Traceback */
.highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */
.highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */
.highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */
.highlight .kp { color: #008800 } /* Keyword.Pseudo */
.highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */
.highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */
.highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */
.highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */
.highlight .na { color: #336699 } /* Name.Attribute */
.highlight .nb { color: #003388 } /* Name.Builtin */
.highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */
.highlight .no { color: #003366; font-weight: bold } /* Name.Constant */
.highlight .nd { color: #555555 } /* Name.Decorator */
.highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */
.highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */
.highlight .nl { color: #336699; font-style: italic } /* Name.Label */
.highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */
.highlight .py { color: #336699; font-weight: bold } /* Name.Property */
.highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */
.highlight .nv { color: #336699 } /* Name.Variable */
.highlight .ow { color: #008800 } /* Operator.Word */
.highlight .w { color: #bbbbbb } /* Text.Whitespace */
.highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */
.highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */
.highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */
.highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */
.highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */
.highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */
.highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */
.highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */
.highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */
.highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */
.highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */
.highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */
.highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */
.highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */
.highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */
.highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */
.highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */
.highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */
.highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */
.highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */
.highlight .vc { color: #336699 } /* Name.Variable.Class */
.highlight .vg { color: #dd7700 } /* Name.Variable.Global */
.highlight .vi { color: #3333bb } /* Name.Variable.Instance */
.highlight .vm { color: #336699 } /* Name.Variable.Magic */
.highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */</style><div class="highlight"><pre><span></span><span class="cm">/*</span>
<span class="cm">Copyright (c) Xerox Corporation 1998-2002.  All rights reserved.</span>

<span class="cm">Use and copying of this software and preparation of derivative works based</span>
<span class="cm">upon this software are permitted.  Any distribution of this software or</span>
<span class="cm">derivative works must comply with all applicable United States export control</span>
<span class="cm">laws.</span>

<span class="cm">This software is made available AS IS, and Xerox Corporation makes no warranty</span>
<span class="cm">about the software, its performance or its conformity to any specification.</span>
<span class="cm">*/</span>

<span class="kn">package</span><span class="w"> </span><span class="nn">tracing</span><span class="p">;</span>

<span class="cm">/**</span>
<span class="cm"> * TwoDShape is an abstract class that defines generic functionality</span>
<span class="cm"> * for 2D shapes.</span>
<span class="cm"> */</span>
<span class="kd">public</span><span class="w"> </span><span class="kd">abstract</span><span class="w"> </span><span class="kd">class</span> <span class="nc">TwoDShape</span><span class="w"> </span><span class="p">{</span>
<span class="w">    </span><span class="cm">/**</span>
<span class="cm">     * Coordinates of the center of the shape.</span>
<span class="cm">     */</span>
<span class="w">    </span><span class="kd">protected</span><span class="w"> </span><span class="kt">double</span><span class="w"> </span><span class="n">x</span><span class="p">,</span><span class="w"> </span><span class="n">y</span><span class="p">;</span>

<span class="w">    </span><span class="kd">protected</span><span class="w"> </span><span class="nf">TwoDShape</span><span class="p">(</span><span class="kt">double</span><span class="w"> </span><span class="n">x</span><span class="p">,</span><span class="w"> </span><span class="kt">double</span><span class="w"> </span><span class="n">y</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="w">        </span><span class="k">this</span><span class="p">.</span><span class="na">x</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">x</span><span class="p">;</span><span class="w"> </span><span class="k">this</span><span class="p">.</span><span class="na">y</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">y</span><span class="p">;</span>
<span class="w">    </span><span class="p">}</span>

<span class="w">    </span><span class="cm">/**</span>
<span class="cm">     * Returns the x coordinate of the shape.</span>
<span class="cm">     */</span>
<span class="w">    </span><span class="kd">public</span><span class="w"> </span><span class="kt">double</span><span class="w"> </span><span class="nf">getX</span><span class="p">()</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="k">return</span><span class="w"> </span><span class="n">x</span><span class="p">;</span><span class="w"> </span><span class="p">}</span>

<span class="w">    </span><span class="cm">/**</span>
<span class="cm">     * Returns the y coordinate of the shape.</span>
<span class="cm">     */</span>
<span class="w">    </span><span class="kd">public</span><span class="w"> </span><span class="kt">double</span><span class="w"> </span><span class="nf">getY</span><span class="p">()</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="k">return</span><span class="w"> </span><span class="n">y</span><span class="p">;</span><span class="w"> </span><span class="p">}</span>

<span class="w">    </span><span class="cm">/**</span>
<span class="cm">     * Returns the distance between this shape and the shape given as</span>
<span class="cm">     * parameter.</span>
<span class="cm">     */</span>
<span class="w">    </span><span class="kd">public</span><span class="w"> </span><span class="kt">double</span><span class="w"> </span><span class="nf">distance</span><span class="p">(</span><span class="n">TwoDShape</span><span class="w"> </span><span class="n">s</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="w">        </span><span class="kt">double</span><span class="w"> </span><span class="n">dx</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">Math</span><span class="p">.</span><span class="na">abs</span><span class="p">(</span><span class="n">s</span><span class="p">.</span><span class="na">getX</span><span class="p">()</span><span class="w"> </span><span class="o">-</span><span class="w"> </span><span class="n">x</span><span class="p">);</span>
<span class="w">        </span><span class="kt">double</span><span class="w"> </span><span class="n">dy</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">Math</span><span class="p">.</span><span class="na">abs</span><span class="p">(</span><span class="n">s</span><span class="p">.</span><span class="na">getY</span><span class="p">()</span><span class="w"> </span><span class="o">-</span><span class="w"> </span><span class="n">y</span><span class="p">);</span>
<span class="w">        </span><span class="k">return</span><span class="w"> </span><span class="n">Math</span><span class="p">.</span><span class="na">sqrt</span><span class="p">(</span><span class="n">dx</span><span class="o">*</span><span class="n">dx</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="n">dy</span><span class="o">*</span><span class="n">dy</span><span class="p">);</span>
<span class="w">    </span><span class="p">}</span>

<span class="w">    </span><span class="cm">/**</span>
<span class="cm">     * Returns the perimeter of this shape. Must be defined in</span>
<span class="cm">     * subclasses.</span>
<span class="cm">     */</span>
<span class="w">    </span><span class="kd">public</span><span class="w"> </span><span class="kd">abstract</span><span class="w"> </span><span class="kt">double</span><span class="w"> </span><span class="nf">perimeter</span><span class="p">();</span>

<span class="w">    </span><span class="cm">/**</span>
<span class="cm">     * Returns the area of this shape. Must be defined in</span>
<span class="cm">     * subclasses.</span>
<span class="cm">     */</span>
<span class="w">    </span><span class="kd">public</span><span class="w"> </span><span class="kd">abstract</span><span class="w"> </span><span class="kt">double</span><span class="w"> </span><span class="nf">area</span><span class="p">();</span>

<span class="w">    </span><span class="cm">/**</span>
<span class="cm">     * Returns a string representation of 2D shapes -- simply its</span>
<span class="cm">     * coordinates.</span>
<span class="cm">     */</span>
<span class="w">    </span><span class="kd">public</span><span class="w"> </span><span class="n">String</span><span class="w"> </span><span class="nf">toString</span><span class="p">()</span><span class="w"> </span><span class="p">{</span>
<span class="w">        </span><span class="k">return</span><span class="w"> </span><span class="p">(</span><span class="s">&quot; @ (&quot;</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="n">String</span><span class="p">.</span><span class="na">valueOf</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="s">&quot;, &quot;</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="n">String</span><span class="p">.</span><span class="na">valueOf</span><span class="p">(</span><span class="n">y</span><span class="p">)</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="s">&quot;) &quot;</span><span class="p">);</span>
<span class="w">    </span><span class="p">}</span>
<span class="p">}</span>
</pre></div>
</code></pre></td></tr></table>
</div> <!-- class=content -->
<div class='footer'>generated by <a href='https://git.zx2c4.com/cgit/about/'>cgit v1.2.3</a> (<a href='https://git-scm.com/'>git 2.39.1</a>) at 2025-08-08 07:52:07 +0000</div>
</div> <!-- id=cgit -->
</body>
</html>
