Example usage for org.springframework.util Assert isTrue

List of usage examples for org.springframework.util Assert isTrue

Introduction

In this page you can find the example usage for org.springframework.util Assert isTrue.

Prototype

@Deprecated
public static void isTrue(boolean expression) 

Source Link

Document

Assert a boolean expression, throwing an IllegalArgumentException if the expression evaluates to false .

Usage

From source file:org.mule.modules.automation.testcases.GetRoleDetailTestCases.java

@Category({ RegressionTests.class, SmokeTests.class })
@Test//  www. jav  a 2 s.c  o  m
public void testGetRoleDetail() throws Exception {
    Role role = runFlowAndGetPayload("get-role-detail");
    Assert.notNull(role);
    Assert.isTrue(role.getId() == 3);
    Assert.isTrue(!role.getInherited());
    Assert.isTrue(role.getName().contentEquals("Manager"));
    Assert.notNull(role.getPermissions());
}

From source file:org.mule.modules.automation.testcases.GetUserDetailTestCases.java

@Category({ RegressionTests.class, SmokeTests.class })
@Test//ww w  .  j  a  v  a2s  .  co  m
public void testGetUserDetail() throws Exception {
    User user = runFlowAndGetPayload("get-user-detail");
    Assert.notNull(user);
    Assert.isTrue(user.getId() == 15);
    Assert.isTrue(user.getFirstName().contentEquals("Ana Paula"));
    Assert.isTrue(user.getLastName().contentEquals("Lo Turco"));
    Assert.isTrue(user.getMail().contentEquals("anapaulal@epidataconsulting.com"));
    Assert.notNull(user.getMemberships());

}

From source file:oz.hadoop.yarn.api.utils.MiniClusterUtils.java

public static void startMiniCluster() {
    try {// w  w  w .j  a  v a 2  s .co m
        semaphore.acquire();
    } catch (InterruptedException e) {
        throw new IllegalStateException("Acquisition of semaphore is interrupted. Exiting");
    }
    if (clusterLauncher != null) {
        throw new IllegalStateException("MiniClustrer is currently running");
    }
    File file = new File("");
    Path path = Paths.get(file.getAbsolutePath());

    Path parentPath = path.getParent();

    File clusterConfiguration = new File(parentPath + "/yarn-test-cluster/src/main/resources");
    Assert.isTrue(clusterConfiguration.exists());
    ConfigUtils.addToClasspath(clusterConfiguration);

    File miniClusterExe = new File(
            parentPath.toString() + "/yarn-test-cluster/build/install/yarn-test-cluster/bin/yarn-test-cluster");
    System.out.println(miniClusterExe.getAbsolutePath());
    if (!miniClusterExe.exists()) {
        logger.info("BUILDING MINI_CLUSTER");
        CommandProcessLauncher buildLauncher = new CommandProcessLauncher(
                path.toString() + "/build-mini-cluster");
        buildLauncher.launch();
    }
    Assert.isTrue(miniClusterExe.exists(), "Failed to find mini-cluster executable");
    clusterLauncher = new CommandProcessLauncher(miniClusterExe.getAbsolutePath());
    executor = Executors.newSingleThreadExecutor();
    executor.execute(new Runnable() {
        @Override
        public void run() {
            logger.info("STARTING MINI_CLUSTER");
            clusterLauncher.launch();
            System.out.println("EXITING>>>>>>>>>");
        }
    });
    try {
        Thread.sleep(2000);
    } catch (InterruptedException e) {
        Thread.currentThread().interrupt();
    }
}

From source file:org.mule.modules.automation.testcases.GetProjectDetailTestCases.java

@Category({ RegressionTests.class, SmokeTests.class })
@Test/*from   ww w .  j a v  a  2s  . com*/
public void testGetProjectDetail() throws Exception {
    Project project = runFlowAndGetPayload("get-project-detail");
    Assert.notNull(project);
    Assert.isTrue(project.getIdentifier().contentEquals("operacionesproyectos"));
    Assert.isTrue(project.getName().contentEquals("Proyectos"));
    Assert.isTrue(project.getDescription().contentEquals(""));
    Assert.isTrue(project.getHomepage().contentEquals(""));
    Assert.notNull(project.getTrackers());
    Assert.isTrue(project.getTrackerByName("story").getId() == 6);
    Assert.isTrue(project.getTrackerByName("Evento de proyecto").getId() == 25);
    Assert.isTrue(project.getTrackerByName("Hito proyecto").getId() == 24);
    Assert.isNull(project.getParentId());
}

From source file:sample.SampleTest.java

@Test
public void samplePositiveTest() {
    Assert.isTrue(true);
}

From source file:com.epam.cme.storefront.forms.validation.EqualAttributesValidator.java

@Override
public void initialize(final EqualAttributes constraintAnnotation) {
    Assert.notEmpty(constraintAnnotation.value());
    Assert.isTrue(constraintAnnotation.value().length == 2);
    firstAttribute = constraintAnnotation.value()[0];
    secondAttribute = constraintAnnotation.value()[1];
    Assert.hasText(firstAttribute);//www  .  j  a v a  2 s  .  com
    Assert.hasText(secondAttribute);
    Assert.isTrue(!firstAttribute.equals(secondAttribute));
}

From source file:org.opencredo.util.si.RoundRobinLoadBalancingRouter.java

public RoundRobinLoadBalancingRouter(MessageChannel[] channels) {
    Assert.noNullElements(channels);/*  w  w w .  ja v  a 2 s  .c  om*/
    Assert.isTrue(channels.length > 0);
    this.channels = channels;
    this.ixLastChannel = 0;
}

From source file:org.mule.modules.automation.testcases.CreateIssueTestCases.java

@Category({ RegressionTests.class, SmokeTests.class })
@Test/*from  w  w  w . j a  v a  2 s  . c o  m*/
public void testCreateIssue() throws Exception {
    Issue result = runFlowAndGetPayload("create-issue");
    Collection<Issue> projectIssues = runFlowAndGetPayload("get-project-issues");
    Assert.notNull(result);
    Assert.isTrue(projectIssues.contains(result));
    Assert.isTrue(result.getSubject().contentEquals("Connector Testing: Creating new Issue"));
    Assert.isTrue(result.getDescription().contentEquals("Connector Testing: Description for the new Issue"));
    Assert.isTrue(result.getPriorityId() == 4);
    Assert.isTrue(result.getStatusId() == 1);
    Assert.isTrue(result.getStatusName().contentEquals("New"));
}

From source file:im.tym.wraop.nospring.WrapperFactoryBuilderTest.java

@Test
public void testDetection() {
    Assert.isTrue(!WrapperFactoryBuilder.ASPECTJ_AVAILABLE);
    Assert.isTrue(!WrapperFactoryBuilder.SPRING_AOP_AVAILABLE);
}

From source file:im.tym.wraop.full.WrapperFactoryBuilderTest.java

@Test
public void testDetection() {
    Assert.isTrue(WrapperFactoryBuilder.ASPECTJ_AVAILABLE);
    Assert.isTrue(WrapperFactoryBuilder.SPRING_AOP_AVAILABLE);
}