Fix Test values comparison 67/69367/2
authorClaudio D. Gasparini <claudio.gasparini@pantheon.tech>
Mon, 12 Mar 2018 09:21:55 +0000 (10:21 +0100)
committerClaudio D. Gasparini <claudio.gasparini@pantheon.tech>
Mon, 12 Mar 2018 12:02:38 +0000 (13:02 +0100)
use { instead of [

Change-Id: I2750e4d00a389f6ca1051851749cb6f21f9f5538
Signed-off-by: Claudio D. Gasparini <claudio.gasparini@pantheon.tech>
bgp/cli/src/test/resources/empty-global.txt
bgp/cli/src/test/resources/global.txt
bgp/rib-impl/src/test/java/org/opendaylight/protocol/bgp/rib/impl/PeerTest.java
concepts/src/test/java/org/opendaylight/protocol/concepts/ASNumberTest.java

index 0e4d21a311ce822d4facc3accad2b1eb4bd17aab..ffe526bb00b3d5490cfdbb5a3d4e019d89844d39 100644 (file)
@@ -1,13 +1,13 @@
-Attribute              | Value                
-----------------------------------------------
-                       |                      
-RIB state              |                      
-====================== |                      
-Router Id              | test-rib             
-As                     | AsNumber [_value=100]
-Total Paths            | 1                    
-Total Prefixes         | 2                    
-                       |                      
-AFI/SAFI state         |                      
-====================== |                      
-Family                 | IPV4UNICAST          
+Attribute              | Value               
+---------------------------------------------
+                       |                     
+RIB state              |                     
+====================== |                     
+Router Id              | test-rib            
+As                     | AsNumber{_value=100}
+Total Paths            | 1                   
+Total Prefixes         | 2                   
+                       |                     
+AFI/SAFI state         |                     
+====================== |                     
+Family                 | IPV4UNICAST         
index d3fec82b7042d99cde04463b9e27f5ad1623836d..9e7f148ba98ce5216755316eedbb00410acecfee 100644 (file)
@@ -1,15 +1,15 @@
-Attribute              | Value                
-----------------------------------------------
-                       |                      
-RIB state              |                      
-====================== |                      
-Router Id              | test-rib             
-As                     | AsNumber [_value=100]
-Total Paths            | 1                    
-Total Prefixes         | 2                    
-                       |                      
-AFI/SAFI state         |                      
-====================== |                      
-Family                 | IPV4UNICAST          
-Total Paths            | 3                    
-Total Prefixes         | 4                    
+Attribute              | Value               
+---------------------------------------------
+                       |                     
+RIB state              |                     
+====================== |                     
+Router Id              | test-rib            
+As                     | AsNumber{_value=100}
+Total Paths            | 1                   
+Total Prefixes         | 2                   
+                       |                     
+AFI/SAFI state         |                     
+====================== |                     
+Family                 | IPV4UNICAST         
+Total Paths            | 3                   
+Total Prefixes         | 4                   
index e4ad016ac2f30cbcececaf6d7e11defd1d12cc6d..9727729982c0d64a312640e48062498bc4dac19c 100644 (file)
@@ -11,6 +11,7 @@ import static org.junit.Assert.assertArrayEquals;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.fail;
 import static org.mockito.Matchers.any;
+import static org.mockito.Mockito.*;
 import static org.mockito.Mockito.doAnswer;
 import static org.mockito.Mockito.doReturn;
 
@@ -105,14 +106,14 @@ public class PeerTest extends AbstractRIBTestSetup {
                 this.routes.put((YangInstanceIdentifier) args[1], node);
             }
             return args[1];
-        }).when(getTransaction()).put(Mockito.eq(LogicalDatastoreType.OPERATIONAL),
+        }).when(getTransaction()).put(eq(LogicalDatastoreType.OPERATIONAL),
                 any(YangInstanceIdentifier.class), any(NormalizedNode.class));
 
         doAnswer(invocation -> {
             final Object[] args = invocation.getArguments();
             this.routes.remove(args[1]);
             return args[1];
-        }).when(getTransaction()).delete(Mockito.eq(LogicalDatastoreType.OPERATIONAL), any(YangInstanceIdentifier.class));
+        }).when(getTransaction()).delete(eq(LogicalDatastoreType.OPERATIONAL), any(YangInstanceIdentifier.class));
     }
 
     @Test
@@ -141,10 +142,10 @@ public class PeerTest extends AbstractRIBTestSetup {
         assertEquals(this.neighborAddress.getIpv4Address().getValue(), this.classic.getName());
         this.classic.onSessionUp(this.session);
         Assert.assertArrayEquals(new byte[]{1, 1, 1, 1}, this.classic.getRawIdentifier());
-        assertEquals("BGPPeer{name=127.0.0.1, tables=[TablesKey" +
-                " [_afi=class org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang" +
-                ".bgp.types.rev130919.Ipv4AddressFamily, _safi=class org.opendaylight.yang.gen." +
-                "v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.UnicastSubsequentAddressFamily]]}",
+        assertEquals("BGPPeer{name=127.0.0.1, tables=[TablesKey{_afi=class org.opendaylight.yang.gen.v1.urn"
+                        + ".opendaylight.params.xml.ns.yang.bgp.types.rev130919.Ipv4AddressFamily,"
+                        + " _safi=class org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types"
+                        + ".rev130919.UnicastSubsequentAddressFamily}]}",
                 this.classic.toString());
 
         final Nlri n1 = new NlriBuilder().setPrefix(new Ipv4Prefix("8.0.1.0/28")).build();
@@ -211,15 +212,15 @@ public class PeerTest extends AbstractRIBTestSetup {
     }
 
     private void mockSession() {
-        final EventLoop eventLoop = Mockito.mock(EventLoop.class);
-        final Channel channel = Mockito.mock(Channel.class);
-        final ChannelPipeline pipeline = Mockito.mock(ChannelPipeline.class);
+        final EventLoop eventLoop = mock(EventLoop.class);
+        final Channel channel = mock(Channel.class);
+        final ChannelPipeline pipeline = mock(ChannelPipeline.class);
         doReturn(null).when(eventLoop).schedule(any(Runnable.class), any(long.class), any(TimeUnit.class));
         doReturn(eventLoop).when(channel).eventLoop();
         doReturn(Boolean.TRUE).when(channel).isWritable();
         doReturn(null).when(channel).close();
         doReturn(pipeline).when(channel).pipeline();
-        Mockito.doCallRealMethod().when(channel).toString();
+        doCallRealMethod().when(channel).toString();
         doReturn(pipeline).when(pipeline).addLast(any(ChannelHandler.class));
         doReturn(new DefaultChannelPromise(channel)).when(channel).writeAndFlush(any(Notification.class));
         doReturn(new InetSocketAddress("localhost", 12345)).when(channel).remoteAddress();
index f25a4e7c8ebde57333087a2dd2b44b260b699961..dee993b5e0e2bdd1b1eb7c504a57cb7253a418dd 100644 (file)
@@ -57,7 +57,7 @@ public class ASNumberTest {
 
     @Test
     public void testToString() {
-        assertEquals("AsNumber [_value=4294967295]", this.asn1.toString());
-        assertEquals("AsNumber [_value=200]", this.asn3.toString());
+        assertEquals("AsNumber{_value=4294967295}", this.asn1.toString());
+        assertEquals("AsNumber{_value=200}", this.asn3.toString());
     }
 }