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


Java Parameters类代码示例

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


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

示例1: data

import org.junit.runners.Parameterized.Parameters; //导入依赖的package包/类
@Parameters
public static Collection<Object[]> data() {
    return asList(new Object[][] {
            { "date-time", Date.class },
            { "date", String.class },
            { "time", String.class },
            { "utc-millisec", Long.class },
            { "regex", Pattern.class },
            { "color", String.class },
            { "style", String.class },
            { "phone", String.class },
            { "uri", URI.class },
            { "email", String.class },
            { "ip-address", String.class },
            { "ipv6", String.class },
            { "host-name", String.class },
            { "uuid", UUID.class }});
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:19,代码来源:FormatRuleTest.java

示例2: data

import org.junit.runners.Parameterized.Parameters; //导入依赖的package包/类
@Parameters(name="{0}-{1}")
public static Collection<Object[]> data() {
    ArrayList<Object[]> list = new ArrayList<>();
    for( Object[] val : ScriptEngine.testParams() ) {
        ScriptEngine script = (ScriptEngine)val[0];
        addParam( list, script, "intConst" );
        addParam( list, script, "floatConst" );
        addParam( list, script, "doubleConst" );
        addParam( list, script, "addInt", 1, 3 );
        addParam( list, script, "addLong" );
        addParam( list, script, "addFloat", 1F, 3.5F );
        addParam( list, script, "addDouble", 1.0, 3.5 );
        addParam( list, script, "subInt", 1, 3 );
        addParam( list, script, "subLong" );
        addParam( list, script, "subFloat", 1F, 3.5F );
        addParam( list, script, "subDouble", 1.0, 3.5 );
        addParam( list, script, "mulDivInt" );
        addParam( list, script, "mulDivLong" );
        addParam( list, script, "mulDivFloat" );
        addParam( list, script, "mulDivDouble" );
        addParam( list, script, "intBits" );
        addParam( list, script, "longBits" );
    }
    return list;
}
 
开发者ID:i-net-software,项目名称:JWebAssembly,代码行数:26,代码来源:MathOperations.java

示例3: data

import org.junit.runners.Parameterized.Parameters; //导入依赖的package包/类
/**
 * The data for this test...
 */
@Parameters
public static Collection<Object[]> data() {
  return Arrays.asList(new Object[][]{
      // Input Value as a int; Expected byte[] in ASN.1
      // 0
      {0, BaseEncoding.base16().decode("00")},
      // 1
      {1, BaseEncoding.base16().decode("01")},
      // 2
      {2, BaseEncoding.base16().decode("02")},
      // 3
      {127, BaseEncoding.base16().decode("7F")},
      // 4
      {128, BaseEncoding.base16().decode("80")},
      // 5
      {254, BaseEncoding.base16().decode("FE")},
      // 6
      {255, BaseEncoding.base16().decode("FF")},});
}
 
开发者ID:hyperledger,项目名称:quilt,代码行数:23,代码来源:OerUint8CodecTest.java

示例4: getParameters

import org.junit.runners.Parameterized.Parameters; //导入依赖的package包/类
/**
 * @return The arrays of parameters
 */
@Parameters(name = "{index}: {0}")
public static Iterable<Object[]> getParameters() {
    return Arrays.asList(new Object[][] {
            { 0, "0", 10.0 },
            { 3, "300", 100.0 },
            { 975, "97.5", 0.1 },
            { 1000, "1 k", 1.0 },
            { 4000, "40", 0.01 },
            { -4000, "-40", 0.01 },
            { -0.04, "-4", 100.0 },
            { 0.002, "20", 10000.0 },
            { 0.0555, "5.5 k", 100000.0 },
            { 0.0004928373928, "49.3 n", 0.0001 },
            { 0.000000251, "251 p", 0.001 },
            { Double.POSITIVE_INFINITY, "∞", 0.001 },
            { Double.MAX_VALUE, "4", Double.MIN_NORMAL},
    });
}
 
开发者ID:lttng,项目名称:lttng-scope,代码行数:22,代码来源:DecimalUnitFormatFactorTest.java

示例5: getParameters

import org.junit.runners.Parameterized.Parameters; //导入依赖的package包/类
@Parameters
    public static Iterable<Object[]> getParameters() {
        return Arrays.asList(new Object[][] {
// @formatter:off
            // (0)
            { "TEST_TEST_TEST", false, "test-test-test", },
            // (1)
            { "test-test-test", true , "test-test-test", },
            // (2)
            { "test.test.test", true , "test.test.test", },
            // (3)
            { "---", false, "E:Could not create a valid domain from \"---\"", },
            // (4)
            { "@12", false, "12", },
            // (5)
            { "@@@", false, "E:Could not create a valid domain from \"@@@\"", },
// @formatter:on
        });
    }
 
开发者ID:SAP,项目名称:cf-mta-deploy-service,代码行数:20,代码来源:DomainValidatorTest.java

示例6: data

import org.junit.runners.Parameterized.Parameters; //导入依赖的package包/类
@Parameters
public static Collection<Object[]> data() {
  return Arrays.asList(new Object[][] {
      { new String(new int[] { 0x00a0 }, 0, 1), true },
      { new String(new int[] { 0x2000 }, 0, 1), true },
      { new String(new int[] { 0x200f }, 0, 1), true },
      { new String(new int[] { 0x2028 }, 0, 1), true },
      { new String(new int[] { 0x202f }, 0, 1), true },
      { new String(new int[] { 0xd800 }, 0, 1), true },
      { new String(new int[] { 0xdfff }, 0, 1), true },
      { new String(new int[] { 0xfff0 }, 0, 1), true },
      { new String(new int[] { 0xffff }, 0, 1), true },
      { "a/b", false },
      { "<a", false },
      { "a>", true },
      { "a<b>", true },
      { "<a>b", true }
  });
}
 
开发者ID:inferjay,项目名称:r8,代码行数:20,代码来源:InvalidFieldNames.java

示例7: getParameters

import org.junit.runners.Parameterized.Parameters; //导入依赖的package包/类
@Parameters
    public static Collection<Object[]> getParameters() {
        return Arrays.asList(new Object[][] {
// @formatter:off
            {
                "mtad-09.yaml", "/mta/targets-v2.json", "/mta/platform-types-v2.json", "R:mtad-09.yaml.json",
            },
            {
                "mtad-10.yaml", "/mta/targets-v2.json", "/mta/platform-types-v2.json", "R:mtad-10.yaml.json",
            },
            {
                "mtad-11.yaml", "/mta/targets-v2.json", "/mta/platform-types-v2.json", "R:mtad-11.yaml.json",
            },
// @formatter:on
        });
    }
 
开发者ID:SAP,项目名称:cf-mta-deploy-service,代码行数:17,代码来源:UserProvidedResourceResolverTest.java

示例8: getParameters

import org.junit.runners.Parameterized.Parameters; //导入依赖的package包/类
@Parameters
public static Iterable<Object[]> getParameters() {
    return Arrays.asList(new Object[][] {
// @formatter:off
        // (0)
        { "[{\"org\":\"org1\",\"space\":\"space1\"}]", true, },
        // (1)
        { "[{\"org\":\"org1\",\"space\":\"space1\"},{\"org\":\"org2\",\"space\":\"space2\"}]", true, },
        // (2) Test with only org without space:
        { "[{\"org\":\"org1\"}]", true, },
        // (3) Test with random object
        { "randomString", false, },
        // (4) Test with only space without org:
        { "[{\"space\":\"space1\"}]", false, },
        // (5) Not a List
        { "{\"org\":\"org1\",\"space\":\"space1\"}", false, },
        // (6) Test with org that is integer:
        { "[{\"org\": 3,\"space\":\"space1\"}]", false, },
        // (7) Test with space that is integer:
        { "[{\"org\":\"org1\",\"space\": 3}]", false, },
        // (8) Test with org and space that are integers:
        { "[{\"org\": 3,\"space\": 3}]", false, },
// @formatter:on
    });
}
 
开发者ID:SAP,项目名称:cf-mta-deploy-service,代码行数:26,代码来源:VisibilityValidatorTest.java

示例9: getParameters

import org.junit.runners.Parameterized.Parameters; //导入依赖的package包/类
@Parameters
public static Iterable<Object[]> getParameters() {
    return Arrays.asList(new Object[][] {
        // @formatter:off
        {
            new SimpleApplication("test-app-1", 2), new SimpleApplication("test-app-1", 3),
        },
        {
            new SimpleApplication("test-app-1", 2), new SimpleApplication("test-app-1", 2),
        },
        {
            new SimpleApplication("test-app-1", 2), null,
        },
        // @formatter:on
    });
}
 
开发者ID:SAP,项目名称:cf-mta-deploy-service,代码行数:17,代码来源:ScaleAppStepTest.java

示例10: getParameters

import org.junit.runners.Parameterized.Parameters; //导入依赖的package包/类
@Parameters
    public static Iterable<Object[]> getParameters() {
        return Arrays.asList(new Object[][] {
// @formatter:off
            // (0) Service with a changed plan
            {
                "service-update-01.json", null, null
            },
            // (1) With non-existing service
            {
                "service-update-02.json", "404 Not Found: Service 'com.sap.sample.mta.test' not found", CloudFoundryException.class
            },
            // (2) With non-existing service plan
            {
                "service-update-03.json", "Could not create service instance com.sap.sample.mta.test. Service plan test-new-plan for service some-label not found", SLException.class
            }
// @formatter:on
        });
    }
 
开发者ID:SAP,项目名称:cf-mta-deploy-service,代码行数:20,代码来源:ServiceUpdaterTest.java

示例11: data

import org.junit.runners.Parameterized.Parameters; //导入依赖的package包/类
@Parameters
public static Collection<Object[]> data() {
    return Arrays.<Object[]>asList(
            new Object[] { "8", "threadid=1", 11221, 13913 },
            new Object[] { "8", "threadid=2", 13914, 16606 },
            new Object[] { "8", "threadid=3", 16607, 19299 },
            new Object[] { "8", "threadid=4", 19300, 21992 },
            new Object[] { "8", "threadid=5", 21993, 24685 },
            new Object[] { "8", "threadid=6", 24686, 27378 },
            new Object[] { "8", "threadid=7", 27379, 30071 },
            new Object[] { "8", "threadid=8", 30072, 32764 },
            new Object[] { "1", "threadid=1", 11221, 32767 },
            new Object[] { "2", "threadid=1", 11221, 21993 },
            new Object[] { "2", "threadid=2", 21994, 32766 },
            new Object[] { null, null, 11221, 32767 },
            new Object[] { "", "", 11221, 32767 });
}
 
开发者ID:didichuxing2,项目名称:https-github.com-apache-zookeeper,代码行数:18,代码来源:PortAssignmentTest.java

示例12: data

import org.junit.runners.Parameterized.Parameters; //导入依赖的package包/类
@Parameters(name = "FFX input: {0} - radix: {1} - bound: {2}")
public static Object[][] data() throws DecoderException {
    return new Object[][]{
        {new FFXInput(new byte[16], new byte[0]), 2, 512},
        {new FFXInput(new byte[16], new byte[0]), 21, 128},
        {new FFXInput(new byte[16], new byte[0]), 36, 64},

        {new FFXInput(new byte[16], new byte[]{1, 2, 3, 4, 5, 6, 7, 8, 9}), 13, 13000},
        {new FFXInput(new byte[16], new byte[]{(byte) 0xC1, 24}), 17, 1024},
        {new FFXInput(new byte[16], new byte[]{2}), 2, 1024},

        {new FFXInput(new byte[]{11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11}, new byte[]{(byte) 0F, 32}), 22, 640},
        {new FFXInput(new byte[]{(byte) 0xEF, 0x22, (byte) 0xA0, (byte) 0xA6, 0x79, 0x5D, (byte) 0xCC, 0x22, 0x12, (byte) 0xA1, 0x33, 0x12, (byte) 0xE9, 0x00, 0x10, 0x2E}, new byte[]{0, 0}), 2, 512},
        {new FFXInput(new byte[]{0x01, 0x12, 0x23, 0x34, 0x45, 0x56, 0x67, 0x78, (byte) 0x89, (byte) 0x9A, (byte) 0xAB, (byte) 0xBC, (byte) 0xCD, (byte) 0xDE, (byte) 0xEF, (byte) 0xF0}, new byte[0]), 2, 512},

        {new FFXInput(getRandomBytes(16), getRandomBytes(3)), 2, 512},
        {new FFXInput(getRandomBytes(16), getRandomBytes(7)), 3, 12345},
        {new FFXInput(getRandomBytes(16), getRandomBytes(0)), 17, 128},
        {new FFXInput(getRandomBytes(16), getRandomBytes(18)), 24, 64},
        {new FFXInput(getRandomBytes(16), getRandomBytes(2)), 31, 32}
    };
}
 
开发者ID:NCSC-NL,项目名称:PEF,代码行数:23,代码来源:TestFFX.java

示例13: getTestData

import org.junit.runners.Parameterized.Parameters; //导入依赖的package包/类
@Parameters()
public static Collection<Object[]> getTestData() {
    return Arrays.asList(new Object[][] {
        {NO_DOMAIN_MC, emptyGraph(NO_DOMAIN_MC)},
        {NO_MGR_POLICY_MC, emptyGraph(NO_MGR_POLICY_MC)},
        {MGR_POLICY_WITHOUT_POLICY_MC, createPolicyGraph(MGR_POLICY_WITHOUT_POLICY_MC)},
        {MGR_POLICY_WITH_POLICY_MC, updatePolicyGraph(MGR_POLICY_WITH_POLICY_MC)},
        {POLICY_WITHOUT_MGR_POLICY_MC, deletePolicyGraph(POLICY_WITHOUT_MGR_POLICY_MC)},
        // TODO hailee: Looks like the test below is still failing inconsistently.
        //{DOMAINS_WITH_ORPHAN_AND_OUT_OF_SYNC_POLICIES_MC,
        //   deleteOrphanAndVSPoliciesGraph(DOMAINS_WITH_ORPHAN_AND_OUT_OF_SYNC_POLICIES_MC)},
        //{DOMAINS_WITHOUT_POLICIES_AND_WITH_ORPHAN_POLICIES_MC,
        //  deletePoliciesWithoutMgrPoliciesGraph(DOMAINS_WITHOUT_POLICIES_AND_WITH_ORPHAN_POLICIES_MC)},
        {DOMAIN_WITH_MULTIPLE_POLICIES_MC, deletePoliciesFromDomainGraph(DOMAIN_WITH_MULTIPLE_POLICIES_MC)}
    });
}
 
开发者ID:opensecuritycontroller,项目名称:osc-core,代码行数:17,代码来源:SyncPolicyMetaTaskTest.java

示例14: data

import org.junit.runners.Parameterized.Parameters; //导入依赖的package包/类
@Parameters(name = "{index}: {0}")
public static Collection<Object[]> data() {
	return Arrays.asList(new Object[][] {
		{ "SELECT BLD FROM acs;" },
		{ "SELECT BLD as units_in_structure, COUNT(ST) as estimate FROM acs GROUP BY BLD;" },
		{ "SELECT BATH as has_bath, COUNT(ST) as ct FROM acs GROUP BY BATH;" },
		{ "SELECT ACR as lotsize, AVG(BDSP) as avg_num_bedrooms FROM acs GROUP BY ACR;" },
		{ "SELECT PSF as has_sub_families, SUM(NP) as num_people FROM acs GROUP BY PSF;" },
		{ "SELECT AVG(NP) as avg_num_people FROM acs;" },
		{ "SELECT BDSP as num_bedrooms, AVG(ACR) as avg_lot_size FROM acs WHERE VEH >= 2 GROUP BY BDSP;" },
		{ "SELECT MIN(YBL) as earliest_built_bucket FROM acs WHERE ACR = 3;" },
		{ "SELECT MIN(RMSP) as min_num_rooms FROM acs WHERE RWAT=2;" },
		{ "SELECT * FROM acs WHERE REFR = 1 AND STOV = 1 AND TEL = 1 AND TOIL = 2;" },
		// simpledb cannot handle predicates vs other columns (only relative to constants)
		{ "SELECT * FROM acs WHERE VEH >= 1 AND VEH <= 5 AND RMSP > 4;" }
	});
}
 
开发者ID:mitdbg,项目名称:imputedb,代码行数:18,代码来源:CleanTest.java

示例15: getParameters

import org.junit.runners.Parameterized.Parameters; //导入依赖的package包/类
@Parameters
public static Collection<Object[]> getParameters() {
    return Arrays.asList(new Object[][] {
            {
                    LdapTestUtils.DirectoryType.ActiveDirectory,
                    false,
                    new String[] {"/ldap-provision-context.xml", "/ad-authn-test.xml"},
            },
            {
                    LdapTestUtils.DirectoryType.OpenLdap,
                    true,
                    new String[] {"/ldap-provision-context.xml", "/openldap-searchbind-authn-test.xml"},
            },
            {
                    LdapTestUtils.DirectoryType.OpenLdap,
                    true,
                    new String[] {"/ldap-provision-context.xml", "/openldap-anonsearchbind-authn-test.xml"},
            },
            {
                    LdapTestUtils.DirectoryType.OpenLdap,
                    false,
                    new String[] {"/ldap-provision-context.xml", "/openldap-directbind-authn-test.xml"},
            },
    });
}
 
开发者ID:luotuo,项目名称:cas4.0.x-server-wechat,代码行数:26,代码来源:LdapAuthenticationHandlerTests.java


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