Examples of MonitorModel


Examples of com.hp.hpl.jena.util.MonitorModel

        Statement s2 = base.createStatement(ar, pr, "2");
        Statement s3 = base.createStatement(ar, pr, "3");
        Statement s4 = base.createStatement(ar, pr, "4");
        Statement s5 = base.createStatement(ar, pr, "5");
       
        MonitorModel monitor = new MonitorModel(base);
        RecordingModelListener listener = new RecordingModelListener();
        monitor.register(listener);
       
        // base data
        base.add(s1);
        base.add(s2);
        base.add(s3);
       
        // Test changes from empty
        List<Statement> additions = new ArrayList<>();
        List<Statement> deletions = new ArrayList<>();
        monitor.snapshot(additions, deletions);
        TestUtil.assertIteratorValues(this, additions.iterator(), new Object[] {s1, s2, s3});
        TestUtil.assertIteratorValues(this, deletions.iterator(), new Object[] {});
        listener.assertHas(new Object[] {"addList", additions, "removeList", deletions});
        listener.clear();
       
        // Make some new changes
        base.add(s4);
        base.add(s5);
        base.remove(s1);
        base.remove(s2);
       
        additions.clear();
        deletions.clear();
        monitor.snapshot(additions, deletions);
        TestUtil.assertIteratorValues(this, additions.iterator(), new Object[] {s4, s5});
        TestUtil.assertIteratorValues(this, deletions.iterator(), new Object[] {s1, s2});
        TestUtil.assertIteratorValues(this, monitor.listStatements(), new Object[] {s3, s4, s5});
       
        listener.assertHas(new Object[] {"addList", additions, "removeList", deletions});
        listener.clear();
    }
View Full Code Here

Examples of com.hp.hpl.jena.util.MonitorModel

        Statement s2 = base.createStatement(ar, pr, "2");
        Statement s3 = base.createStatement(ar, pr, "3");
        Statement s4 = base.createStatement(ar, pr, "4");
        Statement s5 = base.createStatement(ar, pr, "5");
       
        MonitorModel monitor = new MonitorModel(base);
        RecordingModelListener listener = new RecordingModelListener();
        monitor.register(listener);
       
        // base data
        base.add(s1);
        base.add(s2);
        base.add(s3);
       
        // Test changes from empty
        List<Statement> additions = new ArrayList<Statement>();
        List<Statement> deletions = new ArrayList<Statement>();
        monitor.snapshot(additions, deletions);
        TestUtil.assertIteratorValues(this, additions.iterator(), new Object[] {s1, s2, s3});
        TestUtil.assertIteratorValues(this, deletions.iterator(), new Object[] {});
        listener.assertHas(new Object[] {"addList", additions, "removeList", deletions});
        listener.clear();
       
        // Make some new changes
        base.add(s4);
        base.add(s5);
        base.remove(s1);
        base.remove(s2);
       
        additions.clear();
        deletions.clear();
        monitor.snapshot(additions, deletions);
        TestUtil.assertIteratorValues(this, additions.iterator(), new Object[] {s4, s5});
        TestUtil.assertIteratorValues(this, deletions.iterator(), new Object[] {s1, s2});
        TestUtil.assertIteratorValues(this, monitor.listStatements(), new Object[] {s3, s4, s5});
       
        listener.assertHas(new Object[] {"addList", additions, "removeList", deletions});
        listener.clear();
    }
View Full Code Here

Examples of com.hp.hpl.jena.util.MonitorModel

        Statement s2 = base.createStatement(ar, pr, "2");
        Statement s3 = base.createStatement(ar, pr, "3");
        Statement s4 = base.createStatement(ar, pr, "4");
        Statement s5 = base.createStatement(ar, pr, "5");
       
        MonitorModel monitor = new MonitorModel(base);
        RecordingModelListener listener = new RecordingModelListener();
        monitor.register(listener);
       
        // base data
        base.add(s1);
        base.add(s2);
        base.add(s3);
       
        // Test changes from empty
        List<Statement> additions = new ArrayList<Statement>();
        List<Statement> deletions = new ArrayList<Statement>();
        monitor.snapshot(additions, deletions);
        TestUtil.assertIteratorValues(this, additions.iterator(), new Object[] {s1, s2, s3});
        TestUtil.assertIteratorValues(this, deletions.iterator(), new Object[] {});
        listener.assertHas(new Object[] {"addList", additions, "removeList", deletions});
        listener.clear();
       
        // Make some new changes
        base.add(s4);
        base.add(s5);
        base.remove(s1);
        base.remove(s2);
       
        additions.clear();
        deletions.clear();
        monitor.snapshot(additions, deletions);
        TestUtil.assertIteratorValues(this, additions.iterator(), new Object[] {s4, s5});
        TestUtil.assertIteratorValues(this, deletions.iterator(), new Object[] {s1, s2});
        TestUtil.assertIteratorValues(this, monitor.listStatements(), new Object[] {s3, s4, s5});
       
        listener.assertHas(new Object[] {"addList", additions, "removeList", deletions});
        listener.clear();
    }
View Full Code Here

Examples of org.apache.jmeter.visualizers.MonitorModel

                st.getConnector().add(cnn);

                MonitorStats mstats = new MonitorStats(Stats.calculateStatus(st), Stats.calculateLoad(st), 0, Stats
                        .calculateMemoryLoad(st), Stats.calculateThreadLoad(st), "localhost", "8080", "http", System
                        .currentTimeMillis());
                MonitorModel monmodel = new MonitorModel(mstats);
                objs.add(monmodel);
            }
            long afree = Runtime.getRuntime().freeMemory();
            long atotal = Runtime.getRuntime().totalMemory();
            long amax = Runtime.getRuntime().maxMemory();
View Full Code Here

Examples of org.apache.jmeter.visualizers.MonitorModel

                st.getConnector().add(cnn);

                MonitorStats mstats = new MonitorStats(Stats.calculateStatus(st), Stats.calculateLoad(st), 0, Stats
                        .calculateMemoryLoad(st), Stats.calculateThreadLoad(st), "localhost", "8080", "http", System
                        .currentTimeMillis());
                MonitorModel monmodel = new MonitorModel(mstats);
                objs.add(monmodel);
            }
            long afree = Runtime.getRuntime().freeMemory();
            long atotal = Runtime.getRuntime().totalMemory();
            long amax = Runtime.getRuntime().maxMemory();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.