Example usage for java.lang Object Object

List of usage examples for java.lang Object Object

Introduction

In this page you can find the example usage for java.lang Object Object.

Prototype

@HotSpotIntrinsicCandidate
public Object() 

Source Link

Document

Constructs a new object.

Usage

From source file:org.ualerts.fixed.service.SpringPrototypeBeanCommandServiceTest.java

/**
 * Test method for//from  w  w w .j ava 2  s  .co m
 * {@link SpringPrototypeBeanCommandService#invoke()}.
 */
@Test
public void testInvoke() throws Exception {
    final Object object = new Object();
    context.checking(new Expectations() {
        {
            oneOf(invoker).invoke(command);
            will(returnValue(object));
        }
    });
    assertSame(object, service.invoke(command));
    context.assertIsSatisfied();
}

From source file:com.launchkey.sdk.service.V1ServiceAbstract.java

protected byte[] getSecret() throws LaunchKeyException {

    try {/*  w w w .j  a va  2s .c om*/
        String json = objectMapper.writeValueAsString(new Object() {
            public final String secret = secretKey;
            public final String stamped = launchKeyDateFormat.format(new Date());
        });
        return crypto.encryptRSA(json.getBytes(), getLaunchKeyPublicKey());
    } catch (JsonProcessingException e) {
        throw new LaunchKeyException("Unable to create JSON from secret key", e, 0);
    }
}

From source file:com.github.heuermh.ensemblrestclient.JacksonArchivedSequenceConverterTest.java

@Test(expected = UnsupportedOperationException.class)
public void testToBody() {
    converter.toBody(new Object());
}

From source file:ml.shifu.core.util.JexlTest.java

@Test
public void testJavaNull() {
    JexlEngine jexl = new JexlEngine();
    String jexlExp = "is_bad_new != null";
    String jexlExpEqual = "is_bad_new == null";

    Expression e = jexl.createExpression(jexlExp);
    Expression exp = jexl.createExpression(jexlExpEqual);

    JexlContext jc = new MapContext();
    jc.set("is_bad_new", null);
    Assert.assertEquals(Boolean.FALSE, e.evaluate(jc));
    Assert.assertEquals(Boolean.TRUE, exp.evaluate(jc));

    jc.set("is_bad_new", new Object());
    Assert.assertEquals(Boolean.TRUE, e.evaluate(jc));
    Assert.assertEquals(Boolean.FALSE, exp.evaluate(jc));
}

From source file:com.couchbase.client.http.AsyncConnectionManager.java

public AsyncConnectionManager(HttpHost target, int maxConnections, NHttpClientHandler handler,
        HttpParams params, RequeueOpCallback cb) throws IOReactorException {
    super();//from w  w  w  .  j a v  a  2 s . c  om
    this.target = target;
    this.maxConnections = maxConnections;
    this.handler = handler;
    this.params = params;
    this.requeueCallback = cb;
    this.lock = new Object();
    this.allConns = new HashSet<NHttpClientConnection>();
    this.availableConns = new LinkedList<NHttpClientConnection>();
    this.pendingRequests = new LinkedList<AsyncConnectionRequest>();
    this.ioreactor = new DefaultConnectingIOReactor(2, params);
}

From source file:com.microsoft.live.unittest.DeleteTest.java

@Override
public void testAsyncResponseBodyValidWithUserState() throws Throwable {
    this.loadValidResponseBody();

    Object userState = new Object();
    String requestPath = this.calendarId;
    this.runTestOnUiThread(createAsyncRunnable(requestPath, userState));

    LiveOperation fromMethod = this.responseQueue.take();
    LiveOperation fromCallback = this.pollResponseQueue();

    this.checkReturnedOperations(fromMethod, fromCallback);
    this.checkOperationMembers(fromMethod, METHOD, requestPath, userState);
    this.checkValidResponseBody(fromMethod);
}

From source file:edu.illinois.imunit.examples.apache.collections.TestBlockingBuffer.java

/**
 * Tests {@link BlockingBuffer#get()} in combination with {@link BlockingBuffer#addAll(java.util.Collection)}.
 *//*from w  w w .  j  a v a  2  s  .com*/
@Test
@Schedule("[beforeGet]@main->beforeAddAll@addAllThread")
public void testGetWithAddAll() {
    Buffer blockingBuffer = BlockingBuffer.decorate(new MyBuffer());
    Object obj = new Object();
    new NonDelayedAddAll(blockingBuffer, obj, "addAllThread").start();

    // verify does not throw BufferUnderflowException; should block until other thread has added to the buffer .
    fireEvent("beforeGet");
    assertSame(obj, blockingBuffer.get());
    fireEvent("afterGet");
}

From source file:com.microsoft.live.unittest.DownloadTest.java

@Override
public void testAsyncResponseBodyValidWithUserState() throws Throwable {
    this.loadValidResponseBody();
    String requestPath = VALID_PATH;
    Object userState = new Object();

    this.runTestOnUiThread(this.createAsyncRunnable(requestPath, userState));

    LiveDownloadOperation fromMethod = this.responseQueue.take();
    LiveDownloadOperation fromCallback = this.pollResponseQueue();

    this.checkReturnedOperations(fromMethod, fromCallback);
    this.checkOperationMembers(fromMethod, this.getMethod(), requestPath, userState);
    this.checkValidResponseBody(fromMethod);

}

From source file:eu.sisob.uma.restserver.AuthorizationManager.java

/**
 * /*from   ww  w. j  av a  2s.co  m*/
 * @param code
 * @return
 */
public static synchronized Object getLocker(String code) {
    if (!FILE_LOCKERS.containsKey(code))
        FILE_LOCKERS.put(code, new Object());

    return FILE_LOCKERS.get(code);
}

From source file:jp.terasoluna.fw.beans.jxpath.DynamicPointerExTest.java

/**
 * testDynamicPointerExNodePointer01() <br>
 * <br>// w  ww  . jav a2s  .  co m
 * () <br>
 * A <br>
 * <br>
 * () parent:not null<br>
 * () name:not null<br>
 * () bean:new Object()<br>
 * () handler:not null<br>
 * () this.handler:null<br>
 * <br>
 * () this.handler:???<br>
 * <br>
 * ?? <br>
 * @throws Exception ?????
 */
@Test
public void testDynamicPointerExNodePointer01() throws Exception {
    // ??
    QName qName = new QName("name");
    Object bean = new Object();
    DynamicPropertyHandler handler = new MapDynamicPropertyHandler();
    Locale locale = new Locale("ja");
    NodePointer nodePointer = NodePointer.newNodePointer(qName, bean, locale);

    // 
    DynamicPointerEx result = new DynamicPointerEx(nodePointer, qName, bean, handler);

    // 
    Field field = DynamicPointerEx.class.getDeclaredField("handler");
    field.setAccessible(true);
    Object resultHandler = field.get(result);
    assertSame(handler, resultHandler);
}