Tabnine Logo
ClientConfigRemovedMessage$Event.getClientConfig
Code IndexAdd Tabnine to your IDE (free)

How to use
getClientConfig
method
in
net.groboclown.p4.server.api.messagebus.ClientConfigRemovedMessage$Event

Best Java code snippets using net.groboclown.p4.server.api.messagebus.ClientConfigRemovedMessage$Event.getClientConfig (Showing top 7 results out of 315)

origin: groboclown/p4ic4idea

@Test
void removeClientConfig_registered() {
  ProjectConfigRegistry registry = new ProjectConfigRegistryImpl(idea.getMockProject());
  final List<ClientConfig> added = new ArrayList<>();
  final List<ClientConfig> removed = new ArrayList<>();
  MessageBusClient.ProjectClient client = MessageBusClient.forProject(idea.getMockProject(), idea.getMockProject());
  ClientConfigAddedMessage.addListener(client, this, e -> added.add(e.getClientConfig()));
  ClientConfigRemovedMessage.addListener(client, this, (e) -> removed.add(e.getClientConfig()));
  ClientConfig config = createClientConfig();
  VirtualFile root = MockVirtualFileSystem.createRoot();
  registry.addClientConfig(config, root);
  assertEquals(1, added.size());
  added.clear();
  registry.removeClientConfigAt(root);
  assertEquals(0, added.size());
  assertEquals(1, removed.size());
  assertSame(config, removed.get(0));
  ClientConfig fetchedState = registry.getRegisteredClientConfigState(config.getClientServerRef());
  assertNull(fetchedState);
}
origin: groboclown/p4ic4idea

@Test
void projectClosed() {
  ProjectConfigRegistry registry = new ProjectConfigRegistryImpl(idea.getMockProject());
  final List<ClientConfig> added = new ArrayList<>();
  final List<ClientConfig> removed = new ArrayList<>();
  MessageBusClient.ProjectClient client = MessageBusClient.forProject(idea.getMockProject(), idea.getMockProject());
  ClientConfigAddedMessage.addListener(client, this, e -> added.add(e.getClientConfig()));
  ClientConfigRemovedMessage.addListener(client, this, (e) -> removed.add(e.getClientConfig()));
  ClientConfig config = createClientConfig();
  VirtualFile root = MockVirtualFileSystem.createRoot();
  registry.addClientConfig(config, root);
  assertEquals(1, added.size());
  added.clear();
  registry.projectClosed();
  assertEquals(0, added.size());
  assertEquals(1, removed.size());
  assertSame(config, removed.get(0));
  ClientConfig fetchedState = registry.getRegisteredClientConfigState(config.getClientServerRef());
  assertNull(fetchedState);
  // closing the project should turn off further registration
  removed.clear();
  assertThrows(Throwable.class, () -> registry.addClientConfig(config, root));
  assertEquals(0, added.size());
  assertThrows(Throwable.class, () -> registry.removeClientConfigAt(root));
  assertEquals(0, removed.size());
}
origin: groboclown/p4ic4idea

@Test
void disposeComponent() {
  ProjectConfigRegistry registry = new ProjectConfigRegistryImpl(idea.getMockProject());
  final List<ClientConfig> added = new ArrayList<>();
  final List<ClientConfig> removed = new ArrayList<>();
  MessageBusClient.ProjectClient client = MessageBusClient.forProject(idea.getMockProject(), idea.getMockProject());
  ClientConfigAddedMessage.addListener(client, this, e -> added.add(e.getClientConfig()));
  ClientConfigRemovedMessage.addListener(client, this, (e) -> removed.add(e.getClientConfig()));
  ClientConfig config = createClientConfig();
  VirtualFile root = MockVirtualFileSystem.createRoot();
  registry.addClientConfig(config, root);
  assertEquals(1, added.size());
  added.clear();
  registry.disposeComponent();
  assertEquals(0, added.size());
  assertEquals(1, removed.size());
  assertSame(config, removed.get(0));
  ClientConfig fetchedState =
      registry.getRegisteredClientConfigState(config.getClientServerRef());
  assertNull(fetchedState);
  // closing the project should turn off further registration
  removed.clear();
  assertThrows(Throwable.class, () -> registry.addClientConfig(config, root));
  assertEquals(0, added.size());
  assertThrows(Throwable.class, () -> registry.removeClientConfigAt(root));
  assertEquals(0, removed.size());
}
origin: groboclown/p4ic4idea

MessageBusClient.ProjectClient client = MessageBusClient.forProject(idea.getMockProject(), idea.getMockProject());
ClientConfigAddedMessage.addListener(client, this, e -> added.add(e.getClientConfig()));
ClientConfigRemovedMessage.addListener(client, this, (e) -> removed.add(e.getClientConfig()));
ClientConfig config = createClientConfig();
MockVirtualFile root = MockVirtualFileSystem.createRoot();
origin: groboclown/p4ic4idea

ClientConfigRemovedMessage.addListener(projectBusClient, this, event -> {
  if (! ProjectConfigRegistry.this.equals(event.getEventSource())) {
    onClientRemoved(event.getClientConfig(), event.getVcsRootDir());
origin: groboclown/p4ic4idea

@Test
void removeClientConfig_notRegistered() {
  ProjectConfigRegistry registry = new ProjectConfigRegistryImpl(idea.getMockProject());
  final List<ClientConfig> removed = new ArrayList<>();
  MessageBusClient.ProjectClient client = MessageBusClient.forProject(idea.getMockProject(), idea.getMockProject());
  ClientConfigAddedMessage.addListener(client, this,
      e -> fail("should not have added anything"));
  ClientConfigRemovedMessage.addListener(client, this, (e) -> removed.add(e.getClientConfig()));
  ClientConfig config = createClientConfig();
  registry.removeClientConfigAt(MockVirtualFileSystem.createRoot());
  assertEquals(0, removed.size());
  ClientConfig fetchedState = registry.getRegisteredClientConfigState(config.getClientServerRef());
  assertNull(fetchedState);
}
origin: groboclown/p4ic4idea

@Override
public void projectOpened(Project project) {
  MessageBusClient.ProjectClient projectMbClient =
      MessageBusClient.forProject(project, InvalidPasswordMonitorComponent.this);
  ClientConfigAddedMessage.addListener(projectMbClient, this,
      e -> forgetLoginProblem(e.getClientConfig().getServerConfig()));
  ClientConfigRemovedMessage.addListener(projectMbClient, this,
      event -> forgetLoginProblem(event.getClientConfig().getServerConfig()));
}
net.groboclown.p4.server.api.messagebusClientConfigRemovedMessage$EventgetClientConfig

Popular methods of ClientConfigRemovedMessage$Event

  • getVcsRootDir
  • <init>
  • getEventSource

Popular in Java

  • Reading from database using SQL prepared statement
  • addToBackStack (FragmentTransaction)
  • putExtra (Intent)
  • startActivity (Activity)
  • Point (java.awt)
    A point representing a location in (x,y) coordinate space, specified in integer precision.
  • IOException (java.io)
    Signals a general, I/O-related error. Error details may be specified when calling the constructor, a
  • BitSet (java.util)
    The BitSet class implements abit array [http://en.wikipedia.org/wiki/Bit_array]. Each element is eit
  • Iterator (java.util)
    An iterator over a sequence of objects, such as a collection.If a collection has been changed since
  • Handler (java.util.logging)
    A Handler object accepts a logging request and exports the desired messages to a target, for example
  • JCheckBox (javax.swing)
  • Top plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now