package com.hxh.spring.test.video;
|
|
import com.yeshi.buwan.domain.video.VideoResourcePlayVersionMap;
|
import com.yeshi.buwan.domain.video.VideoResourceVersionMap;
|
import com.yeshi.buwan.service.inter.video.VideoResourcePlayVersionMapService;
|
import com.yeshi.buwan.service.inter.video.VideoResourcePlayVersionMapService;
|
import com.yeshi.buwan.service.inter.video.VideoResourceVersionMapService;
|
import org.junit.Test;
|
import org.junit.runner.RunWith;
|
import org.springframework.test.context.ContextConfiguration;
|
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
import org.springframework.test.context.web.WebAppConfiguration;
|
|
import javax.annotation.Resource;
|
import java.util.Date;
|
import java.util.List;
|
|
/**
|
* @author Administrator
|
* @title:
|
* @description:
|
* @date 2021/9/10 14:46
|
*/
|
@RunWith(SpringJUnit4ClassRunner.class) //使用junit4进行测试
|
@ContextConfiguration(locations = {"classpath:spring.xml"})
|
@WebAppConfiguration
|
public class VideoResourcePlayVersionTest {
|
|
@Resource
|
private VideoResourcePlayVersionMapService videoResourcePlayVersionMapService;
|
|
|
@Resource
|
private VideoResourceVersionMapService videoResourceVersionMapService;
|
|
@Test
|
public void addBuWanAndroid() {
|
String[] resourceIds = new String[]{"13", "20", "17", "19", "21", "22", "24", "26", "27"};
|
for (String rid : resourceIds) {
|
try {
|
videoResourcePlayVersionMapService.add(new VideoResourcePlayVersionMap("44", 1, rid, null));
|
} catch (Exception e) {
|
e.printStackTrace();
|
}
|
}
|
|
resourceIds = new String[]{"25"};
|
for (String rid : resourceIds) {
|
try {
|
videoResourcePlayVersionMapService.add(new VideoResourcePlayVersionMap("44", 105, rid, null));
|
} catch (Exception e) {
|
e.printStackTrace();
|
}
|
}
|
|
}
|
|
|
@Test
|
public void addMGAndroid() {
|
String[] resourceIds = null;
|
resourceIds = new String[]{"13", "20", "17", "19", "21", "22", "24", "26", "27"};
|
for (String rid : resourceIds) {
|
try {
|
videoResourcePlayVersionMapService.add(new VideoResourcePlayVersionMap("47", 1, rid, null));
|
} catch (Exception e) {
|
e.printStackTrace();
|
}
|
}
|
|
// resourceIds = new String[]{"25"};
|
// for (String rid : resourceIds) {
|
// try {
|
// videoResourcePlayVersionMapService.add(new VideoResourcePlayVersionMap("47", 1, rid, "meizu"));
|
// } catch (Exception e) {
|
// e.printStackTrace();
|
// }
|
// }
|
|
}
|
|
@Test
|
public void addHJAndroid() {
|
String[] resourceIds = null;
|
resourceIds = new String[]{"13", "20", "17", "19", "21", "22", "24", "26", "27", "25", "28"};
|
for (String rid : resourceIds) {
|
try {
|
videoResourcePlayVersionMapService.add(new VideoResourcePlayVersionMap("48", 1, rid, "meizu"));
|
} catch (Exception e) {
|
e.printStackTrace();
|
}
|
}
|
}
|
|
@Test
|
public void addHJMZ() {
|
String[] resourceIds = null;
|
resourceIds = new String[]{"25", "28"};
|
for (String rid : resourceIds) {
|
try {
|
videoResourcePlayVersionMapService.add(new VideoResourcePlayVersionMap("48", 1, rid, "meizu"));
|
} catch (Exception e) {
|
e.printStackTrace();
|
}
|
}
|
}
|
|
|
@Test
|
public void addBuwanLite() {
|
String[] resourceIds = null;
|
resourceIds = new String[]{"25"};
|
for (String rid : resourceIds) {
|
try {
|
videoResourcePlayVersionMapService.add(new VideoResourcePlayVersionMap("49", 1, rid, "xiaomi"));
|
} catch (Exception e) {
|
e.printStackTrace();
|
}
|
}
|
}
|
|
@Test
|
public void addBuWanIOS() {
|
String[] resourceIds = new String[]{"13", "20", "17", "19", "21", "22", "24", "26", "27"};
|
for (String rid : resourceIds) {
|
try {
|
videoResourcePlayVersionMapService.add(new VideoResourcePlayVersionMap("43", 1, rid, null));
|
} catch (Exception e) {
|
e.printStackTrace();
|
}
|
}
|
}
|
|
|
@Test
|
public void listValid() {
|
List<String> resourceIds = videoResourcePlayVersionMapService.listResourceId("43", 105, null);
|
System.out.println(resourceIds);
|
|
resourceIds = videoResourcePlayVersionMapService.listResourceId("44", 1, null);
|
System.out.println(resourceIds);
|
|
resourceIds = videoResourcePlayVersionMapService.listResourceId("44", 2, null);
|
System.out.println(resourceIds);
|
|
resourceIds = videoResourcePlayVersionMapService.listResourceId("44", 106, null);
|
System.out.println(resourceIds);
|
}
|
|
@Test
|
public void copy() throws Exception {
|
List<VideoResourceVersionMap> mapList = videoResourceVersionMapService.listAll();
|
for (VideoResourceVersionMap map : mapList) {
|
VideoResourcePlayVersionMap pm = new VideoResourcePlayVersionMap();
|
pm.setId(map.getId());
|
pm.setChannel(map.getChannel());
|
pm.setDetailSystemId(map.getDetailSystemId());
|
pm.setRemarks(map.getRemarks());
|
pm.setVersion(map.getVersion());
|
pm.setUpdateTime(new Date());
|
pm.setResourceId(map.getResourceId());
|
pm.setCreateTime(new Date());
|
videoResourcePlayVersionMapService.add(pm);
|
}
|
}
|
|
}
|