Merge "delete all .class files" into stable/beryllium
[nemo.git] / nemo-tools / sandbox / src / test / java / org / opendaylight / nemo / tool / sandbox / northbound / ExecuteRequestTest.java
1 /*
2  * Copyright (c) 2016 Huawei, 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.nemo.tool.sandbox.northbound;
9
10 import junit.framework.TestCase;
11 import org.junit.Assert;
12 import org.junit.Before;
13 import org.junit.Test;
14
15 import static org.junit.Assert.*;
16
17 /**
18  * Created by zhangmeng on 2016/1/14.
19  */
20 public class ExecuteRequestTest extends TestCase {
21     private ExecuteRequest executeRequest;
22     @Before
23     public void setUp() throws Exception {
24         executeRequest =  new ExecuteRequest();
25     }
26
27     @Test
28     public void testGet_Set() throws Exception {
29         Assert.assertTrue(executeRequest.getHostName() == null);
30         executeRequest.setHostName("test");
31         Assert.assertTrue(executeRequest.getHostName().equals("test"));
32
33         Assert.assertTrue(executeRequest.getCommand() == null);
34         executeRequest.setCommand("command");
35         Assert.assertTrue(executeRequest.getCommand().equals("command"));
36
37         //test to string
38         Assert.assertTrue(executeRequest.toString().equals("ExecuteRequest{" +
39                 "hostName='" + "test" + '\'' +
40                 ", command='" + "command" + '\'' +
41                 '}'));
42     }
43
44 }