File tree Expand file tree Collapse file tree 2 files changed +42
-5
lines changed
src/main/java/org/utplsql/api Expand file tree Collapse file tree 2 files changed +42
-5
lines changed Original file line number Diff line number Diff line change @@ -133,6 +133,14 @@ public int compareTo(Version o) {
133
133
return 0 ;
134
134
}
135
135
136
+ private void versionsAreValid ( Version v ) throws InvalidVersionException {
137
+ if ( !isValid () )
138
+ throw new InvalidVersionException (this );
139
+
140
+ if ( !v .isValid () )
141
+ throw new InvalidVersionException (v );
142
+ }
143
+
136
144
/** Compares this version to a given version and returns true if this version is greater or equal than the given one
137
145
* Throws an InvalidVersionException if either this or the given version are invalid
138
146
*
@@ -141,15 +149,44 @@ public int compareTo(Version o) {
141
149
* @throws InvalidVersionException
142
150
*/
143
151
public boolean isGreaterOrEqualThan ( Version v ) throws InvalidVersionException {
144
- if ( !isValid () )
145
- throw new InvalidVersionException (this );
146
152
147
- if ( !v .isValid () )
148
- throw new InvalidVersionException (v );
153
+ versionsAreValid (v );
149
154
150
155
if ( compareTo (v ) >= 0 )
151
156
return true ;
152
157
else
153
158
return false ;
154
159
}
160
+
161
+
162
+ public boolean isGreaterThan ( Version v ) throws InvalidVersionException
163
+ {
164
+ versionsAreValid (v );
165
+
166
+ if ( compareTo (v ) > 0 )
167
+ return true ;
168
+ else
169
+ return false ;
170
+ }
171
+
172
+ public boolean isLessOrEqualThan ( Version v ) throws InvalidVersionException
173
+ {
174
+
175
+ versionsAreValid (v );
176
+
177
+ if ( compareTo (v ) <= 0 )
178
+ return true ;
179
+ else
180
+ return false ;
181
+ }
182
+
183
+ public boolean isLessThan ( Version v ) throws InvalidVersionException
184
+ {
185
+ versionsAreValid (v );
186
+
187
+ if ( compareTo (v ) < 0 )
188
+ return true ;
189
+ else
190
+ return false ;
191
+ }
155
192
}
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ public static TestRunnerStatement getCompatibleTestRunnerStatement(Version datab
27
27
AbstractTestRunnerStatement stmt = null ;
28
28
29
29
try {
30
- if (new Version ("3.0.2" ). isGreaterOrEqualThan ( databaseVersion ))
30
+ if (databaseVersion . isLessThan ( new Version ("3.0.3" ) ))
31
31
stmt = new Pre303TestRunnerStatement (options , conn );
32
32
33
33
} catch ( InvalidVersionException e ) {}
You can’t perform that action at this time.
0 commit comments