List of usage examples for java.lang Object Object
@HotSpotIntrinsicCandidate
public Object()
From source file:com.google.gwt.emultest.java.util.ArrayDequeTest.java
public void testAddAll() throws Exception { Object o1 = new Object(); Object o2 = new Object(); ArrayDeque<Object> deque = new ArrayDeque<>(); assertTrue(deque.addAll(asList(o1, o2))); checkDequeSizeAndContent(deque, o1, o2); try {//from w ww . jav a 2s.co m deque = new ArrayDeque<>(); deque.addAll(asList(o1, null, o2)); fail(); } catch (NullPointerException expected) { } }
From source file:com.yahoo.omid.tso.TSOServer.java
public TSOServer(TSOServerConfig config) { super();/*ww w . j a v a 2 s. com*/ this.config = config; this.finish = false; this.lock = new Object(); }
From source file:shiver.me.timbers.spring.security.jwt.JJwtDecryptorTest.java
@Test public void Can_parse_a_jwt_token() throws IOException { final String token = someString(); final Class<Object> type = Object.class; final JwtParser parser = mock(JwtParser.class); final JwtParser secretParser = mock(JwtParser.class); @SuppressWarnings("unchecked") final Jws<Claims> jws = mock(Jws.class); final Claims claims = mock(Claims.class); final Map map = mock(Map.class); final Object expected = new Object(); // Given/*from www . j a va 2s . c o m*/ given(parserFactory.create()).willReturn(parser); given(parser.setSigningKey(publicKey)).willReturn(secretParser); given(secretParser.parseClaimsJws(token)).willReturn(jws); given(jws.getBody()).willReturn(claims); given(claims.get(PRINCIPAL, Map.class)).willReturn(map); given(objectMapper.convertValue(map, type)).willReturn(expected); // When final Object actual = decryptor.decrypt(token, type); // Then assertThat(actual, is(expected)); }
From source file:net.sf.morph2.integration.commons.collections.TransformerToDecoratedConverterAdapterTestCase.java
/** * {@inheritDoc}/* www .j a va 2 s . co m*/ * @see net.sf.morph2.transform.converters.BaseConverterTestCase#createValidPairs() */ public List createValidPairs() 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(null, "spazz")); l.add(new ConvertedSourcePair(null, new Integer(6))); l.add(new ConvertedSourcePair(null, new Object())); return l; }
From source file:com.example.spring.util.SpringBeanFactory.java
/** * Returns a spring configured object given an id. * * @param id/* w w w . j a va2 s . co m*/ * @return Object, client needs to cast it to appropriate type. */ public Object getBean(String id) { Object context = new Object(); try { context = applicationContext.getBean(id); } catch (BeansException ex) { System.out.println(ex.getStackTrace()); } return context; }
From source file:org.springmodules.validation.validator.ConditionalValidatorTests.java
public void testValidate_WhenConditionCheckPass() throws Exception { Object object = new Object(); BindException errors = new BindException(object, "name"); conditionControl.expectAndReturn(condition.check(object), true); innerValidator.validate(object, errors); conditionControl.replay();//from w w w . j ava 2s . co m innerValidatorControl.replay(); validator.validate(object, errors); conditionControl.verify(); innerValidatorControl.verify(); }
From source file:com.openshift.internal.restclient.capability.resources.OpenshiftBinaryPortForwardingIntegrationTest.java
@Test public void testPortForwarding() { System.setProperty(IBinaryCapability.OPENSHIFT_BINARY_LOCATION, helper.getOpenShiftLocation()); IClient client = helper.createClient(); IResourceFactory resourceFactory = client.getResourceFactory(); Pod pod = resourceFactory.create("v1", ResourceKind.POD); final Port port = new Port(new ModelNode()); port.setProtocol("tcp"); port.setContainerPort(8080);/*from w ww. j a va2 s . c o m*/ pod.setName("hello-openshift"); pod.setNamespace("test"); pod.accept(new CapabilityVisitor<IPortForwardable, Object>() { @Override public Object visit(IPortForwardable capability) { capability.forwardPorts(new PortPair(8181, port)); try { Thread.sleep(5 * 1000); curl(); } catch (Exception e) { e.printStackTrace(); } capability.stop(); return null; } }, new Object()); }
From source file:net.kemitix.spring.common.logging.LogFieldPostProcessorTest.java
/** * Test of postProcessBeforeInitialization method, of class * LogFieldPostProcessor./* w w w. j ava2 s. c om*/ */ @Test public void testPostProcessBeforeInitialization() { System.out.println("postProcessBeforeInitialization"); //given Object bean = new Object(); //when Object result = postProcessor.postProcessBeforeInitialization(bean, null); //then assertThat(result, is(bean)); }
From source file:com.stehno.sjdbcx.reflection.operation.NamedQueryOperationTest.java
@Test public void executeRowMapper() throws Exception { final RowMapper rowMapper = mock(RowMapper.class); when(operationContext.extract(eq(RowMapper.class), any(Method.class))).thenReturn(rowMapper); final Object returned = new Object(); when(namedParameterJdbcTemplate.query(eq(SQL), any(SqlParameterSource.class), eq(rowMapper))) .thenReturn(Arrays.asList(returned)); assertOperation(returned);// w ww . ja v a 2s . c o m }
From source file:ch.algotrader.adapter.fix.AbstractFixApplication.java
public AbstractFixApplication(SessionID sessionID, Object incomingMessageHandler, Object outgoingMessageHandler) { super();//from ww w. j a v a 2 s . com Validate.notNull(sessionID, "Session ID may not be null"); Validate.notNull(incomingMessageHandler, "Incoming message handler may not be null"); this.sessionID = sessionID; this.incomingMessageCracker = new InternalMessageCracker(true, incomingMessageHandler); this.outgoingMessageCracker = outgoingMessageHandler != null ? new InternalMessageCracker(false, outgoingMessageHandler) : new InternalMessageCracker(false, new Object()); }