Package speculoos.core

Examples of speculoos.core.Mapper


     *
     * @throws MapperConfigurationException
     */
    public void test02Reset() throws MapperConfigurationException {
        /* configure */
        Mapper m = (Mapper) mockmapper.proxy();
        Source s = (Source) mocksrc.proxy();
        mockmapper.expects(atLeastOnce()).method("getName");
configure.addMapper("map", m);
        configure.addSource("source", s);
        configure.addParameter("toto", "toto");
View Full Code Here


            fail(e.getLocalizedMessage());
        }
    }
   
    public void test22NoMapperLink() throws MapperConfigurationException {
        Mapper m = (Mapper) mockmapper.proxy();
        Source s = (Source) mocksrc.proxy();
        configure.addSource("source", s);
        try {
            configure.link("map", "source");
            fail("Should have thrown mapper exception");
View Full Code Here

        } catch (MapperConfigurationException e) {
//OK
            }
    }
    public void test23NoSourceLink() throws MapperConfigurationException {
        Mapper m = (Mapper) mockmapper.proxy();
        Source s = (Source) mocksrc.proxy();
        configure.addMapper("map", m);
        try {
            configure.link("map", "source");
            fail("Should have thrown mapper exception");
View Full Code Here

     */
    public Mapper getMapper(String name) throws MapperException {
        if (!configured || !ready)
            throw new MapperConfigurationException(
                    "Manager is not ready to operate.");
        Mapper mapper = (Mapper) mappers.get(name);
        if (mapper == null)
            throw new MapperConfigurationException("No mapper named " + name
                    + " in this manager");
        /* configure mapper through source */
        Source src = (Source) mapperToSource.get(mapper.getName());
        if (src == null)
            throw new MapperConfigurationException(
                    "No source is associated with mapper " + name);
        /* delegate preparation */
        Mapper niou = src.create(name, environment);
        return niou;
    }
View Full Code Here

     * @see speculoos.core.core.Configure#link(java.lang.String,
     *      java.lang.String)
     */
    public void link(String mapName, String srcName)
            throws MapperConfigurationException {
        Mapper m = (Mapper) mappers.get(mapName);
        if (m == null)
            throw new MapperConfigurationException(mapName
                    + " is not the name of a mapper");
        Source src = (Source) sources.get(srcName);
        if (src == null)
            throw new MapperConfigurationException(srcName
                    + " is not the name of a source");
        /* link */
        mapperToSource.put(m.getName(), src);
        if(log.isDebugEnabled())
            log.debug("linking map "+mapName+" to source "+src);
    }
View Full Code Here

TOP

Related Classes of speculoos.core.Mapper

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.