Package com.sun.sgs.profile

Examples of com.sun.sgs.profile.ProfileReport


        this.expectedValues = expectedValues;
    }

    public void run() {
        AssertionError error = null;
        ProfileReport report = SimpleTestListener.report;
        // Check to see if we expected the sample values to be
        // updated in this report.
        Identity owner = report.getTaskOwner();
        boolean update = owner.equals(positiveOwner);
        if (!update && !owner.equals(negativeOwner)) {
            return;
        }
        List<Long> values = report.getUpdatedTaskSamples().get(name);
        try {
            if (update) {
                assertEquals(expectedValues.size(), values.size());
                for (int i = 0; i < expectedValues.size(); i++) {
                    Long found = values.get(i);
View Full Code Here


        // listener that only looks at the transactions run from this test,
        // and verifies that the Context class was correctly reported
        SimpleTestListener listener = new SimpleTestListener(new Runnable() {
                public void run() {
                    ProfileReport r = SimpleTestListener.report;
                    // only proceed for transactions that were run from
                    // this test class
                    if ((! r.wasTaskTransactional()) ||
                        (! r.getTask().getBaseTaskType().startsWith(TASK_NS)))
                    {
                        return;
                    }
                    boolean foundDataListener = false;
                    for (TransactionListenerDetail detail :
View Full Code Here

        this.incrementValue = incrementValue;
    }

    public void run() {
        AssertionError error = null;
        ProfileReport report = SimpleTestListener.report;

        // Check to see if this is a report we care about by checking
        // the owner of this task.
        Identity owner = report.getTaskOwner();
        boolean update = owner.equals(positiveOwner);
        if (!update && !owner.equals(negativeOwner)) {
            return;
        }
       
        if (update) {
            try {
                Long value = report.getUpdatedTaskCounters().get(name);
                System.err.println("got counter value of " + value);
                assertEquals(incrementValue, value.intValue());
            } catch (AssertionError e) {
                error = e;
            }
        } else {
            try {
                Long value = report.getUpdatedTaskCounters().get(name);
                assertNull("expected no value", value);
            } catch (AssertionError e) {
                error = e;
            }
        }
View Full Code Here

        this.errorExchanger = errorExchanger;
    }

    public void run() {
        AssertionError error = null;
        ProfileReport report = SimpleTestListener.report;
        // Check to see if we expected the name to be in this report.
        Identity owner = report.getTaskOwner();
        boolean expected = owner.equals(positiveOwner);
        if (!expected && !owner.equals(negativeOwner)) {
            return;
        }
        boolean found = report.getReportedOperations().contains(name);
        try {
            assertEquals(expected, found);
        } catch (AssertionError e) {
            error = e;
            for (String op : report.getReportedOperations()) {
                System.out.println(op);
            }
        }
        try {
            errorExchanger.exchange(error);
View Full Code Here

        final Identity myOwner = new DummyIdentity("me");
        SimpleTestListener test = new SimpleTestListener(
            new Runnable() {
                public void run() {
                    AssertionError error = null;
                    ProfileReport report = SimpleTestListener.report;
                    if (report.getTaskOwner().equals(myOwner)) {
                        try {
                            Map<String, Long> counts =
                                SimpleTestListener.report.
                                    getUpdatedTaskCounters();
                           
View Full Code Here

        final Identity myOwner = new DummyIdentity("me");
        SimpleTestListener test = new SimpleTestListener(
            new Runnable() {
                public void run() {
                    AssertionError error = null;
                    ProfileReport report = SimpleTestListener.report;
                    if (report.getTaskOwner().equals(myOwner)) {
                        try {
                            List<String> ops =
                                SimpleTestListener.report.getReportedOperations();
                            for (String po : ops) {
                                System.err.println(po);
View Full Code Here

        final Identity myOwner = new DummyIdentity("me");
        SimpleTestListener test = new SimpleTestListener(
            new Runnable() {
                public void run() {
                    AssertionError error = null;
                    ProfileReport report = SimpleTestListener.report;
                    if (report.getTaskOwner().equals(myOwner)) {
                        try {
                            List<String> ops =
                                report.getReportedOperations();
                            System.err.println("+++");
                            for (String name : ops) {
                                assertTrue(name.contains(opName)
                                        || name.contains(op1Name));
                               
View Full Code Here

        final Identity myOwner = new DummyIdentity("me");
        SimpleTestListener test = new SimpleTestListener(
            new Runnable() {
                public void run() {
                    AssertionError error = null;
                    ProfileReport report = SimpleTestListener.report;
                    if (report.getTaskOwner().equals(myOwner)) {
                        try {
                            List<Long> samples =
                                report.getUpdatedTaskSamples().get(sampleName);
                            assertEquals(expected, samples);   
                        } catch (AssertionError e) {
                            error = e;
                        }
                    }
View Full Code Here

        Assert.assertEquals(0, graph.getVertexCount());
    }

    @Test
    public void testNoDetail() throws Exception {
        ProfileReport report = makeReport(new IdentityImpl("something"));
        listener.report(report);

        Graph<LabelVertex, WeightedEdge> graph = builder.getAffinityGraph();
        Assert.assertEquals(0, graph.getEdgeCount());
        // no accessed objects
View Full Code Here

        Assert.assertEquals(0, graph.getVertexCount());
    }

    @Test
    public void testOneAccess() throws Exception {
        ProfileReport report = makeReport(new IdentityImpl("something"));
        AccessedObjectsDetailTest detail = new AccessedObjectsDetailTest();
        detail.addAccess(new String("obj1"));
        setAccessedObjectsDetailMethod.invoke(report, detail);
        listener.report(report);
View Full Code Here

TOP

Related Classes of com.sun.sgs.profile.ProfileReport

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.