Java Code Examples for org.junit.runners.Parameterized.Parameters

The following examples show how to use org.junit.runners.Parameterized.Parameters. These examples are extracted from open source projects. 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 Project: Tomcat8-Source-Read   Source File: TestDefaultServletOptions.java    License: 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 2
Source Project: NeurophFramework   Source File: StepTest.java    License: 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 3
@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 4
Source Project: netty-4.1.22   Source File: SocketSslGreetingTest.java    License: 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 5
Source Project: arcusplatform   Source File: TestDeviceFirmwareResolver.java    License: 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 6
Source Project: das   Source File: BaseDalTransactionalAnnotationTest.java    License: 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 7
Source Project: kbear   Source File: CrrlParserTest.java    License: 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 8
Source Project: org.hl7.fhir.core   Source File: ValidationTestSuite.java    License: 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 9
Source Project: flink   Source File: DefaultFilterTest.java    License: 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 10
Source Project: arcusplatform   Source File: TestKeypad_Alert.java    License: 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 11
@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 12
@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 13
Source Project: besu   Source File: EIP1559BaseFeeTest.java    License: 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 14
Source Project: kbear   Source File: RouteRuleRepositoryTest.java    License: 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 15
Source Project: grcuda   Source File: CUBLASTest.java    License: BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
@Parameters
public static Collection<Object[]> data() {
    return Arrays.asList(new Object[][]{
                    {'S'},
                    {'D'},
                    {'C'},
                    {'Z'},
    });
}
 
Example 16
@SuppressWarnings("deprecation")
@Parameters
public static Iterable<? extends ClientHttpRequestFactory> data() {
	return Arrays.asList(
			new SimpleClientHttpRequestFactory(),
			new HttpComponentsClientHttpRequestFactory(),
			new org.springframework.http.client.Netty4ClientHttpRequestFactory(),
			new OkHttp3ClientHttpRequestFactory()
	);
}
 
Example 17
Source Project: Tomcat8-Source-Read   Source File: TesterHostPerformance.java    License: MIT License 5 votes vote down vote up
@Parameters
public static Collection<Object[]> inputs() {
    List<Object[]> result = new ArrayList<>();
    result.add(new Object[] { "localhost" });
    result.add(new Object[] { "tomcat.apache.org" });
    result.add(new Object[] { "tomcat.apache.org." });
    result.add(new Object[] { "127.0.0.1" });
    result.add(new Object[] { "255.255.255.255" });
    result.add(new Object[] { "[::1]" });
    result.add(new Object[] { "[0123:4567:89AB:CDEF:0123:4567:89AB:CDEF]" });
    return result;
}
 
Example 18
Source Project: Tomcat8-Source-Read   Source File: TestEncodingDetector.java    License: MIT License 5 votes vote down vote up
@Parameters
public static Collection<Object[]> inputs() {
    /// Note: These files are saved using the encoding indicated by the BOM
    List<Object[]> result = new ArrayList<>();
    result.add(new Object[] { "bom-none-prolog-none.jsp",        Integer.valueOf(200), Boolean.TRUE });
    result.add(new Object[] { "bom-none-prolog-none.jspx",       Integer.valueOf(200), Boolean.TRUE });
    result.add(new Object[] { "bom-none-prolog-utf16be.jspx",    Integer.valueOf(200), Boolean.TRUE });
    result.add(new Object[] { "bom-none-prolog-utf16le.jspx",    Integer.valueOf(200), Boolean.TRUE });
    result.add(new Object[] { "bom-none-prolog-utf8.jspx",       Integer.valueOf(200), Boolean.TRUE });
    result.add(new Object[] { "bom-utf8-prolog-none.jsp",        Integer.valueOf(200), Boolean.TRUE });
    result.add(new Object[] { "bom-utf8-prolog-none.jspx",       Integer.valueOf(200), Boolean.TRUE });
    result.add(new Object[] { "bom-utf8-prolog-utf16be.jspx",    Integer.valueOf(500), null });
    result.add(new Object[] { "bom-utf8-prolog-utf16le.jspx",    Integer.valueOf(500), null });
    result.add(new Object[] { "bom-utf8-prolog-utf8.jspx",       Integer.valueOf(200), Boolean.TRUE });
    result.add(new Object[] { "bom-utf16be-prolog-none.jsp",     Integer.valueOf(200), Boolean.TRUE });
    result.add(new Object[] { "bom-utf16be-prolog-none.jspx",    Integer.valueOf(200), Boolean.TRUE });
    result.add(new Object[] { "bom-utf16be-prolog-utf16be.jspx", Integer.valueOf(200), Boolean.TRUE });
    result.add(new Object[] { "bom-utf16be-prolog-utf16le.jspx", Integer.valueOf(500), null });
    result.add(new Object[] { "bom-utf16be-prolog-utf8.jspx",    Integer.valueOf(500), null });
    result.add(new Object[] { "bom-utf16le-prolog-none.jsp",     Integer.valueOf(200), Boolean.TRUE });
    result.add(new Object[] { "bom-utf16le-prolog-none.jspx",    Integer.valueOf(200), Boolean.TRUE });
    result.add(new Object[] { "bom-utf16le-prolog-utf16be.jspx", Integer.valueOf(500), null });
    result.add(new Object[] { "bom-utf16le-prolog-utf16le.jspx", Integer.valueOf(200), Boolean.TRUE });
    result.add(new Object[] { "bom-utf16le-prolog-utf8.jspx",    Integer.valueOf(500), null });
    result.add(new Object[] { "bug60769a.jspx",    Integer.valueOf(500), null });
    result.add(new Object[] { "bug60769b.jspx",    Integer.valueOf(200), Boolean.TRUE });
    return result;
}
 
Example 19
Source Project: NeurophFramework   Source File: ProductTest.java    License: 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[]{.5, .10, .5, .3}), 0.0075},
    {new DoubleArray(new double[]{-.1, .10, 2, 3}), -.060},
    {new DoubleArray(new double[]{-1, -.5, -.10, .1}), -.0050},
    {new DoubleArray(new double[]{1, .5, .10, .9}), .045},
    {new DoubleArray(new double[]{1, 2, 4, 0}), 0}});

}
 
Example 20
Source Project: NeurophFramework   Source File: SigmoidTest.java    License: Apache License 2.0 5 votes vote down vote up
@Parameters
public static Collection<Object[]> getParamters() {
	double[] inputs = new double[] { -3.0, -2.9, -2.8, -2.7, -2.6, -2.5, -2.4, -2.3, -2.2, -2.1, -2.0, -1.9, -1.8,
			-1.7, -1.6, -1.5, -1.4, -1.3, -1.2, -1.1, -1.0, -0.9, -0.8, -0.7, -0.6, -0.5, -0.4, -0.3, -0.2, -0.1, 0,
			0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0, 2.1,
			2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9 };
	double[] expectedOutput = new double[] { 0.04742587317756678, 0.05215356307841774, 0.057324175898868755,
			0.06297335605699651, 0.06913842034334684, 0.07585818002124359, 0.08317269649392241, 0.09112296101485619,
			0.0997504891196852, 0.10909682119561302, 0.11920292202211766, 0.13010847436299797, 0.14185106490048793,
			0.15446526508353484, 0.16798161486607568, 0.18242552380635652, 0.19781611144141847, 0.2141650169574416,
			0.23147521650098266, 0.24973989440488267, 0.2689414213699955, 0.28905049737499644, 0.31002551887238794,
			0.3318122278318344, 0.35434369377420505, 0.37754066879814596, 0.40131233988754855, 0.4255574831883416,
			0.45016600268752266, 0.4750208125210606, 0.5000000000000007, 0.5249791874789407, 0.5498339973124786,
			0.5744425168116597, 0.5986876601124527, 0.6224593312018554, 0.6456563062257962, 0.6681877721681668,
			0.6899744811276132, 0.7109495026250047, 0.7310585786300056, 0.7502601055951181, 0.7685247834990184,
			0.7858349830425594, 0.8021838885585824, 0.8175744761936442, 0.832018385133925, 0.8455347349164659,
			0.8581489350995127, 0.8698915256370027, 0.8807970779778829, 0.8909031788043876, 0.9002495108803152,
			0.9088770389851442, 0.916827303506078, 0.9241418199787569, 0.9308615796566535, 0.9370266439430037,
			0.9426758241011315, 0.9478464369215825 };

	double[] derivative = new double[] { 0.04517665973091215, 0.04943356893664325, 0.05403811475638432,
			0.05900771248391526, 0.06435829917577355, 0.0701037165451082, 0.07625499905185227, 0.0828195669907412,
			0.08980032904006877, 0.09719470480062545, 0.1049935854035066, 0.11318025926193107, 0.12172934028708552,
			0.13060574696620814, 0.1397637919330611, 0.14914645207033295, 0.15868489749561474, 0.16829836246906036,
			0.17789444064680585, 0.18736987954752075, 0.19661193324148205, 0.20550030734226363, 0.21390969652029455,
			0.2217128732931092, 0.22878424045665744, 0.23500371220159464, 0.24026074574152926, 0.244458311690746,
			0.24751657271186, 0.249376040192892, 0.25, 0.2493760401928919, 0.2475165727118599, 0.24445831169074576,
			0.24026074574152904, 0.2350037122015943, 0.2287842404566571, 0.2217128732931088, 0.21390969652029416,
			0.2055003073422632, 0.19661193324148155, 0.18736987954752036, 0.1778944406468053, 0.1682983624690598,
			0.1586848974956143, 0.1491464520703325, 0.13976379193306066, 0.13060574696620764, 0.12172934028708502,
			0.1131802592619306, 0.1049935854035062, 0.09719470480062495, 0.08980032904006844, 0.08281956699074092,
			0.07625499905185193, 0.0701037165451078, 0.06435829917577321, 0.05900771248391504, 0.0540381147563841,
			0.049433568936643 };

	Object[][] objects = new Object[inputs.length][3];
	for (int j = 0; j < inputs.length; j++) {
		objects[j] = new Object[] { inputs[j], expectedOutput[j], derivative[j] };
	}
	return Arrays.asList(objects);
}
 
Example 21
Source Project: spring-analysis-note   Source File: WebSocketHandshakeTests.java    License: 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 22
Source Project: java-technology-stack   Source File: CronTriggerTests.java    License: MIT License 5 votes vote down vote up
@Parameters(name = "date [{0}], time zone [{1}]")
public static List<Object[]> getParameters() {
	List<Object[]> list = new ArrayList<>();
	list.add(new Object[] { new Date(), TimeZone.getTimeZone("PST") });
	list.add(new Object[] { new Date(), TimeZone.getTimeZone("CET") });
	return list;
}
 
Example 23
@Parameters(name="population[{0}], hubRequired[{1}], brand[{2}], expectedProducts[{3}], expectedFilteredProducts[{4}]")
public static List<Object []> files() {
   return Arrays.<Object[]>asList(
         new Object [] { Population.NAME_GENERAL, true, "GE", "6c56c8, 979695, 700faf, 671eee, 359d72, bc45b5, 798086, 4ff66a", "4ff66a, bc45b5, 798086, 0c9a66"},
         new Object [] { Population.NAME_BETA, true, "Schlage", "23af19, 6c56c8, 979695, 700faf, 671eee, 359d72, bc45b5, 798086, 4ff66a", "6c56c8, 979695, 700faf, 671eee, 359d72, bc45b5, 798086, 4ff66a"},
         new Object [] { Population.NAME_GENERAL, false, "Whirlpool", "3981d9, 7dfa41, 162918", "7dfa41, 162918"},
         new Object [] { Population.NAME_BETA, false, "Iris", "3981d9, 7dfa41, 162918", "3981d9, 7dfa41, 4ff66a"}
   );
}
 
Example 24
Source Project: flink   Source File: LogicalTypeDuplicatorTest.java    License: Apache License 2.0 5 votes vote down vote up
@Parameters(name = "{index}: {0}")
public static List<Object[]> testData() {
	return Arrays.asList(
		new Object[][]{
			{new CharType(2), new CharType(2)},
			{createMultisetType(new IntType()), createMultisetType(new BigIntType())},
			{createArrayType(new IntType()), createArrayType(new BigIntType())},
			{createMapType(new IntType()), createMapType(new BigIntType())},
			{createRowType(new IntType()), createRowType(new BigIntType())},
			{createDistinctType(new IntType()), createDistinctType(new BigIntType())},
			{createUserType(new IntType()), createUserType(new BigIntType())},
			{createHumanType(), createHumanType()}
		}
	);
}
 
Example 25
Source Project: arcusplatform   Source File: TestSchedulerHandler.java    License: Apache License 2.0 5 votes vote down vote up
@Parameters(name="{0}")
public static Iterable<Object []> files() {
   return Arrays.asList(
         new Object [] { "SchedulerHandler.driver" },
         new Object [] { "SchedulerHandlerWithCapability.driver" }
   );
}
 
Example 26
Source Project: arcusplatform   Source File: TestInValidPhoneNumber.java    License: Apache License 2.0 5 votes vote down vote up
@Parameters(name="phoneNumber[{0}], expectedCountryCode[{2}], expectedAreaCode[{3}],expectedNumberPart1[{4}],expectedNumberPart2[{5}], comparedPhoneNumber[{6}]")
public static List<Object []> files() {
   return Arrays.<Object[]>asList(
         new Object [] { "122223334444"},  //too many digits
         new Object [] { "223334444"},	//too few digits
         new Object [] { "62223334444"}	//wrong country code            
   );
}
 
Example 27
Source Project: kbear   Source File: ProducerTest.java    License: Apache License 2.0 5 votes vote down vote up
@Parameters(name = "{index}: topics={0}, messageCount={1}, sendInterval={2}")
public static Collection<Object[]> data() throws NoSuchMethodException, SecurityException {
    List<Object[]> parameterValues = new ArrayList<>();
    List<String> topics;
    int messageCount;
    long sendInterval;

    topics = Arrays.asList(TestData.TOPIC_6);
    messageCount = 10;
    sendInterval = 100;
    parameterValues.add(new Object[] { topics, messageCount, sendInterval });

    topics = Arrays.asList(TestData.TOPIC_7);
    messageCount = 100;
    sendInterval = 0;
    parameterValues.add(new Object[] { topics, messageCount, sendInterval });

    topics = Arrays.asList(TestData.TOPIC_6, TestData.TOPIC_7);
    messageCount = 100;
    sendInterval = 0;
    parameterValues.add(new Object[] { topics, messageCount, sendInterval });

    topics = Arrays.asList(TestData.TOPIC_6, TestData.TOPIC_7, TestData.TOPIC_8);
    messageCount = 10;
    sendInterval = 100;
    parameterValues.add(new Object[] { topics, messageCount, sendInterval });

    return parameterValues;
}
 
Example 28
@Parameters(name="{0}")
public static Iterable<Object []> serviceLevels() {
   return ImmutableList.of(
         new Object [] { PlaceCapability.SERVICELEVEL_BASIC },
         new Object [] { PlaceCapability.SERVICELEVEL_PREMIUM },
         new Object [] { PlaceCapability.SERVICELEVEL_PREMIUM_PROMON }
   );
}
 
Example 29
Source Project: grpc-nebula-java   Source File: MessageDeframerTest.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Auto called by test.
 */
@Parameters(name = "{index}: useGzipInflatingBuffer={0}")
public static Collection<Object[]> data() {
  return Arrays.asList(new Object[][]{
          {false}, {true}
  });
}
 
Example 30
Source Project: connector-sdk   Source File: FakeIdentityRepositoryIT.java    License: Apache License 2.0 5 votes vote down vote up
@Parameters
public static Object[] data() {
  String domain = System.getProperty(DOMAIN_PROPERTY_NAME);
  verify(!Strings.isNullOrEmpty(domain));
  return new FakeIdentityRepository[] {
      new FakeIdentityRepository.Builder(domain)
          .addSnapshot(
              new String[][] {generateUserNames(1, 5)},
              new String[][] {generateGroupNames(1, 5)})
          .addSnapshot(
              new String[][] {generateUserNames(2, 7)},
              new String[][] {generateGroupNames(2, 7)})
          .build()
  };
}