Search in sources :

Example 11 with Address

use of org.apache.activemq.artemis.core.postoffice.Address in project activemq-artemis by apache.

the class AddressImplTest method testM.

@Test
public void testM() {
    SimpleString s1 = new SimpleString("a.b.c");
    SimpleString s2 = new SimpleString("a.b.x.e");
    SimpleString s3 = new SimpleString("a.b.c.#");
    Address a1 = new AddressImpl(s1);
    Address a2 = new AddressImpl(s2);
    Address w = new AddressImpl(s3);
    Assert.assertTrue(a1.matches(w));
    Assert.assertFalse(a2.matches(w));
}
Also used : Address(org.apache.activemq.artemis.core.postoffice.Address) SimpleString(org.apache.activemq.artemis.api.core.SimpleString) AddressImpl(org.apache.activemq.artemis.core.postoffice.impl.AddressImpl) Test(org.junit.Test)

Example 12 with Address

use of org.apache.activemq.artemis.core.postoffice.Address in project activemq-artemis by apache.

the class AddressImplTest method testT.

@Test
public void testT() {
    SimpleString s1 = new SimpleString("a.b.c.d");
    SimpleString s3 = new SimpleString("*a.b.c");
    Address a1 = new AddressImpl(s1);
    Address w = new AddressImpl(s3);
    Assert.assertFalse(a1.matches(w));
}
Also used : Address(org.apache.activemq.artemis.core.postoffice.Address) SimpleString(org.apache.activemq.artemis.api.core.SimpleString) AddressImpl(org.apache.activemq.artemis.core.postoffice.impl.AddressImpl) Test(org.junit.Test)

Example 13 with Address

use of org.apache.activemq.artemis.core.postoffice.Address in project activemq-artemis by apache.

the class AddressImplTest method testNoDots.

@Test
public void testNoDots() {
    SimpleString s1 = new SimpleString("abcde");
    SimpleString s2 = new SimpleString("abcde");
    Address a1 = new AddressImpl(s1);
    Address a2 = new AddressImpl(s2);
    Assert.assertTrue(a1.matches(a2));
}
Also used : Address(org.apache.activemq.artemis.core.postoffice.Address) SimpleString(org.apache.activemq.artemis.api.core.SimpleString) AddressImpl(org.apache.activemq.artemis.core.postoffice.impl.AddressImpl) Test(org.junit.Test)

Example 14 with Address

use of org.apache.activemq.artemis.core.postoffice.Address in project activemq-artemis by apache.

the class AddressImplTest method testD.

@Test
public void testD() {
    SimpleString s1 = new SimpleString("a.b.c.d.e");
    SimpleString s2 = new SimpleString("a.b.c.x.e");
    SimpleString s3 = new SimpleString("a.b.*.d.*");
    Address a1 = new AddressImpl(s1);
    Address a2 = new AddressImpl(s2);
    Address w = new AddressImpl(s3);
    Assert.assertTrue(a1.matches(w));
    Assert.assertFalse(a2.matches(w));
}
Also used : Address(org.apache.activemq.artemis.core.postoffice.Address) SimpleString(org.apache.activemq.artemis.api.core.SimpleString) AddressImpl(org.apache.activemq.artemis.core.postoffice.impl.AddressImpl) Test(org.junit.Test)

Example 15 with Address

use of org.apache.activemq.artemis.core.postoffice.Address in project activemq-artemis by apache.

the class AddressImplTest method testK.

@Test
public void testK() {
    SimpleString s1 = new SimpleString("a.b.c.d.e.f");
    SimpleString s2 = new SimpleString("a.b.c.d.e.x");
    SimpleString s3 = new SimpleString("a.#.c.d.e.*");
    Address a1 = new AddressImpl(s1);
    Address a2 = new AddressImpl(s2);
    Address w = new AddressImpl(s3);
    Assert.assertTrue(a1.matches(w));
    Assert.assertTrue(a2.matches(w));
}
Also used : Address(org.apache.activemq.artemis.core.postoffice.Address) SimpleString(org.apache.activemq.artemis.api.core.SimpleString) AddressImpl(org.apache.activemq.artemis.core.postoffice.impl.AddressImpl) Test(org.junit.Test)

Aggregations

Address (org.apache.activemq.artemis.core.postoffice.Address)31 SimpleString (org.apache.activemq.artemis.api.core.SimpleString)24 Test (org.junit.Test)24 AddressImpl (org.apache.activemq.artemis.core.postoffice.impl.AddressImpl)23 Bindings (org.apache.activemq.artemis.core.postoffice.Bindings)4 Binding (org.apache.activemq.artemis.core.postoffice.Binding)3 Field (java.lang.reflect.Field)1 Map (java.util.Map)1 QueueBinding (org.apache.activemq.artemis.core.postoffice.QueueBinding)1 WildcardAddressManager (org.apache.activemq.artemis.core.postoffice.impl.WildcardAddressManager)1 AddressInfo (org.apache.activemq.artemis.core.server.impl.AddressInfo)1 CompositeAddress (org.apache.activemq.artemis.utils.CompositeAddress)1