Package com.streamreduce.core.model

Examples of com.streamreduce.core.model.OutboundConfiguration$Builder


                .build());
        connectionService.updateConnection(createdConnection);
    }

    private void createPreExistingBucket() throws InvalidCredentialsException {
        OutboundConfiguration preexistingOutboundConfig = new OutboundConfiguration.Builder()
                .protocol("s3")
                .credentials(awsConnection.getCredentials())
                .dataTypes(OutboundDataType.PROCESSED)
                .namespace(bucketName)
                .build();
View Full Code Here



    @Test
    public void testUpdateConnectionPersistsOutboundConfigurations() throws Exception {

        OutboundConfiguration outboundConfiguration = new OutboundConfiguration.Builder()
                .credentials(new ConnectionCredentials(cloudBundle.getString("nodeable.aws.accessKeyId"), cloudBundle.getString("nodeable.aws.secretKey")))
                .destination("eu-west-1")
                .protocol("s3")
                .namespace("com.streamreduce.bucket")
                .dataTypes(OutboundDataType.PROCESSED)
View Full Code Here

    @Test
    public void testValidInstantiation() {
        Connection c = TestUtils.createTestFeedConnection(OutboundDataType.PROCESSED);
        ObjectId testObjectId = new ObjectId();
        c.setId(testObjectId);
        OutboundConfiguration outboundConfiguration = Lists.newArrayList(c.getOutboundConfigurations()).get(0);
        OutboundConfigurationWithPayloadDTO dto = new OutboundConfigurationWithPayloadDTO(
                outboundConfiguration,"{\"foo\":\"bar\"}", OutboundDataType.PROCESSED);

        Assert.assertEquals(OutboundDataType.PROCESSED,dto.getDataType());
        Assert.assertEquals(new OutboundConfigurationServiceDTO(outboundConfiguration),dto.getOutboundConfiguration());
View Full Code Here

    @Test
    public void testSerializeDeserialize() throws Exception{
        Connection c = TestUtils.createTestFeedConnection(OutboundDataType.PROCESSED);
        ObjectId testObjectId = new ObjectId();
        c.setId(testObjectId);
        OutboundConfiguration outboundConfiguration = Lists.newArrayList(c.getOutboundConfigurations()).get(0);
        OutboundConfigurationWithPayloadDTO expected = new OutboundConfigurationWithPayloadDTO(
                outboundConfiguration,"{\"foo\":\"bar\"}", OutboundDataType.PROCESSED);

        ObjectMapper om = new ObjectMapper();
        String s = om.writeValueAsString(expected);
View Full Code Here

        connectionCredentials.setApiKey(beforeEncryption);
        connectionCredentials.setCredential(beforeEncryption);
        connectionCredentials.setOauthToken(beforeEncryption);
        connectionCredentials.setOauthTokenSecret(beforeEncryption);

        OutboundConfiguration outboundConfiguration =  new OutboundConfiguration.Builder()
                .dataTypes(OutboundDataType.PROCESSED)
                .protocol("s3")
                .credentials(connectionCredentials)
                .build();
View Full Code Here

    @Test
    public void getConnectionPostLoadSetsReferenceInOutboundConnections() throws Exception {
        //Test that verifies that an OutboundConfiguration will include a reference to its containing connection
        //after it has been loaded from mongo.

        OutboundConfiguration outboundConfiguration = new OutboundConfiguration.Builder()
                .credentials(new ConnectionCredentials(cloudBundle.getString("nodeable.aws.accessKeyId"), cloudBundle.getString("nodeable.aws.secretKey")))
                .protocol("s3")
                .namespace("my.bucket.name.here")
                .dataTypes(OutboundDataType.PROCESSED)
                .build();
View Full Code Here

        }
    }

    @Test
    public void testCreateConnectionPersistsOutboundConfigurations() throws Exception {
        OutboundConfiguration outboundConfiguration = new OutboundConfiguration.Builder()
                .credentials(new ConnectionCredentials(cloudBundle.getString("nodeable.aws.accessKeyId"), cloudBundle.getString("nodeable.aws.secretKey")))
                .destination("eu-west-1")
                .protocol("s3")
                .namespace("com.streamreduce.bucket")
                .dataTypes(OutboundDataType.PROCESSED)
View Full Code Here

public class OutboundClientFactoryTest {

    @Test
    public void testOutboundConnectionForS3ReturnsS3OutboundClient() {
        OutboundConfiguration outboundAWSConnection = new OutboundConfiguration.Builder()
                .credentials(new ConnectionCredentials("user", "pass" ))
                .dataTypes(OutboundDataType.RAW)
                .protocol("s3")
                .build();
View Full Code Here

        Assert.assertEquals(S3OutboundClient.class,outboundClient.getClass());
    }

    @Test
    public void testOutboundConnectionForWebHDFSReturnsWebHDFSOutboundClient() {
        OutboundConfiguration outboundAWSConnection = new OutboundConfiguration.Builder()
                .credentials(new ConnectionCredentials("user", "pass" ))
                .dataTypes(OutboundDataType.RAW)
                .destination("http://www.test.com/webhdfs/v1/")
                .protocol("webhdfs")
                .build();
View Full Code Here

    }


    @Test
    public void testConvertOutboundConnectionToBucketName_UsesNamespaceAndIsLowerCase() throws Exception {
        OutboundConfiguration mockOutboundConfiguration = mock(OutboundConfiguration.class);
        when(mockOutboundConfiguration.getNamespace()).thenReturn("Foo");
        String bucketName = awsClientUnderTest.convertOutboundConnectionToBucketName(mockOutboundConfiguration);
        assertEquals("foo",bucketName);
    }
View Full Code Here

TOP

Related Classes of com.streamreduce.core.model.OutboundConfiguration$Builder

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.