Package hudson.plugins.rubyMetrics.rcov.model

Source Code of hudson.plugins.rubyMetrics.rcov.model.RcovFileResultTest

package hudson.plugins.rubyMetrics.rcov.model;

import hudson.model.FreeStyleBuild;
import hudson.model.Run;
import hudson.plugins.rubyMetrics.rcov.RcovBuildAction;
import org.junit.Test;

import java.lang.reflect.Field;

import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;

public class RcovFileResultTest {
    @Test
    public void testLoadOldBuildXml() throws Exception {
        FreeStyleBuild build = (FreeStyleBuild)Run.XSTREAM2.fromXML(this.getClass().getResourceAsStream("build.xml"));
        assertNotNull("Build was null", build);
        RcovBuildAction action = build.getAction(RcovBuildAction.class);
        assertNotNull("Build action was null", action);
        RcovFileResult result = action.getResults().getFiles().iterator().next();
        Field sourceCode = RcovFileResult.class.getDeclaredField("sourceCode");
        sourceCode.setAccessible(true);
        assertNull(sourceCode.get(result));
    }
}
TOP

Related Classes of hudson.plugins.rubyMetrics.rcov.model.RcovFileResultTest

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.