Java Doc for FileEnterpriseFeederTest.java in  » ERP-CRM-Financial » Kuali-Financial-System » org » kuali » module » gl » batch » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » ERP CRM Financial » Kuali Financial System » org.kuali.module.gl.batch 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


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.


Field Summary
final public static  intNUM_TEST_FILE_SETS
    
final public static  intORIGIN_ENTRY_TEXT_LINE_LENGTH
    
final public static  StringTEST_FILE_PREFIX
    


Method Summary
protected  voidassertDoneFilesDeleted(List<Integer> fileSets)
    
protected  voidassertNoExtraDoneFilesExistAndCreateDoneFilesForSets(List<Integer> fileSets)
     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).
protected  voidassertNoExtraTestDoneFilesExistAfterTest()
     Asserts true if no test done files exist.
protected  voidassertOriginEntriesLoaded(List<String> expectedEntries, OriginEntryGroup groupOfLoadedEntries)
     Fails if the origin entries in the list do not match the origin entries associated with the passed in group.
protected  List<String>buildVerificationEntries(List<Integer> fileSets, OriginEntryGroup group)
    
protected  voidcheckNecessaryFilesPresentAndReadable()
    
protected  voidcheckNotOnProduction()
    
protected  StringconvertIntToString(int value)
    
protected  StringgenerateDataFilename(int fileSetId)
    
protected  StringgenerateDoneFilename(int fileSetId)
    
protected  StringgenerateReconFilename(int fileSetId)
    
protected  OriginEntryGroupgetGroupCreatedByFeed()
     Returns the origin entry group created by the enterprise feed process and does some basic assertions against it.
protected  voidinitializeDatabaseForTest()
    
protected  booleanisFilesetLoadable(int fileSetId)
    
protected  voidsetUp()
     Sets up the proper file names needed for the test.
final public  voidtestBadReconFileSet()
    
final public  voidtestDataFileMissing()
    
final public  voidtestNoDoneFiles()
     Tests to ensure that the feeder will not feed upon anything if no done files exist.
final public  voidtestOneOkFileSet()
    
final public  voidtestOneOkOneBadFileSet()
    

Field Detail
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)





Method Detail
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



Fields inherited from org.kuali.module.gl.OriginEntryTestBase
protected static Object[] FLEXIBLE_CLAIM_ON_CASH_BANK_ENABLED_FLAG(Code)(Java Doc)
protected static Object[] FLEXIBLE_OFFSET_ENABLED_FLAG(Code)(Java Doc)
protected Date date(Code)(Java Doc)
protected ConfigurableDateService dateTimeService(Code)(Java Doc)
protected KualiConfigurationService kualiConfigurationService(Code)(Java Doc)
protected OriginEntryDao originEntryDao(Code)(Java Doc)
protected OriginEntryGroupService originEntryGroupService(Code)(Java Doc)
protected OriginEntryService originEntryService(Code)(Java Doc)
protected PersistenceService persistenceService(Code)(Java Doc)
protected UnitTestSqlDao unitTestSqlDao(Code)(Java Doc)

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)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.