FileDocCategorySizeDatePackage
BackupRequestTest.javaAPI DocGlassfish v2 API5333Fri May 04 22:23:16 BST 2007com.sun.enterprise.config.backup

BackupRequestTest

public class BackupRequestTest extends TestCase
author
Byron Nevins

Fields Summary
Constructors Summary
public BackupRequestTest(String testName)

		super(testName);
	
Methods Summary
public static voidmain(java.lang.String[] args)

		junit.textui.TestRunner.run(suite());
	
public static junit.framework.Testsuite()

		TestSuite suite = new TestSuite(BackupRequestTest.class);
		return suite;
	
public voidtestBadBackupFile()

		System.out.println("testBadBackupFile");
		File f = new File("c:/temp/goo");
		try
		{
			f.mkdirs();
			BackupRequest req = new BackupRequest("c:/temp", "goo", "c:/temp/q.zip");
			BackupManager mgr = new BackupManager(req);
		}
		catch(BackupException be)
		{
			System.out.println(be);
			return;
		}
		finally
		{
			FileUtils.whack(f);
		}
		fail("Should have got an Exception!");
	
public voidtestBadCtor()
Test of verifyInfo method, of class com.sun.enterprise.config.backup.BackupRequest.

		System.out.println("testVerifyInfo");
		try
		{
			BackupRequest req = new BackupRequest(null, null);
			BackupManager mgr = new BackupManager(req);
		}
		catch(NullPointerException e)
		{
			System.out.println(e);
			return;
		}
		catch(BackupException be)
		{
			System.out.println(be);
			return;
		}
		fail("Should have got an Exception!");
	
public voidtestBadDomainName()

		System.out.println("testBadDomainName");
		try
		{
			BackupRequest req = new BackupRequest("c:/temp", "");
			BackupManager mgr = new BackupManager(req);
		}
		catch(BackupException be)
		{
			System.out.println(be);
			return;
		}
		fail("Should have got an Exception!");
	
public voidtestBadDomainsDir()

		System.out.println("testBadDomainsDir");
		try
		{
			BackupRequest req = new BackupRequest("w:/foo", "goo");
			BackupManager mgr = new BackupManager(req);
		}
		catch(BackupException be)
		{
			System.out.println(be);
			return;
		}
		fail("Should have got an Exception!");
	
public voidtestGoodDomainName()

		System.out.println("testGoodDomainName");
		File f = new File("c:/temp/goo");
		f.mkdirs();
		try
		{
			BackupRequest req = new BackupRequest("c:/temp", "goo");
			BackupManager mgr = new BackupManager(req);
		}
		catch(BackupException be)
		{
			System.out.println(be);
			fail("Should not have got an Exception!");
		}
		finally
		{
			FileUtils.whack(f);
		}
	
public voidtestGoodDomainNameButNotExisting()

		System.out.println("testGoodDomainName");
		try
		{
			File f = new File("c:/temp/goo");
			FileUtils.whack(f);
			BackupRequest req = new BackupRequest("c:/temp", "goo");
			BackupManager mgr = new BackupManager(req);
		}
		catch(BackupException be)
		{
			System.out.println(be);
			return;
		}
		
		fail("Should have got an Exception!");
	
public voidtestGoodDomainsDir()

		System.out.println("testGoodDomainsDir");
		File f = new File("c:/temp/goo");
		f.mkdirs();
		try
		{
			BackupRequest req = new BackupRequest("c:/temp", "goo");
			BackupManager mgr = new BackupManager(req);
		}
		catch(BackupException be)
		{
			System.out.println(be);
			fail("Should not have got an Exception!");
		}
		finally
		{
			FileUtils.whack(f);
		}