List of usage examples for java.lang Object Object
@HotSpotIntrinsicCandidate
public Object()
From source file:com.antelink.sourcesquare.client.scan.SourceSquareFSWalker.java
public SourceSquareFSWalker(SourceSquareEngine engine, EventBus eventBus, TreeMapBuilder treemap) { this.eventBus = eventBus; this.levels = new ArrayList<Integer>(); this.lock = new Object(); this.treemap = treemap; this.workers.add(new ProcessWorker(0, engine, this.lock)); this.workers.add(new ProcessWorker(1, engine, this.lock)); this.workers.add(new ProcessWorker(2, engine, this.lock)); }
From source file:org.openspaces.eviction.test.LRUSingleOrderTest.java
@Test public void modifyKeepsAnObjectTest() { logger.info("same as readKeepsAnObjectTest but modify the object instead of read it"); SilverMedal silverMedal = new SilverMedal(0); gigaSpace.write(silverMedal);/*from ww w . j a v a2 s . co m*/ silverMedal.setContest("Butterfly 100m"); for (int i = 1; i <= cacheSize + 10; i++) { if (i == (cacheSize / 2)) gigaSpace.write(silverMedal); else gigaSpace.write(new SilverMedal(i)); } Assert.assertEquals("amount of objects in space is larger than cache size", gigaSpace.count(new Object()), cacheSize); Assert.assertNotNull("silver medal 0 is not in space", gigaSpace.read(silverMedal)); logger.info("Test Passed"); }
From source file:net.sf.morph2.integration.commons.collections.TransformerToDecoratedConverterAdapterTestCase.java
/** * {@inheritDoc}//from w ww .java2 s .c o m * @see net.sf.morph2.transform.converters.BaseConverterTestCase#createInvalidPairs() */ public List createInvalidPairs() throws Exception { ArrayList l = new ArrayList(); l.add(new ConvertedSourcePair("foo", "foo")); l.add(new ConvertedSourcePair("bar", "bar")); l.add(new ConvertedSourcePair("baz", "baz")); l.add(new ConvertedSourcePair("spazz", "spazz")); l.add(new ConvertedSourcePair(new Integer(6), new Integer(6))); Object o = new Object(); l.add(new ConvertedSourcePair(o, o)); return l; }
From source file:de.codecentric.boot.admin.discovery.ApplicationDiscoveryListenerTest.java
@Test public void test_register_and_convert() { when(discovery.getServices()).thenReturn(Collections.singletonList("service")); when(discovery.getInstances("service")).thenReturn(Collections .singletonList((ServiceInstance) new DefaultServiceInstance("service", "localhost", 80, false))); listener.onInstanceRegistered(new InstanceRegisteredEvent<>(new Object(), null)); assertEquals(1, registry.getApplications().size()); Application application = registry.getApplications().iterator().next(); assertEquals("http://localhost:80/health", application.getHealthUrl()); assertEquals("http://localhost:80", application.getManagementUrl()); assertEquals("http://localhost:80", application.getServiceUrl()); assertEquals("service", application.getName()); }
From source file:net.eusashead.hateoas.conditional.interceptor.ConditionalResponseInterceptorTest.java
@Test public void testPreHandleGetNotModified() throws Exception { // Request value String path = "/path/to/resource/"; String query = "query=string"; String etag = "etag"; // Set ETag value to return by service setETag(path, query, etag);// ww w .j a va2 s. co m // Set the request/response HttpServletRequest request = get(path, query).ifNoneMatch(etag).build(); HttpServletResponse response = response().build(); // Execute boolean handle = interceptor.preHandle(request, response, new Object()); // Validate Assert.assertFalse(handle); Assert.assertEquals(304, response.getStatus()); }
From source file:com.codebullets.sagalib.timeout.InMemoryTimeoutManagerTest.java
/** * Given => Callback handler has been added. * When => Scheduled timer is triggered. * Then => callback handler method is triggered. *//* w w w .j a va 2s.com*/ @Test public void timeoutTriggered_callbackAdded_callbackTriggered() { // given int delayInSec = 5; Object expectedData = new Object(); Date expectedTimeoutIn = new Date(clock.now().getTime() + TimeUnit.SECONDS.toMillis(delayInSec)); TimeoutExpired expiredCallback = mock(TimeoutExpired.class); sut.addExpiredCallback(expiredCallback); Timeout expected = Timeout.create(UUIDTimeoutId.generateNewId(), "theSagaId", "theTimeoutName", expectedTimeoutIn, expectedData); // when requestAndTriggerTimeout(expected.getSagaId(), expected.getName(), delayInSec, TimeUnit.SECONDS, expectedData); // then ArgumentCaptor<Timeout> captor = ArgumentCaptor.forClass(Timeout.class); verify(expiredCallback).expired(captor.capture()); assertThat("Saga id does not match.", captor.getValue().getSagaId(), equalTo(expected.getSagaId())); assertThat("Timeout name does not match.", captor.getValue().getName(), equalTo(expected.getName())); assertThat("Expiration time stamp does not match.", captor.getValue().getExpiredAt(), equalTo(expected.getExpiredAt())); assertThat("Data object does not match.", captor.getValue().getData(), sameInstance(expectedData)); }
From source file:edu.amc.sakai.user.GenericObjectPoolTest.java
/** * Verifies that {@link GenericObjectPool#borrowObject()} fires * {@link PoolableObjectFactory#makeObject()}, * {@link PoolableObjectFactory#activateObject(Object)}, * and {@link PoolableObjectFactory#validateObject(Object)}, in that order. * /* w w w . j a v a 2s . c o m*/ * @throws Exception test error */ public void testBorrowObjectFiresMakeActivateAndValidate() throws Exception { Object pooledObject = new Object(); // expectations are implemented as a stack, so are searched in the reverse // order from which they were created mockFactory.expects(once()).method("validateObject").with(same(pooledObject)).will(returnValue(true)); mockFactory.expects(once()).method("activateObject").with(same(pooledObject)); mockFactory.expects(once()).method("makeObject").will(returnValue(pooledObject)); Object borrowedObject = pool.borrowObject(); assertSame("Unexpected object returned from pool", pooledObject, borrowedObject); }
From source file:org.easymock.itests.OsgiTest.java
public void testCanUseMatchers() { new Equals(new Object()); }
From source file:com.redhat.lightblue.metadata.types.ContainerTypeTest.java
@Test(expected = UnsupportedOperationException.class) public void testCast() { type.cast(new Object()); }
From source file:com.spectralogic.ds3client.helpers.channels.WindowedSeekableByteChannel_Test.java
@Test(timeout = 1000) public void writeChannelSections() throws IOException { try (final ByteArraySeekableByteChannel channel = new ByteArraySeekableByteChannel()) { final Object lock = new Object(); final SeekableByteChannel channelOfAs = new WindowedSeekableByteChannel(channel, lock, 0L, 2L); final SeekableByteChannel channelOfBs = new WindowedSeekableByteChannel(channel, lock, 2L, 3L); final SeekableByteChannel channelOfCs = new WindowedSeekableByteChannel(channel, lock, 5L, 4L); assertThat(channelOfAs.size(), is(2L)); assertThat(channelOfBs.size(), is(3L)); assertThat(channelOfCs.size(), is(4L)); writeToChannel("cccc", channelOfCs); writeToChannel("bbb", channelOfBs); writeToChannel("aa", channelOfAs); channel.position(0);//from ww w . java2 s . c o m assertThat(channel.toString(), is("aabbbcccc")); } }