Package org.jbehave.core.configuration.groovy

Source Code of org.jbehave.core.configuration.groovy.BytecodeGroovyClassLoaderBehaviour

package org.jbehave.core.configuration.groovy;

import static junit.framework.Assert.assertNotNull;
import groovy.lang.GroovyClassLoader;

import java.io.IOException;
import java.io.InputStream;

import org.junit.Test;

public class BytecodeGroovyClassLoaderBehaviour {

    @Test
    public void shouldCacheBytes() throws IOException {
        GroovyClassLoader classLoader = new BytecodeGroovyClassLoader();
        assertNotNull((Class<?>) classLoader.parseClass("class Hello { }"));
        InputStream bytecode = classLoader.getResourceAsStream("Hello.class");
        assertNotNull(bytecode);
        bytecode.close();
    }

}
TOP

Related Classes of org.jbehave.core.configuration.groovy.BytecodeGroovyClassLoaderBehaviour

TOP
Copyright © 2018 www.massapi.com. 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.