Package gov.nasa.arc.mct.buffer.memory.internal

Examples of gov.nasa.arc.mct.buffer.memory.internal.PartitionMemoryBuffer


            Assert.assertTrue(getDataTask.isPassed());
        }

    @Test
    public void getLastDataSubrangeTest() throws BufferFullException {
        PartitionMemoryBuffer buffer = new PartitionMemoryBuffer(env);
        Map<Long, Map<String, String>> feedData = new HashMap<Long, Map<String, String>>();

        Map<String, String> value = new HashMap<String, String>();
        value.put("value", "1.3");
        value.put("status", "ok");
        long time = System.nanoTime();
        feedData.put(time, value);

        Map<String, String> value2 = new HashMap<String, String>();
        value2.put("value", "1.4");
        value2.put("status", "ok");
        feedData.put(time + 100, value2);

        Map<String, String> value3 = new HashMap<String, String>();
        value3.put("value", "1.5");
        value3.put("status", "ok");
        feedData.put(time + 200, value3);

        Map<String, String> value4 = new HashMap<String, String>();
        value4.put("value", "1.6");
        value4.put("status", "ok");
        feedData.put(time + 300, value4);

        Map<String, Map<Long, Map<String, String>>> data = new HashMap<String, Map<Long, Map<String, String>>>();
        data.put(testFeedID1, feedData);
        buffer.putData(data, TimeUnit.NANOSECONDS);

        SortedMap<Long, Map<String, String>> returnData = buffer.getLastData(Collections.singleton(testFeedID1),
                TimeUnit.NANOSECONDS, time + 50, time + 250).get(testFeedID1);

        Assert.assertEquals(returnData.size(), 1);
        Map<String, String> returnValue = returnData.get(time + 200);
View Full Code Here

TOP

Related Classes of gov.nasa.arc.mct.buffer.memory.internal.PartitionMemoryBuffer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.