parse_decision 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +17 -0
- data/.rspec +2 -0
- data/Gemfile +6 -0
- data/LICENSE +22 -0
- data/README.md +71 -0
- data/bin/parse_decision +126 -0
- data/lib/parse_decision/config.rb +90 -0
- data/lib/parse_decision/controller.rb +142 -0
- data/lib/parse_decision/parsedecisiontask.rb +31 -0
- data/lib/parse_decision/parser.rb +194 -0
- data/lib/parse_decision/pd_context.rb +148 -0
- data/lib/parse_decision/plugin/application.rb +48 -0
- data/lib/parse_decision/plugin/plugin.rb +56 -0
- data/lib/parse_decision/plugin/ppm_xpath.rb +70 -0
- data/lib/parse_decision/plugin/pre_decision_guideline.rb +177 -0
- data/lib/parse_decision/plugin/product.rb +176 -0
- data/lib/parse_decision/plugin/product_xpath.rb +52 -0
- data/lib/parse_decision/plugin/web_product.rb +179 -0
- data/lib/parse_decision/plugin.rb +50 -0
- data/lib/parse_decision/version.rb +5 -0
- data/lib/parse_decision.rb +59 -0
- data/parse_decision.gemspec +27 -0
- data/rakefile.rb +58 -0
- data/spec/context_spec.rb +21 -0
- data/spec/data/multiproduct.decision.txt +1481 -0
- data/spec/data/prod.decision.txt +3957 -0
- data/spec/data/reference/multiproduct/001-APP.xml +1 -0
- data/spec/data/reference/multiproduct/001-Mod-Forbear-PRODUCT.xml +357 -0
- data/spec/data/reference/multiproduct/001-Mod-Forgive-PRODUCT.xml +361 -0
- data/spec/data/reference/multiproduct/001-Mod-RateTerm-PRODUCT.xml +353 -0
- data/spec/data/reference/multiproduct/001-Mod-SAM-PRODUCT.xml +365 -0
- data/spec/data/reference/product/001-APP.xml +1 -0
- data/spec/data/reference/product/001-Validation-Rules.xml +536 -0
- data/spec/data/reference/product/002-APP.xml +1 -0
- data/spec/data/reference/product/002-FAPIILoanModification-PRODUCT.xml +1770 -0
- data/spec/data/reference/web/001-APP.xml +1 -0
- data/spec/data/reference/web/001-Product01-PRODUCT.xml +1088 -0
- data/spec/data/reference/web/002-APP.xml +1 -0
- data/spec/data/reference/web/002-Product01-PRODUCT.xml +15 -0
- data/spec/data/reference/workflow/001-APP.xml +1 -0
- data/spec/data/reference/workflow/001-WF-DataClearing-Pre-Rules.xml +37 -0
- data/spec/data/reference/workflow-2/001-APP.xml +1 -0
- data/spec/data/reference/workflow-2/001-WF-ProdSel-Post-Rules.xml +699 -0
- data/spec/data/test.rb +13 -0
- data/spec/data/validation.decision.txt +1199 -0
- data/spec/data/web.decision.txt +1128 -0
- data/spec/data/wf.decision.txt +43 -0
- data/spec/data/wf2.decision.txt +705 -0
- data/spec/parser_spec.rb +308 -0
- data/spec/plugin_app_spec.rb +40 -0
- data/spec/plugin_ppmxpath_spec.rb +74 -0
- data/spec/plugin_predecision_spec.rb +81 -0
- data/spec/plugin_product_spec.rb +117 -0
- data/spec/plugin_productxpath_spec.rb +76 -0
- data/spec/plugin_spec.rb +54 -0
- data/spec/spec_helper.rb +81 -0
- data/test/data/2.2.decision-multiple.txt +1391 -0
- data/test/data/2.2.decision.txt +1128 -0
- data/test/data/2.decision.txt +1481 -0
- data/test/plugins/test_plugin_predecisionguideline.rb +120 -0
- data/test/plugins/test_plugin_product.rb +120 -0
- data/test/test_config.rb +90 -0
- data/test/test_context.rb +103 -0
- data/test/test_parse_webdecision.rb +121 -0
- data/test/test_parser.rb +69 -0
- data/test/test_parser_parse.rb +110 -0
- metadata +225 -0
@@ -0,0 +1,110 @@
|
|
1
|
+
##############################################################################
|
2
|
+
# File:: test_parser_parse.rb
|
3
|
+
# Purpose:: Test ParseDecision::Parser.parse functionality
|
4
|
+
#
|
5
|
+
# Author:: Jeff McAffee 03/12/2010
|
6
|
+
# Copyright:: Copyright (c) 2010, kTech Systems LLC. All rights reserved.
|
7
|
+
# Website:: http://ktechsystems.com
|
8
|
+
##############################################################################
|
9
|
+
|
10
|
+
require 'test/unit' #(1)
|
11
|
+
require 'flexmock/test_unit'
|
12
|
+
#require 'testhelper/filecomparer'
|
13
|
+
require 'logger'
|
14
|
+
|
15
|
+
require 'fileutils'
|
16
|
+
|
17
|
+
require 'parse_decision'
|
18
|
+
|
19
|
+
class TestParserParse < Test::Unit::TestCase #(3)
|
20
|
+
include FileUtils
|
21
|
+
include FlexMock::TestCase
|
22
|
+
include ParseDecision
|
23
|
+
|
24
|
+
#-------------------------------------------------------------------------------------------------------------#
|
25
|
+
# setup - Set up test fixture
|
26
|
+
#
|
27
|
+
#------------------------------------------------------------------------------------------------------------#
|
28
|
+
def setup
|
29
|
+
$LOG = Logger.new(STDERR)
|
30
|
+
$LOG.level = Logger::DEBUG
|
31
|
+
@baseDir = File.dirname(__FILE__)
|
32
|
+
@dataDir = File.join(@baseDir, "data")
|
33
|
+
@outputDir = File.join(@dataDir, "output")
|
34
|
+
|
35
|
+
end
|
36
|
+
|
37
|
+
#-------------------------------------------------------------------------------------------------------------#
|
38
|
+
# teardown - Clean up test fixture
|
39
|
+
#
|
40
|
+
#------------------------------------------------------------------------------------------------------------#
|
41
|
+
def teardown
|
42
|
+
end
|
43
|
+
|
44
|
+
#-------------------------------------------------------------------------------------------------------------#
|
45
|
+
# cleanOutput - Clean up output directory
|
46
|
+
#
|
47
|
+
#------------------------------------------------------------------------------------------------------------#
|
48
|
+
def cleanOutput
|
49
|
+
if(!File.exists?(@outputDir))
|
50
|
+
FileUtils.mkdir(@outputDir)
|
51
|
+
return
|
52
|
+
end
|
53
|
+
|
54
|
+
if(File.directory?(@outputDir))
|
55
|
+
FileUtils.rm_r(@outputDir)
|
56
|
+
FileUtils.mkdir(@outputDir)
|
57
|
+
end
|
58
|
+
|
59
|
+
|
60
|
+
end
|
61
|
+
|
62
|
+
#-------------------------------------------------------------------------------------------------------------#
|
63
|
+
# test_parsedecision_parse - Test the parseFile function
|
64
|
+
#
|
65
|
+
#------------------------------------------------------------------------------------------------------------#
|
66
|
+
def DUPtest_parsedecision_parse
|
67
|
+
target = Parser.new
|
68
|
+
assert(nil != target)
|
69
|
+
|
70
|
+
fname = "2.decision.txt"
|
71
|
+
srcFile = File.join(@dataDir, fname)
|
72
|
+
assert(File.exists?(srcFile))
|
73
|
+
|
74
|
+
target.parseFile(srcFile)
|
75
|
+
end
|
76
|
+
|
77
|
+
#-------------------------------------------------------------------------------------------------------------#
|
78
|
+
# test_parsedecision_parse - Test the parseFile function
|
79
|
+
#
|
80
|
+
#------------------------------------------------------------------------------------------------------------#
|
81
|
+
def test_parsedecision_parse
|
82
|
+
target = Parser.new
|
83
|
+
assert(nil != target)
|
84
|
+
|
85
|
+
fname = "2.decision.txt"
|
86
|
+
srcFile = File.join(@dataDir, fname)
|
87
|
+
assert(File.exists?(srcFile))
|
88
|
+
|
89
|
+
cleanOutput()
|
90
|
+
|
91
|
+
target.setOutdir(@outputDir)
|
92
|
+
target.parseFile(srcFile)
|
93
|
+
|
94
|
+
assert(File.exists?(File.join(@outputDir, "01-APP.xml")))
|
95
|
+
assert(File.exists?(File.join(@outputDir, "01-Mod-Forbear-PRODUCT.xml")))
|
96
|
+
assert(File.exists?(File.join(@outputDir, "01-Mod-Forgive-PRODUCT.xml")))
|
97
|
+
assert(File.exists?(File.join(@outputDir, "01-Mod-RateTerm-PRODUCT.xml")))
|
98
|
+
assert(File.exists?(File.join(@outputDir, "01-Mod-SAM-PRODUCT.xml")))
|
99
|
+
end
|
100
|
+
|
101
|
+
#-------------------------------------------------------------------------------------------------------------#
|
102
|
+
# test_parsedecision_does_something
|
103
|
+
#
|
104
|
+
#------------------------------------------------------------------------------------------------------------#
|
105
|
+
def test_parsedecision_does_something
|
106
|
+
|
107
|
+
end
|
108
|
+
|
109
|
+
|
110
|
+
end # TestParserParse
|
metadata
ADDED
@@ -0,0 +1,225 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: parse_decision
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.5
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Jeff McAffee
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-08-13 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.3'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.3'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec-given
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: pry
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: ktcommon
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
description: AMS Decision Log Parser
|
84
|
+
email:
|
85
|
+
- jeff@ktechsystems.com
|
86
|
+
executables:
|
87
|
+
- parse_decision
|
88
|
+
extensions: []
|
89
|
+
extra_rdoc_files: []
|
90
|
+
files:
|
91
|
+
- ".gitignore"
|
92
|
+
- ".rspec"
|
93
|
+
- Gemfile
|
94
|
+
- LICENSE
|
95
|
+
- README.md
|
96
|
+
- bin/parse_decision
|
97
|
+
- lib/parse_decision.rb
|
98
|
+
- lib/parse_decision/config.rb
|
99
|
+
- lib/parse_decision/controller.rb
|
100
|
+
- lib/parse_decision/parsedecisiontask.rb
|
101
|
+
- lib/parse_decision/parser.rb
|
102
|
+
- lib/parse_decision/pd_context.rb
|
103
|
+
- lib/parse_decision/plugin.rb
|
104
|
+
- lib/parse_decision/plugin/application.rb
|
105
|
+
- lib/parse_decision/plugin/plugin.rb
|
106
|
+
- lib/parse_decision/plugin/ppm_xpath.rb
|
107
|
+
- lib/parse_decision/plugin/pre_decision_guideline.rb
|
108
|
+
- lib/parse_decision/plugin/product.rb
|
109
|
+
- lib/parse_decision/plugin/product_xpath.rb
|
110
|
+
- lib/parse_decision/plugin/web_product.rb
|
111
|
+
- lib/parse_decision/version.rb
|
112
|
+
- parse_decision.gemspec
|
113
|
+
- rakefile.rb
|
114
|
+
- spec/context_spec.rb
|
115
|
+
- spec/data/multiproduct.decision.txt
|
116
|
+
- spec/data/prod.decision.txt
|
117
|
+
- spec/data/reference/multiproduct/001-APP.xml
|
118
|
+
- spec/data/reference/multiproduct/001-Mod-Forbear-PRODUCT.xml
|
119
|
+
- spec/data/reference/multiproduct/001-Mod-Forgive-PRODUCT.xml
|
120
|
+
- spec/data/reference/multiproduct/001-Mod-RateTerm-PRODUCT.xml
|
121
|
+
- spec/data/reference/multiproduct/001-Mod-SAM-PRODUCT.xml
|
122
|
+
- spec/data/reference/product/001-APP.xml
|
123
|
+
- spec/data/reference/product/001-Validation-Rules.xml
|
124
|
+
- spec/data/reference/product/002-APP.xml
|
125
|
+
- spec/data/reference/product/002-FAPIILoanModification-PRODUCT.xml
|
126
|
+
- spec/data/reference/web/001-APP.xml
|
127
|
+
- spec/data/reference/web/001-Product01-PRODUCT.xml
|
128
|
+
- spec/data/reference/web/002-APP.xml
|
129
|
+
- spec/data/reference/web/002-Product01-PRODUCT.xml
|
130
|
+
- spec/data/reference/workflow-2/001-APP.xml
|
131
|
+
- spec/data/reference/workflow-2/001-WF-ProdSel-Post-Rules.xml
|
132
|
+
- spec/data/reference/workflow/001-APP.xml
|
133
|
+
- spec/data/reference/workflow/001-WF-DataClearing-Pre-Rules.xml
|
134
|
+
- spec/data/test.rb
|
135
|
+
- spec/data/validation.decision.txt
|
136
|
+
- spec/data/web.decision.txt
|
137
|
+
- spec/data/wf.decision.txt
|
138
|
+
- spec/data/wf2.decision.txt
|
139
|
+
- spec/parser_spec.rb
|
140
|
+
- spec/plugin_app_spec.rb
|
141
|
+
- spec/plugin_ppmxpath_spec.rb
|
142
|
+
- spec/plugin_predecision_spec.rb
|
143
|
+
- spec/plugin_product_spec.rb
|
144
|
+
- spec/plugin_productxpath_spec.rb
|
145
|
+
- spec/plugin_spec.rb
|
146
|
+
- spec/spec_helper.rb
|
147
|
+
- test/data/2.2.decision-multiple.txt
|
148
|
+
- test/data/2.2.decision.txt
|
149
|
+
- test/data/2.decision.txt
|
150
|
+
- test/plugins/test_plugin_predecisionguideline.rb
|
151
|
+
- test/plugins/test_plugin_product.rb
|
152
|
+
- test/test_config.rb
|
153
|
+
- test/test_context.rb
|
154
|
+
- test/test_parse_webdecision.rb
|
155
|
+
- test/test_parser.rb
|
156
|
+
- test/test_parser_parse.rb
|
157
|
+
homepage: https://github.com/jmcaffee/parse_decision
|
158
|
+
licenses:
|
159
|
+
- MIT
|
160
|
+
metadata: {}
|
161
|
+
post_install_message:
|
162
|
+
rdoc_options: []
|
163
|
+
require_paths:
|
164
|
+
- lib
|
165
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
166
|
+
requirements:
|
167
|
+
- - ">="
|
168
|
+
- !ruby/object:Gem::Version
|
169
|
+
version: '0'
|
170
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
171
|
+
requirements:
|
172
|
+
- - ">="
|
173
|
+
- !ruby/object:Gem::Version
|
174
|
+
version: '0'
|
175
|
+
requirements: []
|
176
|
+
rubyforge_project:
|
177
|
+
rubygems_version: 2.3.0
|
178
|
+
signing_key:
|
179
|
+
specification_version: 4
|
180
|
+
summary: AMS Decision Log Parser
|
181
|
+
test_files:
|
182
|
+
- spec/context_spec.rb
|
183
|
+
- spec/data/multiproduct.decision.txt
|
184
|
+
- spec/data/prod.decision.txt
|
185
|
+
- spec/data/reference/multiproduct/001-APP.xml
|
186
|
+
- spec/data/reference/multiproduct/001-Mod-Forbear-PRODUCT.xml
|
187
|
+
- spec/data/reference/multiproduct/001-Mod-Forgive-PRODUCT.xml
|
188
|
+
- spec/data/reference/multiproduct/001-Mod-RateTerm-PRODUCT.xml
|
189
|
+
- spec/data/reference/multiproduct/001-Mod-SAM-PRODUCT.xml
|
190
|
+
- spec/data/reference/product/001-APP.xml
|
191
|
+
- spec/data/reference/product/001-Validation-Rules.xml
|
192
|
+
- spec/data/reference/product/002-APP.xml
|
193
|
+
- spec/data/reference/product/002-FAPIILoanModification-PRODUCT.xml
|
194
|
+
- spec/data/reference/web/001-APP.xml
|
195
|
+
- spec/data/reference/web/001-Product01-PRODUCT.xml
|
196
|
+
- spec/data/reference/web/002-APP.xml
|
197
|
+
- spec/data/reference/web/002-Product01-PRODUCT.xml
|
198
|
+
- spec/data/reference/workflow-2/001-APP.xml
|
199
|
+
- spec/data/reference/workflow-2/001-WF-ProdSel-Post-Rules.xml
|
200
|
+
- spec/data/reference/workflow/001-APP.xml
|
201
|
+
- spec/data/reference/workflow/001-WF-DataClearing-Pre-Rules.xml
|
202
|
+
- spec/data/test.rb
|
203
|
+
- spec/data/validation.decision.txt
|
204
|
+
- spec/data/web.decision.txt
|
205
|
+
- spec/data/wf.decision.txt
|
206
|
+
- spec/data/wf2.decision.txt
|
207
|
+
- spec/parser_spec.rb
|
208
|
+
- spec/plugin_app_spec.rb
|
209
|
+
- spec/plugin_ppmxpath_spec.rb
|
210
|
+
- spec/plugin_predecision_spec.rb
|
211
|
+
- spec/plugin_product_spec.rb
|
212
|
+
- spec/plugin_productxpath_spec.rb
|
213
|
+
- spec/plugin_spec.rb
|
214
|
+
- spec/spec_helper.rb
|
215
|
+
- test/data/2.2.decision-multiple.txt
|
216
|
+
- test/data/2.2.decision.txt
|
217
|
+
- test/data/2.decision.txt
|
218
|
+
- test/plugins/test_plugin_predecisionguideline.rb
|
219
|
+
- test/plugins/test_plugin_product.rb
|
220
|
+
- test/test_config.rb
|
221
|
+
- test/test_context.rb
|
222
|
+
- test/test_parse_webdecision.rb
|
223
|
+
- test/test_parser.rb
|
224
|
+
- test/test_parser_parse.rb
|
225
|
+
has_rdoc:
|