File tree Expand file tree Collapse file tree 2 files changed +31
-3
lines changed
main/java/org/apache/hadoop/fs/glusterfs
test/java/org/apache/hadoop/fs/test Expand file tree Collapse file tree 2 files changed +31
-3
lines changed Original file line number Diff line number Diff line change @@ -69,10 +69,15 @@ public GlusterVolume(Configuration conf){
69
69
this .setConf (conf );
70
70
}
71
71
72
+ public URI getUriOrCreate (URI u ) {
73
+ if (NAME ==null )
74
+ return URI .create ("glusterfs:///" );
75
+ return NAME ;
76
+ }
77
+
72
78
public URI getUri () {
73
- if (NAME ==null ) return URI .create ("glusterfs:///" );
74
- return NAME ;
75
- }
79
+ return getUriOrCreate (NAME );
80
+ }
76
81
77
82
public void initialize (URI uri , Configuration conf ) throws IOException {
78
83
/* we only really care about the URI up to the path, so strip other things off */
Original file line number Diff line number Diff line change
1
+ package org .apache .hadoop .fs .test ;
2
+
3
+ import java .io .IOException ;
4
+ import junit .framework .Assert ;
5
+ import org .apache .hadoop .conf .Configuration ;
6
+ import org .junit .Test ;
7
+ import org .slf4j .Logger ;
8
+ import org .slf4j .LoggerFactory ;
9
+ import org .apache .hadoop .fs .glusterfs .*;
10
+ /**
11
+ * This class is for tests which are gluster specific.
12
+ */
13
+ public class GlusterVolumeTest {
14
+
15
+ Logger log = LoggerFactory .getLogger (GlusterVolumeTest .class );
16
+ static Configuration config = null ;
17
+
18
+ @ org .junit .Test
19
+ public void testNullURI () {
20
+ Assert .assertNotNull (new org .apache .hadoop .fs .glusterfs .GlusterVolume ().getUriOrCreate (null ));
21
+ }
22
+
23
+ }
You can’t perform that action at this time.
0 commit comments