<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">
          <!-- TODO: disable button if som tets are in progress -->
          <button class="btn pull-right" ng-click="runTests()" ng-disabled="!gridOptions.selectedItems.length">
            Run Tests
          </button>
        </form>
      </div>
    </div>
  </div>

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

      <strong>Testing Summary</strong>

      <br/> Running: <strong>{{inProgressData.running}}</strong>
      <br/> Testing class: <strong>{{inProgressData.testClass}}</strong>
      <br/> Testing method: <strong>{{inProgressData.testMethod}}</strong>
      <br/> Run count: <strong>{{inProgressData.runCount}}</strong>
      <br/> Failure count: <strong>{{inProgressData.failureCount}}</strong>
      <br/> Ignore count: <strong>{{inProgressData.ignoreCount}}</strong>
      <br/> Time: <strong>{{inProgressData.runTime}} ms</strong>

    </div>
  </div>

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

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

      <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>

