org.junit.runners.Parameterized.Parameters Java Examples

The following examples show how to use org.junit.runners.Parameterized.Parameters. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ValidationTestSuite.java    From org.hl7.fhir.core with Apache License 2.0 6 votes vote down vote up
@Parameters(name = "{index}: id {0}")
public static Iterable<Object[]> data() throws IOException {
  String contents = TestingUtilities.loadTestResource("validator", "manifest.json");

  Map<String, JsonObject> examples = new HashMap<String, JsonObject>();
  manifest = (JsonObject) new com.google.gson.JsonParser().parse(contents);
  for (Entry<String, JsonElement> e : manifest.getAsJsonObject("test-cases").entrySet()) {
    examples.put(e.getKey(), e.getValue().getAsJsonObject());
  }

  List<String> names = new ArrayList<String>(examples.size());
  names.addAll(examples.keySet());
  Collections.sort(names);

  List<Object[]> objects = new ArrayList<Object[]>(examples.size());
  for (String id : names) {
    objects.add(new Object[]{id, examples.get(id)});
  }
  return objects;
}
 
Example #2
Source File: EIP1559BaseFeeTest.java    From besu with Apache License 2.0 6 votes vote down vote up
@Parameters
public static Collection<Object[]> data() {
  return Arrays.asList(
      new Object[][] {
        {
          FEE_MARKET.getInitialBasefee(),
          FEE_MARKET.getTargetGasUsed(),
          FEE_MARKET.getInitialBasefee()
        },
        {FEE_MARKET.getInitialBasefee(), 7000000, 962500000},
        {1100000000, FEE_MARKET.getTargetGasUsed(), 1100000000},
        {1100000000, 9000000, 1086250000},
        {1086250000, 9000000, 1072671875},
        {1072671875, 9000000, 1059263476},
        {1059263476, 10001000, 1059276716},
        {1059276716, 16000000, 1138722469},
        {MARKER_BASE_FEE, 0, 918084097},
        {MARKER_BASE_FEE, 5, 918084161},
        {MARKER_BASE_FEE, 5000, 918149673},
        {MARKER_BASE_FEE, 500000, 924641839},
        {MARKER_BASE_FEE, FEE_MARKET.getTargetGasUsed(), MARKER_BASE_FEE},
        {MARKER_BASE_FEE, FEE_MARKET.getMaxGas(), 1180393837}
      });
}
 
Example #3
Source File: RouteRuleRepositoryTest.java    From kbear with Apache License 2.0 6 votes vote down vote up
@Parameters(name = "{index}: id={0}, record={1}, ids={2}, records={3}, all={4}, topicId={5}, topicRecords={6}, consumerGroupId={7}, consumerGroupRecords={8}")
public static Collection<Object[]> data() {
    List<RouteRule> records = new ArrayList<>(Arrays.asList(ROUTE_RULE, ROUTE_RULE_2));
    RouteRules.sort(records);

    List<Object[]> parameterValues = new ArrayList<>();
    parameterValues.add(new Object[] { ROUTE_RULE_ID, ROUTE_RULE, Arrays.asList(ROUTE_RULE_ID),
            Arrays.asList(ROUTE_RULE), ALL_ROUTE_RULES, TopicRepositoryTest.TOPIC_ID, TOPIC_ROUTE_RULES,
            ConsumerGroupRepositoryTest.CONSUMER_GROUP_ID, CONSUMER_GROUP_ROUTE_RULES });
    parameterValues.add(new Object[] { ROUTE_RULE_ID, ROUTE_RULE, Arrays.asList(ROUTE_RULE_ID, ROUTE_RULE_ID_2),
            records, ALL_ROUTE_RULES, TopicRepositoryTest.TOPIC_ID_2, TOPIC_2_ROUTE_RULES,
            ConsumerGroupRepositoryTest.CONSUMER_GROUP_ID_2, CONSUMER_GROUP_2_ROUTE_RULES });
    parameterValues.add(new Object[] { UNKNOWN_ROUTE_RULE_ID, null, Collections.emptyList(),
            Collections.emptyList(), ALL_ROUTE_RULES, TopicRepositoryTest.TOPIC_ID, TOPIC_ROUTE_RULES,
            ConsumerGroupRepositoryTest.CONSUMER_GROUP_ID_3, CONSUMER_GROUP_3_ROUTE_RULES });
    return parameterValues;
}
 
Example #4
Source File: TestApplicationContextStripPathParams.java    From Tomcat8-Source-Read with MIT License 6 votes vote down vote up
@Parameters(name = "{index}: input[{0}]")
public static Collection<Object[]> data() {
    return Arrays.asList(new Object[][]{
        { "/foo", "/foo"},
        { "/foo/", "/foo/"},
        { "/foo/bar", "/foo/bar"},
        { "/foo;", "/foo"},
        { "/foo;/", "/foo/"},
        { "/foo;/bar", "/foo/bar"},
        { "/foo;a=1", "/foo"},
        { "/foo;a=1/", "/foo/"},
        { "/foo;a=1/bar", "/foo/bar"},
        // Arguably not valid but does the right thing anyway
        { ";/foo", "/foo"},
        { ";a=1/foo", "/foo"},
        { ";/foo/bar", "/foo/bar"},
        { ";/foo;a=1/bar", "/foo/bar"},
    });
}
 
Example #5
Source File: StepTest.java    From NeurophFramework with Apache License 2.0 6 votes vote down vote up
@Parameters
public static Collection<Object[]>  getParamters() {
	Object[][] objects = new Object[11][4];
	Random r = new Random();
	int row = 0;
	int ylow = 0;
	int yhigh = 0;
	int result = 0;
	for (int i = -5; i <= 5; i++) {
		ylow = r.nextInt(10);
		yhigh = ylow + 2;
		if (i > 0)
			result = yhigh;
		else
			result = ylow;
		objects[row] = new Object[] { i, result, ylow, yhigh };
		row++;
	}
	return Arrays.asList(objects);
}
 
Example #6
Source File: ConstantinopleSStoreOperationGasCostTest.java    From besu with Apache License 2.0 6 votes vote down vote up
@Parameters(name = "Code: {0}, Original: {1}")
public static Object[][] scenarios() {
  // Tests specified in EIP-1283.
  return new Object[][] {
    {"0x60006000556000600055", 0, 412, 0},
    {"0x60006000556001600055", 0, 20212, 0},
    {"0x60016000556000600055", 0, 20212, 19800},
    {"0x60016000556002600055", 0, 20212, 0},
    {"0x60016000556001600055", 0, 20212, 0},
    {"0x60006000556000600055", 1, 5212, 15000},
    {"0x60006000556001600055", 1, 5212, 4800},
    {"0x60006000556002600055", 1, 5212, 0},
    {"0x60026000556003600055", 1, 5212, 0},
    {"0x60026000556001600055", 1, 5212, 4800},
    {"0x60026000556002600055", 1, 5212, 0},
    {"0x60016000556000600055", 1, 5212, 15000},
    {"0x60016000556002600055", 1, 5212, 0},
    {"0x60016000556001600055", 1, 412, 0},
    {"0x600160005560006000556001600055", 0, 40218, 19800},
    {"0x600060005560016000556000600055", 1, 10218, 19800},
    {"0x60026000556000600055", 1, 5212, 15000},
  };
}
 
Example #7
Source File: SocketSslGreetingTest.java    From netty-4.1.22 with Apache License 2.0 6 votes vote down vote up
@Parameters(name = "{index}: serverEngine = {0}, clientEngine = {1}")
public static Collection<Object[]> data() throws Exception {
    List<SslContext> serverContexts = new ArrayList<SslContext>();
    serverContexts.add(SslContextBuilder.forServer(CERT_FILE, KEY_FILE).sslProvider(SslProvider.JDK).build());

    List<SslContext> clientContexts = new ArrayList<SslContext>();
    clientContexts.add(SslContextBuilder.forClient().sslProvider(SslProvider.JDK).trustManager(CERT_FILE).build());

    boolean hasOpenSsl = OpenSsl.isAvailable();
    if (hasOpenSsl) {
        serverContexts.add(SslContextBuilder.forServer(CERT_FILE, KEY_FILE)
                                            .sslProvider(SslProvider.OPENSSL).build());
        clientContexts.add(SslContextBuilder.forClient().sslProvider(SslProvider.OPENSSL)
                                            .trustManager(CERT_FILE).build());
    } else {
        logger.warn("OpenSSL is unavailable and thus will not be tested.", OpenSsl.unavailabilityCause());
    }

    List<Object[]> params = new ArrayList<Object[]>();
    for (SslContext sc: serverContexts) {
        for (SslContext cc: clientContexts) {
            params.add(new Object[] { sc, cc });
        }
    }
    return params;
}
 
Example #8
Source File: GasLimitRangeAndDeltaValidationRuleTest.java    From besu with Apache License 2.0 6 votes vote down vote up
@Parameters
public static Collection<Object[]> data() {
  return Arrays.asList(
      new Object[][] {
        {4096, 4096, new GasLimitRangeAndDeltaValidationRule(4095, 4097), true},
        // In Range, no change = valid,
        {4096, 4096, new GasLimitRangeAndDeltaValidationRule(4094, 4095), false},
        // Out of Range, no change = invalid,
        {4099, 4096, new GasLimitRangeAndDeltaValidationRule(4000, 4200), true},
        // In Range, <1/1024 change = valid,
        {4093, 4096, new GasLimitRangeAndDeltaValidationRule(4000, 4200), true},
        // In Range, ,1/1024 change = valid,
        {4092, 4096, new GasLimitRangeAndDeltaValidationRule(4000, 4200), false},
        // In Range, >1/1024 change = invalid,
        {4100, 4096, new GasLimitRangeAndDeltaValidationRule(4000, 4200), false}
        // In Range, >1/1024 change = invalid,
      });
}
 
Example #9
Source File: TestKeypad_Alert.java    From arcusplatform with Apache License 2.0 6 votes vote down vote up
@Parameters(name = "soundsEnabled? [{0}] silent? [{1}] sounds: {2}")
public static Iterable<Object[]> sounds() {
	return Arrays.asList(
			new Object[] { false, true,  KeyPad.SOUNDS_ON, ImmutableSet.of() },
			new Object[] { false, true,  KeyPad.SOUNDS_ALARM_ONLY, ImmutableSet.of() },
			new Object[] { false, true,  KeyPad.SOUNDS_KEYPAD_ONLY, ImmutableSet.of() },
			new Object[] { false, true,  KeyPad.SOUNDS_OFF, ImmutableSet.of() },
			
			new Object[] { true,  true,  KeyPad.SOUNDS_ON, KeyPad.SOUNDS_KEYPAD_ONLY },
			new Object[] { true,  true,  KeyPad.SOUNDS_ALARM_ONLY, KeyPad.SOUNDS_KEYPAD_ONLY },
			new Object[] { true,  true,  KeyPad.SOUNDS_KEYPAD_ONLY, KeyPad.SOUNDS_KEYPAD_ONLY },
			new Object[] { true,  true,  KeyPad.SOUNDS_OFF, KeyPad.SOUNDS_KEYPAD_ONLY },
			
			new Object[] { false, false, KeyPad.SOUNDS_ON, KeyPad.SOUNDS_ALARM_ONLY },
			new Object[] { false, false, KeyPad.SOUNDS_ALARM_ONLY, KeyPad.SOUNDS_ALARM_ONLY },
			new Object[] { false, false, KeyPad.SOUNDS_KEYPAD_ONLY, KeyPad.SOUNDS_ALARM_ONLY },
			new Object[] { false, false, KeyPad.SOUNDS_OFF, KeyPad.SOUNDS_ALARM_ONLY },
			
			new Object[] { true,  false, KeyPad.SOUNDS_ON, KeyPad.SOUNDS_ON },
			new Object[] { true,  false, KeyPad.SOUNDS_ALARM_ONLY, KeyPad.SOUNDS_ON },
			new Object[] { true,  false, KeyPad.SOUNDS_KEYPAD_ONLY, KeyPad.SOUNDS_ON },
			new Object[] { true,  false, KeyPad.SOUNDS_OFF, KeyPad.SOUNDS_ON }
	);
}
 
Example #10
Source File: TestDeviceFirmwareResolver.java    From arcusplatform with Apache License 2.0 6 votes vote down vote up
@Parameters(name="population[{0}],product[{1}],currentVersion[{2}], retryAttempts[{3}], isUpgrade[{4}],targetVersion[{5}],targetImage[{6}]")
public static List<Object []> files() {
   return Arrays.<Object[]>asList(
         new Object [] { Population.NAME_GENERAL, "product0", "1.0",  null, false, null, null},	//product0 not exist in xml
         new Object [] { Population.NAME_BETA, "product0", "1.0",  null, false, null, null},	//product0 not exist in xml
         new Object [] { Population.NAME_GENERAL, "product1", "1.0",  null, true, "1.1", "mockitron/product1/1.1.bin"},	//ok
         new Object [] { Population.NAME_QA, "product1", "1.0",  null, true, "1.1", "mockitron/product1/1.1-qa.bin"},	//ok
         new Object [] { Population.NAME_GENERAL, "product1", "1.1",  null, false, null, null},	//current version already at targetVersion
         new Object [] { Population.NAME_BETA, "product1", "1.0",  null, false, null, null},	//does not support population 
         new Object [] { Population.NAME_BETA, "product2", "1.0",  null, true, "1.2", "mockitron/product2/1.2.bin"},	//ok
         new Object [] { Population.NAME_QA, "product2", "1.0",  null, false, null, null},	//does not support population
         new Object [] { "noexist", "product2", "1.0",  null, false, null, null},	//does not support population
         new Object [] { Population.NAME_GENERAL, "product1", "1.0",  6, false, "1.1", "mockitron/product1/1.1.bin"},	//max retryAttempts have reached
         new Object [] { Population.NAME_BETA, "product2", "1.0",  6, true, "1.2", "mockitron/product2/1.2.bin"},
         new Object [] { Population.NAME_GENERAL, "product2", "1.0",  100, false, "1.2", "mockitron/product2/1.2.bin"},	//max retryAttempts have reached
         new Object [] { Population.NAME_GENERAL, "product4", "1.0",  null, true, "1.1", "mockitron/product4/1.1.bin"},	//exact version match
         new Object [] { Population.NAME_BETA, "product4", "1.0",  null, false, null, null},	//does not support population
         new Object [] { Population.NAME_GENERAL, "product4", "1.1",  null, true, "1.2", "mockitron/product4/1.2.bin"},	//exact version match
         new Object [] { Population.NAME_BETA, "product4", "1.1",  null, false, null, null}	//does not support population
       
   		);
}
 
Example #11
Source File: BaseDalTransactionalAnnotationTest.java    From das with Apache License 2.0 6 votes vote down vote up
@Parameters
public static Collection data() {
    return Arrays.asList(new Object[][]{
            {1, TransactionAnnoClassMySql.class, TransactionTestMySqlUser.class},
            {2, TransactionAnnoClassMySql.class, TransactionTestMySqlUser.class},
            {3, TransactionAnnoClassMySql.class, TransactionTestMySqlUser.class},
            {1, TransactionAnnoClassMySqlNew.class, TransactionTestMySqlUserNew.class},
            {2, TransactionAnnoClassMySqlNew.class, TransactionTestMySqlUserNew.class},
            {3, TransactionAnnoClassMySqlNew.class, TransactionTestMySqlUserNew.class},
            {1, TransactionAnnoClassSqlServer.class, TransactionTestSqlServerUser.class},
            {2, TransactionAnnoClassSqlServer.class, TransactionTestSqlServerUser.class},
            {3, TransactionAnnoClassSqlServer.class, TransactionTestSqlServerUser.class},
            {1, TransactionAnnoClassSqlServerNew.class, TransactionTestSqlServerUserNew.class},
            {2, TransactionAnnoClassSqlServerNew.class, TransactionTestSqlServerUserNew.class},
            {3, TransactionAnnoClassSqlServerNew.class, TransactionTestSqlServerUserNew.class},
            }
    );
}
 
Example #12
Source File: CrrlParserTest.java    From kbear with Apache License 2.0 6 votes vote down vote up
@Parameters(name = "{index}: rule={0}, route={1}")
public static Collection<Object[]> data() {
    List<Object[]> parameterValues = new ArrayList<>();

    parameterValues.add(new Object[] { "use cluster c1, topic t1",
            Route.newBuilder().setClusterId("c1").setTopicId("t1").build() });

    parameterValues.add(new Object[] { "use cluster c1", Route.newBuilder().setClusterId("c1").build() });

    parameterValues.add(new Object[] { "use cluster c1, topic t1 when topic.id=t1",
            Route.newBuilder().setClusterId("c1").setTopicId("t1").build() });

    parameterValues.add(new Object[] { "use cluster c1, topic t1 when topic.id=t2",
            Route.newBuilder().setClusterId("c1").setTopicId("t1").build() });

    parameterValues.add(new Object[] { "use cluster c1, topic t1 when topic.id=t1 and client.id=c1",
            Route.newBuilder().setClusterId("c1").setTopicId("t1").build() });

    parameterValues.add(new Object[] { "use cluster c1 when topic.id=t1 and client.id=c1",
            Route.newBuilder().setClusterId("c1").build() });

    return parameterValues;
}
 
Example #13
Source File: DefaultFilterTest.java    From flink with Apache License 2.0 6 votes vote down vote up
@Parameters
public static Collection<Object[]> data() {
	return Arrays.asList(new Object[][] {
		{"file.txt",			false},

		{".file.txt",			true},
		{"dir/.file.txt",		true},
		{".dir/file.txt",		false},

		{"_file.txt",			true},
		{"dir/_file.txt",		true},
		{"_dir/file.txt",		false},

		// Check filtering Hadoop's unfinished files
		{FilePathFilter.HADOOP_COPYING,			true},
		{"dir/" + FilePathFilter.HADOOP_COPYING,		true},
		{FilePathFilter.HADOOP_COPYING + "/file.txt",	false},
	});
}
 
Example #14
Source File: TestDefaultServletOptions.java    From Tomcat8-Source-Read with MIT License 6 votes vote down vote up
@Parameters
public static Collection<Object[]> inputs() {
    String[] urls = new String[] { COLLECTION_NAME, FILE_NAME, UNKNOWN_NAME };
    String[] methods = new String[] { "GET", "POST", "HEAD", "TRACE", "PUT", "DELETE" };

    List<Object[]> result = new ArrayList<>();

    for (Boolean listingsValue : booleans) {
        for (Boolean readOnlyValue : booleans) {
            for (Boolean traceValue : booleans) {
                for (String url : urls) {
                    for (String method : methods) {
                        result.add(new Object[] {
                                listingsValue, readOnlyValue, traceValue, url, method } );
                    }
                }
            }
        }

    }
    return result;
}
 
Example #15
Source File: MeterApproximationTest.java    From metrics with Apache License 2.0 5 votes vote down vote up
@Parameters
public static Collection<Object[]> ratesPerMinute() {
    Object[][] data = new Object[][] {
        { 15 }, { 60 }, { 600 }, { 6000 }
    };
    return Arrays.asList(data);
}
 
Example #16
Source File: GasUsageValidationRuleTest.java    From besu with Apache License 2.0 5 votes vote down vote up
@Parameters
public static Collection<Object[]> data() {
  return Arrays.asList(
      new Object[][] {
        {5, 6, true}, // gasUsed is less than gasLimit is valid
        {5, 5, true}, // gasUsed is the same as gaslimit is valid
        {5, 4, false}, // gasUsed is less than gasLimit
      });
}
 
Example #17
Source File: DefaultServerWebExchangeCheckNotModifiedTests.java    From java-technology-stack with MIT License 5 votes vote down vote up
@Parameters(name = "{0}")
static public Iterable<Object[]> safeMethods() {
	return Arrays.asList(new Object[][] {
			{HttpMethod.GET},
			{HttpMethod.HEAD}
	});
}
 
Example #18
Source File: RestTemplateIntegrationTests.java    From java-technology-stack with MIT License 5 votes vote down vote up
@SuppressWarnings("deprecation")
@Parameters
public static Iterable<? extends ClientHttpRequestFactory> data() {
	return Arrays.asList(
			new SimpleClientHttpRequestFactory(),
			new HttpComponentsClientHttpRequestFactory(),
			new Netty4ClientHttpRequestFactory(),
			new OkHttp3ClientHttpRequestFactory()
	);
}
 
Example #19
Source File: FailingBeforeAndAfterMethodsSpringRuleTests.java    From spring-analysis-note with MIT License 5 votes vote down vote up
@Parameters(name = "{0}")
public static Object[] testData() {
	return new Object[] {//
		AlwaysFailingBeforeTestClassSpringRuleTestCase.class.getSimpleName(),//
		AlwaysFailingAfterTestClassSpringRuleTestCase.class.getSimpleName(),//
		AlwaysFailingPrepareTestInstanceSpringRuleTestCase.class.getSimpleName(),//
		AlwaysFailingBeforeTestMethodSpringRuleTestCase.class.getSimpleName(),//
		AlwaysFailingAfterTestMethodSpringRuleTestCase.class.getSimpleName(),//
		FailingBeforeTransactionSpringRuleTestCase.class.getSimpleName(),//
		FailingAfterTransactionSpringRuleTestCase.class.getSimpleName() //
	};
}
 
Example #20
Source File: RepeatedSpringRuleTests.java    From java-technology-stack with MIT License 5 votes vote down vote up
@Parameters(name = "{0}")
public static Object[][] repetitionData() {
	return new Object[][] {//
		{ NonAnnotatedRepeatedTestCase.class.getSimpleName(), 0, 1, 1, 1 },//
		{ DefaultRepeatValueRepeatedTestCase.class.getSimpleName(), 0, 1, 1, 1 },//
		{ NegativeRepeatValueRepeatedTestCase.class.getSimpleName(), 0, 1, 1, 1 },//
		{ RepeatedFiveTimesRepeatedTestCase.class.getSimpleName(), 0, 1, 1, 5 },//
		{ RepeatedFiveTimesViaMetaAnnotationRepeatedTestCase.class.getSimpleName(), 0, 1, 1, 5 },//
		{ TimedRepeatedTestCase.class.getSimpleName(), 3, 4, 4, (5 + 1 + 4 + 10) } //
	};
}
 
Example #21
Source File: DifferenceTest.java    From NeurophFramework with Apache License 2.0 5 votes vote down vote up
@Parameters
public static Collection<Object[]> getParamters() {
    return Arrays.asList(new Object[][]{{new DoubleArray(new double[]{1, 1, 1, 1}), 0},
    {new DoubleArray(new double[]{.5d, .25d, -0.25d, 0.1}), 1.784656},
    {new DoubleArray(new double[]{0, 0, 0, 0}), 2}});

}
 
Example #22
Source File: TimeoutHandlerTest.java    From besu with Apache License 2.0 5 votes vote down vote up
@Parameters
public static Collection<Object[]> data() {
  return Arrays.asList(
      new Object[][] {
        {
          Optional.empty(),
          ETH_GET_LOGS,
          body(ETH_GET_LOGS),
          DEFAULT_OPTS.getTimeoutSeconds(),
          true
        },
        {
          Optional.empty(),
          ETH_GET_LOGS,
          body(ETH_BLOCK_NUMBER),
          DEFAULT_OPTS.getTimeoutSeconds(),
          false
        },
        {
          Optional.of(DEFAULT_OPTS),
          ETH_GET_LOGS,
          body(ETH_BLOCK_NUMBER),
          DEFAULT_OPTS.getTimeoutSeconds(),
          true
        }
      });
}
 
Example #23
Source File: TestDeviceAddedListener.java    From arcusplatform with Apache License 2.0 5 votes vote down vote up
@Parameters(name="pairingDeviceExist[{0}],protocolAddress[{1}],expectedRemoveMode[{2}]")
public static List<Object []> files() {
   return Arrays.<Object[]>asList(
         new Object [] { false, Address.hubProtocolAddress("LWW-1250", "ZIGB", ProtocolDeviceId.fromBytes(new byte[] {(byte)0x04})), PairingDeviceCapability.REMOVEMODE_HUB_AUTOMATIC},
         new Object [] { false, Address.hubProtocolAddress("LWW-1250", "ZWAV", ProtocolDeviceId.fromBytes(new byte[] {(byte)0x03})), PairingDeviceCapability.REMOVEMODE_HUB_MANUAL},
         new Object [] { false, Address.protocolAddress(IpcdProtocol.NAMESPACE, ProtocolDeviceId.hashDeviceId("BlackBox:ms2:1234")), PairingDeviceCapability.REMOVEMODE_CLOUD},
         new Object [] { false, Address.protocolAddress("MOCK", new byte[] {(byte)0x04}), PairingDeviceCapability.REMOVEMODE_CLOUD},
         new Object [] { true, Address.hubProtocolAddress("LWW-1250", "ZIGB", ProtocolDeviceId.fromBytes(new byte[] {(byte)0x04})), PairingDeviceCapability.REMOVEMODE_HUB_AUTOMATIC},
         new Object [] { true, Address.hubProtocolAddress("LWW-1250", "ZWAV", ProtocolDeviceId.fromBytes(new byte[] {(byte)0x03})), PairingDeviceCapability.REMOVEMODE_HUB_MANUAL},
         new Object [] { true, Address.protocolAddress(IpcdProtocol.NAMESPACE, ProtocolDeviceId.hashDeviceId("BlackBox:ms2:1234")), PairingDeviceCapability.REMOVEMODE_CLOUD},
         new Object [] { true, Address.protocolAddress("MOCK", new byte[] {(byte)0x04}), PairingDeviceCapability.REMOVEMODE_CLOUD}

   );
}
 
Example #24
Source File: CriteriaTest.java    From kbear with Apache License 2.0 5 votes vote down vote up
@Parameters(name = "{index}: criteria={0}, matchFactors={1}, notMatchFactors={2}")
public static Collection<Object[]> data() {
    List<Object[]> parameterValues = new ArrayList<>();

    parameterValues.add(new Object[] { new NullCriteria(), ImmutableMap.of("client.id", "10000"), null });
    parameterValues.add(new Object[] { new NullCriteria(), ImmutableMap.of("topic.id", "xxx"), null });
    parameterValues.add(new Object[] { new NullCriteria(),
            ImmutableMap.of("consumerGroup.groupName", "xxx", "consumerGroup.topicId", "yyy"), null });

    parameterValues.add(new Object[] { new EqualCriteria("topic.id", "xxx"), ImmutableMap.of("topic.id", "xxx"),
            ImmutableMap.of("topic.id", "yyy") });
    parameterValues.add(new Object[] { new EqualCriteria("consumerGroup.topicId", "xxx"),
            ImmutableMap.of("consumerGroup.topicId", "xxx"), ImmutableMap.of("consumerGroup.topicId", "yyy") });

    parameterValues.add(new Object[] {
            new AndCriteria(new EqualCriteria("client.id", "10000"), new EqualCriteria("topic.id", "xxx")),
            ImmutableMap.of("topic.id", "xxx", "client.id", "10000"), ImmutableMap.of("topic.id", "yyy") });
    parameterValues.add(new Object[] {
            new AndCriteria(new EqualCriteria("client.id", "10000"), new EqualCriteria("topic.id", "xxx")),
            ImmutableMap.of("topic.id", "xxx", "client.id", "10000"), ImmutableMap.of("client.id", "10000") });
    parameterValues.add(new Object[] {
            new AndCriteria(new EqualCriteria("client.id", "10000"), new EqualCriteria("topic.id", "xxx")),
            ImmutableMap.of("topic.id", "xxx", "client.id", "10000"),
            ImmutableMap.of("consumerGroup.groupName", "xxx") });

    return parameterValues;
}
 
Example #25
Source File: ShardingManagerTest.java    From das with Apache License 2.0 5 votes vote down vote up
@Parameters
public static Collection data() {
    return Arrays.asList(new Object[][]{
        {"MySqlSimple", "MySqlConditionDbShard", "MySqlConditionTableShard", "MySqlConditionDbTableShard"},
        {"SqlSvrSimple", "SqlSvrConditionDbShard", "SqlSvrConditionTableShard", "SqlSvrConditionDbTableShard"},
    });
}
 
Example #26
Source File: WebSocketHandshakeTests.java    From java-technology-stack with MIT License 5 votes vote down vote up
@Parameters(name = "server [{0}], client [{1}]")
public static Iterable<Object[]> arguments() {
	return Arrays.asList(new Object[][] {
			{new JettyWebSocketTestServer(), new JettyWebSocketClient()},
			{new TomcatWebSocketTestServer(), new StandardWebSocketClient()},
			{new UndertowTestServer(), new JettyWebSocketClient()}
	});
}
 
Example #27
Source File: TestZWaveContextBinding.java    From arcusplatform with Apache License 2.0 5 votes vote down vote up
@Parameters(name="{0}")
public static Iterable<Object []> files() {
   return Arrays.asList(
         new Object [] { "ZWaveContextBinding.driver" },
         new Object [] { "ZWaveContextBindingCapability.driver" }
   );
}
 
Example #28
Source File: WebSocketConfigurationTests.java    From spring-analysis-note with MIT License 5 votes vote down vote up
@Parameters(name = "server [{0}], client [{1}]")
public static Iterable<Object[]> arguments() {
	return Arrays.asList(new Object[][] {
			{new JettyWebSocketTestServer(), new JettyWebSocketClient()},
			{new TomcatWebSocketTestServer(), new StandardWebSocketClient()},
			{new UndertowTestServer(), new StandardWebSocketClient()}
	});
}
 
Example #29
Source File: MessageTest.java    From flink-statefun with Apache License 2.0 5 votes vote down vote up
@Parameters(name = "{0}")
public static Iterable<? extends Object[]> data() {
  return Arrays.asList(
      new Object[] {MessageFactoryType.WITH_KRYO_PAYLOADS, DUMMY_PAYLOAD},
      new Object[] {MessageFactoryType.WITH_PROTOBUF_PAYLOADS, DUMMY_PAYLOAD},
      new Object[] {MessageFactoryType.WITH_RAW_PAYLOADS, DUMMY_PAYLOAD.toByteArray()},
      new Object[] {
        MessageFactoryType.WITH_PROTOBUF_PAYLOADS_MULTILANG, Any.pack(DUMMY_PAYLOAD)
      });
}
 
Example #30
Source File: TraceJsonRpcHttpBySpecTest.java    From besu with Apache License 2.0 5 votes vote down vote up
@Parameters(name = "{index}: {0}")
public static Object[][] specs() {
  return AbstractJsonRpcHttpBySpecTest.findSpecFiles(
      "trace/specs/trace-block",
      "trace/specs/trace-transaction",
      "trace/specs/replay-trace-transaction/flat",
      "trace/specs/replay-trace-transaction/vm-trace",
      "trace/specs/replay-trace-transaction/statediff",
      "trace/specs/replay-trace-transaction/all",
      "trace/specs/replay-trace-transaction/halt-cases");
}