插件开发工具库,推荐依赖该工具库。
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

59 lines
1.7 KiB

package com.fanruan.api.cluster.state;
import com.fanruan.api.Prepare;
import com.fr.store.StateServerConfig;
import org.junit.Assert;
import org.junit.Test;
/**
* @author Dylan.Liu
* @version 10.0
* Created by Dylan.Liu on 2019/12/3
*/
public class StateServerConfigKitTest extends Prepare {
@Test
public void testGetType() {
StateServerConfig.getInstance().setType("test_type");
Assert.assertEquals("test_type", StateServerConfigKit.getType());
StateServerConfig.getInstance().setType("test_type2");
Assert.assertEquals("test_type2", StateServerConfigKit.getType());
}
@Test
public void testSetShareMode() {
StateServerConfigKit.setShareMode(true);
Assert.assertTrue(StateServerConfig.getInstance().isShareMode());
StateServerConfigKit.setShareMode(false);
Assert.assertFalse(StateServerConfig.getInstance().isShareMode());
}
@Test
public void testSetType() {
StateServerConfigKit.setType("test_type3");
Assert.assertEquals("test_type3", StateServerConfig.getInstance().getType());
StateServerConfigKit.setType("test_type4");
Assert.assertEquals("test_type4", StateServerConfig.getInstance().getType());
}
@Test
public void testGetConfigClass() {
Assert.assertEquals(StateServerConfigKit.getConfigClass(), StateServerConfig.class);
}
@Test
public void testIsShareMode() {
StateServerConfig.getInstance().setShareMode(false);
Assert.assertFalse(StateServerConfigKit.isShareMode());
StateServerConfig.getInstance().setShareMode(true);
Assert.assertTrue(StateServerConfigKit.isShareMode());
}
}