/* Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *      http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.camunda.bpm.engine.test.standalone.testing;

import org.camunda.bpm.engine.task.Task;
import org.camunda.bpm.engine.test.Deployment;
import org.camunda.bpm.engine.test.ProcessEngineTestCase;


/**
 * @author Joram Barrez
 * @author Falko Menge (camunda)
 */
public class ActivitiTestCaseTest extends ProcessEngineTestCase {
  
  @Deployment
  public void testSimpleProcess() {
    runtimeService.startProcessInstanceByKey("simpleProcess");
    
    Task task = taskService.createTaskQuery().singleResult();
    assertEquals("My Task", task.getName());
    
    taskService.complete(task.getId());
    assertEquals(0, runtimeService.createProcessInstanceQuery().count());
    
    assertEquals(1, historyService.createHistoricProcessInstanceQuery().count());
  }

}

@@ -173,18 +173,17 @@
 se at%0A *
- 
 %0A
+
  *      
@@ -227,17 +227,16 @@
 E-2.0%0A *
- 
 %0A * Unle
@@ -611,16 +611,141 @@
 sting;%0A%0A
+import org.camunda.bpm.engine.impl.ProcessEngineImpl;%0Aimport org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl;%0A
 import o
@@ -1015,19 +1015,17 @@
 tCase %7B%0A
-  
 %0A
+
   @Deplo
@@ -1129,21 +1129,17 @@
 cess%22);%0A
-    
 %0A
+
     Task
@@ -1233,29 +1233,25 @@
 getName());%0A
-    
 %0A
+
     taskServ
@@ -1356,13 +1356,225 @@
 ));%0A
+%0A
     
-%0A
+ProcessEngineConfigurationImpl configuration = ((ProcessEngineImpl)processEngine).getProcessEngineConfiguration();%0A%0A    if (configuration.getHistoryLevel() %3E ProcessEngineConfigurationImpl.HISTORYLEVEL_NONE) %7B%0A  
     
@@ -1651,15 +1651,21 @@
 unt());%0A
+    %7D%0A
   %7D%0A%0A%7D%0A

fix engine test case