/** * 正常系テストデータ. 正常なレンジヘッダフィールドが指定された場合のテスト * @return テストデータ */ @DataPoints public static Fixture[] getFixture() { Fixture[] datas = { // ※前提 first-byte-pos:a last-byte-pos:b suffix-length:c entitylength:Z // a = 0 < b new Fixture(1, "bytes=0-26", 100, 0, 26, 27, "bytes 0-26/100"), // a ≠ 0 < b new Fixture(2, "bytes=3-7", 100, 3, 7, 5, "bytes 3-7/100"), // bがない場合は、entitybodyの最後までを終端として扱う new Fixture(3, "bytes=10-", 100, 10, 99, 90, "bytes 10-99/100"), // Z<bの場合は、entitybodyの最後までを終端として扱う new Fixture(4, "bytes=10-150", 100, 10, 99, 90, "bytes 10-99/100"), // c<Zの場合(開始が省略)は、ファイルの終端からc分を扱う new Fixture(5, "bytes=-10", 100, 90, 99, 10, "bytes 90-99/100"), // c>Zの場合(開始が省略かつファイルサイズより指定が大きい)は、ファイル全体を扱う new Fixture(6, "bytes=-150", 100, 0, 99, 100, "bytes 0-99/100"), // a=b場合 new Fixture(7, "bytes=10-10", 100, 10, 10, 1, "bytes 10-10/100"), // a=b=Zの場合 new Fixture(8, "bytes=99-99", 100, 99, 99, 1, "bytes 99-99/100") }; return datas; }
/** * 無視系ーヘッダ無視パターンテストデータ. 無効なレンジヘッダフィールドの指定のテスト * @return テストデータ */ @DataPoints public static Fixture[] getFixture() { Fixture[] datas = { // ※前提 first-byte-pos:a last-byte-pos:b suffix-length:c entitybody:Z // b < Z < a(開始と終端がひっくり返っている) new Fixture(1, "bytes=500-10", 100), // b < a < Z(開始と終端がひっくり返っている) new Fixture(2, "bytes=50-10", 100), // -がない場合 new Fixture(3, "bytes=50", 100), // c = 0 new Fixture(4, "bytes=-0", 100), // byte-unitがない場合 new Fixture(5, "hoge=10-20", 100), // aが文字列の場合 new Fixture(6, "bytes=hoge-20", 100), // bが文字列の場合 new Fixture(7, "bytes=10-hoge", 100), // aが負の数の場合 new Fixture(8, "bytes=-10-11", 100), // bが負の数の場合 new Fixture(8, "bytes=10--11", 100)}; return datas; }
@DataPoints public static Card[] guilds() { BonusPerBoardElement bonus = new BonusPerBoardElement(); bonus.setType(BoardElementType.CARD); bonus.setColors(Arrays.asList(Color.GREY, Color.BROWN)); bonus.setBoards(Arrays.asList(RelativeBoardPosition.LEFT, RelativeBoardPosition.RIGHT)); bonus.setPoints(1); BonusPerBoardElement bonus2 = new BonusPerBoardElement(); bonus2.setType(BoardElementType.BUILT_WONDER_STAGES); bonus2.setBoards( Arrays.asList(RelativeBoardPosition.LEFT, RelativeBoardPosition.SELF, RelativeBoardPosition.RIGHT)); bonus2.setPoints(1); return new Card[] {TestUtils.createGuildCard(1, bonus), TestUtils.createGuildCard(2, bonus2)}; }
@DataPoints public static String[][] getSampleData() { return new String[][]{ {"lineA", "lineA"}, {"lineB\n", "lineB\n"}, {"\nlineC\n", "lineC\n"}, {"\n\n\nlineD\n", "lineD\n"}, {"firstA\n\n\nlast", "firstA\nlast"}, {"firstB\n\n\nsecond\n\n\n\n\n\nlast", "firstB\nsecond\nlast"}, {"firstC\n\n\nlast\n\n", "firstC\nlast\n"}, // CRLF {"Crlf lineA\r\n\r\nsecond line", "Crlf lineA\r\nsecond line"}, {"Crlf lineB\r\n\r\nsecond line\r\n\r\n", "Crlf lineB\r\nsecond line\r\n"}, // mixed {"Crlf lineC\n\n\nsecond line\r\n\r\n", "Crlf lineC\nsecond line\r\n"}, }; }
@DataPoints public static BatchTest[] getBatches() { List<BatchTest> result = new ArrayList<BatchTest>(); BatchTest test = new BatchTest(); test.contentType = ContentType.XML; test.stream = BulkApiBatchIntegrationTest.class.getResourceAsStream(TEST_REQUEST_XML); result.add(test); test = new BatchTest(); test.contentType = ContentType.CSV; test.stream = BulkApiBatchIntegrationTest.class.getResourceAsStream(TEST_REQUEST_CSV); result.add(test); // TODO test ZIP_XML and ZIP_CSV return result.toArray(new BatchTest[result.size()]); }
@DataPoints public static int[][] valuesAndLengths() { return new int[][] { {1, 1}, {10, 2}, {100, 3}, {1000, 4}, {12, 2}, {123, 3}, {2345, 4}, {9, 1}, {99, 2}, {999, 3}, {9999, 4}, }; }
@DataPoints public static String[] urls() throws Exception { // Load examples try (InputStream in = OEmbedExamplesTest.class.getResourceAsStream("examples.json")) { ObjectMapper mapper = new ObjectMapper(); TypeFactory tf = mapper.getTypeFactory(); examples = mapper.readValue(in, tf.constructMapType(Map.class, tf.constructType(String.class), tf.constructCollectionType(List.class, String.class))); } List<String> result = new ArrayList<>(); urlToProviderName = new HashMap<>(); for (Map.Entry<String, List<String>> e : examples.entrySet()) { for (String url : e.getValue()) { HttpUrl b = HttpUrl.parse(url); String v = b.queryParameter("url"); if (v != null) { urlToProviderName.put(v, e.getKey()); result.add(v); } } } return result.toArray(new String[result.size()]); }
@DataPoints public static TestPair[] data() { int counter = 1; return new TestPair[] { new TestPair(counter++, atom("foo")), new TestPair(counter++, list("foo")), new TestPair(counter++, list("foo", list("bar", atom("baz")), atom("foof"))), new TestPair(counter++, list("foo", atom("baz"))), new TestPair(counter++, list("fo\"o", atom("baz"))), new TestPair(counter++, list("fo-o", atom("baz"))), new TestPair(counter++, list("foo bar", atom("baz"))), new TestPair(counter++, list("\0x80fsssssssssssssoo bar", atom("baz"))), new TestPair(counter++, atom("foo-bar")), new TestPair(counter++, atom("-")), new TestPair(counter++, atom("includes ~ tilde")), }; }
private void addMultiPointMethods(ParameterSignature sig, List<PotentialAssignment> list) throws Throwable { for (FrameworkMethod dataPointsMethod : getDataPointsMethods(sig)) { Class<?> returnType = dataPointsMethod.getReturnType(); if ((returnType.isArray() && sig.canPotentiallyAcceptType(returnType.getComponentType())) || Iterable.class.isAssignableFrom(returnType)) { try { addDataPointsValues(returnType, sig, dataPointsMethod.getName(), list, dataPointsMethod.invokeExplosively(null)); } catch (Throwable throwable) { DataPoints annotation = dataPointsMethod.getAnnotation(DataPoints.class); if (annotation != null && isAssignableToAnyOf(annotation.ignoredExceptions(), throwable)) { return; } else { throw throwable; } } } } }
@Override protected Collection<Field> getDataPointsFields(ParameterSignature sig) { Collection<Field> fields = super.getDataPointsFields(sig); String requestedName = sig.getAnnotation(FromDataPoints.class).value(); List<Field> fieldsWithMatchingNames = new ArrayList<Field>(); for (Field field : fields) { String[] fieldNames = field.getAnnotation(DataPoints.class).value(); if (Arrays.asList(fieldNames).contains(requestedName)) { fieldsWithMatchingNames.add(field); } } return fieldsWithMatchingNames; }
@Override protected Collection<FrameworkMethod> getDataPointsMethods(ParameterSignature sig) { Collection<FrameworkMethod> methods = super.getDataPointsMethods(sig); String requestedName = sig.getAnnotation(FromDataPoints.class).value(); List<FrameworkMethod> methodsWithMatchingNames = new ArrayList<FrameworkMethod>(); for (FrameworkMethod method : methods) { String[] methodNames = method.getAnnotation(DataPoints.class).value(); if (Arrays.asList(methodNames).contains(requestedName)) { methodsWithMatchingNames.add(method); } } return methodsWithMatchingNames; }
@DataPoints public static List<TestCyphertext> cipherTexts() throws URISyntaxException, FileNotFoundException, IOException { JsonObject json = Utils.loadJsonResource("/wallet_ciphertexts.json"); JsonArray jsonCiphertexts = json.getAsJsonArray("ciphertexts"); ArrayList<TestCyphertext> ciphertexts = new ArrayList<>(); for (JsonElement e : jsonCiphertexts) { JsonObject obj = e.getAsJsonObject(); TestCyphertext ciphertext = new TestCyphertext(); ciphertext.passphrase = obj.get("passphrase").getAsString(); ciphertext.cleartext = obj.get("cleartext").getAsString(); ciphertext.encrypted = EncryptedMessage.fromJson(obj.get("encrypted").getAsJsonObject()); ciphertexts.add(ciphertext); } return ciphertexts; }
@DataPoints({"globs"}) public static MatchData[] globs() { final ImmutableList.Builder<MatchData> builder = ImmutableList.<MatchData>builder() .add(MatchData.of("glob:*", false, false, false, true, assertNonNull(hasItems("dir1", "dir2")))) .add(MatchData.of("glob:*", false, false, true, false, assertNonNull(hasItems(subFiles.toArray(new String[0]))))) .add(MatchData.of("glob:dir2", false, false, true, true, assertNonNull(everyItem(equalTo("dir2"))))) .add(MatchData.of("glob:dir2/**/dir22?/dir*/*.*", false, false, true, false, assertNonNull(everyItem(allOf( startsWith(toFileSystemSpecific("dir2/dir22/dir222/dir2221")), anyOf(endsWith("file2.txt"), endsWith("file3.ok"), endsWith("file4")), not(anyOf(endsWith("file4"), endsWith("file1"))) ))))); return assertNonNull(builder.build().toArray(new MatchData[0])); }
private void addFields(ParameterSignature sig, List<PotentialAssignment> list) { for (final Field field : fClass.getJavaClass().getFields()) { if (Modifier.isStatic(field.getModifiers())) { Class<?> type = field.getType(); if (sig.canAcceptArrayType(type) && field.getAnnotation(DataPoints.class) != null) { try { addArrayValues(field.getName(), list, getStaticFieldValue(field)); } catch (Throwable e) { // ignore and move on } } else if (sig.canAcceptType(type) && field.getAnnotation(DataPoint.class) != null) { list.add(PotentialAssignment .forValue(field.getName(), getStaticFieldValue(field))); } } } }
@DataPoints public static DataPair[] getFullyCompatibleData() { return new DataPair[]{ DataPair.pair(XS_INTEGER, NUMERIC_VALUE), DataPair.pair(XS_INT, NUMERIC_VALUE), DataPair.pair(XS_SHORT, NUMERIC_VALUE), DataPair.pair(XS_LONG, NUMERIC_VALUE), DataPair.pair(XS_DECIMAL, FLOATING_POINT_VALUE), DataPair.pair(XS_DOUBLE, FLOATING_POINT_VALUE), DataPair.pair(XS_FLOAT, FLOATING_POINT_VALUE), DataPair.pair(XS_BOOLEAN, "true"), DataPair.pair(XS_STRING, VALUE), DataPair.pair(XS_HEX_BINARY, "FFFF"), DataPair.pair(XS_DAY_TIME_DURATION, "P4DT12H30M5S"), DataPair.pair(XS_YEAR_MONTH_DURATION, "P3Y6M"), DataPair.pair(XS_DATE, "2013-12-31"), DataPair.pair(XS_DATE_TIME, "2013-12-31T23:59:59"), DataPair.pair(XS_TIME, "23:59:59"), DataPair.pair(XS_G_DAY, "---01"), DataPair.pair(XS_G_MONTH, "--01"), DataPair.pair(XS_G_MONTH_DAY, "--01-01"), DataPair.pair(XS_G_YEAR, "0001"), DataPair.pair(XS_G_YEAR_MONTH, "0001-01"), DataPair.pair(XS_ANY_URI, VALUE), }; }
@DataPoints public static DataPair[] getSaxonCompatibleData() { return new DataPair[]{ DataPair.pair(XS_NON_NEGATIVE_INTEGER, NUMERIC_VALUE), DataPair.pair(XS_POSITIVE_INTEGER, NUMERIC_VALUE), DataPair.pair(XS_NON_POSITIVE_INTEGER, NEGATIVE_NUMERIC_VALUE), DataPair.pair(XS_NEGATIVE_INTEGER, NEGATIVE_NUMERIC_VALUE), DataPair.pair(XS_UNSIGNED_INT, NUMERIC_VALUE), DataPair.pair(XS_UNSIGNED_SHORT, NUMERIC_VALUE), DataPair.pair(XS_UNSIGNED_LONG, NUMERIC_VALUE), DataPair.pair(XS_UNSIGNED_BYTE, "10"), DataPair.pair(XS_DURATION, "P3Y6M4DT12H30M5S"), DataPair.pair(XS_BYTE, "32"), DataPair.pair(XS_NORMALIZED_STRING, VALUE), DataPair.pair(XS_TOKEN, VALUE), DataPair.pair(XS_LANGUAGE, VALUE), DataPair.pair(XS_UNTYPED_ATOMIC, VALUE), DataPair.pair(TEXT, VALUE), }; }
@DataPoints public static DataPair[] getSaxonCompatibleData() { return new DataPair[]{ DataPair.pair(XS_NON_NEGATIVE_INTEGER, NUMERIC_VALUE), DataPair.pair(XS_POSITIVE_INTEGER, NUMERIC_VALUE), DataPair.pair(XS_NON_POSITIVE_INTEGER, NEGATIVE_NUMERIC_VALUE), DataPair.pair(XS_NEGATIVE_INTEGER, NEGATIVE_NUMERIC_VALUE), DataPair.pair(XS_UNSIGNED_INT, NUMERIC_VALUE), DataPair.pair(XS_UNSIGNED_SHORT, NUMERIC_VALUE), DataPair.pair(XS_UNSIGNED_LONG, NUMERIC_VALUE), DataPair.pair(XS_UNSIGNED_BYTE, "10"), DataPair.pair(XS_DURATION, "P3Y6M4DT12H30M5S"), DataPair.pair(XS_BYTE, "32"), DataPair.pair(XS_NORMALIZED_STRING, VALUE), DataPair.pair(XS_TOKEN, VALUE), DataPair.pair(XS_LANGUAGE, VALUE), DataPair.pair(XS_DATE_TIME_STAMP, "2013-12-31T23:59:59Z"), DataPair.pair(XS_UNTYPED, VALUE), DataPair.pair(XS_UNTYPED_ATOMIC, VALUE), DataPair.pair(TEXT, VALUE), }; }
@DataPoints public static long[] powersOf2(){ LongArrayList dataPoints = new LongArrayList(100); long l = 1l; while(l>0){ dataPoints.add(l); dataPoints.add(-l); dataPoints.add(3*l); dataPoints.add(-3*l); dataPoints.add(5*l); dataPoints.add(-5*l); dataPoints.add(7*l); dataPoints.add(-7*l); l<<=1; } return dataPoints.toArray(); }
@DataPoints public static BigDecimal[] knownProblemPoints(){ return new BigDecimal[]{ BigDecimal.valueOf(-9208636019293794487l), //DB-3421 BigDecimal.valueOf(-9169196554323565708l), //DB-3421 BigDecimal.valueOf(-9219236770852362184l), //contains 0 bytes internally BigDecimal.valueOf(Integer.MIN_VALUE), BigDecimal.valueOf(Integer.MAX_VALUE), BigDecimal.valueOf(Long.MIN_VALUE), BigDecimal.valueOf(Long.MAX_VALUE), BigDecimal.valueOf(Long.MAX_VALUE | Long.MIN_VALUE), //all 1s BigDecimal.valueOf(Integer.MAX_VALUE| Integer.MIN_VALUE), //all 1s, but only in the integer space BigDecimal.valueOf(18278), BigDecimal.ZERO, BigDecimal.ONE, BigDecimal.TEN, }; }
private void addFields(final ParameterSignature sig, final List<PotentialAssignment> list) { for (final Field field : fClass.getJavaClass().getFields()) { if (Modifier.isStatic(field.getModifiers())) { Class<?> type = field.getType(); if (sig.canAcceptArrayType(type) && field.getAnnotation(DataPoints.class) != null) { try { addArrayValues(field.getName(), list, getStaticFieldValue(field)); } catch (Throwable e) { // ignore and move on } } else if (sig.canAcceptType(type) && field.getAnnotation(DataPoint.class) != null) { list.add(PotentialAssignment.forValue(field.getName(), getStaticFieldValue(field))); } } } }
@DataPoints("Positive-Prefixed") public static Triple[] positivePrefixed() { return new Triple[] { Triple.of("my:book", pathExpr(new Element(new QName("book"), NIL)), pathExpr(new Element(new QName("http://www.example.com/my", "book", "my"), NIL))), Triple.of("my:*", pathExpr(new Element(new QName("*"), NIL)), pathExpr(new Element(new QName("http://www.example.com/my", "*", "my"), NIL))), Triple.of("@my:*", pathExpr(new Attribute(new QName("*"), NIL)), pathExpr(new Attribute(new QName("http://www.example.com/my", "*", "my"), NIL))), }; }
/** * 異常系ー416レスポンスパターンテストデータ. 開始値がエンティティサイズより大きい場合のテスト. * @return テストデータ */ @DataPoints public static Fixture[] getFixture() { Fixture[] datas = { // ※前提 first-byte-pos:a last-byte-pos:b suffix-length:c entitybody:Z // b < Z < a new Fixture(1, "bytes=200-300", 100) }; return datas; }
/** * Double型の出力フォーマットチェックテストパターンを作成. * @return テストパターン */ @DataPoints public static Fixture[] getFixture() { Fixture[] datas = { new Fixture("1.0が1になること", 1.0d, "1"), new Fixture("1.00000が1になること", 1.000000d, "1"), new Fixture("1234567が1234567になること", 1234567d, "1234567"), new Fixture("12345678が12345678になること", 12345678d, "12345678"), new Fixture("123456789012345が123456789012345になること", 123456789012345d, "123456789012345"), new Fixture("1234567890123456が1.234567890123456E15になること", 1234567890123456d, "1.234567890123456E15"), new Fixture("1234567890123456789が1.23456789012345677E18になること", 1234567890123456789d, "1.23456789012345677E18"), new Fixture("0.1が0.1になること", 0.1d, "0.1"), new Fixture("0.1234567890が0.123456789になること", 0.1234567890d, "0.123456789"), new Fixture("0.12345678901234が0.12345678901234になること", 0.12345678901234d, "0.12345678901234"), new Fixture("0.123456789012345が0.123456789012345になること", 0.123456789012345d, "0.123456789012345"), new Fixture("0.12345678901234567が0.12345678901234566になること", 0.12345678901234567d, "0.12345678901234566"), new Fixture("1e1が10になること", 1e1d, "10"), new Fixture("1e6が1000000になること", 1e6d, "1000000"), new Fixture("1e7が10000000になること", 1e7d, "10000000"), new Fixture("1e14が100000000000000になること", 1e14d, "100000000000000"), new Fixture("1e15が1e15になること", 1e15d, "1.0E15"), new Fixture("1e23が9.999999999999999E22になること", 1e23d, "9.999999999999999E22"), new Fixture("1e-1が0.1になること", 1e-1d, "0.1"), new Fixture("1e-3が0.001になること", 1e-3d, "0.001"), new Fixture("1e-4が0.0001になること", 1e-4d, "0.0001"), new Fixture("1e-14が0.00000000000001になること", 1e-14d, "0.00000000000001"), new Fixture("1e-15が1e-15になること", 1e-15d, "1.0E-15") }; return datas; }
@DataPoints({"all", "strictProperties", "strictPrimitives"}) public static Gson[] strictGsons() { Gson gson1 = FxGson.create(); Gson gson2 = FxGson.coreBuilder().create(); Gson gson3 = new FxGsonBuilder().create(); Gson gson4 = FxGson.addFxSupport(new GsonBuilder()).create(); Gson gson5 = new FxGsonBuilder(new GsonBuilder()).create(); Gson gson6 = new FxGsonBuilder().builder() .registerTypeAdapterFactory(new JavaFxPropertyTypeAdapterFactory()) .create(); return new Gson[]{gson1, gson2, gson3, gson4, gson5, gson6}; }
@DataPoints({"all", "extra", "strictProperties", "strictPrimitives"}) public static Gson[] extraGsons() { Gson gson1 = FxGson.createWithExtras(); Gson gson2 = FxGson.fullBuilder().create(); Gson gson3 = new FxGsonBuilder().withExtras().create(); Gson gson4 = new FxGsonBuilder(new GsonBuilder()).withExtras().create(); return new Gson[]{gson1, gson2, gson3, gson4}; }
@DataPoints({"all", "safeProperties", "safePrimitives", "extra"}) public static Gson[] safePropertiesAndPrimitivesAndExtraGsons() { Gson gson1 = new FxGsonBuilder().acceptNullProperties().acceptNullPrimitives().withExtras().create(); Gson gson2 = new FxGsonBuilder(new GsonBuilder()).acceptNullProperties() .acceptNullPrimitives() .withExtras() .create(); return new Gson[]{gson1, gson2}; }
@DataPoints({"all", "specialFloat"}) public static Gson[] specialFLoatGsons() { Gson gson1 = FxGson.coreBuilder().serializeSpecialFloatingPointValues().create(); Gson gson2 = new FxGsonBuilder().builder().serializeSpecialFloatingPointValues().create(); Gson gson3 = new FxGsonBuilder(new GsonBuilder()).builder().serializeSpecialFloatingPointValues().create(); return new Gson[]{gson1, gson2, gson3}; }
@DataPoints public static Class<?>[] primitivePropertyClasses() { return new Class<?>[]{ BooleanProperty.class, IntegerProperty.class, LongProperty.class, FloatProperty.class, DoubleProperty.class, }; }
@DataPoints({"all", "strictProperties", "strictPrimitives"}) public static Gson[] strictGsons() { Gson gson1 = FxGson.create(); Gson gson2 = FxGson.coreBuilder().create(); Gson gson3 = new FxGsonBuilder().create(); Gson gson4 = FxGson.addFxSupport(new GsonBuilder()).create(); Gson gson5 = new FxGsonBuilder(new GsonBuilder()).create(); Gson gson6 = new FxGsonBuilder().builder() .registerTypeAdapterFactory(new JavaFxPropertyTypeAdapterFactory()) .create(); return new Gson[] {gson1, gson2, gson3, gson4, gson5, gson6}; }
@DataPoints({"all", "extra", "strictProperties", "strictPrimitives"}) public static Gson[] extraGsons() { Gson gson1 = FxGson.createWithExtras(); Gson gson2 = FxGson.fullBuilder().create(); Gson gson3 = new FxGsonBuilder().withExtras().create(); Gson gson4 = new FxGsonBuilder(new GsonBuilder()).withExtras().create(); return new Gson[] {gson1, gson2, gson3, gson4}; }
@DataPoints({"all", "safeProperties", "safePrimitives", "extra"}) public static Gson[] safePropertiesAndPrimitivesAndExtraGsons() { Gson gson1 = new FxGsonBuilder().acceptNullProperties().acceptNullPrimitives().withExtras().create(); Gson gson2 = new FxGsonBuilder(new GsonBuilder()).acceptNullProperties() .acceptNullPrimitives() .withExtras() .create(); return new Gson[] {gson1, gson2}; }
@DataPoints({"all", "strictProperties", "strictPrimitives", "specialFloat"}) public static Gson[] specialFloatGsons() { Gson gson1 = FxGson.coreBuilder().serializeSpecialFloatingPointValues().create(); Gson gson2 = new FxGsonBuilder().builder().serializeSpecialFloatingPointValues().create(); Gson gson3 = new FxGsonBuilder(new GsonBuilder()).builder().serializeSpecialFloatingPointValues().create(); return new Gson[] {gson1, gson2, gson3}; }
@DataPoints public static FontExpectation[] expectations() { // no exotic fonts as the test must pass on most machines return new FontExpectation[]{ new FontExpectation(Font.font("System", FontWeight.NORMAL, 12.0), "\"System,Regular,12.0\""), new FontExpectation(Font.font("SansSerif", FontWeight.BOLD, 10.0), "\"SansSerif,Bold,10.0\""), new FontExpectation(Font.font("System", FontPosture.ITALIC, 10.0), "\"System,Italic,10.0\""), new FontExpectation(Font.font("System", FontWeight.BOLD, FontPosture.ITALIC, 10.0), "\"System,Bold Italic,10.0\""), new FontExpectation(Font.font("SansSerif", FontWeight.BOLD, FontPosture.ITALIC, 20.0), "\"SansSerif,Bold Italic,20.0\""), new FontExpectation(null, "null"), }; }
@DataPoints public static Expectation<Color>[] expectations() { return new ColorExpectation[]{ new ColorExpectation(Color.BLUE, "\"#0000ffff\""), new ColorExpectation(Color.RED, "\"#ff0000ff\""), new ColorExpectation(null, "null"), }; }
@DataPoints public static Object[][] getAllPossiblePairsOfArrayIndexes() { int len = logEntries.length; Object[][] result = new Object[len * len][]; for (int i = 0; i < len; i++) { for (int j = 0; j < len; j++) { result[i * len + j] = new Integer[] {i, j}; } } return result; }
@DataPoints(value = "isReceivedAfter") public static Object[][] forIsReceivedAfter() { return new Object[][] { {new DateTime(1999, 1, 1, 0, 0), true}, {null, false}, {new DateTime(2010, 2, 14, 16, 59), true}, {new DateTime(2010, 2, 14, 17, 00), false} }; }
@DataPoints(value = "containsText") public static Object[][] forContainsText() { return new Object[][] { {"sample", true}, {"sample message content", true}, {"", true}, {"null", false}, {"subject", false} }; }