Examples of DummyIdentity


Examples of com.sun.sgs.test.util.DummyIdentity

    }

    @Test
    public void testCrossNodeLabels() throws Exception {
        // These match the ones from the partial toy builder
        Identity id1 = new DummyIdentity("1");
        Identity id2 = new DummyIdentity("2");
        Identity id3 = new DummyIdentity("3");
        Identity id4 = new DummyIdentity("4");
        LabelPropagation lp1 =
            new LabelPropagation(new PartialToyBuilder(PartialToyBuilder.NODE1),
                    wdog, PartialToyBuilder.NODE1, props);
        LabelPropagation lp2 =
            new LabelPropagation(new PartialToyBuilder(PartialToyBuilder.NODE2),
View Full Code Here

Examples of com.sun.sgs.test.util.DummyIdentity

        UndirectedGraph<LabelVertex, WeightedEdge> graph =
                new UndirectedSparseGraph<LabelVertex, WeightedEdge>();

        if (node == PartialToyBuilder.NODE1) {
            // Create a partial graph
            Identity[] idents = {new DummyIdentity("1"),
                                 new DummyIdentity("2")};
            LabelVertex[] nodes = new LabelVertex[2];
            for (int i = 0; i < nodes.length; i++) {
                nodes[i] = new LabelVertex(idents[i]);
                graph.addVertex(nodes[i]);
            }
            graph.addEdge(new WeightedEdge(2), nodes[0], nodes[1]);

        } else if (node == PartialToyBuilder.NODE2) {
            // Create a partial graph
            Identity ident = new DummyIdentity("3");
            LabelVertex ver = new LabelVertex(ident);
            graph.addVertex(ver);

        } else if (node == PartialToyBuilder.NODE3) {
            Identity[] idents = {new DummyIdentity("4"),
                                 new DummyIdentity("5")};
            LabelVertex[] nodes = new LabelVertex[2];
            for (int i = 0; i < nodes.length; i++) {
                nodes[i] = new LabelVertex(idents[i]);
                graph.addVertex(nodes[i]);
            }
View Full Code Here

Examples of com.sun.sgs.test.util.DummyIdentity

        // ids 4,5 used obj3
        public PartialToyBuilder(long node) {
            super(createPartialToyBuilderGraph(node));
            if (node == NODE1) {
                // Create a partial graph
                Identity[] idents = {new DummyIdentity("1"),
                                     new DummyIdentity("2")};
                // Obj uses
                Map<Identity, Long> tempMap =
                        new HashMap<Identity, Long>();
                tempMap.put(idents[0], 2L);
                tempMap.put(idents[1], 2L);
                objUseMap.put("obj1", tempMap);
                tempMap =  new HashMap<Identity, Long>();
                tempMap.put(idents[1], 1L);
                objUseMap.put("obj2", tempMap);

                // conflicts - data cache evictions due to conflict
                HashMap<Object, Long> conflict = new HashMap<Object, Long>();
                conflict.put("obj2", 1L);
                conflictMap.put(NODE3, conflict);
            } else if (node == NODE2) {
                // Create a partial graph
                Identity ident = new DummyIdentity("3");
               
                // Obj uses
                Map<Identity, Long> tempMap = new HashMap<Identity, Long>();
                tempMap.put(ident, 1L);
                objUseMap.put("obj1", tempMap);

                // conflicts - data cache evictions due to conflict
                HashMap<Object, Long> conflict = new HashMap<Object, Long>();
                conflict.put("obj1", 1L);
                conflictMap.put(NODE1, conflict);
            } else if (node == NODE3) {
                Identity[] idents = {new DummyIdentity("4"),
                                     new DummyIdentity("5")};

                // Obj uses
                Map<Identity, Long> tempMap = new HashMap<Identity, Long>();
                tempMap.put(idents[0], 1L);
                tempMap.put(idents[1], 1L);
View Full Code Here

Examples of com.sun.sgs.test.util.DummyIdentity

        ScheduledTaskImpl(long delay) {
            this(delay, NON_RECURRING);
        }
        ScheduledTaskImpl(long delay, long period) {
            this.task = new DummyKernelRunnable();
            this.owner = new DummyIdentity();
            this.start = System.currentTimeMillis() + delay;
            this.period = period;
        }
View Full Code Here

Examples of com.sun.sgs.test.util.DummyIdentity

        final Exchanger<AssertionError> errorExchanger =
                new Exchanger<AssertionError>();

        // The owner for our positive test.  The listener uses this owner
        // to find the ProfileReport for the task in this test.
        final Identity positiveOwner = new DummyIdentity("owner");
        final Identity negativeOwner = new DummyIdentity("other");
        SimpleTestListener test = new SimpleTestListener(
            new CounterReportRunnable(counter.getName(), negativeOwner,
                                      positiveOwner, errorExchanger, 1));
        profileCollector.addListener(test, true);
View Full Code Here

Examples of com.sun.sgs.test.util.DummyIdentity

        final Exchanger<AssertionError> errorExchanger =
                new Exchanger<AssertionError>();

        // The owner for our positive test.  The listener uses this owner
        // to find the ProfileReport for the task in this test.
        final Identity positiveOwner = new DummyIdentity("counterlevel");
        final Identity negativeOwner = new DummyIdentity("counterlevelneg");
        SimpleTestListener test = new SimpleTestListener(
            new CounterReportRunnable(counter.getName(), negativeOwner,
                                      positiveOwner, errorExchanger, 1));
        profileCollector.addListener(test, true);
View Full Code Here

Examples of com.sun.sgs.test.util.DummyIdentity

        final Exchanger<AssertionError> errorExchanger =
                new Exchanger<AssertionError>();

        // The owner for our positive test.  The listener uses this owner
        // to find the ProfileReport for the task in this test.
        final Identity positiveOwner = new DummyIdentity("counterinc");
        final Identity negativeOwner = new DummyIdentity("counterincneg");
        SimpleTestListener test = new SimpleTestListener(
            new CounterReportRunnable(counter.getName(),
                                      negativeOwner, positiveOwner,
                                      errorExchanger, incValue));
        profileCollector.addListener(test, true);
View Full Code Here

Examples of com.sun.sgs.test.util.DummyIdentity

        final Exchanger<AssertionError> errorExchanger =
                new Exchanger<AssertionError>();

        // The owner for our positive test.  The listener uses this owner
        // to find the ProfileReport for the task in this test.
        final Identity positiveOwner = new DummyIdentity("countermult");
        final Identity negativeOwner = new DummyIdentity("countermultneg");
        SimpleTestListener test = new SimpleTestListener(
            new CounterReportRunnable(counter.getName(), negativeOwner,
                                      positiveOwner, errorExchanger, incValue));
        profileCollector.addListener(test, true);
View Full Code Here

Examples of com.sun.sgs.test.util.DummyIdentity

        final Exchanger<AssertionError> errorExchanger =
                new Exchanger<AssertionError>();

        // The owner for our positive test.  The listener uses this owner
        // to find the ProfileReport for the task in this test.
        final Identity positiveOwner = new DummyIdentity("countermult");
        final Identity negativeOwner = new DummyIdentity("countermultneg");
        SimpleTestListener test = new SimpleTestListener(
            new CounterReportRunnable(counter.getName(),
                                      negativeOwner, positiveOwner,
                                      errorExchanger, incValue));
        profileCollector.addListener(test, true);
View Full Code Here

Examples of com.sun.sgs.test.util.DummyIdentity

        // Use an exchanger to synchronize between the threads and communicate
        // any problems.
        final Exchanger<AssertionError> errorExchanger =
                new Exchanger<AssertionError>();

        final Identity myOwner = new DummyIdentity("me");
        SimpleTestListener test = new SimpleTestListener(
            new Runnable() {
                public void run() {
                    AssertionError error = null;
                    ProfileReport report = SimpleTestListener.report;
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.