summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Ritchie <ritchiem@apache.org>2007-04-24 09:01:58 +0000
committerMartin Ritchie <ritchiem@apache.org>2007-04-24 09:01:58 +0000
commitd026ee76c093fe93afe15053d099e6ecc68a64ff (patch)
tree680eb55a44c95e76b9c51240c33b69641ad6de08
parent53605c52439daacf4a0d96a6bf4e9c95a7425b76 (diff)
downloadqpid-python-d026ee76c093fe93afe15053d099e6ecc68a64ff.tar.gz
Merged revisions 1-447993,447995-448007,448009-448141,448143-448157,448161-448194,448196-448210,448212-448218,448220-448223,448225-448233,448235,448237-448241,448243-448596,448598-448623,448625-448850,448852-448880,448882-448982,448984-449635,449637-449639,449641-449642,449644-449645,449647-449674,449676-449719,449721-449749,449751-449762,449764-449933,449935-449941,449943-450383,450385,450387-450400,450402-450433,450435-450503,450505-450555,450557-450860,450862-451024,451026-451149,451151-451316,451318-451931,451933-452139,452141-452162,452164-452320,452322,452324-452325,452327-452333,452335-452429,452431-452528,452530-452545,452547-453192,453194-453195,453197-453536,453538,453540-453656,453658-454676,454678-454735,454737,454739-454781,454783-462728,462730-462819,462821-462833,462835-462839,462841-463071,463073-463178,463180-463308,463310-463362,463364-463375,463377-463396,463398-463402,463404-463409,463411-463661,463663-463670,463672-463673,463675-464493,464495-464502,464504-464576,464578-464613,464615-464628,464630,464632-464866,464868-464899,464901-464942,464944-464949,464951-465004,465006-465016,465018-465053,465055-465165,465167-465321,465323-465406,465408-465427,465429-465431,465433-465548,465550-466044,466047-466075,466077,466079-466081,466083-466099,466101-466112,466114-466126,466128-466240,466242-466971,466973-466978,466980-467309,467311-467312,467316-467328,467330-467485,467487-467588,467590-467604,467606-467699,467701-467706,467708-467749,467751-468069,468071-468537,468539-469241,469244-469246,469248-469318,469320-469421,469423,469425-469429,469431-469435,469437-469462,469464-469469,469472-469477,469479-469490,469492-469503,469505-469529,469531-469598,469600-469624,469626-469737,469739-469752,469754-469806,469808-469928,469930-469953,469955-470011,470013-470109,470111-470335,470338-470339,470341-470379,470381,470383-470399,470401-470446,470448-470741,470743-470758,470760-470809,470811-470817,470819-470993,470995-471001,471003-471788,471790-471792,471794-472028,472030-472032,472034-472036,472038,472040,472043,472045-472059,472061,472063,472065-472066,472068,472070-472072,472074-472080,472082,472084-472092,472094-472107,472109-472123,472125-472158,472160-472165,472167-472172,472174-472457,472459-472460,472462-472464,472466-472470,472472-472483,472486-472491,472493-472494,472496-472497,472499,472501-472503,472505-472512,472514-472544,472546-472556,472558-472560,472562-472572,472574-472587,472589-472591,472593-472605,472607,472609-472731,472733-472786,472788-472843,472845-472849,472851-472859,472861-472878,472880-472903,472905,472907-472988,472990-472991,472993-473071,473073-473086,473088-473090,473093,473095-473096,473098-473106,473108-473110,473112-473185,473187-473260,473262,473268-473270,473275-473279,473281,473284-473287,473289-473295,473297-473306,473308-473330,473332-473335,473337,473339-473344,473346-473351,473353-473355,473357-473358,473361-473471,473473-473497,473499-473535,473537-473567,473569-473888,473890-474451,474454-474492,474494-474563,474565-474843,474845-474865,474867-474932,474934-475035,475037-475144,475146-475180,475182-475265,475267-475285,475287,475289-475293,475295-475296,475298-475302,475304-475631,475633-475649,475651-475748,475750-475752,475754-476107,476109-476302,476304-476413,476415-476430,476432-476700,476702-476868,476870-477147,477149-477213,477215-477263,477265-477340,477342-477635,477637-477789,477791-477825,477827-477841,477843,477846-477852,477854,477856,477858-477865,477867-477894,477896-478022,478024-478182,478184-478211,478213-478233,478235-478236,478238-478241,478243-478252,478254-478259,478261-478263,478265,478267-478269,478271-478286,478288-478342,478344-478379,478381-478412,478414-478443,478445-478636,478639-478658,478660-478821,478823-478853,478855-478922,478924-478962,478965-478974,478976-479029,479031-479049,479051-479210,479212-479214,479216-479407,479409-479415,479417-479425,479427-479559,479561-479639,479641-479676,479678-479685,479687-480030,480033-480086,480091-480093,480095-480118,480120-480139,480141,480143-480148,480150-480156,480158-480163,480165-480177,480179-480189,480191-480193,480195-480198,480200-480220,480222-480282,480284-480292,480294-480308,480310-480317,480320-480422,480424,480426-480581,480583-480656,480658-480692,480695-480702,480704,480706-480710,480712-480910,480913-480933,480935-480945,480947-480972,480974-480993,480995-481034,481036-481158,481161-481174,481176-481220,481222-481234,481236-481260,481263-481264,481266-481296,481298-481304,481306-481311,481313-481332,481334,481336-481380,481382-481441,481443-482144,482146-482180,482182-482193,482195-482232,482234-482236,482239,482241-482242,482244-482247,482250-482251,482253,482256-482261,482264-482288,482290-482364,482366,482368,482370-482554,482556,482558-482569,482572-482636,482638,482640-482696,482698-482722,482724-482732,482734-482771,482774-482957,482959-483045,483047-483105,483108,483110-483115,483117,483119-483127,483130-483134,483136-483148,483150-483158,483160-483164,483166-483178,483180-483391,483393-483400,483402-483403,483405-483418,483420-483421,483425-483436,483438-483470,483472-483502,483504-483558,483560-483599,483601-483637,483639-483644,483646-483659,483661-483670,483672-483878,483880-483910,483912-483915,483917-483940,483942,483944-483968,483970-483972,483974-483976,483978,483980-484612,484614-484657,484659-484693,484695-484718,484720-484842,484844-484847,484849-484986,484988-485019,485021-485489,485491-485544,485546-485591,485593,485595-485697,485699-485729,485731-485734,485736-485779,485781-485787,485789-485851,485853,485855-486007,486009,486011-486020,486022-486083,486085-486097,486099-486117,486120-486131,486133-486148,486150-486161,486163-486164,486166-486197,486199-486205,486208-486247,486249-486253,486256-486427,486429-486431,486433-486554,486556-486573,486575-486593,486595,486597-486609,486611-486619,486622,486625,486627-486641,486643-486645,486649-486687,486689-486721,486723-486730,486732-486746,486748-486759,486761,486763-486777,486779-486782,486784-486788,486790,486792,486794-486796,486798-487175,487178,487180-487213,487215,487217-487267,487269-487284,487286-487298,487300-487358,487360-487367,487369-487382,487384-487434,487436-487480,487482-487547,487549-487561,487563-487565,487567-487578,487580-487615,487617-487622,487624,487626,487628,487630-487635,487637-487703,487705-487777,487780-487781,487783-487800,487802-487803,487805-487820,487822-487848,487850-487902,487904-488103,488105-488133,488135-488158,488160-488163,488165-488187,488189-488216,488218-488248,488250-488278,488280,488282-488303,488305-488313,488315-488342,488344-488351,488353-488376,488378-488449,488451-488593,488595,488597-488623,488625-488700,488702-488704,488706-488710,488714,488716-488725,488727-488744,488746-488770,488772-488798,488800,488802-488807,488809,488811-488829,488831-488843,488845-488851,488853-489069,489071-489077,489079-489081,489084-489102,489104-489105,489107-489109,489111-489112,489114-489139,489141-489178,489181-489203,489205-489211,489213,489216-489329,489332-489402,489404-489417,489419-489421,489423-489643,489645-489690,489692-489703,489705-489714,489716-489747,489749-489753,489755-489803,489805-489904,489906-490372,490374-490504,490506-490604,490606-490707,490710-490733,490735-490871,490873-490984,490986-491028,491030,491032-491071,491073-491119,491121-491576,491578-491672,491674-491800,491802-491838,491840-491878,491880-492183,492185-492279,492281-492317,492319-492513,492515-492584,492586-492587,492589-492601,492603-492635,492637-492640,492642-492717,492719-492723,492725-492729,492731-492755,492757-492901,492903-492955,492957-492962,492964-492997,492999-493002,493004-493041,493043-493059,493062-493063,493065-493086,493088-493125,493127-493139,493141-493150,493152-493871,493873-494017,494019-494030,494032-494041,494043-494091,494093-494120,494122-494354,494356-494436,494438-494539,494541-494552,494554-494586,494588-494649,494651,494653-494654,494656-494657,494659-494764,494766-494768,494770-494796,494798-494799,494802,494804-494860,494862-494903,494905-494906,494908-495019,495021-495160,495162-495168,495171-495188,495190-495229,495231-495254,495256-495303,495305-495313,495315-495336,495338-495372,495374-495379,495381-495454,495457-495459,495462-495516,495518-495524,495526-495531,495533-495548,495551-495553,495555,495557-495558,495560,495562-495573,495575-495583,495585-495594,495596-495628,495630-495638,495640-495651,495653-495660,495662-495753,495755-496259,496261-496262,496264-496269,496271-496275,496277-496301,496303-496316,496318-496383,496385-496413,496415-496495,496497-496625,496627-496636,496638-496640,496642-496647,496650-496657,496659-496660,496663-496664,496666-496677,496679-496681,496683-496730,496732-496750,496752,496754-496784,496786-496832,496834-496840,496842-496990,496992-496995,496997-497340,497343-497351,497353-497403,497405-497424,497426-497438,497440-497481,497483-497497,497499-497765,497767-497769,497771-497775,497777-497778,497780,497782-497783,497785,497787-497812,497814-497871,497873-497877,497879-498573,498575-498588,498590,498592,498594-498636,498638-498669,498671-498686,498688-498689,498691-498719,498721-498964,498966-498969,498971-498973,498975-498982,498985-499035,499037-499040,499042,499044-499048,499050-499082,499084-499086,499088-499164,499167-499169,499171-499355,499357-499370,499372-499373,499375-499391,499393,499395-499425,499428,499430-499445,499447-499455,499457-499460,499462-499465,499467,499469-499489,499491-499492,499494-499531,499533-499562,499566-499627,499629-499715,499717-499732,499734-499755,499758-499763,499765-499780,499782-499795,499797-499802,499804-499844,499846,499848-499850,499852-499863,499865-499873,499875-499974,499976-499978,499980-500263,500265-500283,500285-500309,500311-501000,501002,501012-501057,501059-501095,501097-501390,501392-501410,501413-501447,501449-501454,501456,501458-501464,501466-501471,501473-501803,501805-501913,501915-501916,501918-501919,501921-501944,501946-502171,502173-502177,502181,502183-502247,502250-502252,502254-502260,502262-502267,502270,502272,502274-502575,502577-502609,502611-502619,502621-502626,502628-502654,502656-503592,503594-503603,503605-503608,503610-503636,503638-503645,503647-503705,503707-503789,503791-504024,504026-504111,504113-504506,504508-504735,504737-504863,504865-504867,504869-504914,504916-505241,505243-505254,505257-505267,505269-505354,505356-505891,505893-505971,505973-506400,506402-506404,506407-506438,506440-506516,506518-506541,506543-506966,506968-506971,506973-507095,507097-507108,507111-507454,507456,507459-507471,507473-507556,507558,507560-507581,507585-507594,507597,507599-507608,507610-507728,507730-507893,507895-507937,507940-508234,508236-508350,508352-508365,508367-508380,508383,508386-508415,508417-508648,508650-508941,508943-509146,509148-509171,509173-509175,509179-509201,509203-509207,509209-509215,509217-509222,509224-509477,509480-509627,509629-509634,509636-509641,509643-509736,509738-509931,509933-510059,510061-510075,510077-510158,510161-510896,510898-510938,510940-511388,511390-511922,511924-512287,512289-512698,512702-512813,512815-512817,512819-513359,513361-513370,513372-514702,514704-514886,514888-514902,514904-515126,515129-515141,515143-515516,515518-515534,515536-515538,515540-515648,515650-515651,515653-516070,516072-516411,516413-516448,516450,516452-517637,517639-517647,517649-517659,517661-517663,517665-517677,517679-517682,517684-517744,517746-518085,518087-518175,518177-518558,518560-518568,518571-518666,518668,518670-518699,518701-518987,518990-518992,518994-519908,519910-519932,519934-520414,520416-520842,520844-520937,520939-521362,521364-521681,521683-521704,521706-521709,521711-521714,521716-521781,521783-521792,521794-522462,522464-522527,522529-522534,522536-522566,522568-522958,522960,522962-522966,522968-522976,522978-522980,522982-522988,522992-522993,522995-523244,523246-523746,523748-524049,524051-524738,524741-524742,524744-524762,524764,524766,524768-525486,525488-525530,525532,525534,525537-525552,525554-525765,525767-525776,525778-525784,525789-525803,525805-525816,525818-525828,525830-525861,525863-525866,525868-526090,526092-526112,526114-526116,526119-526121,526123-526149,526151-526153,526155-526156,526160-526165,526167-526186,526188-526193,526196-526197,526200-526665,526667-526682,526686-526690,526693,526695-526708,526710-526713,526715-526775,526777-526802,526804-526806,526808-527048,527051-527052,527054-527181,527183-527486,527488-527492,527494-527498,527500-527508,527510-527517,527519-527536,527538-527555,527559-527802,527804-527842,527844-527847,527849-527875,527877-527940,527942-527958,527960-527971,527973-528002,528004,528006-528423,528425-529232,529234-529245,529247-529296,529298-529634,529636-529658,529660-529665,529667-529668,529670-530033,530035-530036,530038-530040,530045-530046,530050-530051,530053-530431,530433-530436,530439-530440,530443,530445-530446,530448,530450-530682,530684,530687-530696,530698-530733,530735-530776,530778-530795,530799,530801-530811,530813-530818,530820-531832 via svnmerge from
https://svn.apache.org/repos/asf/incubator/qpid/branches/M2 ........ r530838 | ritchiem | 2007-04-20 17:03:10 +0100 (Fri, 20 Apr 2007) | 2 lines Added addition log when broker is ready to process. Updated HeapExhaustion - to use system.out.println so you can set amqj.logging.level=warn to speed up test. ........ r531437 | rgreig | 2007-04-23 12:23:39 +0100 (Mon, 23 Apr 2007) | 1 line QPID-394. Removed revision tags. ........ r531456 | bhupendrab | 2007-04-23 13:58:24 +0100 (Mon, 23 Apr 2007) | 1 line QPID-470 : Catching the security exception for users, which have no access to management console ........ r531458 | bhupendrab | 2007-04-23 14:13:28 +0100 (Mon, 23 Apr 2007) | 1 line QPID-445 : Fixed the ClassCastException ........ r531512 | ritchiem | 2007-04-23 16:52:43 +0100 (Mon, 23 Apr 2007) | 3 lines QPID-472 - Creation of TemporaryQueues will not guarantee unique queue names if created rapidly. Updated TemporaryQueueTest.java so that it checks Headers/Queue/Topic for unroutable/mandatory messages beig returned. ........ r531513 | ritchiem | 2007-04-23 16:54:15 +0100 (Mon, 23 Apr 2007) | 1 line QPID-436 - topic exchange doesn't obey the mandatory flag ........ r531515 | ritchiem | 2007-04-23 16:58:04 +0100 (Mon, 23 Apr 2007) | 2 lines Update to system test so that the run as part of the build process as they were not running. Change to AMQMessage to ensure that the TxAckTest passes. Was failing as the reference count was being changed out of the increment/decrementReference methods ........ r531517 | ritchiem | 2007-04-23 16:59:59 +0100 (Mon, 23 Apr 2007) | 1 line Comment updates on the origin of the tests ........ r531518 | ritchiem | 2007-04-23 17:02:41 +0100 (Mon, 23 Apr 2007) | 1 line White Space changes ........ r531524 | bhupendrab | 2007-04-23 17:28:00 +0100 (Mon, 23 Apr 2007) | 1 line QPID-445 ........ r531526 | ritchiem | 2007-04-23 17:38:24 +0100 (Mon, 23 Apr 2007) | 3 lines QPID-290 - Java broker does not honor maximum number of channels threshold Applied patch from Nuno Santos ........ r531527 | ritchiem | 2007-04-23 17:38:44 +0100 (Mon, 23 Apr 2007) | 1 line ResetMessageListenerTest - needs to have IMMEDIATE_PREFETCH = true. ........ git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@531842 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--java/broker/src/main/java/org/apache/qpid/server/Main.java10
-rw-r--r--java/broker/src/main/java/org/apache/qpid/server/exchange/DestWildExchange.java47
-rw-r--r--java/broker/src/main/java/org/apache/qpid/server/filter/ArithmeticExpression.java267
-rw-r--r--java/broker/src/main/java/org/apache/qpid/server/filter/BinaryExpression.java41
-rw-r--r--java/broker/src/main/java/org/apache/qpid/server/filter/BooleanExpression.java7
-rw-r--r--java/broker/src/main/java/org/apache/qpid/server/filter/ComparisonExpression.java131
-rw-r--r--java/broker/src/main/java/org/apache/qpid/server/filter/Expression.java7
-rw-r--r--java/broker/src/main/java/org/apache/qpid/server/filter/LogicExpression.java104
-rw-r--r--java/broker/src/main/java/org/apache/qpid/server/management/MBeanInvocationHandlerImpl.java50
-rw-r--r--java/broker/src/main/java/org/apache/qpid/server/protocol/AMQMinaProtocolSession.java15
-rw-r--r--java/broker/src/main/java/org/apache/qpid/server/queue/AMQMessage.java2
-rw-r--r--java/broker/src/main/java/org/apache/qpid/server/queue/AMQQueue.java2
-rw-r--r--java/broker/src/main/java/org/apache/qpid/server/security/access/UserManagement.java4
-rw-r--r--java/broker/src/test/java/org/apache/qpid/server/queue/AMQQueueAlertTest.java4
-rw-r--r--java/client/src/main/java/org/apache/qpid/client/AMQSession.java2
-rw-r--r--java/client/src/main/java/org/apache/qpid/client/AMQTemporaryQueue.java19
-rw-r--r--java/client/src/test/java/org/apache/qpid/client/ResetMessageListenerTest.java23
-rw-r--r--java/client/src/test/java/org/apache/qpid/test/unit/client/temporaryqueue/TemporaryQueueTest.java135
-rw-r--r--java/client/src/test/java/org/apache/qpid/test/unit/close/MessageRequeueTest.java4
-rw-r--r--java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/Constants.java6
-rw-r--r--java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/actions/AbstractAction.java58
-rw-r--r--java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/actions/AddServer.java26
-rw-r--r--java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/actions/CloseConnection.java31
-rw-r--r--java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/actions/EditAttribute.java28
-rw-r--r--java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/actions/ReconnectServer.java32
-rw-r--r--java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/actions/Refresh.java15
-rw-r--r--java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/actions/RemoveServer.java25
-rw-r--r--java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/jmx/MBeanUtility.java8
-rw-r--r--java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/AttributesTabControl.java3
-rw-r--r--java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/MBeanTypeTabControl.java6
-rw-r--r--java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/NavigationView.java77
-rw-r--r--java/systests/pom.xml4
-rw-r--r--java/systests/src/main/java/org/apache/qpid/server/ack/TxAckTest.java22
-rw-r--r--java/systests/src/main/java/org/apache/qpid/server/channel/MaxChannelsTest.java75
-rw-r--r--java/systests/src/main/java/org/apache/qpid/server/exchange/ReturnUnroutableMandatoryMessageTest.java140
-rw-r--r--java/systests/src/main/java/org/apache/qpid/server/failure/HeapExhaustion.java6
-rw-r--r--java/systests/src/main/java/org/apache/qpid/server/queue/ConcurrencyTestDisabled.java (renamed from java/systests/src/main/java/org/apache/qpid/server/queue/ConcurrencyTest.java)6
-rw-r--r--java/systests/src/main/java/org/apache/qpid/server/queue/MessageTestHelper.java3
-rw-r--r--java/systests/src/main/java/org/apache/qpid/server/queue/PersistentTestManual.java (renamed from java/systests/src/main/java/org/apache/qpid/server/queue/PersistentTest.java)10
-rw-r--r--java/systests/src/main/java/org/apache/qpid/test/VMTestCase.java5
-rw-r--r--java/systests/src/main/java/org/apache/qpid/test/client/QueueBrowserTest.java6
41 files changed, 933 insertions, 533 deletions
diff --git a/java/broker/src/main/java/org/apache/qpid/server/Main.java b/java/broker/src/main/java/org/apache/qpid/server/Main.java
index 1e5f56fe3a..c345b43aeb 100644
--- a/java/broker/src/main/java/org/apache/qpid/server/Main.java
+++ b/java/broker/src/main/java/org/apache/qpid/server/Main.java
@@ -373,6 +373,7 @@ public class Main
}
acceptor.bind(bindAddress, handler, sconfig);
+ //fixme qpid.AMQP should be using qpidproperties to get value
_brokerLogger.info("Qpid.AMQP listening on non-SSL address " + bindAddress);
}
@@ -381,14 +382,21 @@ public class Main
AMQPFastProtocolHandler handler = new AMQPProtocolProvider().getHandler();
try
{
- acceptor.bind(new InetSocketAddress(connectorConfig.sslPort), handler, sconfig);
+
+ acceptor.bind(new InetSocketAddress(connectorConfig.sslPort), handler, sconfig);
+ //fixme qpid.AMQP should be using qpidproperties to get value
_brokerLogger.info("Qpid.AMQP listening on SSL port " + connectorConfig.sslPort);
+
}
catch (IOException e)
{
_brokerLogger.error("Unable to listen on SSL port: " + e, e);
}
}
+
+ //fixme qpid.AMQP should be using qpidproperties to get value
+ _brokerLogger.info("Qpid Broker Ready :" + QpidProperties.getReleaseVersion()
+ + " build: " + QpidProperties.getBuildVersion());
}
catch (Exception e)
{
diff --git a/java/broker/src/main/java/org/apache/qpid/server/exchange/DestWildExchange.java b/java/broker/src/main/java/org/apache/qpid/server/exchange/DestWildExchange.java
index 8a50e93bf9..605a4bcb61 100644
--- a/java/broker/src/main/java/org/apache/qpid/server/exchange/DestWildExchange.java
+++ b/java/broker/src/main/java/org/apache/qpid/server/exchange/DestWildExchange.java
@@ -57,19 +57,16 @@ public class DestWildExchange extends AbstractExchange
private ConcurrentHashMap<AMQShortString, List<AMQQueue>> _routingKey2queues = new ConcurrentHashMap<AMQShortString, List<AMQQueue>>();
- /**
- * DestWildExchangeMBean class implements the management interface for the
- * Topic exchanges.
- */
+ /** DestWildExchangeMBean class implements the management interface for the Topic exchanges. */
@MBeanDescription("Management Bean for Topic Exchange")
private final class DestWildExchangeMBean extends ExchangeMBean
{
// open mbean data types for representing exchange bindings
- private String[] _bindingItemNames = {"Routing Key", "Queue Names"};
- private String[] _bindingItemIndexNames = {_bindingItemNames[0]};
+ private String[] _bindingItemNames = {"Routing Key", "Queue Names"};
+ private String[] _bindingItemIndexNames = {_bindingItemNames[0]};
private OpenType[] _bindingItemTypes = new OpenType[2];
- private CompositeType _bindingDataType = null;
- private TabularType _bindinglistDataType = null;
+ private CompositeType _bindingDataType = null;
+ private TabularType _bindinglistDataType = null;
private TabularDataSupport _bindingList = null;
@MBeanConstructor("Creates an MBean for AMQ topic exchange")
@@ -80,22 +77,18 @@ public class DestWildExchange extends AbstractExchange
init();
}
- /**
- * initialises the OpenType objects.
- */
+ /** initialises the OpenType objects. */
private void init() throws OpenDataException
{
_bindingItemTypes[0] = SimpleType.STRING;
_bindingItemTypes[1] = new ArrayType(1, SimpleType.STRING);
_bindingDataType = new CompositeType("Exchange Binding", "Routing key and Queue names",
- _bindingItemNames, _bindingItemNames, _bindingItemTypes);
+ _bindingItemNames, _bindingItemNames, _bindingItemTypes);
_bindinglistDataType = new TabularType("Exchange Bindings", "Exchange Bindings for " + getName(),
- _bindingDataType, _bindingItemIndexNames);
+ _bindingDataType, _bindingItemIndexNames);
}
- /**
- * returns exchange bindings in tabular form
- */
+ /** returns exchange bindings in tabular form */
public TabularData bindings() throws OpenDataException
{
_bindingList = new TabularDataSupport(_bindinglistDataType);
@@ -122,7 +115,9 @@ public class DestWildExchange extends AbstractExchange
{
AMQQueue queue = getQueueRegistry().getQueue(new AMQShortString(queueName));
if (queue == null)
+ {
throw new JMException("Queue \"" + queueName + "\" is not registered with the exchange.");
+ }
try
{
@@ -159,7 +154,7 @@ public class DestWildExchange extends AbstractExchange
{
queueList.add(queue);
}
- else if(_logger.isDebugEnabled())
+ else if (_logger.isDebugEnabled())
{
_logger.debug("Queue " + queue + " is already registered with routing key " + routingKey);
}
@@ -176,10 +171,18 @@ public class DestWildExchange extends AbstractExchange
// TODO: add support for the immediate flag
if (queues == null)
{
- _logger.warn("No queues found for routing key " + routingKey);
- _logger.warn("Routing map contains: " + _routingKey2queues);
- //todo Check for valid topic - mritchie
- return;
+ if (info.isMandatory())
+ {
+ String msg = "Topic " + routingKey + " is not known to " + this;
+ throw new NoRouteException(msg, payload);
+ }
+ else
+ {
+ _logger.warn("No queues found for routing key " + routingKey);
+ _logger.warn("Routing map contains: " + _routingKey2queues);
+ //todo Check for valid topic - mritchie
+ return;
+ }
}
for (AMQQueue q : queues)
@@ -245,7 +248,7 @@ public class DestWildExchange extends AbstractExchange
}
}
- protected ExchangeMBean createMBean() throws AMQException
+ protected ExchangeMBean createMBean() throws AMQException
{
try
{
diff --git a/java/broker/src/main/java/org/apache/qpid/server/filter/ArithmeticExpression.java b/java/broker/src/main/java/org/apache/qpid/server/filter/ArithmeticExpression.java
index 1b3b116fd0..138d4155b1 100644
--- a/java/broker/src/main/java/org/apache/qpid/server/filter/ArithmeticExpression.java
+++ b/java/broker/src/main/java/org/apache/qpid/server/filter/ArithmeticExpression.java
@@ -1,3 +1,4 @@
+/* Copyright Rupert Smith, 2005 to 2006, all rights reserved. */
/**
*
* Licensed to the Apache Software Foundation (ASF) under one or more
@@ -20,16 +21,14 @@ package org.apache.qpid.server.filter;
// Based on like named file from r450141 of the Apache ActiveMQ project <http://www.activemq.org/site/home.html>
//
-
import org.apache.qpid.AMQException;
import org.apache.qpid.server.queue.AMQMessage;
/**
* An expression which performs an operation on two expression values
- *
- * @version $Revision$
*/
-public abstract class ArithmeticExpression extends BinaryExpression {
+public abstract class ArithmeticExpression extends BinaryExpression
+{
protected static final int INTEGER = 1;
protected static final int LONG = 2;
@@ -39,156 +38,213 @@ public abstract class ArithmeticExpression extends BinaryExpression {
* @param left
* @param right
*/
- public ArithmeticExpression(Expression left, Expression right) {
+ public ArithmeticExpression(Expression left, Expression right)
+ {
super(left, right);
}
- public static Expression createPlus(Expression left, Expression right) {
- return new ArithmeticExpression(left, right) {
- protected Object evaluate(Object lvalue, Object rvalue) {
- if (lvalue instanceof String) {
- String text = (String) lvalue;
- String answer = text + rvalue;
- return answer;
+ public static Expression createPlus(Expression left, Expression right)
+ {
+ return new ArithmeticExpression(left, right)
+ {
+ protected Object evaluate(Object lvalue, Object rvalue)
+ {
+ if (lvalue instanceof String)
+ {
+ String text = (String) lvalue;
+ String answer = text + rvalue;
+
+ return answer;
+ }
+ else if (lvalue instanceof Number)
+ {
+ return plus((Number) lvalue, asNumber(rvalue));
+ }
+
+ throw new RuntimeException("Cannot call plus operation on: " + lvalue + " and: " + rvalue);
}
- else if (lvalue instanceof Number) {
- return plus((Number) lvalue, asNumber(rvalue));
+
+ public String getExpressionSymbol()
+ {
+ return "+";
}
- throw new RuntimeException("Cannot call plus operation on: " + lvalue + " and: " + rvalue);
- }
+ };
+ }
- public String getExpressionSymbol()
+ public static Expression createMinus(Expression left, Expression right)
+ {
+ return new ArithmeticExpression(left, right)
{
- return "+";
- }
- };
- }
+ protected Object evaluate(Object lvalue, Object rvalue)
+ {
+ if (lvalue instanceof Number)
+ {
+ return minus((Number) lvalue, asNumber(rvalue));
+ }
- public static Expression createMinus(Expression left, Expression right) {
- return new ArithmeticExpression(left, right) {
- protected Object evaluate(Object lvalue, Object rvalue) {
- if (lvalue instanceof Number) {
- return minus((Number) lvalue, asNumber(rvalue));
+ throw new RuntimeException("Cannot call minus operation on: " + lvalue + " and: " + rvalue);
}
- throw new RuntimeException("Cannot call minus operation on: " + lvalue + " and: " + rvalue);
- }
- public String getExpressionSymbol() {
- return "-";
- }
- };
+ public String getExpressionSymbol()
+ {
+ return "-";
+ }
+ };
}
- public static Expression createMultiply(Expression left, Expression right) {
- return new ArithmeticExpression(left, right) {
+ public static Expression createMultiply(Expression left, Expression right)
+ {
+ return new ArithmeticExpression(left, right)
+ {
+
+ protected Object evaluate(Object lvalue, Object rvalue)
+ {
+ if (lvalue instanceof Number)
+ {
+ return multiply((Number) lvalue, asNumber(rvalue));
+ }
- protected Object evaluate(Object lvalue, Object rvalue) {
- if (lvalue instanceof Number) {
- return multiply((Number) lvalue, asNumber(rvalue));
+ throw new RuntimeException("Cannot call multiply operation on: " + lvalue + " and: " + rvalue);
}
- throw new RuntimeException("Cannot call multiply operation on: " + lvalue + " and: " + rvalue);
- }
- public String getExpressionSymbol() {
- return "*";
- }
- };
+ public String getExpressionSymbol()
+ {
+ return "*";
+ }
+ };
}
- public static Expression createDivide(Expression left, Expression right) {
- return new ArithmeticExpression(left, right) {
+ public static Expression createDivide(Expression left, Expression right)
+ {
+ return new ArithmeticExpression(left, right)
+ {
- protected Object evaluate(Object lvalue, Object rvalue) {
- if (lvalue instanceof Number) {
- return divide((Number) lvalue, asNumber(rvalue));
+ protected Object evaluate(Object lvalue, Object rvalue)
+ {
+ if (lvalue instanceof Number)
+ {
+ return divide((Number) lvalue, asNumber(rvalue));
+ }
+
+ throw new RuntimeException("Cannot call divide operation on: " + lvalue + " and: " + rvalue);
}
- throw new RuntimeException("Cannot call divide operation on: " + lvalue + " and: " + rvalue);
- }
- public String getExpressionSymbol() {
- return "/";
- }
- };
+ public String getExpressionSymbol()
+ {
+ return "/";
+ }
+ };
}
- public static Expression createMod(Expression left, Expression right) {
- return new ArithmeticExpression(left, right) {
+ public static Expression createMod(Expression left, Expression right)
+ {
+ return new ArithmeticExpression(left, right)
+ {
+
+ protected Object evaluate(Object lvalue, Object rvalue)
+ {
+ if (lvalue instanceof Number)
+ {
+ return mod((Number) lvalue, asNumber(rvalue));
+ }
- protected Object evaluate(Object lvalue, Object rvalue) {
- if (lvalue instanceof Number) {
- return mod((Number) lvalue, asNumber(rvalue));
+ throw new RuntimeException("Cannot call mod operation on: " + lvalue + " and: " + rvalue);
}
- throw new RuntimeException("Cannot call mod operation on: " + lvalue + " and: " + rvalue);
- }
- public String getExpressionSymbol() {
- return "%";
- }
- };
+ public String getExpressionSymbol()
+ {
+ return "%";
+ }
+ };
}
- protected Number plus(Number left, Number right) {
- switch (numberType(left, right)) {
- case INTEGER:
- return new Integer(left.intValue() + right.intValue());
- case LONG:
- return new Long(left.longValue() + right.longValue());
- default:
- return new Double(left.doubleValue() + right.doubleValue());
+ protected Number plus(Number left, Number right)
+ {
+ switch (numberType(left, right))
+ {
+
+ case INTEGER:
+ return new Integer(left.intValue() + right.intValue());
+
+ case LONG:
+ return new Long(left.longValue() + right.longValue());
+
+ default:
+ return new Double(left.doubleValue() + right.doubleValue());
}
}
- protected Number minus(Number left, Number right) {
- switch (numberType(left, right)) {
- case INTEGER:
- return new Integer(left.intValue() - right.intValue());
- case LONG:
- return new Long(left.longValue() - right.longValue());
- default:
- return new Double(left.doubleValue() - right.doubleValue());
+ protected Number minus(Number left, Number right)
+ {
+ switch (numberType(left, right))
+ {
+
+ case INTEGER:
+ return new Integer(left.intValue() - right.intValue());
+
+ case LONG:
+ return new Long(left.longValue() - right.longValue());
+
+ default:
+ return new Double(left.doubleValue() - right.doubleValue());
}
}
- protected Number multiply(Number left, Number right) {
- switch (numberType(left, right)) {
- case INTEGER:
- return new Integer(left.intValue() * right.intValue());
- case LONG:
- return new Long(left.longValue() * right.longValue());
- default:
- return new Double(left.doubleValue() * right.doubleValue());
+ protected Number multiply(Number left, Number right)
+ {
+ switch (numberType(left, right))
+ {
+
+ case INTEGER:
+ return new Integer(left.intValue() * right.intValue());
+
+ case LONG:
+ return new Long(left.longValue() * right.longValue());
+
+ default:
+ return new Double(left.doubleValue() * right.doubleValue());
}
}
- protected Number divide(Number left, Number right) {
+ protected Number divide(Number left, Number right)
+ {
return new Double(left.doubleValue() / right.doubleValue());
}
- protected Number mod(Number left, Number right) {
+ protected Number mod(Number left, Number right)
+ {
return new Double(left.doubleValue() % right.doubleValue());
}
- private int numberType(Number left, Number right) {
- if (isDouble(left) || isDouble(right)) {
+ private int numberType(Number left, Number right)
+ {
+ if (isDouble(left) || isDouble(right))
+ {
return DOUBLE;
}
- else if (left instanceof Long || right instanceof Long) {
+ else if ((left instanceof Long) || (right instanceof Long))
+ {
return LONG;
}
- else {
+ else
+ {
return INTEGER;
}
}
- private boolean isDouble(Number n) {
- return n instanceof Float || n instanceof Double;
+ private boolean isDouble(Number n)
+ {
+ return (n instanceof Float) || (n instanceof Double);
}
- protected Number asNumber(Object value) {
- if (value instanceof Number) {
+ protected Number asNumber(Object value)
+ {
+ if (value instanceof Number)
+ {
return (Number) value;
}
- else {
+ else
+ {
throw new RuntimeException("Cannot convert value: " + value + " into a number");
}
}
@@ -196,22 +252,25 @@ public abstract class ArithmeticExpression extends BinaryExpression {
public Object evaluate(AMQMessage message) throws AMQException
{
Object lvalue = left.evaluate(message);
- if (lvalue == null) {
+ if (lvalue == null)
+ {
return null;
}
+
Object rvalue = right.evaluate(message);
- if (rvalue == null) {
+ if (rvalue == null)
+ {
return null;
}
+
return evaluate(lvalue, rvalue);
}
-
/**
* @param lvalue
* @param rvalue
* @return
*/
- abstract protected Object evaluate(Object lvalue, Object rvalue);
+ protected abstract Object evaluate(Object lvalue, Object rvalue);
}
diff --git a/java/broker/src/main/java/org/apache/qpid/server/filter/BinaryExpression.java b/java/broker/src/main/java/org/apache/qpid/server/filter/BinaryExpression.java
index 4256ab9189..1a1024bd2b 100644
--- a/java/broker/src/main/java/org/apache/qpid/server/filter/BinaryExpression.java
+++ b/java/broker/src/main/java/org/apache/qpid/server/filter/BinaryExpression.java
@@ -1,3 +1,4 @@
+/* Copyright Rupert Smith, 2005 to 2006, all rights reserved. */
/**
*
* Licensed to the Apache Software Foundation (ASF) under one or more
@@ -20,35 +21,35 @@ package org.apache.qpid.server.filter;
// Based on like named file from r450141 of the Apache ActiveMQ project <http://www.activemq.org/site/home.html>
//
-
-
/**
* An expression which performs an operation on two expression values.
- *
- * @version $Revision$
*/
-abstract public class BinaryExpression implements Expression {
+public abstract class BinaryExpression implements Expression
+{
protected Expression left;
protected Expression right;
- public BinaryExpression(Expression left, Expression right) {
+ public BinaryExpression(Expression left, Expression right)
+ {
this.left = left;
this.right = right;
}
- public Expression getLeft() {
+ public Expression getLeft()
+ {
return left;
}
- public Expression getRight() {
+ public Expression getRight()
+ {
return right;
}
-
/**
* @see java.lang.Object#toString()
*/
- public String toString() {
+ public String toString()
+ {
return "(" + left.toString() + " " + getExpressionSymbol() + " " + right.toString() + ")";
}
@@ -57,7 +58,8 @@ abstract public class BinaryExpression implements Expression {
*
* @see java.lang.Object#hashCode()
*/
- public int hashCode() {
+ public int hashCode()
+ {
return toString().hashCode();
}
@@ -66,11 +68,14 @@ abstract public class BinaryExpression implements Expression {
*
* @see java.lang.Object#equals(java.lang.Object)
*/
- public boolean equals(Object o) {
+ public boolean equals(Object o)
+ {
- if (o == null || !this.getClass().equals(o.getClass())) {
+ if ((o == null) || !this.getClass().equals(o.getClass()))
+ {
return false;
}
+
return toString().equals(o.toString());
}
@@ -81,20 +86,22 @@ abstract public class BinaryExpression implements Expression {
*
* @return
*/
- abstract public String getExpressionSymbol();
+ public abstract String getExpressionSymbol();
/**
* @param expression
*/
- public void setRight(Expression expression) {
+ public void setRight(Expression expression)
+ {
right = expression;
}
/**
* @param expression
*/
- public void setLeft(Expression expression) {
+ public void setLeft(Expression expression)
+ {
left = expression;
}
-
+
}
diff --git a/java/broker/src/main/java/org/apache/qpid/server/filter/BooleanExpression.java b/java/broker/src/main/java/org/apache/qpid/server/filter/BooleanExpression.java
index 122527d4f3..0d5c5009f7 100644
--- a/java/broker/src/main/java/org/apache/qpid/server/filter/BooleanExpression.java
+++ b/java/broker/src/main/java/org/apache/qpid/server/filter/BooleanExpression.java
@@ -1,3 +1,4 @@
+/* Copyright Rupert Smith, 2005 to 2006, all rights reserved. */
/**
*
* Licensed to the Apache Software Foundation (ASF) under one or more
@@ -20,18 +21,12 @@ package org.apache.qpid.server.filter;
// Based on like named file from r450141 of the Apache ActiveMQ project <http://www.activemq.org/site/home.html>
//
-
import org.apache.qpid.AMQException;
import org.apache.qpid.server.queue.AMQMessage;
-
-
-
/**
* A BooleanExpression is an expression that always
* produces a Boolean result.
- *
- * @version $Revision$
*/
public interface BooleanExpression extends Expression
{
diff --git a/java/broker/src/main/java/org/apache/qpid/server/filter/ComparisonExpression.java b/java/broker/src/main/java/org/apache/qpid/server/filter/ComparisonExpression.java
index cedb8d7ca8..606a59e0fa 100644
--- a/java/broker/src/main/java/org/apache/qpid/server/filter/ComparisonExpression.java
+++ b/java/broker/src/main/java/org/apache/qpid/server/filter/ComparisonExpression.java
@@ -1,3 +1,4 @@
+/* Copyright Rupert Smith, 2005 to 2006, all rights reserved. */
/*
*
* Licensed to the Apache Software Foundation (ASF) under one
@@ -32,8 +33,6 @@ import org.apache.qpid.server.queue.AMQMessage;
/**
* A filter performing a comparison of two objects
- *
- * @version $Revision$
*/
public abstract class ComparisonExpression extends BinaryExpression implements BooleanExpression
{
@@ -153,7 +152,7 @@ public abstract class ComparisonExpression extends BinaryExpression implements B
{
return
Boolean.FALSE;
- //throw new RuntimeException("LIKE can only operate on String identifiers. LIKE attemped on: '" + rv.getClass());
+ // throw new RuntimeException("LIKE can only operate on String identifiers. LIKE attemped on: '" + rv.getClass());
}
return likePattern.matcher((String) rv).matches() ? Boolean.TRUE : Boolean.FALSE;
@@ -240,42 +239,42 @@ public abstract class ComparisonExpression extends BinaryExpression implements B
private static BooleanExpression doCreateEqual(Expression left, Expression right)
{
return new ComparisonExpression(left, right)
- {
-
- public Object evaluate(AMQMessage message) throws AMQException
{
- Object lv = left.evaluate(message);
- Object rv = right.evaluate(message);
- // Iff one of the values is null
- if ((lv == null) ^ (rv == null))
+ public Object evaluate(AMQMessage message) throws AMQException
{
+ Object lv = left.evaluate(message);
+ Object rv = right.evaluate(message);
+
+ // Iff one of the values is null
+ if ((lv == null) ^ (rv == null))
+ {
+ return Boolean.FALSE;
+ }
+
+ if ((lv == rv) || lv.equals(rv))
+ {
+ return Boolean.TRUE;
+ }
+
+ if ((lv instanceof Comparable) && (rv instanceof Comparable))
+ {
+ return compare((Comparable) lv, (Comparable) rv);
+ }
+
return Boolean.FALSE;
}
- if ((lv == rv) || lv.equals(rv))
+ protected boolean asBoolean(int answer)
{
- return Boolean.TRUE;
+ return answer == 0;
}
- if ((lv instanceof Comparable) && (rv instanceof Comparable))
+ public String getExpressionSymbol()
{
- return compare((Comparable) lv, (Comparable) rv);
+ return "=";
}
-
- return Boolean.FALSE;
- }
-
- protected boolean asBoolean(int answer)
- {
- return answer == 0;
- }
-
- public String getExpressionSymbol()
- {
- return "=";
- }
- };
+ };
}
public static BooleanExpression createGreaterThan(final Expression left, final Expression right)
@@ -284,17 +283,17 @@ public abstract class ComparisonExpression extends BinaryExpression implements B
checkLessThanOperand(right);
return new ComparisonExpression(left, right)
- {
- protected boolean asBoolean(int answer)
{
- return answer > 0;
- }
+ protected boolean asBoolean(int answer)
+ {
+ return answer > 0;
+ }
- public String getExpressionSymbol()
- {
- return ">";
- }
- };
+ public String getExpressionSymbol()
+ {
+ return ">";
+ }
+ };
}
public static BooleanExpression createGreaterThanEqual(final Expression left, final Expression right)
@@ -303,17 +302,17 @@ public abstract class ComparisonExpression extends BinaryExpression implements B
checkLessThanOperand(right);
return new ComparisonExpression(left, right)
- {
- protected boolean asBoolean(int answer)
{
- return answer >= 0;
- }
+ protected boolean asBoolean(int answer)
+ {
+ return answer >= 0;
+ }
- public String getExpressionSymbol()
- {
- return ">=";
- }
- };
+ public String getExpressionSymbol()
+ {
+ return ">=";
+ }
+ };
}
public static BooleanExpression createLessThan(final Expression left, final Expression right)
@@ -322,19 +321,19 @@ public abstract class ComparisonExpression extends BinaryExpression implements B
checkLessThanOperand(right);
return new ComparisonExpression(left, right)
- {
-
- protected boolean asBoolean(int answer)
{
- return answer < 0;
- }
- public String getExpressionSymbol()
- {
- return "<";
- }
+ protected boolean asBoolean(int answer)
+ {
+ return answer < 0;
+ }
+
+ public String getExpressionSymbol()
+ {
+ return "<";
+ }
- };
+ };
}
public static BooleanExpression createLessThanEqual(final Expression left, final Expression right)
@@ -343,18 +342,18 @@ public abstract class ComparisonExpression extends BinaryExpression implements B
checkLessThanOperand(right);
return new ComparisonExpression(left, right)
- {
-
- protected boolean asBoolean(int answer)
{
- return answer <= 0;
- }
- public String getExpressionSymbol()
- {
- return "<=";
- }
- };
+ protected boolean asBoolean(int answer)
+ {
+ return answer <= 0;
+ }
+
+ public String getExpressionSymbol()
+ {
+ return "<=";
+ }
+ };
}
/**
diff --git a/java/broker/src/main/java/org/apache/qpid/server/filter/Expression.java b/java/broker/src/main/java/org/apache/qpid/server/filter/Expression.java
index 4a2130e767..cb40a32290 100644
--- a/java/broker/src/main/java/org/apache/qpid/server/filter/Expression.java
+++ b/java/broker/src/main/java/org/apache/qpid/server/filter/Expression.java
@@ -1,3 +1,4 @@
+/* Copyright Rupert Smith, 2005 to 2006, all rights reserved. */
/**
*
* Licensed to the Apache Software Foundation (ASF) under one or more
@@ -15,7 +16,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.apache.qpid.server.filter;
//
// Based on like named file from r450141 of the Apache ActiveMQ project <http://www.activemq.org/site/home.html>
@@ -24,11 +24,8 @@ package org.apache.qpid.server.filter;
import org.apache.qpid.AMQException;
import org.apache.qpid.server.queue.AMQMessage;
-
/**
* Represents an expression
- *
- * @version $Revision$
*/
public interface Expression
{
@@ -37,5 +34,5 @@ public interface Expression
* @return the value of this expression
*/
public Object evaluate(AMQMessage message) throws AMQException;
-
+
}
diff --git a/java/broker/src/main/java/org/apache/qpid/server/filter/LogicExpression.java b/java/broker/src/main/java/org/apache/qpid/server/filter/LogicExpression.java
index dea6092b8a..a90775a186 100644
--- a/java/broker/src/main/java/org/apache/qpid/server/filter/LogicExpression.java
+++ b/java/broker/src/main/java/org/apache/qpid/server/filter/LogicExpression.java
@@ -1,3 +1,4 @@
+/* Copyright Rupert Smith, 2005 to 2006, all rights reserved. */
/**
*
* Licensed to the Apache Software Foundation (ASF) under one or more
@@ -25,69 +26,86 @@ import org.apache.qpid.server.queue.AMQMessage;
/**
* A filter performing a comparison of two objects
- *
- * @version $Revision$
*/
-public abstract class LogicExpression extends BinaryExpression implements BooleanExpression {
-
- public static BooleanExpression createOR(BooleanExpression lvalue, BooleanExpression rvalue) {
- return new LogicExpression(lvalue, rvalue) {
-
- public Object evaluate(AMQMessage message) throws AMQException {
-
- Boolean lv = (Boolean) left.evaluate(message);
- // Can we do an OR shortcut??
- if (lv !=null && lv.booleanValue()) {
- return Boolean.TRUE;
+public abstract class LogicExpression extends BinaryExpression implements BooleanExpression
+{
+
+ public static BooleanExpression createOR(BooleanExpression lvalue, BooleanExpression rvalue)
+ {
+ return new LogicExpression(lvalue, rvalue)
+ {
+
+ public Object evaluate(AMQMessage message) throws AMQException
+ {
+
+ Boolean lv = (Boolean) left.evaluate(message);
+ // Can we do an OR shortcut??
+ if ((lv != null) && lv.booleanValue())
+ {
+ return Boolean.TRUE;
+ }
+
+ Boolean rv = (Boolean) right.evaluate(message);
+
+ return (rv == null) ? null : rv;
+ }
+
+ public String getExpressionSymbol()
+ {
+ return "OR";
}
-
- Boolean rv = (Boolean) right.evaluate(message);
- return rv==null ? null : rv;
- }
-
- public String getExpressionSymbol() {
- return "OR";
- }
- };
+ };
}
- public static BooleanExpression createAND(BooleanExpression lvalue, BooleanExpression rvalue) {
- return new LogicExpression(lvalue, rvalue) {
+ public static BooleanExpression createAND(BooleanExpression lvalue, BooleanExpression rvalue)
+ {
+ return new LogicExpression(lvalue, rvalue)
+ {
- public Object evaluate(AMQMessage message) throws AMQException {
+ public Object evaluate(AMQMessage message) throws AMQException
+ {
- Boolean lv = (Boolean) left.evaluate(message);
+ Boolean lv = (Boolean) left.evaluate(message);
- // Can we do an AND shortcut??
- if (lv == null)
- return null;
- if (!lv.booleanValue()) {
- return Boolean.FALSE;
- }
+ // Can we do an AND shortcut??
+ if (lv == null)
+ {
+ return null;
+ }
+
+ if (!lv.booleanValue())
+ {
+ return Boolean.FALSE;
+ }
+
+ Boolean rv = (Boolean) right.evaluate(message);
- Boolean rv = (Boolean) right.evaluate(message);
- return rv == null ? null : rv;
- }
+ return (rv == null) ? null : rv;
+ }
- public String getExpressionSymbol() {
- return "AND";
- }
- };
+ public String getExpressionSymbol()
+ {
+ return "AND";
+ }
+ };
}
/**
* @param left
* @param right
*/
- public LogicExpression(BooleanExpression left, BooleanExpression right) {
+ public LogicExpression(BooleanExpression left, BooleanExpression right)
+ {
super(left, right);
}
- abstract public Object evaluate(AMQMessage message) throws AMQException;
+ public abstract Object evaluate(AMQMessage message) throws AMQException;
- public boolean matches(AMQMessage message) throws AMQException {
+ public boolean matches(AMQMessage message) throws AMQException
+ {
Object object = evaluate(message);
- return object!=null && object==Boolean.TRUE;
+
+ return (object != null) && (object == Boolean.TRUE);
}
}
diff --git a/java/broker/src/main/java/org/apache/qpid/server/management/MBeanInvocationHandlerImpl.java b/java/broker/src/main/java/org/apache/qpid/server/management/MBeanInvocationHandlerImpl.java
index 7d25fb8c69..3ab23e8b46 100644
--- a/java/broker/src/main/java/org/apache/qpid/server/management/MBeanInvocationHandlerImpl.java
+++ b/java/broker/src/main/java/org/apache/qpid/server/management/MBeanInvocationHandlerImpl.java
@@ -17,8 +17,7 @@
*/
package org.apache.qpid.server.management;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.server.security.access.AMQUserManagementMBean;
+import org.apache.qpid.server.security.access.UserManagement;
import org.apache.log4j.Logger;
import javax.management.remote.MBeanServerForwarder;
@@ -37,12 +36,6 @@ import java.security.Principal;
import java.security.AccessControlContext;
import java.util.Set;
import java.util.Properties;
-import java.util.concurrent.ConcurrentMap;
-import java.util.concurrent.ConcurrentHashMap;
-import java.io.File;
-import java.io.InputStream;
-import java.io.IOException;
-import java.io.FileInputStream;
/**
* This class can be used by the JMXConnectorServer as an InvocationHandler for the mbean operations. This implements
@@ -110,6 +103,7 @@ public class MBeanInvocationHandlerImpl implements InvocationHandler
// Restrict access to "createMBean" and "unregisterMBean" to any user
if (methodName.equals("createMBean") || methodName.equals("unregisterMBean"))
{
+ _logger.debug("User trying to create or unregister an MBean");
throw new SecurityException("Access denied");
}
@@ -155,32 +149,8 @@ public class MBeanInvocationHandlerImpl implements InvocationHandler
{
if (args[0] instanceof ObjectName)
{
- String mbeanMethod = (args.length > 1) ? (String) args[1] : null;
- if (mbeanMethod == null)
- {
- if (args[0] instanceof ObjectName)
- {
- ObjectName object = (ObjectName) args[0];
- return object.getCanonicalName().contains("UserManagement");
- }
- else
- {
- return false;
- }
- }
-
- try
- {
- MBeanInfo mbeanInfo = mbs.getMBeanInfo((ObjectName) args[0]);
- if (mbeanInfo != null)
- {
- return mbeanInfo.getClassName().equals("org.apache.qpid.server.security.access.AMQUserManagementMBean");
- }
- }
- catch (JMException ex)
- {
- return false;
- }
+ ObjectName object = (ObjectName) args[0];
+ return UserManagement.TYPE.equals(object.getKeyProperty("type"));
}
return false;
@@ -223,16 +193,16 @@ public class MBeanInvocationHandlerImpl implements InvocationHandler
private boolean isReadOnlyMethod(Method method, Object[] args)
{
String methodName = method.getName();
- if (methodName.equals("queryMBeans") ||
- methodName.equals("getDefaultDomain") ||
- methodName.equals("getMBeanInfo") ||
- methodName.equals("getAttribute") ||
- methodName.equals("getAttributes"))
+ if (methodName.startsWith("query") || methodName.startsWith("get"))
{
return true;
}
+ else if (methodName.startsWith("set"))
+ {
+ return false;
+ }
- if (args[0] instanceof ObjectName)
+ if ((args[0] instanceof ObjectName) && (methodName.equals("invoke")))
{
String mbeanMethod = (args.length > 1) ? (String) args[1] : null;
if (mbeanMethod == null)
diff --git a/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQMinaProtocolSession.java b/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQMinaProtocolSession.java
index 2e62c2f1e4..3162efa183 100644
--- a/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQMinaProtocolSession.java
+++ b/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQMinaProtocolSession.java
@@ -463,7 +463,17 @@ public class AMQMinaProtocolSession implements AMQProtocolSession,
throw new AMQException("Session is marked awaiting channel close");
}
- _channelMap.put(channelId, channel);
+ if (_channelMap.size() == _maxNoOfChannels)
+ {
+ String errorMessage = toString() + ": maximum number of channels has been reached (" +
+ _maxNoOfChannels + "); can't create channel";
+ _logger.error(errorMessage);
+ throw new AMQException(AMQConstant.NOT_ALLOWED, errorMessage);
+ }
+ else
+ {
+ _channelMap.put(channel.getChannelId(), channel);
+ }
if (((channelId & CHANNEL_CACHE_SIZE) == channelId))
{
@@ -755,8 +765,9 @@ public class AMQMinaProtocolSession implements AMQProtocolSession,
{
return _authorizedID;
}
+
public String getClientVersion()
{
- return _clientVersion == null ? null : _clientVersion.toString();
+ return _clientVersion == null ? null : _clientVersion.toString();
}
}
diff --git a/java/broker/src/main/java/org/apache/qpid/server/queue/AMQMessage.java b/java/broker/src/main/java/org/apache/qpid/server/queue/AMQMessage.java
index e19038504f..955aaa6acb 100644
--- a/java/broker/src/main/java/org/apache/qpid/server/queue/AMQMessage.java
+++ b/java/broker/src/main/java/org/apache/qpid/server/queue/AMQMessage.java
@@ -366,7 +366,7 @@ public class AMQMessage
*/
public AMQMessage takeReference()
{
- _referenceCount.incrementAndGet();
+ incrementReference();// _referenceCount.incrementAndGet();
return this;
}
diff --git a/java/broker/src/main/java/org/apache/qpid/server/queue/AMQQueue.java b/java/broker/src/main/java/org/apache/qpid/server/queue/AMQQueue.java
index 65d5906d05..0adf6153f8 100644
--- a/java/broker/src/main/java/org/apache/qpid/server/queue/AMQQueue.java
+++ b/java/broker/src/main/java/org/apache/qpid/server/queue/AMQQueue.java
@@ -615,7 +615,7 @@ public class AMQQueue implements Managable, Comparable
}
catch (MessageCleanupException e)
{
- //Message was dequeued, but could notthen be deleted
+ //Message was dequeued, but could not then be deleted
//though it is no longer referenced. This should be very
//rare and can be detected and cleaned up on recovery or
//done through some form of manual intervention.
diff --git a/java/broker/src/main/java/org/apache/qpid/server/security/access/UserManagement.java b/java/broker/src/main/java/org/apache/qpid/server/security/access/UserManagement.java
index ec7031534b..b8762aa43b 100644
--- a/java/broker/src/main/java/org/apache/qpid/server/security/access/UserManagement.java
+++ b/java/broker/src/main/java/org/apache/qpid/server/security/access/UserManagement.java
@@ -63,7 +63,7 @@ public interface UserManagement
impact = MBeanOperationInfo.ACTION)
boolean setRights(@MBeanOperationParameter(name = "username", description = "Username")String username,
@MBeanOperationParameter(name = "read", description = "Administration read")boolean read,
- @MBeanOperationParameter(name = "write", description = "Administration write")boolean write,
+ @MBeanOperationParameter(name = "readAndWrite", description = "Administration write")boolean write,
@MBeanOperationParameter(name = "admin", description = "Administration rights")boolean admin);
/**
@@ -82,7 +82,7 @@ public interface UserManagement
boolean createUser(@MBeanOperationParameter(name = "username", description = "Username")String username,
@MBeanOperationParameter(name = "password", description = "Password")char[] password,
@MBeanOperationParameter(name = "read", description = "Administration read")boolean read,
- @MBeanOperationParameter(name = "write", description = "Administration write")boolean write,
+ @MBeanOperationParameter(name = "readAndWrite", description = "Administration write")boolean write,
@MBeanOperationParameter(name = "admin", description = "Administration rights")boolean admin);
/**
diff --git a/java/broker/src/test/java/org/apache/qpid/server/queue/AMQQueueAlertTest.java b/java/broker/src/test/java/org/apache/qpid/server/queue/AMQQueueAlertTest.java
index a5c5763db1..a9496d0de1 100644
--- a/java/broker/src/test/java/org/apache/qpid/server/queue/AMQQueueAlertTest.java
+++ b/java/broker/src/test/java/org/apache/qpid/server/queue/AMQQueueAlertTest.java
@@ -106,7 +106,7 @@ public class AMQQueueAlertTest extends TestCase
/**
* Tests if Queue Depth alert is thrown when queue depth reaches the threshold value
*
- * Based on FT402 subbmitted by client
+ * Based on FT-402 subbmitted by client
*
* @throws Exception
*/
@@ -134,6 +134,8 @@ public class AMQQueueAlertTest extends TestCase
* Tests if MESSAGE AGE alert is thrown, when a message is in the queue for time higher than threshold value of
* message age
*
+ * Alternative test to FT-401 provided by client
+ *
* @throws Exception
*/
public void testMessageAgeAlert() throws Exception
diff --git a/java/client/src/main/java/org/apache/qpid/client/AMQSession.java b/java/client/src/main/java/org/apache/qpid/client/AMQSession.java
index 7b65f279be..93724c9920 100644
--- a/java/client/src/main/java/org/apache/qpid/client/AMQSession.java
+++ b/java/client/src/main/java/org/apache/qpid/client/AMQSession.java
@@ -644,7 +644,7 @@ public class AMQSession extends Closeable implements Session, QueueSession, Topi
}
catch (AMQException e)
{
- throw(JMSException) (new JMSException("Failed to rollback: " + e).initCause(e));
+ throw (JMSException) (new JMSException("Failed to rollback: " + e).initCause(e));
}
}
}
diff --git a/java/client/src/main/java/org/apache/qpid/client/AMQTemporaryQueue.java b/java/client/src/main/java/org/apache/qpid/client/AMQTemporaryQueue.java
index ce8e14506f..f54cb782c8 100644
--- a/java/client/src/main/java/org/apache/qpid/client/AMQTemporaryQueue.java
+++ b/java/client/src/main/java/org/apache/qpid/client/AMQTemporaryQueue.java
@@ -25,9 +25,10 @@ import javax.jms.TemporaryQueue;
import org.apache.qpid.framing.AMQShortString;
-/**
- * AMQ implementation of a TemporaryQueue.
- */
+import java.util.Random;
+import java.util.UUID;
+
+/** AMQ implementation of a TemporaryQueue. */
final class AMQTemporaryQueue extends AMQQueue implements TemporaryQueue, TemporaryDestination
{
@@ -35,21 +36,17 @@ final class AMQTemporaryQueue extends AMQQueue implements TemporaryQueue, Tempor
private final AMQSession _session;
private boolean _deleted;
- /**
- * Create a new instance of an AMQTemporaryQueue
- */
+ /** Create a new instance of an AMQTemporaryQueue */
public AMQTemporaryQueue(AMQSession session)
{
- super(session.getTemporaryQueueExchangeName(),new AMQShortString("TempQueue" + Long.toString(System.currentTimeMillis())), true);
+ super(session.getTemporaryQueueExchangeName(), new AMQShortString("TempQueue" + UUID.randomUUID()), true);
_session = session;
}
- /**
- * @see javax.jms.TemporaryQueue#delete()
- */
+ /** @see javax.jms.TemporaryQueue#delete() */
public synchronized void delete() throws JMSException
{
- if(_session.hasConsumer(this))
+ if (_session.hasConsumer(this))
{
throw new JMSException("Temporary Queue has consumers so cannot be deleted");
}
diff --git a/java/client/src/test/java/org/apache/qpid/client/ResetMessageListenerTest.java b/java/client/src/test/java/org/apache/qpid/client/ResetMessageListenerTest.java
index 42594fff8e..97fbf9876f 100644
--- a/java/client/src/test/java/org/apache/qpid/client/ResetMessageListenerTest.java
+++ b/java/client/src/test/java/org/apache/qpid/client/ResetMessageListenerTest.java
@@ -43,16 +43,13 @@ import org.apache.qpid.client.transport.TransportConnection;
import org.apache.qpid.jndi.PropertiesFileInitialContextFactory;
/**
- * QPID-293 Setting MessageListener after connection has started can cause messages to be "lost" on a internal delivery queue
- * <p/>
- * The message delivery process:
- * Mina puts a message on _queue in AMQSession and the dispatcher thread take()s
- * from here and dispatches to the _consumers. If the _consumer1 doesn't have a message listener set at connection start
- * then messages are stored on _synchronousQueue (which needs to be > 1 to pass JMS TCK as multiple consumers on a
- * session can run in any order and a synchronous put/poll will block the dispatcher).
- * <p/>
- * When setting the message listener later the _synchronousQueue is just poll()'ed and the first message delivered
- * the remaining messages will be left on the queue and lost, subsequent messages on the session will arrive first.
+ * QPID-293 Setting MessageListener after connection has started can cause messages to be "lost" on a internal delivery
+ * queue <p/> The message delivery process: Mina puts a message on _queue in AMQSession and the dispatcher thread
+ * take()s from here and dispatches to the _consumers. If the _consumer1 doesn't have a message listener set at
+ * connection start then messages are stored on _synchronousQueue (which needs to be > 1 to pass JMS TCK as multiple
+ * consumers on a session can run in any order and a synchronous put/poll will block the dispatcher). <p/> When setting
+ * the message listener later the _synchronousQueue is just poll()'ed and the first message delivered the remaining
+ * messages will be left on the queue and lost, subsequent messages on the session will arrive first.
*/
public class ResetMessageListenerTest extends TestCase
{
@@ -78,6 +75,8 @@ public class ResetMessageListenerTest extends TestCase
super.setUp();
TransportConnection.createVMBroker(1);
+ System.setProperty(AMQSession.IMMEDIATE_PREFETCH, "true");
+
InitialContextFactory factory = new PropertiesFileInitialContextFactory();
Hashtable<String, String> env = new Hashtable<String, String>();
@@ -203,7 +202,7 @@ public class ResetMessageListenerTest extends TestCase
try
{
- _clientConnection.stop();
+ _clientConnection.stop();
}
catch (JMSException e)
{
@@ -226,7 +225,7 @@ public class ResetMessageListenerTest extends TestCase
}
}
});
-
+
_clientConnection.start();
}
catch (javax.jms.IllegalStateException e)
diff --git a/java/client/src/test/java/org/apache/qpid/test/unit/client/temporaryqueue/TemporaryQueueTest.java b/java/client/src/test/java/org/apache/qpid/test/unit/client/temporaryqueue/TemporaryQueueTest.java
index a177cf86d3..2ba5bed0b1 100644
--- a/java/client/src/test/java/org/apache/qpid/test/unit/client/temporaryqueue/TemporaryQueueTest.java
+++ b/java/client/src/test/java/org/apache/qpid/test/unit/client/temporaryqueue/TemporaryQueueTest.java
@@ -7,14 +7,20 @@ import javax.jms.MessageProducer;
import javax.jms.Session;
import javax.jms.TemporaryQueue;
import javax.jms.TextMessage;
+import javax.jms.Queue;
import junit.framework.TestCase;
+import junit.framework.Assert;
import org.apache.qpid.AMQException;
import org.apache.qpid.client.AMQConnection;
+import org.apache.qpid.client.AMQQueue;
import org.apache.qpid.client.transport.TransportConnection;
import org.apache.qpid.url.URLSyntaxException;
+import java.util.List;
+import java.util.LinkedList;
+
public class TemporaryQueueTest extends TestCase
{
@@ -35,7 +41,7 @@ public class TemporaryQueueTest extends TestCase
protected Connection createConnection() throws AMQException, URLSyntaxException
{
return new AMQConnection(_broker, "guest", "guest",
- "fred", "test");
+ "fred", "test");
}
public void testTempoaryQueue() throws Exception
@@ -50,14 +56,14 @@ public class TemporaryQueueTest extends TestCase
producer.send(session.createTextMessage("hello"));
TextMessage tm = (TextMessage) consumer.receive(2000);
assertNotNull(tm);
- assertEquals("hello",tm.getText());
+ assertEquals("hello", tm.getText());
try
{
queue.delete();
fail("Expected JMSException : should not be able to delete while there are active consumers");
}
- catch(JMSException je)
+ catch (JMSException je)
{
; //pass
}
@@ -68,7 +74,7 @@ public class TemporaryQueueTest extends TestCase
{
queue.delete();
}
- catch(JMSException je)
+ catch (JMSException je)
{
fail("Unexpected Exception: " + je.getMessage());
}
@@ -76,6 +82,127 @@ public class TemporaryQueueTest extends TestCase
conn.close();
}
+ public void tUniqueness() throws JMSException, AMQException, URLSyntaxException
+ {
+ int numProcs = Runtime.getRuntime().availableProcessors();
+ final int threadsProc = 5;
+
+ runUniqueness(1, 10);
+ runUniqueness(numProcs * threadsProc, 10);
+ runUniqueness(numProcs * threadsProc, 100);
+ runUniqueness(numProcs * threadsProc, 500);
+ }
+
+ void runUniqueness(int makers, int queues) throws JMSException, AMQException, URLSyntaxException
+ {
+ Connection connection = createConnection();
+
+ Session session = connection.createSession(false, Session.CLIENT_ACKNOWLEDGE);
+
+ List<TempQueueMaker> tqList = new LinkedList<TempQueueMaker>();
+
+ //Create Makers
+ for (int m = 0; m < makers; m++)
+ {
+ tqList.add(new TempQueueMaker(session, queues));
+ }
+
+
+ List<Thread> threadList = new LinkedList<Thread>();
+
+ //Create Makers
+ for (TempQueueMaker maker : tqList)
+ {
+ threadList.add(new Thread(maker));
+ }
+
+ //Start threads
+ for (Thread thread : threadList)
+ {
+ thread.start();
+ }
+
+ // Join Threads
+ for (Thread thread : threadList)
+ {
+ try
+ {
+ thread.join();
+ }
+ catch (InterruptedException e)
+ {
+ fail("Couldn't correctly join threads");
+ }
+ }
+
+
+ List<AMQQueue> list = new LinkedList<AMQQueue>();
+
+ // Test values
+ for (TempQueueMaker maker : tqList)
+ {
+ check(maker, list);
+ }
+
+ Assert.assertEquals("Not enough queues made.", makers * queues, list.size());
+
+ connection.close();
+ }
+
+ private void check(TempQueueMaker tq, List<AMQQueue> list)
+ {
+ for (AMQQueue q : tq.getList())
+ {
+ if (list.contains(q))
+ {
+ fail(q + " already exists.");
+ }
+ else
+ {
+ list.add(q);
+ }
+ }
+ }
+
+
+ class TempQueueMaker implements Runnable
+ {
+ List<AMQQueue> _queues;
+ Session _session;
+ private int _count;
+
+
+ TempQueueMaker(Session session, int queues) throws JMSException
+ {
+ _queues = new LinkedList<AMQQueue>();
+
+ _count = queues;
+
+ _session = session;
+ }
+
+ public void run()
+ {
+ int i = 0;
+ try
+ {
+ for (; i < _count; i++)
+ {
+ _queues.add((AMQQueue) _session.createTemporaryQueue());
+ }
+ }
+ catch (JMSException jmse)
+ {
+ //stop
+ }
+ }
+
+ List<AMQQueue> getList()
+ {
+ return _queues;
+ }
+ }
+
public static junit.framework.Test suite()
{
diff --git a/java/client/src/test/java/org/apache/qpid/test/unit/close/MessageRequeueTest.java b/java/client/src/test/java/org/apache/qpid/test/unit/close/MessageRequeueTest.java
index 62234ad21f..d52707d965 100644
--- a/java/client/src/test/java/org/apache/qpid/test/unit/close/MessageRequeueTest.java
+++ b/java/client/src/test/java/org/apache/qpid/test/unit/close/MessageRequeueTest.java
@@ -181,7 +181,9 @@ public class MessageRequeueTest extends TestCase
passed = true;
}
- /** multiple consumers */
+ /** multiple consumers
+ * Based on code subbmitted by client FT-304
+ */
public void testTwoCompetingConsumers()
{
Consumer c1 = new Consumer();
diff --git a/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/Constants.java b/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/Constants.java
index efd4a7e9a6..127ae22a10 100644
--- a/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/Constants.java
+++ b/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/Constants.java
@@ -20,8 +20,6 @@
*/
package org.apache.qpid.management.ui;
-import static org.apache.qpid.management.ui.Constants.CONNECTION_PROTOCOLS;
-
/**
* Contains constants for the application
* @author Bhupendra Bhardwaj
@@ -86,6 +84,8 @@ public class Constants
public final static String ACTION_ADDSERVER = "New Connection";
public final static String ACTION_RECONNECT = "Reconnect";
+ public final static String ACTION_CLOSE = "Close Connection";
+ public final static String ACTION_EDITATTRIBUTE = "Edit Attribute";
public final static String ACTION_LOGIN = "Login";
public final static String QUEUE_SORT_BY_NAME = "Queue Name";
@@ -125,7 +125,7 @@ public class Constants
public final static int OPERATION_IMPACT_ACTIONINFO = 2;
public final static int OPERATION_IMPACT_UNKNOWN = 3;
- public final static String ERROR_SERVER_CONNECTION = "Server could not be connected";
+ public final static String ERROR_SERVER_CONNECTION = "Server Connection Failed";
public final static String INFO_PROTOCOL = "Please select the protocol";
public final static String INFO_HOST_ADDRESS = "Please enter the host address";
public final static String INFO_HOST_PORT = "Please enter the port number";
diff --git a/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/actions/AbstractAction.java b/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/actions/AbstractAction.java
new file mode 100644
index 0000000000..0101905bbf
--- /dev/null
+++ b/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/actions/AbstractAction.java
@@ -0,0 +1,58 @@
+package org.apache.qpid.management.ui.actions;
+
+import static org.apache.qpid.management.ui.Constants.ERROR_SERVER_CONNECTION;
+
+import org.apache.qpid.management.ui.ApplicationRegistry;
+import org.apache.qpid.management.ui.ApplicationWorkbenchAdvisor;
+import org.apache.qpid.management.ui.Constants;
+import org.apache.qpid.management.ui.jmx.MBeanUtility;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.dialogs.ErrorDialog;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.IWorkbenchWindowActionDelegate;
+
+public class AbstractAction
+{
+ protected IWorkbenchWindow _window;
+
+ /**
+ * We will cache window object in order to
+ * be able to provide parent shell for the message dialog.
+ * @see IWorkbenchWindowActionDelegate#init
+ */
+ public void init(IWorkbenchWindow window)
+ {
+ this._window = window;
+ if (_window.getShell() != null)
+ {
+ _window.getShell().setImage(ApplicationRegistry.getImage(Constants.CONSOLE_IMAGE));
+ }
+ }
+
+ protected void handleException(Exception ex, String title, String msg)
+ {
+ MBeanUtility.printStackTrace(ex);
+ if (msg == null)
+ {
+ msg = ex.getMessage();
+ }
+ if ((msg == null) && (ex.getCause() != null))
+ {
+ msg = ex.getCause().getMessage();
+ }
+
+ if (msg == null)
+ {
+ msg = ERROR_SERVER_CONNECTION;
+ }
+
+ if (title == null)
+ {
+ title = ERROR_SERVER_CONNECTION;
+ }
+ IStatus status = new Status(IStatus.ERROR, ApplicationWorkbenchAdvisor.PERSPECTIVE_ID,
+ IStatus.OK, msg, null);
+ ErrorDialog.openError(_window.getShell(), "Error", title, status);
+ }
+}
diff --git a/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/actions/AddServer.java b/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/actions/AddServer.java
index 0e12c59de4..ff0f42b49e 100644
--- a/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/actions/AddServer.java
+++ b/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/actions/AddServer.java
@@ -23,15 +23,11 @@ package org.apache.qpid.management.ui.actions;
import static org.apache.qpid.management.ui.Constants.*;
import org.apache.qpid.management.ui.ApplicationRegistry;
-import org.apache.qpid.management.ui.ApplicationWorkbenchAdvisor;
import org.apache.qpid.management.ui.exceptions.InfoRequiredException;
import org.apache.qpid.management.ui.views.NavigationView;
import org.apache.qpid.management.ui.views.NumberVerifyListener;
import org.apache.qpid.management.ui.views.ViewUtility;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.dialogs.ErrorDialog;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
@@ -45,12 +41,10 @@ import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.IWorkbenchWindowActionDelegate;
-public class AddServer/* extends Action*/ implements IWorkbenchWindowActionDelegate
+public class AddServer extends AbstractAction implements IWorkbenchWindowActionDelegate
{
- private IWorkbenchWindow _window;
private static final String[] _domains ={"org.apache.qpid"};
private NavigationView _navigationView;
@@ -96,13 +90,11 @@ public class AddServer/* extends Action*/ implements IWorkbenchWindowActionDeleg
}
catch(InfoRequiredException ex)
{
- ViewUtility.popupInfoMessage("New connection", ex.getMessage());
+ ViewUtility.popupInfoMessage(ACTION_ADDSERVER, ex.getMessage());
}
- catch(Exception ex)
+ catch (Exception ex)
{
- IStatus status = new Status(IStatus.ERROR, ApplicationWorkbenchAdvisor.PERSPECTIVE_ID,
- IStatus.OK, ex.getMessage(), ex.getCause());
- ErrorDialog.openError(_window.getShell(), "Error", ERROR_SERVER_CONNECTION, status);
+ handleException(ex, null, null);
}
}
}
@@ -133,15 +125,7 @@ public class AddServer/* extends Action*/ implements IWorkbenchWindowActionDeleg
* @see IWorkbenchWindowActionDelegate#dispose
*/
public void dispose() {
- }
-
- /**
- * We will cache window object in order to
- * be able to provide parent shell for the message dialog.
- * @see IWorkbenchWindowActionDelegate#init
- */
- public void init(IWorkbenchWindow window) {
- this._window = window;
+
}
private NavigationView getNavigationView()
diff --git a/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/actions/CloseConnection.java b/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/actions/CloseConnection.java
index 3f44274a92..3907424748 100644
--- a/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/actions/CloseConnection.java
+++ b/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/actions/CloseConnection.java
@@ -20,22 +20,16 @@
*/
package org.apache.qpid.management.ui.actions;
-import org.apache.qpid.management.ui.ApplicationWorkbenchAdvisor;
+import static org.apache.qpid.management.ui.Constants.ACTION_CLOSE;
import org.apache.qpid.management.ui.exceptions.InfoRequiredException;
import org.apache.qpid.management.ui.views.NavigationView;
import org.apache.qpid.management.ui.views.ViewUtility;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.dialogs.ErrorDialog;
import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.IWorkbenchWindowActionDelegate;
-public class CloseConnection implements IWorkbenchWindowActionDelegate
-{
- private IWorkbenchWindow _window;
-
+public class CloseConnection extends AbstractAction implements IWorkbenchWindowActionDelegate
+{
public CloseConnection()
{
@@ -52,13 +46,11 @@ public class CloseConnection implements IWorkbenchWindowActionDelegate
}
catch(InfoRequiredException ex)
{
- ViewUtility.popupInfoMessage("Close connection", ex.getMessage());
+ ViewUtility.popupInfoMessage(ACTION_CLOSE, ex.getMessage());
}
catch(Exception ex)
{
- IStatus status = new Status(IStatus.ERROR, ApplicationWorkbenchAdvisor.PERSPECTIVE_ID,
- IStatus.OK, ex.getMessage(), ex.getCause());
- ErrorDialog.openError(_window.getShell(), "Error", "Server could not be removed", status);
+ handleException(ex, null, null);
}
}
}
@@ -79,15 +71,6 @@ public class CloseConnection implements IWorkbenchWindowActionDelegate
* @see IWorkbenchWindowActionDelegate#dispose
*/
public void dispose() {
- }
-
- /**
- * We will cache window object in order to
- * be able to provide parent shell for the message dialog.
- * @see IWorkbenchWindowActionDelegate#init
- */
- public void init(IWorkbenchWindow window) {
- this._window = window;
- }
-
+
+ }
}
diff --git a/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/actions/EditAttribute.java b/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/actions/EditAttribute.java
index 0030330b06..69e74898ab 100644
--- a/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/actions/EditAttribute.java
+++ b/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/actions/EditAttribute.java
@@ -20,22 +20,16 @@
*/
package org.apache.qpid.management.ui.actions;
-import org.apache.qpid.management.ui.ApplicationWorkbenchAdvisor;
+import static org.apache.qpid.management.ui.Constants.ACTION_EDITATTRIBUTE;
import org.apache.qpid.management.ui.exceptions.InfoRequiredException;
import org.apache.qpid.management.ui.views.MBeanView;
import org.apache.qpid.management.ui.views.ViewUtility;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.dialogs.ErrorDialog;
import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.IWorkbenchWindowActionDelegate;
-public class EditAttribute implements IWorkbenchWindowActionDelegate
-{
- private IWorkbenchWindow _window;
-
+public class EditAttribute extends AbstractAction implements IWorkbenchWindowActionDelegate
+{
public void run(IAction action)
{
if(_window != null)
@@ -47,13 +41,11 @@ public class EditAttribute implements IWorkbenchWindowActionDelegate
}
catch(InfoRequiredException ex)
{
- ViewUtility.popupInfoMessage("Edit Attribute", ex.getMessage());
+ ViewUtility.popupInfoMessage(ACTION_EDITATTRIBUTE, ex.getMessage());
}
catch(Exception ex)
{
- IStatus status = new Status(IStatus.ERROR, ApplicationWorkbenchAdvisor.PERSPECTIVE_ID,
- IStatus.OK, ex.getMessage(), ex.getCause());
- ErrorDialog.openError(_window.getShell(), "Error", "Attribute could not be edited", status);
+ handleException(ex, "Attribute could not be edited", null);
}
}
}
@@ -74,14 +66,6 @@ public class EditAttribute implements IWorkbenchWindowActionDelegate
* @see IWorkbenchWindowActionDelegate#dispose
*/
public void dispose() {
- }
-
- /**
- * We will cache window object in order to
- * be able to provide parent shell for the message dialog.
- * @see IWorkbenchWindowActionDelegate#init
- */
- public void init(IWorkbenchWindow window) {
- this._window = window;
+
}
}
diff --git a/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/actions/ReconnectServer.java b/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/actions/ReconnectServer.java
index 9aa265ab3c..3c0dea586e 100644
--- a/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/actions/ReconnectServer.java
+++ b/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/actions/ReconnectServer.java
@@ -20,19 +20,20 @@
*/
package org.apache.qpid.management.ui.actions;
-import static org.apache.qpid.management.ui.Constants.*;
+import static org.apache.qpid.management.ui.Constants.ACTION_LOGIN;
+import static org.apache.qpid.management.ui.Constants.CONSOLE_IMAGE;
+import static org.apache.qpid.management.ui.Constants.INFO_PASSWORD;
+import static org.apache.qpid.management.ui.Constants.INFO_USERNAME;
+import static org.apache.qpid.management.ui.Constants.PASSWORD;
+import static org.apache.qpid.management.ui.Constants.USERNAME;
import org.apache.qpid.management.ui.ApplicationRegistry;
-import org.apache.qpid.management.ui.ApplicationWorkbenchAdvisor;
import org.apache.qpid.management.ui.Constants;
import org.apache.qpid.management.ui.exceptions.InfoRequiredException;
import org.apache.qpid.management.ui.views.NavigationView;
import org.apache.qpid.management.ui.views.TreeObject;
import org.apache.qpid.management.ui.views.ViewUtility;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.dialogs.ErrorDialog;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
@@ -40,18 +41,15 @@ import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.IWorkbenchWindowActionDelegate;
-public class ReconnectServer implements IWorkbenchWindowActionDelegate
+public class ReconnectServer extends AbstractAction implements IWorkbenchWindowActionDelegate
{
- private IWorkbenchWindow _window;
private NavigationView _navigationView;
private String _title;
private String _serverName;
@@ -80,16 +78,6 @@ public class ReconnectServer implements IWorkbenchWindowActionDelegate
{
}
-
- /**
- * We will cache window object in order to
- * be able to provide parent shell for the message dialog.
- * @see IWorkbenchWindowActionDelegate#init
- */
- public void init(IWorkbenchWindow window)
- {
- this._window = window;
- }
private NavigationView getNavigationView()
{
@@ -126,11 +114,9 @@ public class ReconnectServer implements IWorkbenchWindowActionDelegate
{
ViewUtility.popupInfoMessage("Reconnect Qpid server", ex.getMessage());
}
- catch(Exception ex)
+ catch (Exception ex)
{
- IStatus status = new Status(IStatus.ERROR, ApplicationWorkbenchAdvisor.PERSPECTIVE_ID,
- IStatus.OK, ex.getMessage(), ex.getCause());
- ErrorDialog.openError(_window.getShell(), "Error", ERROR_SERVER_CONNECTION, status);
+ handleException(ex, null, null);
}
}
}
diff --git a/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/actions/Refresh.java b/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/actions/Refresh.java
index a2335c5841..b76c36c649 100644
--- a/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/actions/Refresh.java
+++ b/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/actions/Refresh.java
@@ -25,17 +25,14 @@ import org.apache.qpid.management.ui.views.MBeanView;
import org.apache.qpid.management.ui.views.NavigationView;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.IWorkbenchWindowActionDelegate;
/**
* This action refreshes both the views -Navigation and MBeanView
* @author Bhupendra Bhardwaj
*/
-public class Refresh implements IWorkbenchWindowActionDelegate
+public class Refresh extends AbstractAction implements IWorkbenchWindowActionDelegate
{
- private IWorkbenchWindow _window;
-
/**
* Selection in the workbench has been changed. We
* can change the state of the 'real' action here
@@ -57,16 +54,6 @@ public class Refresh implements IWorkbenchWindowActionDelegate
{
}
-
- /**
- * We will cache window object in order to
- * be able to provide parent shell for the message dialog.
- * @see IWorkbenchWindowActionDelegate#init
- */
- public void init(IWorkbenchWindow window)
- {
- this._window = window;
- }
public void run(IAction action)
{
diff --git a/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/actions/RemoveServer.java b/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/actions/RemoveServer.java
index 189f0f811b..f8878c44a1 100644
--- a/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/actions/RemoveServer.java
+++ b/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/actions/RemoveServer.java
@@ -20,22 +20,15 @@
*/
package org.apache.qpid.management.ui.actions;
-import org.apache.qpid.management.ui.ApplicationWorkbenchAdvisor;
import org.apache.qpid.management.ui.exceptions.InfoRequiredException;
import org.apache.qpid.management.ui.views.NavigationView;
import org.apache.qpid.management.ui.views.ViewUtility;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.dialogs.ErrorDialog;
import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.IWorkbenchWindowActionDelegate;
-public class RemoveServer implements IWorkbenchWindowActionDelegate
-{
- private IWorkbenchWindow _window;
-
+public class RemoveServer extends AbstractAction implements IWorkbenchWindowActionDelegate
+{
/**
* Selection in the workbench has been changed. We
* can change the state of the 'real' action here
@@ -57,16 +50,6 @@ public class RemoveServer implements IWorkbenchWindowActionDelegate
{
}
-
- /**
- * We will cache window object in order to
- * be able to provide parent shell for the message dialog.
- * @see IWorkbenchWindowActionDelegate#init
- */
- public void init(IWorkbenchWindow window)
- {
- this._window = window;
- }
public void run(IAction action)
{
@@ -83,9 +66,7 @@ public class RemoveServer implements IWorkbenchWindowActionDelegate
}
catch(Exception ex)
{
- IStatus status = new Status(IStatus.ERROR, ApplicationWorkbenchAdvisor.PERSPECTIVE_ID,
- IStatus.OK, ex.getMessage(), ex.getCause());
- ErrorDialog.openError(_window.getShell(), "Error", "Server could not be removed", status);
+ handleException(ex, "Server could not be removed", null);
}
}
}
diff --git a/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/jmx/MBeanUtility.java b/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/jmx/MBeanUtility.java
index 41db11c10e..2d1883533b 100644
--- a/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/jmx/MBeanUtility.java
+++ b/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/jmx/MBeanUtility.java
@@ -20,7 +20,6 @@
*/
package org.apache.qpid.management.ui.jmx;
-import java.io.IOException;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
@@ -149,11 +148,6 @@ public class MBeanUtility
ViewUtility.popupErrorMessage("Error", "Managed Object is null \n" + ex.toString());
printStackTrace(ex);
}
- else if (ex instanceof IOException)
- {
- ViewUtility.popupErrorMessage(mbean.getInstanceName(), "IO Error occured \n" + ex.toString());
- printStackTrace(ex);
- }
else if (ex instanceof ReflectionException)
{
ViewUtility.popupErrorMessage(mbean.getInstanceName(), "Server has thrown error \n" + ex.toString());
@@ -462,7 +456,7 @@ public class MBeanUtility
}
}
- private static void printStackTrace(Throwable ex)
+ public static void printStackTrace(Throwable ex)
{
if (ApplicationRegistry.debug)
{
diff --git a/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/AttributesTabControl.java b/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/AttributesTabControl.java
index a7e8bbfc4c..1ffe34d9c5 100644
--- a/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/AttributesTabControl.java
+++ b/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/AttributesTabControl.java
@@ -21,6 +21,7 @@
package org.apache.qpid.management.ui.views;
import static org.apache.qpid.management.ui.Constants.*;
+
import org.apache.qpid.management.ui.ApplicationRegistry;
import org.apache.qpid.management.ui.ManagedBean;
import org.apache.qpid.management.ui.jmx.JMXServerRegistry;
@@ -51,8 +52,6 @@ import org.eclipse.swt.events.PaintEvent;
import org.eclipse.swt.events.PaintListener;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.VerifyEvent;
-import org.eclipse.swt.events.VerifyListener;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.graphics.Image;
diff --git a/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/MBeanTypeTabControl.java b/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/MBeanTypeTabControl.java
index a8a96e0b5a..31b6cc6221 100644
--- a/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/MBeanTypeTabControl.java
+++ b/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/MBeanTypeTabControl.java
@@ -1,9 +1,13 @@
package org.apache.qpid.management.ui.views;
+import static org.apache.qpid.management.ui.Constants.BUTTON_REFRESH;
+import static org.apache.qpid.management.ui.Constants.FONT_BOLD;
+import static org.apache.qpid.management.ui.Constants.FONT_ITALIC;
+import static org.apache.qpid.management.ui.Constants.FONT_NORMAL;
+
import java.util.Collections;
import java.util.HashMap;
-import static org.apache.qpid.management.ui.Constants.*;
import org.apache.qpid.management.ui.ApplicationRegistry;
import org.apache.qpid.management.ui.ManagedBean;
import org.apache.qpid.management.ui.jmx.MBeanUtility;
diff --git a/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/NavigationView.java b/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/NavigationView.java
index 68f95e01f0..e5f99c2f7b 100644
--- a/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/NavigationView.java
+++ b/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/NavigationView.java
@@ -20,6 +20,8 @@
*/
package org.apache.qpid.management.ui.views;
+import static org.apache.qpid.management.ui.Constants.*;
+
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
@@ -27,14 +29,12 @@ import java.util.HashMap;
import java.util.List;
import org.apache.qpid.management.ui.ApplicationRegistry;
-import static org.apache.qpid.management.ui.Constants.*;
import org.apache.qpid.management.ui.ManagedBean;
import org.apache.qpid.management.ui.ManagedServer;
import org.apache.qpid.management.ui.ServerRegistry;
import org.apache.qpid.management.ui.exceptions.InfoRequiredException;
import org.apache.qpid.management.ui.jmx.JMXServerRegistry;
import org.apache.qpid.management.ui.jmx.MBeanUtility;
-
import org.eclipse.jface.preference.PreferenceStore;
import org.eclipse.jface.viewers.DoubleClickEvent;
import org.eclipse.jface.viewers.IDoubleClickListener;
@@ -48,7 +48,6 @@ import org.eclipse.jface.viewers.TreeExpansionEvent;
import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.viewers.ViewerSorter;
-
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.graphics.Image;
@@ -63,7 +62,6 @@ import org.eclipse.swt.widgets.MenuItem;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Tree;
import org.eclipse.swt.widgets.TreeItem;
-
import org.eclipse.ui.part.ViewPart;
/**
@@ -216,10 +214,9 @@ public class NavigationView extends ViewPart
ServerRegistry serverRegistry = new JMXServerRegistry(server);
ApplicationRegistry.addServer(server, serverRegistry);
}
- catch (Exception ex)
+ catch (IOException ex)
{
- ex.printStackTrace();
- throw new Exception("Error in connecting to Qpid broker at " + server.getUrl(), ex);
+ throw (Exception)ex.getCause();
}
}
@@ -274,7 +271,15 @@ public class NavigationView extends ViewPart
_managedServerMap.put(managedServer, serverNode);
// populate the server tree
- populateServer(serverNode);
+ try
+ {
+ populateServer(serverNode);
+ }
+ catch (SecurityException ex)
+ {
+ disconnect(managedServer);
+ throw ex;
+ }
// Add the Queue/Exchanges/Connections from config file into the navigation tree
addConfiguredItems(managedServer);
@@ -413,38 +418,30 @@ public class NavigationView extends ViewPart
* the given server node.
* @param serverNode
*/
- private void populateServer(TreeObject serverNode)
+ private void populateServer(TreeObject serverNode) throws Exception
{
ManagedServer server = (ManagedServer) serverNode.getManagedObject();
String domain = server.getDomain();
- try
+ if (!domain.equals(ALL))
+ {
+ TreeObject domainNode = new TreeObject(domain, NODE_TYPE_DOMAIN);
+ domainNode.setParent(serverNode);
+
+ populateDomain(domainNode);
+ }
+ else
{
- if (!domain.equals(ALL))
+ List<TreeObject> domainList = new ArrayList<TreeObject>();
+ List<String> domains = MBeanUtility.getAllDomains(server);
+
+ for (String domainName : domains)
{
- TreeObject domainNode = new TreeObject(domain, NODE_TYPE_DOMAIN);
+ TreeObject domainNode = new TreeObject(domainName, NODE_TYPE_DOMAIN);
domainNode.setParent(serverNode);
+ domainList.add(domainNode);
populateDomain(domainNode);
}
- else
- {
- List<TreeObject> domainList = new ArrayList<TreeObject>();
- List<String> domains = MBeanUtility.getAllDomains(server);
- ;
- for (String domainName : domains)
- {
- TreeObject domainNode = new TreeObject(domainName, NODE_TYPE_DOMAIN);
- domainNode.setParent(serverNode);
-
- domainList.add(domainNode);
- populateDomain(domainNode);
- }
- }
- }
- catch (Exception ex)
- {
- System.out.println("\nError in connecting to Qpid broker ");
- ex.printStackTrace();
}
}
@@ -726,6 +723,11 @@ public class NavigationView extends ViewPart
{
TreeObject selectedNode = getSelectedServerNode();
ManagedServer managedServer = (ManagedServer) selectedNode.getManagedObject();
+ disconnect(managedServer);
+ }
+
+ private void disconnect(ManagedServer managedServer) throws Exception
+ {
if (!_managedServerMap.containsKey(managedServer))
{
return;
@@ -763,8 +765,17 @@ public class NavigationView extends ViewPart
// put the server in the managed server map
_managedServerMap.put(managedServer, selectedNode);
- // populate the server tree now
- populateServer(selectedNode);
+ try
+ {
+ // populate the server tree now
+ populateServer(selectedNode);
+ }
+ catch (SecurityException ex)
+ {
+ disconnect(managedServer);
+ throw ex;
+ }
+
// Add the Queue/Exchanges/Connections from config file into the navigation tree
addConfiguredItems(managedServer);
diff --git a/java/systests/pom.xml b/java/systests/pom.xml
index 614166754c..d9d07ed6f9 100644
--- a/java/systests/pom.xml
+++ b/java/systests/pom.xml
@@ -62,7 +62,8 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
- <skip>true</skip>
+ <testSourceDirectory>${basedir}/src/main</testSourceDirectory>
+ <testClassesDirectory>target/classes</testClassesDirectory>
</configuration>
</plugin>
@@ -89,3 +90,4 @@
</resources>
</build>
</project>
+
diff --git a/java/systests/src/main/java/org/apache/qpid/server/ack/TxAckTest.java b/java/systests/src/main/java/org/apache/qpid/server/ack/TxAckTest.java
index 9fcd88b1a8..3ee8277eba 100644
--- a/java/systests/src/main/java/org/apache/qpid/server/ack/TxAckTest.java
+++ b/java/systests/src/main/java/org/apache/qpid/server/ack/TxAckTest.java
@@ -24,6 +24,8 @@ import junit.framework.TestCase;
import org.apache.qpid.AMQException;
import org.apache.qpid.framing.BasicPublishBody;
import org.apache.qpid.framing.AMQShortString;
+import org.apache.qpid.framing.ContentHeaderBody;
+import org.apache.qpid.framing.AMQFrameDecodingException;
import org.apache.qpid.framing.abstraction.MessagePublishInfo;
import org.apache.qpid.server.RequiredDeliveryException;
import org.apache.qpid.server.queue.AMQMessage;
@@ -102,7 +104,7 @@ public class TxAckTest extends TestCase
_storeContext, null,
new LinkedList<RequiredDeliveryException>(),
new HashSet<Long>());
- for(int i = 0; i < messageCount; i++)
+ for (int i = 0; i < messageCount; i++)
{
long deliveryTag = i + 1;
@@ -144,7 +146,7 @@ public class TxAckTest extends TestCase
private void assertCount(List<Long> tags, int expected)
{
- for(long tag : tags)
+ for (long tag : tags)
{
UnacknowledgedMessage u = _map.get(tag);
assertTrue("Message not found for tag " + tag, u != null);
@@ -161,6 +163,7 @@ public class TxAckTest extends TestCase
assertCount(_unacked, 0);
}
+
void undoPrepare()
{
_op.consolidate();
@@ -175,7 +178,6 @@ public class TxAckTest extends TestCase
_op.consolidate();
_op.commit(_storeContext);
-
//check acked messages are removed from map
Set<Long> keys = new HashSet<Long>(_map.getDeliveryTags());
keys.retainAll(_acked);
@@ -195,6 +197,20 @@ public class TxAckTest extends TestCase
TestMessage(long tag, long messageId, MessagePublishInfo publishBody, TransactionalContext txnContext)
{
super(messageId, publishBody, txnContext);
+ try
+ {
+ setContentHeaderBody(new ContentHeaderBody()
+ {
+ public int getSize()
+ {
+ return 1;
+ }
+ });
+ }
+ catch (AMQException e)
+ {
+ // won't happen
+ }
_tag = tag;
}
diff --git a/java/systests/src/main/java/org/apache/qpid/server/channel/MaxChannelsTest.java b/java/systests/src/main/java/org/apache/qpid/server/channel/MaxChannelsTest.java
new file mode 100644
index 0000000000..5ddccb8a7b
--- /dev/null
+++ b/java/systests/src/main/java/org/apache/qpid/server/channel/MaxChannelsTest.java
@@ -0,0 +1,75 @@
+/*
+ *
+ * Copyright (c) 2006 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package org.apache.qpid.server.protocol;
+
+import junit.framework.TestCase;
+import org.apache.mina.common.IoSession;
+import org.apache.qpid.codec.AMQCodecFactory;
+import org.apache.qpid.server.AMQChannel;
+import org.apache.qpid.server.virtualhost.VirtualHost;
+import org.apache.qpid.server.registry.IApplicationRegistry;
+import org.apache.qpid.server.registry.ApplicationRegistry;
+import org.apache.qpid.server.exchange.ExchangeRegistry;
+import org.apache.qpid.server.queue.QueueRegistry;
+import org.apache.qpid.server.queue.AMQQueue;
+import org.apache.qpid.server.store.MessageStore;
+import org.apache.qpid.server.store.SkeletonMessageStore;
+import org.apache.qpid.AMQException;
+import org.apache.qpid.protocol.AMQConstant;
+import org.apache.qpid.framing.AMQShortString;
+
+import javax.management.JMException;
+
+/** Test class to test MBean operations for AMQMinaProtocolSession. */
+public class MaxChannelsTest extends TestCase
+{
+// private MessageStore _messageStore = new SkeletonMessageStore();
+
+ public void testChannels() throws Exception
+ {
+ IApplicationRegistry appRegistry = ApplicationRegistry.getInstance();
+ AMQMinaProtocolSession _protocolSession = new AMQMinaProtocolSession(new MockIoSession(),
+ appRegistry.getVirtualHostRegistry(),
+ new AMQCodecFactory(true),
+ null);
+ _protocolSession.setVirtualHost(appRegistry.getVirtualHostRegistry().getVirtualHost("test"));
+
+ // check the channel count is correct
+ int channelCount = _protocolSession.getChannels().size();
+ assertEquals("Initial channel count wrong", 0, channelCount);
+
+ long maxChannels = 10L;
+ _protocolSession.setMaximumNumberOfChannels(maxChannels);
+ assertEquals("Number of channels not correctly set.", new Long(maxChannels), _protocolSession.getMaximumNumberOfChannels());
+
+
+ try
+ {
+ for (long currentChannel = 0L; currentChannel < maxChannels; currentChannel++)
+ {
+ _protocolSession.addChannel(new AMQChannel(_protocolSession, (int) currentChannel, null, null));
+ }
+ }
+ catch (AMQException e)
+ {
+ assertEquals("Wrong exception recevied.", e.getErrorCode(), AMQConstant.NOT_ALLOWED);
+ }
+ assertEquals("Maximum number of channels not set.", new Long(maxChannels), new Long(_protocolSession.getChannels().size()));
+ }
+
+}
diff --git a/java/systests/src/main/java/org/apache/qpid/server/exchange/ReturnUnroutableMandatoryMessageTest.java b/java/systests/src/main/java/org/apache/qpid/server/exchange/ReturnUnroutableMandatoryMessageTest.java
index 87491ed3d3..ca352b2fd7 100644
--- a/java/systests/src/main/java/org/apache/qpid/server/exchange/ReturnUnroutableMandatoryMessageTest.java
+++ b/java/systests/src/main/java/org/apache/qpid/server/exchange/ReturnUnroutableMandatoryMessageTest.java
@@ -22,6 +22,8 @@ public class ReturnUnroutableMandatoryMessageTest extends TestCase implements Ex
private static final Logger _logger = Logger.getLogger(ReturnUnroutableMandatoryMessageTest.class);
private final List<Message> _bouncedMessageList = Collections.synchronizedList(new ArrayList<Message>());
+ private static final String VIRTUALHOST = "test";
+ private static final String BROKER = "vm://:1";
static
{
@@ -53,10 +55,10 @@ public class ReturnUnroutableMandatoryMessageTest extends TestCase implements Ex
*
* @throws Exception
*/
- public void testReturnUnroutableMandatoryMessage() throws Exception
+ public void testReturnUnroutableMandatoryMessage_HEADERS() throws Exception
{
_bouncedMessageList.clear();
- Connection con = new AMQConnection("vm://:1", "guest", "guest", "consumer1", "/test");
+ Connection con = new AMQConnection(BROKER, "guest", "guest", "consumer1", VIRTUALHOST);
AMQSession consumerSession = (AMQSession) con.createSession(false, Session.CLIENT_ACKNOWLEDGE);
@@ -70,7 +72,7 @@ public class ReturnUnroutableMandatoryMessageTest extends TestCase implements Ex
//((AMQSession) consumerSession).declareExchangeSynch(ExchangeDefaults.HEADERS_EXCHANGE_NAME, ExchangeDefaults.HEADERS_EXCHANGE_CLASS);
// This is the default now
- Connection con2 = new AMQConnection("vm://:1", "guest", "guest", "producer1", "/test");
+ Connection con2 = new AMQConnection(BROKER, "guest", "guest", "producer1", VIRTUALHOST);
con2.setExceptionListener(this);
AMQSession producerSession = (AMQSession) con2.createSession(false, Session.CLIENT_ACKNOWLEDGE);
@@ -127,6 +129,138 @@ public class ReturnUnroutableMandatoryMessageTest extends TestCase implements Ex
}
+ public void testReturnUnroutableMandatoryMessage_QUEUE() throws Exception
+ {
+ _bouncedMessageList.clear();
+ Connection con = new AMQConnection(BROKER, "guest", "guest", "consumer1", VIRTUALHOST);
+
+
+ AMQSession consumerSession = (AMQSession) con.createSession(false, Session.CLIENT_ACKNOWLEDGE);
+
+ AMQQueue valid_queue = new AMQQueue(ExchangeDefaults.DIRECT_EXCHANGE_CLASS, "testReturnUnroutableMandatoryMessage_QUEUE");
+ AMQQueue invalid_queue = new AMQQueue(ExchangeDefaults.DIRECT_EXCHANGE_CLASS, "testReturnUnroutableMandatoryMessage_QUEUE_INVALID");
+ MessageConsumer consumer = consumerSession.createConsumer(valid_queue);
+
+ //force synch to ensure the consumer has resulted in a bound queue
+ //((AMQSession) consumerSession).declareExchangeSynch(ExchangeDefaults.HEADERS_EXCHANGE_NAME, ExchangeDefaults.HEADERS_EXCHANGE_CLASS);
+ // This is the default now
+
+ Connection con2 = new AMQConnection(BROKER, "guest", "guest", "producer1", VIRTUALHOST);
+
+ con2.setExceptionListener(this);
+ AMQSession producerSession = (AMQSession) con2.createSession(false, Session.CLIENT_ACKNOWLEDGE);
+
+ // Need to start the "producer" connection in order to receive bounced messages
+ _logger.info("Starting producer connection");
+ con2.start();
+
+
+ MessageProducer nonMandatoryProducer = producerSession.createProducer(valid_queue, false, false);
+ MessageProducer mandatoryProducer = producerSession.createProducer(invalid_queue);
+
+ // First test - should be routed
+ _logger.info("Sending non-mandatory message");
+ TextMessage msg1 = producerSession.createTextMessage("msg1");
+ nonMandatoryProducer.send(msg1);
+
+ // Second test - should be bounced
+ _logger.info("Sending non-routable mandatory message");
+ TextMessage msg2 = producerSession.createTextMessage("msg2");
+ mandatoryProducer.send(msg2);
+
+
+ _logger.info("Starting consumer connection");
+ con.start();
+ TextMessage tm = (TextMessage) consumer.receive(1000L);
+
+ assertTrue("No message routed to receiver", tm != null);
+ assertTrue("Wrong message routed to receiver: " + tm.getText(), "msg1".equals(tm.getText()));
+
+ try
+ {
+ Thread.sleep(1000L);
+ }
+ catch (InterruptedException e)
+ {
+ ;
+ }
+
+ assertTrue("Wrong number of messages bounced (expect 1): " + _bouncedMessageList.size(), _bouncedMessageList.size() == 1);
+ Message m = _bouncedMessageList.get(0);
+ assertTrue("Wrong message bounced: " + m.toString(), m.toString().contains("msg2"));
+
+
+ con.close();
+ con2.close();
+ }
+
+
+ public void testReturnUnroutableMandatoryMessage_TOPIC() throws Exception
+ {
+ _bouncedMessageList.clear();
+ Connection con = new AMQConnection(BROKER, "guest", "guest", "consumer1", VIRTUALHOST);
+
+
+ AMQSession consumerSession = (AMQSession) con.createSession(false, Session.CLIENT_ACKNOWLEDGE);
+
+ AMQTopic valid_topic = new AMQTopic(ExchangeDefaults.TOPIC_EXCHANGE_CLASS, "test.Return.Unroutable.Mandatory.Message.TOPIC");
+ AMQTopic invalid_topic = new AMQTopic(ExchangeDefaults.TOPIC_EXCHANGE_CLASS, "test.Return.Unroutable.Mandatory.Message.TOPIC.invalid");
+ MessageConsumer consumer = consumerSession.createConsumer(valid_topic);
+
+ //force synch to ensure the consumer has resulted in a bound queue
+ //((AMQSession) consumerSession).declareExchangeSynch(ExchangeDefaults.HEADERS_EXCHANGE_NAME, ExchangeDefaults.HEADERS_EXCHANGE_CLASS);
+ // This is the default now
+
+ Connection con2 = new AMQConnection(BROKER, "guest", "guest", "producer1", VIRTUALHOST);
+
+ con2.setExceptionListener(this);
+ AMQSession producerSession = (AMQSession) con2.createSession(false, Session.CLIENT_ACKNOWLEDGE);
+
+ // Need to start the "producer" connection in order to receive bounced messages
+ _logger.info("Starting producer connection");
+ con2.start();
+
+
+ MessageProducer nonMandatoryProducer = producerSession.createProducer(valid_topic, false, false);
+ MessageProducer mandatoryProducer = producerSession.createProducer(invalid_topic);
+
+ // First test - should be routed
+ _logger.info("Sending non-mandatory message");
+ TextMessage msg1 = producerSession.createTextMessage("msg1");
+ nonMandatoryProducer.send(msg1);
+
+ // Second test - should be bounced
+ _logger.info("Sending non-routable mandatory message");
+ TextMessage msg2 = producerSession.createTextMessage("msg2");
+ mandatoryProducer.send(msg2);
+
+
+ _logger.info("Starting consumer connection");
+ con.start();
+ TextMessage tm = (TextMessage) consumer.receive(1000L);
+
+ assertTrue("No message routed to receiver", tm != null);
+ assertTrue("Wrong message routed to receiver: " + tm.getText(), "msg1".equals(tm.getText()));
+
+ try
+ {
+ Thread.sleep(1000L);
+ }
+ catch (InterruptedException e)
+ {
+ ;
+ }
+
+ assertTrue("Wrong number of messages bounced (expect 1): " + _bouncedMessageList.size(), _bouncedMessageList.size() == 1);
+ Message m = _bouncedMessageList.get(0);
+ assertTrue("Wrong message bounced: " + m.toString(), m.toString().contains("msg2"));
+
+
+ con.close();
+ con2.close();
+ }
+
+
public static junit.framework.Test suite()
{
return new junit.framework.TestSuite(ReturnUnroutableMandatoryMessageTest.class);
diff --git a/java/systests/src/main/java/org/apache/qpid/server/failure/HeapExhaustion.java b/java/systests/src/main/java/org/apache/qpid/server/failure/HeapExhaustion.java
index 52eb5414ff..228bd1ec6f 100644
--- a/java/systests/src/main/java/org/apache/qpid/server/failure/HeapExhaustion.java
+++ b/java/systests/src/main/java/org/apache/qpid/server/failure/HeapExhaustion.java
@@ -16,7 +16,7 @@ public class HeapExhaustion extends TestCase
{
private static final Logger _logger = Logger.getLogger(HeapExhaustion.class);
- protected QpidClientConnection conn;
+ protected QpidClientConnection conn;
protected final String BROKER = "localhost";
protected final String vhost = "/test";
protected final String queue = "direct://amq.direct//queue";
@@ -65,7 +65,7 @@ public class HeapExhaustion extends TestCase
conn.put(queue, payload, 1);
copies++;
total += size;
- _logger.info("put copy " + copies + " OK for total bytes: " + total);
+ System.out.println("put copy " + copies + " OK for total bytes: " + total);
}
}
@@ -85,7 +85,7 @@ public class HeapExhaustion extends TestCase
conn.put(queue, payload, 1);
copies++;
total += size;
- _logger.debug("put copy " + copies + " OK for total bytes: " + total);
+ System.out.println("put copy " + copies + " OK for total bytes: " + total);
Thread.sleep(200);
}
}
diff --git a/java/systests/src/main/java/org/apache/qpid/server/queue/ConcurrencyTest.java b/java/systests/src/main/java/org/apache/qpid/server/queue/ConcurrencyTestDisabled.java
index 4971db2d28..068f37574d 100644
--- a/java/systests/src/main/java/org/apache/qpid/server/queue/ConcurrencyTest.java
+++ b/java/systests/src/main/java/org/apache/qpid/server/queue/ConcurrencyTestDisabled.java
@@ -34,7 +34,7 @@ import java.util.concurrent.Executor;
* Tests delivery in the face of concurrent incoming _messages, subscription alterations
* and attempts to asynchronously process queued _messages.
*/
-public class ConcurrencyTest extends MessageTestHelper
+public class ConcurrencyTestDisabled extends MessageTestHelper
{
private final Random random = new Random();
@@ -55,7 +55,7 @@ public class ConcurrencyTest extends MessageTestHelper
private boolean failed;
private VirtualHost _virtualHost;
- public ConcurrencyTest() throws Exception
+ public ConcurrencyTestDisabled() throws Exception
{
IApplicationRegistry applicationRegistry = ApplicationRegistry.getInstance();
@@ -259,7 +259,7 @@ public class ConcurrencyTest extends MessageTestHelper
public static junit.framework.Test suite()
{
- return new junit.framework.TestSuite(ConcurrencyTest.class);
+ return new junit.framework.TestSuite(ConcurrencyTestDisabled.class);
}
}
diff --git a/java/systests/src/main/java/org/apache/qpid/server/queue/MessageTestHelper.java b/java/systests/src/main/java/org/apache/qpid/server/queue/MessageTestHelper.java
index 03a56df487..88272023e8 100644
--- a/java/systests/src/main/java/org/apache/qpid/server/queue/MessageTestHelper.java
+++ b/java/systests/src/main/java/org/apache/qpid/server/queue/MessageTestHelper.java
@@ -29,6 +29,7 @@ import org.apache.qpid.server.store.SkeletonMessageStore;
import org.apache.qpid.server.store.StoreContext;
import org.apache.qpid.server.registry.ApplicationRegistry;
import org.apache.qpid.server.util.TestApplicationRegistry;
+import org.apache.qpid.server.util.NullApplicationRegistry;
import org.apache.qpid.server.txn.TransactionalContext;
import org.apache.qpid.server.txn.NonTransactionalContext;
import org.apache.qpid.server.RequiredDeliveryException;
@@ -51,7 +52,7 @@ class MessageTestHelper extends TestCase
MessageTestHelper() throws Exception
{
- ApplicationRegistry.initialise(new TestApplicationRegistry());
+ ApplicationRegistry.initialise(new NullApplicationRegistry());
}
AMQMessage message() throws AMQException
diff --git a/java/systests/src/main/java/org/apache/qpid/server/queue/PersistentTest.java b/java/systests/src/main/java/org/apache/qpid/server/queue/PersistentTestManual.java
index 4ad10b68ff..5abbbd2aae 100644
--- a/java/systests/src/main/java/org/apache/qpid/server/queue/PersistentTest.java
+++ b/java/systests/src/main/java/org/apache/qpid/server/queue/PersistentTestManual.java
@@ -37,9 +37,9 @@ import javax.jms.TextMessage;
import java.io.IOException;
import java.util.Properties;
-public class PersistentTest
+public class PersistentTestManual
{
- private static final Logger _logger = Logger.getLogger(PersistentTest.class);
+ private static final Logger _logger = Logger.getLogger(PersistentTestManual.class);
private static final String QUEUE = "direct://amq.direct//PersistentTest-Queue2?durable='true',exclusive='true'";
@@ -56,7 +56,7 @@ public class PersistentTest
private String _password;
private String _virtualpath;
- public PersistentTest(Properties overrides)
+ public PersistentTestManual(Properties overrides)
{
properties = new Properties(defaults);
properties.putAll(overrides);
@@ -257,12 +257,12 @@ public class PersistentTest
public static void main(String[] args)
{
- PersistentTest test;
+ PersistentTestManual test;
Properties options = CommandLineParser.processCommandLine(args, new CommandLineParser(new String[][]{}));
- test = new PersistentTest(options);
+ test = new PersistentTestManual(options);
try
{
test.test();
diff --git a/java/systests/src/main/java/org/apache/qpid/test/VMTestCase.java b/java/systests/src/main/java/org/apache/qpid/test/VMTestCase.java
index 31fd77691d..540c91ddaf 100644
--- a/java/systests/src/main/java/org/apache/qpid/test/VMTestCase.java
+++ b/java/systests/src/main/java/org/apache/qpid/test/VMTestCase.java
@@ -114,4 +114,9 @@ public class VMTestCase extends TestCase
TransportConnection.killVMBroker(1);
super.tearDown();
}
+
+ public void testDummyinVMTestCase()
+ {
+ // keep maven happy
+ }
}
diff --git a/java/systests/src/main/java/org/apache/qpid/test/client/QueueBrowserTest.java b/java/systests/src/main/java/org/apache/qpid/test/client/QueueBrowserTest.java
index ac65eec979..ec9df8f1b3 100644
--- a/java/systests/src/main/java/org/apache/qpid/test/client/QueueBrowserTest.java
+++ b/java/systests/src/main/java/org/apache/qpid/test/client/QueueBrowserTest.java
@@ -20,8 +20,8 @@
*/
package org.apache.qpid.test.client;
-import org.apache.qpid.test.VMTestCase;
import org.apache.log4j.Logger;
+import org.apache.qpid.test.VMTestCase;
import javax.jms.Queue;
import javax.jms.ConnectionFactory;
@@ -36,6 +36,8 @@ import javax.jms.QueueReceiver;
import javax.jms.Message;
import java.util.Enumeration;
+import junit.framework.TestCase;
+
public class QueueBrowserTest extends VMTestCase
{
private static final Logger _logger = Logger.getLogger(QueueBrowserTest.class);
@@ -87,7 +89,7 @@ public class QueueBrowserTest extends VMTestCase
*
*/
- public void queueBrowserMsgsRemainOnQueueTest() throws JMSException
+ public void testQueueBrowserMsgsRemainOnQueue() throws JMSException
{
// create QueueBrowser