mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2024-11-22 06:12:05 +01:00
Use Message in FromMatchesFilterTest
This commit is contained in:
parent
2bf6435881
commit
98ec77caee
1 changed files with 10 additions and 36 deletions
|
@ -19,6 +19,7 @@ package org.jivesoftware.smack.filter;
|
|||
import static org.junit.Assert.assertTrue;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
|
||||
import org.jivesoftware.smack.packet.Message;
|
||||
import org.jivesoftware.smack.packet.Stanza;
|
||||
import org.junit.Test;
|
||||
import org.jxmpp.jid.EntityFullJid;
|
||||
|
@ -46,10 +47,7 @@ public class FromMatchesFilterTest {
|
|||
public void autoCompareMatchingEntityFullJid()
|
||||
{
|
||||
FromMatchesFilter filter = FromMatchesFilter.create(FULL_JID1_R1);
|
||||
Stanza packet = new Stanza() {
|
||||
@Override
|
||||
public String toXML() { return null; }
|
||||
};
|
||||
Stanza packet = new Message();
|
||||
|
||||
packet.setFrom(FULL_JID1_R1);
|
||||
assertTrue(filter.accept(packet));
|
||||
|
@ -74,10 +72,7 @@ public class FromMatchesFilterTest {
|
|||
public void autoCompareMatchingBaseJid()
|
||||
{
|
||||
FromMatchesFilter filter = FromMatchesFilter.create(BASE_JID1);
|
||||
Stanza packet = new Stanza() {
|
||||
@Override
|
||||
public String toXML() { return null; }
|
||||
};
|
||||
Stanza packet = new Message();
|
||||
|
||||
packet.setFrom(BASE_JID1);
|
||||
assertTrue(filter.accept(packet));
|
||||
|
@ -102,10 +97,7 @@ public class FromMatchesFilterTest {
|
|||
public void autoCompareMatchingServiceJid()
|
||||
{
|
||||
FromMatchesFilter filter = FromMatchesFilter.create(SERVICE_JID1);
|
||||
Stanza packet = new Stanza() {
|
||||
@Override
|
||||
public String toXML() { return null; }
|
||||
};
|
||||
Stanza packet = new Message();
|
||||
|
||||
packet.setFrom(SERVICE_JID1);
|
||||
assertTrue(filter.accept(packet));
|
||||
|
@ -127,10 +119,7 @@ public class FromMatchesFilterTest {
|
|||
public void bareCompareMatchingEntityFullJid()
|
||||
{
|
||||
FromMatchesFilter filter = FromMatchesFilter.createBare(FULL_JID1_R1);
|
||||
Stanza packet = new Stanza() {
|
||||
@Override
|
||||
public String toXML() { return null; }
|
||||
};
|
||||
Stanza packet = new Message();
|
||||
|
||||
packet.setFrom(BASE_JID1);
|
||||
assertTrue(filter.accept(packet));
|
||||
|
@ -155,10 +144,7 @@ public class FromMatchesFilterTest {
|
|||
public void bareCompareMatchingBaseJid()
|
||||
{
|
||||
FromMatchesFilter filter = FromMatchesFilter.createBare(BASE_JID1);
|
||||
Stanza packet = new Stanza() {
|
||||
@Override
|
||||
public String toXML() { return null; }
|
||||
};
|
||||
Stanza packet = new Message();
|
||||
|
||||
packet.setFrom(BASE_JID1);
|
||||
assertTrue(filter.accept(packet));
|
||||
|
@ -183,10 +169,7 @@ public class FromMatchesFilterTest {
|
|||
public void bareCompareMatchingServiceJid()
|
||||
{
|
||||
FromMatchesFilter filter = FromMatchesFilter.createBare(SERVICE_JID1);
|
||||
Stanza packet = new Stanza() {
|
||||
@Override
|
||||
public String toXML() { return null; }
|
||||
};
|
||||
Stanza packet = new Message();
|
||||
|
||||
packet.setFrom(SERVICE_JID1);
|
||||
assertTrue(filter.accept(packet));
|
||||
|
@ -208,10 +191,7 @@ public class FromMatchesFilterTest {
|
|||
public void fullCompareMatchingEntityFullJid()
|
||||
{
|
||||
FromMatchesFilter filter = FromMatchesFilter.createFull(FULL_JID1_R1);
|
||||
Stanza packet = new Stanza() {
|
||||
@Override
|
||||
public String toXML() { return null; }
|
||||
};
|
||||
Stanza packet = new Message();
|
||||
|
||||
packet.setFrom(FULL_JID1_R1);
|
||||
assertTrue(filter.accept(packet));
|
||||
|
@ -236,10 +216,7 @@ public class FromMatchesFilterTest {
|
|||
public void fullCompareMatchingBaseJid()
|
||||
{
|
||||
FromMatchesFilter filter = FromMatchesFilter.createFull(BASE_JID1);
|
||||
Stanza packet = new Stanza() {
|
||||
@Override
|
||||
public String toXML() { return null; }
|
||||
};
|
||||
Stanza packet = new Message();
|
||||
|
||||
packet.setFrom(BASE_JID1);
|
||||
assertTrue(filter.accept(packet));
|
||||
|
@ -264,10 +241,7 @@ public class FromMatchesFilterTest {
|
|||
public void fullCompareMatchingServiceJid()
|
||||
{
|
||||
FromMatchesFilter filter = FromMatchesFilter.createFull(SERVICE_JID1);
|
||||
Stanza packet = new Stanza() {
|
||||
@Override
|
||||
public String toXML() { return null; }
|
||||
};
|
||||
Stanza packet = new Message();
|
||||
|
||||
packet.setFrom(SERVICE_JID1);
|
||||
assertTrue(filter.accept(packet));
|
||||
|
|
Loading…
Reference in a new issue