Commit 1c2c1d75 authored by ZWT's avatar ZWT

都删了

parent cf2a9e66
package pps.core.common.service.data;
import pps.core.common.utils.DynObj;
public class CounterOutput extends DynObj {
}
package xstartup.base;
import xstartup.base.exception.XServiceException;
import xstartup.base.util.XUuidUtils;
/**
* @author lixueyan
* @date 2023/4/4 0004 13:36
* 为满足定时任务等 非前端请求需要用户信息的 接口,特创建此类
*/
public class XSelfServiceContext extends XContext {
XSelfServiceContext(String logTag) {
super(XUuidUtils.randomUUID(), "UNKNOWN", XStartup.getCurrent().getScope(), logTag);
}
public static XSelfServiceContext build(String logTag) {
XSelfServiceContext context = new XSelfServiceContext(logTag);
return context;
}
public static XSelfServiceContext build(Class<?> targetClass) {
XSelfServiceContext context = new XSelfServiceContext(targetClass.getName());
return context;
}
public XApp getApp() {
if (this.app == null) {
XAppInfo appInfo = XStartup.getApplication();
this.app = new XApp(appInfo.getSystemId(), appInfo.getTenantId(), appInfo.getId());
}
return this.app;
}
public XUser getUser() {
if (this.user == null) {
this.user = XUser.createAnonymousUser("local", 1L, 1L, 1L, "xservice", "xservice");
}
return this.user;
}
public void setUser(XUser user) throws XServiceException {
this.user = user;
}
public String getSessionId() {
return this.getUser().getSessionId();
}
}
\ No newline at end of file
package pps.core.common.utils;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import java.util.concurrent.ConcurrentHashMap;
class Pinyin4jUtilTest {
@Test
void testGetFirstSpellPinYin() {
String result = PinyinUtil.getPinyin("我的祖国", "_");
System.out.println("result: " + result);
}
@Test
void maptest() {
ConcurrentHashMap<String, String> map = new ConcurrentHashMap<String, String>();
String abc = map.get("abc");
Assertions.assertNull(abc);
}
@Test
void testFavorite() {
String s = null + "";
Assertions.assertTrue(s.equals(""));
}
}
\ No newline at end of file
package pps.core.common.utils;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
class SqlFilterTest {
@Test
void testFilterValue() {
Assertions.assertEquals("1/1", SqlFilter.filterValue("1/1"));
Assertions.assertEquals("original", SqlFilter.filterValue("original"));
Assertions.assertEquals("", SqlFilter.filterValue("select"));
Assertions.assertEquals("1", SqlFilter.filterValue("select 1"));
Assertions.assertEquals("1", SqlFilter.filterValue("drop 1"));
Assertions.assertEquals("1", SqlFilter.filterValue("1'"));
Assertions.assertEquals("1", SqlFilter.filterValue("1-------"));
Assertions.assertEquals("7.007111", SqlFilter.filterValue("7.007111--"));
Assertions.assertEquals("1", SqlFilter.filterValue("1//"));
Assertions.assertEquals("1", SqlFilter.filterValue("1/**/"));
Assertions.assertEquals("11", SqlFilter.filterValue("1/*1*/"));
Thread.currentThread().setName("dealNewToOldMq");
Assertions.assertEquals("dealNewToOldMq", Thread.currentThread().getName());
}
}
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment