當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。