Search in sources :

Example 46 with Client

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);
}
Also used : ClientDetailsEntity(org.orcid.persistence.jpa.entities.ClientDetailsEntity) Client(org.orcid.jaxb.model.v3.dev1.client.Client) Test(org.junit.Test)

Example 47 with 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());
}
Also used : ClientDetailsEntity(org.orcid.persistence.jpa.entities.ClientDetailsEntity) Client(org.orcid.jaxb.model.v3.dev1.client.Client) Test(org.junit.Test)

Example 48 with Client

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);
}
Also used : ArgumentMatchers.anyString(org.mockito.ArgumentMatchers.anyString) Client(org.orcid.jaxb.model.v3.dev1.client.Client) Test(org.junit.Test)

Example 49 with 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();
}
Also used : Client(client.Client)

Example 50 with Client

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);
}
Also used : Server(server.Server) Client(client.Client) Test(org.junit.Test)

Aggregations

Client (org.powerbot.bot.rt4.client.Client)36 Client (org.powerbot.bot.rt6.client.Client)33 Point (java.awt.Point)25 ArrayList (java.util.ArrayList)13 Client (org.orcid.jaxb.model.v3.dev1.client.Client)11 Test (org.junit.Test)8 Tile (org.powerbot.script.Tile)8 ClientDetailsEntity (org.orcid.persistence.jpa.entities.ClientDetailsEntity)6 HashSet (java.util.HashSet)5 Rectangle (java.awt.Rectangle)4 Reflector (org.powerbot.bot.Reflector)4 Condition (org.powerbot.script.Condition)4 Client (client.Client)3 CopyOnWriteArrayList (java.util.concurrent.CopyOnWriteArrayList)3 ClientRedirectUri (org.orcid.jaxb.model.v3.dev1.client.ClientRedirectUri)3 Graphics (java.awt.Graphics)2 LinkedList (java.util.LinkedList)2 AtomicReference (java.util.concurrent.atomic.AtomicReference)2 ArgumentMatchers.anyString (org.mockito.ArgumentMatchers.anyString)2 ScopePathType (org.orcid.jaxb.model.message.ScopePathType)2