Siba/test/org/dclermonte/siba/model/SibaManagerTest.java

54 lines
1018 B
Java
Raw Normal View History

package org.dclermonte.siba.model;
2016-05-15 16:56:10 +02:00
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);
}
/**
2016-05-15 16:56:10 +02:00
*
* @throws IOException
* @throws ArchiveException
*/
@Test(expectedExceptions = IllegalArgumentException.class)
public void backupTest01() throws ArchiveException, IOException
{
SibaManager.backup(null, null);
}
2016-05-15 16:56:10 +02:00
/**
*
* @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);
}
}