Browse Source

PushConnectionTest: Use Java 7 try-with-resources

Change-Id: I429066d2af9c5fb8bf8bc038b99ebe5a7dc09170
stable-4.5
Shawn Pearce 8 years ago
parent
commit
ae5870a1f2
  1. 13
      org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/PushConnectionTest.java

13
org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/PushConnectionTest.java

@ -125,16 +125,9 @@ public class PushConnectionTest {
Map<String, RemoteRefUpdate> updates = new HashMap<>(); Map<String, RemoteRefUpdate> updates = new HashMap<>();
updates.put(rru.getRemoteName(), rru); updates.put(rru.getRemoteName(), rru);
Transport tn = testProtocol.open(uri, client, "server"); try (Transport tn = testProtocol.open(uri, client, "server");
try { PushConnection connection = tn.openPush()) {
PushConnection connection = tn.openPush(); connection.push(NullProgressMonitor.INSTANCE, updates);
try {
connection.push(NullProgressMonitor.INSTANCE, updates);
} finally {
connection.close();
}
} finally {
tn.close();
} }
assertEquals(REJECTED_OTHER_REASON, rru.getStatus()); assertEquals(REJECTED_OTHER_REASON, rru.getStatus());

Loading…
Cancel
Save