Fix IT start error problem. (#5168)

This commit is contained in:
杨翊 SionYang 2021-03-23 10:53:56 +08:00 committed by GitHub
parent 2798aa90a1
commit a9a795c97d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
29 changed files with 27 additions and 121 deletions

View File

@ -1,49 +0,0 @@
/*
* Copyright 1999-2018 Alibaba Group Holding Ltd.
*
* 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 com.alibaba.nacos.test;
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
/**
* Unit test for simple App.
*/
public class AppTest
extends TestCase {
/**
* Create the test case
*
* @param testName name of the test case
*/
public AppTest(String testName) {
super(testName);
}
/**
* @return the suite of tests being tested
*/
public static Test suite() {
return new TestSuite(AppTest.class);
}
/**
* Rigourous Test :-)
*/
public void testApp() {
assertTrue(true);
}
}

View File

@ -1,39 +0,0 @@
/*
* Copyright 1999-2018 Alibaba Group Holding Ltd.
*
* 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 com.alibaba.nacos.test;
import com.alibaba.nacos.common.utils.JacksonUtils;
import com.alibaba.nacos.naming.healthcheck.RsInfo;
import org.junit.Test;
/**
* @author <a href="mailto:liaochuntao@live.com">liaochuntao</a>
* @author yangyi
*
* @deprecated It seems no necessary for super test class, will be removed.
*/
@Deprecated
public class BaseTest {
@Test
public void test_rs_json() {
String json = "{\"cluster\":\"DEFAULT\",\"ip\":\"127.0.0.1\",\"metadata\":{},\"port\":60000,\"scheduled\":true,\"serviceName\":\"DEFAULT_GROUP@@jinhan9J7ye.Vj6hx.net\",\"weight\":1.0}";
RsInfo client = JacksonUtils.toObj(json, RsInfo.class);
System.out.println(client);
}
}

View File

@ -48,7 +48,7 @@ import java.util.Map;
@FixMethodOrder(MethodSorters.JVM)
@RunWith(SpringRunner.class)
@SpringBootTest(classes = Nacos.class, properties = {
"server.servlet.context-path=/nacos"}, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
"server.servlet.context-path=/nacos"}, webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT)
public class NacosAsyncRestTemplate_ITCase {
@LocalServerPort

View File

@ -47,7 +47,7 @@ import java.util.Map;
*/
@RunWith(SpringRunner.class)
@SpringBootTest(classes = Nacos.class, properties = {
"server.servlet.context-path=/nacos"}, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
"server.servlet.context-path=/nacos"}, webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT)
@FixMethodOrder(MethodSorters.JVM)
public class NacosRestTemplate_ITCase {

View File

@ -51,7 +51,7 @@ import java.util.Map;
*/
@RunWith(SpringRunner.class)
@SpringBootTest(classes = Nacos.class, properties = {
"server.servlet.context-path=/nacos"}, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
"server.servlet.context-path=/nacos"}, webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT)
@FixMethodOrder(MethodSorters.JVM)
public class NacosRestTemplate_Interceptors_ITCase {

View File

@ -45,7 +45,7 @@ import static org.junit.Assert.fail;
*/
@RunWith(SpringRunner.class)
@SpringBootTest(classes = Nacos.class, properties = {"server.servlet.context-path=/nacos"},
webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT)
public class ConfigAuth_ITCase extends AuthBase {
@LocalServerPort

View File

@ -43,7 +43,7 @@ import static org.junit.Assert.fail;
*/
@RunWith(SpringRunner.class)
@SpringBootTest(classes = Nacos.class, properties = {"server.servlet.context-path=/nacos"},
webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT)
public class NamingAuth_ITCase extends AuthBase {
@LocalServerPort

View File

@ -44,7 +44,7 @@ import java.util.concurrent.TimeUnit;
*/
@RunWith(SpringRunner.class)
@SpringBootTest(classes = Nacos.class, properties = {"server.servlet.context-path=/nacos"},
webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT)
public class Permission_ITCase extends HttpClient4Test {
@LocalServerPort

View File

@ -44,7 +44,7 @@ import java.util.concurrent.TimeUnit;
*/
@RunWith(SpringRunner.class)
@SpringBootTest(classes = Nacos.class, properties = {"server.servlet.context-path=/nacos"},
webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT)
public class Role_ITCase extends HttpClient4Test {
@LocalServerPort

View File

@ -46,7 +46,7 @@ import java.util.concurrent.TimeUnit;
*/
@RunWith(SpringRunner.class)
@SpringBootTest(classes = Nacos.class, properties = {"server.servlet.context-path=/nacos"},
webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT)
public class User_ITCase extends HttpClient4Test {
@LocalServerPort

View File

@ -25,10 +25,8 @@ import com.alibaba.nacos.core.cluster.lookup.LookupFactory;
import com.alibaba.nacos.core.cluster.MemberLookup;
import com.alibaba.nacos.core.cluster.lookup.StandaloneMemberLookup;
import com.alibaba.nacos.sys.env.EnvUtil;
import com.alibaba.nacos.sys.utils.ApplicationUtils;
import com.alibaba.nacos.sys.utils.DiskUtils;
import com.alibaba.nacos.sys.utils.InetUtils;
import com.alibaba.nacos.test.BaseTest;
import org.apache.commons.lang3.StringUtils;
import org.junit.After;
import org.junit.Assert;
@ -49,7 +47,7 @@ import java.util.Map;
* @author <a href="mailto:liaochuntao@live.com">liaochuntao</a>
*/
@FixMethodOrder(value = MethodSorters.NAME_ASCENDING)
public class MemberLookup_ITCase extends BaseTest {
public class MemberLookup_ITCase {
static final String path = Paths.get(System.getProperty("user.home"), "/member_look")
.toString();

View File

@ -50,7 +50,7 @@ import static com.alibaba.nacos.test.naming.NamingBase.randomDomainName;
*/
@RunWith(SpringRunner.class)
@SpringBootTest(classes = Nacos.class, properties = {
"server.servlet.context-path=/nacos"}, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
"server.servlet.context-path=/nacos"}, webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT)
public class AutoDeregisterInstance_ITCase {
private NamingService naming;

View File

@ -55,7 +55,7 @@ import static com.alibaba.nacos.test.naming.NamingBase.*;
*/
@RunWith(SpringRunner.class)
@SpringBootTest(classes = Nacos.class, properties = {"server.servlet.context-path=/nacos"},
webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT)
public class CPInstancesAPI_ITCase {
private NamingService naming;

View File

@ -40,7 +40,7 @@ import java.util.concurrent.TimeUnit;
@RunWith(SpringRunner.class)
@SpringBootTest(classes = Nacos.class, properties = {"server.servlet.context-path=/nacos"},
webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT)
public class ClientBeat_ITCase extends NamingBase {
private NamingService naming;

View File

@ -49,7 +49,7 @@ import static com.alibaba.nacos.test.naming.NamingBase.*;
@RunWith(SpringRunner.class)
@SpringBootTest(classes = Nacos.class, properties = {"server.servlet.context-path=/nacos"},
webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT)
@Ignore
public class Cmdb_ITCase {

View File

@ -45,7 +45,7 @@ import static com.alibaba.nacos.test.naming.NamingBase.randomDomainName;
*/
@RunWith(SpringRunner.class)
@SpringBootTest(classes = Nacos.class, properties = {"server.servlet.context-path=/nacos"},
webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT)
public class DeregisterInstance_ITCase {
private NamingService naming;

View File

@ -48,7 +48,7 @@ import static com.alibaba.nacos.test.naming.NamingBase.*;
*/
@RunWith(SpringRunner.class)
@SpringBootTest(classes = Nacos.class, properties = {"server.servlet.context-path=/nacos"},
webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT)
public class MultiTenant_ITCase {
private NamingService naming;

View File

@ -60,7 +60,7 @@ import static com.alibaba.nacos.test.naming.NamingBase.randomDomainName;
*/
@RunWith(SpringRunner.class)
@SpringBootTest(classes = Nacos.class, properties = {
"server.servlet.context-path=/nacos"}, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
"server.servlet.context-path=/nacos"}, webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT)
public class MultiTenant_InstanceAPI_ITCase {
private NamingService naming;

View File

@ -45,7 +45,7 @@ import java.util.concurrent.TimeUnit;
@RunWith(SpringRunner.class)
@SpringBootTest(classes = NamingApp.class, properties = {"server.servlet.context-path=/nacos"},
webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT)
public class NamingHttpClientProxy_ITCase {
@LocalServerPort
private int port;

View File

@ -27,8 +27,6 @@ import com.alibaba.nacos.api.naming.pojo.Instance;
import com.alibaba.nacos.api.naming.pojo.Service;
import com.alibaba.nacos.api.selector.ExpressionSelector;
import com.alibaba.nacos.api.selector.NoneSelector;
import com.alibaba.nacos.sys.utils.ApplicationUtils;
import com.alibaba.nacos.test.BaseTest;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
@ -51,8 +49,8 @@ import static com.alibaba.nacos.test.naming.NamingBase.randomDomainName;
**/
@RunWith(SpringRunner.class)
@SpringBootTest(classes = Nacos.class, properties = {"server.servlet.context-path=/nacos"},
webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
public class NamingMaintainService_ITCase extends BaseTest {
webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT)
public class NamingMaintainService_ITCase {
private NamingMaintainService namingMaintainService;
private NamingService namingService;

View File

@ -46,7 +46,7 @@ import java.util.concurrent.TimeUnit;
*/
@RunWith(SpringRunner.class)
@SpringBootTest(classes = Nacos.class, properties = {
"server.servlet.context-path=/nacos"}, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
"server.servlet.context-path=/nacos"}, webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT)
public class RegisterInstance_ITCase {
private NamingService naming;

View File

@ -35,7 +35,7 @@ import java.net.URL;
*/
@RunWith(SpringRunner.class)
@SpringBootTest(classes = Nacos.class, properties = {"server.servlet.context-path=/nacos"},
webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT)
public class RestAPI_ITCase extends NamingBase {
@LocalServerPort

View File

@ -47,7 +47,7 @@ import static com.alibaba.nacos.test.naming.NamingBase.*;
*/
@RunWith(SpringRunner.class)
@SpringBootTest(classes = Nacos.class, properties = {"server.servlet.context-path=/nacos"},
webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT)
public class SelectInstances_ITCase {
private NamingService naming;

View File

@ -42,7 +42,7 @@ import static com.alibaba.nacos.test.naming.NamingBase.*;
*/
@RunWith(SpringRunner.class)
@SpringBootTest(classes = Nacos.class, properties = {"server.servlet.context-path=/nacos"},
webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT)
public class SelectOneHealthyInstance_ITCase {
private NamingService naming;

View File

@ -45,7 +45,7 @@ import static com.alibaba.nacos.test.naming.NamingBase.randomDomainName;
*/
@RunWith(SpringRunner.class)
@SpringBootTest(classes = Nacos.class, properties = {"server.servlet.context-path=/nacos"},
webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT)
public class ServiceListTest_ITCase {
private NamingService naming;

View File

@ -46,7 +46,7 @@ import static com.alibaba.nacos.test.naming.NamingBase.*;
*/
@RunWith(SpringRunner.class)
@SpringBootTest(classes = Nacos.class, properties = {"server.servlet.context-path=/nacos"},
webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT)
public class SubscribeCluster_ITCase {
private NamingService naming;

View File

@ -48,7 +48,7 @@ import java.util.concurrent.TimeUnit;
*/
@RunWith(SpringRunner.class)
@SpringBootTest(classes = Nacos.class, properties = {"server.servlet.context-path=/nacos"},
webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT)
public class Subscribe_ITCase extends RestAPI_ITCase {
private NamingService naming;

View File

@ -45,7 +45,7 @@ import static com.alibaba.nacos.test.naming.NamingBase.*;
*/
@RunWith(SpringRunner.class)
@SpringBootTest(classes = Nacos.class, properties = {"server.servlet.context-path=/nacos"},
webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT)
public class Unsubscribe_ITCase {
private NamingService naming;

View File

@ -17,8 +17,6 @@
<configuration>
<springProperty scope="context" name="logPath" source="nacos.logging.path" defaultValue="${nacos.home}/logs"/>
<!--<appender name="DefaultAppender" class="ch.qos.logback.core.ConsoleAppender">-->
<!--<append>true</append>-->
<!--<encoder>-->