Package com.springsource.insight.intercept.topology

Examples of com.springsource.insight.intercept.topology.ExternalResourceDescriptor


            int port = op.getInt("port", (-1));
            String dbName = op.get("dbName", String.class);

            String mongoHash = MD5NameGenerator.getName(dbName + host + port);
            String color = colorManager.getColor(op);
            dbDescriptors.add(new ExternalResourceDescriptor(dbFrame,
                    "mongo:" + mongoHash,
                    dbName,
                    ExternalResourceType.DATABASE.name(),
                    MONGODB_VENDOR,
                    host,
View Full Code Here


        AbstractMongoDBExternalResourceAnalyzer analyzer = createMongoAnalyzer();
        List<ExternalResourceDescriptor> results =
                (List<ExternalResourceDescriptor>) analyzer.locateExternalResourceName(trace);
        assertEquals(1, results.size());

        ExternalResourceDescriptor externalResourceDescriptor = results.get(0);
        assertEquals(frame, externalResourceDescriptor.getFrame());
        assertEquals(ExternalResourceType.DATABASE.name(), externalResourceDescriptor.getType());
        assertEquals("mongo:" + MD5NameGenerator.getName("dbNamelocalhost" + 6379), externalResourceDescriptor.getName());
        assertEquals(AbstractMongoDBExternalResourceAnalyzer.MONGODB_VENDOR, externalResourceDescriptor.getVendor());
        assertEquals("dbName", externalResourceDescriptor.getLabel());
        assertEquals("localhost", externalResourceDescriptor.getHost());
        assertEquals(6379, externalResourceDescriptor.getPort());
        assertEquals(Boolean.FALSE, Boolean.valueOf(externalResourceDescriptor.isIncoming()));
    }
View Full Code Here

        final URI TEST_URI = new URI("http://test-host:3777/testBasicOperatiom");
        Trace trace = createTrace(createFrame(null, TEST_URI));
        Collection<ExternalResourceDescriptor> resList = analyzer.locateExternalResourceName(trace);
        assertEquals("Mismatched resources size", 1, resList.size());

        ExternalResourceDescriptor res = ListUtil.getFirstMember(resList);
        assertResourceContents(res, TEST_URI, "test-host:3777");
        assertSame("Mismatched frame instance", trace.getRootFrame(), res.getFrame());
    }
View Full Code Here

        AbstractMongoDBExternalResourceAnalyzer analyzer = createMongoAnalyzer();
        List<ExternalResourceDescriptor> externalResourceDescriptors =
                (List<ExternalResourceDescriptor>) analyzer.locateExternalResourceName(trace);
        assertEquals(2, externalResourceDescriptors.size());

        ExternalResourceDescriptor descriptor = externalResourceDescriptors.get(0);
        assertEquals(op2, descriptor.getFrame().getOperation());
        assertEquals("dbName2", descriptor.getLabel());
        assertEquals(ExternalResourceType.DATABASE.name(), descriptor.getType());
        assertEquals("MongoDB", descriptor.getVendor());
        assertEquals(null, descriptor.getHost());
        assertEquals(6379, descriptor.getPort());
        String expectedHash = MD5NameGenerator.getName("dbName2" + null + 6379);
        assertEquals("mongo:" + expectedHash, descriptor.getName());
        assertEquals(Boolean.FALSE, Boolean.valueOf(descriptor.isIncoming()));

        descriptor = externalResourceDescriptors.get(1);
        assertEquals(op1, descriptor.getFrame().getOperation());
        assertEquals("dbName", descriptor.getLabel());
        assertEquals(ExternalResourceType.DATABASE.name(), descriptor.getType());
        assertEquals("MongoDB", descriptor.getVendor());
        assertEquals("127.0.0.1", descriptor.getHost());
        assertEquals(6379, descriptor.getPort());
        expectedHash = MD5NameGenerator.getName("dbName127.0.0.1" + 6379);
        assertEquals("mongo:" + expectedHash, descriptor.getName());
        assertEquals(Boolean.FALSE, Boolean.valueOf(descriptor.isIncoming()));
    }
View Full Code Here

            String label = buildLabel(op);

            String hashString = MD5NameGenerator.getName(label);
            String color = colorManager.getColor(op);

            ExternalResourceDescriptor descriptor =
                    new ExternalResourceDescriptor(cacheFrame,
                            EhcacheDefinitions.VENDOR_NAME + ":" + hashString,
                            label,
                            ExternalResourceType.CACHE.name(),
                            EhcacheDefinitions.VENDOR_NAME, color, false);
            queueDescriptors.add(descriptor);
View Full Code Here

                TraceId.valueOf("fake-id"),
                frame);

        Collection<ExternalResourceDescriptor> res = analyzer.locateExternalResourceName(trace);
        assertEquals("Mismatched number of results", 1, res.size());
        ExternalResourceDescriptor externalResourceDescriptor = res.iterator().next();

        assertEquals("Gemfire source frame", frame, externalResourceDescriptor.getFrame());
        assertEquals("Gemfire external resource host", host, externalResourceDescriptor.getHost());
        assertEquals("Gemfire external resource port", port, externalResourceDescriptor.getPort());
        assertEquals("Gemfire external resource type", ExternalResourceType.KVSTORE.name(), externalResourceDescriptor.getType());
        assertEquals("Gemfire external resource type", ExternalResourceType.KVSTORE.name(), externalResourceDescriptor.getType());
        assertEquals("Gemfire external resource name", AbstractGemFireExternalResourceAnalyzer.createName(host, port), externalResourceDescriptor.getName());
        assertEquals("Gemfire external resource vendor", GemFireDefenitions.GEMFIRE, externalResourceDescriptor.getVendor());
        assertEquals("Gemfire external resource label", AbstractGemFireExternalResourceAnalyzer.createLabel(host, port), externalResourceDescriptor.getLabel());
        assertEquals("Gemfire external incoming", Boolean.FALSE, Boolean.valueOf(externalResourceDescriptor.isIncoming()));
    }
View Full Code Here

                TraceId.valueOf("fake-id"),
                frame);

        Collection<ExternalResourceDescriptor> res = analyzer.locateExternalResourceName(trace);
        assertEquals("Mismatched number of results", 1, res.size());
        ExternalResourceDescriptor externalResourceDescriptor = res.iterator().next();

        assertEquals("Gemfire source frame", frame, externalResourceDescriptor.getFrame());
        assertEquals("Gemfire external resource host", host, externalResourceDescriptor.getHost());
        assertEquals("Gemfire external resource port", port, externalResourceDescriptor.getPort());
        assertEquals("Gemfire external resource type", ExternalResourceType.KVSTORE.name(), externalResourceDescriptor.getType());
        assertEquals("Gemfire external resource type", ExternalResourceType.KVSTORE.name(), externalResourceDescriptor.getType());
        assertEquals("Gemfire external resource name", AbstractGemFireExternalResourceAnalyzer.createName(host, port), externalResourceDescriptor.getName());
        assertEquals("Gemfire external resource vendor", GemFireDefenitions.GEMFIRE, externalResourceDescriptor.getVendor());
        assertEquals("Gemfire external resource label", AbstractGemFireExternalResourceAnalyzer.createLabel(host, port), externalResourceDescriptor.getLabel());
        assertEquals("Gemfire external incoming", Boolean.FALSE, Boolean.valueOf(externalResourceDescriptor.isIncoming()));
    }
View Full Code Here

                TraceId.valueOf("fake-id"),
                frame);

        Collection<ExternalResourceDescriptor> res = analyzer.locateExternalResourceName(trace);
        assertEquals("Mismatched number of results", 1, res.size());
        ExternalResourceDescriptor externalResourceDescriptor = res.iterator().next();

        assertEquals("Gemfire source frame", frame, externalResourceDescriptor.getFrame());
        assertEquals("Gemfire external resource host", host, externalResourceDescriptor.getHost());
        assertEquals("Gemfire external resource port", -1, externalResourceDescriptor.getPort());
        assertEquals("Gemfire external resource type", ExternalResourceType.KVSTORE.name(), externalResourceDescriptor.getType());
        assertEquals("Gemfire external resource type", ExternalResourceType.KVSTORE.name(), externalResourceDescriptor.getType());
        assertEquals("Gemfire external resource name", AbstractGemFireExternalResourceAnalyzer.createName(host, -1), externalResourceDescriptor.getName());
        assertEquals("Gemfire external resource vendor", GemFireDefenitions.GEMFIRE, externalResourceDescriptor.getVendor());
        assertEquals("Gemfire external resource label", AbstractGemFireExternalResourceAnalyzer.createLabel(host, -1), externalResourceDescriptor.getLabel());
        assertEquals("Gemfire external incoming", Boolean.FALSE, Boolean.valueOf(externalResourceDescriptor.isIncoming()));
    }
View Full Code Here

                TraceId.valueOf("fake-id"),
                frame);

        Collection<ExternalResourceDescriptor> res = analyzer.locateExternalResourceName(trace);
        assertEquals("Mismatched number of results", 1, res.size());
        ExternalResourceDescriptor externalResourceDescriptor = res.iterator().next();

        assertEquals("Gemfire source frame", frame, externalResourceDescriptor.getFrame());
        assertEquals("Gemfire external resource host", host, externalResourceDescriptor.getHost());
        assertEquals("Gemfire external resource port", -1, externalResourceDescriptor.getPort());
        assertEquals("Gemfire external resource type", ExternalResourceType.KVSTORE.name(), externalResourceDescriptor.getType());
        assertEquals("Gemfire external resource type", ExternalResourceType.KVSTORE.name(), externalResourceDescriptor.getType());
        assertEquals("Gemfire external resource name", AbstractGemFireExternalResourceAnalyzer.createName(host, -1), externalResourceDescriptor.getName());
        assertEquals("Gemfire external resource vendor", GemFireDefenitions.GEMFIRE, externalResourceDescriptor.getVendor());
        assertEquals("Gemfire external resource label", AbstractGemFireExternalResourceAnalyzer.createLabel(host, -1), externalResourceDescriptor.getLabel());
        assertEquals("Gemfire external incoming", Boolean.FALSE, Boolean.valueOf(externalResourceDescriptor.isIncoming()));
    }
View Full Code Here

        final URI TEST_URI = new URI("http://test-host:3777/testBasicOperatiom");
        Trace trace = createTrace(createFrame(null, TEST_URI));
        Collection<ExternalResourceDescriptor> resList = analyzer.locateExternalResourceName(trace);
        assertEquals("Mismatched resources size", 1, resList.size());

        ExternalResourceDescriptor res = ListUtil.getFirstMember(resList);
        assertResourceContents(res, TEST_URI, "test-host:3777");
        assertSame("Mismatched frame instance", trace.getRootFrame(), res.getFrame());
    }
View Full Code Here

TOP

Related Classes of com.springsource.insight.intercept.topology.ExternalResourceDescriptor

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.