You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

54 lines
1.3 KiB
Java

1 year ago
package com.htfp.weather.download;
import org.junit.jupiter.api.Test;
import java.util.List;
import static org.junit.jupiter.api.Assertions.*;
/**
* @Author : shiyi
* @Date : 2024/4/25 16:15
* @Description :
*/
class GfsDownloaderTest {
public static GfsDataConfig gfsDataConfig = new GfsDataConfig();
static {
gfsDataConfig.readConfig();
}
GfsDownloader gfsDownloader = new GfsDownloader(gfsDataConfig);
@Test
void iniTimeSetting() {
gfsDownloader.iniTimeSetting();
}
@Test
void download() {
gfsDownloader.iniTimeSetting();
List<FileInfo> fileInfoList = gfsDownloader.getFilesInfo();
gfsDownloader.download(fileInfoList.get(0));
}
@Test
void downloadAll() {
gfsDownloader.iniTimeSetting();
List<FileInfo> fileInfoList = gfsDownloader.getFilesInfo();
boolean isComplete = gfsDownloader.downloadAll(fileInfoList);
if (isComplete) {
System.out.println("下载完成");
}
}
@Test
void getFilesInfo() {
gfsDownloader.iniTimeSetting();
List<FileInfo> fileInfoList = gfsDownloader.getFilesInfo();
for (FileInfo fileInfo :fileInfoList) {
System.out.println(fileInfo);
}
}
}