Example usage for java.util UUID randomUUID

List of usage examples for java.util UUID randomUUID

Introduction

In this page you can find the example usage for java.util UUID randomUUID.

Prototype

public static UUID randomUUID() 

Source Link

Document

Static factory to retrieve a type 4 (pseudo randomly generated) UUID.

Usage

From source file:com.nesscomputing.service.discovery.client.internal.TestConsistentRingGroup.java

@Before
public void setup() {
    List<ServiceInformation> services = Lists.newArrayList();
    services.add(new ServiceInformation("fake", "type1", UUID.randomUUID(), Maps.<String, String>newHashMap()));
    services.add(new ServiceInformation("fake", "type2", UUID.randomUUID(), Maps.<String, String>newHashMap()));
    services.add(new ServiceInformation("fake", null, UUID.randomUUID(), Maps.<String, String>newHashMap()));

    group = new ConsistentRingGroup(services);
}

From source file:gobblin.metastore.testing.TestMetadataDatabase.java

TestMetadataDatabase(TestMetastoreDatabaseServer testMetastoreDatabaseServer, String version) throws Exception {
    this.testMetastoreDatabaseServer = testMetastoreDatabaseServer;
    this.database = String.format("gobblin_%s", UUID.randomUUID().toString().replace("-", StringUtils.EMPTY));
    this.resetDatabase(version);
}

From source file:jp.co.ctc_g.rack.core.model.RackEntity.java

/**
 * ??
 */
public RackEntity() {

    this(UUID.randomUUID().toString());
}

From source file:org.ocelotds.messaging.MessageToClientTest.java

/**
 * Test of getId method, of class MessageToClient.
 *///from w w  w.jav  a  2 s  .  co  m
@Test
public void testGetSetId() {
    System.out.println("testGetSetId");
    MessageToClient instance = new MessageToClient();
    String expResult = UUID.randomUUID().toString();
    instance.setId(expResult);
    String result = instance.getId();
    assertThat(result).isEqualTo(expResult);
}

From source file:com.sawyer.advadapters.app.adapters.jsonadapter.UnitTestJSONArrayActivity.java

private static String getString() {
    return UUID.randomUUID().toString().substring(0, 6);
}

From source file:com.coffeebeans.persistence.domain.model.base.DomainObject.java

public DomainObject() {
    this(UUID.randomUUID());
}

From source file:sh.lab.jcorrelat.Message.java

public Message() {
    this.id = UUID.randomUUID().toString();
}

From source file:com.talis.storage.SubmittedItemTest.java

@Test
public void getEntityReturnsInputStreamFromConstructorUnread() throws IOException {
    byte[] data = UUID.randomUUID().toString().getBytes();
    InputStream entity = new ByteArrayInputStream(data);
    SubmittedItem submittedItem = new SubmittedItem(MediaType.TEXT_PLAIN_TYPE, entity);
    assertSame(entity, submittedItem.getEntity());
    assertTrue(Arrays.equals(data, IOUtils.toByteArray(submittedItem.getEntity())));
}

From source file:com.epam.ta.reportportal.ws.converter.builders.UserCreationBidBuilder.java

public UserCreationBidBuilder addUserCreationBid(CreateUserRQ request) {
    if (request != null) {
        getObject().setId(UUID.randomUUID().toString());
        getObject().setEmail(EntityUtils.normalizeEmail(request.getEmail().trim()));
        getObject().setDefaultProject(EntityUtils.normalizeProjectName(request.getDefaultProject()));
        getObject().setRole(request.getRole());
    }/*from  w ww .  ja  v  a 2  s .  c  om*/
    return this;
}

From source file:logdruid.data.DateFormat.java

public String generate() {
    String generatedUniqueId = UUID.randomUUID().toString();
    logger.info("unique ID: " + generatedUniqueId);
    return generatedUniqueId;
}