@@ -43,6 +43,7 @@ public class CasSimpleTargetTest {
43
43
44
44
private String connectString ;
45
45
private String retentionClass ;
46
+ private String clipName ;
46
47
private Integer retentionPeriod ;
47
48
private Integer retentionPeriodEbr ;
48
49
@@ -55,6 +56,7 @@ public void setup() throws Exception {
55
56
56
57
connectString = syncProperties .getProperty (SyncConfig .PROP_CAS_CONNECT_STRING );
57
58
retentionClass = syncProperties .getProperty (SyncConfig .PROP_CAS_RETENTION_CLASS );
59
+ clipName = syncProperties .getProperty (SyncConfig .PROP_CAS_CLIP_NAME );
58
60
if (syncProperties .getProperty (SyncConfig .PROP_CAS_RETENTION_PERIOD ) != null )
59
61
retentionPeriod = Integer .parseInt (syncProperties .getProperty (SyncConfig .PROP_CAS_RETENTION_PERIOD ));
60
62
if (syncProperties .getProperty (SyncConfig .PROP_CAS_RETENTION_PERIOD_EBR ) != null )
@@ -81,6 +83,7 @@ public void testSyncWithVerification() throws Exception {
81
83
source .configure (null , null , null );
82
84
CasSimpleTarget target = new CasSimpleTarget ();
83
85
target .setConnectionString (connectString );
86
+ target .setClipName (clipName );
84
87
85
88
IdCollector idCollector = new IdCollector ();
86
89
@@ -196,13 +199,15 @@ public void testCli() throws Exception {
196
199
String rClass = "rcTest" ;
197
200
String rPeriod = "100" ;
198
201
String rPeriodEbr = "200" ;
202
+ String clipName = "Clip" ;
199
203
String [] args = new String []{
200
204
"-source" , "file:///tmp/foo" ,
201
205
"-target" , "cas-simple:hpp://cas.ip.address?cas.pea" ,
202
206
"--target-top-tag" , tagName ,
203
207
"--retention-class" , rClass ,
204
208
"--retention-period" , rPeriod ,
205
- "--ebr-retention-period" , rPeriodEbr
209
+ "--ebr-retention-period" , rPeriodEbr ,
210
+ "--clip-name" , clipName
206
211
};
207
212
208
213
// use reflection to bootstrap EcsSync using CLI arguments
@@ -219,6 +224,7 @@ public void testCli() throws Exception {
219
224
Assert .assertEquals ("retention period mismatch" , Integer .parseInt (rPeriod ), csTarget .getRetentionPeriod ());
220
225
Assert .assertEquals ("ebr retention period mismatch" , Integer .parseInt (rPeriodEbr ), csTarget .getRetentionPeriodEbr ());
221
226
Assert .assertEquals ("tag name mismatch" , tagName , csTarget .getTopTagName ());
227
+ Assert .assertEquals ("clip name mismatch" , clipName , csTarget .getClipName ());
222
228
}
223
229
224
230
private void verify (TestObjectSource source , CasSimpleTarget target ) throws Exception {
@@ -244,6 +250,10 @@ private void verifyClipIntegrity(String clipId, TestSyncObject sourceObject, Cas
244
250
245
251
Assert .assertEquals ("x-emc-data" , tagName );
246
252
253
+ if (target .getClipName () != null ) {
254
+ Assert .assertEquals ("clip name does not match" , clipName , clip .getName ());
255
+ }
256
+
247
257
if (target .getRetentionClass () != null ) {
248
258
Assert .assertEquals ("retention class does not match" , retentionClass , clip .getRetentionClassName ());
249
259
}
@@ -293,13 +303,15 @@ private void deleteClips(CasSimpleTarget target, Collection<String> clipIds) {
293
303
ExecutorService executor = Executors .newFixedThreadPool (32 );
294
304
List <Future > futures = new ArrayList <>();
295
305
for (final String clipId : clipIds ) {
296
- futures .add (executor .submit (new Callable <Void >() {
297
- @ Override
298
- public Void call () throws Exception {
299
- FPClip .Delete (pool , clipId );
300
- return null ;
301
- }
302
- }));
306
+ if (clipId != null ) {
307
+ futures .add (executor .submit (new Callable <Void >() {
308
+ @ Override
309
+ public Void call () throws Exception {
310
+ FPClip .Delete (pool , clipId );
311
+ return null ;
312
+ }
313
+ }));
314
+ }
303
315
}
304
316
305
317
for (Future future : futures ) {
0 commit comments