当前位置: 首页>>代码示例>>Java>>正文


Java Parameterized类代码示例

本文整理汇总了Java中org.junit.runners.Parameterized的典型用法代码示例。如果您正苦于以下问题:Java Parameterized类的具体用法?Java Parameterized怎么用?Java Parameterized使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Parameterized类属于org.junit.runners包,在下文中一共展示了Parameterized类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: generateTestParameters

import org.junit.runners.Parameterized; //导入依赖的package包/类
@Parameterized.Parameters(name = "{0}")
public static Iterable<Object[]> generateTestParameters() {
    return Arrays.asList(new Object[][]{
            {__.V().count(), countStep(Vertex.class), Collections.emptyList()},
            {__.V().count(), countStep(Vertex.class), TraversalStrategies.GlobalCache.getStrategies(TinkerGraph.class).toList()},
            {__.V().as("a").count(), countStep(Vertex.class), TraversalStrategies.GlobalCache.getStrategies(TinkerGraph.class).toList()},
            {__.V().count().as("a"), countStep(Vertex.class), TraversalStrategies.GlobalCache.getStrategies(TinkerGraph.class).toList()},
            {__.V().map(out()).count().as("a"), countStep(Vertex.class), TraversalStrategies.GlobalCache.getStrategies(TinkerGraph.class).toList()},
            {__.V().map(out()).identity().count().as("a"), countStep(Vertex.class), TraversalStrategies.GlobalCache.getStrategies(TinkerGraph.class).toList()},
            {__.V().map(out().groupCount()).identity().count().as("a"), countStep(Vertex.class), TraversalStrategies.GlobalCache.getStrategies(TinkerGraph.class).toList()},
            {__.V().label().map(s -> s.get().length()).count(), countStep(Vertex.class), TraversalStrategies.GlobalCache.getStrategies(TinkerGraph.class).toList()},
            {__.V().as("a").map(select("a")).count(), countStep(Vertex.class),TraversalStrategies.GlobalCache.getStrategies(TinkerGraph.class).toList()},
            //
            {__.V(), __.V(), Collections.emptyList()},
            {__.V().out().count(), __.V().out().count(), Collections.emptyList()},
            {__.V(1).count(), __.V(1).count(), Collections.emptyList()},
            {__.count(), __.count(), Collections.emptyList()},
            {__.V().map(out().groupCount("m")).identity().count().as("a"), __.V().map(out().groupCount("m")).identity().count().as("a"), Collections.emptyList()},
    });
}
 
开发者ID:ShiftLeftSecurity,项目名称:tinkergraph-gremlin,代码行数:21,代码来源:TinkerGraphCountStrategyTest.java

示例2: constructorFailParams

import org.junit.runners.Parameterized; //导入依赖的package包/类
@Parameterized.Parameters
public static Collection constructorFailParams() {
  return Arrays.asList(new Object[][]{
    {null, null, null, null, null, null},
    {"", null, null, null, null, null},
    {null, null, null, null, null, null},
    {"server", null, null, null, null, null},
    {"server", "", null, null, null, null},
    {"server", "foo", null, null, null, null},
    {"server", "/tmp", null, null, null, null},
    {"server", "/tmp", "", null, null, null},
    {"server", "/tmp", "foo", null, null, null},
    {"server", "/tmp", "/tmp", null, null, null},
    {"server", "/tmp", "/tmp", "", null, null},
    {"server", "/tmp", "/tmp", "foo", null, null},
    {"server", "/tmp", "/tmp", "/tmp", null, null},
    {"server", "/tmp", "/tmp", "/tmp", "", null},
    {"server", "/tmp", "/tmp", "/tmp", "foo", null}});
}
 
开发者ID:naver,项目名称:hadoop,代码行数:20,代码来源:TestServerConstructor.java

示例3: data

import org.junit.runners.Parameterized; //导入依赖的package包/类
@Parameterized.Parameters(name = "{index}: \"{0}\"")
public static List<Object[]> data() {

    return Arrays.asList(new Object[][]{
            {
                    "Test valid usage",
                    AnnotationProcessorIntegrationTestConfigurationBuilder.createTestConfig()
                            .setSourceFileToCompile("testcases/generators/FileObjectUtilsTestClass.java")
                            .compilationShouldSucceed()
                            .resourceShouldMatch(JavaFileObjects.forResource("testcases/generators/expectedResult.txt"))
                            .build()
            },


    });

}
 
开发者ID:toolisticon,项目名称:annotation-processor-toolkit,代码行数:18,代码来源:FileObjectUtilsTest.java

示例4: data

import org.junit.runners.Parameterized; //导入依赖的package包/类
@Parameterized.Parameters
public static Collection<Object[]> data() {
    return Arrays.asList(new Object[][] {
        {
            "",
            Collections.emptyList()
        },
        {
            "redhat",
            Arrays.asList(
                new Templates.Resource("deployment.yml", "src/main/fabric8/deployment.yml"),
                new Templates.Resource("settings.xml", "configuration/settings.xml")
            )
        }
    });
}
 
开发者ID:syndesisio,项目名称:syndesis,代码行数:17,代码来源:DefaultProjectGeneratorTest.java

示例5: data

import org.junit.runners.Parameterized; //导入依赖的package包/类
@Parameterized.Parameters
public static Collection<Object[]> data() {
    return Arrays.asList(new Object[][] {
            {"a.b.c", "a.b.c", true},
            {"a.b.c.*", "a.b.c.d", true},
            {"*.c", "a.b.c", true},
            {"*", "a.b.c.MyTest", true},
            {"*.MyTest", "a.b.c.MyTest", true},
            {"a.b.*.c", "a.b.x.y.c", true},
            {"a.b.*.c.*", "a.b.x.y.c.MyTest", true},

            {"a.b.*.c", "a.b.x.y.c.NotMyTest", false},
            {"*.MyTest", "a.b.c.NotMyTest", false},
            {"*.c", "a.b.c.d", false},
            {"a.b.c", "x", false},
            {"", "x", false},
    });
}
 
开发者ID:apache,项目名称:sling-org-apache-sling-testing-rules,代码行数:19,代码来源:FilterRuleAsteriskMatchTest.java

示例6: getParameters

import org.junit.runners.Parameterized; //导入依赖的package包/类
@Parameterized.Parameters
public static Collection<Object[]> getParameters() {
    return Arrays.asList(new Object[][]{
            // Allow all paths on single host
            {
                    newService("https://host.vt.edu/**"),
                    "https://host.vt.edu/a/b/c?a=1&b=2",
                    true,
            },
            // Global catch-all for HTTP
            {
                    newService("http://**"),
                    "http://host.subdomain.example.com/service",
                    true,
            },
            // Null case
            {
                    newService("https:/example.com/**"),
                    null,
                    false,
            },
    });
}
 
开发者ID:luotuo,项目名称:cas4.0.x-server-wechat,代码行数:24,代码来源:RegisteredServiceImplTests.java

示例7: data

import org.junit.runners.Parameterized; //导入依赖的package包/类
@Parameterized.Parameters
public static Collection<Object[]> data() {
    return Arrays.asList(new Object[][] {
        { strategiesListOf("a", "c", "d", "e", "b"), strategiesListOf("a", "b", "c", "d", "e") },
        { strategiesListOf("d,e", "b,c,d", "a,b,d", "a", "a,c"), strategiesListOf("a,b,d", "a,c", "a", "b,c,d", "d,e") },
        { strategiesListOf("a,c,d", "a,c,e", "a,c,d,e", "a,b", "a,b,c,d,e"), strategiesListOf("a,b,c,d,e", "a,b", "a,c,d,e", "a,c,d", "a,c,e") },
        { strategiesListOf("b,c,d", "a", "b", "b,c,d,e", "c,d,e"), strategiesListOf("a", "b,c,d,e", "b,c,d", "b", "c,d,e") },
        { strategiesListOf("e", "c", "c,e", "a,d,e", "a,e"), strategiesListOf("a,d,e", "a,e", "c,e", "c", "e") },
        { strategiesListOf("b,d", "a,d", "d,e", "c", "b"), strategiesListOf("a,d", "b,d", "b", "c", "d,e") },
        { strategiesListOf("a,c,e", "a,c", "a,c,d", "a,b", "b,c"), strategiesListOf("a,b", "a,c,d", "a,c,e", "a,c", "b,c") },
        { strategiesListOf("c,e", "a,b", "a", "b"), strategiesListOf("a,b", "a", "b", "c,e") },
        { strategiesListOf("b,a", "e,a", "a,e", "a,b"), strategiesListOf("b,a", "a,b", "e,a", "a,e") },
        { strategiesListOf("a,b,d", "a", "a,d,b", "a,b"), strategiesListOf("a,b,d", "a,d,b", "a,b", "a") },
        { strategiesListOf("e", "d", "e,c", "e,d"), strategiesListOf("e,c", "e,d", "d", "e") },
        { strategiesListOf("c,d,e", "d,e,c", "d,c,e"), strategiesListOf("c,d,e", "d,e,c", "d,c,e") },
        { strategiesListOf("c,e", "e,d", "a"), strategiesListOf("a", "c,e", "e,d") },
        { strategiesListOf("b,c,d,e", "a"), strategiesListOf("a", "b,c,d,e") },
    });
}
 
开发者ID:arquillian,项目名称:smart-testing,代码行数:20,代码来源:StrategiesComparatorTest.java

示例8: data

import org.junit.runners.Parameterized; //导入依赖的package包/类
@Parameterized.Parameters(name = "{index}: \"{0}\"")
public static List<Object[]> data() {

    return Arrays.asList(new Object[][]{
            {
                    "Test valid usage",
                    AnnotationProcessorIntegrationTestConfigurationBuilder.createTestConfig()
                            .setSourceFileToCompile("testcases/methodWithOneStringParameterAndVoidReturn/ValidUsageTest.java")
                            .addMessageValidator()
                                .setInfoChecks("Start processing")
                            .finishMessageValidator()
                            .compilationShouldSucceed()
                            .build()
            },
            {
                    "Test invalid usage : non void return type",
                    AnnotationProcessorIntegrationTestConfigurationBuilder.createTestConfig()
                            .setSourceFileToCompile("testcases/methodWithOneStringParameterAndVoidReturn/InvalidUsageNonVoidReturnType.java")
                            .compilationShouldFail()
                            .addMessageValidator()
                                .setErrorChecks("Method must have void return type")
                            .finishMessageValidator()
                            .build()
            },
            {
                    "Test invalid usage : non String parameter",
                    AnnotationProcessorIntegrationTestConfigurationBuilder.createTestConfig()
                            .setSourceFileToCompile("testcases/methodWithOneStringParameterAndVoidReturn/InvalidUsageNonStringParameter.java")
                            .compilationShouldFail()
                            .addMessageValidator()
                                .setErrorChecks("Method must have parameters of types [java.lang.String], but has parameters of types [java.lang.Object]")
                            .finishMessageValidator()
                            .build()
            },


    });

}
 
开发者ID:toolisticon,项目名称:annotation-processor-toolkit,代码行数:40,代码来源:MethodWithOneStringParameterAndVoidReturnTypeProcessorTest.java

示例9: params

import org.junit.runners.Parameterized; //导入依赖的package包/类
@Parameterized.Parameters
public static Collection<Object[]> params() {
    return Arrays.asList(new Object[][] {
            {0, 0, "0"},
            {1, 1, "1"},
            {-5, -5, "-5"},
            {488, 488, "488"},
            {-876, -876, "-876"},
    });
}
 
开发者ID:FWDekker,项目名称:intellij-randomness,代码行数:11,代码来源:IntegerInsertActionTest.java

示例10: data

import org.junit.runners.Parameterized; //导入依赖的package包/类
@Parameterized.Parameters(name = "{index}: plain text is {0}")
public static Iterable<int[]> data() {
    return Arrays.asList(
            new int[] {18, 27, 13, 34, 44, 6, 37, 28, 10, 9, 16, 3, 2},
            new int[] {4, 4, 5, 4, 7, 0, 9, 4, 3, 2},
            new int[] {11, 33, 44},
            new int[] {37, 25, 16}
    );
}
 
开发者ID:idealista,项目名称:format-preserving-encryption-java,代码行数:10,代码来源:FF1AlgorithmWithRadix45NoEmptyDataKey256Should.java

示例11: getTestParms

import org.junit.runners.Parameterized; //导入依赖的package包/类
@Parameterized.Parameters
public static List<Object[]> getTestParms() {
    final List<Object[]> params = new ArrayList<Object[]>(6);

    // Test case #1 - Buffer is bigger than encoded data
    params.add(new Object[] {1024});

    // Test case #2 - Buffer overflow case
    params.add(new Object[] {10});
    return params;
}
 
开发者ID:luotuo,项目名称:cas4.0.x-server-wechat,代码行数:12,代码来源:KryoTranscoderTests.java

示例12: data

import org.junit.runners.Parameterized; //导入依赖的package包/类
@Parameterized.Parameters(name= "{index}: #{0} is inside #{1}")
public static Iterable<Object[]> data() {
    return Arrays.asList(new Object[][] {
            { "dropbox:/dir1/dir2/file.org", "dropbox:/dir1/dir2" },
            { "dropbox:/dir/file.org",       "dropbox:/dir"       },
            { "dropbox:/dir",                "dropbox:"           },
            { "dropbox:/dir/",               "dropbox:"           },
            { "dropbox:/",                   "dropbox:"           }
    });
}
 
开发者ID:orgzly,项目名称:orgzly-android,代码行数:11,代码来源:UriUtilsTest.java

示例13: queries

import org.junit.runners.Parameterized; //导入依赖的package包/类
@Parameterized.Parameters(name = "{index}: ({0})={1}")
public static Iterable<Object[]> queries() throws Exception {
    return Arrays.asList(new Object[][]{
            {"src/test/resources/employees.xlsx", unmarshalling(), null, -1},
            {"src/test/resources/employees_sheet2.xlsx", unmarshalling(), null, 1},
            {"src/test/resources/cloud.xls", unmarshalling(), PoijiException.class, -1},
            {"src/test/resources/cloud", unmarshalling(), PoijiException.class, -1},
    });
}
 
开发者ID:ozlerhakan,项目名称:poiji,代码行数:10,代码来源:DerializersTest.java

示例14: data

import org.junit.runners.Parameterized; //导入依赖的package包/类
@Parameterized.Parameters(name= "{index}: Filename {0} supported: #{1}")
public static Iterable<Object[]> data() {
    return Arrays.asList(new Object[][] {
            { "filename.org", true },
            { "filename.txt", false },
            { "filename.org.txt", true },
            { ".#filename.org", false },
    });
}
 
开发者ID:orgzly,项目名称:orgzly-android,代码行数:10,代码来源:BookNameTest.java

示例15: parameters

import org.junit.runners.Parameterized; //导入依赖的package包/类
@Parameterized.Parameters(name = "{0}")
public static List<Object[]> parameters() {
  try {
    List<Object[]> result = new ArrayList<>();
    for (WebPlatformUrlTestData urlTestData : loadTests()) {
      result.add(new Object[] {urlTestData});
    }
    return result;
  } catch (IOException e) {
    throw new AssertionError();
  }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:13,代码来源:WebPlatformUrlTest.java


注:本文中的org.junit.runners.Parameterized类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。