File tree 4 files changed +59
-8
lines changed
src/test/java/com/oracle/weblogic/imagetool
4 files changed +59
-8
lines changed Original file line number Diff line number Diff line change 1
1
pipeline {
2
2
agent any
3
+ tools {
4
+ maven ' maven-3.6.0'
5
+ jdk ' jdk11'
6
+ }
3
7
4
8
stages {
5
- stage( ' Build ' ) {
9
+ stage ( ' Environment ' ) {
6
10
steps {
7
- echo ' Building..'
11
+ sh '''
12
+ echo "PATH = ${PATH}"
13
+ echo "M2_HOME = ${M2_HOME}"
14
+ mvn --version
15
+ '''
8
16
}
9
17
}
10
- stage( ' Test ' ) {
18
+ stage ( ' Build ' ) {
11
19
steps {
12
- echo ' Testing.. '
20
+ sh ' mvn -B clean package '
13
21
}
14
22
}
15
- stage( ' Deploy ' ) {
23
+ stage ( ' Test ' ) {
16
24
steps {
17
- echo ' Deploying....'
25
+ sh ' mvn test'
26
+ }
27
+ post {
28
+ always {
29
+ junit ' target/surefire-reports/*.xml'
30
+ }
18
31
}
19
32
}
20
33
}
Original file line number Diff line number Diff line change 38
38
<artifactId >json</artifactId >
39
39
<version >20180813</version >
40
40
</dependency >
41
+ <dependency >
42
+ <groupId >junit</groupId >
43
+ <artifactId >junit</artifactId >
44
+ <version >4.12</version >
45
+ <scope >test</scope >
46
+ </dependency >
41
47
</dependencies >
42
48
43
49
<build >
Original file line number Diff line number Diff line change
1
+ package com .oracle .weblogic .imagetool .api .model ;
2
+
3
+ import org .junit .Test ;
4
+
5
+ import static org .junit .Assert .assertEquals ;
6
+
7
+ public class DomainTypeTest {
8
+
9
+ @ org .junit .Test
10
+ public void fromValue () {
11
+ assertEquals ("validate domain type lowercase jrf" , DomainType .JRF , DomainType .fromValue ("jrf" ));
12
+ assertEquals ("validate domain type uppercase jrf" , DomainType .JRF , DomainType .fromValue ("JRF" ));
13
+ assertEquals ("validate domain type lowercase wls" , DomainType .WLS , DomainType .fromValue ("wls" ));
14
+ assertEquals ("validate domain type uppercase WLS" , DomainType .WLS , DomainType .fromValue ("WLS" ));
15
+ }
16
+ }
Original file line number Diff line number Diff line change 1
1
/* Copyright (c) 2019 Oracle and/or its affiliates. All rights reserved.
2
- *
3
2
* Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl.
4
3
*/
5
4
package com .oracle .weblogic .imagetool .util ;
6
5
6
+ import org .junit .Test ;
7
+
8
+ import static org .junit .Assert .assertEquals ;
9
+ import static org .junit .Assert .assertTrue ;
10
+
7
11
public class UtilsTest {
8
- }
12
+
13
+ @ Test
14
+ public void compareVersions () {
15
+ assertEquals (0 , Utils .compareVersions ("12.2.1.3.0" , "12.2.1.3.0" ));
16
+ assertTrue (Utils .compareVersions ("1.0" , "1.1" ) < 0 );
17
+ assertTrue (Utils .compareVersions ("1.1" , "1.0" ) > 0 );
18
+ }
19
+
20
+ @ Test
21
+ public void isEmptyString () {
22
+ assertTrue (Utils .isEmptyString ("" ));
23
+ }
24
+ }
You can’t perform that action at this time.
0 commit comments