summaryrefslogtreecommitdiffstats
path: root/feature-pooling-dmaap/src/test/java/org
AgeCommit message (Collapse)AuthorFilesLines
2020-11-02Make feature-pooling-dmaap work without filteringJim Hahn22-1742/+89
As DMaaP server-side filtering has been deprecated, modified feature-pooling-dmaap to work without it. The new design assumes that each pdp gets its own unique consumer group, thus all pdps receive all events. Each pdp then uses the bucket assignments to determine whether or not to process the event. Note: this means that events no longer have to be forwarded to the correct host, thus the "Forward" class has been deleted. Other than that, the code already did post-filtering of events so most of it still works even without server-side filtering. As a result, most of the effort was in simply removing code that no longer applies. Per review comments: Modified code to use the event hash code instead of the request ID has code when routing events. This eliminated the need for the extractor classes and related properties. Replaced amsterdam and beijing properties with usecases properties. Issue-ID: POLICY-2881 Change-Id: I87e4f98c14f419593879c278d7da053c80575553 Signed-off-by: Jim Hahn <jrh3@att.com>
2020-09-30Fix new sonars in drools-pdpJim Hahn1-59/+46
Addressed the following sonar issues: - extract common test method - too many assertions in test method - don't always return the same value Issue-ID: POLICY-2616 Change-Id: Iab836cdcd667b35e2db9db7d6ffc7896df33e1c8 Signed-off-by: Jim Hahn <jrh3@att.com>
2020-08-25Address more sonars in drools-pdpJim Hahn4-9/+22
Addressed the following sonars: - either log or rethrow - call "remove()" for thread-local-storage - use assertEquals - only one method call in exception test - swap arguments in assertEquals - add assertion to assertThatThrownBy() - explain @Ignore Also addressed eclipse warnings: - unused fields and methods Issue-ID: POLICY-2616 Change-Id: I6590c0d2b103885bc933014d48bf5fd92401cd80 Signed-off-by: Jim Hahn <jrh3@att.com>
2020-07-06Use apache TripleHAHN III3-26/+26
Replaced policy-utils/Triple with apache Triple. Issue-ID: POLICY-2694 Change-Id: I160f90c03f18b7da8dec5d0a00f809bcfb29680b Signed-off-by: Jim Hahn <jrh3@att.com>
2020-06-29Clean up of Pair classes - drools-pdpwaynedunican7-165/+149
Removed Pair class from drools-pdp and replaced with Apache Common Pair class Issue-ID: POLICY-2202 Change-Id: Ica2a5b734fb6eebfc0713027c1c4dc3b8d3882c8 Signed-off-by: waynedunican <wayne.dunican@est.tech>
2020-06-19Address checkstyle version issues in drools-pdpJim Hahn3-54/+53
Also added serializationId to several classes to address eclipse warnings. Issue-ID: POLICY-2188 Change-Id: I3df5e8abaad8da9261c0d5cd19a93ed68dceb870 Signed-off-by: Jim Hahn <jrh3@att.com>
2020-06-16Merge "reduce sonar issue - 2 rev"Liam Fallon2-17/+19
2020-06-15reduce sonar issue - 2 revTaka Cho2-17/+19
In some conditions for assertTrue, sonarcloud recommends using assertEquals Assert.assertTrue(a.equals(b)); Assert.assertTrue(a == b); Assert.assertTrue(a == null); Assert.assertTrue(a != null); Assert.assertFalse(a.equals(b)); Compliant Solution Assert.assertEquals(a, b); Assert.assertSame(a, b); Assert.assertNull(a); Assert.assertNotNull(a); Assert.assertNotEquals(a, b); Issue-ID: POLICY-2616 Change-Id: Ib362573bd865d1b561916bf64640c8ddeaa02546 Signed-off-by: Taka Cho <takamune.cho@att.com>
2020-06-10reduce sonar issue - drools-pdpTaka Cho1-1/+2
remove unused import rename the method name Issue-ID: POLICY-2616 Change-Id: I15845159063ec5fa3cfb34a59b9c433ba3201ccc Signed-off-by: Taka Cho <takamune.cho@att.com>
2020-04-06Address sonar issues in drools-pdpJim Hahn6-62/+58
Addressed the following sonar issues: - add "final" to public static fields - commented code; some were bogus - just updated the comments so sonar is happy - use "{}" instead of string concatenation - junit should assert something - when using logger, invoke compute-intensive tasks conditionally - use superclass name instead of subclass name to access static fields - don't always return the same value - remove "transient" from fields of classes that aren't Serializable - don't nest try/catch blocks - use appropriate class name in Logger.getLogger() - use Predicate<T> instead of Function<T,Boolean> - remove unused parameters from private methods - either log or throw - remove duplicate methods - use remove() TLS instead of set(null) - null check is implicit in instanceof check - do something with return value - don't use volatile - don't return "null" list; used Optional instead - add no-arg constructor to non-Serializable superclass - add callSuper=true for EqualsAndHashCode - don't declare "throws XXX" where XXX is a subclass of RuntimeException - remove serialVersionUID field if the class isn't Serializable Also addressed some eclipse warnings: - unused fields - suppress generic typic cast warnings Issue-ID: POLICY-2305 Change-Id: I906d5bf71c1f86531423e23b3667a585cdba45e1 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-11-08Miscellaneous code clean upjhh4-15/+14
Issue-ID: POLICY-2203 Signed-off-by: jhh <jorge.hernandez-herrero@att.com> Change-Id: I5731d4636bd2aaecbc486406298bcba1b19e8f4d Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
2019-07-08Fix drools-pdp due to sonar changes in commonJim Hahn1-5/+7
Fixed breakages due to changes made in policy/common to satisfy sonar. Change-Id: I26a38340707b2903e089350c31c5dfdb5c019ee0 Issue-ID: POLICY-1791 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-02-22Add getEffectiveTopic method to pooling testJim Hahn1-0/+5
A new method, getEffectiveTopic(), was added to the Topic interface. A test class in the pooling feature uses that interface, thus the method had to be added to the implementation within that test class. Note: until this is merged, drools-pdp will not build. Change-Id: Ib82e7a0d23f5b8e8eda08e8fc570e96543497da2 Issue-ID: POLICY-1534 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-01-16Remove jackson from feature-pooling-dmaapJim Hahn4-43/+42
Modified code to use gson instead of jackson. Change-Id: I5a1b2dacdc1801b1110154ed7c3c81e0713ef369 Issue-ID: POLICY-1431 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-01-08Replace expectException with AssertJJim Hahn2-70/+15
Change-Id: I5c9c5e962a7e2a5617405d534c0719f4bdb6ff1c Issue-ID: POLICY-1393 Signed-off-by: Jim Hahn <jrh3@att.com>
2018-11-29Remove Factory from various drools-pdp classesJim Hahn5-362/+456
Also merged changes from 'Rename test classes in drools-pdp'. Change-Id: I4d0a3a1b0b5523eadf38d1edb5aa86c404b69d19 Issue-ID: POLICY-1288 Signed-off-by: Jim Hahn <jrh3@att.com>
2018-11-28Rename test classes in drools-pdpParshad Patel18-23/+24
Make test classes name consistence Issue-ID: POLICY-1281 Change-Id: I9632831dd36b1d362aeadfb53fda600762c835ca Signed-off-by: Parshad Patel <pars.patel@samsung.com>
2018-10-02Add junit coverage to drools-pdpJim Hahn1-2/+2
Added coverage to distributed locking. Added coverage to test-transaction - still more to do. Added coverage to healthcheck - still more to do. Also fixed "code smell" in pooling. Also fixed "code smell" in session persistence. Fixed typo in comment. Removed unneeded setUp() method from test. Fixed new checkstyle errors. Fixed another new checkstyle error. Change-Id: I0d2ab13fcbd64486af88affb02e114e624c6a3d1 Issue-ID: POLICY-1148 Signed-off-by: Jim Hahn <jrh3@att.com>
2018-09-13Fix checkstyle for features submodules.Pamela Dragosh29-123/+255
These are the remaining submodules that have checkstyle. Pretty clean compile after this. There were a couple of sonar fixes in there also. Issue-ID: POLICY-882 Change-Id: I8191ea1aa261f4a7b9d3d21c108572fd31db1b8c Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2018-07-30Copy policy-endpoints from drools-pdp to commonmmis1-13/+9
Issue-ID: POLICY-967 Change-Id: Ib19d3a89ffa328c39f7871bff59efb3dd1617f7a Signed-off-by: mmis <michael.morris@ericsson.com>
2018-07-25Copy policy-endpoints from drools-pdp to commonmmis6-73/+69
Removed policy-endpoints, and 3 classes from policy-core. Replaced refenences to the deleted classes with references to the corresponding classes in policy-common Issue-ID: POLICY-967 Change-Id: I547cde4894424b8f40b7ddd4e2342ebb729cb588 Signed-off-by: mmis <michael.morris@ericsson.com>
2018-07-13Don't stop controller on dmaap failureJim Hahn7-351/+69
Modified feature-pooling-dmaap so that it continues to work even if it's unable to communicate with the internal DMaaP topic. When that happens, it simply starts processing locally, until communication is re-established and it receives a bucket assignment. Fixed typo in comment. Added to comment for State.internalTopicFailed(). Removed extra space before @Ignore. Change-Id: I9c851c66c9162c608f2df98e11d49fc526539434 Issue-ID: POLICY-878 Signed-off-by: Jim Hahn <jrh3@att.com>
2018-06-20Merge "Remove references to SpecPropertyConfiguration"Pamela Dragosh4-242/+40
2018-06-19Remove references to SpecPropertyConfigurationJim Hahn4-242/+40
Change-Id: Ib4779611f124277cf8be2b3eddfe41bf69dfd74b Issue-ID: POLICY-907 Signed-off-by: Jim Hahn <jrh3@att.com>
2018-06-18Fix fortify issue with pooling extractor classJim Hahn4-12/+11
The pooling extractor class was using reflection to extract values from private fields. It has been modified to only extract from public fields or to use public getXxx() methods instead. Change-Id: I3aafe9ebfcd41d0e71dc3529030597609b704f53 Issue-ID: POLICY-906 Signed-off-by: Jim Hahn <jrh3@att.com>
2018-05-09Discard Forward to wrong hostJim Hahn3-1/+11
Changed to discard Forward message if the channel does not match the host that received it. Change-Id: I9235bd3b0c5eb264f9b1cfe53552fadf66a0edc2 Issue-ID: POLICY-787 Signed-off-by: Jim Hahn <jrh3@att.com>
2018-05-04Fix various problems in poolingJim Hahn10-171/+64
Renamed META-INF SessionAPI to EngineAPI, as it implements the latter. Created default PoolingFeature.factory object. Don't delete a controller's pooling manager when stop is called; do that in afterHalt and afterShutdown. This enables it to be restarted as long as the controller still exists. Only stop & start the internal DMaaP topic at the engine level instead of the controller level. This is necessary to prevent sinks for ALL controllers from being started each time an individual controller starts. Clear all bucket assignments when controller is stopped. Mark test methods with @Override annotation. Add default property file for pooling feature. Add license to default property file. Remove tests for doDeleteManager(), as it no longer exists. Changed " = " to "=" in the property file. Change-Id: I80c0c3f1879b5a320044db93e3dfa3b7281cda51 Issue-ID: POLICY-774 Signed-off-by: Jim Hahn <jrh3@att.com>
2018-04-21Sonar fixes for latest pooling codeJim Hahn5-12/+60
Made changes to pooling code to address new sonar issues. Add comments to awaitActive() methods. Change-Id: I390173de00135a0a5fe50af82ed4ba780df9df80 Issue-ID: POLICY-728 Signed-off-by: Jim Hahn <jrh3@att.com>
2018-04-20Add comprehensive junit tests for pooling featureJim Hahn13-262/+1036
Added FeatureTest.java and FeatureTest2.java. Fixed a number of issues that were identified via the above tests. Moved fixes of policy-endpoints to other JIRA tickets. Resolved potential sonar issue with commented-out code by making STD_XXX constants into plain variables to they could be changed via a method call. Changed stdEventWaitMs to stdEventWaitSec. Change-Id: Icf8fcc9b0dfe2578aa0787e0c9224a6f76a068ee Issue-ID: POLICY-748 Signed-off-by: Jim Hahn <jrh3@att.com>
2018-04-16Sonar fixes to poolingJim Hahn19-498/+1750
Made various changes to the pooling feature to address some of the sonar issues. Remove duplicate classes, Pair & Triple. Fix sonar issue about duplicate process(xxx) methods. Remove extra items from pom.xml and add assembly builder. Fix license text in pom.xml, inadvertently reformatted. Fix a few typos in comments and change LinkedList to Queue. Move assembly.xml to correct source directory. Replace ScheduledFuture<?> with CancellableScheduledTask, to satisfy sonar. Eliminate "TODO" items: add logging, delay after sending Offline message. Add more logging in process(Message) methods. Begin creating end-to-end junit test, fixed bugs found as a result. Restore logback-test.xml to WARN. Fix merge conflict - restored test properties file. Change-Id: Ic70a8cee49678ea0fc3da309699aec1f6088fe70 Issue-ID: POLICY-728 Signed-off-by: Jim Hahn <jrh3@att.com>
2018-03-28Add pooling capabilityJim Hahn38-0/+7650
Add an optional feature that that supports session pooling, wherein more than one host can be active at a time. Use beforeInsert() instead of beforeOffer(), where possible. Move request-id-extraction from policy-managment to feature-pooling. Combined AdditionalProperties into PoolingProperties. Finished junit tests for DmaapManager. Adjusted filters for all XxxState classes, and added testGetFilter to all XxxStateTest classes. Always publish Offline message when the internal topic fails. Remove DelayedExtractor, as it isn't needed. Renamed ExtractorMap to ClassExtractors, and added property name prefix to the constructor to give more control over property naming to invokers. Remove State copy constructor. Use class name instead of class in ClassExtractors map. Remove BucketAssignments from ProcessingState. Remove some TODO items. Add META-INF for implemented feature APIs. Fix ClassExtractor bug where it can't find a field in a superclass, and add a test for classes defined in another file. Add assembly and rename project directory. Add more junit coverage. Change-Id: I7f132f84a7b284a58ab09c9069db19b853acd7e9 Issue-ID: POLICY-577 Signed-off-by: Jim Hahn <jrh3@att.com>