Search in sources :

Example 76 with Parameters

use of org.junit.runners.Parameterized.Parameters in project drools by kiegroup.

the class DslParserTest method getParameters.

@Parameters
public static Collection<Object[]> getParameters() {
    final Set<Object[]> set = new HashSet<>();
    for (File f : getFiles("dsl", "dslr")) {
        final String dslPath = f.getAbsolutePath();
        final File dsl = new File(dslPath.substring(0, dslPath.length() - 1));
        set.add(new Object[] { dsl, f, KieBaseTestConfiguration.CLOUD_EQUALITY });
        if (TestParametersUtil.TEST_EXECUTABLE_MODEL_WITH_FLOW_DSL) {
            set.add(new Object[] { dsl, f, KieBaseTestConfiguration.CLOUD_EQUALITY_MODEL_FLOW });
        }
        if (TestParametersUtil.TEST_EXECUTABLE_MODEL_WITH_PATTERN_DSL) {
            set.add(new Object[] { dsl, f, KieBaseTestConfiguration.CLOUD_EQUALITY_MODEL_PATTERN });
        }
    }
    return set;
}
Also used : File(java.io.File) HashSet(java.util.HashSet) Parameters(org.junit.runners.Parameterized.Parameters)

Example 77 with Parameters

use of org.junit.runners.Parameterized.Parameters in project linuxtools by eclipse.

the class GprofTest method data.

@Parameters
public static Collection<Object[]> data() {
    List<Object[]> params = new ArrayList<>();
    boolean addr2line2_16 = false;
    try {
        Process p = Runtime.getRuntime().exec("addr2line --version");
        InputStream is = p.getInputStream();
        LineNumberReader reader = new LineNumberReader(new InputStreamReader(is));
        String line;
        while ((line = reader.readLine()) != null) {
            if (line.contains("addr2line 2.16.")) {
                addr2line2_16 = true;
                break;
            }
        }
    } catch (IOException e) {
    }
    for (File testDir : STJunitUtils.getTestDirs()) {
        final File gmonFile = new File(testDir, OUTPUT_FILE);
        final File binaryFile = new File(testDir, BINARY_FILE);
        File view_cg_RefFile_default = new File(testDir, "testCallgraphView.ref");
        File view_cg_RefFile_alternate = new File(testDir, "testCallgraphView.ref.binutils-2.16");
        File view_cg2_RefFile_default = new File(testDir, "testCallgraphTimeView.ref");
        File view_cg2_RefFile_alternate = new File(testDir, "testCallgraphTimeView.ref.binutils-2.16");
        final File view_cg_RefFile;
        final File view_cg2_RefFile;
        if (addr2line2_16 && view_cg_RefFile_alternate.exists()) {
            view_cg_RefFile = view_cg_RefFile_alternate;
        } else {
            view_cg_RefFile = view_cg_RefFile_default;
        }
        if (addr2line2_16 && view_cg2_RefFile_alternate.exists()) {
            view_cg2_RefFile = view_cg2_RefFile_alternate;
        } else {
            view_cg2_RefFile = view_cg2_RefFile_default;
        }
        final File view_cg2_DumpFile = new File(testDir, "testCallgraphTimeView.dump");
        final File view_cg_DumpFile = new File(testDir, "testCallgraphView.dump");
        final File view_samplesFile_RefFile = new File(testDir, "testSampleView.ref");
        final File view_samplesFile_DumpFile = new File(testDir, "testSampleView.dump");
        final File view_samplesFileT_RefFile = new File(testDir, "testTimeView.ref");
        final File view_samplesFileT_DumpFile = new File(testDir, "testTimeView.dump");
        final File view_samplesFunction_RefFile = new File(testDir, "testFunctionSampleView.ref");
        final File view_samplesFunction_DumpFile = new File(testDir, "testFunctionSampleView.dump");
        final File view_samplesFunctionT_RefFile = new File(testDir, "testFunctionTimeView.ref");
        final File view_samplesFunctionT_DumpFile = new File(testDir, "testFunctionTimeView.dump");
        final File view_samplesFlat_RefFile = new File(testDir, "testFlatSampleView.ref");
        final File view_samplesFlat_DumpFile = new File(testDir, "testFlatSampleView.dump");
        final File view_samplesFlatT_RefFile = new File(testDir, "testFlatTimeView.ref");
        final File view_samplesFlatT_DumpFile = new File(testDir, "testFlatTimeView.dump");
        IBinaryObject binary = STSymbolManager.sharedInstance.getBinaryObject(new Path(binaryFile.getAbsolutePath()));
        final GmonDecoder gd = new GmonDecoder(binary, null);
        try {
            gd.read(gmonFile.getAbsolutePath());
        } catch (IOException e) {
            e.printStackTrace();
        }
        params.add(new Object[] { gmonFile, gd, view_cg_RefFile, view_cg_DumpFile, CallGraphContentProvider.sharedInstance, false });
        params.add(new Object[] { gmonFile, gd, view_cg2_RefFile, view_cg2_DumpFile, CallGraphContentProvider.sharedInstance, true });
        params.add(new Object[] { gmonFile, gd, view_samplesFile_RefFile, view_samplesFile_DumpFile, FileHistogramContentProvider.sharedInstance, false });
        params.add(new Object[] { gmonFile, gd, view_samplesFileT_RefFile, view_samplesFileT_DumpFile, FileHistogramContentProvider.sharedInstance, true });
        params.add(new Object[] { gmonFile, gd, view_samplesFunction_RefFile, view_samplesFunction_DumpFile, FunctionHistogramContentProvider.sharedInstance, false });
        params.add(new Object[] { gmonFile, gd, view_samplesFunctionT_RefFile, view_samplesFunctionT_DumpFile, FunctionHistogramContentProvider.sharedInstance, true });
        params.add(new Object[] { gmonFile, gd, view_samplesFlat_RefFile, view_samplesFlat_DumpFile, FlatHistogramContentProvider.sharedInstance, false });
        params.add(new Object[] { gmonFile, gd, view_samplesFlatT_RefFile, view_samplesFlatT_DumpFile, FlatHistogramContentProvider.sharedInstance, true });
    }
    return params;
}
Also used : Path(org.eclipse.core.runtime.Path) InputStreamReader(java.io.InputStreamReader) InputStream(java.io.InputStream) ArrayList(java.util.ArrayList) IOException(java.io.IOException) LineNumberReader(java.io.LineNumberReader) GmonDecoder(org.eclipse.linuxtools.internal.gprof.parser.GmonDecoder) IBinaryObject(org.eclipse.cdt.core.IBinaryParser.IBinaryObject) File(java.io.File) Parameters(org.junit.runners.Parameterized.Parameters)

Aggregations

Parameters (org.junit.runners.Parameterized.Parameters)77 ArrayList (java.util.ArrayList)43 File (java.io.File)24 TestCaseContext (org.apache.asterix.testframework.context.TestCaseContext)6 Date (java.util.Date)5 SslContext (io.netty.handler.ssl.SslContext)4 IOException (java.io.IOException)4 ExpiredCRLException (org.apereo.cas.adaptors.x509.authentication.ExpiredCRLException)4 ThresholdExpiredCRLRevocationPolicy (org.apereo.cas.adaptors.x509.authentication.revocation.policy.ThresholdExpiredCRLRevocationPolicy)4 RunWith (org.junit.runner.RunWith)4 ClassPathResource (org.springframework.core.io.ClassPathResource)4 ZonedDateTime (java.time.ZonedDateTime)3 Configuration (org.apache.hadoop.conf.Configuration)3 YarnConfiguration (org.apache.hadoop.yarn.conf.YarnConfiguration)3 RevokedCertificateException (org.apereo.cas.adaptors.x509.authentication.revocation.RevokedCertificateException)3 Parameterized (org.junit.runners.Parameterized)3 CollectionAgentDTO (org.opennms.netmgt.collection.dto.CollectionAgentDTO)3 FileFilter (java.io.FileFilter)2 InputStream (java.io.InputStream)2 Field (java.lang.reflect.Field)2