X-Git-Url: http://wien.tomnetworks.com/gitweb/?p=hs-java.git;a=blobdiff_plain;f=TestGen.hs;h=9d1bcd8caa43ae249056e1978970aee27106c8eb;hp=31e71c0676ae0255d345a46d8ac1d6a502dd1dd5;hb=HEAD;hpb=4174461dc7cd2b14183917db3cd11219a37e804c diff --git a/TestGen.hs b/TestGen.hs index 31e71c0..9d1bcd8 100644 --- a/TestGen.hs +++ b/TestGen.hs @@ -1,23 +1,25 @@ -{-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE OverloadedStrings, FlexibleContexts #-} +import Control.Monad.Exception import qualified Data.ByteString.Lazy as B import JVM.ClassFile import JVM.Converter import JVM.Assembler import JVM.Builder +import JVM.Exceptions import Java.ClassPath import qualified Java.Lang import qualified Java.IO -test :: GenerateIO () +test :: (Throws ENotFound e, Throws ENotLoaded e, Throws UnexpectedEndMethod e) => GenerateIO e () test = do withClassPath $ do -- Add current directory (with Hello.class) to ClassPath addDirectory "." - -- Load method signature: Hello.hello() + -- Load method signature: Hello.hello() from Hello.class helloJava <- getClassMethod "./Hello" "hello" -- Initializer method. Just calls java.lang.Object.