vergessen...

git-svn-id: https://projects.brucker.ch/su4sml/svn/infsec-import/trunk/src/su4sml@5721 3260e6d1-4efc-4170-b0a7-36055960796d
This commit is contained in:
Jürgen Doser 2006-12-11 10:05:34 +00:00
parent dbca184faf
commit 969ae9dbd1
1 changed files with 60 additions and 0 deletions

View File

@ -0,0 +1,60 @@
(*****************************************************************************
* su4sml - a SecureUML repository for SML
*
* junit_cartridge.sml - a junit cartridge for gcg
* Copyright (C) 2006
*
* This file is part of su4sml.
*
* su4sml is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free
* Software Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* su4sml is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
******************************************************************************)
(* FIXME: This is blindly copied from the C#_Cartridge. *)
(* Probably, some things have to be adjusted to Java syntax *)
functor Junit_Cartridge(SuperCart : BASE_CARTRIDGE) : BASE_CARTRIDGE =
struct
type Model = SuperCart.Model
type environment = { extension : SuperCart.environment }
(* fun getModel (env:environment) = SuperCart.getModel (#extension env)*)
fun initEnv model = { extension = SuperCart.initEnv model } : environment
fun unpack (env : environment) = #extension env
fun pack superEnv = {extension = superEnv} : environment
(* for BASE_CARTRIDGE *)
fun curClassifier env = SuperCart.curClassifier (unpack env)
fun curArgument env = SuperCart.curArgument (unpack env)
fun curOperation env = SuperCart.curOperation (unpack env)
fun curAttribute env = SuperCart.curAttribute (unpack env)
(* any special variables? *)
fun lookup (env : environment) s = SuperCart.lookup (unpack env) s
(* any special predicates?*)
fun test (env : environment) s = SuperCart.test (unpack env) s
(* any special lists? *)
fun foreach listType (env : environment)
= map pack (SuperCart.foreach listType (unpack env))
end