Skip to content

Commit

Permalink
[ISSUE alibaba#3576] [Enhancement] Adding the destroy lifecycle metho…
Browse files Browse the repository at this point in the history
…d on NamingMaintainService (alibaba#3985)
  • Loading branch information
realJackSun authored and WesleyOne committed Oct 20, 2020
1 parent d77392a commit c57799c
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -167,4 +167,10 @@ void updateService(String serviceName, String groupName, float protectThreshold,
*/
void updateService(Service service, AbstractSelector selector) throws NacosException;

/**
* Shutdown the resource service.
*
* @throws NacosException exception.
*/
void shutDown() throws NacosException;
}
Original file line number Diff line number Diff line change
Expand Up @@ -173,4 +173,8 @@ public void updateService(Service service, AbstractSelector selector) throws Nac
serverProxy.updateService(service, selector);
}

@Override
public void shutDown() throws NacosException {
serverProxy.shutdown();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
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;
import org.junit.Test;
Expand Down Expand Up @@ -163,5 +164,10 @@ public void deleteService() throws NacosException {

Assert.assertTrue(namingMaintainService.deleteService(serviceName));
}


@After
public void tearDown() throws NacosException {
namingMaintainService.shutDown();
namingService.shutDown();
}
}

0 comments on commit c57799c

Please sign in to comment.