Update of /cvsroot/batchserver/batchserver/test/org/jmonks/batchserver/framework/repository
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19662
Added Files:
RepositoryTest.java
Log Message:
no message
--- NEW FILE: RepositoryTest.java ---
/*
* RepositoryTest.java
* JUnit based test
*
* Created on March 14, 2006, 3:54 PM
*/
package org.jmonks.batchserver.framework.repository;
import junit.framework.*;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.util.Map;
import org.apache.log4j.Logger;
import org.jmonks.batchserver.framework.config.*;
import org.jmonks.batchserver.framework.controller.JobController;
/**
*
* @author w951h8m
*/
public class RepositoryTest extends TestCase
{
public RepositoryTest(String testName)
{
super(testName);
}
protected void setUp() throws Exception
{
}
protected void tearDown() throws Exception
{
}
public static Test suite()
{
TestSuite suite = new TestSuite(RepositoryTest.class);
return suite;
}
/**
* Test to make sure repository cannot be instantiated.
*/
public void testInstantiation()
{
try
{
Repository repository=(Repository)Repository.class.newInstance();
fail("Repository should not be instantiated.");
}
catch(InstantiationException ex)
{
/**
* This is expected as Repository cannot be instantiated.
*/
}
catch(IllegalAccessException ex)
{
/**
* This is expected as the constructor of Repository is protected.
*/
}
}
/**
* Test to make sure this is not returning null.
*/
public void testGetRepository()
{
FrameworkConfig frameworkConfig=FrameworkConfig.getInstance();
assertNotNull(frameworkConfig);
FrameworkConfig.RepositoryConfig repositoryConfig=frameworkConfig.getRepositoryConfig();
assertNotNull(repositoryConfig);
Repository repository=Repository.getRepository(repositoryConfig);
assertNotNull(repository);
}
}
|