Ejemplo n.º 1
0
        // VALUE GROUP SCAN
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testValueGroupRange()
        public virtual void TestValueGroupRange()
        {
//JAVA TO C# CONVERTER WARNING: Java wildcard generics have no direct equivalent in .NET:
//ORIGINAL LINE: org.neo4j.internal.kernel.api.IndexQuery.RangePredicate<?> p = IndexQuery.range(propId, org.neo4j.values.storable.ValueGroup.DATE);
            RangePredicate <object> p = IndexQuery.Range(_propId, ValueGroup.DATE);

            assertTrue(Test(p, DateValue.date(-4000, 1, 31)));
            assertTrue(Test(p, DateValue.date(2018, 3, 7)));
            assertFalse(Test(p, DateTimeValue.datetime(2018, 3, 7, 0, 0, 0, 0, ZoneOffset.UTC)));
            assertFalse(Test(p, stringValue("hej")));
            assertFalse(Test(p, _gps2_3d));
        }
Ejemplo n.º 2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void compareToSameAsValue()
        public virtual void CompareToSameAsValue()
        {
            Value[] values = new Value[] { DateTimeValue.datetime(9999, 100, ZoneId.of("+18:00")), DateTimeValue.datetime(10000, 100, ZoneId.of("-18:00")), DateTimeValue.datetime(10000, 100, ZoneOffset.of("-17:59:59")), DateTimeValue.datetime(10000, 100, ZoneId.of("UTC")), DateTimeValue.datetime(10000, 100, ZoneId.of("+01:00")), DateTimeValue.datetime(10000, 100, ZoneId.of("Europe/Stockholm")), DateTimeValue.datetime(10000, 100, ZoneId.of("+03:00")), DateTimeValue.datetime(10000, 101, ZoneId.of("-18:00")) };

            ZonedDateTimeIndexKey keyI = new ZonedDateTimeIndexKey();
            ZonedDateTimeIndexKey keyJ = new ZonedDateTimeIndexKey();

            int len = values.Length;

            for (int i = 0; i < len; i++)
            {
                for (int j = 0; j < len; j++)
                {
                    Value vi = values[i];
                    Value vj = values[j];
                    vi.WriteTo(keyI);
                    vj.WriteTo(keyJ);

                    int expected = Integer.signum(Values.COMPARATOR.Compare(vi, vj));
                    assertEquals(format("comparing %s and %s", vi, vj), expected, Integer.signum(i - j));
                    assertEquals(format("comparing %s and %s", vi, vj), expected, Integer.signum(keyI.CompareValueTo(keyJ)));
                }
            }
        }
Ejemplo n.º 3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldReadAndWriteConsistentValues()
        public virtual void ShouldReadAndWriteConsistentValues()
        {
            Value[] values = new Value[] { DateTimeValue.datetime(9999, 100, ZoneId.of("+18:00")), DateTimeValue.datetime(10000, 100, ZoneId.of("-18:00")), DateTimeValue.datetime(10000, 100, ZoneOffset.of("-17:59:59")), DateTimeValue.datetime(10000, 100, ZoneId.of("UTC")), DateTimeValue.datetime(10000, 100, ZoneId.of("+01:00")), DateTimeValue.datetime(10000, 100, ZoneId.of("Europe/Stockholm")), DateTimeValue.datetime(10000, 100, ZoneId.of("+03:00")), DateTimeValue.datetime(10000, 101, ZoneId.of("-18:00")) };

            ZonedDateTimeLayout   layout   = new ZonedDateTimeLayout();
            PageCursor            cursor   = new StubPageCursor(0, 8 * 1024);
            ZonedDateTimeIndexKey writeKey = layout.NewKey();
            ZonedDateTimeIndexKey readKey  = layout.NewKey();

            // Write all
            foreach (Value value in values)
            {
                value.WriteTo(writeKey);
                layout.WriteKey(cursor, writeKey);
            }

            // Read all
            cursor.Offset = 0;
            foreach (Value value in values)
            {
                layout.ReadKey(cursor, readKey, ZonedDateTimeIndexKey.Size);
                assertEquals(value, readKey.AsValue());
            }
        }
Ejemplo n.º 4
0
 public override Value AsValue()
 {
     return(TimeZones.validZoneId(ZoneId) ? DateTimeValue.datetime(EpochSecondUTC, NanoOfSecond, ZoneId.of(TimeZones.map(ZoneId))) : DateTimeValue.datetime(EpochSecondUTC, NanoOfSecond, ZoneOffset.ofTotalSeconds(ZoneOffsetSeconds)));
 }
Ejemplo n.º 5
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testDateTimeWithPrecedingNotInLinedLong()
        public virtual void TestDateTimeWithPrecedingNotInLinedLong()
        {
            TestDateTypeWithPrecedingNotInLinedLong(DateTimeValue.datetime(DateValue.parse("2018-04-01"), LocalTimeValue.parse("01:02:03"), ZoneId.of("Europe/Stockholm")));
        }
Ejemplo n.º 6
0
 internal static DateTimeValue AsValue(long long0, long long1, long long2, long long3)
 {
     return(DateTimeValue.datetime(AsValueRaw(long0, long1, long2, long3)));
 }