Example usage for junit.framework Assert assertEquals

List of usage examples for junit.framework Assert assertEquals

Introduction

In this page you can find the example usage for junit.framework Assert assertEquals.

Prototype

static public void assertEquals(int expected, int actual) 

Source Link

Document

Asserts that two ints are equal.

Usage

From source file:de.itsvs.cwtrpc.controller.config.RemoteServiceControllerConfigBeanDefinitionParserTest.java

@Test
public void test1() {
    RemoteServiceControllerConfig config;

    config = appContext.getBean("serviceController100", RemoteServiceControllerConfig.class);
    Assert.assertEquals(1, config.getServiceModuleConfigs().size());
    Assert.assertEquals("myModule700", config.getServiceModuleConfigs().iterator().next().getName());
    Assert.assertTrue(config.getResponseCompressionEnabled());
    Assert.assertFalse(config.getRpcTokenProtectionEnabled());
    Assert.assertEquals("rpcTokenService", config.getRpcTokenValidatorName());
    Assert.assertSame(appContext.getBean("serializationPolicyProvider"),
            config.getSerializationPolicyProvider());
}

From source file:ar.com.zauber.commons.spring.web.controllers.ExceptionControllerTest.java

/** test */
@Test/*  w w w  .j a  va 2s  .com*/
public final void test500() throws Exception {
    req.setAttribute("javax.servlet.error.status_code", 500);
    final ModelAndView mav = exceptionController.handleRequestInternal(req, res);
    Assert.assertEquals("exceptions/internalerror", mav.getViewName());
}

From source file:org.web4thejob.orm.DataReaderServiceTest.java

@Test(expected = DataIntegrityViolationException.class)
public void findUniqueByQuery() {
    final Query query = ContextUtil.getEntityFactory().buildQuery(Master1.class);
    Assert.assertEquals(iterations, ContextUtil.getDRS().getAll(Master1.class).size());
    ContextUtil.getDRS().findUniqueByQuery(query);
}

From source file:io.cloudslang.lang.compiler.PreCompileTransformersTest.java

@Test
public void testOpInvalidInput() throws Exception {
    URI resource = getClass().getResource("/corrupted/transformers/operation_input_private_no_default.sl")
            .toURI();//w  w w  .  ja  v a  2 s.c o  m
    ExecutableModellingResult result = compiler.preCompileSource(SlangSource.fromFile(resource));

    Assert.assertNotNull(result);

    Executable executable = result.getExecutable();
    Assert.assertNotNull(executable);
    List<Input> inputs = executable.getInputs();
    Assert.assertEquals(6, inputs.size());

    List<RuntimeException> errors = result.getErrors();
    Assert.assertNotNull(errors);
    Assert.assertTrue(errors.size() > 0);
    exception.expect(RuntimeException.class);
    exception.expectMessage("For operation 'operation_input_private_no_default' syntax is illegal.");
    exception.expectMessage(
            "Input: 'input_private_no_default' is private and required but no default value was specified");
    throw errors.get(0);
}

From source file:com.osbcp.cssparser.CSSParserTest.java

@Test
public void testCommentInsideRule() throws Exception {

    List<Rule> rules = CSSParser.parse(
            "table /* and a comment here */ td { width: 100px; /* should be ignored */ text-decoration: underlined; }");

    Assert.assertEquals(1, rules.size());

    Rule rule = rules.get(0);//www. ja v  a 2 s .c o  m
    Assert.assertEquals("table  td", rule.getSelectors().get(0).toString());
    Assert.assertEquals("width", rule.getPropertyValues().get(0).getProperty());
    Assert.assertEquals("100px", rule.getPropertyValues().get(0).getValue());
    Assert.assertEquals("text-decoration", rule.getPropertyValues().get(1).getProperty());
    Assert.assertEquals("underlined", rule.getPropertyValues().get(1).getValue());

}

From source file:com.redhat.rhn.domain.monitoring.test.MonitoringTestUtils.java

/**
 * Verify that the parameters in the probe have been set in accordance
 * with what {@link #setupParamValues} has set up.
 *
 * @param probe the probe to verify// w  w w . j a  va  2  s  . co  m
 * @param command the command the probe uses
 */
public static void verifyParameters(Probe probe, Command command) {
    Set probeNames = parameterNameSet(probe);
    Set cmdNames = parameterNameSet(command);
    Assert.assertEquals(cmdNames, probeNames);
    Map probeValues = parameterValueMap(probe);
    Assert.assertEquals(makeParamDefaults(command, true), probeValues);
}

From source file:io.cloudslang.lang.compiler.modeller.transformers.DoTransformerTest.java

@Test
public void testTransformExpression() throws Exception {
    Map doArgumentsMap = loadFirstTaskFromFile("/flow_with_data.yaml");
    @SuppressWarnings("unchecked")
    List<Argument> arguments = doTransformer.transform(doArgumentsMap);
    Assert.assertFalse(arguments.isEmpty());
    Assert.assertEquals(2, arguments.size());
    Argument argument = arguments.iterator().next();
    Assert.assertEquals("city", argument.getName());
    Assert.assertEquals("city_name", argument.getValue());
    Assert.assertEquals(false, argument.isOverridable());
}

From source file:com.photon.phresco.service.rest.api.LoginServiceTest.java

public void testLogin() throws PhrescoException {
    String userName = "kumar_s";
    String password = "Phresco@123";
    byte[] encodeBase64 = Base64.encodeBase64(password.getBytes());
    String encodedPassword = new String(encodeBase64);
    PhrescoServerFactory.initialize();//from  w  w  w .  j  a  v  a2 s  .  co  m
    RepositoryManager repoMgr = PhrescoServerFactory.getRepositoryManager();
    Credentials credentials = new Credentials(userName, encodedPassword);
    Client client = ClientHelper.createClient();
    WebResource resource = client.resource(repoMgr.getAuthServiceURL() + "/ldap/authenticate");
    resource.accept(MediaType.APPLICATION_JSON);
    ClientResponse response = resource.type(MediaType.APPLICATION_JSON).post(ClientResponse.class, credentials);
    GenericType<User> genericType = new GenericType<User>() {
    };
    User user = response.getEntity(genericType);
    Assert.assertEquals(true, user.isPhrescoEnabled());
}

From source file:de.itsvs.cwtrpc.controller.config.AutowiredRemoteServiceGroupConfigBeanDefinitionParserTest.java

@Test
public void test1() {
    AutowiredRemoteServiceGroupConfig config;

    config = appContext.getBean("autowiredServiceGroup101", AutowiredRemoteServiceGroupConfig.class);
    Assert.assertEquals(1, config.getBasePackages().size());
    Assert.assertEquals("de.itsvs.test.", config.getBasePackages().iterator().next());
    Assert.assertNull(config.getResponseCompressionEnabled());
    Assert.assertNull(config.getRpcTokenProtectionEnabled());
    Assert.assertNull(config.getRpcTokenValidatorName());
    Assert.assertEquals(0, config.getServiceConfigs().size());
    Assert.assertEquals(0, config.getChildGroupConfigs().size());
    Assert.assertEquals(0, config.getIncludeFilters().size());
    Assert.assertEquals(0, config.getExcludeFilters().size());
}

From source file:org.jasig.portlet.weather.dao.worldwide.WorldWeatherOnlineUnmarshallingTest.java

@Test
public void testMetric() throws JAXBException, IOException, ParseException {
    InputStream is = applicationContext.getResource("classpath:/seattleWeather.xml").getInputStream();
    Weather weather = dao.deserializeWeatherResult(is, TemperatureUnit.C);
    Assert.assertEquals(weather.getForecast().size(), 3);
    Assert.assertEquals(weather.getForecast().toArray(new Forecast[] {})[0].getDay(), "Thu");
    Assert.assertEquals(weather.getForecast().toArray(new Forecast[] {})[0].getImgName(), "01");
    Assert.assertEquals(weather.getForecast().toArray(new Forecast[] {})[0].getImgUrl(), null);
    Assert.assertEquals(weather.getCurrentWeather().getCondition(), "Light drizzle");
    Assert.assertEquals(weather.getCurrentWeather().getImgName(), "12");
    Assert.assertEquals(weather.getCurrentWeather().getTemperature(), new Integer(7));
}