//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @TestFactory Stream<org.junit.jupiter.api.DynamicTest> testMildlyForFalseDeadlocks() internal virtual Stream <DynamicTest> TestMildlyForFalseDeadlocks() { ThrowingConsumer <Fixture> fixtureConsumer = fixture => loopRunTest(fixture, TEST_RUNS); //JAVA TO C# CONVERTER TODO TASK: Method reference arbitrary object instance method syntax is not converted by Java to C# Converter: return(DynamicTest.stream(Fixtures(), Fixture::toString, fixtureConsumer)); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @TestFactory Stream<org.junit.jupiter.api.DynamicTest> shouldHandleMultipleCallsToClose() internal virtual Stream <DynamicTest> ShouldHandleMultipleCallsToClose() { return(DynamicTest.stream(ArrayFactories(), NumberArrayFactoryName, factory => { // GIVEN NumberArray <object> array = factory.newIntArray(10, -1); // WHEN array.Close(); // THEN should also work array.Close(); })); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @TestFactory Stream<org.junit.jupiter.api.DynamicTest> shouldGetAndSetRandomItems() internal virtual Stream <DynamicTest> ShouldGetAndSetRandomItems() { ThrowingConsumer <NumberArrayTestData> throwingConsumer = data => { using (NumberArray array = data.array) { IDictionary <int, object> key = new Dictionary <int, object>(); Reader reader = data.reader; object defaultValue = reader.read(array, 0); // WHEN setting random items for (int i = 0; i < INDEXES * 2; i++) { int index = _random.Next(INDEXES); object value = data.valueGenerator.apply(_random); data.writer.write(i % 2 == 0 ? array : array.at(index), index, value); key.put(index, value); } // THEN they should be read correctly AssertAllValues(key, defaultValue, reader, array); // AND WHEN swapping some for (int i = 0; i < INDEXES / 2; i++) { int fromIndex = _random.Next(INDEXES); int toIndex; do { toIndex = _random.Next(INDEXES); } while (toIndex == fromIndex); object fromValue = reader.read(array, fromIndex); object toValue = reader.read(array, toIndex); key.put(fromIndex, toValue); key.put(toIndex, fromValue); array.swap(fromIndex, toIndex); } // THEN they should end up in the correct places AssertAllValues(key, defaultValue, reader, array); } }; return(DynamicTest.stream(Arrays().GetEnumerator(), data => data.name, throwingConsumer)); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @TestFactory Stream<org.junit.jupiter.api.DynamicTest> addGet() internal virtual Stream <DynamicTest> AddGet() { //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final java.util.List<org.eclipse.collections.api.tuple.Pair<String, org.neo4j.values.storable.Value[]>> inputs = asList(testInput("NoValue", System.Func.identity(), org.neo4j.values.storable.NoValue.NO_VALUE), testInput("Boolean", org.neo4j.values.storable.Values::booleanValue, true, false, true, false), testInput("BooleanArray", org.neo4j.values.storable.Values::booleanArray, new boolean[] {false, true, false}, EMPTY_BOOLEAN_ARRAY), testInput("Byte", org.neo4j.values.storable.Values::byteValue, (byte) 0, (byte) 1, (byte) -1, Byte.MIN_VALUE, Byte.MAX_VALUE), testInput("ByteArray", org.neo4j.values.storable.Values::byteArray, new byte[] {(byte) 0, (byte) 1, (byte) -1, Byte.MIN_VALUE, Byte.MAX_VALUE}, EMPTY_BYTE_ARRAY), testInput("Short", org.neo4j.values.storable.Values::shortValue, (short) 0, (short) 1, (short) -1, Short.MIN_VALUE, Short.MAX_VALUE), testInput("ShortArray", org.neo4j.values.storable.Values::shortArray, new short[] {(short) 0, (short) 1, (short) -1, Short.MIN_VALUE, Short.MAX_VALUE}, EMPTY_SHORT_ARRAY), testInput("Char", org.neo4j.values.storable.Values::charValue, 'a', '\uFFFF', '∂', '©'), testInput("CharArray", org.neo4j.values.storable.Values::charArray, new char[] {'a', '\uFFFF', '∂', '©'}, EMPTY_CHAR_ARRAY), testInput("Int", org.neo4j.values.storable.Values::intValue, 0, 1, -1, Integer.MIN_VALUE, Integer.MAX_VALUE), testInput("IntArray", org.neo4j.values.storable.Values::intArray, new int[] {0, 1, -1, Integer.MIN_VALUE, Integer.MAX_VALUE}, EMPTY_INT_ARRAY), testInput("Long", org.neo4j.values.storable.Values::longValue, 0L, 1L, -1L, Long.MIN_VALUE, Long.MAX_VALUE), testInput("LongArray", org.neo4j.values.storable.Values::longArray, new long[] {0L, 1L, -1L, Long.MIN_VALUE, Long.MAX_VALUE}, EMPTY_LONG_ARRAY), testInput("Double", org.neo4j.values.storable.Values::doubleValue, 0.0, 1.0, -1.0, Double.MIN_VALUE, Double.MAX_VALUE, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY), testInput("DoubleArray", org.neo4j.values.storable.Values::doubleArray, new double[] {0.0, 1.0, -1.0, Double.MIN_VALUE, Double.MAX_VALUE, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY}, EMPTY_DOUBLE_ARRAY), testInput("Float", org.neo4j.values.storable.Values::floatValue, 0.0f, 1.0f, -1.0f, Float.MIN_VALUE, Float.MAX_VALUE, Float.NEGATIVE_INFINITY, Float.POSITIVE_INFINITY), testInput("FloatArray", org.neo4j.values.storable.Values::floatArray, new float[] {0.0f, 1.0f, -1.0f, Float.MIN_VALUE, Float.MAX_VALUE, Float.NEGATIVE_INFINITY, Float.POSITIVE_INFINITY}, EMPTY_FLOAT_ARRAY), testInput("String", org.neo4j.values.storable.Values::stringValue, "", "x", "foobar"), testInput("StringArray", org.neo4j.values.storable.Values::stringArray, new String[] {"", "x", "foobar"}, EMPTY_STRING_ARRAY), testInput("Point", input -> pointValue(input.getOne(), input.getTwo()), org.eclipse.collections.impl.tuple.Tuples.pair(org.neo4j.values.storable.CoordinateReferenceSystem.WGS84, new double[] {1.0, 2.0}), org.eclipse.collections.impl.tuple.Tuples.pair(org.neo4j.values.storable.CoordinateReferenceSystem.WGS84_3D, new double[] {1.0, 2.0, 3.0}), org.eclipse.collections.impl.tuple.Tuples.pair(org.neo4j.values.storable.CoordinateReferenceSystem.Cartesian, new double[] {1.0, 2.0}), org.eclipse.collections.impl.tuple.Tuples.pair(org.neo4j.values.storable.CoordinateReferenceSystem.Cartesian_3D, new double[] {1.0, 2.0, 3.0})), testInput("PointArray", org.neo4j.values.storable.Values::pointArray, new org.neo4j.graphdb.spatial.Point[] { pointValue(org.neo4j.values.storable.CoordinateReferenceSystem.WGS84, 1.0, 2.0), pointValue(org.neo4j.values.storable.CoordinateReferenceSystem.WGS84_3D, 1.0, 2.0, 3.0), pointValue(org.neo4j.values.storable.CoordinateReferenceSystem.Cartesian, 1.0, 2.0), pointValue(org.neo4j.values.storable.CoordinateReferenceSystem.Cartesian_3D, 1.0, 2.0, 3.0) }, new org.neo4j.graphdb.spatial.Point[0]), testInput("Duration", org.neo4j.values.storable.Values::durationValue, (java.time.temporal.TemporalAmount) java.time.Duration.parse("P2DT3H4M"), java.time.Period.parse("P1Y2M3W4D")), testInput("DurationArray", org.neo4j.values.storable.Values::durationArray, new java.time.temporal.TemporalAmount[] {java.time.Duration.parse("P2DT3H4M"), java.time.Period.parse("P1Y2M3W4D")}, new java.time.temporal.TemporalAmount[0]), testInput("Date", org.neo4j.values.storable.DateValue::date, java.time.LocalDate.now(), java.time.LocalDate.parse("1977-05-25")), testInput("DateArray", org.neo4j.values.storable.Values::dateArray, new java.time.LocalDate[] {java.time.LocalDate.now(), java.time.LocalDate.parse("1977-05-25")}, new java.time.LocalDate[0]), testInput("Time", org.neo4j.values.storable.TimeValue::time, java.time.OffsetTime.now(), java.time.OffsetTime.parse("19:28:34.123+02:00")), testInput("TimeArray", org.neo4j.values.storable.Values::timeArray, new java.time.OffsetTime[] {java.time.OffsetTime.now(), java.time.OffsetTime.parse("19:28:34.123+02:00")}, new java.time.OffsetTime[0]), testInput("LocalTime", org.neo4j.values.storable.LocalTimeValue::localTime, java.time.LocalTime.now(), java.time.LocalTime.parse("19:28:34.123")), testInput("LocalTimeArray", org.neo4j.values.storable.Values::localTimeArray, new java.time.LocalTime[] {java.time.LocalTime.now(), java.time.LocalTime.parse("19:28:34.123")}, new java.time.LocalTime[0]), testInput("LocalDateTime", org.neo4j.values.storable.LocalDateTimeValue::localDateTime, java.time.LocalDateTime.now(), java.time.LocalDateTime.parse("1956-10-04T19:28:34.123")), testInput("LocalDateTimeArray", org.neo4j.values.storable.Values::localDateTimeArray, new java.time.LocalDateTime[] {java.time.LocalDateTime.now(), java.time.LocalDateTime.parse("1956-10-04T19:28:34.123")}, new java.time.LocalDateTime[0]), testInput("DateTime", org.neo4j.values.storable.DateTimeValue::datetime, java.time.ZonedDateTime.now(), java.time.ZonedDateTime.parse("1956-10-04T19:28:34.123+01:00[Europe/Paris]"), java.time.ZonedDateTime.parse("1956-10-04T19:28:34.123+01:15"), java.time.ZonedDateTime.parse("2018-09-13T16:12:16.12345+14:00[Pacific/Kiritimati]"), java.time.ZonedDateTime.parse("2018-09-13T16:12:16.12345-12:00[Etc/GMT+12]"), java.time.ZonedDateTime.parse("2018-09-13T16:12:16.12345-18:00"), java.time.ZonedDateTime.parse("2018-09-13T16:12:16.12345+18:00")), testInput("DateTimeArray", org.neo4j.values.storable.Values::dateTimeArray, new java.time.ZonedDateTime[] { java.time.ZonedDateTime.parse("1956-10-04T19:28:34.123+01:00[Europe/Paris]"), java.time.ZonedDateTime.parse("1956-10-04T19:28:34.123+01:15"), java.time.ZonedDateTime.parse("2018-09-13T16:12:16.12345+14:00[Pacific/Kiritimati]"), java.time.ZonedDateTime.parse("2018-09-13T16:12:16.12345-12:00[Etc/GMT+12]"), java.time.ZonedDateTime.parse("2018-09-13T16:12:16.12345-18:00"), java.time.ZonedDateTime.parse("2018-09-13T16:12:16.12345+18:00") }, new java.time.ZonedDateTime[0])); IList <Pair <string, Value[]> > inputs = new IList <Pair <string, Value[]> > { TestInput("NoValue", System.Func.identity(), NoValue.NO_VALUE), TestInput("Boolean", Values.booleanValue, true, false, true, false), TestInput("BooleanArray", Values.booleanArray, new bool[] { false, true, false }, EMPTY_BOOLEAN_ARRAY), TestInput("Byte", Values.byteValue, (sbyte)0, (sbyte)1, (sbyte)-1, sbyte.MinValue, sbyte.MaxValue), TestInput("ByteArray", Values.byteArray, new sbyte[] { (sbyte)0, (sbyte)1, (sbyte)-1, sbyte.MinValue, sbyte.MaxValue }, EMPTY_BYTE_ARRAY), TestInput("Short", Values.shortValue, (short)0, (short)1, (short)-1, short.MinValue, short.MaxValue), TestInput("ShortArray", Values.shortArray, new short[] { (short)0, (short)1, (short)-1, short.MinValue, short.MaxValue }, EMPTY_SHORT_ARRAY), TestInput("Char", Values.charValue, 'a', '\uFFFF', '∂', '©'), TestInput("CharArray", Values.charArray, new char[] { 'a', '\uFFFF', '∂', '©' }, EMPTY_CHAR_ARRAY), TestInput("Int", Values.intValue, 0, 1, -1, int.MinValue, int.MaxValue), TestInput("IntArray", Values.intArray, new int[] { 0, 1, -1, int.MinValue, int.MaxValue }, EMPTY_INT_ARRAY), TestInput("Long", Values.longValue, 0L, 1L, -1L, long.MinValue, long.MaxValue), TestInput("LongArray", Values.longArray, new long[] { 0L, 1L, -1L, long.MinValue, long.MaxValue }, EMPTY_LONG_ARRAY), TestInput("Double", Values.doubleValue, 0.0, 1.0, -1.0, double.Epsilon, double.MaxValue, double.NegativeInfinity, double.PositiveInfinity), TestInput("DoubleArray", Values.doubleArray, new double[] { 0.0, 1.0, -1.0, double.Epsilon, double.MaxValue, double.NegativeInfinity, double.PositiveInfinity }, EMPTY_DOUBLE_ARRAY), TestInput("Float", Values.floatValue, 0.0f, 1.0f, -1.0f, float.Epsilon, float.MaxValue, float.NegativeInfinity, float.PositiveInfinity), TestInput("FloatArray", Values.floatArray, new float[] { 0.0f, 1.0f, -1.0f, float.Epsilon, float.MaxValue, float.NegativeInfinity, float.PositiveInfinity }, EMPTY_FLOAT_ARRAY), TestInput("String", Values.stringValue, "", "x", "foobar"), TestInput("StringArray", Values.stringArray, new string[] { "", "x", "foobar" }, EMPTY_STRING_ARRAY), TestInput("Point", input => pointValue(input.One, input.Two), Tuples.pair(CoordinateReferenceSystem.WGS84, new double[] { 1.0, 2.0 }), Tuples.pair(CoordinateReferenceSystem.WGS84_3D, new double[] { 1.0, 2.0, 3.0 }), Tuples.pair(CoordinateReferenceSystem.Cartesian, new double[] { 1.0, 2.0 }), Tuples.pair(CoordinateReferenceSystem.Cartesian_3D, new double[] { 1.0, 2.0, 3.0 })), TestInput("PointArray", Values.pointArray, new Point[] { pointValue(CoordinateReferenceSystem.WGS84, 1.0, 2.0), pointValue(CoordinateReferenceSystem.WGS84_3D, 1.0, 2.0, 3.0), pointValue(CoordinateReferenceSystem.Cartesian, 1.0, 2.0), pointValue(CoordinateReferenceSystem.Cartesian_3D, 1.0, 2.0, 3.0) }, new Point[0]), TestInput("Duration", Values.durationValue, (TemporalAmount)Duration.parse("P2DT3H4M"), Period.parse("P1Y2M3W4D")), TestInput("DurationArray", Values.durationArray, new TemporalAmount[] { Duration.parse("P2DT3H4M"), Period.parse("P1Y2M3W4D") }, new TemporalAmount[0]), TestInput("Date", DateValue.date, LocalDate.now(), LocalDate.parse("1977-05-25")), TestInput("DateArray", Values.dateArray, new LocalDate[] { LocalDate.now(), LocalDate.parse("1977-05-25") }, new LocalDate[0]), TestInput("Time", TimeValue.time, OffsetTime.now(), OffsetTime.parse("19:28:34.123+02:00")), TestInput("TimeArray", Values.timeArray, new OffsetTime[] { OffsetTime.now(), OffsetTime.parse("19:28:34.123+02:00") }, new OffsetTime[0]), TestInput("LocalTime", LocalTimeValue.localTime, LocalTime.now(), LocalTime.parse("19:28:34.123")), TestInput("LocalTimeArray", Values.localTimeArray, new LocalTime[] { LocalTime.now(), LocalTime.parse("19:28:34.123") }, new LocalTime[0]), TestInput("LocalDateTime", LocalDateTimeValue.localDateTime, DateTime.Now, DateTime.Parse("1956-10-04T19:28:34.123")), TestInput("LocalDateTimeArray", Values.localDateTimeArray, new DateTime[] { DateTime.Now, DateTime.Parse("1956-10-04T19:28:34.123") }, new DateTime[0]), TestInput("DateTime", DateTimeValue.datetime, ZonedDateTime.now(), ZonedDateTime.parse("1956-10-04T19:28:34.123+01:00[Europe/Paris]"), ZonedDateTime.parse("1956-10-04T19:28:34.123+01:15"), ZonedDateTime.parse("2018-09-13T16:12:16.12345+14:00[Pacific/Kiritimati]"), ZonedDateTime.parse("2018-09-13T16:12:16.12345-12:00[Etc/GMT+12]"), ZonedDateTime.parse("2018-09-13T16:12:16.12345-18:00"), ZonedDateTime.parse("2018-09-13T16:12:16.12345+18:00")), TestInput("DateTimeArray", Values.dateTimeArray, new ZonedDateTime[] { ZonedDateTime.parse("1956-10-04T19:28:34.123+01:00[Europe/Paris]"), ZonedDateTime.parse("1956-10-04T19:28:34.123+01:15"), ZonedDateTime.parse("2018-09-13T16:12:16.12345+14:00[Pacific/Kiritimati]"), ZonedDateTime.parse("2018-09-13T16:12:16.12345-12:00[Etc/GMT+12]"), ZonedDateTime.parse("2018-09-13T16:12:16.12345-18:00"), ZonedDateTime.parse("2018-09-13T16:12:16.12345+18:00") }, new ZonedDateTime[0]) }; return(DynamicTest.stream(inputs.GetEnumerator(), Pair.getOne, pair => { Value[] values = pair.Two; long[] refs = values.Select(_container.add).ToArray(); for (int i = 0; i < values.Length; i++) { assertEquals(values[i], _container.get(refs[i])); } })); }