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.microsoft.live.unittest.PostTest.java

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

    Object userState = new Object();
    String requestPath = Paths.ME_CALENDARS;

    this.runTestOnUiThread(createAsyncRunnable(requestPath, CALENDAR, 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:org.springmodules.validation.validator.CompoundValidatorTests.java

public void testValidate_WhenOnlyOneValidatorSupports() throws Exception {
    Object object = new Object();
    BindException errors = new BindException(object, "name");

    validatorControl1.expectAndReturn(validator1.supports(object.getClass()), true);
    validator1.validate(object, errors);
    validatorControl2.expectAndReturn(validator2.supports(object.getClass()), false);

    validatorControl1.replay();//ww  w. ja v a 2 s .c o m
    validatorControl2.replay();

    validator.validate(object, errors);

    validatorControl1.verify();
    validatorControl2.verify();
}

From source file:com.ciphertool.genetics.PopulationTest.java

@Test
public void testSetGeneticStructure() {
    Population population = new Population();

    MockBreeder mockBreeder = new MockBreeder();
    population.setBreeder(mockBreeder);/*w  ww.j  a v a 2s  .  c  o m*/

    Object geneticStructure = new Object();
    population.setGeneticStructure(geneticStructure);

    Field breederField = ReflectionUtils.findField(Population.class, "breeder");
    ReflectionUtils.makeAccessible(breederField);
    MockBreeder breederFromObject = (MockBreeder) ReflectionUtils.getField(breederField, population);

    Field geneticStructureField = ReflectionUtils.findField(MockBreeder.class, "geneticStructure");
    ReflectionUtils.makeAccessible(geneticStructureField);
    Object geneticStructureFromObject = ReflectionUtils.getField(geneticStructureField, breederFromObject);

    assertSame(geneticStructure, geneticStructureFromObject);
}

From source file:org.jimsey.projects.turbine.condenser.service.TurbineService.java

public String listStocks(String market) {

    // TODO is there a better way to push the list into a json property?
    String result = null;/*from  ww  w . j av a 2  s . c o m*/
    try {
        result = json.writeValueAsString(new Object() {
            @JsonProperty("stocks")
            List<Stocks> stockz = getStocks(market);
        });
    } catch (JsonProcessingException e) {
        logger.error(e.getMessage(), e);
    }
    return result;
}

From source file:de.codecentric.boot.admin.discovery.ApplicationDiscoveryListenerTest.java

@Test
public void single_discovery_for_same_heartbeat() {
    Object heartbeat = new Object();
    listener.onParentHeartbeat(new ParentHeartbeatEvent(new Object(), heartbeat));

    when(discovery.getServices()).thenReturn(Collections.singletonList("service"));
    when(discovery.getInstances("service")).thenReturn(Collections
            .singletonList((ServiceInstance) new DefaultServiceInstance("service", "localhost", 80, false)));

    listener.onApplicationEvent(new HeartbeatEvent(new Object(), heartbeat));
    assertEquals(0, registry.getApplications().size());

    listener.onApplicationEvent(new HeartbeatEvent(new Object(), new Object()));
    assertEquals(1, registry.getApplications().size());
}

From source file:jun.learn.scene.propertysource.PropertySource.java

/**
 * Create a new {@code PropertySource} with the given name and with a new
 * {@code Object} instance as the underlying source.
 * <p>Often useful in testing scenarios when creating anonymous implementations
 * that never query an actual source but rather return hard-coded values.
 *///from  w w w.  ja v a 2s .com
@SuppressWarnings("unchecked")
public PropertySource(String name) {
    this(name, (T) new Object());
}

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

public void testValidUrl1() throws Exception {

    URLValidator validator = new URLValidator();
    validator.setValidatorContext(new DummyValidatorContext(new Object(), tpf));
    validator.setFieldName("testingUrl4");
    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.microsoft.live.unittest.PutTest.java

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

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

    this.runTestOnUiThread(createAsyncRunnable(requestPath, CALENDAR, 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:com.wirecard.ezlinkwebservices.services.impl.TranxDetailsServiceImpl.java

@Override
public EZLINGWSTRANXDETAILSRESBODY getTranxDetails(EZLINGWSTRANXDETAILSREQENV parameters)
        throws TranxDetailsFault_Exception {

    ezlink.info("Tranx Details Request received in " + TranxDetailsServiceImpl.class.getName());

    EZLINGWSTRANXDETAILSRESBODY objEZLINGWSTRANXDETAILSRESBODY = new EZLINGWSTRANXDETAILSRESBODY();
    TranxDetailsRes objTranxDetailsRes = new TranxDetailsRes();
    TranxDetailsResError objTranxDetailsResError = new TranxDetailsResError();
    ETranxLogDto objETranxLogDto;/*from w  ww.j  a  v a2 s .c  om*/

    try {

        String merchantNo = parameters.getEZLINGWSTRANXDETAILSREQBODY().getTranxDetailsReq().getMERCHANTNO();
        String merchantTranxRefNo = parameters.getEZLINGWSTRANXDETAILSREQBODY().getTranxDetailsReq()
                .getMERCHANTREFNO();
        String orderNo = parameters.getEZLINGWSTRANXDETAILSREQBODY().getTranxDetailsReq().getORDERNO();
        double amount = parameters.getEZLINGWSTRANXDETAILSREQBODY().getTranxDetailsReq().getAMOUNT()
                .doubleValue();

        ezlink.info("\n-------TRANX DETAILS----REQUEST----------------------------------------------");
        ezlink.info("SOURCE ID : " + parameters.getEZLINGWSTRANXDETAILSREQHEADER().getSOURCEID());
        ezlink.info("IP : " + parameters.getEZLINGWSTRANXDETAILSREQHEADER().getIPADDRESS());
        ezlink.info("SEC LEVEL : " + parameters.getEZLINGWSTRANXDETAILSREQHEADER().getSECURITYLEVEL());
        ezlink.info("MERCHANT NO : " + merchantNo);
        ezlink.info("MERCHANT TRANX REF NO : " + merchantTranxRefNo);
        ezlink.info("ORDER NO : " + orderNo);
        ezlink.info("AMOUNT : " + amount);
        ezlink.info("\n-------TRANX DETAILS----REQUEST----------------------------------------------");

        SpringBeanAutowiringSupport.processInjectionBasedOnCurrentContext(this);
        objETranxLogDto = objETranxLogDtoMapper.getTranxDetails(merchantNo, merchantTranxRefNo, orderNo,
                amount);
    } catch (Exception ex) {
        ezlink.error(new Object(), ex);
        TranxDetailsFault objTranxDetailsFault = new TranxDetailsFault();
        objTranxDetailsFault.setMessage(StringConstants.Common.CONNECTION_ISSUE_MESSAGE);
        objTranxDetailsFault.setFaultInfo(StringConstants.Common.CONNECTION_ISSUE_MESSAGE_INFO);

        ezlink.info("\n------TRANX DETAILS-------EXCEPTION----------------------");
        ezlink.info("Response sent from getTranxDetail : " + new Date());
        ezlink.info("Status : " + objTranxDetailsFault.getMessage());
        ezlink.info("Remarks : " + objTranxDetailsFault.getFaultInfo());
        ezlink.info("\n-------TRANX DETAILS---------EXCEPTION-------------------");

        throw new TranxDetailsFault_Exception(objTranxDetailsFault.getMessage(), objTranxDetailsFault);

    }
    if (null == objETranxLogDto) {
        TranxDetailsFault objTranxDetailsFault = new TranxDetailsFault();
        objTranxDetailsFault.setMessage(StringConstants.Common.NO_TRANSCATION_DETAIL_AVAILABLE);
        objTranxDetailsFault.setFaultInfo(StringConstants.Common.NO_TRANSCATION_DETAIL_AVAILABLE_INFO);

        ezlink.info("\n------TRANX DETAILS-------EXCEPTION----------------------");
        ezlink.info("Response sent from getTranxDetail : " + new Date());
        ezlink.info("Status : " + objTranxDetailsFault.getMessage());
        ezlink.info("Remarks : " + objTranxDetailsFault.getFaultInfo());
        ezlink.info("\n-------TRANX DETAILS---------EXCEPTION-------------------");

        throw new TranxDetailsFault_Exception(objTranxDetailsFault.getMessage(), objTranxDetailsFault);

    }

    objTranxDetailsRes.setMERCHANTNO(objETranxLogDto.getMerchantNo());
    objTranxDetailsRes.setMERCHANTREFNO(objETranxLogDto.getMerchantRefno());
    objTranxDetailsRes.setORDERNO(objETranxLogDto.getOrderNo());
    objTranxDetailsRes.setAMOUNT(String.valueOf(objETranxLogDto.getAmount()));
    objTranxDetailsRes.setCURRENCYCODE(String.valueOf(objETranxLogDto.getCurrency()));

    DateFormat df = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss");
    objTranxDetailsRes.setTRANXDATE(df.format(objETranxLogDto.getDatetime()));

    objTranxDetailsRes.setTRANXSTATUS(objETranxLogDto.getTranxStatus());
    objTranxDetailsRes.setRESPONSECODE(objETranxLogDto.getResponseCode());

    objTranxDetailsResError.setTDERRORCODE(StringConstants.ResponseCode.SUCCESS);
    objTranxDetailsResError.setTDERRORDESC(StringConstants.Common.STATUS_SUCCESS);

    ezlink.info("\n-------TRANX DETAILS----RESPONSE----------------------------------------------");
    ezlink.info("MERCHANT NO : " + objTranxDetailsRes.getMERCHANTNO());
    ezlink.info("MERCHANT TRANX REF NO : " + objTranxDetailsRes.getMERCHANTREFNO());
    ezlink.info("ORDER NO : " + objTranxDetailsRes.getORDERNO());
    ezlink.info("AMOUNT : " + objTranxDetailsRes.getAMOUNT());
    ezlink.info("CURRENCY CODE : " + objTranxDetailsRes.getCURRENCYCODE());
    ezlink.info("TRANSACTION STATUS : " + objTranxDetailsRes.getTRANXSTATUS());
    ezlink.info("RESPONSE CODE : " + objTranxDetailsRes.getRESPONSECODE());
    ezlink.info("TRANSACTION DATE : " + objTranxDetailsRes.getTRANXDATE());
    ezlink.info("ERROR CODE : " + objTranxDetailsResError.getTDERRORCODE());
    ezlink.info("ERROR DESCRIPTION : " + objTranxDetailsResError.getTDERRORDESC());
    ezlink.info("\n-------TRANX DETAILS----RESPONSE----------------------------------------------");

    objEZLINGWSTRANXDETAILSRESBODY.setTranxDetailsRes(objTranxDetailsRes);
    objEZLINGWSTRANXDETAILSRESBODY.setTranxDetailsResError(objTranxDetailsResError);

    return objEZLINGWSTRANXDETAILSRESBODY;
}

From source file:org.slf4j.impl.PiazzaLogger.java

public void debug(String format) {
    processLogs(Severity.DEBUG, format, new Object());
}