// Path: src/main/java/org/grouchotools/jsrules/Parameter.java
// public class Parameter<T> extends JsonBean {
//     public Parameter(String name, Class<T> klasse) {
//         this.name = name;
//         this.klasse = klasse;
//         this.staticValue = null;
//     }
// 
//     public Parameter(String name, Class<T> klasse, T staticValue) {
//         this.name = name;
//         this.klasse = klasse;
//         this.staticValue = staticValue;
//     }
//     
//     private final String name;
//     private final Class<T> klasse;
//     private final T staticValue;
// 
//     public String getName() {
//         return name;
//     }
// 
//     public Class<T> getKlasse() {
//         return klasse;
//     }
// 
//     public T getStaticValue() {
//         return staticValue;
//     }
//    
// }
// 
// Path: src/main/java/org/grouchotools/jsrules/config/ParamConfig.java
// public class ParamConfig extends JsonBean implements Config  {
//     private String parameterName;
//     private String parameterClass;
//     private String parameterStaticValue;
// 
//     public ParamConfig() {
// 
//     }
// 
//     public ParamConfig(String parameterName, String parameterClass, 
//             String parameterStaticValue) {
//         this.parameterName = parameterName;
//         this.parameterClass = parameterClass;
//         this.parameterStaticValue = parameterStaticValue;
//     }
// 
//     public String getParameterName() {
//         return parameterName;
//     }
// 
//     public void setParameterName(String parameterName) {
//         this.parameterName = parameterName;
//     }
// 
//     public String getParameterClass() {
//         return parameterClass;
//     }
// 
//     public void setParameterClass(String parameterClass) {
//         this.parameterClass = parameterClass;
//     }
// 
//     public String getParameterStaticValue() {
//         return parameterStaticValue;
//     }
// 
//     public void setParameterStaticValue(String parameterStaticValue) {
//         this.parameterStaticValue = parameterStaticValue;
//     }
//     
// }
// 
// Path: src/main/java/org/grouchotools/jsrules/exception/InvalidConfigException.java
// public class InvalidConfigException extends JsRulesException {
// 
//     public InvalidConfigException() {
//     }
// 
//     public InvalidConfigException(String message) {
//         super(message);
//     }
// 
//     public InvalidConfigException(String message, Throwable cause) {
//         super(message, cause);
//     }
// 
//     public InvalidConfigException(Throwable cause) {
//         super(cause);
//     }
// 
//     public InvalidConfigException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
//         super(message, cause, enableSuppression, writableStackTrace);
//     }
//     
// }
// 
// Path: src/main/java/org/grouchotools/jsrules/loader/impl/ParamLoaderImpl.java
// public class ParamLoaderImpl implements ParamLoader {
// 
//     /**
//      *
//      * @param config
//      * @return
//      * @throws org.grouchotools.jsrules.exception.InvalidConfigException
//      */
//     @Override
//     public Parameter load(ParamConfig config) throws InvalidConfigException {
//         if (config == null || config.getParameterClass() == null) {
//             throw new InvalidConfigException("Parameter class must not be null");
//         }
//         String parameterClassName = config.getParameterClass().toUpperCase();
//         ClassHandler handler;
//         try {
//             handler = ClassHandler.valueOf(parameterClassName);
//         } catch (IllegalArgumentException ex) {
//             throw new InvalidConfigException(parameterClassName+" is not a supported class", ex);
//         }
//         Class paramClass = handler.getMyClass();
//         String paramStaticValue = config.getParameterStaticValue();
//         Object paramStaticObject = null;
//         if (paramStaticValue != null) {
//             try {
//                 paramStaticObject = handler.convertString(paramStaticValue);
//             } catch (ClassHandlerException|IllegalArgumentException ex) {
//                 throw new InvalidConfigException(paramStaticValue+" is not a valid "+parameterClassName, ex);
//             }
//         }
//         return new Parameter(config.getParameterName(), paramClass, 
//                 paramStaticObject);
//     }
// 
// }


import static org.junit.Assert.assertEquals;
import org.grouchotools.jsrules.Parameter;
import org.grouchotools.jsrules.config.ParamConfig;
import org.grouchotools.jsrules.exception.InvalidConfigException;
import org.grouchotools.jsrules.loader.impl.ParamLoaderImpl;
import org.junit.*;
import org.junit.rules.ExpectedException;
/*
 * The MIT License
 *
 * Copyright 2015 Paul.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */
package org.grouchotools.jsrules.loader;



/**
 *
 * @author Paul
 */
public class ParamLoaderTest {
    @Rule
    public ExpectedException exception= ExpectedException.none();
    
    private final ParamLoader paramLoader = new ParamLoaderImpl();
    
    private final String paramName = "param";
    
    public ParamLoaderTest() {
    }
    
    @BeforeClass
    public static void setUpClass() {
    }
    
    @AfterClass
// Path: src/main/java/org/grouchotools/jsrules/Parameter.java
// public class Parameter<T> extends JsonBean {
//     public Parameter(String name, Class<T> klasse) {
//         this.name = name;
//         this.klasse = klasse;
//         this.staticValue = null;
//     }
// 
//     public Parameter(String name, Class<T> klasse, T staticValue) {
//         this.name = name;
//         this.klasse = klasse;
//         this.staticValue = staticValue;
//     }
//     
//     private final String name;
//     private final Class<T> klasse;
//     private final T staticValue;
// 
//     public String getName() {
//         return name;
//     }
// 
//     public Class<T> getKlasse() {
//         return klasse;
//     }
// 
//     public T getStaticValue() {
//         return staticValue;
//     }
//    
// }
// 
// Path: src/main/java/org/grouchotools/jsrules/config/ParamConfig.java
// public class ParamConfig extends JsonBean implements Config  {
//     private String parameterName;
//     private String parameterClass;
//     private String parameterStaticValue;
// 
//     public ParamConfig() {
// 
//     }
// 
//     public ParamConfig(String parameterName, String parameterClass, 
//             String parameterStaticValue) {
//         this.parameterName = parameterName;
//         this.parameterClass = parameterClass;
//         this.parameterStaticValue = parameterStaticValue;
//     }
// 
//     public String getParameterName() {
//         return parameterName;
//     }
// 
//     public void setParameterName(String parameterName) {
//         this.parameterName = parameterName;
//     }
// 
//     public String getParameterClass() {
//         return parameterClass;
//     }
// 
//     public void setParameterClass(String parameterClass) {
//         this.parameterClass = parameterClass;
//     }
// 
//     public String getParameterStaticValue() {
//         return parameterStaticValue;
//     }
// 
//     public void setParameterStaticValue(String parameterStaticValue) {
//         this.parameterStaticValue = parameterStaticValue;
//     }
//     
// }
// 
// Path: src/main/java/org/grouchotools/jsrules/exception/InvalidConfigException.java
// public class InvalidConfigException extends JsRulesException {
// 
//     public InvalidConfigException() {
//     }
// 
//     public InvalidConfigException(String message) {
//         super(message);
//     }
// 
//     public InvalidConfigException(String message, Throwable cause) {
//         super(message, cause);
//     }
// 
//     public InvalidConfigException(Throwable cause) {
//         super(cause);
//     }
// 
//     public InvalidConfigException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
//         super(message, cause, enableSuppression, writableStackTrace);
//     }
//     
// }
// 
// Path: src/main/java/org/grouchotools/jsrules/loader/impl/ParamLoaderImpl.java
// public class ParamLoaderImpl implements ParamLoader {
// 
//     /**
//      *
//      * @param config
//      * @return
//      * @throws org.grouchotools.jsrules.exception.InvalidConfigException
//      */
//     @Override
//     public Parameter load(ParamConfig config) throws InvalidConfigException {
//         if (config == null || config.getParameterClass() == null) {
//             throw new InvalidConfigException("Parameter class must not be null");
//         }
//         String parameterClassName = config.getParameterClass().toUpperCase();
//         ClassHandler handler;
//         try {
//             handler = ClassHandler.valueOf(parameterClassName);
//         } catch (IllegalArgumentException ex) {
//             throw new InvalidConfigException(parameterClassName+" is not a supported class", ex);
//         }
//         Class paramClass = handler.getMyClass();
//         String paramStaticValue = config.getParameterStaticValue();
//         Object paramStaticObject = null;
//         if (paramStaticValue != null) {
//             try {
//                 paramStaticObject = handler.convertString(paramStaticValue);
//             } catch (ClassHandlerException|IllegalArgumentException ex) {
//                 throw new InvalidConfigException(paramStaticValue+" is not a valid "+parameterClassName, ex);
//             }
//         }
//         return new Parameter(config.getParameterName(), paramClass, 
//                 paramStaticObject);
//     }
// 
// }


// Path: src/test/java/org/grouchotools/jsrules/loader/ParamLoaderTest.java
import static org.junit.Assert.assertEquals;
import org.grouchotools.jsrules.Parameter;
import org.grouchotools.jsrules.config.ParamConfig;
import org.grouchotools.jsrules.exception.InvalidConfigException;
import org.grouchotools.jsrules.loader.impl.ParamLoaderImpl;
import org.junit.*;
import org.junit.rules.ExpectedException;

/*
 * The MIT License
 *
 * Copyright 2015 Paul.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */
package org.grouchotools.jsrules.loader;



/**
 *
 * @author Paul
 */
public class ParamLoaderTest {
    @Rule
    public ExpectedException exception= ExpectedException.none();
    
    private final ParamLoader paramLoader = new ParamLoaderImpl();
    
    private final String paramName = "param";
    
    public ParamLoaderTest() {
    }
    
    @BeforeClass
    public static void setUpClass() {
    }
    
    @AfterClass
    public static void tearDownClass() {