Example usage for java.lang AssertionError getClass

List of usage examples for java.lang AssertionError getClass

Introduction

In this page you can find the example usage for java.lang AssertionError getClass.

Prototype

@HotSpotIntrinsicCandidate
public final native Class<?> getClass();

Source Link

Document

Returns the runtime class of this Object .

Usage

From source file:com.alliander.osgp.acceptancetests.devicemanagement.RemoveOrganisationSteps.java

@DomainStep("the remove organisation request should return result (.*)")
public boolean thenTheResponseShouldReturn(final String result) {
    LOGGER.info("THEN: the set remove organisation request should return {}.", result);

    if (result.toUpperCase().equals("OK")) {
        try {/*from  w  w w.j  av a 2 s  .c  om*/
            Assert.assertNotNull("Response should not be null", this.response);
            Assert.assertNull("Throwable should be null", this.throwable);
        } catch (final AssertionError e) {
            LOGGER.error("Exception [{}]: {}", e.getClass().getSimpleName(), e.getMessage());
            return false;
        }
    } else {
        try {
            Assert.assertNotNull("Throwable should not be null", this.throwable);
            Assert.assertEquals(result.toUpperCase(),
                    this.throwable.getCause().getClass().getSimpleName().toUpperCase());
        } catch (final AssertionError e) {
            LOGGER.error("Exception [{}]: {}", e.getClass().getSimpleName(), e.getMessage());
            return false;
        }
    }

    return true;
}

From source file:com.alliander.osgp.acceptancetests.devicemanagement.ChangeOrganisationDataSteps.java

@DomainStep("the change organisation request should return result (.*)")
public boolean thenTheResponseShouldReturn(final String result) {
    LOGGER.info("THEN: the set remove organisation request should return {}.", result);

    if (result.toUpperCase().equals("OK")) {
        try {/*from   w  w w . ja  v a 2s  . co  m*/
            Assert.assertNotNull("Response should not be null", this.response);
            Assert.assertNull("Throwable should be null", this.throwable);
        } catch (final AssertionError e) {
            LOGGER.error("Exception [{}]: {}", e.getClass().getSimpleName(), e.getMessage());
            return false;
        }
    } else {
        try {
            Assert.assertNotNull("Throwable should not be null", this.throwable);
            Assert.assertEquals(result.toUpperCase(),
                    this.throwable.getCause().getClass().getSimpleName().toUpperCase());
        } catch (final AssertionError e) {
            LOGGER.error("Exception [{}]: {}", e.getClass().getSimpleName(), e.getMessage());
            return false;
        }
    }

    return true;
}

From source file:com.alliander.osgp.acceptancetests.devicemanagement.RemoveDeviceSteps.java

@DomainStep("the remove device response should return (.*)")
public boolean thenTheResponseShouldReturn(final String result) {
    LOGGER.info("THEN: the remove device response should return {}.", result);

    if (result.toUpperCase().equals("OK")) {
        try {// w  ww  . j  ava 2s.  com
            Assert.assertNotNull("Response should not be null", this.response);
            Assert.assertNull("Throwable should be null", this.throwable);
        } catch (final AssertionError e) {
            LOGGER.error("Exception [{}]: {}", e.getClass().getSimpleName(), e.getMessage());
            return false;
        }
    } else {
        try {
            Assert.assertNotNull("Throwable should not be null", this.throwable);
            Assert.assertEquals(result.toUpperCase(),
                    this.throwable.getCause().getClass().getSimpleName().toUpperCase());
        } catch (final AssertionError e) {
            LOGGER.error("Exception [{}]: {}", e.getClass().getSimpleName(), e.getMessage());
            return false;
        }
    }

    return true;
}

From source file:com.alliander.osgp.acceptancetests.deviceinstallation.StopDeviceTestSteps.java

@DomainStep("the stop device test response should return result (.*)")
public boolean thenTheResponseShouldReturn(final String result) {
    LOGGER.info("THEN: the stop device test response should return {}.", result);

    if (result.toUpperCase().equals("OK")) {
        try {//from   w w  w. jav a 2s  .c om
            Assert.assertNotNull("Response should not be null", this.response);
            Assert.assertNull("Throwable should be null", this.throwable);
        } catch (final AssertionError e) {
            LOGGER.error("Exception [{}]: {}", e.getClass().getSimpleName(), e.getMessage());
            return false;
        }
    } else {
        try {
            Assert.assertNotNull("Throwable should not be null", this.throwable);
            Assert.assertEquals(result.toUpperCase(), this.throwable.getClass().getSimpleName().toUpperCase());
        } catch (final AssertionError e) {
            LOGGER.error("Exception [{}]: {}", e.getClass().getSimpleName(), e.getMessage());
            return false;
        }
    }

    return true;
}

From source file:com.alliander.osgp.acceptancetests.deviceinstallation.StartDeviceTestSteps.java

@DomainStep("the start device test response should return result (.*)")
public boolean thenTheResponseShouldReturn(final String result) {
    LOGGER.info("THEN: the start device test response should return {}.", result);

    if (result.toUpperCase().equals("OK")) {
        try {/*from   ww  w .  jav  a2  s .co m*/
            Assert.assertNotNull("Response should not be null", this.response);
            Assert.assertNull("Throwable should be null", this.throwable);
        } catch (final AssertionError e) {
            LOGGER.error("Exception [{}]: {}", e.getClass().getSimpleName(), e.getMessage());
            return false;
        }
    } else {
        try {
            Assert.assertNotNull("Throwable should not be null", this.throwable);
            Assert.assertEquals(result.toUpperCase(), this.throwable.getClass().getSimpleName().toUpperCase());
        } catch (final AssertionError e) {
            LOGGER.error("Exception [{}]: {}", e.getClass().getSimpleName(), e.getMessage());
            return false;
        }
    }

    return true;
}

From source file:com.alliander.osgp.acceptancetests.firmwaremanagement.GetFirmwareVersionSteps.java

@DomainStep("the get firmware version response should return result (.*)")
public boolean thenTheResponseShouldReturn(final String result) {
    LOGGER.info("THEN: the get firmware version response should return {}.", result);

    if (result.toUpperCase().equals("OK")) {
        try {//from   www .j a  v  a  2 s .com
            Assert.assertNotNull("Response should not be null", this.response);
            Assert.assertNull("Throwable should be null", this.throwable);
        } catch (final AssertionError e) {
            LOGGER.error("Exception [{}]: {}", e.getClass().getSimpleName(), e.getMessage());
            return false;
        }
    } else {
        try {
            Assert.assertNotNull("Throwable should not be null", this.throwable);
            Assert.assertEquals(result.toUpperCase(), this.throwable.getClass().getSimpleName().toUpperCase());
        } catch (final AssertionError e) {
            LOGGER.error("Exception [{}]: {}", e.getClass().getSimpleName(), e.getMessage());
            return false;
        }
    }

    return true;
}

From source file:com.alliander.osgp.acceptancetests.adhocmanagement.SetTransitionSteps.java

@DomainStep("the set transition request should return result (.*)")
public boolean thenTheRequestShouldReturn(final String result) {
    LOGGER.info("THEN: the set transition request should return {}.", result);

    if (result.toUpperCase().equals("OK")) {
        try {//from w w  w .  j av a2  s . c  o  m
            Assert.assertNotNull("Response should not be null", this.response);
            Assert.assertNull("Throwable should be null", this.throwable);
        } catch (final AssertionError e) {
            LOGGER.error("Exception [{}]: {}", e.getClass().getSimpleName(), e.getMessage());
            return false;
        }
    } else {
        try {
            Assert.assertNotNull("Throwable should not be null", this.throwable);
            Assert.assertEquals(result.toUpperCase(), this.throwable.getClass().getSimpleName().toUpperCase());
        } catch (final AssertionError e) {
            LOGGER.error("Exception [{}]: {}", e.getClass().getSimpleName(), e.getMessage());
            return false;
        }
    }

    return true;
}

From source file:com.alliander.osgp.acceptancetests.configurationmanagement.GetConfigurationDataSteps.java

@DomainStep("the get configuration data response should return result (.*)")
public boolean thenTheResponseShouldReturn(final String result) {
    LOGGER.info("THEN: the get status response should return {}.", result);

    if (result.toUpperCase().equals("OK")) {
        try {/* w w  w .j a  va2s .co  m*/
            Assert.assertNotNull("Response should not be null", this.response);
            Assert.assertNull("Throwable should be null", this.throwable);
        } catch (final AssertionError e) {
            LOGGER.error("Exception [{}]: {}", e.getClass().getSimpleName(), e.getMessage());
            return false;
        }
    } else {
        try {
            Assert.assertNotNull("Throwable should not be null", this.throwable);
            Assert.assertEquals(result.toUpperCase(), this.throwable.getClass().getSimpleName().toUpperCase());
        } catch (final AssertionError e) {
            LOGGER.error("Exception [{}]: {}", e.getClass().getSimpleName(), e.getMessage());
            return false;
        }
    }

    return true;
}