Package fmpp.tdd
Class TddUtil
- java.lang.Object
-
- fmpp.tdd.TddUtil
-
public class TddUtil extends java.lang.Object
Utility methods for TDD related tasks.
-
-
Constructor Summary
Constructors Constructor Description TddUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.util.Map<?,?>
convertToDataMap(java.lang.Object value)
Converts a value toMap
, if it's possible, in a way that mostly useful when it will be used as part of the "data" setting.static DataLoader
getDataLoaderInstance(Engine eng, java.lang.String dlName)
Resolves a data loader name to a data loader instance.
-
-
-
Method Detail
-
getDataLoaderInstance
public static DataLoader getDataLoaderInstance(Engine eng, java.lang.String dlName) throws EvalException
Resolves a data loader name to a data loader instance.- Throws:
EvalException
-
convertToDataMap
public static java.util.Map<?,?> convertToDataMap(java.lang.Object value) throws TypeNotConvertableToMapException
Converts a value toMap
, if it's possible, in a way that mostly useful when it will be used as part of the "data" setting. ReturnsMap
-s andnull
as is. At the moment it can convertTemplateHashModelEx
and the appropriateAdapterTemplateModel
objects. It will convertTemplateModel
keys of the key-value pairs toString
-s, but keepTemplateModel
values of the key-value pairs as is, so that they keep any extra FreeMarker-specific functionality (like theTemplateNodeModel
interface).- Returns:
- A
Map
that's normally aMap<String, Object>
, but this method don't guarantee that due to backward compatibility restrictions.null
exactly if the argument wasnull
. - Throws:
TypeNotConvertableToMapException
- If the type is not convertible toMap
.java.lang.RuntimeException
- Any other unexpected exception that occurs during the conversion will be wrapped into someRuntimeException
subclass.- Since:
- 0.9.16
-
-