Update of /cvsroot/batchserver/batchserver/test/org/jmonks/batchserver/framework
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv25929
Modified Files:
FrameworkTestSuite.java
Added Files:
RepositoryTest.java
Log Message:
no message
Index: FrameworkTestSuite.java
===================================================================
RCS file: /cvsroot/batchserver/batchserver/test/org/jmonks/batchserver/framework/FrameworkTestSuite.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** FrameworkTestSuite.java 13 Sep 2006 04:51:14 -0000 1.9
--- FrameworkTestSuite.java 13 Sep 2006 23:30:46 -0000 1.10
***************
*** 19,23 ****
import org.jmonks.batchserver.framework.config.JobControllerConfigTest;
import org.jmonks.batchserver.framework.config.PoolJobControllerConfigTest;
! import org.jmonks.batchserver.framework.repository.RepositoryTest;
import org.jmonks.batchserver.framework.repository.db4o.Db4oRepositoryTest;
import org.jmonks.batchserver.framework.util.JdbcConnectionHelperTest;
--- 19,23 ----
import org.jmonks.batchserver.framework.config.JobControllerConfigTest;
import org.jmonks.batchserver.framework.config.PoolJobControllerConfigTest;
! import org.jmonks.batchserver.framework.RepositoryTest;
import org.jmonks.batchserver.framework.repository.db4o.Db4oRepositoryTest;
import org.jmonks.batchserver.framework.util.JdbcConnectionHelperTest;
--- NEW FILE: RepositoryTest.java ---
/*
* RepositoryTest.java
* JUnit based test
*
* Created on September 12, 2006, 10:16 PM
*/
package org.jmonks.batchserver.framework;
import junit.framework.*;
import org.jmonks.batchserver.framework.config.*;
/**
*
* @author Suresh Pragada
*/
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();
suite.addTest(new RepositoryTest("testInstantiation"));
suite.addTest(new RepositoryTest("testCreateReport"));
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.
*/
}
}
public void testCreateReport()
{
FrameworkConfig.RepositoryConfig repositoryConfig=FrameworkConfig.getInstance().getRepositoryConfig();
if(repositoryConfig!=null)
{
Repository.createRepository("process_file_abc", repositoryConfig);
try
{
Repository.createRepository("process_file_abc", repositoryConfig);
fail("No shout when trying to create the repository second time.");
}
catch(IllegalStateException exception)
{
}
}
else
{
try
{
Repository.createRepository("process_file_abc", null);
fail("Repository has been created with no repository config.");
}
catch(ConfigurationException exception)
{
}
}
}
}
|