54 lines
1018 B
Java
54 lines
1018 B
Java
package org.dclermonte.siba.model;
|
|
|
|
import java.io.File;
|
|
import java.io.IOException;
|
|
|
|
import org.apache.commons.compress.archivers.ArchiveException;
|
|
import org.testng.Assert;
|
|
import org.testng.annotations.Test;
|
|
|
|
/**
|
|
*
|
|
* @author cpm
|
|
*/
|
|
public class SibaManagerTest
|
|
{
|
|
/**
|
|
*
|
|
*/
|
|
@Test
|
|
public void aFooTest()
|
|
{
|
|
Assert.assertTrue(true);
|
|
}
|
|
|
|
/**
|
|
*
|
|
* @throws IOException
|
|
* @throws ArchiveException
|
|
*/
|
|
@Test(expectedExceptions = IllegalArgumentException.class)
|
|
public void backupTest01() throws ArchiveException, IOException
|
|
{
|
|
SibaManager.backup(null, null);
|
|
}
|
|
|
|
/**
|
|
*
|
|
* @throws ArchiveException
|
|
* @throws IOException
|
|
*/
|
|
@Test
|
|
public void backupTest02() throws ArchiveException, IOException
|
|
{
|
|
String md5LineSource = "qslfjqmlsfjmqlsjfqmlsjfsjf mqlsfjmljdf";
|
|
File target = SibaManager.backup(new File("../data/simplestuff"), new File("/tmp/"));
|
|
|
|
// Load md5 file.
|
|
String md5LineTarget = FileUtils.load(target);
|
|
|
|
// Test.
|
|
Assert.assertEquals(md5LineSource, md5LineTarget);
|
|
}
|
|
}
|