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.qrmedia.commons.collections.PairUtilsTest.java

@SuppressWarnings("unchecked")
@Test//ww  w  .j a  va2 s.  c om
public void toPairs() {
    String firstObject1 = "007";
    String firstObject2 = "008";
    Object secondObject = new Object();

    assertTrue(CollectionUtils.isEqualCollection(
            Arrays.asList(new Pair<String, Object>(firstObject1, secondObject),
                    new Pair<String, Object>(firstObject2, secondObject)),
            PairUtils.toPairs(Arrays.asList(firstObject1, firstObject2), secondObject)));
}

From source file:com.yahoo.omid.tso.TSOServer.java

public TSOServer() {
    super();/*www.  j  a v a  2s  .  co m*/
    this.config = TSOServerConfig.configFactory();

    this.finish = false;
    this.lock = new Object();
}

From source file:org.jvoicexml.demo.mmi.simpledemo.SimpleMmiDemo.java

/**
 * Constructs a new object.
 */
public SimpleMmiDemo() {
    lock = new Object();
}

From source file:com.alibaba.citrus.util.internal.apache.lang.HashCodeBuilderTests.java

public void testSuper() {
    Object obj = new Object();
    assertEquals(17 * 37 + 19 * 41 + obj.hashCode(), new HashCodeBuilder(17, 37)
            .appendSuper(new HashCodeBuilder(19, 41).append(obj).toHashCode()).toHashCode());
}

From source file:shiver.me.timbers.waiting.SpringPropertyGetterTest.java

@Test
public void Can_get_a_spring_property_while_supplying_a_default_value() {

    final String key = someString();

    final Environment environment = mock(Environment.class);
    final Object defaultValue = new Object();

    final String expected = someString();

    // Given/*  w w  w.  jav  a 2 s .  c o m*/
    given(context.getEnvironment()).willReturn(environment);
    given(environment.getProperty(key, defaultValue.toString())).willReturn(expected);

    // When
    final String actual = getter.get(key, defaultValue);

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

From source file:com.gemstone.gemfire.security.NotAuthorizedExceptionTest.java

@Before
public void setUp() throws Exception {
    this.message = testName.getMethodName() + " message";
    this.causeMessage = testName.getMethodName() + " cause message";

    this.nonSerializableResolvedObj = new Object();
    this.nonSerializableNamingException = new NamingException(this.causeMessage);
    this.nonSerializableNamingException.setResolvedObj(this.nonSerializableResolvedObj);

    this.serializableResolvedObj = new SerializableObject(this.testName.getMethodName());
    this.serializableNamingException = new NamingException(this.causeMessage);
    this.serializableNamingException.setResolvedObj(this.serializableResolvedObj);

    this.principalName = "jsmith";
    this.nonSerializablePrincipal = mock(Principal.class);
    this.serializablePrincipal = new SerializablePrincipal(this.principalName);

    assertPreconditions();/*from ww w. j  a  v  a2s.c  o m*/
}

From source file:spring.travel.site.request.RequestInfoInterceptorTest.java

@Test
public void shouldSetRequestInfoAttributeWithIpAddressIfRequestCookiesAreNull() throws Exception {
    when(request.getHeaders("Cookie")).thenReturn(null);

    assertTrue(interceptor.preHandle(request, response, new Object()));

    verify(request, times(1)).setAttribute(eq(attributeName), requestCaptor.capture());
    Request requestInfo = requestCaptor.getValue();

    assertEquals(Optional.empty(), requestInfo.getCookieValue());
    assertEquals(ipAddress, requestInfo.getRemoteAddress());
    assertEquals(Optional.empty(), requestInfo.getUser());
}

From source file:com.opensymphony.xwork2.validator.URLValidatorTest.java

public void testInvalidEmptyValue() throws Exception {

    URLValidator validator = new URLValidator();
    validator.setValidatorContext(new DummyValidatorContext(new Object(), tpf));
    validator.setFieldName("testingUrl2");
    validator.setValueStack(ActionContext.getContext().getValueStack());
    validator.validate(new MyObject());

    assertFalse(validator.getValidatorContext().hasErrors());
    assertFalse(validator.getValidatorContext().hasActionErrors());
    assertFalse(validator.getValidatorContext().hasActionMessages());
    assertFalse(validator.getValidatorContext().hasFieldErrors());
}

From source file:com.smartsheet.api.internal.json.JacksonJsonSerializerTest.java

@Test
public void testSerialize() {
    try {/*from  w  ww  .j  a v  a  2s .  co m*/
        // Illegal Argument due to null
        try {
            jjs.serialize(null, new ByteArrayOutputStream());
            fail("should throw exception");
        } catch (IllegalArgumentException ex) {
            //Expected
        }

        // Illegal Argument due to null
        try {
            jjs.serialize(new Object(), null);
            fail("should throw exception");
        } catch (IllegalArgumentException ex) {
            //Expected
        }

        // Illegal Argument due to null
        try {
            jjs.serialize(null, null);
            fail("should throw exception");
        } catch (IllegalArgumentException ex) {
            //Expected
        }
    } catch (JSONSerializerException ex) {
        fail("Shouldn't have thrown this exception: " + ex);
    }

    // Mapping Exception. Can't serialize to an object and can't create an empty bean serializer
    try {
        jjs.serialize(new Object(), new ByteArrayOutputStream());
        fail("Should throw a JSONMappingException");
    } catch (JSONSerializerException ex) {
        // Expected
    }

    // Test successful serialization
    User user = new User();
    user.setEmail("test@test.com");
    try {
        jjs.serialize(user, new ByteArrayOutputStream());
    } catch (JSONSerializerException e) {
        fail("Shouldn't throw an exception");
    }

    // Test IOException
    File tempFile = null;
    try {
        tempFile = File.createTempFile("json_test", ".tmp");
        FileOutputStream fos = new FileOutputStream(tempFile);
        fos.close();
        try {
            jjs.serialize(user, fos);
        } catch (JSONSerializerException e) {
            // Expected

        }
    } catch (IOException e1) {
        fail("Trouble creating a temp file");
    }
}

From source file:com.lonepulse.robozombie.proxy.ProcessorInvocationTest.java

/**
 * <p>Tests {@link Processors#RESPONSE} invocation with an inadequate argument count.</p>
 *  //from ww w  . j  av a  2 s . c o m
 * @since 1.3.0
 */
@Test
public final void testResponseArgumentCount() {

    expectedException.expect(Is.isA(RuntimeException.class));
    Processors.RESPONSE.run(new Object());
}