Simon Hunt | 338a3b4 | 2016-04-14 09:43:52 -0700 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright 2016-present Open Networking Laboratory |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | package org.onosproject.ui.impl.topo.model; |
| 18 | |
| 19 | /** |
| 20 | * Base class for model test classes. |
| 21 | */ |
| 22 | public abstract class AbstractModelTest { |
| 23 | |
| 24 | /** |
| 25 | * System agnostic end-of-line character. |
| 26 | */ |
| 27 | protected static final String EOL = String.format("%n"); |
| 28 | |
| 29 | /** |
| 30 | * Prints the given string to stdout. |
| 31 | * |
| 32 | * @param s string to print |
| 33 | */ |
| 34 | protected void print(String s) { |
| 35 | System.out.println(s); |
| 36 | } |
| 37 | |
| 38 | /** |
| 39 | * Prints the toString() of the given object to stdout. |
| 40 | * |
| 41 | * @param o object to print |
| 42 | */ |
| 43 | protected void print(Object o) { |
| 44 | print(o.toString()); |
| 45 | } |
| 46 | |
| 47 | /** |
| 48 | * Prints the formatted string to stdout. |
| 49 | * |
| 50 | * @param fmt format string |
| 51 | * @param params parameters |
| 52 | * @see String#format(String, Object...) |
| 53 | */ |
| 54 | protected void print(String fmt, Object... params) { |
| 55 | print(String.format(fmt, params)); |
| 56 | } |
| 57 | |
| 58 | } |