@Test public void testClientNameWithThreadId() throws Exception { ClientNameWithThreadId expect = new ClientNameWithThreadId(); ClientNameWithThreadId actual = new ClientNameWithThreadId(); Assert.assertEquals(expect.id, actual.id); ClientNameFromThread getter = new ClientNameFromThread(ClientNameWithThreadId.class.getName()); getter.start(); getter.join(); Assert.assertFalse(expect.id.equals(getter.clientName.id)); }
@Override public boolean equals(Object obj) { if (!(obj instanceof ClientName)) { return false; } if (this == obj) { return true; } ClientName clientName = (ClientName)obj; return this.addr.equals(clientName.addr) && this.id.equals(clientName.id) && this.startCode.equals(clientName.startCode); }
ClientName { @Override public boolean equals(Object obj) { if (!(obj instanceof ClientName)) { return false; } if (this == obj) { return true; } ClientName clientName = (ClientName)obj; return this.addr.equals(clientName.addr) && this.id.equals(clientName.id) && this.startCode.equals(clientName.startCode); } }
ClientName { @Override public boolean equals(Object obj) { if (!(obj instanceof ClientName)) { return false; } if (this == obj) { return true; } ClientName clientName = (ClientName)obj; return this.addr.equals(clientName.addr) && this.id.equals(clientName.id) && this.startCode.equals(clientName.startCode); } ClientName(String id); }
ClientName { @Override public boolean equals(Object obj) { if (!(obj instanceof ClientName)) { return false; } if (this == obj) { return true; } ClientName clientName = (ClientName)obj; return this.addr.equals(clientName.addr) && this.id.equals(clientName.id) && this.startCode.equals(clientName.startCode); } ClientName(String id); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object obj); }
ClientName { @Override public boolean equals(Object obj) { if (!(obj instanceof ClientName)) { return false; } if (this == obj) { return true; } ClientName clientName = (ClientName)obj; return this.addr.equals(clientName.addr) && this.id.equals(clientName.id) && this.startCode.equals(clientName.startCode); } ClientName(String id); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object obj);  }