Example usage for junit.framework Assert assertTrue

List of usage examples for junit.framework Assert assertTrue

Introduction

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

Prototype

static public void assertTrue(boolean condition) 

Source Link

Document

Asserts that a condition is true.

Usage

From source file:com.yxy.chukonu.java.aws.sdk.s3.kms.managed.cmk.testKMSkeyUploadObject.java

public static void main(String[] args) throws Exception {
    String bucketName = "***bucket name***";
    String objectKey = "ExampleKMSEncryptedObject"; //The key in the specified bucket under which the object is stored.
    String kms_cmk_id = "***AWS KMS customer master key ID***";

    KMSEncryptionMaterialsProvider materialProvider = new KMSEncryptionMaterialsProvider(kms_cmk_id);

    encryptionClient = new AmazonS3EncryptionClient(new ProfileCredentialsProvider(), materialProvider,
            new CryptoConfiguration());

    // Upload object using the encryption client.
    byte[] plaintext = "Hello World, S3 Client-side Encryption Using Asymmetric Master Key!".getBytes();
    System.out.println("plaintext's length: " + plaintext.length);
    encryptionClient.putObject(new PutObjectRequest(bucketName, objectKey, new ByteArrayInputStream(plaintext),
            new ObjectMetadata()));

    // Download the object.
    S3Object downloadedObject = encryptionClient.getObject(bucketName, objectKey);
    byte[] decrypted = IOUtils.toByteArray(downloadedObject.getObjectContent());

    // Verify same data.
    Assert.assertTrue(Arrays.equals(plaintext, decrypted));
}

From source file:com.doculibre.constellio.utils.izpack.UsersXmlFileUtils.java

public static void main(String[] argv) {
    createEmptyUsersFile();//w ww  .  j av  a2s .  c o m

    ConstellioUser dataUser = new ConstellioUser("admin", "lol", ConstellioSpringUtils.getDefaultLocale());
    dataUser.setFirstName("System");
    dataUser.setLastName("Administrator");
    dataUser.getRoles().add(Roles.ADMIN);

    addUserTo(dataUser);

    List<ConstellioUser> users = readUsers();

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

    ConstellioUser user = users.get(0);

    Assert.assertTrue(user.checkPassword("lol"));

    //        Assert.assertEquals(1, user.getRoles());

    Assert.assertTrue(user.isAdmin());
    System.out.println("Succes!" + DEFAULT_USERS_FILE);

}

From source file:io.selendroid.server.internal.SelendroidAssert.java

public static void assertResponseValueHasSessionId(JSONObject responseValue) {
    Assert.assertTrue(responseValue.has("SESSION_ID_KEY"));
}

From source file:de.mayflower.filmmarket.domain.ShortFormIntegrationTest.java

@Test
public void testShortForm() {
    ShortForm shortForm = new ShortForm();
    shortForm.setLicensee("Lizenznehmer");
    shortForm.setLicensor("Lizenzgeber");
    shortForm.setLicensefee(50L);//from   w w  w  .j  a  va2  s. c o  m
    shortForm.persist();
    shortForm.flush();
    shortForm.clear();

    Assert.assertNotNull(shortForm.getId());
    Assert.assertEquals("Lizenznehmer", shortForm.getLicensee());
    Assert.assertTrue(50L == shortForm.getLicensefee());
}

From source file:org.openmrs.module.jmx.util.ContextProviderTest.java

@Test
public void getApplicationContext() {
    ApplicationContext context = ContextProvider.getApplicationContext();
    Assert.assertTrue(context instanceof ApplicationContext);
}

From source file:com.art4ul.jcoon.handlers.AnnotationProcessorTests.java

@Test
public void loadAnnotationHandlerTest() {
    Assert.assertTrue(AnnotationProcessor.getInstance()
            .getAnnotationBeforeHandler(BaseUrl.class) instanceof BaseUrlAnnotationBeforeHandler);
    Assert.assertTrue(AnnotationProcessor.getInstance().getAnnotationBeforeHandler(
            HttpErrorHandler.class) instanceof HttpErrorHandlerAnnotationBeforeHandler);
    Assert.assertTrue(AnnotationProcessor.getInstance()
            .getAnnotationBeforeHandler(PathVariable.class) instanceof PathVariableAnnotationBeforeHandler);
    Assert.assertTrue(AnnotationProcessor.getInstance()
            .getAnnotationBeforeHandler(RequestBody.class) instanceof RequestBodyAnnotationBeforeHandler);
    Assert.assertTrue(AnnotationProcessor.getInstance()
            .getAnnotationBeforeHandler(RequestHeader.class) instanceof RequestHeaderAnnotationBeforeHandler);
    Assert.assertTrue(AnnotationProcessor.getInstance()
            .getAnnotationBeforeHandler(RequestMapping.class) instanceof RequestMappingAnnotationBeforeHandler);
    Assert.assertTrue(AnnotationProcessor.getInstance()
            .getAnnotationBeforeHandler(RequestParam.class) instanceof RequestParamAnnotationBeforeHandler);
}

From source file:cn.javass.spring.chapter4.ResourcePatternTest.java

@Test
public void testClasspathPrefix() throws IOException {
    ResourcePatternResolver resolver = new PathMatchingResourcePatternResolver();

    //???ResourceResourceLoader.getResource
    Resource[] resources = resolver.getResources("classpath:META-INF/INDEX.LIST");
    Assert.assertEquals(1, resources.length);

    //??ResourceResourceLoader.getResource
    resources = resolver.getResources("classpath:META-INF/*.LIST");
    Assert.assertTrue(resources.length == 1);

    //???ResourceResourceLoader.getResource
    resources = resolver.getResources("classpath:META-INF/MANIFEST.MF");
    Assert.assertEquals(1, resources.length);
}

From source file:org.grycap.vmrc.dao.test.VmiDAOTest.java

@Test
public void dummyTest() throws Exception {
    try {//from www.j a  va  2 s. c o m
        Assert.assertTrue(true);
    } catch (Exception e) {
        e.printStackTrace();
    }
}

From source file:com.TDD.TddTestInheritance.java

@Test
public void testInheritance() {
    person = new Player();
    Assert.assertTrue(person instanceof Person);

}

From source file:org.openmrs.module.sdmxhdintegration.SDMXHDMessageValidatorTest.java

@Test
@Verifies(value = "should support only message class", method = "supports(Class)")
public void supports_shouldSupportOnlyMessageClass() {
    Assert.assertTrue(validator.supports(SDMXHDMessage.class));
    Assert.assertFalse(validator.supports(Object.class));
}