Search in sources :

Example 11 with Endpoint

use of org.openstack4j.model.identity.v3.Endpoint in project camel by apache.

the class RegionProducerTest method setUp.

@Before
public void setUp() {
    producer = new RegionProducer(endpoint, client);
    when(regionService.create(any(Region.class))).thenReturn(testOSregion);
    when(regionService.get(anyString())).thenReturn(testOSregion);
    List<Region> getAllList = new ArrayList<>();
    getAllList.add(testOSregion);
    getAllList.add(testOSregion);
    doReturn(getAllList).when(regionService).list();
    dummyRegion = createRegion();
    when(testOSregion.getDescription()).thenReturn(dummyRegion.getDescription());
}
Also used : ArrayList(java.util.ArrayList) Region(org.openstack4j.model.identity.v3.Region) RegionProducer(org.apache.camel.component.openstack.keystone.producer.RegionProducer) Before(org.junit.Before)

Example 12 with Endpoint

use of org.openstack4j.model.identity.v3.Endpoint in project brave by openzipkin.

the class MutableSpanTest method remoteEndpoint.

@Test
public void remoteEndpoint() {
    MutableSpan span = newSpan();
    Endpoint endpoint = Endpoint.newBuilder().serviceName("server").build();
    span.kind(CLIENT);
    span.remoteEndpoint(endpoint);
    span.start(1L);
    span.finish(2L);
    assertThat(span.toSpan().remoteEndpoint()).isEqualTo(endpoint);
}
Also used : Endpoint(zipkin2.Endpoint) Test(org.junit.Test)

Example 13 with Endpoint

use of org.openstack4j.model.identity.v3.Endpoint in project ysoserial by frohoff.

the class JBoss method doRun.

private static void doRun(URI u, final Object payloadObject, String username, String password) {
    ConnectionProvider instance = null;
    ConnectionProviderContextImpl context = null;
    ConnectionHandler ch = null;
    Channel c = null;
    VersionedConnection vc = null;
    try {
        Logger logger = LogManager.getLogManager().getLogger("");
        logger.addHandler(new ConsoleLogHandler());
        logger.setLevel(Level.INFO);
        OptionMap options = OptionMap.builder().set(Options.SSL_ENABLED, u.getScheme().equals("https")).getMap();
        context = new ConnectionProviderContextImpl(options, "endpoint");
        instance = new HttpUpgradeConnectionProviderFactory().createInstance(context, options);
        String host = u.getHost();
        int port = u.getPort() > 0 ? u.getPort() : 9990;
        SocketAddress destination = new InetSocketAddress(host, port);
        ConnectionHandlerFactory chf = getConnection(destination, username, password, context, instance, options);
        ch = chf.createInstance(new ConnectionHandlerContextImpl(context));
        c = getChannel(context, ch, options);
        System.err.println("Connected");
        vc = makeVersionedConnection(c);
        MBeanServerConnection mbc = vc.getMBeanServerConnection(null);
        doExploit(payloadObject, mbc);
        System.err.println("DONE");
    } catch (Throwable e) {
        e.printStackTrace(System.err);
    } finally {
        cleanup(instance, context, ch, c, vc);
    }
}
Also used : ConnectionHandlerFactory(org.jboss.remoting3.spi.ConnectionHandlerFactory) InetSocketAddress(java.net.InetSocketAddress) Channel(org.jboss.remoting3.Channel) Logger(java.util.logging.Logger) Endpoint(org.jboss.remoting3.Endpoint) ConnectionProvider(org.jboss.remoting3.spi.ConnectionProvider) ConnectionHandler(org.jboss.remoting3.spi.ConnectionHandler) OptionMap(org.xnio.OptionMap) HttpUpgradeConnectionProviderFactory(org.jboss.remoting3.remote.HttpUpgradeConnectionProviderFactory) VersionedConnection(org.jboss.remotingjmx.VersionedConnection) SocketAddress(java.net.SocketAddress) InetSocketAddress(java.net.InetSocketAddress) MBeanServerConnection(javax.management.MBeanServerConnection)

Example 14 with Endpoint

use of org.openstack4j.model.identity.v3.Endpoint in project zipkin-gcp by openzipkin.

the class LabelExtractorTest method testEndpointIsSetIpv6.

@Test
public void testEndpointIsSetIpv6() {
    Endpoint.Builder serverEndpointBuilder = Endpoint.newBuilder().serviceName("service1").port(80);
    serverEndpointBuilder.parseIp("::1");
    Endpoint serverEndpoint = serverEndpointBuilder.build();
    Endpoint.Builder clientEndpointBuilder = Endpoint.newBuilder().serviceName("service2").port(80);
    clientEndpointBuilder.parseIp("::1");
    Endpoint clientEndpoint = clientEndpointBuilder.build();
    Span serverSpan = Span.newBuilder().kind(Kind.SERVER).traceId("4").name("test-span").id("5").localEndpoint(serverEndpoint).build();
    Span clientSpan = Span.newBuilder().kind(Kind.CLIENT).traceId("4").name("test-span").id("6").parentId("5").localEndpoint(clientEndpoint).build();
    String prefix = "test.prefix/";
    LabelExtractor extractor = new LabelExtractor(Collections.<String, String>emptyMap(), prefix);
    Map<String, String> serverLabels = extractor.extract(serverSpan);
    assertNull(serverLabels.get(prefix + "endpoint.ipv4"));
    assertEquals("::1", serverLabels.get(prefix + "endpoint.ipv6"));
    Map<String, String> clientLabels = extractor.extract(clientSpan);
    assertNull(clientLabels.get(prefix + "endpoint.ipv4"));
    assertNull(clientLabels.get(prefix + "endpoint.ipv6"));
}
Also used : Endpoint(zipkin2.Endpoint) Span(zipkin2.Span) Test(org.junit.Test)

Example 15 with Endpoint

use of org.openstack4j.model.identity.v3.Endpoint in project zipkin-gcp by openzipkin.

the class LabelExtractorTest method testEndpointIsSetIpv4.

@Test
public void testEndpointIsSetIpv4() {
    Endpoint.Builder serverEndpointBuilder = Endpoint.newBuilder().serviceName("service1").port(80);
    serverEndpointBuilder.parseIp("10.0.0.1");
    Endpoint serverEndpoint = serverEndpointBuilder.build();
    Endpoint.Builder clientEndpointBuilder = Endpoint.newBuilder().serviceName("service2").port(80);
    clientEndpointBuilder.parseIp("10.0.0.1");
    Endpoint clientEndpoint = clientEndpointBuilder.build();
    Span serverSpan = Span.newBuilder().kind(Kind.SERVER).traceId("4").name("test-span").id("5").localEndpoint(serverEndpoint).build();
    Span clientSpan = Span.newBuilder().kind(Kind.CLIENT).traceId("4").name("test-span").id("6").parentId("5").localEndpoint(clientEndpoint).build();
    String prefix = "test.prefix/";
    LabelExtractor extractor = new LabelExtractor(Collections.<String, String>emptyMap(), prefix);
    Map<String, String> serverLabels = extractor.extract(serverSpan);
    assertEquals("10.0.0.1", serverLabels.get(prefix + "endpoint.ipv4"));
    assertNull(serverLabels.get(prefix + "endpoint.ipv6"));
    Map<String, String> clientLabels = extractor.extract(clientSpan);
    assertNull(clientLabels.get(prefix + "endpoint.ipv4"));
    assertNull(clientLabels.get(prefix + "endpoint.ipv6"));
}
Also used : Endpoint(zipkin2.Endpoint) Span(zipkin2.Span) Test(org.junit.Test)

Aggregations

Endpoint (zipkin2.Endpoint)7 ArrayList (java.util.ArrayList)6 Before (org.junit.Before)6 Test (org.junit.Test)6 ProjectProducer (org.apache.camel.component.openstack.keystone.producer.ProjectProducer)2 Endpoint (org.jboss.remoting3.Endpoint)2 Access (org.openstack4j.model.identity.v2.Access)2 Span (zipkin2.Span)2 Tracing (brave.Tracing)1 CloudConnectorException (com.sequenceiq.cloudbreak.cloud.exception.CloudConnectorException)1 CrnkClient (io.crnk.client.CrnkClient)1 Task (io.crnk.monitor.brave.mock.models.Task)1 PropertyChangeEvent (java.beans.PropertyChangeEvent)1 PropertyChangeListener (java.beans.PropertyChangeListener)1 InetAddress (java.net.InetAddress)1 InetSocketAddress (java.net.InetSocketAddress)1 NetworkInterface (java.net.NetworkInterface)1 SocketAddress (java.net.SocketAddress)1 HashMap (java.util.HashMap)1 HashSet (java.util.HashSet)1