BUG-5790: BGP Test tool
[bgpcep.git] / bgp / testtool / src / main / java / org / opendaylight / protocol / bgp / testtool / Main.java
1 /*
2  * Copyright (c) 2013 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 package org.opendaylight.protocol.bgp.testtool;
9
10 import java.io.BufferedReader;
11 import java.io.IOException;
12 import java.io.InputStreamReader;
13 import org.opendaylight.protocol.util.LoggerUtil;
14 import org.slf4j.Logger;
15 import org.slf4j.LoggerFactory;
16
17 /**
18  * Starter class for testing.
19  */
20 public final class Main {
21     private static final Logger LOG = LoggerFactory.getLogger(Main.class);
22
23     private Main() {
24         throw new UnsupportedOperationException();
25     }
26
27     public static void main(final String[] args) throws IOException {
28         final Arguments arguments = Arguments.parseArguments(args);
29         LoggerUtil.initiateLogger(arguments);
30
31         final BGPTestTool bgpTestTool = new BGPTestTool();
32         final InputStreamReader isr = new InputStreamReader(System.in);
33         final BufferedReader br = new BufferedReader(isr);
34         bgpTestTool.start(arguments);
35         for (;;) {
36             LOG.info("Insert local address:");
37             bgpTestTool.printCount(br.readLine());
38         }
39     }
40 }