forked from shekhargulati/strman-java
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Strman_ESTest.java
213 lines (185 loc) · 8.4 KB
/
Strman_ESTest.java
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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
/*
* This file was automatically generated by EvoSuite
* Wed Oct 10 02:49:41 GMT 2018
*/
// There were totally 277 tests generated automatically by EVOSUITE
// with more than 10800 lines of code.
// This file kept only a small portion of the generated file to serve as demonstration purpose.
package com.strman;
import org.junit.Test;
import static org.junit.Assert.*;
import static org.evosuite.runtime.EvoAssertions.*;
import com.strman.Strman;
import java.util.List;
import java.util.Map;
import java.util.NoSuchElementException;
import java.util.Optional;
import java.util.regex.PatternSyntaxException;
import org.evosuite.runtime.EvoRunner;
import org.evosuite.runtime.EvoRunnerParameters;
import org.evosuite.runtime.Random;
import org.junit.runner.RunWith;
@RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, separateClassLoader = true, useJEE = true)
public class Strman_ESTest extends Strman_ESTest_scaffolding {
@Test(timeout = 4000)
public void test000() throws Throwable {
String string0 = Strman.lowerFirst("⨤");
assertNotNull(string0);
assertEquals("⨤", string0);
String[] stringArray0 = new String[3];
stringArray0[2] = "⨤";
String string1 = Strman.join(stringArray0, "⨤");
assertFalse(string1.equals((Object)string0));
assertNotNull(string1);
assertEquals("null⨤null⨤⨤", string1);
assertEquals(3, stringArray0.length);
// Undeclared exception!
try {
Strman.endsWith("", stringArray0[0], true);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("com.strman.Strman", e);
}
}
// tests 001 - 020 omitted
@Test(timeout = 4000)
public void test021() throws Throwable {
String string0 = Strman.htmlEncode("(?<=G.{");
assertNotNull(string0);
assertEquals("(?<=null.{", string0);
String string1 = Strman.removeRight("RcpiwHrb\"{wJZ.]RcpiwHrb\"{wJZ.]'FZk}ufqL{)l@]7c'F", "d:*b", true);
assertFalse(string1.equals((Object)string0));
assertNotNull(string1);
assertEquals("RcpiwHrb\"{wJZ.]RcpiwHrb\"{wJZ.]'FZk}ufqL{)l@]7c'F", string1);
String string2 = Strman.htmlDecode("RcpiwHrb\"{wJZ.]RcpiwHrb\"{wJZ.]'FZk}ufqL{)l@]7c'F");
assertFalse(string2.equals((Object)string0));
assertFalse(string2.equals((Object)string1));
assertNotNull(string2);
assertEquals("null", string2);
String string3 = Strman.rightTrim("(?<=G.{");
assertFalse(string3.equals((Object)string0));
assertFalse(string3.equals((Object)string2));
assertFalse(string3.equals((Object)string1));
assertNotNull(string3);
assertEquals("(?<=G.{", string3);
int int0 = Strman.lastIndexOf("6u3X)x)rf\"", "", 49, false);
assertEquals(10, int0);
String[] stringArray0 = new String[3];
stringArray0[0] = "null";
stringArray0[1] = "RcpiwHrb\"{wJZ.]RcpiwHrb\"{wJZ.]'FZk}ufqL{)l@]7c'F";
stringArray0[2] = "6u3X)x)rf\"";
Optional<String> optional0 = Strman.trimEnd("", stringArray0);
assertNotNull(optional0);
assertEquals(3, stringArray0.length);
String string4 = Strman.reverse("");
assertFalse(string4.equals((Object)string2));
assertFalse(string4.equals((Object)string1));
assertFalse(string4.equals((Object)string3));
assertFalse(string4.equals((Object)string0));
assertNotNull(string4);
assertEquals("", string4);
String string5 = Strman.truncate("null", 49, "@[$M");
assertFalse(string5.equals((Object)string0));
assertTrue(string5.equals((Object)string2));
assertFalse(string5.equals((Object)string1));
assertFalse(string5.equals((Object)string4));
assertFalse(string5.equals((Object)string3));
assertNotNull(string5);
assertEquals("null", string5);
String string6 = Strman.prependArray("", stringArray0);
assertFalse(string6.equals((Object)string4));
assertFalse(string6.equals((Object)string5));
assertFalse(string6.equals((Object)string1));
assertFalse(string6.equals((Object)string2));
assertFalse(string6.equals((Object)string0));
assertFalse(string6.equals((Object)string3));
assertNotNull(string6);
assertEquals("nullRcpiwHrb\"{wJZ.]RcpiwHrb\"{wJZ.]'FZk}ufqL{)l@]7c'F6u3X)x)rf\"", string6);
assertEquals(3, stringArray0.length);
boolean boolean0 = Strman.endsWith("", "null", 4461, false);
assertFalse(boolean0);
String string7 = Strman.appendArray("null", stringArray0);
assertFalse(string7.equals((Object)string0));
assertFalse(string7.equals((Object)string4));
assertFalse(string7.equals((Object)string6));
assertFalse(string7.equals((Object)string3));
assertFalse(string7.equals((Object)string5));
assertFalse(string7.equals((Object)string1));
assertFalse(string7.equals((Object)string2));
assertNotNull(string7);
assertEquals("nullnullRcpiwHrb\"{wJZ.]RcpiwHrb\"{wJZ.]'FZk}ufqL{)l@]7c'F6u3X)x)rf\"", string7);
assertEquals(3, stringArray0.length);
String string8 = Strman.toKebabCase((String) null);
assertFalse(string8.equals((Object)string6));
assertFalse(string8.equals((Object)string0));
assertTrue(string8.equals((Object)string4));
assertFalse(string8.equals((Object)string2));
assertFalse(string8.equals((Object)string5));
assertFalse(string8.equals((Object)string3));
assertFalse(string8.equals((Object)string7));
assertFalse(string8.equals((Object)string1));
assertNotNull(string8);
assertEquals("", string8);
String string9 = Strman.encode("RE<Dp&@yytOX-o\u0399", 10, 49);
assertFalse(string9.equals((Object)string2));
assertFalse(string9.equals((Object)string0));
assertFalse(string9.equals((Object)string8));
assertFalse(string9.equals((Object)string7));
assertFalse(string9.equals((Object)string3));
assertFalse(string9.equals((Object)string1));
assertFalse(string9.equals((Object)string4));
assertFalse(string9.equals((Object)string6));
assertFalse(string9.equals((Object)string5));
assertNotNull(string9);
assertEquals("000000008200000000690000000060000000006800000001120000000038000000006400000001210000000121000000011600000000790000000088000000004500000001110000000921", string9);
// Undeclared exception!
try {
Strman.split("vlX1y+:[Qo+WuHQ", "MZ1xO*aG[");
fail("Expecting exception: PatternSyntaxException");
} catch(PatternSyntaxException e) {
//
// Unclosed character class near index 8\r
// MZ1xO*aG[\r
// ^
//
verifyException("java.util.regex.Pattern", e);
}
}
// tests 022-274 was omitted
@Test(timeout = 4000)
public void test275() throws Throwable {
Strman.chars("vkD.");
Strman.decEncode("vkD.");
Strman.inequal("\u0174", "00118001070006800046");
Strman.removeNonWords("00118001070006800046");
Strman.countSubstr("00118001070006800046", "00118001070006800046", true, false);
Strman.encode("n,", (-2354), (-1968526675));
Strman.replace("00118001070006800046", "00118001070006800046", "zpw#^ agxd?ailu>#", true);
// Undeclared exception!
try {
Strman.decDecode("~C");
fail("Expecting exception: NumberFormatException");
} catch(NumberFormatException e) {
//
// For input string: \"~C\"
//
verifyException("java.lang.NumberFormatException", e);
}
}
@Test(timeout = 4000)
public void test276() throws Throwable {
// Undeclared exception!
try {
Strman.isString((Object) null);
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// value can't be null
//
verifyException("com.strman.Strman", e);
}
}
}