246
257
greekRepos = new File(localTmp, "repos");
247
258
greekDump = new File(localTmp, "greek_dump");
248
259
admin.create(greekRepos, true,false, null, this.fsType);
249
addExpectedCommitItem(greekFiles.getAbsolutePath(), null, null,
250
NodeKind.none, CommitItemStateFlags.Add);
260
addExpectedCommitItem(greekFiles.getAbsolutePath(),
261
makeReposUrl(greekRepos).toString(), null,
262
NodeKind.dir, CommitItemStateFlags.Add);
251
263
client.doImport(greekFiles.getAbsolutePath(),
252
makeReposUrl(greekRepos).toString(),
264
makeReposUrl(greekRepos).toString(),
253
265
Depth.infinity, false, false, null,
254
266
new MyCommitMessage(), null);
255
267
admin.dump(greekRepos, new FileOutputStream(greekDump),
286
298
this.client = new SVNClient();
287
299
this.client.notification2(new MyNotifier());
288
this.client.setPrompt(new DefaultPromptUserPassword());
300
if (DefaultAuthn.useDeprecated())
301
this.client.setPrompt(DefaultAuthn.getDeprecated());
303
this.client.setPrompt(DefaultAuthn.getDefault());
289
304
this.client.username(USERNAME);
290
305
this.client.setProgressCallback(new DefaultProgressListener());
291
306
this.client.setConfigDirectory(this.conf.getAbsolutePath());
292
307
this.expectedCommitItems = new HashMap<String, MyCommitItem>();
295
* the default prompt : never prompts the user, provides defaults answers
310
* the default prompts : never prompt the user, provide default answers
297
protected static class DefaultPromptUserPassword implements UserPasswordCallback
312
protected static class DefaultAuthn
300
public int askTrustSSLServer(String info, boolean allowPermanently)
302
return UserPasswordCallback.AcceptTemporary;
305
public String askQuestion(String realm, String question, boolean showAnswer)
310
public boolean askYesNo(String realm, String question, boolean yesIsDefault)
315
public String getPassword()
320
public String getUsername()
325
public boolean prompt(String realm, String username)
330
public boolean prompt(String realm, String username, boolean maySave)
335
public String askQuestion(String realm, String question,
336
boolean showAnswer, boolean maySave)
341
public boolean userAllowedSave()
314
public static boolean useDeprecated()
316
String prop = System.getProperty("test.authn.deprecated");
317
return (prop != null && !prop.isEmpty());
320
public static AuthnCallback getDefault()
322
return new DefaultAuthnCallback();
325
@SuppressWarnings("deprecation")
326
public static UserPasswordCallback getDeprecated()
328
return new DeprecatedAuthnCallback();
331
private static class DefaultAuthnCallback
332
implements AuthnCallback
334
public UsernameResult
335
usernamePrompt(String realm, boolean maySave)
337
return new UsernameResult(USERNAME);
340
public UserPasswordResult
341
userPasswordPrompt(String realm, String username,
344
return new UserPasswordResult(USERNAME, PASSWORD);
347
public SSLServerTrustResult
348
sslServerTrustPrompt(String realm,
349
SSLServerCertFailures failures,
350
SSLServerCertInfo info,
353
return SSLServerTrustResult.acceptTemporarily();
356
public SSLClientCertResult
357
sslClientCertPrompt(String realm, boolean maySave)
362
public SSLClientCertPassphraseResult
363
sslClientCertPassphrasePrompt(String realm, boolean maySave)
368
public boolean allowStorePlaintextPassword(String realm)
373
public boolean allowStorePlaintextPassphrase(String realm)
379
@SuppressWarnings("deprecation")
380
private static class DeprecatedAuthnCallback
381
implements UserPasswordCallback
383
public int askTrustSSLServer(String info, boolean allowPermanently)
385
return UserPasswordCallback.AcceptTemporary;
388
public String askQuestion(String realm, String question,
394
public boolean askYesNo(String realm, String question,
395
boolean yesIsDefault)
400
public String getPassword()
405
public String getUsername()
410
public boolean prompt(String realm, String username)
415
public boolean prompt(String realm, String username, boolean maySave)
420
public String askQuestion(String realm, String question,
421
boolean showAnswer, boolean maySave)
426
public boolean userAllowedSave()
347
private static class DefaultProgressListener implements ProgressCallback
433
protected static class DefaultProgressListener implements ProgressCallback
350
436
public void onProgress(ProgressEvent event)