2 * Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
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
9 package org.opendaylight.groupbasedpolicy.renderer.iovisor.sf;
11 import static org.junit.Assert.assertEquals;
12 import static org.junit.Assert.assertFalse;
13 import static org.junit.Assert.assertTrue;
15 import java.util.ArrayList;
16 import java.util.List;
18 import org.junit.Before;
19 import org.junit.Test;
21 public class ClassificationResultTest {
23 private static final String ERROR_MESSAGE = "error message";
24 private ClassificationResult resultOk;
25 private ClassificationResult resultError;
29 List<String> list = new ArrayList<>();
31 resultOk = new ClassificationResult(list);
32 resultError = new ClassificationResult(ERROR_MESSAGE);
36 public void testConstructor_Result() {
37 assertTrue(resultOk.isSuccessfull());
41 public void testConstructor_ErrorMsg() {
42 assertFalse(resultError.isSuccessfull());
46 public void testGetErrorMessage() {
47 assertEquals(resultOk.getErrorMessage(), ClassificationResult.DEFAULT_ERROR_MESSAGE);
48 assertEquals(resultError.getErrorMessage(), ERROR_MESSAGE);