org.junit.runners.Parameterized.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(5.4k)|赞(0)|评价(0)|浏览(116)

本文整理了Java中org.junit.runners.Parameterized.<init>()方法的一些代码示例,展示了Parameterized.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Parameterized.<init>()方法的具体详情如下:
包路径:org.junit.runners.Parameterized
类名称:Parameterized
方法名:<init>

Parameterized.<init>介绍

[英]Only called reflectively. Do not use programmatically.
[中]只是若有所思地打电话。不要以编程方式使用。

代码示例

代码示例来源:origin: neo4j/neo4j

  1. @Parameters( name = "multiThreadedIndexPopulationEnabled = {0}" )
  2. public static Object[] multiThreadedIndexPopulationEnabledValues()
  3. {
  4. return new Object[]{true, false};
  5. }

代码示例来源:origin: neo4j/neo4j

  1. @Parameters( name = "{0}" )
  2. public static List<Class<? extends TransportConnection>> transports()
  3. {
  4. return asList( SocketConnection.class, WebSocketConnection.class, SecureSocketConnection.class, SecureWebSocketConnection.class );
  5. }

代码示例来源:origin: neo4j/neo4j

  1. @Parameters( name = "{1}" )
  2. public static List<Object[]> parameters()
  3. {
  4. return Arrays.asList( new Object[]{UNBOUNDED_QUEUE, "Unbounded Queue"}, new Object[]{SYNCHRONOUS_QUEUE, "Synchronous Queue"},
  5. new Object[]{TEST_BOUNDED_QUEUE_SIZE, "Bounded Queue"} );
  6. }

代码示例来源:origin: googlesamples/android-testing

  1. /**
  2. * @return {@link Iterable} that contains the values that should be passed to the constructor.
  3. * In this example we are going to use three parameters: operand one, operand two and the
  4. * expected result.
  5. */
  6. @Parameters
  7. public static Iterable<Object[]> data() {
  8. return Arrays.asList(new Object[][]{
  9. {0, 0, 0},
  10. {0, -1, -1},
  11. {2, 2, 4},
  12. {8, 8, 16},
  13. {16, 16, 32},
  14. {32, 0, 32},
  15. {64, 64, 128}});
  16. }

代码示例来源:origin: neo4j/neo4j

  1. @Parameters( name = "{0}" )
  2. public static List<CollectionsFactorySupplier> data()
  3. {
  4. return asList( new CollectionsFactorySupplier()
  5. {
  6. @Override
  7. public CollectionsFactory create()
  8. {
  9. return CollectionsFactorySupplier.ON_HEAP.create();
  10. }
  11. @Override
  12. public String toString()
  13. {
  14. return "On heap";
  15. }
  16. }, new CollectionsFactorySupplier()
  17. {
  18. @Override
  19. public CollectionsFactory create()
  20. {
  21. return new OffHeapCollectionsFactory( BLOCK_ALLOCATOR );
  22. }
  23. @Override
  24. public String toString()
  25. {
  26. return "Off heap";
  27. }
  28. } );
  29. }

代码示例来源:origin: neo4j/neo4j

  1. @Parameters( name = "{2}" )
  2. public static List<Object[]> parameters()
  3. {
  4. List<Object[]> result = new ArrayList<>();
  5. for ( Class<? extends TransportConnection> connectionClass : CONNECTION_CLASSES )
  6. {
  7. for ( Neo4jPack neo4jPack : NEO4J_PACK_VERSIONS )
  8. {
  9. result.add( new Object[]{connectionClass, neo4jPack, newName( connectionClass, neo4jPack )} );
  10. }
  11. }
  12. return result;
  13. }

代码示例来源:origin: elastic/elasticsearch-hadoop

  1. @Parameters
  2. public static Collection<Object[]> getParameters() {
  3. List<Object[]> parameters = new ArrayList<Object[]>();
  4. parameters.add(new Object[]{false, "typed"});
  5. parameters.add(new Object[]{true, "typeless"});
  6. return parameters;
  7. }

代码示例来源:origin: h2oai/h2o-3

  1. @Parameters
  2. public static PCAImplementation[] parametersForSvdImplementation() {
  3. return hex.pca.PCAImplementation.values();
  4. }

代码示例来源:origin: neo4j/neo4j

  1. new Neo4jPackV2() );
  2. @Parameter( 0 )
  3. public Class<? extends TransportConnection> connectionClass;
  4. @Parameter( 1 )
  5. public Neo4jPack neo4jPack;
  6. @Parameter( 2 )
  7. public String name;

代码示例来源:origin: json-path/JsonPath

  1. @Parameters
  2. public static Iterable<Configuration> configurations() {
  3. return Configurations.configurations();
  4. }

代码示例来源:origin: web3j/web3j

  1. /**
  2. * Loads the test vectors into a in-memory list and feed them one after another to
  3. * our parameterized tests.
  4. *
  5. * @return Collection of test vectors in which each vector is an array containing
  6. * initial entropy, expected mnemonic and expected seed.
  7. * @throws IOException Shouldn't happen!
  8. */
  9. @Parameters
  10. public static Collection<Object[]> data() throws IOException {
  11. String data = Files.lines(Paths.get(SAMPLE_FILE)).collect(Collectors.joining("\n"));
  12. String[] each = data.split("###");
  13. List<Object[]> parameters = new ArrayList<>();
  14. for (String part : each) {
  15. parameters.add(part.trim().split("\n"));
  16. }
  17. return parameters;
  18. }

代码示例来源:origin: neo4j/neo4j

  1. @Parameters( name = "{0}" )
  2. public static List<Neo4jPack> parameters()
  3. {
  4. return Arrays.asList( new Neo4jPackV1(), new Neo4jPackV2() );
  5. }

代码示例来源:origin: neo4j/neo4j

  1. private ExecutorService executorService;
  2. @Parameter( 0 )
  3. public int queueSize;
  4. @Parameter( 1 )
  5. public String name;

代码示例来源:origin: neo4j/neo4j

  1. @Parameter
  2. public Neo4jPack neo4jPack;

代码示例来源:origin: h2oai/h2o-3

  1. @Parameter
  2. public PCAImplementation PCAImplementation;

代码示例来源:origin: googleapis/google-cloud-java

  1. @Parameter(value = 0)
  2. public Type type;
  3. @Parameter(value = 1)
  4. public String implMethodName;
  5. @Parameter(value = 2)
  6. public Object value;
  7. @Parameter(value = 3)
  8. public String getterMethodName;
  9. @Parameter(value = 4)
  10. @Nullable
  11. public List<String> otherAllowedGetters;

代码示例来源:origin: neo4j/neo4j

  1. private TxState state;
  2. @Parameter
  3. public CollectionsFactorySupplier collectionsFactorySupplier;

代码示例来源:origin: neo4j/neo4j

  1. private static final String NAME_PROPERTY = "name";
  2. @Parameter
  3. public boolean multiThreadedPopulationEnabled;

代码示例来源:origin: mulesoft/mule

  1. @Parameters(name = "isSimpleType({0})")
  2. public static Collection<Object[]> data() {
  3. return Arrays.asList(new Object[][] {{BUILDER.stringType().build(), true}, {BUILDER.numberType().build(), true},
  4. {BUILDER.booleanType().build(), true}, {BUILDER.objectType().build(), false},
  5. {BUILDER.arrayType().of(BUILDER.stringType()).build(), false}, {BUILDER.dateTimeType().build(), false}});
  6. }

代码示例来源:origin: cloudant/sync-android

  1. @Parameters(name = "{0}")
  2. public static Iterable<Object[]> data() throws Exception {
  3. return Arrays.asList(new Object[][]{ { SQL_ONLY_EXECUTION },
  4. { MATCHER_EXECUTION },
  5. { STANDARD_EXECUTION } });
  6. }

相关文章