File tree Expand file tree Collapse file tree 4 files changed +66
-8
lines changed
src/test/java/com/oracle/weblogic/imagetool Expand file tree Collapse file tree 4 files changed +66
-8
lines changed Original file line number Diff line number Diff line change 11pipeline {
22 agent any
3+ tools {
4+ maven ' maven-3.6.0'
5+ jdk ' jdk11'
6+ }
37
48 stages {
5- stage( ' Build ' ) {
9+ stage ( ' Environment ' ) {
610 steps {
7- echo ' Building..'
11+ sh '''
12+ echo "PATH = ${PATH}"
13+ echo "M2_HOME = ${M2_HOME}"
14+ mvn --version
15+ '''
816 }
917 }
10- stage( ' Test ' ) {
18+ stage ( ' Build ' ) {
1119 steps {
12- echo ' Testing.. '
20+ sh ' mvn -B -DskipTests clean package '
1321 }
1422 }
15- stage( ' Deploy ' ) {
23+ stage ( ' Test ' ) {
1624 steps {
17- echo ' Deploying....'
25+ sh ' mvn test'
26+ }
27+ post {
28+ always {
29+ junit ' target/surefire-reports/*.xml'
30+ }
1831 }
1932 }
2033 }
Original file line number Diff line number Diff line change 3838 <artifactId >json</artifactId >
3939 <version >20180813</version >
4040 </dependency >
41+ <dependency >
42+ <groupId >junit</groupId >
43+ <artifactId >junit</artifactId >
44+ <version >4.12</version >
45+ <scope >test</scope >
46+ </dependency >
4147 </dependencies >
4248
4349 <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+ import static org .junit .Assert .assertNotEquals ;
7+
8+ public class DomainTypeTest {
9+
10+ @ org .junit .Test
11+ public void fromValue () {
12+ assertEquals ("validate domain type lowercase wls" , DomainType .WLS , DomainType .fromValue ("wls" ));
13+ assertEquals ("validate domain type uppercase WLS" , DomainType .WLS , DomainType .fromValue ("WLS" ));
14+
15+ assertEquals ("validate domain type lowercase jrf" , DomainType .JRF , DomainType .fromValue ("jrf" ));
16+ assertEquals ("validate domain type uppercase JRF" , DomainType .JRF , DomainType .fromValue ("JRF" ));
17+
18+ assertEquals ("validate domain type lowercase rjrf" , DomainType .RestrictedJRF , DomainType .fromValue ("rjrf" ));
19+ assertEquals ("validate domain type uppercase RJRF" , DomainType .RestrictedJRF , DomainType .fromValue ("RJRF" ));
20+
21+ assertNotEquals ("string JRF does not equal WLS type" , DomainType .WLS , DomainType .fromValue ("jrf" ));
22+ }
23+ }
Original file line number Diff line number Diff line change 11/* Copyright (c) 2019 Oracle and/or its affiliates. All rights reserved.
2- *
32* Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl.
43*/
54package com .oracle .weblogic .imagetool .util ;
65
6+ import org .junit .Test ;
7+
8+ import static org .junit .Assert .assertEquals ;
9+ import static org .junit .Assert .assertTrue ;
10+
711public 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