package com.iailab; import com.iailab.module.collection.tag.impl.OadpTagCollector; import org.junit.Test; import org.junit.runner.RunWith; import javax.annotation.Resource; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; import java.util.ArrayList; import java.util.Calendar; import java.util.List; /** * @author PanZhibao * @Description * @createTime 2023年04月25日 16:17:00 */ @SpringBootTest @RunWith(SpringRunner.class) public class OadpTagCollectorTest { @Resource private OadpTagCollector tagCollector; @Test public void test() { Calendar calendar = Calendar.getInstance(); calendar.set(Calendar.MILLISECOND, 0); List tags = new ArrayList<>(); tags.add("source=producer-modbus;id=device0.change_random_int32"); tags.add("source=producer-modbus;id=device0.change_random_float"); tagCollector.collect(calendar.getTime(), tags); } @Test public void testSp() { String regex = "[+\\-\\*/()\\&&\\||]"; String expression = "324123423&&34576||9999||66666+536345"; String[] arr = expression.split(regex); } }