1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-11-29 07:22:07 +01:00

Use Message in FromMatchesFilterTest

This commit is contained in:
Florian Schmaus 2016-05-25 22:51:15 +02:00
parent 2bf6435881
commit 98ec77caee

View file

@ -19,6 +19,7 @@ package org.jivesoftware.smack.filter;
import static org.junit.Assert.assertTrue; import static org.junit.Assert.assertTrue;
import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertFalse;
import org.jivesoftware.smack.packet.Message;
import org.jivesoftware.smack.packet.Stanza; import org.jivesoftware.smack.packet.Stanza;
import org.junit.Test; import org.junit.Test;
import org.jxmpp.jid.EntityFullJid; import org.jxmpp.jid.EntityFullJid;
@ -46,10 +47,7 @@ public class FromMatchesFilterTest {
public void autoCompareMatchingEntityFullJid() public void autoCompareMatchingEntityFullJid()
{ {
FromMatchesFilter filter = FromMatchesFilter.create(FULL_JID1_R1); FromMatchesFilter filter = FromMatchesFilter.create(FULL_JID1_R1);
Stanza packet = new Stanza() { Stanza packet = new Message();
@Override
public String toXML() { return null; }
};
packet.setFrom(FULL_JID1_R1); packet.setFrom(FULL_JID1_R1);
assertTrue(filter.accept(packet)); assertTrue(filter.accept(packet));
@ -74,10 +72,7 @@ public class FromMatchesFilterTest {
public void autoCompareMatchingBaseJid() public void autoCompareMatchingBaseJid()
{ {
FromMatchesFilter filter = FromMatchesFilter.create(BASE_JID1); FromMatchesFilter filter = FromMatchesFilter.create(BASE_JID1);
Stanza packet = new Stanza() { Stanza packet = new Message();
@Override
public String toXML() { return null; }
};
packet.setFrom(BASE_JID1); packet.setFrom(BASE_JID1);
assertTrue(filter.accept(packet)); assertTrue(filter.accept(packet));
@ -102,10 +97,7 @@ public class FromMatchesFilterTest {
public void autoCompareMatchingServiceJid() public void autoCompareMatchingServiceJid()
{ {
FromMatchesFilter filter = FromMatchesFilter.create(SERVICE_JID1); FromMatchesFilter filter = FromMatchesFilter.create(SERVICE_JID1);
Stanza packet = new Stanza() { Stanza packet = new Message();
@Override
public String toXML() { return null; }
};
packet.setFrom(SERVICE_JID1); packet.setFrom(SERVICE_JID1);
assertTrue(filter.accept(packet)); assertTrue(filter.accept(packet));
@ -127,10 +119,7 @@ public class FromMatchesFilterTest {
public void bareCompareMatchingEntityFullJid() public void bareCompareMatchingEntityFullJid()
{ {
FromMatchesFilter filter = FromMatchesFilter.createBare(FULL_JID1_R1); FromMatchesFilter filter = FromMatchesFilter.createBare(FULL_JID1_R1);
Stanza packet = new Stanza() { Stanza packet = new Message();
@Override
public String toXML() { return null; }
};
packet.setFrom(BASE_JID1); packet.setFrom(BASE_JID1);
assertTrue(filter.accept(packet)); assertTrue(filter.accept(packet));
@ -155,10 +144,7 @@ public class FromMatchesFilterTest {
public void bareCompareMatchingBaseJid() public void bareCompareMatchingBaseJid()
{ {
FromMatchesFilter filter = FromMatchesFilter.createBare(BASE_JID1); FromMatchesFilter filter = FromMatchesFilter.createBare(BASE_JID1);
Stanza packet = new Stanza() { Stanza packet = new Message();
@Override
public String toXML() { return null; }
};
packet.setFrom(BASE_JID1); packet.setFrom(BASE_JID1);
assertTrue(filter.accept(packet)); assertTrue(filter.accept(packet));
@ -183,10 +169,7 @@ public class FromMatchesFilterTest {
public void bareCompareMatchingServiceJid() public void bareCompareMatchingServiceJid()
{ {
FromMatchesFilter filter = FromMatchesFilter.createBare(SERVICE_JID1); FromMatchesFilter filter = FromMatchesFilter.createBare(SERVICE_JID1);
Stanza packet = new Stanza() { Stanza packet = new Message();
@Override
public String toXML() { return null; }
};
packet.setFrom(SERVICE_JID1); packet.setFrom(SERVICE_JID1);
assertTrue(filter.accept(packet)); assertTrue(filter.accept(packet));
@ -208,10 +191,7 @@ public class FromMatchesFilterTest {
public void fullCompareMatchingEntityFullJid() public void fullCompareMatchingEntityFullJid()
{ {
FromMatchesFilter filter = FromMatchesFilter.createFull(FULL_JID1_R1); FromMatchesFilter filter = FromMatchesFilter.createFull(FULL_JID1_R1);
Stanza packet = new Stanza() { Stanza packet = new Message();
@Override
public String toXML() { return null; }
};
packet.setFrom(FULL_JID1_R1); packet.setFrom(FULL_JID1_R1);
assertTrue(filter.accept(packet)); assertTrue(filter.accept(packet));
@ -236,10 +216,7 @@ public class FromMatchesFilterTest {
public void fullCompareMatchingBaseJid() public void fullCompareMatchingBaseJid()
{ {
FromMatchesFilter filter = FromMatchesFilter.createFull(BASE_JID1); FromMatchesFilter filter = FromMatchesFilter.createFull(BASE_JID1);
Stanza packet = new Stanza() { Stanza packet = new Message();
@Override
public String toXML() { return null; }
};
packet.setFrom(BASE_JID1); packet.setFrom(BASE_JID1);
assertTrue(filter.accept(packet)); assertTrue(filter.accept(packet));
@ -264,10 +241,7 @@ public class FromMatchesFilterTest {
public void fullCompareMatchingServiceJid() public void fullCompareMatchingServiceJid()
{ {
FromMatchesFilter filter = FromMatchesFilter.createFull(SERVICE_JID1); FromMatchesFilter filter = FromMatchesFilter.createFull(SERVICE_JID1);
Stanza packet = new Stanza() { Stanza packet = new Message();
@Override
public String toXML() { return null; }
};
packet.setFrom(SERVICE_JID1); packet.setFrom(SERVICE_JID1);
assertTrue(filter.accept(packet)); assertTrue(filter.accept(packet));