Skip to content

Commit

Permalink
Fix JENKINS-11542
Browse files Browse the repository at this point in the history
  • Loading branch information
gboissinot committed Oct 27, 2012
1 parent 889b673 commit 7f98236
Show file tree
Hide file tree
Showing 3 changed files with 104 additions and 0 deletions.
@@ -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;
}
}
43 changes: 43 additions & 0 deletions src/main/java/org/jenkinsci/plugins/xunit/types/QTestlibType.java
@@ -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
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Please sign in to comment.