use of ru.compscicenter.hpc2016.ha1.client.Client in project ORCID-Source by ORCID.
the class JpaJaxbClientAdapterTest method toClientTest.
@Test
public void toClientTest() {
ClientDetailsEntity entity = getClientDetailsEntity();
Client client = adapter.toClient(entity);
assertEquals(getClient(), client);
}
use of ru.compscicenter.hpc2016.ha1.client.Client in project ORCID-Source by ORCID.
the class JpaJaxbClientAdapterTest method toEntityTest.
@Test
public void toEntityTest() {
Client client = getClient();
ClientDetailsEntity entity = adapter.toEntity(client);
ClientDetailsEntity toCompare = getClientDetailsEntity();
// Configuration values should be the default
assertFalse(entity.isPersistentTokensEnabled());
assertNull(entity.getAuthenticationProviderId());
assertEquals(toCompare.getClientDescription(), entity.getClientDescription());
assertEquals(toCompare.getClientId(), entity.getClientId());
assertEquals(toCompare.getClientName(), entity.getClientName());
assertEquals(toCompare.getClientRegisteredRedirectUris(), entity.getClientRegisteredRedirectUris());
assertEquals(toCompare.getClientWebsite(), entity.getClientWebsite());
assertEquals(toCompare.isAllowAutoDeprecate(), entity.isAllowAutoDeprecate());
assertFalse(entity.isPersistentTokensEnabled());
assertNull(entity.getClientType());
assertNull(entity.getAuthenticationProviderId());
assertNull(entity.getEmailAccessReason());
assertNull(entity.getGroupProfileId());
assertNull(entity.getClientSecrets());
assertEquals(Collections.EMPTY_SET, entity.getClientAuthorizedGrantTypes());
assertEquals(Collections.EMPTY_SET, entity.getClientResourceIds());
assertEquals(Collections.EMPTY_SET, entity.getClientScopes());
assertEquals(Collections.EMPTY_SET, entity.getCustomEmails());
assertEquals(Collections.EMPTY_LIST, entity.getClientGrantedAuthorities());
}
use of ru.compscicenter.hpc2016.ha1.client.Client in project ORCID-Source by ORCID.
the class ClientManagerReadOnlyTest method getClientTest.
@Test
public void getClientTest() {
String seed = RandomStringUtils.randomAlphanumeric(30);
when(daoMock.findByClientId(anyString(), anyLong())).thenReturn(getClientDetailsEntity(seed));
Client client = clientManagerReadOnly.get(seed);
assertEquals(getClient(seed), client);
}
use of ru.compscicenter.hpc2016.ha1.client.Client in project hpcourse by cscenter.
the class SimpleTests method submitHardTask.
public void submitHardTask() {
new Thread(new Runnable() {
@Override
public void run() {
Client client = new Client("localhost", 1500);
client.submitTask(getHardTask());
}
}).start();
}
use of ru.compscicenter.hpc2016.ha1.client.Client in project hpcourse by cscenter.
the class SimpleTests method SimpleTest.
@Test
public void SimpleTest() throws InterruptedException {
Thread serverThread = new Thread(new Server("localhost", 1500));
serverThread.start();
Thread.sleep(1000);
Client client = new Client("localhost", 1500);
for (int i = 0; i < 4; i++) submitHardTask();
Thread.sleep(100);
client.getList();
new Thread(new Runnable() {
@Override
public void run() {
Client client = new Client("localhost", 1500);
client.submitTask(getDependTask(1, 2, 3, 4));
}
}).start();
Thread.sleep(100);
client.getList();
new Thread(new Runnable() {
@Override
public void run() {
Client client = new Client("localhost", 1500);
client.submitTask(getDependTask(1, 2, 3, 5));
}
}).start();
for (int i = 0; i < 4; i++) subscribeTask();
long actual = client.subscribe(6);
client.getList();
assertEquals(0, actual);
}
Aggregations