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:com.redhat.lightblue.metadata.types.DateTypeTest.java

@Test(expected = Error.class)
public void testCastOther() {
    Object object = new Object();
    dateType.cast(object);
}

From source file:ch.qos.logback.ext.spring.DelegatingLogbackAppender.java

public DelegatingLogbackAppender() {
    cacheMode = EventCacheMode.ON;
    lock = new Object();
}

From source file:dwo.gameserver.model.items.itemcontainer.PcInventory.java

public PcInventory(L2PcInstance owner) {
    _owner = owner;
    _lock = new Object();
}

From source file:com.redhat.lightblue.metadata.types.IntegerTypeTest.java

@Test
public void testCompareV1Null() {
    assertEquals(integerType.compare(null, new Object()), -1);
}

From source file:shiver.me.timbers.spring.security.jwt.AuthenticationRequestJwtTokenParserTest.java

@Test
@SuppressWarnings("unchecked")
public void Can_parse_a_jwt_token_from_a_header() throws JwtInvalidTokenException {

    final HttpServletRequest request = mock(HttpServletRequest.class);

    final String token = someString();
    final Object principal = new Object();
    final Authentication expected = mock(Authentication.class);

    // Given//  w w w  . j a v a2  s.com
    given(request.getCookies()).willReturn(new Cookie[0]);
    given(request.getHeader(tokenName)).willReturn(token);
    given(principleTokenParser.parse(token)).willReturn(principal);
    given(authenticationConverter.convert(principal)).willReturn(expected);

    // When
    final Authentication actual = tokenParser.parse(request);

    // Then
    assertThat(actual, is(expected));
}

From source file:ee.ria.xroad.asyncdb.AsyncDBImpl.java

@Override
public List<MessageQueue> getMessageQueues() throws Exception {

    Callable<Void> task = () -> {
        String dbDirPath = SystemProperties.getAsyncDBPath();
        String[] messageQueueDirs = AsyncDBUtil.getDirectoriesList(new File(dbDirPath));

        if (messageQueueDirs == null) {
            return null;
        }/*from  w  w  w. j  a  v  a2 s  .c  o  m*/

        for (String queueName : messageQueueDirs) {
            LOG.debug("Message queue dir to process: '{}'", queueName);

            if (!MESSAGE_QUEUES.containsKey(queueName)) {
                String messageQueueDir = makePath(dbDirPath, queueName);
                // In this case, we lock the directory for
                // message queue. However, this JVM has not accessed
                // this queue (because it is not in cache). Therefore
                // we are the first to access the queue in this JVM
                // and do not have to use JVM-level locking. And we
                // already have the global lock for this JVM.
                // The file-based locking (to synchronize with other
                // JVMs) is sufficient in our case.
                // We'll use new Object() as lockable object so that
                // there will be no lock contention.
                AsyncDBUtil.performLocked(new AddQueueToCache(messageQueueDir, queueName),
                        makePath(messageQueueDir, MessageQueue.LOCK_FILE_NAME), new Object());
            }
        }
        return null;
    };

    AsyncDBUtil.performLocked(task, AsyncDBUtil.getGlobalLockFilePath(), this);

    return new ArrayList<>(MESSAGE_QUEUES.values());
}

From source file:pl.nask.hsn2.service.FailedRequestTest.java

@SuppressWarnings("unused")
private void defineTestsExpectations() throws Exception {
    final DataResponse dataResponse = new DataResponse(1L);
    final ObjectResponse saveObjectsResponse = new ObjectResponse(
            pl.nask.hsn2.bus.operations.ObjectResponse.ResponseType.SUCCESS_PUT);
    saveObjectsResponse.setObjects(Collections.singleton(1L));
    new NonStrictExpectations() {
        {/*ww  w  . j  a  v  a2s .  c  o m*/
            // Sends data to Data Store as a byte array.
            connector.sendDataStoreData(anyLong, withInstanceOf(byte[].class));
            result = dataResponse;

            // Sends data to Data Store as an input stream.
            connector.sendDataStoreData(anyLong, withInstanceOf(InputStream.class));
            result = dataResponse;

            // Updating job context with new attributes.
            connector.updateObject(anyLong, withInstanceOf(ObjectData.class));
            result = saveObjectsResponse;
            forEachInvocation = new Object() {
                void validate(long jobId, ObjectData data) {
                    MockTestsHelper.connectorUpdatesObject(data, updatedAttributes);
                }
            };
        }
    };

    new NonStrictExpectations() {
        final WebClientDataStoreHelper wcHelper = null;
        {
            // Get cookies from Data Store.
            WebClientDataStoreHelper.getCookiesFromDataStore(connector, anyLong, anyLong);
            result = COOKIE_WRAPPERS;
        }
    };
}

From source file:com.ebuddy.cassandra.structure.DecomposerTest.java

@Test(groups = "unit", expectedExceptions = IllegalArgumentException.class)
public void decomposeUnsupportedType() throws Exception {
    Map<Path, Object> structures = new HashMap<Path, Object>();
    structures.put(DefaultPath.fromStrings("z"), new Object());

    decomposer.decompose(structures);/*w w  w  .j  a v a  2 s  .c  o  m*/
}

From source file:com.job.portal.manager.JobsManager.java

public JSONArray getJobApplicants(HttpServletRequest request) {
    JSONArray arr = null;/*from  www  .  j av a 2  s.  c o m*/
    try {
        String jobId = request.getParameter("jobId");
        if (ExpressionCheck.checkNumber(jobId)) {
            JobApplicationsDAO jad = new JobApplicationsDAO();
            arr = jad.getJobApplicants(jobId);
        } else {
            arr = new JSONArray();
        }
    } catch (Exception e) {
        LogOut.log.error("In " + new Object() {
        }.getClass().getEnclosingClass().getName() + "." + new Object() {
        }.getClass().getEnclosingMethod().getName() + " " + e);
    } finally {
        return arr;
    }
}

From source file:io.smartspaces.activity.annotation.StandardConfigurationPropertyAnnotationProcessorTest.java

@Test
public void defaultInt_doesNotExist_ok() {
    final int expected = 42;
    int actual = new Object() {
        @ConfigurationProperty(name = property, required = false)
        private int field = expected;

        {//from  ww  w.  j av  a  2  s. co  m
            // need to process annotations after default value is set
            injectConfigValues(this);
        }
    }.field;
    assertEquals(expected, actual);
}