private void excuteUsingJavaWithoutJudging() { Invoke((MethodInvoker) delegate { lbInfo.Items.Insert(0, "Compiling the code..."); }); string error = Java.Compile(SystemFile.GetJavaFilePath()); if (!string.IsNullOrEmpty(error)) { Invoke((MethodInvoker) delegate { lbInfo.Items.Insert(0, Messages.GetErrorType(error)); rtbReport.Text = error; }); } else { Invoke((MethodInvoker) delegate { lbInfo.Items.Insert(0, "Compiled Successfully !."); }); string[] inputFilePaths = SystemFile.GetInputFilePaths(SystemFolder.GetTestInDir()); string[] outputFilePaths = SystemFile.GetOutputFilePaths(SystemFolder.GetTestInDir()); int i = 1; foreach (string inputFilePath in inputFilePaths) { string fileInputContent = SystemFile.GetFileContentText(inputFilePath); Invoke((MethodInvoker) delegate { lbInfo.Items.Insert(0, "Running test " + i + "..."); }); Result result = Java.Run(fileInputContent); if (result.error.Length > 0) { Invoke((MethodInvoker) delegate { lbInfo.Items.Insert(0, Messages.GetErrorType(result.error.ToString()) + " at test " + i); rtbReport.Text = result.error.ToString(); }); ErrorTests.Add(inputFilePath); ErrorCount++; i++; continue; } File.WriteAllText(outputFilePaths[i - 1], result.output.ToString().TrimEnd('\n').TrimEnd('\r')); i++; TestedCount++; } TotalTestCount = inputFilePaths.Length; TestedCount += ErrorCount; NotTestedCount = TotalTestCount - TestedCount; } }