Commit 3f8dcabb authored by Qi LI's avatar Qi LI
Browse files

add test coverage report

parent f5706d1f
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" lang="en"><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/><link rel="stylesheet" href=".resources/report.css" type="text/css"/><link rel="shortcut icon" href=".resources/report.gif" type="image/gif"/><title>Sessions</title></head><body><div class="breadcrumb" id="breadcrumb"><span class="info"><a href=".sessions.html" class="el_session">Sessions</a></span><a href="index.html" class="el_report">test (Feb 24, 2016 5:32:41 PM)</a> &gt; <span class="el_session">Sessions</span></div><h1>Sessions</h1><p>This coverage report is based on execution data from the following sessions:</p><table class="coverage" cellspacing="0"><thead><tr><td>Session</td><td>Start Time</td><td>Dump Time</td></tr></thead><tbody><tr><td><span class="el_session">qli-SATELLITE-4fdf02e5</span></td><td>Feb 24, 2016 5:32:40 PM</td><td>Feb 24, 2016 5:32:41 PM</td></tr></tbody></table><p>Execution data for the following classes is considered in this report:</p><table class="coverage" cellspacing="0"><thead><tr><td>Class</td><td>Id</td></tr></thead><tbody><tr><td><span class="el_class">com.sun.proxy..Proxy1</span></td><td><code>f7553b42294540c4</code></td></tr><tr><td><span class="el_class">com.sun.proxy..Proxy3</span></td><td><code>59b58dc6b1199f9d</code></td></tr><tr><td><a href="Bowling/src/game/Frame.html" class="el_class">game.Frame</a></td><td><code>3987db8d8e152f78</code></td></tr><tr><td><a href="Bowling/src/game/Game.html" class="el_class">game.Game</a></td><td><code>da9389aad2ac2c87</code></td></tr><tr><td><a href="Bowling/src/game/Player.html" class="el_class">game.Player</a></td><td><code>06b6f713ba1dbfbc</code></td></tr><tr><td><a href="Bowling/src/game/ScoreTable.html" class="el_class">game.ScoreTable</a></td><td><code>e5329e36b6a1def6</code></td></tr><tr><td><a href="Bowling/src/game/Set.html" class="el_class">game.Set</a></td><td><code>40005cd6005c2fd6</code></td></tr><tr><td><span class="el_class">org.eclipse.jdt.internal.junit.runner.DefaultClassifier</span></td><td><code>4484a9a59adb3361</code></td></tr><tr><td><span class="el_class">org.eclipse.jdt.internal.junit.runner.FirstRunExecutionListener</span></td><td><code>b4131ab1cf51c9dd</code></td></tr><tr><td><span class="el_class">org.eclipse.jdt.internal.junit.runner.RemoteTestRunner</span></td><td><code>0806b04d936face5</code></td></tr><tr><td><span class="el_class">org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.ReaderThread</span></td><td><code>b178f2452a3665d3</code></td></tr><tr><td><span class="el_class">org.eclipse.jdt.internal.junit.runner.TestExecution</span></td><td><code>e652a18f68b6d4d4</code></td></tr><tr><td><span class="el_class">org.eclipse.jdt.internal.junit.runner.TestIdMap</span></td><td><code>92a1552568c37473</code></td></tr><tr><td><span class="el_class">org.eclipse.jdt.internal.junit4.runner.JUnit4Identifier</span></td><td><code>594205fb27f73919</code></td></tr><tr><td><span class="el_class">org.eclipse.jdt.internal.junit4.runner.JUnit4TestListener</span></td><td><code>2a7658cee04f69e3</code></td></tr><tr><td><span class="el_class">org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader</span></td><td><code>abd187362af39c42</code></td></tr><tr><td><span class="el_class">org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference</span></td><td><code>573f2e7aed6dec69</code></td></tr><tr><td><span class="el_class">org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.1</span></td><td><code>5cb1946e627d5daf</code></td></tr><tr><td><span class="el_class">org.junit.Assert</span></td><td><code>e2bac9fc5ef3a4be</code></td></tr><tr><td><span class="el_class">org.junit.internal.ComparisonCriteria</span></td><td><code>46e057da5e4340fb</code></td></tr><tr><td><span class="el_class">org.junit.internal.ExactComparisonCriteria</span></td><td><code>b46e382b993e25ce</code></td></tr><tr><td><span class="el_class">org.junit.internal.MethodSorter</span></td><td><code>e7c1106d3801ff54</code></td></tr><tr><td><span class="el_class">org.junit.internal.MethodSorter.1</span></td><td><code>81fdc65e8fe19b52</code></td></tr><tr><td><span class="el_class">org.junit.internal.MethodSorter.2</span></td><td><code>bfe6560dc3722ab0</code></td></tr><tr><td><span class="el_class">org.junit.internal.builders.AllDefaultPossibilitiesBuilder</span></td><td><code>84f7fffb8cd30ad9</code></td></tr><tr><td><span class="el_class">org.junit.internal.builders.AnnotatedBuilder</span></td><td><code>0faf353d180c9332</code></td></tr><tr><td><span class="el_class">org.junit.internal.builders.IgnoredBuilder</span></td><td><code>e152f333c53967a6</code></td></tr><tr><td><span class="el_class">org.junit.internal.builders.JUnit3Builder</span></td><td><code>4a2cc8e608e1275e</code></td></tr><tr><td><span class="el_class">org.junit.internal.builders.JUnit4Builder</span></td><td><code>5902b7da0403f55c</code></td></tr><tr><td><span class="el_class">org.junit.internal.builders.SuiteMethodBuilder</span></td><td><code>1df136431e07e393</code></td></tr><tr><td><span class="el_class">org.junit.internal.requests.ClassRequest</span></td><td><code>f1e703dd2591ce5c</code></td></tr><tr><td><span class="el_class">org.junit.internal.runners.model.EachTestNotifier</span></td><td><code>0cb318e674165ac8</code></td></tr><tr><td><span class="el_class">org.junit.internal.runners.model.ReflectiveCallable</span></td><td><code>d591724635588bcb</code></td></tr><tr><td><span class="el_class">org.junit.internal.runners.rules.RuleMemberValidator</span></td><td><code>95b5ee2068ec6875</code></td></tr><tr><td><span class="el_class">org.junit.internal.runners.rules.RuleMemberValidator.Builder</span></td><td><code>f24845fa6fd065af</code></td></tr><tr><td><span class="el_class">org.junit.internal.runners.rules.RuleMemberValidator.DeclaringClassMustBePublic</span></td><td><code>1de994463c748d89</code></td></tr><tr><td><span class="el_class">org.junit.internal.runners.rules.RuleMemberValidator.FieldMustBeARule</span></td><td><code>e24e9f59de6fe5b7</code></td></tr><tr><td><span class="el_class">org.junit.internal.runners.rules.RuleMemberValidator.FieldMustBeATestRule</span></td><td><code>690823bd2992f52e</code></td></tr><tr><td><span class="el_class">org.junit.internal.runners.rules.RuleMemberValidator.MemberMustBeNonStaticOrAlsoClassRule</span></td><td><code>1e703fb3e7f4e533</code></td></tr><tr><td><span class="el_class">org.junit.internal.runners.rules.RuleMemberValidator.MemberMustBePublic</span></td><td><code>806c174eb921b478</code></td></tr><tr><td><span class="el_class">org.junit.internal.runners.rules.RuleMemberValidator.MemberMustBeStatic</span></td><td><code>ac28a03dd36b2b5a</code></td></tr><tr><td><span class="el_class">org.junit.internal.runners.rules.RuleMemberValidator.MethodMustBeARule</span></td><td><code>88ea4a2237de2b8b</code></td></tr><tr><td><span class="el_class">org.junit.internal.runners.rules.RuleMemberValidator.MethodMustBeATestRule</span></td><td><code>9f4dd18a26005c18</code></td></tr><tr><td><span class="el_class">org.junit.internal.runners.statements.ExpectException</span></td><td><code>d4f541ccb0309b8c</code></td></tr><tr><td><span class="el_class">org.junit.internal.runners.statements.InvokeMethod</span></td><td><code>05a7aa636afa2c39</code></td></tr><tr><td><span class="el_class">org.junit.runner.Description</span></td><td><code>c7f1b09126c24b2b</code></td></tr><tr><td><span class="el_class">org.junit.runner.Request</span></td><td><code>4f785af929bd628a</code></td></tr><tr><td><span class="el_class">org.junit.runner.Result</span></td><td><code>3a364b299d905039</code></td></tr><tr><td><span class="el_class">org.junit.runner.Result.Listener</span></td><td><code>bbae11d09f5b5a09</code></td></tr><tr><td><span class="el_class">org.junit.runner.Runner</span></td><td><code>f5abacc70e2e08a4</code></td></tr><tr><td><span class="el_class">org.junit.runner.notification.RunListener</span></td><td><code>a740fd873cf92a63</code></td></tr><tr><td><span class="el_class">org.junit.runner.notification.RunNotifier</span></td><td><code>ba709a76760379c2</code></td></tr><tr><td><span class="el_class">org.junit.runner.notification.RunNotifier.1</span></td><td><code>6eb5e06975b1ea02</code></td></tr><tr><td><span class="el_class">org.junit.runner.notification.RunNotifier.2</span></td><td><code>dc4db4223d160c08</code></td></tr><tr><td><span class="el_class">org.junit.runner.notification.RunNotifier.3</span></td><td><code>7a903d9d1caf7673</code></td></tr><tr><td><span class="el_class">org.junit.runner.notification.RunNotifier.7</span></td><td><code>304ecd1b313cb650</code></td></tr><tr><td><span class="el_class">org.junit.runner.notification.RunNotifier.SafeNotifier</span></td><td><code>3b3dc2f2fc8cfc56</code></td></tr><tr><td><span class="el_class">org.junit.runner.notification.SynchronizedRunListener</span></td><td><code>0f89c0c6a77088e5</code></td></tr><tr><td><span class="el_class">org.junit.runners.BlockJUnit4ClassRunner</span></td><td><code>673d2df2f68a9490</code></td></tr><tr><td><span class="el_class">org.junit.runners.BlockJUnit4ClassRunner.1</span></td><td><code>b3af68717b17ffc6</code></td></tr><tr><td><span class="el_class">org.junit.runners.ParentRunner</span></td><td><code>df303f19df248a10</code></td></tr><tr><td><span class="el_class">org.junit.runners.ParentRunner.1</span></td><td><code>89f115a2214a3636</code></td></tr><tr><td><span class="el_class">org.junit.runners.ParentRunner.2</span></td><td><code>0fc04165488ae7c7</code></td></tr><tr><td><span class="el_class">org.junit.runners.ParentRunner.3</span></td><td><code>65f7d637ed11f8f4</code></td></tr><tr><td><span class="el_class">org.junit.runners.model.FrameworkField</span></td><td><code>d6d3c27befd6f49d</code></td></tr><tr><td><span class="el_class">org.junit.runners.model.FrameworkMember</span></td><td><code>83f9d72bb2731cf1</code></td></tr><tr><td><span class="el_class">org.junit.runners.model.FrameworkMethod</span></td><td><code>b9c1cccbfa624e4a</code></td></tr><tr><td><span class="el_class">org.junit.runners.model.FrameworkMethod.1</span></td><td><code>87d2600c48ade534</code></td></tr><tr><td><span class="el_class">org.junit.runners.model.RunnerBuilder</span></td><td><code>0281d51b4f8328d4</code></td></tr><tr><td><span class="el_class">org.junit.runners.model.Statement</span></td><td><code>9a75aa5de27bf4d5</code></td></tr><tr><td><span class="el_class">org.junit.runners.model.TestClass</span></td><td><code>90136128a3e4d163</code></td></tr><tr><td><span class="el_class">org.junit.runners.model.TestClass.FieldComparator</span></td><td><code>261449f31a730808</code></td></tr><tr><td><span class="el_class">org.junit.runners.model.TestClass.MethodComparator</span></td><td><code>5a734d8eaadb6011</code></td></tr><tr><td><span class="el_class">org.junit.validator.AnnotationValidatorFactory</span></td><td><code>e736331fde301341</code></td></tr><tr><td><span class="el_class">org.junit.validator.AnnotationsValidator</span></td><td><code>51f829810937d72f</code></td></tr><tr><td><span class="el_class">org.junit.validator.AnnotationsValidator.AnnotatableValidator</span></td><td><code>d211a963f22be103</code></td></tr><tr><td><span class="el_class">org.junit.validator.AnnotationsValidator.ClassValidator</span></td><td><code>1b463c4e6642e880</code></td></tr><tr><td><span class="el_class">org.junit.validator.AnnotationsValidator.FieldValidator</span></td><td><code>64068b954dc56a31</code></td></tr><tr><td><span class="el_class">org.junit.validator.AnnotationsValidator.MethodValidator</span></td><td><code>f16b57f17c787036</code></td></tr><tr><td><span class="el_class">org.junit.validator.PublicClassValidator</span></td><td><code>3bac248cf06b18e4</code></td></tr><tr><td><a href="Bowling/src/test/TestFrame.html" class="el_class">test.TestFrame</a></td><td><code>abe02da8d673a1cf</code></td></tr><tr><td><a href="Bowling/src/test/TestGame.html" class="el_class">test.TestGame</a></td><td><code>5c1b7e27053b85a9</code></td></tr><tr><td><a href="Bowling/src/test/TestPlayer.html" class="el_class">test.TestPlayer</a></td><td><code>fea0bcbac4c4529f</code></td></tr><tr><td><a href="Bowling/src/test/TestScoreTable.html" class="el_class">test.TestScoreTable</a></td><td><code>08a8801f6a4df45a</code></td></tr><tr><td><a href="Bowling/src/test/TestSet.html" class="el_class">test.TestSet</a></td><td><code>1e8ea3ef1919cceb</code></td></tr></tbody></table><div class="footer"><span class="right">Created with <a href="http://www.eclemma.org/jacoco">JaCoCo</a> 0.7.2.201409121644</span>test (Feb 24, 2016 5:32:41 PM)</div></body></html>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" lang="en"><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/><link rel="stylesheet" href="../.resources/report.css" type="text/css"/><link rel="shortcut icon" href="../.resources/report.gif" type="image/gif"/><title>Bowling</title><script type="text/javascript" src="../.resources/sort.js"></script></head><body onload="initialSort(['breadcrumb', 'coveragetable'])"><div class="breadcrumb" id="breadcrumb"><span class="info"><a href="../.sessions.html" class="el_session">Sessions</a></span><a href="../index.html" class="el_report">test (Feb 24, 2016 5:32:41 PM)</a> &gt; <span class="el_group">Bowling</span></div><h1>Bowling</h1><table class="coverage" cellspacing="0" id="coveragetable"><thead><tr><td class="sortable" id="a" onclick="toggleSort(this)">Element</td><td class="down sortable bar" id="b" onclick="toggleSort(this)">Missed Instructions</td><td class="sortable ctr2" id="c" onclick="toggleSort(this)">Cov.</td><td class="sortable bar" id="d" onclick="toggleSort(this)">Missed Branches</td><td class="sortable ctr2" id="e" onclick="toggleSort(this)">Cov.</td><td class="sortable ctr1" id="f" onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="g" onclick="toggleSort(this)">Cxty</td><td class="sortable ctr1" id="h" onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="i" onclick="toggleSort(this)">Lines</td><td class="sortable ctr1" id="j" onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="k" onclick="toggleSort(this)">Methods</td><td class="sortable ctr1" id="l" onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="m" onclick="toggleSort(this)">Classes</td></tr></thead><tfoot><tr><td>Total</td><td class="bar">60 of 2,546</td><td class="ctr2">98%</td><td class="bar">6 of 168</td><td class="ctr2">96%</td><td class="ctr1">8</td><td class="ctr2">149</td><td class="ctr1">15</td><td class="ctr2">417</td><td class="ctr1">2</td><td class="ctr2">65</td><td class="ctr1">0</td><td class="ctr2">10</td></tr></tfoot><tbody><tr><td id="a0"><a href="src/index.html" class="el_bundle">src</a></td><td class="bar" id="b0"><img src="../.resources/redbar.gif" width="2" height="10" title="60" alt="60"/><img src="../.resources/greenbar.gif" width="117" height="10" title="2,486" alt="2,486"/></td><td class="ctr2" id="c0">98%</td><td class="bar" id="d0"><img src="../.resources/redbar.gif" width="4" height="10" title="6" alt="6"/><img src="../.resources/greenbar.gif" width="115" height="10" title="162" alt="162"/></td><td class="ctr2" id="e0">96%</td><td class="ctr1" id="f0">8</td><td class="ctr2" id="g0">149</td><td class="ctr1" id="h0">15</td><td class="ctr2" id="i0">417</td><td class="ctr1" id="j0">2</td><td class="ctr2" id="k0">65</td><td class="ctr1" id="l0">0</td><td class="ctr2" id="m0">10</td></tr></tbody></table><div class="footer"><span class="right">Created with <a href="http://www.eclemma.org/jacoco">JaCoCo</a> 0.7.2.201409121644</span>test (Feb 24, 2016 5:32:41 PM)</div></body></html>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" lang="en"><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/><link rel="stylesheet" href="../../../.resources/report.css" type="text/css"/><link rel="shortcut icon" href="../../../.resources/report.gif" type="image/gif"/><title>Frame</title><script type="text/javascript" src="../../../.resources/sort.js"></script></head><body onload="initialSort(['breadcrumb'])"><div class="breadcrumb" id="breadcrumb"><span class="info"><a href="../../../.sessions.html" class="el_session">Sessions</a></span><a href="../../../index.html" class="el_report">test (Feb 24, 2016 5:32:41 PM)</a> &gt; <a href="../../index.html" class="el_group">Bowling</a> &gt; <a href="../index.html" class="el_bundle">src</a> &gt; <a href="index.html" class="el_package">game</a> &gt; <span class="el_class">Frame</span></div><h1>Frame</h1><table class="coverage" cellspacing="0" id="coveragetable"><thead><tr><td class="sortable" id="a" onclick="toggleSort(this)">Element</td><td class="down sortable bar" id="b" onclick="toggleSort(this)">Missed Instructions</td><td class="sortable ctr2" id="c" onclick="toggleSort(this)">Cov.</td><td class="sortable bar" id="d" onclick="toggleSort(this)">Missed Branches</td><td class="sortable ctr2" id="e" onclick="toggleSort(this)">Cov.</td><td class="sortable ctr1" id="f" onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="g" onclick="toggleSort(this)">Cxty</td><td class="sortable ctr1" id="h" onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="i" onclick="toggleSort(this)">Lines</td><td class="sortable ctr1" id="j" onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="k" onclick="toggleSort(this)">Methods</td></tr></thead><tfoot><tr><td>Total</td><td class="bar">0 of 115</td><td class="ctr2">100%</td><td class="bar">0 of 18</td><td class="ctr2">100%</td><td class="ctr1">0</td><td class="ctr2">18</td><td class="ctr1">0</td><td class="ctr2">22</td><td class="ctr1">0</td><td class="ctr2">9</td></tr></tfoot><tbody><tr><td id="a1"><a href="Frame.java.html#L13" class="el_method">enterPoint(int)</a></td><td class="bar" id="b0"><img src="../../../.resources/greenbar.gif" width="120" height="10" title="50" alt="50"/></td><td class="ctr2" id="c0">100%</td><td class="bar" id="d0"><img src="../../../.resources/greenbar.gif" width="120" height="10" title="8" alt="8"/></td><td class="ctr2" id="e0">100%</td><td class="ctr1" id="f0">0</td><td class="ctr2" id="g0">5</td><td class="ctr1" id="h0">0</td><td class="ctr2" id="i0">8</td><td class="ctr1" id="j0">0</td><td class="ctr2" id="k0">1</td></tr><tr><td id="a2"><a href="Frame.java.html#L4" class="el_method">Frame(int)</a></td><td class="bar" id="b1"><img src="../../../.resources/greenbar.gif" width="36" height="10" title="15" alt="15"/></td><td class="ctr2" id="c1">100%</td><td class="bar" id="d4"/><td class="ctr2" id="e4">n/a</td><td class="ctr1" id="f1">0</td><td class="ctr2" id="g4">1</td><td class="ctr1" id="h1">0</td><td class="ctr2" id="i1">6</td><td class="ctr1" id="j1">0</td><td class="ctr2" id="k1">1</td></tr><tr><td id="a6"><a href="Frame.java.html#L36" class="el_method">isFinished()</a></td><td class="bar" id="b2"><img src="../../../.resources/greenbar.gif" width="36" height="10" title="15" alt="15"/></td><td class="ctr2" id="c2">100%</td><td class="bar" id="d1"><img src="../../../.resources/greenbar.gif" width="90" height="10" title="6" alt="6"/></td><td class="ctr2" id="e1">100%</td><td class="ctr1" id="f2">0</td><td class="ctr2" id="g1">4</td><td class="ctr1" id="h2">0</td><td class="ctr2" id="i3">1</td><td class="ctr1" id="j2">0</td><td class="ctr2" id="k2">1</td></tr><tr><td id="a7"><a href="Frame.java.html#L32" class="el_method">isSpare()</a></td><td class="bar" id="b3"><img src="../../../.resources/greenbar.gif" width="26" height="10" title="11" alt="11"/></td><td class="ctr2" id="c3">100%</td><td class="bar" id="d2"><img src="../../../.resources/greenbar.gif" width="30" height="10" title="2" alt="2"/></td><td class="ctr2" id="e2">100%</td><td class="ctr1" id="f3">0</td><td class="ctr2" id="g2">2</td><td class="ctr1" id="h3">0</td><td class="ctr2" id="i4">1</td><td class="ctr1" id="j3">0</td><td class="ctr2" id="k3">1</td></tr><tr><td id="a8"><a href="Frame.java.html#L28" class="el_method">isStrike()</a></td><td class="bar" id="b4"><img src="../../../.resources/greenbar.gif" width="19" height="10" title="8" alt="8"/></td><td class="ctr2" id="c4">100%</td><td class="bar" id="d3"><img src="../../../.resources/greenbar.gif" width="30" height="10" title="2" alt="2"/></td><td class="ctr2" id="e3">100%</td><td class="ctr1" id="f4">0</td><td class="ctr2" id="g3">2</td><td class="ctr1" id="h4">0</td><td class="ctr2" id="i5">1</td><td class="ctr1" id="j4">0</td><td class="ctr2" id="k4">1</td></tr><tr><td id="a0"><a href="Frame.java.html#L24" class="el_method">addBonus(int)</a></td><td class="bar" id="b5"><img src="../../../.resources/greenbar.gif" width="16" height="10" title="7" alt="7"/></td><td class="ctr2" id="c5">100%</td><td class="bar" id="d5"/><td class="ctr2" id="e5">n/a</td><td class="ctr1" id="f5">0</td><td class="ctr2" id="g5">1</td><td class="ctr1" id="h5">0</td><td class="ctr2" id="i2">2</td><td class="ctr1" id="j5">0</td><td class="ctr2" id="k5">1</td></tr><tr><td id="a3"><a href="Frame.java.html#L39" class="el_method">getFirstLance()</a></td><td class="bar" id="b6"><img src="../../../.resources/greenbar.gif" width="7" height="10" title="3" alt="3"/></td><td class="ctr2" id="c6">100%</td><td class="bar" id="d6"/><td class="ctr2" id="e6">n/a</td><td class="ctr1" id="f6">0</td><td class="ctr2" id="g6">1</td><td class="ctr1" id="h6">0</td><td class="ctr2" id="i6">1</td><td class="ctr1" id="j6">0</td><td class="ctr2" id="k6">1</td></tr><tr><td id="a5"><a href="Frame.java.html#L40" class="el_method">getSecondLance()</a></td><td class="bar" id="b7"><img src="../../../.resources/greenbar.gif" width="7" height="10" title="3" alt="3"/></td><td class="ctr2" id="c7">100%</td><td class="bar" id="d7"/><td class="ctr2" id="e7">n/a</td><td class="ctr1" id="f7">0</td><td class="ctr2" id="g7">1</td><td class="ctr1" id="h7">0</td><td class="ctr2" id="i7">1</td><td class="ctr1" id="j7">0</td><td class="ctr2" id="k7">1</td></tr><tr><td id="a4"><a href="Frame.java.html#L41" class="el_method">getScore()</a></td><td class="bar" id="b8"><img src="../../../.resources/greenbar.gif" width="7" height="10" title="3" alt="3"/></td><td class="ctr2" id="c8">100%</td><td class="bar" id="d8"/><td class="ctr2" id="e8">n/a</td><td class="ctr1" id="f8">0</td><td class="ctr2" id="g8">1</td><td class="ctr1" id="h8">0</td><td class="ctr2" id="i8">1</td><td class="ctr1" id="j8">0</td><td class="ctr2" id="k8">1</td></tr></tbody></table><div class="footer"><span class="right">Created with <a href="http://www.eclemma.org/jacoco">JaCoCo</a> 0.7.2.201409121644</span>test (Feb 24, 2016 5:32:41 PM)</div></body></html>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" lang="en"><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/><link rel="stylesheet" href="../../../.resources/report.css" type="text/css"/><link rel="shortcut icon" href="../../../.resources/report.gif" type="image/gif"/><title>Frame.java</title><link rel="stylesheet" href="../../../.resources/prettify.css" type="text/css"/><script type="text/javascript" src="../../../.resources/prettify.js"></script></head><body onload="window['PR_TAB_WIDTH']=4;prettyPrint()"><div class="breadcrumb" id="breadcrumb"><span class="info"><a href="../../../.sessions.html" class="el_session">Sessions</a></span><a href="../../../index.html" class="el_report">test (Feb 24, 2016 5:32:41 PM)</a> &gt; <a href="../../index.html" class="el_group">Bowling</a> &gt; <a href="../index.html" class="el_bundle">src</a> &gt; <a href="index.source.html" class="el_package">game</a> &gt; <span class="el_source">Frame.java</span></div><h1>Frame.java</h1><pre class="source lang-java linenums">package game;
public class Frame {
<span class="fc" id="L4"> private int firstLance = -1;</span>
<span class="fc" id="L5"> private int secondLance = -1;</span>
<span class="fc" id="L6"> private int score = 0;</span>
<span class="fc" id="L8"> public Frame(int previousScore) {</span>
<span class="fc" id="L9"> this.score = previousScore;</span>
<span class="fc" id="L10"> }</span>
public void enterPoint(int point) throws Exception {
<span class="fc bfc" id="L13" title="All 4 branches covered."> if(point &lt; 0 || point &gt; 10)</span>
<span class="fc" id="L14"> throw new Exception(&quot;invalid point: [0, 10]&quot;);</span>
<span class="fc bfc" id="L16" title="All 2 branches covered."> if (firstLance == -1) this.firstLance = point;</span>
<span class="fc bfc" id="L17" title="All 2 branches covered."> else if (point + this.firstLance &gt; 10)</span>
<span class="fc" id="L18"> throw new Exception(&quot;invalid point: [0, &quot; + (10 - this.firstLance) + &quot;]&quot;);</span>
<span class="fc" id="L19"> else this.secondLance = point;</span>
<span class="fc" id="L20"> this.score += point;</span>
<span class="fc" id="L21"> }</span>
public void addBonus(int point) {
<span class="fc" id="L24"> this.score += point;</span>
<span class="fc" id="L25"> }</span>
public boolean isStrike() {
<span class="fc bfc" id="L28" title="All 2 branches covered."> return firstLance == 10;</span>
}
public boolean isSpare() {
<span class="fc bfc" id="L32" title="All 2 branches covered."> return (firstLance + secondLance) == 10;</span>
}
public boolean isFinished() {
<span class="fc bfc" id="L36" title="All 6 branches covered."> return isStrike() || (firstLance != -1 &amp;&amp; secondLance != -1);</span>
}
<span class="fc" id="L39"> public int getFirstLance() { return this.firstLance; }</span>
<span class="fc" id="L40"> public int getSecondLance() { return this.secondLance; }</span>
<span class="fc" id="L41"> public int getScore() { return this.score; }</span>
}
</pre><div class="footer"><span class="right">Created with <a href="http://www.eclemma.org/jacoco">JaCoCo</a> 0.7.2.201409121644</span>test (Feb 24, 2016 5:32:41 PM)</div></body></html>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" lang="en"><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/><link rel="stylesheet" href="../../../.resources/report.css" type="text/css"/><link rel="shortcut icon" href="../../../.resources/report.gif" type="image/gif"/><title>Game</title><script type="text/javascript" src="../../../.resources/sort.js"></script></head><body onload="initialSort(['breadcrumb'])"><div class="breadcrumb" id="breadcrumb"><span class="info"><a href="../../../.sessions.html" class="el_session">Sessions</a></span><a href="../../../index.html" class="el_report">test (Feb 24, 2016 5:32:41 PM)</a> &gt; <a href="../../index.html" class="el_group">Bowling</a> &gt; <a href="../index.html" class="el_bundle">src</a> &gt; <a href="index.html" class="el_package">game</a> &gt; <span class="el_class">Game</span></div><h1>Game</h1><table class="coverage" cellspacing="0" id="coveragetable"><thead><tr><td class="sortable" id="a" onclick="toggleSort(this)">Element</td><td class="down sortable bar" id="b" onclick="toggleSort(this)">Missed Instructions</td><td class="sortable ctr2" id="c" onclick="toggleSort(this)">Cov.</td><td class="sortable bar" id="d" onclick="toggleSort(this)">Missed Branches</td><td class="sortable ctr2" id="e" onclick="toggleSort(this)">Cov.</td><td class="sortable ctr1" id="f" onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="g" onclick="toggleSort(this)">Cxty</td><td class="sortable ctr1" id="h" onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="i" onclick="toggleSort(this)">Lines</td><td class="sortable ctr1" id="j" onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="k" onclick="toggleSort(this)">Methods</td></tr></thead><tfoot><tr><td>Total</td><td class="bar">32 of 357</td><td class="ctr2">91%</td><td class="bar">2 of 32</td><td class="ctr2">94%</td><td class="ctr1">2</td><td class="ctr2">22</td><td class="ctr1">6</td><td class="ctr2">70</td><td class="ctr1">0</td><td class="ctr2">6</td></tr></tfoot><tbody><tr><td id="a3"><a href="Game.java.html#L107" class="el_method">main(String[])</a></td><td class="bar" id="b0"><img src="../../../.resources/redbar.gif" width="20" height="10" title="27" alt="27"/><img src="../../../.resources/greenbar.gif" width="42" height="10" title="56" alt="56"/></td><td class="ctr2" id="c5">67%</td><td class="bar" id="d1"><img src="../../../.resources/redbar.gif" width="6" height="10" title="1" alt="1"/><img src="../../../.resources/greenbar.gif" width="20" height="10" title="3" alt="3"/></td><td class="ctr2" id="e3">75%</td><td class="ctr1" id="f0">1</td><td class="ctr2" id="g2">3</td><td class="ctr1" id="h0">5</td><td class="ctr2" id="i1">17</td><td class="ctr1" id="j0">0</td><td class="ctr2" id="k0">1</td></tr><tr><td id="a5"><a href="Game.java.html#L44" class="el_method">startSet()</a></td><td class="bar" id="b1"><img src="../../../.resources/redbar.gif" width="3" height="10" title="5" alt="5"/><img src="../../../.resources/greenbar.gif" width="116" height="10" title="154" alt="154"/></td><td class="ctr2" id="c4">97%</td><td class="bar" id="d2"><img src="../../../.resources/greenbar.gif" width="120" height="10" title="18" alt="18"/></td><td class="ctr2" id="e0">100%</td><td class="ctr1" id="f2">0</td><td class="ctr2" id="g0">10</td><td class="ctr1" id="h1">1</td><td class="ctr2" id="i0">31</td><td class="ctr1" id="j1">0</td><td class="ctr2" id="k1">1</td></tr><tr><td id="a1"><a href="Game.java.html#L22" class="el_method">enterPlayers()</a></td><td class="bar" id="b2"><img src="../../../.resources/greenbar.gif" width="52" height="10" title="70" alt="70"/></td><td class="ctr2" id="c0">100%</td><td class="bar" id="d0"><img src="../../../.resources/redbar.gif" width="6" height="10" title="1" alt="1"/><img src="../../../.resources/greenbar.gif" width="33" height="10" title="5" alt="5"/></td><td class="ctr2" id="e2">83%</td><td class="ctr1" id="f1">1</td><td class="ctr2" id="g1">4</td><td class="ctr1" id="h2">0</td><td class="ctr2" id="i2">11</td><td class="ctr1" id="j2">0</td><td class="ctr2" id="k2">1</td></tr><tr><td id="a0"><a href="Game.java.html#L99" class="el_method">enrollAllPlayers()</a></td><td class="bar" id="b3"><img src="../../../.resources/greenbar.gif" width="14" height="10" title="19" alt="19"/></td><td class="ctr2" id="c1">100%</td><td class="bar" id="d3"><img src="../../../.resources/greenbar.gif" width="26" height="10" title="4" alt="4"/></td><td class="ctr2" id="e1">100%</td><td class="ctr1" id="f3">0</td><td class="ctr2" id="g3">3</td><td class="ctr1" id="h3">0</td><td class="ctr2" id="i4">4</td><td class="ctr1" id="j3">0</td><td class="ctr2" id="k3">1</td></tr><tr><td id="a2"><a href="Game.java.html#L14" class="el_method">Game(InputStream)</a></td><td class="bar" id="b4"><img src="../../../.resources/greenbar.gif" width="12" height="10" title="17" alt="17"/></td><td class="ctr2" id="c2">100%</td><td class="bar" id="d4"/><td class="ctr2" id="e4">n/a</td><td class="ctr1" id="f4">0</td><td class="ctr2" id="g4">1</td><td class="ctr1" id="h4">0</td><td class="ctr2" id="i3">5</td><td class="ctr1" id="j4">0</td><td class="ctr2" id="k4">1</td></tr><tr><td id="a4"><a href="Game.java.html#L94" class="el_method">quitGame()</a></td><td class="bar" id="b5"><img src="../../../.resources/greenbar.gif" width="6" height="10" title="9" alt="9"/></td><td class="ctr2" id="c3">100%</td><td class="bar" id="d5"/><td class="ctr2" id="e5">n/a</td><td class="ctr1" id="f5">0</td><td class="ctr2" id="g5">1</td><td class="ctr1" id="h5">0</td><td class="ctr2" id="i5">2</td><td class="ctr1" id="j5">0</td><td class="ctr2" id="k5">1</td></tr></tbody></table><div class="footer"><span class="right">Created with <a href="http://www.eclemma.org/jacoco">JaCoCo</a> 0.7.2.201409121644</span>test (Feb 24, 2016 5:32:41 PM)</div></body></html>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" lang="en"><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/><link rel="stylesheet" href="../../../.resources/report.css" type="text/css"/><link rel="shortcut icon" href="../../../.resources/report.gif" type="image/gif"/><title>Game.java</title><link rel="stylesheet" href="../../../.resources/prettify.css" type="text/css"/><script type="text/javascript" src="../../../.resources/prettify.js"></script></head><body onload="window['PR_TAB_WIDTH']=4;prettyPrint()"><div class="breadcrumb" id="breadcrumb"><span class="info"><a href="../../../.sessions.html" class="el_session">Sessions</a></span><a href="../../../index.html" class="el_report">test (Feb 24, 2016 5:32:41 PM)</a> &gt; <a href="../../index.html" class="el_group">Bowling</a> &gt; <a href="../index.html" class="el_bundle">src</a> &gt; <a href="index.source.html" class="el_package">game</a> &gt; <span class="el_source">Game.java</span></div><h1>Game.java</h1><pre class="source lang-java linenums">package game;
import java.util.List;
import java.util.Scanner;
import java.io.IOException;
import java.io.InputStream;
import java.nio.file.FileSystems;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.InputMismatchException;
public class Game {
<span class="fc" id="L14"> private List&lt;Player&gt; players = new ArrayList&lt;Player&gt;();</span>
<span class="fc" id="L15"> private Scanner inputReader = null;</span>
<span class="fc" id="L17"> public Game(InputStream in) {</span>
<span class="fc" id="L18"> this.inputReader = new Scanner(in);</span>
<span class="fc" id="L19"> }</span>
private void enterPlayers(){
<span class="fc" id="L22"> int newPlayerNumber = 0;</span>
while(true) {
<span class="fc" id="L25"> System.out.format(&quot;Number of new players: &quot;);</span>
try {
<span class="fc" id="L27"> newPlayerNumber = inputReader.nextInt();</span>
<span class="fc" id="L28"> } catch (InputMismatchException i) {</span>
<span class="fc" id="L29"> System.out.println(inputReader.next() + &quot;is not a number.&quot;);</span>
}
<span class="pc bpc" id="L31" title="1 of 4 branches missed."> if (newPlayerNumber &gt; 0 || players.size() != 0) break;</span>
}
<span class="fc bfc" id="L34" title="All 2 branches covered."> for (int i = 0; i &lt; newPlayerNumber; ++i) {</span>
<span class="fc" id="L35"> System.out.format(&quot;Name of player %d (out of %d): &quot;, i + 1, newPlayerNumber);</span>
<span class="fc" id="L36"> String name = inputReader.next();</span>
<span class="fc" id="L37"> players.add(new Player(name));</span>
}
<span class="fc" id="L39"> }</span>
public Player startSet() {
<span class="fc" id="L44"> Set newSet = new Set(players);</span>
<span class="fc bfc" id="L45" title="All 2 branches covered."> while(!newSet.isOver()) {</span>
<span class="fc" id="L46"> Player next = newSet.getNextPlayer();</span>
<span class="fc bfc" id="L48" title="All 2 branches covered."> if (!next.isOff()) {</span>
<span class="fc" id="L49"> int point = -1;</span>
<span class="fc bfc" id="L50" title="All 4 branches covered."> while (point &lt; 0 || point &gt; 10) {</span>
<span class="fc" id="L51"> System.out.format(&quot;%n%s, please enter the point: &quot;, next.getName());</span>
<span class="fc bfc" id="L53" title="All 2 branches covered."> if (!inputReader.hasNextInt()) {</span>
<span class="fc" id="L54"> String command = inputReader.next();</span>
<span class="fc" id="L55"> inputReader.nextLine();</span>
<span class="fc bfc" id="L57" title="All 2 branches covered."> if (command.equals(&quot;score&quot;)) {</span>
<span class="fc bfc" id="L58" title="All 2 branches covered."> for (int i = 0; i &lt; players.size(); ++i) {</span>
<span class="fc" id="L59"> Player player = players.get(i);</span>
<span class="fc" id="L60"> System.out.format(&quot;%s's score table:%n%s%n&quot;, player.getName(), newSet.getScoreTable(player));</span>
}
<span class="fc bfc" id="L62" title="All 2 branches covered."> } else if (command.equals(&quot;quit&quot;)) {</span>
<span class="fc" id="L63"> next.quitNow();</span>
<span class="fc" id="L64"> System.out.format(&quot;%n%s has quit the game !%n&quot;, next.getName());</span>
<span class="fc" id="L65"> break;</span>
}
} else {
<span class="fc" id="L68"> point = inputReader.nextInt();</span>
<span class="fc" id="L69"> inputReader.nextLine();</span>
try {
<span class="fc" id="L72"> String info = newSet.enterPoint(point);</span>
<span class="fc bfc" id="L73" title="All 2 branches covered."> if (info != null) System.out.println(info);</span>
<span class="fc" id="L74"> System.out.format(&quot;%s's score table:%n%s%n&quot;, next.getName(), newSet.getScoreTable(next));</span>
<span class="fc" id="L75"> } catch (Exception e) {</span>
<span class="fc" id="L76"> System.out.println(e.getMessage());</span>
}
}
}
<span class="fc" id="L80"> } else {</span>
<span class="fc" id="L81"> int point = 0;</span>
try {
<span class="fc" id="L83"> newSet.enterPoint(point);</span>
//System.out.format(&quot;%s's score table:%n%s%n&quot;, next.getName(), newSet.getScoreTable(next));
<span class="pc" id="L85"> } catch (Exception e) {</span>
<span class="nc" id="L86"> System.out.println(e.getMessage());</span>
}
}
}
<span class="fc" id="L90"> return newSet.getWinner();</span>
}
public boolean quitGame() {
<span class="fc" id="L94"> System.out.println(&quot;\nGo on next set? (Type 'quit' to stop)&quot;);</span>
<span class="fc" id="L95"> return inputReader.next().equals(&quot;quit&quot;);</span>
}
public void enrollAllPlayers() {
<span class="fc bfc" id="L99" title="All 2 branches covered."> for (Player player : players) {</span>
<span class="fc bfc" id="L100" title="All 2 branches covered."> if (player.isOff())</span>
<span class="fc" id="L101"> player.onGame();</span>
}
<span class="fc" id="L103"> }</span>
public static void main (String[] args) {
<span class="fc" id="L107"> Game game = null;</span>
<span class="pc bpc" id="L108" title="1 of 2 branches missed."> if (args.length &gt;= 2) {</span>
<span class="fc" id="L109"> Path path = FileSystems.getDefault().getPath(&quot;src&quot;, &quot;test&quot;, args[1]);</span>
try {
<span class="fc" id="L111"> InputStream in = Files.newInputStream(path);</span>
<span class="fc" id="L112"> game = new Game(in);</span>
<span class="pc" id="L113"> } catch (IOException e) {</span>
<span class="nc" id="L114"> System.out.println(&quot;No file &quot; + path.toString() + &quot; found!&quot;);</span>
<span class="nc" id="L115"> System.out.println(&quot;Read input from System.in instead&quot;);</span>
<span class="nc" id="L116"> game = new Game(System.in);</span>
}
<span class="nc" id="L119"> } else {</span>
<span class="nc" id="L120"> game = new Game(System.in);</span>
}
while(true) {
<span class="fc" id="L124"> game.enterPlayers();</span>
<span class="fc" id="L125"> game.enrollAllPlayers();</span>
<span class="fc" id="L126"> Player winner = game.startSet();</span>
<span class="fc" id="L127"> System.out.println(&quot;Congratulations &quot; + winner.getName() + &quot;! You win!&quot;);</span>
<span class="fc bfc" id="L129" title="All 2 branches covered."> if (game.quitGame()) break;</span>
}
<span class="fc" id="L131"> }</span>
}
</pre><div class="footer"><span class="right">Created with <a href="http://www.eclemma.org/jacoco">JaCoCo</a> 0.7.2.201409121644</span>test (Feb 24, 2016 5:32:41 PM)</div></body></html>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" lang="en"><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/><link rel="stylesheet" href="../../../.resources/report.css" type="text/css"/><link rel="shortcut icon" href="../../../.resources/report.gif" type="image/gif"/><title>Player</title><script type="text/javascript" src="../../../.resources/sort.js"></script></head><body onload="initialSort(['breadcrumb'])"><div class="breadcrumb" id="breadcrumb"><span class="info"><a href="../../../.sessions.html" class="el_session">Sessions</a></span><a href="../../../index.html" class="el_report">test (Feb 24, 2016 5:32:41 PM)</a> &gt; <a href="../../index.html" class="el_group">Bowling</a> &gt; <a href="../index.html" class="el_bundle">src</a> &gt; <a href="index.html" class="el_package">game</a> &gt; <span class="el_class">Player</span></div><h1>Player</h1><table class="coverage" cellspacing="0" id="coveragetable"><thead><tr><td class="sortable" id="a" onclick="toggleSort(this)">Element</td><td class="down sortable bar" id="b" onclick="toggleSort(this)">Missed Instructions</td><td class="sortable ctr2" id="c" onclick="toggleSort(this)">Cov.</td><td class="sortable bar" id="d" onclick="toggleSort(this)">Missed Branches</td><td class="sortable ctr2" id="e" onclick="toggleSort(this)">Cov.</td><td class="sortable ctr1" id="f" onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="g" onclick="toggleSort(this)">Cxty</td><td class="sortable ctr1" id="h" onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="i" onclick="toggleSort(this)">Lines</td><td class="sortable ctr1" id="j" onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="k" onclick="toggleSort(this)">Methods</td></tr></thead><tfoot><tr><td>Total</td><td class="bar">0 of 29</td><td class="ctr2">100%</td><td class="bar">0 of 0</td><td class="ctr2">n/a</td><td class="ctr1">0</td><td class="ctr2">6</td><td class="ctr1">0</td><td class="ctr2">11</td><td class="ctr1">0</td><td class="ctr2">6</td></tr></tfoot><tbody><tr><td id="a3"><a href="Player.java.html#L7" class="el_method">Player(String)</a></td><td class="bar" id="b0"><img src="../../../.resources/greenbar.gif" width="120" height="10" title="10" alt="10"/></td><td class="ctr2" id="c0">100%</td><td class="bar" id="d0"/><td class="ctr2" id="e0">n/a</td><td class="ctr1" id="f0">0</td><td class="ctr2" id="g0">1</td><td class="ctr1" id="h0">0</td><td class="ctr2" id="i0">4</td><td class="ctr1" id="j0">0</td><td class="ctr2" id="k0">1</td></tr><tr><td id="a4"><a href="Player.java.html#L23" class="el_method">quitNow()</a></td><td class="bar" id="b1"><img src="../../../.resources/greenbar.gif" width="60" height="10" title="5" alt="5"/></td><td class="ctr2" id="c1">100%</td><td class="bar" id="d1"/><td class="ctr2" id="e1">n/a</td><td class="ctr1" id="f1">0</td><td class="ctr2" id="g1">1</td><td class="ctr1" id="h1">0</td><td class="ctr2" id="i1">2</td><td class="ctr1" id="j1">0</td><td class="ctr2" id="k1">1</td></tr><tr><td id="a2"><a href="Player.java.html#L31" class="el_method">onGame()</a></td><td class="bar" id="b2"><img src="../../../.resources/greenbar.gif" width="60" height="10" title="5" alt="5"/></td><td class="ctr2" id="c2">100%</td><td class="bar" id="d2"/><td class="ctr2" id="e2">n/a</td><td class="ctr1" id="f2">0</td><td class="ctr2" id="g2">1</td><td class="ctr1" id="h2">0</td><td class="ctr2" id="i2">2</td><td class="ctr1" id="j2">0</td><td class="ctr2" id="k2">1</td></tr><tr><td id="a0"><a href="Player.java.html#L14" class="el_method">getName()</a></td><td class="bar" id="b3"><img src="../../../.resources/greenbar.gif" width="36" height="10" title="3" alt="3"/></td><td class="ctr2" id="c3">100%</td><td class="bar" id="d3"/><td class="ctr2" id="e3">n/a</td><td class="ctr1" id="f3">0</td><td class="ctr2" id="g3">1</td><td class="ctr1" id="h3">0</td><td class="ctr2" id="i3">1</td><td class="ctr1" id="j3">0</td><td class="ctr2" id="k3">1</td></tr><tr><td id="a5"><a href="Player.java.html#L19" class="el_method">toString()</a></td><td class="bar" id="b4"><img src="../../../.resources/greenbar.gif" width="36" height="10" title="3" alt="3"/></td><td class="ctr2" id="c4">100%</td><td class="bar" id="d4"/><td class="ctr2" id="e4">n/a</td><td class="ctr1" id="f4">0</td><td class="ctr2" id="g4">1</td><td class="ctr1" id="h4">0</td><td class="ctr2" id="i4">1</td><td class="ctr1" id="j4">0</td><td class="ctr2" id="k4">1</td></tr><tr><td id="a1"><a href="Player.java.html#L27" class="el_method">isOff()</a></td><td class="bar" id="b5"><img src="../../../.resources/greenbar.gif" width="36" height="10" title="3" alt="3"/></td><td class="ctr2" id="c5">100%</td><td class="bar" id="d5"/><td class="ctr2" id="e5">n/a</td><td class="ctr1" id="f5">0</td><td class="ctr2" id="g5">1</td><td class="ctr1" id="h5">0</td><td class="ctr2" id="i5">1</td><td class="ctr1" id="j5">0</td><td class="ctr2" id="k5">1</td></tr></tbody></table><div class="footer"><span class="right">Created with <a href="http://www.eclemma.org/jacoco">JaCoCo</a> 0.7.2.201409121644</span>test (Feb 24, 2016 5:32:41 PM)</div></body></html>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" lang="en"><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/><link rel="stylesheet" href="../../../.resources/report.css" type="text/css"/><link rel="shortcut icon" href="../../../.resources/report.gif" type="image/gif"/><title>Player.java</title><link rel="stylesheet" href="../../../.resources/prettify.css" type="text/css"/><script type="text/javascript" src="../../../.resources/prettify.js"></script></head><body onload="window['PR_TAB_WIDTH']=4;prettyPrint()"><div class="breadcrumb" id="breadcrumb"><span class="info"><a href="../../../.sessions.html" class="el_session">Sessions</a></span><a href="../../../index.html" class="el_report">test (Feb 24, 2016 5:32:41 PM)</a> &gt; <a href="../../index.html" class="el_group">Bowling</a> &gt; <a href="../index.html" class="el_bundle">src</a> &gt; <a href="index.source.html" class="el_package">game</a> &gt; <span class="el_source">Player.java</span></div><h1>Player.java</h1><pre class="source lang-java linenums">package game;
public class Player {
private final String name;
<span class="fc" id="L7"> private Boolean quit = false;</span>
<span class="fc" id="L9"> public Player(String name) {</span>
<span class="fc" id="L10"> this.name = name;</span>
<span class="fc" id="L11"> }</span>
public String getName() {
<span class="fc" id="L14"> return this.name;</span>
}
@Override
public String toString() {
<span class="fc" id="L19"> return this.name;</span>
}
public void quitNow() {
<span class="fc" id="L23"> this.quit = true;</span>
<span class="fc" id="L24"> }</span>
public Boolean isOff() {
<span class="fc" id="L27"> return quit;</span>
}
public void onGame() {
<span class="fc" id="L31"> this.quit = false;</span>
<span class="fc" id="L32"> }</span>
}
</pre><div class="footer"><span class="right">Created with <a href="http://www.eclemma.org/jacoco">JaCoCo</a> 0.7.2.201409121644</span>test (Feb 24, 2016 5:32:41 PM)</div></body></html>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" lang="en"><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/><link rel="stylesheet" href="../../../.resources/report.css" type="text/css"/><link rel="shortcut icon" href="../../../.resources/report.gif" type="image/gif"/><title>ScoreTable</title><script type="text/javascript" src="../../../.resources/sort.js"></script></head><body onload="initialSort(['breadcrumb'])"><div class="breadcrumb" id="breadcrumb"><span class="info"><a href="../../../.sessions.html" class="el_session">Sessions</a></span><a href="../../../index.html" class="el_report">test (Feb 24, 2016 5:32:41 PM)</a> &gt; <a href="../../index.html" class="el_group">Bowling</a> &gt; <a href="../index.html" class="el_bundle">src</a> &gt; <a href="index.html" class="el_package">game</a> &gt; <span class="el_class">ScoreTable</span></div><h1>ScoreTable</h1><table class="coverage" cellspacing="0" id="coveragetable"><thead><tr><td class="sortable" id="a" onclick="toggleSort(this)">Element</td><td class="down sortable bar" id="b" onclick="toggleSort(this)">Missed Instructions</td><td class="sortable ctr2" id="c" onclick="toggleSort(this)">Cov.</td><td class="sortable bar" id="d" onclick="toggleSort(this)">Missed Branches</td><td class="sortable ctr2" id="e" onclick="toggleSort(this)">Cov.</td><td class="sortable ctr1" id="f" onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="g" onclick="toggleSort(this)">Cxty</td><td class="sortable ctr1" id="h" onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="i" onclick="toggleSort(this)">Lines</td><td class="sortable ctr1" id="j" onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="k" onclick="toggleSort(this)">Methods</td></tr></thead><tfoot><tr><td>Total</td><td class="bar">2 of 355</td><td class="ctr2">99%</td><td class="bar">3 of 60</td><td class="ctr2">95%</td><td class="ctr1">3</td><td class="ctr2">38</td><td class="ctr1">0</td><td class="ctr2">65</td><td class="ctr1">0</td><td class="ctr2">8</td></tr></tfoot><tbody><tr><td id="a1"><a href="ScoreTable.java.html#L22" class="el_method">getCurrentFrame()</a></td><td class="bar" id="b0"><img src="../../../.resources/redbar.gif" width="2" height="10" title="2" alt="2"/><img src="../../../.resources/greenbar.gif" width="15" height="10" title="14" alt="14"/></td><td class="ctr2" id="c7">88%</td><td class="bar" id="d1"><img src="../../../.resources/redbar.gif" width="5" height="10" title="1" alt="1"/><img src="../../../.resources/greenbar.gif" width="5" height="10" title="1" alt="1"/></td><td class="ctr2" id="e5">50%</td><td class="ctr1" id="f1">1</td><td class="ctr2" id="g4">2</td><td class="ctr1" id="h0">0</td><td class="ctr2" id="i5">2</td><td class="ctr1" id="j0">0</td><td class="ctr2" id="k0">1</td></tr><tr><td id="a7"><a href="ScoreTable.java.html#L71" class="el_method">updateScoreTable()</a></td><td class="bar" id="b1"><img src="../../../.resources/greenbar.gif" width="120" height="10" title="106" alt="106"/></td><td class="ctr2" id="c0">100%</td><td class="bar" id="d2"><img src="../../../.resources/greenbar.gif" width="110" height="10" title="22" alt="22"/></td><td class="ctr2" id="e0">100%</td><td class="ctr1" id="f2">0</td><td class="ctr2" id="g1">12</td><td class="ctr1" id="h1">0</td><td class="ctr2" id="i0">26</td><td class="ctr1" id="j1">0</td><td class="ctr2" id="k1">1</td></tr><tr><td id="a4"><a href="ScoreTable.java.html#L39" class="el_method">isComplete()</a></td><td class="bar" id="b2"><img src="../../../.resources/greenbar.gif" width="89" height="10" title="79" alt="79"/></td><td class="ctr2" id="c1">100%</td><td class="bar" id="d0"><img src="../../../.resources/redbar.gif" width="10" height="10" title="2" alt="2"/><img src="../../../.resources/greenbar.gif" width="110" height="10" title="22" alt="22"/></td><td class="ctr2" id="e4">92%</td><td class="ctr1" id="f0">2</td><td class="ctr2" id="g0">13</td><td class="ctr1" id="h2">0</td><td class="ctr2" id="i1">11</td><td class="ctr1" id="j2">0</td><td class="ctr2" id="k2">1</td></tr><tr><td id="a5"><a href="ScoreTable.java.html#L27" class="el_method">readTable()</a></td><td class="bar" id="b3"><img src="../../../.resources/greenbar.gif" width="86" height="10" title="76" alt="76"/></td><td class="ctr2" id="c2">100%</td><td class="bar" id="d3"><img src="../../../.resources/greenbar.gif" width="30" height="10" title="6" alt="6"/></td><td class="ctr2" id="e1">100%</td><td class="ctr1" id="f3">0</td><td class="ctr2" id="g2">4</td><td class="ctr1" id="h3">0</td><td class="ctr2" id="i3">8</td><td class="ctr1" id="j3">0</td><td class="ctr2" id="k3">1</td></tr><tr><td id="a3"><a href="ScoreTable.java.html#L54" class="el_method">getFrameToEnter()</a></td><td class="bar" id="b4"><img src="../../../.resources/greenbar.gif" width="52" height="10" title="46" alt="46"/></td><td class="ctr2" id="c3">100%</td><td class="bar" id="d4"><img src="../../../.resources/greenbar.gif" width="20" height="10" title="4" alt="4"/></td><td class="ctr2" id="e2">100%</td><td class="ctr1" id="f4">0</td><td class="ctr2" id="g3">3</td><td class="ctr1" id="h4">0</td><td class="ctr2" id="i2">11</td><td class="ctr1" id="j4">0</td><td class="ctr2" id="k4">1</td></tr><tr><td id="a2"><a href="ScoreTable.java.html#L17" class="el_method">getCurrentScore()</a></td><td class="bar" id="b5"><img src="../../../.resources/greenbar.gif" width="19" height="10" title="17" alt="17"/></td><td class="ctr2" id="c4">100%</td><td class="bar" id="d5"><img src="../../../.resources/greenbar.gif" width="10" height="10" title="2" alt="2"/></td><td class="ctr2" id="e3">100%</td><td class="ctr1" id="f5">0</td><td class="ctr2" id="g5">2</td><td class="ctr1" id="h5">0</td><td class="ctr2" id="i6">2</td><td class="ctr1" id="j5">0</td><td class="ctr2" id="k5">1</td></tr><tr><td id="a6"><a href="ScoreTable.java.html#L7" class="el_method">ScoreTable()</a></td><td class="bar" id="b6"><img src="../../../.resources/greenbar.gif" width="9" height="10" title="8" alt="8"/></td><td class="ctr2" id="c5">100%</td><td class="bar" id="d6"/><td class="ctr2" id="e6">n/a</td><td class="ctr1" id="f6">0</td><td class="ctr2" id="g6">1</td><td class="ctr1" id="h6">0</td><td class="ctr2" id="i7">2</td><td class="ctr1" id="j6">0</td><td class="ctr2" id="k6">1</td></tr><tr><td id="a0"><a href="ScoreTable.java.html#L12" class="el_method">enterPoint(int)</a></td><td class="bar" id="b7"><img src="../../../.resources/greenbar.gif" width="7" height="10" title="7" alt="7"/></td><td class="ctr2" id="c6">100%</td><td class="bar" id="d7"/><td class="ctr2" id="e7">n/a</td><td class="ctr1" id="f7">0</td><td class="ctr2" id="g7">1</td><td class="ctr1" id="h7">0</td><td class="ctr2" id="i4">3</td><td class="ctr1" id="j7">0</td><td class="ctr2" id="k7">1</td></tr></tbody></table><div class="footer"><span class="right">Created with <a href="http://www.eclemma.org/jacoco">JaCoCo</a> 0.7.2.201409121644</span>test (Feb 24, 2016 5:32:41 PM)</div></body></html>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" lang="en"><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/><link rel="stylesheet" href="../../../.resources/report.css" type="text/css"/><link rel="shortcut icon" href="../../../.resources/report.gif" type="image/gif"/><title>ScoreTable.java</title><link rel="stylesheet" href="../../../.resources/prettify.css" type="text/css"/><script type="text/javascript" src="../../../.resources/prettify.js"></script></head><body onload="window['PR_TAB_WIDTH']=4;prettyPrint()"><div class="breadcrumb" id="breadcrumb"><span class="info"><a href="../../../.sessions.html" class="el_session">Sessions</a></span><a href="../../../index.html" class="el_report">test (Feb 24, 2016 5:32:41 PM)</a> &gt; <a href="../../index.html" class="el_group">Bowling</a> &gt; <a href="../index.html" class="el_bundle">src</a> &gt; <a href="index.source.html" class="el_package">game</a> &gt; <span class="el_source">ScoreTable.java</span></div><h1>ScoreTable.java</h1><pre class="source lang-java linenums">package game;
import java.util.List;
import java.util.ArrayList;
public class ScoreTable {
<span class="fc" id="L7"> private List&lt;Frame&gt; frames = new ArrayList&lt;Frame&gt;();</span>
<span class="fc" id="L9"> public ScoreTable() {}</span>
public void enterPoint(int point) throws Exception {
<span class="fc" id="L12"> getFrameToEnter().enterPoint(point);</span>
<span class="fc" id="L13"> updateScoreTable();</span>
<span class="fc" id="L14"> }</span>
public int getCurrentScore() {
<span class="fc bfc" id="L17" title="All 2 branches covered."> if (frames.size() == 0) return 0;</span>
<span class="fc" id="L18"> return frames.get(frames.size() - 1).getScore();</span>
}
public Frame getCurrentFrame() {
<span class="pc bpc" id="L22" title="1 of 2 branches missed."> if (frames.size() == 0) return null;</span>
<span class="fc" id="L23"> else return frames.get(frames.size() - 1);</span>
}
public String readTable() {
<span class="fc" id="L27"> StringBuffer pins = new StringBuffer();</span>
<span class="fc" id="L28"> StringBuffer scores = new StringBuffer();</span>
<span class="fc bfc" id="L29" title="All 2 branches covered."> for (int i = 0; i &lt; frames.size(); ++i) {</span>
<span class="fc" id="L30"> Frame frame = frames.get(i);</span>
<span class="fc" id="L31"> pins.append(String.format(&quot;|%5d %2d&quot;, frame.getFirstLance(),</span>
<span class="fc bfc" id="L32" title="All 4 branches covered."> frame.isStrike() || !frame.isFinished() ? 0 : frame.getSecondLance()));</span>
<span class="fc" id="L33"> scores.append(String.format(&quot;|%3d &quot;, frame.getScore()));</span>
}
<span class="fc" id="L35"> return pins.toString() + &quot;\n&quot; + scores.toString();</span>
}
public boolean isComplete() {
<span class="fc" id="L39"> int framesNumber = frames.size();</span>
<span class="fc bfc" id="L40" title="All 2 branches covered."> if (framesNumber &lt; 10) return false;</span>
<span class="fc bfc" id="L41" title="All 2 branches covered."> else if (framesNumber == 10) {</span>
<span class="fc" id="L42"> Frame frame = frames.get(framesNumber - 1);</span>
<span class="fc bfc" id="L43" title="All 6 branches covered."> return frame.isFinished() &amp;&amp; !frame.isSpare() &amp;&amp; !frame.isStrike();</span>
<span class="fc bfc" id="L44" title="All 2 branches covered."> } else if (framesNumber == 11) {</span>
<span class="fc" id="L45"> Frame currentFrame = frames.get(framesNumber - 1);</span>
<span class="fc" id="L46"> Frame lastFrame = frames.get(framesNumber - 2);</span>
<span class="pc bpc" id="L48" title="1 of 6 branches missed."> boolean hasTwoBalls = currentFrame.isSpare() || (currentFrame.isFinished() &amp;&amp; !currentFrame.isStrike());</span>
<span class="pc bpc" id="L49" title="1 of 6 branches missed."> return lastFrame.isSpare() || (lastFrame.isStrike() &amp;&amp; hasTwoBalls);</span>
<span class="fc" id="L50"> } else return true;</span>
}
private Frame getFrameToEnter() {
<span class="fc" id="L54"> Frame frame = null;</span>
<span class="fc bfc" id="L56" title="All 2 branches covered."> if (frames.size() == 0) {</span>
<span class="fc" id="L57"> frame = new Frame(0);</span>
<span class="fc" id="L58"> this.frames.add(frame);</span>
<span class="fc" id="L59"> } else {</span>
<span class="fc" id="L60"> Frame currentFrame = frames.get(frames.size() - 1);</span>
<span class="fc bfc" id="L61" title="All 2 branches covered."> if (currentFrame.isFinished()) {</span>
<span class="fc" id="L62"> frame = new Frame(currentFrame.getScore());</span>
<span class="fc" id="L63"> this.frames.add(frame);</span>
<span class="fc" id="L64"> } else frame = currentFrame;</span>
}
<span class="fc" id="L67"> return frame;</span>
}
private void updateScoreTable() {
<span class="fc" id="L71"> int numberFrames = frames.size();</span>
<span class="fc" id="L72"> Frame currentFrame = frames.get(numberFrames - 1);</span>
<span class="fc bfc" id="L73" title="All 2 branches covered."> Frame lastFrame = numberFrames &gt; 1 ? frames.get(numberFrames - 2) : null;</span>
<span class="fc bfc" id="L74" title="All 2 branches covered."> Frame beforeLastFrame = numberFrames &gt; 2 ? frames.get(numberFrames - 3) : null;</span>
<span class="fc bfc" id="L76" title="All 2 branches covered."> if (lastFrame == null) {</span>
<span class="fc" id="L77"> return;</span>
<span class="fc bfc" id="L78" title="All 4 branches covered."> } else if (currentFrame.isStrike() || !currentFrame.isFinished()) {</span>
<span class="fc" id="L79"> int bonus = 0;</span>
<span class="fc" id="L80"> int lance = currentFrame.getFirstLance();</span>
<span class="fc bfc" id="L82" title="All 4 branches covered."> if (lastFrame.isStrike() || lastFrame.isSpare()) {</span>
<span class="fc" id="L83"> lastFrame.addBonus(lance);</span>
<span class="fc" id="L84"> bonus += lance;</span>
}
<span class="fc bfc" id="L87" title="All 4 branches covered."> if (beforeLastFrame != null &amp;&amp; beforeLastFrame.isStrike()</span>
<span class="fc bfc" id="L88" title="All 2 branches covered."> &amp;&amp; lastFrame.isStrike()) {</span>
<span class="fc" id="L89"> beforeLastFrame.addBonus(lance);</span>
<span class="fc" id="L90"> lastFrame.addBonus(lance);</span>
<span class="fc" id="L91"> bonus += lance;</span>
}
<span class="fc" id="L94"> currentFrame.addBonus(bonus);</span>
<span class="fc" id="L95"> } else {</span>
<span class="fc" id="L96"> int bonus = 0;</span>
<span class="fc" id="L97"> int lance = currentFrame.getSecondLance();</span>
<span class="fc bfc" id="L99" title="All 2 branches covered."> if (lastFrame.isStrike()) {</span>
<span class="fc" id="L100"> lastFrame.addBonus(lance);</span>
<span class="fc" id="L101"> bonus += lance;</span>
}
<span class="fc" id="L104"> currentFrame.addBonus(bonus);</span>
}
<span class="fc" id="L106"> }</span>
}
</pre><div class="footer"><span class="right">Created with <a href="http://www.eclemma.org/jacoco">JaCoCo</a> 0.7.2.201409121644</span>test (Feb 24, 2016 5:32:41 PM)</div></body></html>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" lang="en"><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/><link rel="stylesheet" href="../../../.resources/report.css" type="text/css"/><link rel="shortcut icon" href="../../../.resources/report.gif" type="image/gif"/><title>Set</title><script type="text/javascript" src="../../../.resources/sort.js"></script></head><body onload="initialSort(['breadcrumb'])"><div class="breadcrumb" id="breadcrumb"><span class="info"><a href="../../../.sessions.html" class="el_session">Sessions</a></span><a href="../../../index.html" class="el_report">test (Feb 24, 2016 5:32:41 PM)</a> &gt; <a href="../../index.html" class="el_group">Bowling</a> &gt; <a href="../index.html" class="el_bundle">src</a> &gt; <a href="index.html" class="el_package">game</a> &gt; <span class="el_class">Set</span></div><h1>Set</h1><table class="coverage" cellspacing="0" id="coveragetable"><thead><tr><td class="sortable" id="a" onclick="toggleSort(this)">Element</td><td class="down sortable bar" id="b" onclick="toggleSort(this)">Missed Instructions</td><td class="sortable ctr2" id="c" onclick="toggleSort(this)">Cov.</td><td class="sortable bar" id="d" onclick="toggleSort(this)">Missed Branches</td><td class="sortable ctr2" id="e" onclick="toggleSort(this)">Cov.</td><td class="sortable ctr1" id="f" onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="g" onclick="toggleSort(this)">Cxty</td><td class="sortable ctr1" id="h" onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="i" onclick="toggleSort(this)">Lines</td><td class="sortable ctr1" id="j" onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="k" onclick="toggleSort(this)">Methods</td></tr></thead><tfoot><tr><td>Total</td><td class="bar">0 of 198</td><td class="ctr2">100%</td><td class="bar">0 of 26</td><td class="ctr2">100%</td><td class="ctr1">0</td><td class="ctr2">20</td><td class="ctr1">0</td><td class="ctr2">41</td><td class="ctr1">0</td><td class="ctr2">7</td></tr></tfoot><tbody><tr><td id="a6"><a href="Set.java.html#L60" class="el_method">updatePlayerIndex()</a></td><td class="bar" id="b0"><img src="../../../.resources/greenbar.gif" width="120" height="10" title="73" alt="73"/></td><td class="ctr2" id="c0">100%</td><td class="bar" id="d0"><img src="../../../.resources/greenbar.gif" width="120" height="10" title="14" alt="14"/></td><td class="ctr2" id="e0">100%</td><td class="ctr1" id="f0">0</td><td class="ctr2" id="g0">8</td><td class="ctr1" id="h0">0</td><td class="ctr2" id="i0">13</td><td class="ctr1" id="j0">0</td><td class="ctr2" id="k0">1</td></tr><tr><td id="a3"><a href="Set.java.html#L45" class="el_method">getWinner()</a></td><td class="bar" id="b1"><img src="../../../.resources/greenbar.gif" width="60" height="10" title="37" alt="37"/></td><td class="ctr2" id="c1">100%</td><td class="bar" id="d1"><img src="../../../.resources/greenbar.gif" width="34" height="10" title="4" alt="4"/></td><td class="ctr2" id="e1">100%</td><td class="ctr1" id="f1">0</td><td class="ctr2" id="g1">3</td><td class="ctr1" id="h1">0</td><td class="ctr2" id="i1">10</td><td class="ctr1" id="j1">0</td><td class="ctr2" id="k1">1</td></tr><tr><td id="a5"><a href="Set.java.html#L9" class="el_method">Set(List)</a></td><td class="bar" id="b2"><img src="../../../.resources/greenbar.gif" width="59" height="10" title="36" alt="36"/></td><td class="ctr2" id="c2">100%</td><td class="bar" id="d3"><img src="../../../.resources/greenbar.gif" width="17" height="10" title="2" alt="2"/></td><td class="ctr2" id="e2">100%</td><td class="ctr1" id="f2">0</td><td class="ctr2" id="g3">2</td><td class="ctr1" id="h2">0</td><td class="ctr2" id="i2">8</td><td class="ctr1" id="j2">0</td><td class="ctr2" id="k2">1</td></tr><tr><td id="a0"><a href="Set.java.html#L21" class="el_method">enterPoint(int)</a></td><td class="bar" id="b3"><img src="../../../.resources/greenbar.gif" width="49" height="10" title="30" alt="30"/></td><td class="ctr2" id="c3">100%</td><td class="bar" id="d2"><img src="../../../.resources/greenbar.gif" width="34" height="10" title="4" alt="4"/></td><td class="ctr2" id="e3">100%</td><td class="ctr1" id="f3">0</td><td class="ctr2" id="g2">3</td><td class="ctr1" id="h3">0</td><td class="ctr2" id="i3">7</td><td class="ctr1" id="j3">0</td><td class="ctr2" id="k3">1</td></tr><tr><td id="a4"><a href="Set.java.html#L37" class="el_method">isOver()</a></td><td class="bar" id="b4"><img src="../../../.resources/greenbar.gif" width="13" height="10" title="8" alt="8"/></td><td class="ctr2" id="c4">100%</td><td class="bar" id="d4"><img src="../../../.resources/greenbar.gif" width="17" height="10" title="2" alt="2"/></td><td class="ctr2" id="e4">100%</td><td class="ctr1" id="f4">0</td><td class="ctr2" id="g4">2</td><td class="ctr1" id="h4">0</td><td class="ctr2" id="i4">1</td><td class="ctr1" id="j4">0</td><td class="ctr2" id="k4">1</td></tr><tr><td id="a1"><a href="Set.java.html#L33" class="el_method">getNextPlayer()</a></td><td class="bar" id="b5"><img src="../../../.resources/greenbar.gif" width="11" height="10" title="7" alt="7"/></td><td class="ctr2" id="c5">100%</td><td class="bar" id="d5"/><td class="ctr2" id="e5">n/a</td><td class="ctr1" id="f5">0</td><td class="ctr2" id="g5">1</td><td class="ctr1" id="h5">0</td><td class="ctr2" id="i5">1</td><td class="ctr1" id="j5">0</td><td class="ctr2" id="k5">1</td></tr><tr><td id="a2"><a href="Set.java.html#L41" class="el_method">getScoreTable(Player)</a></td><td class="bar" id="b6"><img src="../../../.resources/greenbar.gif" width="11" height="10" title="7" alt="7"/></td><td class="ctr2" id="c6">100%</td><td class="bar" id="d6"/><td class="ctr2" id="e6">n/a</td><td class="ctr1" id="f6">0</td><td class="ctr2" id="g6">1</td><td class="ctr1" id="h6">0</td><td class="ctr2" id="i6">1</td><td class="ctr1" id="j6">0</td><td class="ctr2" id="k6">1</td></tr></tbody></table><div class="footer"><span class="right">Created with <a href="http://www.eclemma.org/jacoco">JaCoCo</a> 0.7.2.201409121644</span>test (Feb 24, 2016 5:32:41 PM)</div></body></html>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" lang="en"><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/><link rel="stylesheet" href="../../../.resources/report.css" type="text/css"/><link rel="shortcut icon" href="../../../.resources/report.gif" type="image/gif"/><title>Set.java</title><link rel="stylesheet" href="../../../.resources/prettify.css" type="text/css"/><script type="text/javascript" src="../../../.resources/prettify.js"></script></head><body onload="window['PR_TAB_WIDTH']=4;prettyPrint()"><div class="breadcrumb" id="breadcrumb"><span class="info"><a href="../../../.sessions.html" class="el_session">Sessions</a></span><a href="../../../index.html" class="el_report">test (Feb 24, 2016 5:32:41 PM)</a> &gt; <a href="../../index.html" class="el_group">Bowling</a> &gt; <a href="../index.html" class="el_bundle">src</a> &gt; <a href="index.source.html" class="el_package">game</a> &gt; <span class="el_source">Set.java</span></div><h1>Set.java</h1><pre class="source lang-java linenums">package game;
import java.util.HashMap;
import java.util.List;
public class Set {
private final List&lt;Player&gt; players;
private HashMap&lt;Player, ScoreTable&gt; tables;
<span class="fc" id="L9"> private int currentPlayerIndex = 0;</span>
<span class="fc" id="L10"> private int frameCount = 0;</span>
<span class="fc" id="L12"> public Set(List&lt;Player&gt; players) {</span>
<span class="fc" id="L13"> this.players = players;</span>
<span class="fc" id="L14"> this.tables = new HashMap&lt;Player, ScoreTable&gt;();</span>
<span class="fc bfc" id="L15" title="All 2 branches covered."> for (Player player : players) {</span>
<span class="fc" id="L16"> tables.put(player, new ScoreTable());</span>
}
<span class="fc" id="L18"> }</span>
public String enterPoint(int point) throws Exception {
<span class="fc" id="L21"> ScoreTable tableToEnter = tables.get(players.get(currentPlayerIndex));</span>
<span class="fc" id="L22"> tableToEnter.enterPoint(point);</span>
<span class="fc" id="L24"> updatePlayerIndex();</span>
<span class="fc" id="L26"> Frame current = tableToEnter.getCurrentFrame();</span>
<span class="fc bfc" id="L27" title="All 2 branches covered."> if (current.isStrike()) return &quot;You made a Strike!&quot;;</span>
<span class="fc bfc" id="L28" title="All 2 branches covered."> else if (current.isSpare()) return &quot;You made a Spare!&quot;;</span>
<span class="fc" id="L29"> else return null;</span>
}
public Player getNextPlayer() {
<span class="fc" id="L33"> return players.get(currentPlayerIndex);</span>
}
public boolean isOver() {
<span class="fc bfc" id="L37" title="All 2 branches covered."> return currentPlayerIndex == -1;</span>
}
public String getScoreTable(Player player) {
<span class="fc" id="L41"> return tables.get(player).readTable();</span>
}
public Player getWinner() {
<span class="fc" id="L45"> Player winner = null;</span>
<span class="fc" id="L46"> int maxScore = 0;</span>
<span class="fc bfc" id="L47" title="All 2 branches covered."> for (int i = 0; i &lt; players.size(); ++i) {</span>
<span class="fc" id="L48"> Player player = players.get(i);</span>
<span class="fc" id="L49"> ScoreTable table = tables.get(player);</span>
<span class="fc" id="L50"> int score = table.getCurrentScore();</span>
<span class="fc bfc" id="L51" title="All 2 branches covered."> if (score &gt; maxScore) {</span>
<span class="fc" id="L52"> maxScore = score;</span>
<span class="fc" id="L53"> winner = player;</span>
}
}
<span class="fc" id="L56"> return winner;</span>
}
private void updatePlayerIndex() {
<span class="fc bfc" id="L60" title="All 2 branches covered."> if (frameCount &lt; 10) {</span>
<span class="fc" id="L61"> Frame currentFrame = tables.get(players.get(currentPlayerIndex)).getCurrentFrame();</span>
<span class="fc bfc" id="L62" title="All 2 branches covered."> if (currentFrame.isFinished()) currentPlayerIndex++;</span>
<span class="fc bfc" id="L64" title="All 2 branches covered."> if (currentPlayerIndex == players.size()) {</span>
<span class="fc" id="L65"> currentPlayerIndex = 0;</span>
<span class="fc" id="L66"> frameCount++;</span>
}
}
<span class="fc bfc" id="L70" title="All 2 branches covered."> if (frameCount == 10) {</span>
<span class="fc" id="L71"> int nextPlayerIndex = -1;</span>
<span class="fc bfc" id="L73" title="All 4 branches covered."> for (int i = 0; i &lt; players.size() &amp;&amp; nextPlayerIndex == -1; ++i) {</span>
<span class="fc bfc" id="L74" title="All 2 branches covered."> if (!tables.get(players.get(i)).isComplete())</span>
<span class="fc" id="L75"> nextPlayerIndex = i;</span>
}
<span class="fc" id="L77"> currentPlayerIndex = nextPlayerIndex;</span>
}
<span class="fc" id="L79"> }</span>
}
</pre><div class="footer"><span class="right">Created with <a href="http://www.eclemma.org/jacoco">JaCoCo</a> 0.7.2.201409121644</span>test (Feb 24, 2016 5:32:41 PM)</div></body></html>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" lang="en"><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/><link rel="stylesheet" href="../../../.resources/report.css" type="text/css"/><link rel="shortcut icon" href="../../../.resources/report.gif" type="image/gif"/><title>game</title><script type="text/javascript" src="../../../.resources/sort.js"></script></head><body onload="initialSort(['breadcrumb', 'coveragetable'])"><div class="breadcrumb" id="breadcrumb"><span class="info"><a href="index.source.html" class="el_source">Source Files</a><a href="../../../.sessions.html" class="el_session">Sessions</a></span><a href="../../../index.html" class="el_report">test (Feb 24, 2016 5:32:41 PM)</a> &gt; <a href="../../index.html" class="el_group">Bowling</a> &gt; <a href="../index.html" class="el_bundle">src</a> &gt; <span class="el_package">game</span></div><h1>game</h1><table class="coverage" cellspacing="0" id="coveragetable"><thead><tr><td class="sortable" id="a" onclick="toggleSort(this)">Element</td><td class="down sortable bar" id="b" onclick="toggleSort(this)">Missed Instructions</td><td class="sortable ctr2" id="c" onclick="toggleSort(this)">Cov.</td><td class="sortable bar" id="d" onclick="toggleSort(this)">Missed Branches</td><td class="sortable ctr2" id="e" onclick="toggleSort(this)">Cov.</td><td class="sortable ctr1" id="f" onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="g" onclick="toggleSort(this)">Cxty</td><td class="sortable ctr1" id="h" onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="i" onclick="toggleSort(this)">Lines</td><td class="sortable ctr1" id="j" onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="k" onclick="toggleSort(this)">Methods</td><td class="sortable ctr1" id="l" onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="m" onclick="toggleSort(this)">Classes</td></tr></thead><tfoot><tr><td>Total</td><td class="bar">34 of 1,054</td><td class="ctr2">97%</td><td class="bar">5 of 136</td><td class="ctr2">96%</td><td class="ctr1">5</td><td class="ctr2">104</td><td class="ctr1">6</td><td class="ctr2">209</td><td class="ctr1">0</td><td class="ctr2">36</td><td class="ctr1">0</td><td class="ctr2">5</td></tr></tfoot><tbody><tr><td id="a1"><a href="Game.html" class="el_class">Game</a></td><td class="bar" id="b0"><img src="../../../.resources/redbar.gif" width="10" height="10" title="32" alt="32"/><img src="../../../.resources/greenbar.gif" width="109" height="10" title="325" alt="325"/></td><td class="ctr2" id="c4">91%</td><td class="bar" id="d1"><img src="../../../.resources/redbar.gif" width="4" height="10" title="2" alt="2"/><img src="../../../.resources/greenbar.gif" width="60" height="10" title="30" alt="30"/></td><td class="ctr2" id="e3">94%</td><td class="ctr1" id="f1">2</td><td class="ctr2" id="g1">22</td><td class="ctr1" id="h0">6</td><td class="ctr2" id="i0">70</td><td class="ctr1" id="j0">0</td><td class="ctr2" id="k3">6</td><td class="ctr1" id="l0">0</td><td class="ctr2" id="m0">1</td></tr><tr><td id="a3"><a href="ScoreTable.html" class="el_class">ScoreTable</a></td><td class="bar" id="b1"><img src="../../../.resources/greenbar.gif" width="118" height="10" title="353" alt="353"/></td><td class="ctr2" id="c3">99%</td><td class="bar" id="d0"><img src="../../../.resources/redbar.gif" width="6" height="10" title="3" alt="3"/><img src="../../../.resources/greenbar.gif" width="114" height="10" title="57" alt="57"/></td><td class="ctr2" id="e2">95%</td><td class="ctr1" id="f0">3</td><td class="ctr2" id="g0">38</td><td class="ctr1" id="h1">0</td><td class="ctr2" id="i1">65</td><td class="ctr1" id="j1">0</td><td class="ctr2" id="k1">8</td><td class="ctr1" id="l1">0</td><td class="ctr2" id="m1">1</td></tr><tr><td id="a4"><a href="Set.html" class="el_class">Set</a></td><td class="bar" id="b2"><img src="../../../.resources/greenbar.gif" width="66" height="10" title="198" alt="198"/></td><td class="ctr2" id="c0">100%</td><td class="bar" id="d2"><img src="../../../.resources/greenbar.gif" width="52" height="10" title="26" alt="26"/></td><td class="ctr2" id="e0">100%</td><td class="ctr1" id="f2">0</td><td class="ctr2" id="g2">20</td><td class="ctr1" id="h2">0</td><td class="ctr2" id="i2">41</td><td class="ctr1" id="j2">0</td><td class="ctr2" id="k2">7</td><td class="ctr1" id="l2">0</td><td class="ctr2" id="m2">1</td></tr><tr><td id="a0"><a href="Frame.html" class="el_class">Frame</a></td><td class="bar" id="b3"><img src="../../../.resources/greenbar.gif" width="38" height="10" title="115" alt="115"/></td><td class="ctr2" id="c1">100%</td><td class="bar" id="d3"><img src="../../../.resources/greenbar.gif" width="36" height="10" title="18" alt="18"/></td><td class="ctr2" id="e1">100%</td><td class="ctr1" id="f3">0</td><td class="ctr2" id="g3">18</td><td class="ctr1" id="h3">0</td><td class="ctr2" id="i3">22</td><td class="ctr1" id="j3">0</td><td class="ctr2" id="k0">9</td><td class="ctr1" id="l3">0</td><td class="ctr2" id="m3">1</td></tr><tr><td id="a2"><a href="Player.html" class="el_class">Player</a></td><td class="bar" id="b4"><img src="../../../.resources/greenbar.gif" width="9" height="10" title="29" alt="29"/></td><td class="ctr2" id="c2">100%</td><td class="bar" id="d4"/><td class="ctr2" id="e4">n/a</td><td class="ctr1" id="f4">0</td><td class="ctr2" id="g4">6</td><td class="ctr1" id="h4">0</td><td class="ctr2" id="i4">11</td><td class="ctr1" id="j4">0</td><td class="ctr2" id="k4">6</td><td class="ctr1" id="l4">0</td><td class="ctr2" id="m4">1</td></tr></tbody></table><div class="footer"><span class="right">Created with <a href="http://www.eclemma.org/jacoco">JaCoCo</a> 0.7.2.201409121644</span>test (Feb 24, 2016 5:32:41 PM)</div></body></html>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" lang="en"><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/><link rel="stylesheet" href="../../../.resources/report.css" type="text/css"/><link rel="shortcut icon" href="../../../.resources/report.gif" type="image/gif"/><title>game</title><script type="text/javascript" src="../../../.resources/sort.js"></script></head><body onload="initialSort(['breadcrumb', 'coveragetable'])"><div class="breadcrumb" id="breadcrumb"><span class="info"><a href="index.html" class="el_class">Classes</a><a href="../../../.sessions.html" class="el_session">Sessions</a></span><a href="../../../index.html" class="el_report">test (Feb 24, 2016 5:32:41 PM)</a> &gt; <a href="../../index.html" class="el_group">Bowling</a> &gt; <a href="../index.html" class="el_bundle">src</a> &gt; <span class="el_package">game</span></div><h1>game</h1><table class="coverage" cellspacing="0" id="coveragetable"><thead><tr><td class="sortable" id="a" onclick="toggleSort(this)">Element</td><td class="down sortable bar" id="b" onclick="toggleSort(this)">Missed Instructions</td><td class="sortable ctr2" id="c" onclick="toggleSort(this)">Cov.</td><td class="sortable bar" id="d" onclick="toggleSort(this)">Missed Branches</td><td class="sortable ctr2" id="e" onclick="toggleSort(this)">Cov.</td><td class="sortable ctr1" id="f" onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="g" onclick="toggleSort(this)">Cxty</td><td class="sortable ctr1" id="h" onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="i" onclick="toggleSort(this)">Lines</td><td class="sortable ctr1" id="j" onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="k" onclick="toggleSort(this)">Methods</td><td class="sortable ctr1" id="l" onclick="toggleSort(this)">Missed</td><td class="sortable ctr2" id="m" onclick="toggleSort(this)">Classes</td></tr></thead><tfoot><tr><td>Total</td><td class="bar">34 of 1,054</td><td class="ctr2">97%</td><td class="bar">5 of 136</td><td class="ctr2">96%</td><td class="ctr1">5</td><td class="ctr2">104</td><td class="ctr1">6</td><td class="ctr2">209</td><td class="ctr1">0</td><td class="ctr2">36</td><td class="ctr1">0</td><td class="ctr2">5</td></tr></tfoot><tbody><tr><td id="a1"><a href="Game.java.html" class="el_source">Game.java</a></td><td class="bar" id="b0"><img src="../../../.resources/redbar.gif" width="10" height="10" title="32" alt="32"/><img src="../../../.resources/greenbar.gif" width="109" height="10" title="325" alt="325"/></td><td class="ctr2" id="c4">91%</td><td class="bar" id="d1"><img src="../../../.resources/redbar.gif" width="4" height="10" title="2" alt="2"/><img src="../../../.resources/greenbar.gif" width="60" height="10" title="30" alt="30"/></td><td class="ctr2" id="e3">94%</td><td class="ctr1" id="f1">2</td><td class="ctr2" id="g1">22</td><td class="ctr1" id="h0">6</td><td class="ctr2" id="i0">70</td><td class="ctr1" id="j0">0</td><td class="ctr2" id="k3">6</td><td class="ctr1" id="l0">0</td><td class="ctr2" id="m0">1</td></tr><tr><td id="a3"><a href="ScoreTable.java.html" class="el_source">ScoreTable.java</a></td><td class="bar" id="b1"><img src="../../../.resources/greenbar.gif" width="118" height="10" title="353" alt="353"/></td><td class="ctr2" id="c3">99%</td><td class="bar" id="d0"><img src="../../../.resources/redbar.gif" width="6" height="10" title="3" alt="3"/><img src="../../../.resources/greenbar.gif" width="114" height="10" title="57" alt="57"/></td><td class="ctr2" id="e2">95%</td><td class="ctr1" id="f0">3</td><td class="ctr2" id="g0">38</td><td class="ctr1" id="h1">0</td><td class="ctr2" id="i1">65</td><td class="ctr1" id="j1">0</td><td class="ctr2" id="k1">8</td><td class="ctr1" id="l1">0</td><td class="ctr2" id="m1">1</td></tr><tr><td id="a4"><a href="Set.java.html" class="el_source">Set.java</a></td><td class="bar" id="b2"><img src="../../../.resources/greenbar.gif" width="66" height="10" title="198" alt="198"/></td><td class="ctr2" id="c0">100%</td><td class="bar" id="d2"><img src="../../../.resources/greenbar.gif" width="52" height="10" title="26" alt=