| org.kuali.module.gl.OriginEntryTestBase org.kuali.module.gl.batch.FileEnterpriseFeederTest
FileEnterpriseFeederTest | public class FileEnterpriseFeederTest extends OriginEntryTestBase (Code) | | This class tests the enterprise feeder service. The concept of a file set is pervasive throughout this test. A file set consists
of:
- an ID value, starting at 1. The next file set is identified with 2, and so on. NOTE: when the ID value is used in a filename
(see below), it is left-padded with zero's to make it 3 characters long (e.g. 001, 002, 010, 865).
- a data file, this file will be named entp_test_file_.data
- a reconciliation file, this file will be named entp_test_file.recon .
The IDs are left-padded so that they can be properly sorted by file name, so that files may be fed in a predictable order. For
each particular test case in the code, a list of file sets IDs are selected to be tested. The done files will be generated for
each of the selected file set IDs before the feeder is invoked, and they should hopefully be deleted by the feeder. Dependencies:
- there are file set in the enterprise feeder staging directory (injected via Spring) that are necessary for the feeder to be
tested correctly
- the staging directory may contain data and reconciliation files not related to this test, but they may NOT include done
files. Having done files will result in TEST FAILURE
- if any file sets are added and/or modified, then the method
FileEnterpriseFeederTest.isFilesetValid(int) must be
modified, if necessary.
- The files for all file sets must be in the directory configured for use by the enterprise feeder step bean. Running the
dist-local target in build.xml should place the files in the external configuration directory, or they can be copied from
build/externalConfigDirectory/static/staging/GL . See the entp_test_file_readme.txt file for more information about the file
sets.
|
NUM_TEST_FILE_SETS | final public static int NUM_TEST_FILE_SETS(Code) | | |
ORIGIN_ENTRY_TEXT_LINE_LENGTH | final public static int ORIGIN_ENTRY_TEXT_LINE_LENGTH(Code) | | |
TEST_FILE_PREFIX | final public static String TEST_FILE_PREFIX(Code) | | |
assertDoneFilesDeleted | protected void assertDoneFilesDeleted(List<Integer> fileSets) throws IOException(Code) | | Asserts that there are no longer any existing .done files
Parameters: fileSets - a List of file sets to check .done files for throws: IOException - thrown if one of the files cannot be read for any reason |
assertNoExtraDoneFilesExistAndCreateDoneFilesForSets | protected void assertNoExtraDoneFilesExistAndCreateDoneFilesForSets(List<Integer> fileSets) throws IOException(Code) | | This method asserts that there doesn't exist any done files in the enterprise feeder directory that do not begin with
DONE_FILE_PREFIX (see constants definition in this class). If there are files that begin w/ that prefix in the directory,
they are deleted. After checking/ deleting done files, it will then create a done files listed in the fileSets parameter.
Parameters: fileSets - A list of Integers, representing the done files that will be created. (see class description) to see howthese integers map into file names. throws: IOException - if a file cannot be successfully read |
assertNoExtraTestDoneFilesExistAfterTest | protected void assertNoExtraTestDoneFilesExistAfterTest() throws IOException(Code) | | Asserts true if no test done files exist. If so, method removes done files before assert.
throws: IOException - thrown if a data file cannot be successfully read |
assertOriginEntriesLoaded | protected void assertOriginEntriesLoaded(List<String> expectedEntries, OriginEntryGroup groupOfLoadedEntries)(Code) | | Fails if the origin entries in the list do not match the origin entries associated with the passed in group.
Parameters: expectedEntries - the entries that were the expected output of the enterprise feed process Parameters: groupOfLoadedEntries - the entries that were really the output of the enterprise feed process |
buildVerificationEntries | protected List<String> buildVerificationEntries(List<Integer> fileSets, OriginEntryGroup group) throws IOException(Code) | | Converts the entries generated by the enterprise feed to String-formatted entries
Parameters: fileSets - the file sets to convert entries for Parameters: group - not used as such a List of String-formatted generated origin entries throws: IOException - thrown if one of the data files cannot be read successfully |
checkNecessaryFilesPresentAndReadable | protected void checkNecessaryFilesPresentAndReadable()(Code) | | Makes sure that the data files for this test exist; if not, throws an exception
|
checkNotOnProduction | protected void checkNotOnProduction()(Code) | | Throws an exception if running on production
|
convertIntToString | protected String convertIntToString(int value)(Code) | | Zero pads an integer to be at least 3 digits long
Parameters: value - an integer value a left zero padded String |
generateDataFilename | protected String generateDataFilename(int fileSetId)(Code) | | Generates the full path and file name of a generated enterprise feed data file
Parameters: fileSetId - the integer id of the file that should have been generated the full path and file name for the file |
generateDoneFilename | protected String generateDoneFilename(int fileSetId)(Code) | | Generates the full path and file name of a generated enterprise feed .done file
Parameters: fileSetId - the integer id of the file that should have been generated the full path and file name for the file |
generateReconFilename | protected String generateReconFilename(int fileSetId)(Code) | | Generates the full path and file name of a generated enterprise feed reconciliation file
Parameters: fileSetId - the integer id of the file that should have been generated the full path and file name for the file |
getGroupCreatedByFeed | protected OriginEntryGroup getGroupCreatedByFeed()(Code) | | Returns the origin entry group created by the enterprise feed process and does some
basic assertions against it.
the OriginEntryGroup created by the enterprise feed process |
initializeDatabaseForTest | protected void initializeDatabaseForTest()(Code) | | Clears out the origin entry and origin entry group tables to prepare for the test
|
isFilesetLoadable | protected boolean isFilesetLoadable(int fileSetId)(Code) | | Determines whether the files in a set are able to be loaded because of the lack of parse errors and the lack of
reconciliation errors
Parameters: fileSetId - the integer id of the file set true if it can be loaded, false otherwise |
setUp | protected void setUp() throws Exception(Code) | | Sets up the proper file names needed for the test.
See Also: junit.framework.TestCase.setUp |
testBadReconFileSet | final public void testBadReconFileSet() throws Exception(Code) | | Tests that the enterprise feeder will successfully run, even when fed a bad reconciliation file
throws: Exception - |
testDataFileMissing | final public void testDataFileMissing() throws Exception(Code) | | Tests that the enterprise feeder will successfully run, even when there's a missing data file
throws: Exception - thrown if anything goes wrong |
testNoDoneFiles | final public void testNoDoneFiles() throws Exception(Code) | | Tests to ensure that the feeder will not feed upon anything if no done files exist.
throws: Exception - thrown if some vague thing goes wrong |
testOneOkFileSet | final public void testOneOkFileSet() throws Exception(Code) | | This method tests that the uploading of a single OK file set
throws: Exception - thrown if some vague thing goes wrong |
testOneOkOneBadFileSet | final public void testOneOkOneBadFileSet() throws Exception(Code) | | Tests the uploading of two files, one parsable, the other not
throws: Exception - thrown if anything goes wrong |
Methods inherited from org.kuali.module.gl.OriginEntryTestBase | protected void assertOriginEntries(int groupCount, EntryHolder[] requiredEntries)(Code)(Java Doc) protected void clearEncumbranceTable()(Code)(Java Doc) protected void clearExpenditureTable()(Code)(Java Doc) protected void clearGlAccountBalanceTable()(Code)(Java Doc) protected void clearGlBalanceTable()(Code)(Java Doc) protected void clearGlEntryTable(String fin_coa_cd, String account_nbr)(Code)(Java Doc) protected void clearOriginEntryTables()(Code)(Java Doc) protected void clearReversalTable()(Code)(Java Doc) protected void clearSufficientFundBalanceTable()(Code)(Java Doc) protected int getGroup(List groups, String groupCode)(Code)(Java Doc) protected void loadInputTransactions(String groupCode, String[] transactions, Date date)(Code)(Java Doc) protected void loadInputTransactions(String groupCode, String[] transactions)(Code)(Java Doc) protected void loadTransactions(String[] transactions, OriginEntryGroup group)(Code)(Java Doc) protected void resetAllEnhancementFlags() throws Exception(Code)(Java Doc) protected void setApplicationConfigurationFlag(Class componentClass, String name, boolean value) throws Exception(Code)(Java Doc) protected void setUp() throws Exception(Code)(Java Doc) protected void trace(Object o, int tabIndentCount)(Code)(Java Doc) protected void traceList(List list, String name)(Code)(Java Doc)
|
|
|