Skip to content

Commit

Permalink
rearrange comments
Browse files Browse the repository at this point in the history
  • Loading branch information
pranav-super committed Oct 21, 2024
1 parent bdb5f30 commit 82573c8
Showing 1 changed file with 34 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -540,14 +540,15 @@ void testBackwardOverlap() throws SQLException {
"2024-01-01T01:00:00Z",
CREATED_AT
);
// have to manually pick this
ExternalEvent aE = new ExternalEvent(
a.key() + "_event",
SOURCE_TYPE,
a.key(),
DERIVATION_GROUP,
a.start_time(),
DURATION
); // have to manually pick this
);
ExternalSource b = new ExternalSource(
"B",
SOURCE_TYPE,
Expand Down Expand Up @@ -620,14 +621,15 @@ void testBackground() throws SQLException {
"2024-01-01T03:00:00Z",
CREATED_AT
);
// just need 1 that shows up and source range will still show correctly
ExternalEvent aE = new ExternalEvent(
a.key() + "_event",
SOURCE_TYPE,
a.key(),
DERIVATION_GROUP,
"2024-01-01T01:10:00Z",
DURATION
); // just need 1 that shows up and source range will still show correctly
);
ExternalSource b = new ExternalSource(
"B",
SOURCE_TYPE,
Expand Down Expand Up @@ -1094,7 +1096,8 @@ void rule2() throws SQLException {
CREATED_AT
);

ExternalEvent e = new ExternalEvent("a", "2024-01-01T00:25:00Z", "00:10:00", A); // spills into B
// spills into B
ExternalEvent e = new ExternalEvent("a", "2024-01-01T00:25:00Z", "00:10:00", A);
ExternalEvent b1 = new ExternalEvent("b1", "2024-01-01T00:30:00Z", "00:10:00", B);
ExternalEvent b2 = new ExternalEvent("b2", "2024-01-01T00:45:00Z", "00:10:00", B);

Expand Down Expand Up @@ -1179,18 +1182,20 @@ void rule3_basic() throws SQLException {
CREATED_AT
);

// negated by B, very clearly
ExternalEvent e1 = new ExternalEvent(
"a1",
"2024-01-01T00:40:00Z",
"00:10:00",
A
); // negated by B, very clearly
);
// even empty space in B neg should negate
ExternalEvent e2 = new ExternalEvent(
"a2",
"2024-01-01T00:55:00Z",
"00:35:00",
A
); // even empty space in B neg should negate
);
ExternalEvent b1 = new ExternalEvent("b1", "2024-01-01T00:00:00Z", "00:10:00", B);
ExternalEvent b2 = new ExternalEvent("b2", "2024-01-01T00:30:00Z", "00:20:00", B);

Expand Down Expand Up @@ -1265,18 +1270,20 @@ void rule3_empty() throws SQLException {
CREATED_AT
);

// negated by empty space
ExternalEvent e1 = new ExternalEvent(
"a1",
"2024-01-01T00:40:00Z",
"00:10:00",
A
); // negated by empty space
);
// negated by empty space
ExternalEvent e2 = new ExternalEvent(
"a2",
"2024-01-01T00:55:00Z",
"00:35:00",
A
); // negated by empty space
);


// insert sources
Expand Down Expand Up @@ -1337,24 +1344,27 @@ void rule4() throws SQLException {
CREATED_AT
);

// negated by empty space
ExternalEvent e1 = new ExternalEvent(
"a",
"2024-01-01T01:50:00Z",
"00:10:00",
A
); // negated by empty space
);
// negated by empty space
ExternalEvent e2 = new ExternalEvent(
"a",
"2024-01-01T03:40:00Z",
"00:15:00",
B
); // negated by empty space
);
// negated by empty space
ExternalEvent e3 = new ExternalEvent(
"a",
"2024-01-01T00:30:00Z",
"00:20:00",
C
); // negated by empty space
);

// insert sources
insertExternalSource(A);
Expand Down Expand Up @@ -1530,7 +1540,8 @@ void noDuplicateEventsInSameSource() throws SQLException {
CREATED_AT);

ExternalEvent e1 = new ExternalEvent("a", "2024-01-01T00:00:00Z", "00:10:00", A);
ExternalEvent e2 = new ExternalEvent("a", "2024-01-01T00:55:00Z", "00:15:00", A); // illegal!
// illegal!
ExternalEvent e2 = new ExternalEvent("a", "2024-01-01T00:55:00Z", "00:15:00", A);

// uploading is fine for the first event, naturally
// insert generic external event type, source type, and derivation group
Expand Down Expand Up @@ -1634,11 +1645,14 @@ void externalEventSourceBounds() throws SQLException {
"2024-01-01T02:00:00Z",
CREATED_AT);

ExternalEvent legal = new ExternalEvent("a", "2024-01-01T01:00:00Z", "00:10:00", A); // legal.
ExternalEvent completelyBefore = new ExternalEvent("completelyBefore", "2024-01-01T00:00:00Z", "00:10:00", A); // illegal!
ExternalEvent beforeIntersect = new ExternalEvent("beforeIntersect", "2024-01-01T00:55:00Z", "00:25:00", A); // illegal!
ExternalEvent afterIntersect = new ExternalEvent("afterIntersect", "2024-01-01T01:45:00Z", "00:30:00", A); // illegal!
ExternalEvent completelyAfter = new ExternalEvent("completelyAfter", "2024-01-01T02:10:00Z", "00:15:00", A); // illegal!
// legal.
ExternalEvent legal = new ExternalEvent("a", "2024-01-01T01:00:00Z", "00:10:00", A);

// illegal!
ExternalEvent completelyBefore = new ExternalEvent("completelyBefore", "2024-01-01T00:00:00Z", "00:10:00", A);
ExternalEvent beforeIntersect = new ExternalEvent("beforeIntersect", "2024-01-01T00:55:00Z", "00:25:00", A);
ExternalEvent afterIntersect = new ExternalEvent("afterIntersect", "2024-01-01T01:45:00Z", "00:30:00", A);
ExternalEvent completelyAfter = new ExternalEvent("completelyAfter", "2024-01-01T02:10:00Z", "00:15:00", A);

// assert the legal event is okay (in the center of the source)
// insert generic external event type, source type, and derivation group
Expand Down Expand Up @@ -1678,6 +1692,7 @@ void externalEventSourceBounds() throws SQLException {
*/
@Test
void duplicateSource() throws SQLException {
// same name and DERIVATION_GROUP
ExternalSource failing = new ExternalSource(
"Derivation_Test_00.json",
SOURCE_TYPE,
Expand All @@ -1686,7 +1701,8 @@ void duplicateSource() throws SQLException {
"2024-01-05 00:00:00+00",
"2024-01-11 00:00:00+00",
CREATED_AT
); // same name and DERIVATION_GROUP
);
// same name, diff DERIVATION_GROUP
ExternalSource succeeding = new ExternalSource(
"Derivation_Test_00.json",
SOURCE_TYPE,
Expand All @@ -1695,7 +1711,7 @@ void duplicateSource() throws SQLException {
"2024-01-05 00:00:00+00",
"2024-01-11 00:00:00+00",
CREATED_AT
); // same name, diff DERIVATION_GROUP
);

// upload general data
upload_source(DERIVATION_GROUP, false);
Expand Down

0 comments on commit 82573c8

Please sign in to comment.