File tree 4 files changed +66
-21
lines changed
main/java/org/broadleafcommerce/common/util
org/broadleafcommerce/common/test/util
4 files changed +66
-21
lines changed Original file line number Diff line number Diff line change 67
67
<groupId >org.codehaus.gmavenplus</groupId >
68
68
<artifactId >gmavenplus-plugin</artifactId >
69
69
</plugin >
70
+ <plugin >
71
+ <groupId >org.apache.maven.plugins</groupId >
72
+ <artifactId >maven-surefire-plugin</artifactId >
73
+ <configuration >
74
+ <includes >
75
+ <include >**/*Spec*</include >
76
+ <include >**/*Test*</include >
77
+ </includes >
78
+ <argLine >${surefire.argLine} </argLine >
79
+ </configuration >
80
+ </plugin >
70
81
</plugins >
71
82
<resources >
72
83
<resource >
377
388
<scope >test</scope >
378
389
</dependency >
379
390
<dependency >
380
- <groupId >org.gebish</groupId >
381
- <artifactId >geb-core</artifactId >
382
- <scope >test</scope >
383
- </dependency >
384
- <dependency >
385
- <groupId >org.seleniumhq.selenium</groupId >
386
- <artifactId >selenium-support</artifactId >
391
+ <groupId >org.spockframework</groupId >
392
+ <artifactId >spock-core</artifactId >
387
393
<scope >test</scope >
388
394
</dependency >
389
- <dependency >
390
- <groupId >org.seleniumhq.selenium</groupId >
391
- <artifactId >selenium-firefox-driver</artifactId >
392
- <scope >test</scope >
393
- </dependency >
394
- <dependency >
395
- <groupId >org.seleniumhq.selenium</groupId >
396
- <artifactId >selenium-chrome-driver</artifactId >
397
- <scope >test</scope >
398
- </dependency >
399
395
</dependencies >
400
396
</project >
Original file line number Diff line number Diff line change 20
20
21
21
package org .broadleafcommerce .common .util ;
22
22
23
+ import org .apache .commons .lang .StringUtils ;
24
+ import org .codehaus .jettison .json .JSONObject ;
25
+
23
26
import java .io .ByteArrayInputStream ;
24
27
import java .io .IOException ;
25
28
import java .io .UnsupportedEncodingException ;
30
33
import java .util .zip .Adler32 ;
31
34
import java .util .zip .CheckedInputStream ;
32
35
33
- import org .apache .commons .lang .StringUtils ;
34
- import org .codehaus .jettison .json .JSONObject ;
35
-
36
36
public class StringUtil {
37
37
38
38
public static long getChecksum (String test ) {
@@ -47,7 +47,7 @@ public static long getChecksum(String test) {
47
47
throw new RuntimeException (e );
48
48
}
49
49
}
50
-
50
+
51
51
/**
52
52
* Checks if a string is included in the beginning of another string, but only in dot-separated segment leaps.
53
53
* Examples:
Original file line number Diff line number Diff line change
1
+ /*
2
+ * #%L
3
+ * BroadleafCommerce Common Libraries
4
+ * %%
5
+ * Copyright (C) 2009 - 2016 Broadleaf Commerce
6
+ * %%
7
+ * Licensed under the Apache License, Version 2.0 (the "License");
8
+ * you may not use this file except in compliance with the License.
9
+ * You may obtain a copy of the License at
10
+ *
11
+ * http://www.apache.org/licenses/LICENSE-2.0
12
+ *
13
+ * Unless required by applicable law or agreed to in writing, software
14
+ * distributed under the License is distributed on an "AS IS" BASIS,
15
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ * See the License for the specific language governing permissions and
17
+ * limitations under the License.
18
+ * #L%
19
+ */
20
+ /**
21
+ *
22
+ */
23
+ package org.broadleafcommerce.common.test.util
24
+
25
+ import org.broadleafcommerce.common.util.StringUtil
26
+
27
+ import spock.lang.Specification
28
+
29
+
30
+ /**
31
+ *
32
+ *
33
+ * @author Phillip Verheyden (phillipuniverse)
34
+ */
35
+ class StringUtilSpec extends Specification {
36
+
37
+ def " Exact roperty segments" () {
38
+ when :
39
+ def result = StringUtil . segmentInclusion(" fulfillmentLocation.address.phoneFax" , " fulfillmentLocation.address.phone" )
40
+ then :
41
+ ! result
42
+
43
+ when :
44
+ result = StringUtil . segmentInclusion(" fulfillmentLocation.address.phoneFax.phoneNumber" , " fulfillmentLocation.address.phoneFax" )
45
+ then :
46
+ result
47
+ }
48
+
49
+ }
You can’t perform that action at this time.
0 commit comments