Fix fileEncoding violations for checkstyle
[groupbasedpolicy.git] / renderers / iovisor / src / test / java / org / opendaylight / groupbasedpolicy / renderer / iovisor / sf / ClassificationResultTest.java
1 /*
2  * Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8
9 package org.opendaylight.groupbasedpolicy.renderer.iovisor.sf;
10
11 import static org.junit.Assert.assertEquals;
12 import static org.junit.Assert.assertFalse;
13 import static org.junit.Assert.assertTrue;
14
15 import java.util.ArrayList;
16 import java.util.List;
17
18 import org.junit.Before;
19 import org.junit.Test;
20
21 public class ClassificationResultTest {
22
23     private static final String ERROR_MESSAGE = "error message";
24     private ClassificationResult resultOk;
25     private ClassificationResult resultError;
26
27     @Before
28     public void init() {
29         List<String> list = new ArrayList<>();
30         list.add("string");
31         resultOk = new ClassificationResult(list);
32         resultError = new ClassificationResult(ERROR_MESSAGE);
33     }
34
35     @Test
36     public void testConstructor_Result() {
37         assertTrue(resultOk.isSuccessfull());
38     }
39
40     @Test
41     public void testConstructor_ErrorMsg() {
42         assertFalse(resultError.isSuccessfull());
43     }
44
45     @Test
46     public void testGetErrorMessage() {
47         assertEquals(resultOk.getErrorMessage(), ClassificationResult.DEFAULT_ERROR_MESSAGE);
48         assertEquals(resultError.getErrorMessage(), ERROR_MESSAGE);
49     }
50
51 }