@@ -0,0 +1,2372 @@
+package controller;%0A/*%0A*  Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.%0A*%0A*  WSO2 Inc. licenses this file to you under the Apache License,%0A*  Version 2.0 (the %22License%22); you may not use this file except%0A*  in compliance with the License.%0A*  You may obtain a copy of the License at%0A*%0A*    http://www.apache.org/licenses/LICENSE-2.0%0A*%0A* Unless required by applicable law or agreed to in writing,%0A* software distributed under the License is distributed on an%0A* %22AS IS%22 BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY%0A* KIND, either express or implied.  See the License for the%0A* specific language governing permissions and limitations%0A* under the License.%0A*/%0A%0Aimport com.sun.tools.attach.AttachNotSupportedException;%0Aimport com.sun.tools.attach.VirtualMachine;%0Aimport com.sun.tools.attach.VirtualMachineDescriptor;%0Aimport jvmmonitor.exceptions.MonitoringNotStartedException;%0Aimport org.wso2.carbon.databridge.agent.exception.DataEndpointAgentConfigurationException;%0Aimport org.wso2.carbon.databridge.agent.exception.DataEndpointAuthenticationException;%0Aimport org.wso2.carbon.databridge.agent.exception.DataEndpointConfigurationException;%0Aimport org.wso2.carbon.databridge.agent.exception.DataEndpointException;%0Aimport org.wso2.carbon.databridge.commons.exception.TransportException;%0A%0Aimport javax.management.MalformedObjectNameException;%0Aimport java.io.IOException;%0A%0Apublic class test %7B%0A%0A    public static void main(String%5B%5D args) throws IOException,%0A            AttachNotSupportedException,%0A            MalformedObjectNameException,%0A            InterruptedException,%0A            MonitoringNotStartedException,%0A            DataEndpointAuthenticationException,%0A            DataEndpointAgentConfigurationException,%0A            TransportException,%0A            DataEndpointException,%0A            DataEndpointConfigurationException %7B%0A%0A        Runtime.getRuntime().exec(%22java -jar /home/buddhi/work/wso2/automatic-anomaly-detection/test/BadCode.jar%22);%0A        String pid = null;%0A%0A        for (VirtualMachineDescriptor vmd : VirtualMachine.list()) %7B%0A            if (vmd.displayName().indexOf(%22BadCode.jar%22) != -1) %7B%0A                pid = vmd.id();%0A                System.out.println(vmd.id() + %22%5Ct%22 + vmd.displayName());%0A            %7D%0A        %7D%0A%0A        new Controller().sendUsageData(pid);%0A%0A        Runtime.getRuntime().exec(%22kill -9 %22 + pid);%0A%0A    %7D%0A%7D%0A

Add test case using BarCode.jar file