Skip to content
Permalink
Browse files

Fix JENKINS-11542

  • Loading branch information...
gboissinot committed Oct 27, 2012
1 parent 889b673 commit 7f98236835f54e00f7c65993a87becda297c39d1
@@ -0,0 +1,47 @@
package org.jenkinsci.plugins.xunit.types;

import com.thalesgroup.dtkit.junit.model.JUnitModel;
import com.thalesgroup.dtkit.metrics.model.InputMetricXSL;
import com.thalesgroup.dtkit.metrics.model.InputType;
import com.thalesgroup.dtkit.metrics.model.OutputMetric;

/**
* @author Gregory Boissinot
*/
public class QTestLibInputMetric extends InputMetricXSL {

@Override
public InputType getToolType() {
return InputType.TEST;
}

@Override
public String getToolVersion() {
return "Version N/A";
}

@Override
public String getToolName() {
return "QTestlib";
}

@Override
public boolean isDefault() {
return false;
}

@Override
public String getXslName() {
return "qtestlib-to-junit-4.xsl";
}

@Override
public String[] getInputXsdNameList() {
return null;
}

@Override
public OutputMetric getOutputFormatType() {
return JUnitModel.OUTPUT_JUNIT_4;
}
}
@@ -0,0 +1,43 @@
package org.jenkinsci.plugins.xunit.types;

import com.thalesgroup.dtkit.metrics.hudson.api.descriptor.TestTypeDescriptor;
import com.thalesgroup.dtkit.metrics.hudson.api.type.TestType;
import com.thalesgroup.dtkit.metrics.model.InputMetric;
import com.thalesgroup.dtkit.metrics.model.InputMetricException;
import com.thalesgroup.dtkit.metrics.model.InputMetricFactory;
import hudson.Extension;
import org.kohsuke.stapler.DataBoundConstructor;

/**
* @author Gregory Boissinot
*/
public class QTestLibType extends TestType {

@DataBoundConstructor
public QTestLibType(String pattern, boolean failIfNotNew, boolean deleteOutputFiles, boolean stopProcessingIfError) {
super(pattern, failIfNotNew, deleteOutputFiles, stopProcessingIfError);
}

@Extension
public static class QTestLibTypeDescriptor extends TestTypeDescriptor<QTestLibType> {

public QTestLibTypeDescriptor() {
super(QTestLibType.class, null);
}

@Override
public String getId() {
return this.getClass().getName();
}

@Override
public InputMetric getInputMetric() {
try {
return InputMetricFactory.getInstance(CheckInputMetric.class);
} catch (InputMetricException e) {
throw new RuntimeException("Can't create the inputMetric object for the class " + CheckInputMetric.class);
}
}
}
}

@@ -0,0 +1,14 @@
package org.jenkinsci.plugins.xunit.types;

import org.junit.Test;

/**
* @author Gregory Boissinot
*/
public class QTestLibTypeTest extends AbstractTest {

@Test
public void testTestCase1() throws Exception {
convertAndValidate(QTestLibInputMetric.class,"qtestlib/testcase1/input.xml", "qtestlib/testcase1/result.xml");
}
}

1 comment on commit 7f98236

@buildhive

This comment has been minimized.

Copy link

commented on 7f98236 Oct 27, 2012

Jenkins » xunit-plugin #12 FAILURE
Looks like this commit caused a build failure
(what's this?)

Please sign in to comment.
You can’t perform that action at this time.