You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
1.1 KiB
37 lines
1.1 KiB
2 years ago
|
import com.msb.DirEnum;
|
||
2 years ago
|
import org.junit.Assert;
|
||
|
import org.junit.Test;
|
||
|
|
||
|
import javax.imageio.ImageIO;
|
||
|
import java.awt.image.BufferedImage;
|
||
|
import java.io.File;
|
||
|
import java.io.IOException;
|
||
2 years ago
|
import java.util.Random;
|
||
2 years ago
|
|
||
|
/**
|
||
|
* @Author bingor
|
||
|
* @Date 2022-10-01 10:48
|
||
|
* @Description: com.msb.test
|
||
|
* @Version: 1.0
|
||
|
*/
|
||
|
public class CommonTest {
|
||
|
|
||
|
@Test
|
||
|
public void testReadImage() throws IOException {
|
||
|
BufferedImage bufferedImage = ImageIO.read(new File("E:\\myfile\\msb_马士兵教育体系\\课程下载的资源\\MCA高级构架师\\73-坦克大战(一期)\\images\\tankD.gif"));
|
||
|
Assert.assertNotNull(bufferedImage);
|
||
2 years ago
|
BufferedImage image = ImageIO.read(CommonTest.class.getClassLoader().getResourceAsStream("images/tankD.gif"));
|
||
|
Assert.assertNotNull(image);
|
||
2 years ago
|
}
|
||
|
|
||
2 years ago
|
@Test
|
||
|
public void testEnum() {
|
||
|
Random random = new Random();
|
||
|
System.out.println(DirEnum.valueOf(random.nextInt(3)));
|
||
|
System.out.println(DirEnum.valueOf(random.nextInt(3)));
|
||
|
System.out.println(DirEnum.valueOf(random.nextInt(3)));
|
||
|
System.out.println(DirEnum.valueOf(random.nextInt(3)));
|
||
|
}
|
||
|
|
||
2 years ago
|
}
|