def test_compile_java_file(self): java = Java(self.java_home) class_file = os.path.join(calculator_package_dir(), 'operations', 'Operation.class') if os.path.isfile(class_file): os.remove(class_file) java.exec_javac(calculator_operation_java_file(), None, None, 10) self.assertTrue(os.path.isfile(class_file)) os.remove(class_file)
def test_java_timeout(self): java = Java(self.java_home) with self.assertRaises(subprocess.TimeoutExpired): java.exec_javac(calculator_java_file(), None, None, 0)
def test_maven_wrong_args(self): java = Java(self.java_home) with self.assertRaises(subprocess.CalledProcessError): java.exec_javac(calculator_java_file(), None, None, 10, '< x')