Skip to content

Commit

Permalink
HORNETQ-1217 junit 3 -> 4. Automatically generated.
Browse files Browse the repository at this point in the history
  • Loading branch information
Francisco Borges committed Jun 3, 2013
1 parent 58cc781 commit ef39628
Show file tree
Hide file tree
Showing 534 changed files with 6,008 additions and 873 deletions.
7 changes: 5 additions & 2 deletions hornetq-commons/src/test/java/org/hornetq/utils/PairTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,16 @@

package org.hornetq.utils;

import junit.framework.TestCase;
import org.junit.Test;

import org.junit.Assert;
import org.hornetq.api.core.Pair;


public class PairTest extends TestCase
public class PairTest extends Assert
{

@Test
public void testPair()
{
Pair<Integer, Integer> p = new Pair<Integer, Integer>(Integer.valueOf(12), Integer.valueOf(13));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,25 @@
*/
package org.hornetq.core.remoting.impl.netty;

import org.junit.Test;

import org.hornetq.api.core.HornetQBuffer;
import org.hornetq.spi.core.remoting.BufferDecoder;
import org.jboss.netty.buffer.ChannelBuffer;
import org.jboss.netty.buffer.ChannelBuffers;
import org.jboss.netty.handler.codec.embedder.DecoderEmbedder;
import org.jboss.netty.util.CharsetUtil;

import junit.framework.TestCase;
import org.junit.Assert;

/**
*
* @author <a href="mailto:[email protected]">Norman Maurer</a>
*
*/
public class HornetQFrameDecoderTest extends TestCase{
public class HornetQFrameDecoderTest extends Assert{

@Test
public void testDecoding() {
final ChannelBuffer buffer = ChannelBuffers.copiedBuffer("TestBytes", CharsetUtil.US_ASCII);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
package org.hornetq.tests;


import junit.framework.Assert;
import junit.framework.TestCase;
import org.junit.Assert;


import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;

public abstract class CoreUnitTestCase extends TestCase
public abstract class CoreUnitTestCase extends Assert
{
public CoreUnitTestCase()
{
super();

}

public CoreUnitTestCase(String name)
{
super(name);

}

public static void assertEqualsByteArrays(final byte[] expected, final byte[] actual)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,28 +1,30 @@
package org.hornetq.tests.util;
import org.junit.Before;
import org.junit.After;

import java.io.ByteArrayOutputStream;
import java.io.PrintStream;

import junit.framework.TestCase;
import org.junit.Assert;

/**
* Test case that hijacks sys-out and sys-err.
* <p>
* It is meant to avoid cluttering either during test execution when the tested code (expectedly)
* writes to these.
*/
public abstract class SilentTestCase extends TestCase
public abstract class SilentTestCase extends Assert
{
private PrintStream origSysOut;
private PrintStream origSysErr;

private PrintStream sysOut;
private PrintStream sysErr;

@Override
protected void setUp() throws Exception
@Before
public void setUp() throws Exception
{
super.setUp();

origSysOut = System.out;
origSysErr = System.err;
sysOut = new PrintStream(new ByteArrayOutputStream());
Expand All @@ -31,11 +33,11 @@ protected void setUp() throws Exception
System.setErr(sysErr);
}

@Override
@After
public void tearDown() throws Exception
{
System.setOut(origSysOut);
System.setErr(origSysErr);
super.tearDown();

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,15 @@

package org.hornetq.util;

import org.junit.Test;

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.util.ArrayList;
import java.util.concurrent.atomic.AtomicLong;
import java.util.zip.Deflater;

import junit.framework.TestCase;
import org.junit.Assert;

import org.hornetq.utils.DeflaterReader;
import org.hornetq.utils.InflaterReader;
Expand All @@ -31,9 +33,10 @@
* @author <a href="mailto:[email protected]">Howard Gao</a>
*
*/
public class CompressionUtilTest extends TestCase
public class CompressionUtilTest extends Assert
{

@Test
public void testDeflaterReader() throws Exception
{
String inputString = "blahblahblah??blahblahblahblahblah??blablahblah??blablahblah??bla";
Expand Down Expand Up @@ -71,6 +74,7 @@ public void testDeflaterReader() throws Exception
reader.close();
}

@Test
public void testDeflaterReader2() throws Exception
{
String inputString = "blahblahblah??blahblahblahblahblah??blablahblah??blablahblah??bla";
Expand Down Expand Up @@ -112,6 +116,7 @@ public void testDeflaterReader2() throws Exception
reader.close();
}

@Test
public void testInflaterReader() throws Exception
{
String inputString = "blahblahblah??blahblahblahblahblah??blablahblah??blablahblah??bla";
Expand Down Expand Up @@ -150,6 +155,7 @@ public void testInflaterReader() throws Exception
inflater.close();
}

@Test
public void testInflaterWriter() throws Exception
{
String inputString = "blahblahblah??blahblahblahblahblah??blablahblah??blablahblah??bla";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,15 @@
*/

package org.hornetq.util;
import org.junit.Before;
import org.junit.After;

import org.junit.Test;

import java.util.Iterator;

import junit.framework.Assert;
import junit.framework.TestCase;
import org.junit.Assert;


import org.hornetq.tests.util.RandomUtil;
import org.hornetq.utils.ConcurrentHashSet;
Expand All @@ -27,7 +31,7 @@
*
*
*/
public class ConcurrentHashSetTest extends TestCase
public class ConcurrentHashSetTest extends Assert
{
// Constants -----------------------------------------------------

Expand All @@ -43,18 +47,21 @@ public class ConcurrentHashSetTest extends TestCase

// Public --------------------------------------------------------

@Test
public void testAdd() throws Exception
{
Assert.assertTrue(set.add(element));
Assert.assertFalse(set.add(element));
}

@Test
public void testAddIfAbsent() throws Exception
{
Assert.assertTrue(set.addIfAbsent(element));
Assert.assertFalse(set.addIfAbsent(element));
}

@Test
public void testRemove() throws Exception
{
Assert.assertTrue(set.add(element));
Expand All @@ -63,6 +70,7 @@ public void testRemove() throws Exception
Assert.assertFalse(set.remove(element));
}

@Test
public void testContains() throws Exception
{
Assert.assertFalse(set.contains(element));
Expand All @@ -74,6 +82,7 @@ public void testContains() throws Exception
Assert.assertFalse(set.contains(element));
}

@Test
public void testSize() throws Exception
{
Assert.assertEquals(0, set.size());
Expand All @@ -85,6 +94,7 @@ public void testSize() throws Exception
Assert.assertEquals(0, set.size());
}

@Test
public void testClear() throws Exception
{
Assert.assertTrue(set.add(element));
Expand All @@ -94,6 +104,7 @@ public void testClear() throws Exception
Assert.assertFalse(set.contains(element));
}

@Test
public void testIsEmpty() throws Exception
{
Assert.assertTrue(set.isEmpty());
Expand All @@ -105,6 +116,7 @@ public void testIsEmpty() throws Exception
Assert.assertTrue(set.isEmpty());
}

@Test
public void testIterator() throws Exception
{
set.add(element);
Expand All @@ -119,22 +131,22 @@ public void testIterator() throws Exception

// TestCase overrides --------------------------------------------

@Override
protected void setUp() throws Exception
@Before
public void setUp() throws Exception
{
super.setUp();


set = new ConcurrentHashSet<String>();
element = RandomUtil.randomString();
}

@Override
protected void tearDown() throws Exception
@After
public void tearDown() throws Exception
{
set = null;
element = null;

super.tearDown();

}
// Package protected ---------------------------------------------

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@

package org.hornetq.util;

import org.junit.Test;

import java.util.concurrent.CountDownLatch;

import junit.framework.Assert;
import junit.framework.TestCase;
import org.junit.Assert;


import org.hornetq.tests.CoreUnitTestCase;
import org.hornetq.utils.ConcurrentHashSet;
Expand All @@ -27,7 +29,7 @@
*
* @author <a href="mailto:[email protected]">Clebert Suconic</a> Created 24-Sep-08 3:42:25 PM
*/
public class TimeAndCounterIDGeneratorTest extends TestCase
public class TimeAndCounterIDGeneratorTest extends Assert
{

// Constants -----------------------------------------------------
Expand All @@ -40,6 +42,7 @@ public class TimeAndCounterIDGeneratorTest extends TestCase

// Public --------------------------------------------------------

@Test
public void testCalculation()
{
TimeAndCounterIDGenerator seq = new TimeAndCounterIDGenerator();
Expand All @@ -58,6 +61,7 @@ public void testCalculation()

}

@Test
public void testCalculationRefresh()
{
TimeAndCounterIDGenerator seq = new TimeAndCounterIDGenerator();
Expand All @@ -76,6 +80,7 @@ public void testCalculationRefresh()

}

@Test
public void testCalculationOnMultiThread() throws Throwable
{
final ConcurrentHashSet<Long> hashSet = new ConcurrentHashSet<Long>();
Expand Down Expand Up @@ -152,6 +157,7 @@ public void run()

}

@Test
public void testWrapID() throws Throwable
{
TimeAndCounterIDGenerator seq = new TimeAndCounterIDGenerator();
Expand Down
Loading

0 comments on commit ef39628

Please sign in to comment.