Esempio n. 1
0
        public void testJavaExecution()
        {
            Assert.That(IKVMInstall.checkIKVMInstallation(), "checkIKVMInstallation return false");
            Assert.That(File.Exists(testJavaFile), "testJavaFile didn't exist:{0}", testJavaFile);

            Files.deleteFile(expectedCompiledTestJavaFile);

            JavaCompile.compileJavaFile(testJavaFile);
            Assert.That(File.Exists(expectedCompiledTestJavaFile), "expectedCompiledTestJavaFile didn't exist:{0}", expectedCompiledTestJavaFile);

            var executionResponse = JavaExec.executeJavaFile(expectedCompiledTestJavaFile);

            Assert.That(executionResponse == expectedExecutionResult,
                        "executionResponse != expectedExecutionResult: {0}, {1}", executionResponse,
                        expectedExecutionResult);
            DI.log.info(executionResponse);

            /*Assert.That(JavaShell.testJava("print 2+3", "5"), "testJava failed");
             * Assert.That(false == JavaShell.testJava("print 2+3", "4"), "testJava should had failed");
             *
             * var scriptToExecute = "print 2+3";
             * var expectedDataReceived = "5" + Environment.NewLine;
             * var tempPyScript = DI.config.getTempFileInTempDirectory("py");
             * Files.WriteFileContent(tempPyScript, scriptToExecute);
             *
             * var dataReceived = new JavaShell().executeJavaFile(tempPyScript, "");
             * Assert.That(dataReceived == expectedDataReceived, "data received did no match expectedDataReceived");
             * File.Delete(tempPyScript);*/
        }
Esempio n. 2
0
 public void unInstallIKVM()
 {
     IKVMInstall.uninstallIKVM();
     Assert.That(false == Directory.Exists(IKVMConfig._IKVMRuntimeDir),
                 "Java Runtime directory should had been empty: {0}",
                 IKVMConfig._IKVMRuntimeDir);
 }
Esempio n. 3
0
 public void installIKVM()
 {
     if (Directory.Exists(IKVMConfig._IKVMRuntimeDir))
     {
         unInstallIKVM();
     }
     IKVMInstall.installIKVM();
     Assert.That(Directory.Exists(IKVMConfig._IKVMRuntimeDir), "Could not find Java Runtime directory: {0}",
                 IKVMConfig._IKVMRuntimeDir);
 }
Esempio n. 4
0
 public void test_checkIfJavaPathIsCorrectlySet()
 {
     Assert.That(IKVMInstall.checkIfJavaPathIsCorrectlySet(), "checkIfJavaPathIsCorrectlySet failed");
 }