Changed the root package from net.sf.briar to org.briarproject.

This commit is contained in:
akwizgran
2014-01-08 16:18:30 +00:00
parent dce70f487c
commit 832476412c
427 changed files with 2507 additions and 2507 deletions

View File

@@ -0,0 +1,33 @@
package org.briarproject.lifecycle;
import java.util.HashSet;
import java.util.Set;
import org.briarproject.BriarTestCase;
import org.briarproject.api.lifecycle.ShutdownManager;
import org.junit.Test;
public class ShutdownManagerImplTest extends BriarTestCase {
@Test
public void testAddAndRemove() {
ShutdownManager s = createShutdownManager();
Set<Integer> handles = new HashSet<Integer>();
for(int i = 0; i < 100; i++) {
int handle = s.addShutdownHook(new Runnable() {
public void run() {}
});
// The handles should all be distinct
assertTrue(handles.add(handle));
}
// The hooks should be removable
for(int handle : handles) assertTrue(s.removeShutdownHook(handle));
// The hooks should no longer be removable
for(int handle : handles) assertFalse(s.removeShutdownHook(handle));
}
protected ShutdownManager createShutdownManager() {
return new ShutdownManagerImpl();
}
}