TestEthLinux.java
2.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
package org.emercit.utilstools;
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
import static org.junit.Assert.*;
import java.util.Vector;
import org.emercit.utilstools.config.Msg;
import org.emercit.utilstools.ethmanager.model.EthBean;
import org.emercit.utilstools.ethmanager.service.EthLinux;
import org.junit.Before;
import org.junit.After;
import org.junit.Ignore;
@Ignore
public class TestEthLinux extends TestCase {
private EthBean bean;
private Vector<EthBean> beans;
private EthLinux ethlinux;
private int value;
private Msg msg;
public TestEthLinux( String testName )
{
super( testName );
}
public static Test suite()
{
return new TestSuite( TestEthLinux.class );
}
@Before
public void upEthLinux()
{
}
@After
public void downEthLinux()
{
}
/*
* Установка и сбро сетевых настроек
*/
public void testEthLinux()
{
ethlinux=new EthLinux();
assertNotNull(ethlinux);
// INIT
int value=ethlinux.setDefaults();
msg=Msg.getByCode(value);
if (msg.getTypeVariable().getCode()==1) {
fail("Тест завален");
}
beans=ethlinux.getEthBeans();
assertNotNull(beans);
bean=beans.firstElement();
assertNotNull(bean);
value=ethlinux.reload(bean.getName());
msg=Msg.getByCode(value);
if (msg.getTypeVariable().getCode()==1) {
fail("Тест завален");
}
bean.setIp("192.168.99.1");
value=ethlinux.Update(bean);
msg=Msg.getByCode(value);
if (msg.getTypeVariable().getCode()==1) {
fail("Тест завален");
}
assertTrue( true );
}
}
//assertFalse(!stservice.IsRun("start.jar")); // Если true - то тест завален
// assertEquals(stservice.IsRun("start.jar")); // Если не равны - тест завален
// assertNotNull(stservice.IsRun("start.jar"))); // Если null - тест завален
//assertNull(stservice.IsRun("start.jar"))); // Если не null - тест завален
//assertNotSame(stservice.IsRun("start.jar")); // Если оба объекта являются одинаковыми(не одно и то же, что равны) - тест завален
//assertSame(stservice.IsRun("start.jar")); // Если оба объекта не являются одинаковыми - тест завален