Example usage for junit.framework Assert assertNotSame

List of usage examples for junit.framework Assert assertNotSame

Introduction

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

Prototype

static public void assertNotSame(Object expected, Object actual) 

Source Link

Document

Asserts that two objects do not refer to the same object.

Usage

From source file:org.slc.sli.ingestion.landingzone.ZipFileUtilTest.java

@Test
public void testFileInputStreamZip() throws IOException {
    File zipFile = new File(ZIP_FILE_DIR, ZIP_FILE_WITH_NO_DIRS_NAME);
    File zipCopy = File.createTempFile(UUID.randomUUID().toString(), ".zip");
    FileUtils.copyFile(zipFile, zipCopy);

    InputStream ctlIs = null;// w  ww .j  a  v a 2s . c o  m
    InputStream xmlIs = null;

    try {
        ctlIs = ZipFileUtil.getInputStreamForFile(zipCopy, "MainControlFile.ctl");
        xmlIs = ZipFileUtil.getInputStreamForFile(zipCopy, "InterchangeStudent.xml");

        Assert.assertNotNull(ctlIs);
        Assert.assertNotNull(xmlIs);
        Assert.assertNotSame(ctlIs, xmlIs);
    } finally {
        IOUtils.closeQuietly(ctlIs);
        IOUtils.closeQuietly(xmlIs);
        FileUtils.deleteQuietly(zipCopy);
    }
}

From source file:org.vaadin.viritin.FilterableListContainerTest.java

@Test
public void clearFilters() {
    final List<Person> listOfPersons = getListOfPersons(100);
    FilterableListContainer<Person> container = new FilterableListContainer<>(listOfPersons);
    container.addContainerFilter(new SimpleStringFilter("firstName", "First1", true, true));
    Assert.assertNotSame(listOfPersons.size(), container.size());
    container.removeAllContainerFilters();
    Assert.assertEquals(listOfPersons.size(), container.size());
    container.addContainerFilter(new SimpleStringFilter("firstName", "foobar", true, true));
    Assert.assertEquals(0, container.size());

    final MutableBoolean fired = new MutableBoolean(false);
    container.addListener(new Container.ItemSetChangeListener() {
        @Override//from w  ww.jav  a 2  s  .  c  om
        public void containerItemSetChange(Container.ItemSetChangeEvent event) {
            fired.setTrue();
        }
    });
    container.removeAllContainerFilters();
    Assert.assertTrue(fired.booleanValue());
    Assert.assertEquals(listOfPersons.size(), container.size());
}