com.fatwire.gst.foundation.test
Class CSTest

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by com.fatwire.gst.foundation.test.CSTest
All Implemented Interfaces:
junit.framework.Test

public abstract class CSTest
extends junit.framework.TestCase

NOTE July 6, 2010: The following instructions are not rigorously tested but the class works.

JUnit test base class that allows AssetAPI and limited ICS usage in the absence of the ContentServer web container.

Using this class, it is possible to test the DAO layer without requiring deployment to the web container.

To set up, follow the following instructions:

  1. mount the shared filesystem on your local machine in the same path that it is mounted on on the application server
  2. mount (or copy) the Content Server home folder onto your local file system. It is probably not a bad idea to mount it in the same place that it is mounted on the application server. TODO: verify
  3. add the path to futuretense.ini to your classpath (this is the home folder described above)
  4. add a system property for cs.installDir, and set it to the of the Content Server home folder
  5. add a property file called "datasource.properties" to your classpath that contains the following properties, set to the appropriate values for the purposes of setting up a JDBCDataSource (you can probably get these from your application server administrator: username, password, driverClassName, url, maxActive, maxIdle)
This effectively sets up a local copy of Content Server without a servlet context. Some operations that require the execution of a JSP element and related items will fail when using ICS, but core DB operations should succeed. The ICS object's cache is not reliable in this configuration, however, and writes to the database will not be noticed on the main server. An ICS object is available, protected, and as well SessionFactory.getSession(ics) operates per usual.


Field Summary
protected  COM.FutureTense.Interfaces.ICS ics
           
 
Constructor Summary
CSTest()
           
CSTest(String name)
           
 
Method Summary
 Properties readProperties(String name)
           
protected  void setUp()
           
protected  void tearDown()
           
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame, format
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ics

protected COM.FutureTense.Interfaces.ICS ics
Constructor Detail

CSTest

public CSTest()

CSTest

public CSTest(String name)
Method Detail

tearDown

protected void tearDown()
                 throws Exception
Overrides:
tearDown in class junit.framework.TestCase
Throws:
Exception

readProperties

public Properties readProperties(String name)
                          throws IOException
Throws:
IOException

setUp

protected void setUp()
              throws Exception
Overrides:
setUp in class junit.framework.TestCase
Throws:
Exception


Copyright © 2010-2013 Oracle Corporation. All Rights Reserved.