示例#1
0
        public void Accept_AcceptsValidServiceBinding()
        {
            Service s = CreateRabbitService();

            Assert.NotNull(s);

            RabbitServiceInfoFactory factory = new RabbitServiceInfoFactory();

            Assert.True(factory.Accept(s));
        }
示例#2
0
        public void Accept_AcceptsNoLabelNoTagsSecureUriServiceBinding()
        {
            Service s = new Service()
            {
                Name        = "rabbitService",
                Plan        = "free",
                Credentials = new Credential()
                {
                    { "hostname", new Credential("192.168.0.90") },
                    { "port", new Credential("3306") },
                    { "name", new Credential("cf_b4f8d2fa_a3ea_4e3a_a0e8_2cd040790355") },
                    { "username", new Credential("Dd6O1BPXUHdrmzbP") },
                    { "password", new Credential("7E1LxXnlH2hhlPVt") },
                    { "uri", new Credential("amqps://*****:*****@192.168.0.90:3306/cf_b4f8d2fa_a3ea_4e3a_a0e8_2cd040790355?reconnect=true") },
                }
            };
            RabbitServiceInfoFactory factory = new RabbitServiceInfoFactory();

            Assert.True(factory.Accept(s));
        }
示例#3
0
        public void Accept_WithLabelNoTagsServiceBinding()
        {
            Service s = new Service()
            {
                Label       = "rabbitmq",
                Name        = "myService",
                Plan        = "Standard",
                Credentials = new Credential()
                {
                    { "hostname", new Credential("192.168.0.90") },
                    { "port", new Credential("3306") },
                    { "name", new Credential("cf_b4f8d2fa_a3ea_4e3a_a0e8_2cd040790355") },
                    { "username", new Credential("Dd6O1BPXUHdrmzbP") },
                    { "password", new Credential("7E1LxXnlH2hhlPVt") },
                    { "uri", new Credential("amqp://*****:*****@192.168.0.90:3306/cf_b4f8d2fa_a3ea_4e3a_a0e8_2cd040790355?reconnect=true") },
                    { "http_api_uri", new Credential("https://*****:*****@pivotal-rabbitmq.system.testcloud.com/api/") }
                }
            };
            RabbitServiceInfoFactory factory = new RabbitServiceInfoFactory();

            Assert.True(factory.Accept(s));
        }
示例#4
0
        public void Accept_RejectsInvalidServiceBinding()
        {
            Service s = new Service()
            {
                Label       = "p-mysql",
                Tags        = new string[] { "foobar", "relational" },
                Name        = "mySqlService",
                Plan        = "100mb-dev",
                Credentials = new Credential()
                {
                    { "hostname", new Credential("192.168.0.90") },
                    { "port", new Credential("3306") },
                    { "name", new Credential("cf_b4f8d2fa_a3ea_4e3a_a0e8_2cd040790355") },
                    { "username", new Credential("Dd6O1BPXUHdrmzbP") },
                    { "password", new Credential("7E1LxXnlH2hhlPVt") },
                    { "uri", new Credential("mysql://*****:*****@192.168.0.90:3306/cf_b4f8d2fa_a3ea_4e3a_a0e8_2cd040790355?reconnect=true") },
                    { "jdbcUrl", new Credential("jdbc:mysql://192.168.0.90:3306/cf_b4f8d2fa_a3ea_4e3a_a0e8_2cd040790355?user=Dd6O1BPXUHdrmzbP&password=7E1LxXnlH2hhlPVt") }
                }
            };
            RabbitServiceInfoFactory factory = new RabbitServiceInfoFactory();

            Assert.False(factory.Accept(s));
        }