当前位置:网站首页>Picture server project test
Picture server project test
2022-07-01 06:20:00 【qq_ fifty-two million twenty-five thousand two hundred and eight】
1. Write test cases and execute 
According to the development stage
Project test sequence :
unit testing —— A functional test —— automated testing , Performance testing
2. unit testing
public class ImageDAOTest {
@Test
public void queryCountByMd5() {
ImageDAO imageDAO = new ImageDAO();
int n = imageDAO.queryCountByMd5("123123");
assertEquals(1,n);
}
@Test
public void insert() {
ImageDAO imageDAO = new ImageDAO();
Image image = new Image();
image.setImageName("");
image.setSize((long)44189);
image.setUploadTime("2021-07-01 12:42:10");
image.setMd5("71f7b259105fc5d3b86826945daff728");
image.setContentType("image/jpeg");
image.setPath("/71f7b259105fc5d3b86826945daff728");
imageDAO.insert(image);
}
@Test
public void queryAllImage() {
ImageDAO imageDAO = new ImageDAO();
List<Image> list = new ArrayList<>();
list = imageDAO.queryAllImage();
System.out.println(list.size());
for(Image image : list) {
System.out.println(image.getImageName());
}
}
@Test
public void queryOneImage() {
ImageDAO imageDAO = new ImageDAO();
Image image = imageDAO.queryOneImage(0);
System.out.println(image);
}
@Test
public void delete() {
ImageDAO imageDAO = new ImageDAO();
int n = imageDAO.delete(24);
System.out.println(n);
}
}
3. Performance testing
Adopted Loadrunner A three piece set of , First use Virtual User Generator Recording script , Reuse Controller Simulate the virtual user to simply test the load pressure , The last generation Analysis Report for analysis .

4. automated testing
Here we use selenium and unittest Completed automated testing . Write scripts that simply upload and delete images .
from selenium import webdriver
import unittest
import time
class imageTest(unittest.TestCase):
def setUp(self):
self.driver=webdriver.Chrome()
self.driver.get("http://127.0.0.1:8080/java_image_server/index.html")
self.driver.maximize_window()
time.sleep(3)
def tesrDown(self):
self.driver.quit()
# Upload
# @unittest.skip("skipping")
def test_upload(self):
self.driver.find_element_by_id("upload").send_keys("E:\\06.jpg")
time.sleep(6)
self.driver.find_element_by_xpath("//*[@id='blog-collapse']/form/div[2]/input").click()
time.sleep(6)
# Delete
# @unittest.skip("skipping")
def test_delete(self):
self.driver.find_element_by_xpath("//*[@id='container']/div[1]/button").click()
time.sleep(3)
alert=self.driver.switch_to.alert
alert.accept()
time.sleep(3)
if __name__=="__main__":
unittest.main()
边栏推荐
- 【ManageEngine卓豪】局域网监控的作用
- Oracle create user + Role
- 【ManageEngine卓豪】用统一终端管理助“欧力士集团”数字化转型
- 连续四年入选Gartner魔力象限,ManageEngine卓豪是如何做到的?
- 【ManageEngine卓豪】网络运维管理是什么,网络运维平台有什么用
- Smartinstantiationawarebeanpostprocessor of the extension point series determines which construction method to execute - Chapter 432
- SystemVerilog learning-09-interprocess synchronization, communication and virtual methods
- Small guide for rapid completion of mechanical arm (VI): stepping motor driver
- 扩散(多源广搜)
- 【ITSM】什么是ITSM,IT部门为什么需要ITSM
猜你喜欢

【ManageEngine卓豪 】助力世界顶尖音乐学院--茱莉亚学院,提升终端安全

【文件系统】如何在ubi之上运行squashfs

One of the characteristic agricultural products that make Tiantou village, Guankou Town, Xiamen into a "sweet" village is
![[self use of advanced mathematics in postgraduate entrance examination] advanced mathematics Chapter 1 thinking map in basic stage](/img/54/f187e22ad69f3985d30376bad1fa03.png)
[self use of advanced mathematics in postgraduate entrance examination] advanced mathematics Chapter 1 thinking map in basic stage

ONEFLOW source code parsing: automatic inference of operator signature

分布式锁实现

HCM Beginner (IV) - time

OpenGL es: (3) EGL, basic steps of EGL drawing, eglsurface, anativewindow

SystemVerilog learning-10-validation quantification and coverage

指数法和Random Forest实现山东省丰水期地表水体信息
随机推荐
【ManageEngine卓豪】助力黄石爱康医院实现智能批量化网络设备配置管理
利用百度地图查询全国地铁线路
10 golang operator
3D打印机穿线:5种简单的解决方案
SystemVerilog learning-06-class encapsulation
【ManageEngine卓豪】移动终端管理解决方案,助力中州航空产业数字化转型
分布式锁实现
Dongle data collection
Make: g++: command not found
MySQL怎么存储emoji?
ABP 学习解决方案中的项目以及依赖关系
Distributed lock implementation
LED lighting used in health lighting
The row and column numbers of each pixel of multi-source grid data in the same area are the same, that is, the number of rows and columns are the same, and the pixel size is the same
Skywalking integrated Nacos dynamic configuration
OpenGL es: (2) relationship between OpenGL es, EGL and glsl
浏览器端保存数据到本地文件
Pychart configuring jupyter
[note] e-commerce order data analysis practice
PLA不粘贴在床上:6个简单的解决方案