shikeying
2022-10-11 2b1f542577dd8dfc54d3433dff3615796ceab0af
recommend-video/src/test/java/com/iplatform/recvideo/VideoSimilarTest.java
@@ -3,14 +3,25 @@
import com.iplatform.model.po.Rc_video_t1;
import com.iplatform.recvideo.util.PythonInvokeUtils;
import com.iplatform.recvideo.util.VideoFileUtils;
import com.walker.infrastructure.utils.ClassUtils;
import com.walker.scheduler.impl.TimedScheduler;
import org.junit.Test;
import org.springframework.web.client.RestTemplate;
import java.lang.reflect.Constructor;
import java.util.List;
public class VideoSimilarTest {
    @Test
//    @Test
    public void testSchedulerClass() throws Exception{
        Class<?> schedulerClass = ClassUtils.forName("com.iplatform.recvideo.scheduler.VideoSearchScheduler", VideoSimilarTest.class.getClassLoader());
        Constructor<TimedScheduler> constructor = (Constructor<TimedScheduler>)schedulerClass.getConstructor(int.class, String.class);
        TimedScheduler listeningScheduler = constructor.newInstance(100, "test_scheduler");
    }
//    @Test
    public void testPythonSearch() throws Exception{
        String url = "http://121.36.40.27:12345/ai/video/search_img";
        RestTemplate restTemplate = new RestTemplate();
@@ -23,9 +34,10 @@
        }
    }
//    @Test
    @Test
    public void testGetVideoId(){
        String id = PythonInvokeUtils.getFileNameWithoutSuffix("/opt/ai/video/20220921/landscape_01.mp4", Constants.VIDEO_SUFFIX);
//        String id = PythonInvokeUtils.getFileNameWithoutSuffix("/opt/ai/video/20220921/landscape_01.mp4", Constants.VIDEO_SUFFIX);
        String id = PythonInvokeUtils.getFileNameWithoutSuffix("D:\\dev_tools\\ai\\20220520144630\\1527541255435849728\\1527541255435849728_0.jpg", Constants.IMAGE_SUFFIX);
        System.out.println(id);
    }