Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pgdurand committed Mar 29, 2021
1 parent f4c2032 commit 6ba9996
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
1 change: 1 addition & 0 deletions src/test/unit/AllTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
UtilsTest.class,
PAnnotateBlastResultTest.class,
CmdLineQueryTest.class,
PFTPLoaderTest.class
})
public class AllTests {

Expand Down
4 changes: 2 additions & 2 deletions src/test/unit/AsperaCmdTest.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright (C) 2019 Patrick G. Durand
/* Copyright (C) 2019-2021 Patrick G. Durand
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
Expand Down Expand Up @@ -52,7 +52,7 @@ public class AsperaCmdTest {
//convenient way to bypass download tests (use only during debugging)
private static boolean doDownload = true;
private static boolean doDownloadNCBI = true;
private static boolean doDownloadEBI = true;
private static boolean doDownloadEBI = false;

private static final Log LOGGER = LogFactory
.getLog(DBMSAbstractConfig.KDMS_ROOTLOG_CATEGORY
Expand Down
17 changes: 8 additions & 9 deletions src/test/unit/PFTPLoaderTest.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright (C) 2007-2017 Ludovic Antin
/* Copyright (C) 2007-2021 Ludovic Antin, Patrick Durand
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
Expand Down Expand Up @@ -42,12 +42,12 @@ public void setUp() throws Exception {
_dbConf = new DBServerConfig();
}

private DBMSFtpFile createFtpFileToDownload(String filename) {
private DBMSFtpFile createFtpFileToDownload(String filename, String remoteDir, long size) {
FTPFile ftpFile = new FTPFile();
ftpFile.setName(filename);
ftpFile.setTimestamp(Calendar.getInstance());
ftpFile.setSize(10000);
return new DBMSFtpFile("databank/uniprot_multi/", ftpFile);
ftpFile.setSize(size);
return new DBMSFtpFile(remoteDir, ftpFile);
}

@Test
Expand All @@ -63,18 +63,17 @@ public void testDownload() {
}

File first = new File(_dbConf.getLocalTmpFolder(), "uniprot-aquaporine.dat");
File second = new File(_dbConf.getLocalTmpFolder(),
"uniprot-glucuronidase.dat");
File second = new File(_dbConf.getLocalTmpFolder(), "uniprot-glucuronidase.dat");
File third = new File(_dbConf.getLocalTmpFolder(), "uniprot-kinase.dat");

first.delete();
second.delete();
third.delete();

ArrayList<DBMSFtpFile> validNames = new ArrayList<DBMSFtpFile>();
validNames.add(createFtpFileToDownload(first.getName()));
validNames.add(createFtpFileToDownload(second.getName()));
validNames.add(createFtpFileToDownload(third.getName()));
validNames.add(createFtpFileToDownload(first.getName(), _dbConf.getRemoteFolders(), 4478l));
validNames.add(createFtpFileToDownload(second.getName(), _dbConf.getRemoteFolders(), 421780l));
validNames.add(createFtpFileToDownload(third.getName(), _dbConf.getRemoteFolders(), 85948l));
PFTPLoaderEngine loaderEngine = new PFTPLoaderEngine(_dbConf, null,
validNames);
((PFTPLoaderEngine) loaderEngine).setScheduleTime(1000);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ tasks.unit.post=idxsw

tasks.global.post=formatdb(lclid=false;check=true;nr=true)

ftp.server=192.168.1.18
ftp.server=ftp.ifremer.fr
ftp.port=21
ftp.uname=anonymous
[email protected]
ftp.rdir=/unittests/uniprot_multi
ftp.rdir=/ifremer/dataref/bioinfo/sebimer/devel/beedeem/unit-tests/uniprot_multi
ftp.rdir.exclude=

history=0

0 comments on commit 6ba9996

Please sign in to comment.