@Override public String toString() { return "problem(" + getSource() + ": " + getMessage() + ")"; }
public boolean hasTrustTicket() { return getTrustTicket() != null; }
public boolean hasLoginSso() { return getLoginSso() != null; }
public MockP4RemoteChangelist withConfig(ClientConfig cc) { csRef = cc.getClientServerRef(); //clientname = cc.getClientname(); //serverName = csRef.getServerName(); username = cc.getServerConfig().getUsername(); summary = null; return this; }
private ClientConfig createClientConfig(String clientName) { MockConfigPart data = new MockConfigPart() .withServerName("1666") .withUsername("user") .withClientname(clientName); ServerConfig serverConfig = ServerConfig.createFrom(data); return ClientConfig.createFrom(serverConfig, data); } }
ConnectionInfo(@NotNull ClientConfig clientConfig) { this.clientConfig = clientConfig; serverConfig = clientConfig.getServerConfig(); serverName = clientConfig.getServerConfig().getServerName(); }
public boolean isIn(@NotNull ServerConfig config) { return getServerConfig().getServerId().equals(config.getServerId()); }
@Override public boolean hasError() { for (ConfigProblem configProblem : getConfigProblems()) { if (configProblem.isError()) { return true; } } return false; }
public void read(ClientConfig config, Consumer<ClientQueryCacheStore> fun) throws InterruptedException { lockTimeout.withReadLock(lock, () -> { ClientQueryCacheStore store = clientQueryCache.get(config.getClientServerRef()); if (store != null) { fun.accept(store); } }); }
ConnectionInfo(@NotNull ServerConfig config) { this.clientConfig = null; this.serverConfig = config; this.serverName = config.getServerName(); }
@Override public boolean hasError() { for (ConfigProblem configProblem : getConfigProblems()) { if (configProblem.isError()) { return true; } } return false; }
@Override public boolean hasError() { for (ConfigProblem configProblem : getConfigProblems()) { if (configProblem.isError()) { return true; } } return false; }
public boolean hasAuthTicket() { return getAuthTicket() != null; }
@Test void createFrom_invalid_noClientname() { MockConfigPart data = new MockConfigPart() .withUsername("u") .withServerName("blah"); assertThrows(IllegalArgumentException.class, () -> ClientConfig.createFrom( ServerConfig.createFrom(data), data )); }
@Override public String toString() { if (clientName != null) { return serverConfig.getServerName().getDisplayName() + "@" + clientName; } return serverConfig.getServerName().getDisplayName(); }
@Override public boolean hasError() { for (ConfigProblem configProblem : getConfigProblems()) { if (configProblem.isError()) { return true; } } return false; }
@Test void createFrom_invalid_invalidServerConfigSettings() { MockConfigPart data = new MockConfigPart() .withUsername("u") .withServerName("blah") .withClientname("c"); ServerConfig sc = ServerConfig.createFrom(data); data.withUsername(null).withServerName(null); // Should not throw an error - it only needs client stuff. ClientConfig.createFrom(sc, data); }
@Override public boolean hasError() { for (ConfigProblem configProblem : getConfigProblems()) { if (configProblem.isError()) { return true; } } return false; }
private ClientConfig createClientConfig() { MockConfigPart part = new MockConfigPart() // By using the RSH port, it means that the connection will be kept open // (NTS connection). By keeping the connection open until explicitly // disconnected, this will indirectly be testing that the // SimpleConnectionManager closes the connection. .withServerName(p4.getPort()) .withUsername(p4.getUser()) .withClientname("client") .withNoPassword(); final ServerConfig serverConfig = ServerConfig.createFrom(part); return ClientConfig.createFrom(serverConfig, part); } }