2 * Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
\r
4 * This program and the accompanying materials are made available under the
\r
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
\r
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
\r
9 package org.opendaylight.groupbasedpolicy.renderer.iovisor.sf;
\r
11 import static org.junit.Assert.assertEquals;
\r
12 import static org.junit.Assert.assertFalse;
\r
13 import static org.junit.Assert.assertTrue;
\r
15 import java.util.ArrayList;
\r
16 import java.util.List;
\r
18 import org.junit.Before;
\r
19 import org.junit.Test;
\r
21 public class ClassificationResultTest {
\r
23 private static final String ERROR_MESSAGE = "error message";
\r
24 private ClassificationResult resultOk;
\r
25 private ClassificationResult resultError;
\r
28 public void init() {
\r
29 List<String> list = new ArrayList<>();
\r
31 resultOk = new ClassificationResult(list);
\r
32 resultError = new ClassificationResult(ERROR_MESSAGE);
\r
36 public void testConstructor_Result() {
\r
37 assertTrue(resultOk.isSuccessfull());
\r
41 public void testConstructor_ErrorMsg() {
\r
42 assertFalse(resultError.isSuccessfull());
\r
46 public void testGetErrorMessage() {
\r
47 assertEquals(resultOk.getErrorMessage(), ClassificationResult.DEFAULT_ERROR_MESSAGE);
\r
48 assertEquals(resultError.getErrorMessage(), ERROR_MESSAGE);
\r