Search in sources :

Example 6 with PeriodicNotification

use of org.apache.rya.periodic.notification.notification.PeriodicNotification in project incubator-rya by apache.

the class CommandNotificationSerializerTest method basicSerializationTest.

@Test
public void basicSerializationTest() {
    PeriodicNotification notification = PeriodicNotification.builder().id(UUID.randomUUID().toString()).period(24).timeUnit(TimeUnit.DAYS).initialDelay(1).build();
    CommandNotification command = new CommandNotification(Command.ADD, notification);
    Assert.assertEquals(command, serializer.deserialize(topic, serializer.serialize(topic, command)));
    PeriodicNotification notification1 = PeriodicNotification.builder().id(UUID.randomUUID().toString()).period(32).timeUnit(TimeUnit.SECONDS).initialDelay(15).build();
    CommandNotification command1 = new CommandNotification(Command.ADD, notification1);
    Assert.assertEquals(command1, serializer.deserialize(topic, serializer.serialize(topic, command1)));
    PeriodicNotification notification2 = PeriodicNotification.builder().id(UUID.randomUUID().toString()).period(32).timeUnit(TimeUnit.SECONDS).initialDelay(15).build();
    CommandNotification command2 = new CommandNotification(Command.ADD, notification2);
    Assert.assertEquals(command2, serializer.deserialize(topic, serializer.serialize(topic, command2)));
    BasicNotification notification3 = new BasicNotification(UUID.randomUUID().toString());
    CommandNotification command3 = new CommandNotification(Command.ADD, notification3);
    Assert.assertEquals(command3, serializer.deserialize(topic, serializer.serialize(topic, command3)));
}
Also used : BasicNotification(org.apache.rya.periodic.notification.notification.BasicNotification) PeriodicNotification(org.apache.rya.periodic.notification.notification.PeriodicNotification) CommandNotification(org.apache.rya.periodic.notification.notification.CommandNotification) Test(org.junit.Test)

Aggregations

PeriodicNotification (org.apache.rya.periodic.notification.notification.PeriodicNotification)6 CommandNotification (org.apache.rya.periodic.notification.notification.CommandNotification)3 FluoQuery (org.apache.rya.indexing.pcj.fluo.app.query.FluoQuery)2 PeriodicQueryNode (org.apache.rya.indexing.pcj.fluo.app.query.PeriodicQueryNode)2 UnsupportedQueryException (org.apache.rya.indexing.pcj.fluo.app.query.UnsupportedQueryException)2 PeriodicQueryStorageException (org.apache.rya.indexing.pcj.storage.PeriodicQueryStorageException)2 BasicNotification (org.apache.rya.periodic.notification.notification.BasicNotification)2 MalformedQueryException (org.openrdf.query.MalformedQueryException)2 JsonObject (com.google.gson.JsonObject)1 JsonPrimitive (com.google.gson.JsonPrimitive)1 HashSet (java.util.HashSet)1 PeriodicQueryMetadata (org.apache.rya.indexing.pcj.fluo.app.query.PeriodicQueryMetadata)1 Notification (org.apache.rya.periodic.notification.api.Notification)1 Test (org.junit.Test)1