Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IQueue accepts null values from HazelcastClient #7048

Closed
tlamerig opened this issue Dec 10, 2015 · 1 comment

Comments

Projects
None yet
4 participants
@tlamerig
Copy link

commented Dec 10, 2015

public class IQueueTest {
    private static final String Q = "q";
    private HazelcastInstance instance;
    private HazelcastInstance client;

    @Before
    public void setUp() throws Exception {
        instance = Hazelcast.newHazelcastInstance();
        client = HazelcastClient.newHazelcastClient();
    }

    @After
    public void tearDown() throws Exception {
        client.shutdown();
        instance.shutdown();
    }

    @Test(expected = NullPointerException.class)
    public void addNullShouldThrow() throws Exception {
        IQueue<String> myQueue = client.getQueue(Q);
        myQueue.add(null);
    }

    @Test(expected = NullPointerException.class)
    public void putNullShouldThrow() throws Exception {
        IQueue<String> myQueue = client.getQueue(Q);
        myQueue.put(null);
    }

    @Test(expected = NullPointerException.class)
    public void queueShouldNotBeAbleToContainNull() throws Exception {
        BlockingQueue<String> q = client.getQueue(Q);
        q.add(null);
        q.add("hello");
        assertEquals(2, q.size());
        q.poll();
        String hello = q.poll();
        assertEquals("hello", hello);
    }
}
@pveentjer

This comment has been minimized.

Copy link
Member

commented Dec 11, 2015

Thanks for reporting these bugs! There is a PR pending with the fix.

@jerrinot jerrinot added this to the 3.6 milestone Dec 11, 2015

pveentjer added a commit to pveentjer/hazelcast that referenced this issue Dec 11, 2015

@eminn eminn closed this in #7052 Dec 11, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.