Source:
<code>public void testFailureCAppDeployment() throws Exception { int startESCount = eventStreamManagerAdminServiceClient.getEventStreamCount(); int startERCount = eventReceiverAdminServiceClient.getActiveEventReceiverCount(); int startEPCount = eventPublisherAdminServiceClient.getActiveEventPublisherCount(); int startEPCCount = eventProcessorAdminServiceClient.getAllActiveExecutionPlanConfigurationCount(); String carFilePath = FrameworkPathUtil.getSystemResourceLocation() + "artifacts" + File.separator + "CEP" + File.separator + "car" + File.separator; String cAppDirectoryPath = FrameworkPathUtil.getCarbonHome() + File.separator + "repository" + File.separator + "deployment" + File.separator + "server" + File.separator + "carbonapps" + File.separator; try { FileManager.copyResourceToFileSystem(carFilePath + cAppFailureFileName, cAppDirectoryPath, cAppFailureFileName); } catch (Exception e) { throw new RemoteException("Exception caught when deploying the car file into CEP server", e); } Thread.sleep(20000); Assert.assertEquals(eventStreamManagerAdminServiceClient.getEventStreamCount(), startESCount); Assert.assertEquals(eventReceiverAdminServiceClient.getActiveEventReceiverCount(), startERCount); Assert.assertEquals(eventPublisherAdminServiceClient.getActiveEventPublisherCount(), startEPCount); Assert.assertEquals(eventProcessorAdminServiceClient.getAllActiveExecutionPlanConfigurationCount(), startEPCCount); <START> } <END></code><technical_language>remove capp, test case CEP initial state guarantee next test fail</technical_language>

Target:
public void testFailureCAppDeployment() throws Exception { int startESCount = eventStreamManagerAdminServiceClient.getEventStreamCount(); int startERCount = eventReceiverAdminServiceClient.getActiveEventReceiverCount(); int startEPCount = eventPublisherAdminServiceClient.getActiveEventPublisherCount(); int startEPCCount = eventProcessorAdminServiceClient.getAllActiveExecutionPlanConfigurationCount(); String carFilePath = FrameworkPathUtil.getSystemResourceLocation() + "artifacts" + File.separator + "CEP" + File.separator + "car" + File.separator; String cAppDirectoryPath = FrameworkPathUtil.getCarbonHome() + File.separator + "repository" + File.separator + "deployment" + File.separator + "server" + File.separator + "carbonapps" + File.separator; try { FileManager.copyResourceToFileSystem(carFilePath + cAppFailureFileName, cAppDirectoryPath, cAppFailureFileName); } catch (Exception e) { throw new RemoteException("Exception caught when deploying the car file into CEP server", e); } Thread.sleep(20000); Assert.assertEquals(eventStreamManagerAdminServiceClient.getEventStreamCount(), startESCount); Assert.assertEquals(eventReceiverAdminServiceClient.getActiveEventReceiverCount(), startERCount); Assert.assertEquals(eventPublisherAdminServiceClient.getActiveEventPublisherCount(), startEPCount); Assert.assertEquals(eventProcessorAdminServiceClient.getAllActiveExecutionPlanConfigurationCount(), startEPCCount); try { FileManager.deleteFile(cAppDirectoryPath + cAppFailureFileName); } catch (Exception e) { throw new RemoteException("Exception caught when deleting the car file from CEP server", e); } Thread.sleep(20000); }