- Timestamp:
- 01/12/09 08:49:32 (20 months ago)
- Author:
- jmoore
- Message:
-
OmeroClustering : Minor Ring changes before moving to jdbc
(cherry picked from commit e149432bb345abc61f7be7c01fbca64848e553e2)
- Files:
-
Legend:
- Unmodified
- Added
- Removed
-
|
r3243
|
r3264
|
|
| 7 | 7 | package ome.services.blitz.test.utests; |
| 8 | 8 | |
| 9 | | import junit.framework.TestCase; |
| 10 | 9 | import ome.services.blitz.fire.Ring; |
| 11 | 10 | |
| 12 | 11 | import org.jgroups.blocks.ReplicatedTree; |
| | 12 | import org.jmock.Mock; |
| | 13 | import org.jmock.MockObjectTestCase; |
| 13 | 14 | import org.testng.annotations.AfterClass; |
| 14 | 15 | import org.testng.annotations.BeforeClass; |
| | 16 | import org.testng.annotations.BeforeTest; |
| 15 | 17 | import org.testng.annotations.Test; |
| 16 | 18 | |
| … |
… |
|
| 19 | 21 | * @since Beta4 |
| 20 | 22 | */ |
| 21 | | public class RingTest extends TestCase { |
| | 23 | public class RingTest extends MockObjectTestCase { |
| 22 | 24 | |
| 23 | | // Using tree directly since the ring hides it |
| 24 | 25 | ReplicatedTree tree1, tree2; |
| | 26 | Ice.Communicator ic; |
| | 27 | Mock mockIc; |
| 25 | 28 | |
| 26 | 29 | @BeforeClass |
| … |
… |
|
| 30 | 33 | tree1.start(); |
| 31 | 34 | tree2.start(); |
| | 35 | } |
| | 36 | |
| | 37 | @BeforeTest |
| | 38 | public void setupMethod() throws Exception { |
| | 39 | mockIc = mock(Ice.Communicator.class); |
| | 40 | ic = (Ice.Communicator) mockIc.proxy(); |
| 32 | 41 | } |
| 33 | 42 | |
| … |
… |
|
| 41 | 50 | public void testMain() throws Exception { |
| 42 | 51 | Ring.main(new String[]{}); |
| | 52 | } |
| | 53 | |
| | 54 | @Test |
| | 55 | public void testFirstTakesOver() throws Exception { |
| | 56 | Ring one = new Ring("takeover", "session_ring.xml"); |
| | 57 | one.init(ic, "one"); |
| | 58 | assertEquals("one", one.getRedirect()); |
| | 59 | Ring two = new Ring("takeover", "session_ring.xml"); |
| | 60 | two.init(ic, "two"); |
| | 61 | assertEquals("one", two.getRedirect()); |
| | 62 | } |
| | 63 | |
| | 64 | @Test |
| | 65 | public void testSeveralThreadsStartAndOnlyOneValueIsSet() throws Exception { |
| | 66 | fail(); |
| | 67 | } |
| | 68 | |
| | 69 | @Test |
| | 70 | public void testHandlesMissingServers() throws Exception { |
| | 71 | fail(); |
| | 72 | } |
| | 73 | |
| | 74 | @Test |
| | 75 | public void testRemovesUnreachable() throws Exception { |
| | 76 | fail(); |
| | 77 | } |
| | 78 | |
| | 79 | @Test |
| | 80 | public void testReaddsSelfIfTemporarilyUnreachable() throws Exception { |
| | 81 | fail(); |
| 43 | 82 | } |
| 44 | 83 | |
| … |
… |
|
| 64 | 103 | Ring ring = new Ring("test", "session_ring.xml"); |
| 65 | 104 | ring.printTree("/SESSIONS"); |
| | 105 | ring.destroy(); |
| 66 | 106 | } |
| 67 | 107 | |
Download in other formats:
1.2.1-PRO © 2008-2009
agile42 all
rights reserved
(this page was served in: 0.86831 sec.)