@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}}); }
@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() }, }); }
@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") ) } }); }
@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()}, }); }
@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}, }); }
@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, }, }); }
@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") }, }); }
@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() }, }); }
@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"}, }); }
@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} ); }
@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; }
@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:" } }); }
@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}, }); }
@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 }, }); }
@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(); } }
@Parameterized.Parameters public static Collection<Object[]> params() { return Arrays.asList(new Object[][] { {0, 0, "", new Alphabet[] {}}, {0, 0, "'", new Alphabet[] {}}, {0, 0, "a", new Alphabet[] {}}, {0, 0, "2Rv", new Alphabet[] {}}, {723, 723, "", new Alphabet[] {Alphabet.LOWERCASE}}, {466, 466, "z", new Alphabet[] {Alphabet.UPPERCASE, Alphabet.SPECIAL, Alphabet.UNDERSCORE}} }); }
@Parameterized.Parameters(name = "magic={0}, compression={1}") public static Collection<Object[]> data() { List<Object[]> values = new ArrayList<>(); for (byte magic : asList(MAGIC_VALUE_V0, MAGIC_VALUE_V1, MAGIC_VALUE_V2)) for (CompressionType type: CompressionType.values()) values.add(new Object[] {magic, type}); return values; }
@Parameterized.Parameters public static Collection<Object[]> generateData() { return Arrays.asList( new Object[][] { {1, 1}, {10, 1}, {10, 2}, {10, 5}, {10, 10}, {100, 1}, {100, 2}, {100, 5}, {100, 10}, {1000, 1}, {1000, 2}, {1000, 5}, {1000, 10} } ); }
@Parameterized.Parameters public static Iterable<Object[]> data() { return Arrays.asList(new Object[][]{ {PrimaryKeyAsBoxedByte.class, "{ \"name\":\"HaHaHaHaHaHaHaHaH\" }"}, {PrimaryKeyAsBoxedShort.class, "{ \"name\":\"KeyValueTestIsFun\" }"}, {PrimaryKeyAsBoxedInteger.class, "{ \"name\":\"FunValueTestIsKey\" }"}, {PrimaryKeyAsBoxedLong.class, "{ \"name\":\"NameAsBoxedLong-!\" }"}, {PrimaryKeyAsString.class, "{ \"id\":2429214 }"} }); }
@Parameterized.Parameters(name = "{0}") public static Collection<Object[]> params() { return Arrays.asList( new Object[][] { {"/?x=y"}, {"/robots.txt"}, {"/xsl/layout.xsl"}, {"/css/main.css"}, {"/images/logo.svg"}, } ); }
@Parameterized.Parameters public static Collection<String[]> data() { return Arrays.asList( new String[]{"/specs/syntax/anyType.txt"}, new String[]{"/specs/syntax/typeDeclaration.txt"}, new String[]{"/specs/syntax/methodDeclaration.txt"} ); }
@Parameterized.Parameters(name = "bufferOffset={0}, compression={1}") public static Collection<Object[]> data() { List<Object[]> values = new ArrayList<>(); for (int bufferOffset : Arrays.asList(0, 15)) for (CompressionType compressionType : CompressionType.values()) values.add(new Object[] {bufferOffset, compressionType}); return values; }
@Parameterized.Parameters public static Collection spreadsheetData() throws IOException { String excelName = "/TestData/VehicleData.xls"; String localPath = "/src/test/java/Resources"; String path = System.getProperty("user.dir")+ localPath+excelName; InputStream spreadsheet = new FileInputStream(path); return new ExcelXlsReaderParameter(spreadsheet).getData(); }
@Parameterized.Parameters(name = "{0}") public static Iterable<Object[]> data() { return Arrays.asList(new Object[][]{ {"coerceLong", 100l, 200l, 300l}, {"coerceInt", 100, 200, 300}, {"coerceDouble", 100d, 200d, 300d}, {"coerceFloat", 100f, 200f, 300f}, {"coerceString", "100", "200", "300"}}); }
@Parameterized.Parameters public static Collection<Object[]> data() { return Arrays.asList( new Object[][] { {ServerState.LEADING}, {ServerState.FOLLOWING}, {ServerState.OBSERVING}}); }
@Parameterized.Parameters public static Collection<Object[]> data() throws IOException { RaftProperties prop = new RaftProperties(); prop.setClass(MiniRaftCluster.STATEMACHINE_CLASS_KEY, SimpleStateMachine4Testing.class, StateMachine.class); RaftServerConfigKeys.Log.setSegmentSizeMax(prop, SizeInBytes.valueOf("8KB")); return ParameterizedBaseTest.getMiniRaftClusters(prop, 3); }
@Parameterized.Parameters(name = "chassis: {0}, engine type: {1}") public static Collection<Object[]> testData() { return Arrays.asList( new Object[]{Color.RED, EngineType.DIESEL}, new Object[]{Color.BLACK, EngineType.DIESEL} ); }
@Parameterized.Parameters public static Collection booleans() { return Arrays.asList(new Object[][] { { false }, { true } }); }
@Parameterized.Parameters(name = "{0}/execute:{2}") public static Collection<Object[]> data() { return Arrays.asList(new Object[]{Store.Type.PAGESTORE, mock(Page.class), Boolean.TRUE}, new Object[]{Store.Type.PAGESTORE, mock(PageFolder.class), Boolean.FALSE}, new Object[]{Store.Type.SITESTORE, mock(PageRef.class), Boolean.FALSE}, new Object[]{Store.Type.MEDIASTORE, mock(Media.class), Boolean.FALSE}, new Object[]{Store.Type.CONTENTSTORE, mock(Content2.class), Boolean.FALSE}, new Object[]{Store.Type.TEMPLATESTORE, mock(Template.class), Boolean.FALSE}); }
@Parameterized.Parameters public static Object[] data() { return new Object[]{ new ArrayList<Item>() {{ add(ITEM_1); }}, new ArrayList<String>() {{ // Empty list }}, null }; }
@Parameterized.Parameters public static Collection<Object[]> data() { return Arrays.asList(new Object[][]{ {fileMock(), false}, {fileMock().exists(), false}, {fileMock().exists().file(), false}, {fileMock().exists().file().writable(), true}, {fileMock().exists().dir(), false}, }); }
/** * We use parameterized tests to run the channel connection tests with each * version of the channel. */ @Parameterized.Parameters(name = "{index}: PaymentChannelStateTest({0})") public static Collection<PaymentChannelClient.VersionSelector> data() { return Arrays.asList( PaymentChannelClient.VersionSelector.VERSION_1, PaymentChannelClient.VersionSelector.VERSION_2_ALLOW_1); }
@Parameterized.Parameters(name = "Page {0}, Starter {1}, Breed {2}") public static Collection runningLines() throws IOException { return Arrays.asList(new Object[][]{ {0, 1, Breed.THOROUGHBRED, new RaceDistance("Six Furlongs", "6f", true, 3960), expectedThoroughbredStarter()}, {5, 1, Breed.QUARTER_HORSE, new RaceDistance("Three Hundred And Fifty Yards", "350y", true, 1050), expectedQuarterHorseStarter()} }); }
@Parameterized.Parameters public static Collection<Object[]> getTestParameters() { return Arrays.asList(new Object[][] { { Boolean.FALSE }, { Boolean.TRUE } }); }
@Parameterized.Parameters(name = "{1}") public static Collection<Object[]> data() { invokeSafely(ModelCopierSpecTest::setUp); return new ServiceModelCopiers(intermediateModel).copierSpecs().stream() .map(spec -> new Object[] { spec, spec.className().simpleName().toLowerCase(Locale.ENGLISH) }) .collect(toList()); }
@Parameterized.Parameters(name = "{index}: assertJsonMatches({0}, {1})") public static Collection<Object[]> data() { return Arrays.asList(new Object[][]{ { "empty/object/actual.json", "empty/object/pattern.json", }, { "empty/array/actual.json", "empty/array/pattern.json" } }); }
@Parameterized.Parameters public static List<String> data() { return Arrays.asList( "test-data/parquet-python/nation.plain.parquet", "test-data/parquet-python/nation.dict.parquet", "test-data/parquet-python/nation.impala.parquet", "test-data/parquet-python/snappy-nation.impala.parquet", "test-data/parquet-python/gzip-nation.impala.parquet" ); }
@Parameterized.Parameters(name = "Is pretty printing be enabled for \"{0}\"? {2}") public static Iterable<Object[]> data() { return Arrays.asList(new Object[][] { { "", false }, { "false", false }, { "fdjksfdks", false }, { "true", true } }); }