<style>
  .test-toolbar {
    padding-top: 20px;
    padding-bottom: 10px;
  }

  .testGrid {
    height: 300px;
  }

  .testHeader  {
    font-weight: bold;
  }
</style>
<div ng-controller="JUnit.TreeController">
  <div class="row-fluid test-toolbar">
    <div class="span8">
      <input class="search-query span12" type="text" ng-model="gridOptions.filterOptions.filterText"
             placeholder="Filter tests">
    </div>
    <div class="span4">
      <div class="pull-right">
        <form class="form-inline">
          <button class="btn pull-right" ng-click="runTests()" ng-disabled="runningTests() || !gridOptions.selectedItems.length">
            Run tests
          </button>
        </form>
      </div>
    </div>
  </div>

  <div class="row-fluid">
    <div ng-show="runningTests()" class="alert alert-{{alertClass}}">

      <strong>Testing in progress ...</strong>

      <br/> Testing class: <strong>{{inProgressData.testClass}}</strong>
      <br/> Testing method: <strong>{{inProgressData.testMethod}}</strong>
      <br/> Run: <strong>{{inProgressData.runCount}}</strong>
      <br/> Failure: <strong>{{inProgressData.failureCount}}</strong>
      <br/> Ignore: <strong>{{inProgressData.ignoreCount}}</strong>
      <br/> Elapsed time: <strong>{{inProgressData.runTime}}</strong> ms

    </div>
  </div>

  <div class="row-fluid">
    <div ng-show="hasTestResults()" class="alert alert-{{alertClass}}">
      <button type="button" class="close" ng-click="clearResults()">&times;</button>

      <strong>Test Results</strong>

      <br/> Run: <strong>{{testResults.runCount}}</strong>
      <br/> Failure: <strong>{{testResults.failureCount}}</strong>
      <br/> Ignore: <strong>{{testResults.ignoreCount}}</strong>
      <br/> Elapsed time: <strong>{{testResults.runTime}}</strong> ms

      <ul class="failures">
        <li ng-repeat="failure in testResults.failures | filter:resultSearchTest" class="failure">
          <div class="expandable closed" model="failure">
            <div class="heading title">
              <span class="testHeader">{{failure.testHeader}}</span>
            </div>

            <div class="content expandable-body">
              <strong>{{failure.message}}</strong>

              <div class="exception" ng-repeat="exception in failure.exceptions">
                <!--
                                <div class="expandable closed" model="exception">
                -->
                <div class="" model="exception">
                  <div class="heading title">
                    <span class="exceptionMessage" ng-hide="exception.message == failure.message">{{exception.message}}</span>
                  </div>
                  <!--
                                    <div class="content expandable-body">
                  -->
                  <div class="content">
                    <ul class="stack-trace-list">
                      <li class="stack-trace" ng-repeat="stack in exception.stackTraceList">
                        {{stack.className}}.{{stack.methodName}}({{stack.fileName}}:{{stack.lineNumber}})
                        <hawtio-open-ide file-name="{{stack.fileName}}" class-name="{{stack.className}}" line="{{stack.lineNumber}})" column="{{stack.columnNumber}})"></hawtio-open-ide>
                      </li>
                    </ul>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </li>
      </ul>
    </div>
  </div>

  <div class="row-fluid">
    <div class="gridStyle" ng-grid="gridOptions"></div>
  </div>

</div>

