Delete invalid test cases.

pull/73/head
xiaolongzuo 6 years ago
parent 1445c0a007
commit 529926b99d

@ -1,23 +0,0 @@
/*
* Copyright (C) 2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.cloud.alicloud.acm;
/**
* @author xiaolongzuo
*/
public class AcmAutoConfiguration {
}

@ -1,23 +0,0 @@
/*
* Copyright (C) 2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.cloud.alicloud.ans;
/**
* @author xiaolongzuo
*/
public class AnsAutoConfiguration {
}

@ -1,39 +0,0 @@
/*
* Copyright (C) 2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.cloud.alicloud.context;
/**
* @author xiaolongzuo
*/
// @RunWith(SpringRunner.class)
// @SpringBootTest(properties = { "spring.cloud.alicloud.access-key=123",
// "spring.cloud.alicloud.secret-key=123456" })
public class AliCloudPropertiesTests {
// @Test
// public void testConfigurationValueDefaultsAreAsExpected() {
// assertThat(config.getAccessKey()).isNull();
// assertThat(config.getSecretKey()).isNull();
// }
//
// @Test
// public void testConfigurationValuesAreCorrectlyLoaded() {
// assertThat(config.getAccessKey()).isEqualTo("123");
// assertThat(config.getSecretKey()).isEqualTo("123456");
// }
}

@ -1,42 +0,0 @@
/*
* Copyright (C) 2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.cloud.alicloud.context;
/**
* @author xiaolongzuo
*/
// @RunWith(SpringRunner.class)
// @SpringBootTest(classes = AliCloudSpringApplicationTests.AliCloudDisabledApp.class,
// properties = {
// "spring.application.name=myapp",
// "spring.cloud.alicloud.edas.application.name=myapp",
// "spring.cloud.alicloud.access-key=ak", "spring.cloud.alicloud.secret-key=sk",
// "spring.cloud.alicloud.oss.endpoint=test" }, webEnvironment = RANDOM_PORT)
// @DirtiesContext
public class AliCloudSpringApplicationTests {
// @Test
// public void contextLoads() {
// System.out.println("Context load...");
// }
//
// @SpringBootApplication
// public static class AliCloudDisabledApp {
//
// }
}

@ -1,68 +0,0 @@
/*
* Copyright (C) 2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.cloud.alicloud.context.acm;
/**
* @author xiaolongzuo
*/
public class AcmPropertiesTests {
// private ApplicationContextRunner contextRunner = new ApplicationContextRunner()
// .withConfiguration(
// AutoConfigurations.of(AcmContextBootstrapConfiguration.class,
// EdasContextAutoConfiguration.class,
// AliCloudContextAutoConfiguration.class));
//
// @Test
// public void testConfigurationValueDefaultsAreAsExpected() {
// this.contextRunner.withPropertyValues().run(context -> {
// AcmProperties config = context.getBean(AcmProperties.class);
// assertThat(config.getServerMode()).isEqualTo(AliCloudServerMode.LOCAL);
// assertThat(config.getServerList()).isEqualTo("127.0.0.1");
// assertThat(config.getServerPort()).isEqualTo("8080");
// assertThat(config.getEndpoint()).isNull();
// assertThat(config.getFileExtension()).isEqualTo("properties");
// assertThat(config.getGroup()).isEqualTo("DEFAULT_GROUP");
// assertThat(config.getNamespace()).isNull();
// assertThat(config.getRamRoleName()).isNull();
// assertThat(config.getTimeout()).isEqualTo(3000);
// });
// }
//
// @Test
// public void testConfigurationValuesAreCorrectlyLoaded() {
// this.contextRunner.withPropertyValues("spring.cloud.alicloud.access-key=ak",
// "spring.cloud.alicloud.secret-key=sk",
// "spring.cloud.alicloud.acm.server-mode=EDAS",
// "spring.cloud.alicloud.acm.server-port=11111",
// "spring.cloud.alicloud.acm.server-list=10.10.10.10",
// "spring.cloud.alicloud.acm.namespace=testNamespace",
// "spring.cloud.alicloud.acm.endpoint=testDomain",
// "spring.cloud.alicloud.acm.group=testGroup",
// "spring.cloud.alicloud.acm.file-extension=yaml").run(context -> {
// AcmProperties config = context.getBean(AcmProperties.class);
// assertThat(config.getServerMode()).isEqualTo(AliCloudServerMode.EDAS);
// assertThat(config.getServerList()).isEqualTo("10.10.10.10");
// assertThat(config.getServerPort()).isEqualTo("11111");
// assertThat(config.getEndpoint()).isEqualTo("testDomain");
// assertThat(config.getGroup()).isEqualTo("testGroup");
// assertThat(config.getFileExtension()).isEqualTo("yaml");
// assertThat(config.getNamespace()).isEqualTo("testNamespace");
// });
// }
}

@ -1,91 +0,0 @@
/*
* Copyright (C) 2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.cloud.alicloud.context.ans;
/**
* @author xiaolongzuo
*/
public class AnsPropertiesTests {
// private ApplicationContextRunner contextRunner = new ApplicationContextRunner()
// .withConfiguration(AutoConfigurations.of(AnsContextAutoConfiguration.class,
// EdasContextAutoConfiguration.class,
// AliCloudContextAutoConfiguration.class));
//
// @Test
// public void testConfigurationValueDefaultsAreAsExpected()
// throws ClassNotFoundException {
// this.contextRunner.withPropertyValues().run(context -> {
// AnsProperties config = context.getBean(AnsProperties.class);
// assertThat(config.getServerMode()).isEqualTo(AliCloudServerMode.LOCAL);
// assertThat(config.getServerList()).isEqualTo("127.0.0.1");
// assertThat(config.getServerPort()).isEqualTo("8080");
// assertThat(config.getClientDomains()).isEqualTo("");
// assertThat(config.getClientWeight()).isEqualTo(1.0F);
// assertThat(config.getClientWeights().size()).isEqualTo(0);
// assertThat(config.getClientTokens().size()).isEqualTo(0);
// assertThat(config.getClientMetadata().size()).isEqualTo(0);
// assertThat(config.getClientToken()).isNull();
// assertThat(config.getClientCluster()).isEqualTo("DEFAULT");
// assertThat(config.isRegisterEnabled()).isTrue();
// assertThat(config.getClientInterfaceName()).isNull();
// assertThat(config.getClientPort()).isEqualTo(-1);
// assertThat(config.getEnv()).isEqualTo("DEFAULT");
// assertThat(config.isSecure()).isFalse();
// assertThat(config.getTags().size()).isEqualTo(1);
// assertThat(config.getTags().keySet().iterator().next())
// .isEqualTo("ANS_SERVICE_TYPE");
// assertThat(config.getTags().get("ANS_SERVICE_TYPE"))
// .isEqualTo("SPRING_CLOUD");
// });
// }
//
// @Test
// public void testConfigurationValuesAreCorrectlyLoaded() {
// this.contextRunner
// .withPropertyValues("spring.cloud.alicloud.ans.server-mode=EDAS",
// "spring.cloud.alicloud.ans.server-port=11111",
// "spring.cloud.alicloud.ans.server-list=10.10.10.10",
// "spring.cloud.alicloud.ans.client-domains=testDomain",
// "spring.cloud.alicloud.ans.client-weight=0.9",
// "spring.cloud.alicloud.ans.client-weights.testDomain=0.9")
// .run(context -> {
// AnsProperties config = context.getBean(AnsProperties.class);
// assertThat(config.getServerMode()).isEqualTo(AliCloudServerMode.EDAS);
// assertThat(config.getServerList()).isEqualTo("10.10.10.10");
// assertThat(config.getServerPort()).isEqualTo("11111");
// assertThat(config.getClientDomains()).isEqualTo("testDomain");
// assertThat(config.getClientWeight()).isEqualTo(0.9F);
// assertThat(config.getClientWeights().size()).isEqualTo(1);
// assertThat(config.getClientTokens().size()).isEqualTo(0);
// assertThat(config.getClientMetadata().size()).isEqualTo(0);
// assertThat(config.getClientToken()).isNull();
// assertThat(config.getClientCluster()).isEqualTo("DEFAULT");
// assertThat(config.isRegisterEnabled()).isTrue();
// assertThat(config.getClientInterfaceName()).isNull();
// assertThat(config.getClientPort()).isEqualTo(-1);
// assertThat(config.getEnv()).isEqualTo("DEFAULT");
// assertThat(config.isSecure()).isFalse();
// assertThat(config.getTags().size()).isEqualTo(1);
// assertThat(config.getTags().keySet().iterator().next())
// .isEqualTo("ANS_SERVICE_TYPE");
// assertThat(config.getTags().get("ANS_SERVICE_TYPE"))
// .isEqualTo("SPRING_CLOUD");
// });
// }
}

@ -1,61 +0,0 @@
/*
* Copyright (C) 2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.cloud.alicloud.context.edas;
/**
* @author xiaolongzuo
*/
public class EdasPropertiesTests {
// private ApplicationContextRunner contextRunner = new ApplicationContextRunner()
// .withConfiguration(AutoConfigurations.of(EdasContextAutoConfiguration.class,
// AliCloudContextAutoConfiguration.class));
//
// @Test
// public void testConfigurationValueDefaultsAreAsExpected() {
// this.contextRunner.withPropertyValues().run(context -> {
// EdasProperties config = context.getBean(EdasProperties.class);
// assertThat(config.getNamespace()).isNull();
// assertThat(config.isApplicationNameValid()).isFalse();
// });
// }
//
// @Test
// public void testConfigurationValuesAreCorrectlyLoaded1() {
// this.contextRunner
// .withPropertyValues("spring.cloud.alicloud.edas.namespace=testns",
// "spring.application.name=myapps")
// .run(context -> {
// EdasProperties config = context.getBean(EdasProperties.class);
// assertThat(config.getNamespace()).isEqualTo("testns");
// assertThat(config.getApplicationName()).isEqualTo("myapps");
// });
// }
//
// @Test
// public void testConfigurationValuesAreCorrectlyLoaded2() {
// this.contextRunner
// .withPropertyValues("spring.cloud.alicloud.edas.namespace=testns",
// "spring.cloud.alicloud.edas.application.name=myapps")
// .run(context -> {
// EdasProperties config = context.getBean(EdasProperties.class);
// assertThat(config.getNamespace()).isEqualTo("testns");
// assertThat(config.getApplicationName()).isEqualTo("myapps");
// });
// }
}

@ -1,69 +0,0 @@
/*
* Copyright (C) 2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.cloud.alicloud.context.oss;
import com.aliyun.oss.OSS;
/**
* {@link OSS} {@link OssProperties} Test
*
* @author <a href="mailto:fangjian0423@gmail.com">Jim</a>
*/
public class OssAutoConfigurationTests {
// private ApplicationContextRunner contextRunner = new ApplicationContextRunner()
// .withConfiguration(AutoConfigurations.of(OssContextAutoConfiguration.class))
// .withPropertyValues("spring.cloud.alicloud.accessKey=your-ak")
// .withPropertyValues("spring.cloud.alicloud.secretKey=your-sk")
// .withPropertyValues(
// "spring.cloud.alicloud.oss.endpoint=http://oss-cn-beijing.aliyuncs.com")
// .withPropertyValues("spring.cloud.alicloud.oss.config.userAgent=alibaba");
//
// @Test
// public void testOSSProperties() {
// this.contextRunner.run(context -> {
// assertThat(context.getBeansOfType(OssProperties.class).size() == 1).isTrue();
// AliCloudProperties aliCloudProperties = context
// .getBean(AliCloudProperties.class);
// OssProperties ossProperties = context.getBean(OssProperties.class);
// assertThat(aliCloudProperties.getAccessKey()).isEqualTo("your-ak");
// assertThat(aliCloudProperties.getSecretKey()).isEqualTo("your-sk");
// assertThat(ossProperties.getEndpoint())
// .isEqualTo("http://oss-cn-beijing.aliyuncs.com");
// assertThat(ossProperties.getConfig().getUserAgent()).isEqualTo("alibaba");
// });
// }
//
// @Test
// public void testOSSClient() {
// this.contextRunner.run(context -> {
// assertThat(context.getBeansOfType(OSS.class).size() == 1).isTrue();
// assertThat(context.getBeanNamesForType(OSS.class)[0]).isEqualTo("ossClient");
// OSSClient ossClient = (OSSClient) context.getBean(OSS.class);
// assertThat(ossClient.getEndpoint().toString())
// .isEqualTo("http://oss-cn-beijing.aliyuncs.com");
// assertThat(ossClient.getClientConfiguration().getUserAgent())
// .isEqualTo("alibaba");
// assertThat(
// ossClient.getCredentialsProvider().getCredentials().getAccessKeyId())
// .isEqualTo("your-ak");
// assertThat(ossClient.getCredentialsProvider().getCredentials()
// .getSecretAccessKey()).isEqualTo("your-sk");
// });
// }
}

@ -1,23 +0,0 @@
/*
* Copyright (C) 2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.cloud.alicloud.oss;
/**
* @author xiaolongzuo
*/
public class OssAutoConfiguration {
}
Loading…
Cancel
Save