-/*\r
- * Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.\r
- *\r
- * This program and the accompanying materials are made available under the\r
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
- * and is available at http://www.eclipse.org/legal/epl-v10.html\r
- */\r
-package org.opendaylight.groupbasedpolicy.renderer.ofoverlay.statistics.flowcache;\r
-\r
-import static org.junit.Assert.assertEquals;\r
-import static org.junit.Assert.assertNotNull;\r
-import static org.junit.Assert.fail;\r
-\r
-import org.junit.Before;\r
-import org.junit.Test;\r
-import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.HasDirection.Direction;\r
-\r
-public class FlowCacheBuilderTest {\r
-\r
- private static final String NAME_1 = "name_1";\r
- private static final Direction direction = Direction.Bidirectional;\r
- private static final String VALUE_1 = "value_1";\r
- private FlowCacheDefinition flowCacheDefinition;\r
- private FlowCache.FlowCacheBuilder builder;\r
-\r
- @Before\r
- public void init() {\r
- builder = new FlowCache.FlowCacheBuilder();\r
- flowCacheDefinition = FlowCacheDefinition.builder().setValue(VALUE_1).build();\r
- }\r
-\r
- @Test\r
- public void testConstructor() {\r
- FlowCache.FlowCacheBuilder b = null;\r
- try {\r
- b = new FlowCache.FlowCacheBuilder();\r
- } catch (Exception e) {\r
- fail("Exception thrown: " + e.getMessage());\r
- }\r
- assertNotNull(b);\r
- }\r
-\r
- @Test\r
- public void testSetName() {\r
- builder.setName(NAME_1);\r
-\r
- assertEquals(NAME_1, builder.getName());\r
- }\r
-\r
- @Test\r
- public void testSetDefinition() {\r
- builder.setDefinition(flowCacheDefinition);\r
-\r
- assertEquals(VALUE_1, builder.getDefinition().getValue());\r
- }\r
-\r
- @Test\r
- public void testSetDirection() {\r
- builder.setDirection(direction);\r
-\r
- assertEquals(direction, builder.getDirection());\r
- }\r
-\r
- @Test\r
- public void testBuild() {\r
- FlowCache cache = builder.setName(NAME_1)\r
- .setDefinition(flowCacheDefinition)\r
- .setDirection(direction)\r
- .build();\r
-\r
- assertNotNull(cache);\r
- assertEquals(NAME_1, cache.getName());\r
- assertEquals(flowCacheDefinition, cache.getDefinition());\r
- assertEquals(direction, cache.getDirection());\r
- }\r
-\r
-}\r
+/*
+ * Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.groupbasedpolicy.renderer.ofoverlay.statistics.flowcache;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.fail;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.HasDirection.Direction;
+
+public class FlowCacheBuilderTest {
+
+ private static final String NAME_1 = "name_1";
+ private static final Direction direction = Direction.Bidirectional;
+ private static final String VALUE_1 = "value_1";
+ private FlowCacheDefinition flowCacheDefinition;
+ private FlowCache.FlowCacheBuilder builder;
+
+ @Before
+ public void init() {
+ builder = new FlowCache.FlowCacheBuilder();
+ flowCacheDefinition = FlowCacheDefinition.builder().setValue(VALUE_1).build();
+ }
+
+ @Test
+ public void testConstructor() {
+ FlowCache.FlowCacheBuilder b = null;
+ try {
+ b = new FlowCache.FlowCacheBuilder();
+ } catch (Exception e) {
+ fail("Exception thrown: " + e.getMessage());
+ }
+ assertNotNull(b);
+ }
+
+ @Test
+ public void testSetName() {
+ builder.setName(NAME_1);
+
+ assertEquals(NAME_1, builder.getName());
+ }
+
+ @Test
+ public void testSetDefinition() {
+ builder.setDefinition(flowCacheDefinition);
+
+ assertEquals(VALUE_1, builder.getDefinition().getValue());
+ }
+
+ @Test
+ public void testSetDirection() {
+ builder.setDirection(direction);
+
+ assertEquals(direction, builder.getDirection());
+ }
+
+ @Test
+ public void testBuild() {
+ FlowCache cache = builder.setName(NAME_1)
+ .setDefinition(flowCacheDefinition)
+ .setDirection(direction)
+ .build();
+
+ assertNotNull(cache);
+ assertEquals(NAME_1, cache.getName());
+ assertEquals(flowCacheDefinition, cache.getDefinition());
+ assertEquals(direction, cache.getDirection());
+ }
+
+}