summaryrefslogtreecommitdiff
path: root/java/broker/src
diff options
context:
space:
mode:
authorStephen Vinoski <vinoski@apache.org>2006-11-19 04:14:42 +0000
committerStephen Vinoski <vinoski@apache.org>2006-11-19 04:14:42 +0000
commit26f3bd59751462922e4c3268392a526a60ef7b2f (patch)
tree33d4dcf6804551948e3c78233494e29fbba95c4e /java/broker/src
parentbe9f473e274d6cfe4cf8d8b04dd3f5a171ba9de4 (diff)
downloadqpid-python-26f3bd59751462922e4c3268392a526a60ef7b2f.tar.gz
convert tests to junit3
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@476701 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/broker/src')
-rw-r--r--java/broker/src/test/java/org/apache/qpid/server/UnitTests.java39
-rw-r--r--java/broker/src/test/java/org/apache/qpid/server/configuration/TestPropertyUtils.java11
-rw-r--r--java/broker/src/test/java/org/apache/qpid/server/configuration/UnitTests.java35
-rw-r--r--java/broker/src/test/java/org/apache/qpid/server/exchange/HeadersBindingTest.java41
-rw-r--r--java/broker/src/test/java/org/apache/qpid/server/exchange/UnitTests.java35
-rw-r--r--java/broker/src/test/java/org/apache/qpid/server/util/LoggingProxyTest.java30
-rw-r--r--java/broker/src/test/java/org/apache/qpid/server/util/UnitTests.java35
7 files changed, 35 insertions, 191 deletions
diff --git a/java/broker/src/test/java/org/apache/qpid/server/UnitTests.java b/java/broker/src/test/java/org/apache/qpid/server/UnitTests.java
deleted file mode 100644
index fcae268288..0000000000
--- a/java/broker/src/test/java/org/apache/qpid/server/UnitTests.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-package org.apache.qpid.server;
-
-import junit.framework.JUnit4TestAdapter;
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- org.apache.qpid.server.configuration.UnitTests.class,
- org.apache.qpid.server.exchange.UnitTests.class,
- org.apache.qpid.server.util.UnitTests.class
- })
-public class UnitTests
-{
- public static junit.framework.Test suite()
- {
- return new JUnit4TestAdapter(UnitTests.class);
- }
-}
diff --git a/java/broker/src/test/java/org/apache/qpid/server/configuration/TestPropertyUtils.java b/java/broker/src/test/java/org/apache/qpid/server/configuration/TestPropertyUtils.java
index 8bab0fbc12..3b83190e42 100644
--- a/java/broker/src/test/java/org/apache/qpid/server/configuration/TestPropertyUtils.java
+++ b/java/broker/src/test/java/org/apache/qpid/server/configuration/TestPropertyUtils.java
@@ -20,16 +20,14 @@
*/
package org.apache.qpid.server.configuration;
-import junit.framework.JUnit4TestAdapter;
import org.apache.qpid.configuration.PropertyException;
import org.apache.qpid.configuration.PropertyUtils;
-import static org.junit.Assert.assertEquals;
-import org.junit.Test;
+
+import junit.framework.TestCase;
// TODO: This belongs in the "common" module.
-public class TestPropertyUtils
+public class TestPropertyUtils extends TestCase
{
- @Test
public void testSimpleExpansion() throws PropertyException
{
System.setProperty("banana", "fruity");
@@ -37,7 +35,6 @@ public class TestPropertyUtils
assertEquals(expandedProperty, "fruity");
}
- @Test
public void testDualExpansion() throws PropertyException
{
System.setProperty("banana", "fruity");
@@ -48,6 +45,6 @@ public class TestPropertyUtils
public static junit.framework.Test suite()
{
- return new JUnit4TestAdapter(TestPropertyUtils.class);
+ return new junit.framework.TestSuite(TestPropertyUtils.class);
}
}
diff --git a/java/broker/src/test/java/org/apache/qpid/server/configuration/UnitTests.java b/java/broker/src/test/java/org/apache/qpid/server/configuration/UnitTests.java
deleted file mode 100644
index 6e39e9efd1..0000000000
--- a/java/broker/src/test/java/org/apache/qpid/server/configuration/UnitTests.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-package org.apache.qpid.server.configuration;
-
-import junit.framework.JUnit4TestAdapter;
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-@RunWith(Suite.class)
-@Suite.SuiteClasses({TestPropertyUtils.class})
-public class UnitTests
-{
- public static junit.framework.Test suite()
- {
- return new JUnit4TestAdapter(UnitTests.class);
- }
-}
diff --git a/java/broker/src/test/java/org/apache/qpid/server/exchange/HeadersBindingTest.java b/java/broker/src/test/java/org/apache/qpid/server/exchange/HeadersBindingTest.java
index 0e7ab10c59..f8c15d937a 100644
--- a/java/broker/src/test/java/org/apache/qpid/server/exchange/HeadersBindingTest.java
+++ b/java/broker/src/test/java/org/apache/qpid/server/exchange/HeadersBindingTest.java
@@ -20,24 +20,19 @@
*/
package org.apache.qpid.server.exchange;
-import org.junit.Test;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.assertFalse;
-
-
import java.util.Map;
import java.util.HashMap;
-import junit.framework.JUnit4TestAdapter;
+import junit.framework.TestCase;
/**
*/
-public class HeadersBindingTest
+public class HeadersBindingTest extends TestCase
{
private Map<String, String> bindHeaders = new HashMap<String, String>();
private Map<String, String> matchHeaders = new HashMap<String, String>();
- @Test public void default_1()
+ public void testDefault_1()
{
bindHeaders.put("A", "Value of A");
@@ -46,7 +41,7 @@ public class HeadersBindingTest
assertTrue(new HeadersBinding(bindHeaders).matches(matchHeaders));
}
- @Test public void default_2()
+ public void testDefault_2()
{
bindHeaders.put("A", "Value of A");
@@ -56,7 +51,7 @@ public class HeadersBindingTest
assertTrue(new HeadersBinding(bindHeaders).matches(matchHeaders));
}
- @Test public void default_3()
+ public void testDefault_3()
{
bindHeaders.put("A", "Value of A");
@@ -65,7 +60,7 @@ public class HeadersBindingTest
assertFalse(new HeadersBinding(bindHeaders).matches(matchHeaders));
}
- @Test public void all_1()
+ public void testAll_1()
{
bindHeaders.put("X-match", "all");
bindHeaders.put("A", "Value of A");
@@ -75,7 +70,7 @@ public class HeadersBindingTest
assertTrue(new HeadersBinding(bindHeaders).matches(matchHeaders));
}
- @Test public void all_2()
+ public void testAll_2()
{
bindHeaders.put("X-match", "all");
bindHeaders.put("A", "Value of A");
@@ -86,7 +81,7 @@ public class HeadersBindingTest
assertFalse(new HeadersBinding(bindHeaders).matches(matchHeaders));
}
- @Test public void all_3()
+ public void testAll_3()
{
bindHeaders.put("X-match", "all");
bindHeaders.put("A", "Value of A");
@@ -98,7 +93,7 @@ public class HeadersBindingTest
assertTrue(new HeadersBinding(bindHeaders).matches(matchHeaders));
}
- @Test public void all_4()
+ public void testAll_4()
{
bindHeaders.put("X-match", "all");
bindHeaders.put("A", "Value of A");
@@ -111,7 +106,7 @@ public class HeadersBindingTest
assertTrue(new HeadersBinding(bindHeaders).matches(matchHeaders));
}
- @Test public void all_5()
+ public void testAll_5()
{
bindHeaders.put("X-match", "all");
bindHeaders.put("A", "Value of A");
@@ -124,7 +119,7 @@ public class HeadersBindingTest
assertFalse(new HeadersBinding(bindHeaders).matches(matchHeaders));
}
- @Test public void any_1()
+ public void testAny_1()
{
bindHeaders.put("X-match", "any");
bindHeaders.put("A", "Value of A");
@@ -134,7 +129,7 @@ public class HeadersBindingTest
assertTrue(new HeadersBinding(bindHeaders).matches(matchHeaders));
}
- @Test public void any_2()
+ public void testAny_2()
{
bindHeaders.put("X-match", "any");
bindHeaders.put("A", "Value of A");
@@ -145,7 +140,7 @@ public class HeadersBindingTest
assertTrue(new HeadersBinding(bindHeaders).matches(matchHeaders));
}
- @Test public void any_3()
+ public void testAny_3()
{
bindHeaders.put("X-match", "any");
bindHeaders.put("A", "Value of A");
@@ -157,7 +152,7 @@ public class HeadersBindingTest
assertTrue(new HeadersBinding(bindHeaders).matches(matchHeaders));
}
- @Test public void any_4()
+ public void testAny_4()
{
bindHeaders.put("X-match", "any");
bindHeaders.put("A", "Value of A");
@@ -170,7 +165,7 @@ public class HeadersBindingTest
assertTrue(new HeadersBinding(bindHeaders).matches(matchHeaders));
}
- @Test public void any_5()
+ public void testAny_5()
{
bindHeaders.put("X-match", "any");
bindHeaders.put("A", "Value of A");
@@ -183,7 +178,7 @@ public class HeadersBindingTest
assertTrue(new HeadersBinding(bindHeaders).matches(matchHeaders));
}
- @Test public void any_6()
+ public void testAny_6()
{
bindHeaders.put("X-match", "any");
bindHeaders.put("A", "Value of A");
@@ -195,9 +190,9 @@ public class HeadersBindingTest
assertFalse(new HeadersBinding(bindHeaders).matches(matchHeaders));
}
+
public static junit.framework.Test suite()
{
- return new JUnit4TestAdapter(HeadersBindingTest.class);
+ return new junit.framework.TestSuite(HeadersBindingTest.class);
}
-
}
diff --git a/java/broker/src/test/java/org/apache/qpid/server/exchange/UnitTests.java b/java/broker/src/test/java/org/apache/qpid/server/exchange/UnitTests.java
deleted file mode 100644
index ce3812be7f..0000000000
--- a/java/broker/src/test/java/org/apache/qpid/server/exchange/UnitTests.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-package org.apache.qpid.server.exchange;
-
-import junit.framework.JUnit4TestAdapter;
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-@RunWith(Suite.class)
-@Suite.SuiteClasses({HeadersBindingTest.class})
-public class UnitTests
-{
- public static junit.framework.Test suite()
- {
- return new JUnit4TestAdapter(UnitTests.class);
- }
-}
diff --git a/java/broker/src/test/java/org/apache/qpid/server/util/LoggingProxyTest.java b/java/broker/src/test/java/org/apache/qpid/server/util/LoggingProxyTest.java
index 878500689a..c7db51016e 100644
--- a/java/broker/src/test/java/org/apache/qpid/server/util/LoggingProxyTest.java
+++ b/java/broker/src/test/java/org/apache/qpid/server/util/LoggingProxyTest.java
@@ -20,16 +20,13 @@
*/
package org.apache.qpid.server.util;
-import junit.framework.JUnit4TestAdapter;
-import org.junit.Assert;
-import static org.junit.Assert.assertEquals;
-import org.junit.Test;
-
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
-public class LoggingProxyTest
+import junit.framework.TestCase;
+
+public class LoggingProxyTest extends TestCase
{
static interface IFoo {
void foo();
@@ -58,35 +55,34 @@ public class LoggingProxyTest
}
}
- @Test
- public void simple() {
+ public void testSimple() {
LoggingProxy proxy = new LoggingProxy(new Foo(), 20);
IFoo foo = (IFoo)proxy.getProxy(IFoo.class);
foo.foo();
assertEquals(2, proxy.getBufferSize());
- Assert.assertTrue(proxy.getBuffer().get(0).toString().matches(".*: foo\\(\\) entered$"));
- Assert.assertTrue(proxy.getBuffer().get(1).toString().matches(".*: foo\\(\\) returned$"));
+ assertTrue(proxy.getBuffer().get(0).toString().matches(".*: foo\\(\\) entered$"));
+ assertTrue(proxy.getBuffer().get(1).toString().matches(".*: foo\\(\\) returned$"));
foo.foo(3, Arrays.asList(0, 1, 2));
assertEquals(4, proxy.getBufferSize());
- Assert.assertTrue(proxy.getBuffer().get(2).toString().matches(".*: foo\\(\\[3, \\[0, 1, 2\\]\\]\\) entered$"));
- Assert.assertTrue(proxy.getBuffer().get(3).toString().matches(".*: foo\\(\\) returned$"));
+ assertTrue(proxy.getBuffer().get(2).toString().matches(".*: foo\\(\\[3, \\[0, 1, 2\\]\\]\\) entered$"));
+ assertTrue(proxy.getBuffer().get(3).toString().matches(".*: foo\\(\\) returned$"));
foo.bar();
assertEquals(6, proxy.getBufferSize());
- Assert.assertTrue(proxy.getBuffer().get(4).toString().matches(".*: bar\\(\\) entered$"));
- Assert.assertTrue(proxy.getBuffer().get(5).toString().matches(".*: bar\\(\\) returned null$"));
+ assertTrue(proxy.getBuffer().get(4).toString().matches(".*: bar\\(\\) entered$"));
+ assertTrue(proxy.getBuffer().get(5).toString().matches(".*: bar\\(\\) returned null$"));
foo.bar("hello", Arrays.asList(1, 2, 3));
assertEquals(8, proxy.getBufferSize());
- Assert.assertTrue(proxy.getBuffer().get(6).toString().matches(".*: bar\\(\\[hello, \\[1, 2, 3\\]\\]\\) entered$"));
- Assert.assertTrue(proxy.getBuffer().get(7).toString().matches(".*: bar\\(\\) returned ha$"));
+ assertTrue(proxy.getBuffer().get(6).toString().matches(".*: bar\\(\\[hello, \\[1, 2, 3\\]\\]\\) entered$"));
+ assertTrue(proxy.getBuffer().get(7).toString().matches(".*: bar\\(\\) returned ha$"));
proxy.dump();
}
public static junit.framework.Test suite()
{
- return new JUnit4TestAdapter(LoggingProxyTest.class);
+ return new junit.framework.TestSuite(LoggingProxyTest.class);
}
}
diff --git a/java/broker/src/test/java/org/apache/qpid/server/util/UnitTests.java b/java/broker/src/test/java/org/apache/qpid/server/util/UnitTests.java
deleted file mode 100644
index 5314fa0df8..0000000000
--- a/java/broker/src/test/java/org/apache/qpid/server/util/UnitTests.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-package org.apache.qpid.server.util;
-
-import junit.framework.JUnit4TestAdapter;
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-@RunWith(Suite.class)
-@Suite.SuiteClasses({LoggingProxyTest.class})
-public class UnitTests
-{
- public static junit.framework.Test suite()
- {
- return new JUnit4TestAdapter(UnitTests.class);
- }
-}