Search in sources :

Example 6 with CUserManager

use of com.google.security.zynamics.binnavi.Gui.Users.CUserManager in project binnavi by google.

the class CUserManagerTest method removeListenerTest.

@Test
public void removeListenerTest() {
    final CUserManager manager = CUserManager.get(m_sql);
    final MockUserManagerListener listener = new MockUserManagerListener();
    manager.addListener(listener);
    assertTrue(Iterators.contains(manager.getListeners(), listener));
    manager.removeListener(listener);
    assertFalse(Iterators.contains(manager.getListeners(), listener));
}
Also used : CUserManager(com.google.security.zynamics.binnavi.Gui.Users.CUserManager) Test(org.junit.Test)

Example 7 with CUserManager

use of com.google.security.zynamics.binnavi.Gui.Users.CUserManager in project binnavi by google.

the class CUserManagerTest method editUserWrongArgumentsTest1.

@Test(expected = NullPointerException.class)
public void editUserWrongArgumentsTest1() throws CouldntSaveDataException {
    final CUserManager manager = CUserManager.get(m_sql);
    manager.editUserName(null, null);
}
Also used : CUserManager(com.google.security.zynamics.binnavi.Gui.Users.CUserManager) Test(org.junit.Test)

Example 8 with CUserManager

use of com.google.security.zynamics.binnavi.Gui.Users.CUserManager in project binnavi by google.

the class CUserManagerTest method addListenerTest.

@Test
public void addListenerTest() {
    final CUserManager manager = CUserManager.get(m_sql);
    final MockUserManagerListener listener = new MockUserManagerListener();
    manager.addListener(listener);
    assertEquals(1, Iterators.size(manager.getListeners()));
    assertTrue(Iterators.contains(manager.getListeners(), listener));
}
Also used : CUserManager(com.google.security.zynamics.binnavi.Gui.Users.CUserManager) Test(org.junit.Test)

Example 9 with CUserManager

use of com.google.security.zynamics.binnavi.Gui.Users.CUserManager in project binnavi by google.

the class CUserManagerTest method getCurrentActiveUserTest.

@Test
public void getCurrentActiveUserTest() throws CouldntSaveDataException {
    final CUserManager manager = CUserManager.get(m_sql);
    final IUser activeUser = manager.addUser(" ACTIVE USER ");
    manager.setCurrentActiveUser(activeUser);
    assertEquals(activeUser, manager.getCurrentActiveUser());
}
Also used : IUser(com.google.security.zynamics.binnavi.Gui.Users.Interfaces.IUser) CUserManager(com.google.security.zynamics.binnavi.Gui.Users.CUserManager) Test(org.junit.Test)

Example 10 with CUserManager

use of com.google.security.zynamics.binnavi.Gui.Users.CUserManager in project binnavi by google.

the class CUserManagerTest method getCurrentActiveUserTestFail.

@Test(expected = IllegalStateException.class)
public void getCurrentActiveUserTestFail() {
    final CUserManager manager = CUserManager.get(m_sql);
    manager.getCurrentActiveUser();
}
Also used : CUserManager(com.google.security.zynamics.binnavi.Gui.Users.CUserManager) Test(org.junit.Test)

Aggregations

CUserManager (com.google.security.zynamics.binnavi.Gui.Users.CUserManager)22 Test (org.junit.Test)20 IUser (com.google.security.zynamics.binnavi.Gui.Users.Interfaces.IUser)11 IComment (com.google.security.zynamics.binnavi.Gui.GraphWindows.CommentDialogs.Interfaces.IComment)4 MockSqlProvider (com.google.security.zynamics.binnavi.Database.MockClasses.MockSqlProvider)3 CComment (com.google.security.zynamics.binnavi.Gui.GraphWindows.CommentDialogs.CComment)3 CTag (com.google.security.zynamics.binnavi.Tagging.CTag)3 CouldntLoadDataException (com.google.security.zynamics.binnavi.Database.Exceptions.CouldntLoadDataException)2 CouldntSaveDataException (com.google.security.zynamics.binnavi.Database.Exceptions.CouldntSaveDataException)2 CUser (com.google.security.zynamics.binnavi.Gui.Users.CUser)2 CGroupNode (com.google.security.zynamics.binnavi.disassembly.CGroupNode)2 CModule (com.google.security.zynamics.binnavi.disassembly.Modules.CModule)2 MockModule (com.google.security.zynamics.binnavi.disassembly.Modules.MockModule)2 Date (java.util.Date)2 CModuleViewGenerator (com.google.security.zynamics.binnavi.Database.CModuleViewGenerator)1 SQLProvider (com.google.security.zynamics.binnavi.Database.Interfaces.SQLProvider)1 MockDatabase (com.google.security.zynamics.binnavi.Database.MockClasses.MockDatabase)1 MaybeNullException (com.google.security.zynamics.binnavi.Exceptions.MaybeNullException)1 MockTagManager (com.google.security.zynamics.binnavi.Tagging.MockTagManager)1 CCodeNode (com.google.security.zynamics.binnavi.disassembly.CCodeNode)1