Skip to content
Permalink
Browse files
Remove old junit code
  • Loading branch information
coheigea committed Dec 16, 2015
1 parent 16ffe55 commit c69285a1a96e1e10fc059a2372f88c879fe45617
Show file tree
Hide file tree
Showing 9 changed files with 42 additions and 25 deletions.
@@ -32,8 +32,7 @@
<rule ref="rulesets/java/braces.xml"/>
<rule ref="rulesets/java/empty.xml"/>
<rule ref="rulesets/java/migrating.xml">
<exclude name="JUnit4TestShouldUseAfterAnnotation" />
<exclude name="JUnit4TestShouldUseTestAnnotation" />
<exclude name="JUnit4TestShouldUseAfterAnnotation" />
</rule>
<rule ref="rulesets/java/unnecessary.xml"/>

@@ -26,7 +26,8 @@

public class TestAsn1Dump {

//@Test
@Test
@org.junit.Ignore
public void testDumpWithPersonnelRecord() throws IOException {
try {
PersonnelRecord pr = TestData.createSamplePersonnel();
@@ -41,7 +42,8 @@ public void testDumpWithPersonnelRecord() throws IOException {
}
}

//@Test
@Test
@org.junit.Ignore
public void testDumpWithCompressedData() throws IOException {
String hexStr = TestUtil.readStringFromTxtFile("/compressed-data.txt");
try {
@@ -53,7 +55,8 @@ public void testDumpWithCompressedData() throws IOException {
}
}

//@Test
@Test
@org.junit.Ignore
public void testDumpWithSignedData() throws IOException {
String hexStr = TestUtil.readStringFromTxtFile("/signed-data.txt");
try {
@@ -65,7 +68,8 @@ public void testDumpWithSignedData() throws IOException {
}
}

//@Test
@Test
@org.junit.Ignore
public void testDumpWithDerData() throws IOException {
byte[] data = TestUtil.readBytesFromBinFile("/der-data.dat");
try {
@@ -27,6 +27,7 @@
import org.apache.kerby.kerberos.kerb.type.ticket.TgtTicket;
import org.apache.kerby.pki.PkiLoader;
import org.junit.Before;
import org.junit.Test;

import java.io.InputStream;
import java.security.PrivateKey;
@@ -74,7 +75,8 @@ protected void setUpClient() throws Exception {
loadCredentials();
}

//@Test
@Test
@org.junit.Ignore
public void testPkinit() throws Exception {
assertThat(userCert).isNotNull();

@@ -19,10 +19,10 @@
*/
package org.apache.kerby.kerberos.kerb.client.preauth.pkinit;

import junit.framework.TestCase;
import org.apache.kerby.kerberos.kerb.client.preauth.pkinit.certs.CertificateChainFactory;
import org.bouncycastle.jce.provider.BouncyCastleProvider;
import org.junit.Before;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

@@ -43,7 +43,7 @@
import java.security.interfaces.RSAPrivateCrtKey;
import java.util.Arrays;

public class EnvelopedDataEngineTest extends TestCase {
public class EnvelopedDataEngineTest extends org.junit.Assert {
/**
* The log for this class.
*/
@@ -76,6 +76,7 @@ public void setUp() throws Exception {
*
* @throws Exception
*/
@Test
public void testEnvelopedData() throws Exception {
byte[] dataToEnvelope = "Hello".getBytes();

@@ -20,11 +20,11 @@
package org.apache.kerby.kerberos.kerb.client.preauth.pkinit;


import junit.framework.TestCase;
import org.apache.kerby.kerberos.kerb.client.preauth.pkinit.certs.CertificateChainFactory;
import org.bouncycastle.cms.CMSSignedData;
import org.bouncycastle.jce.provider.BouncyCastleProvider;
import org.junit.Before;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

@@ -51,7 +51,7 @@
* @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
* @version $Rev$, $Date$
*/
public class SignedDataEngineTest extends TestCase {
public class SignedDataEngineTest extends org.junit.Assert {
/**
* The log for this class.
*/
@@ -86,6 +86,7 @@ public void setUp() throws Exception {
*
* @throws Exception
*/
@Test
public void testSignedData() throws Exception {
byte[] data = "Hello".getBytes();

@@ -19,9 +19,9 @@
*/
package org.apache.kerby.kerberos.kerb.client.preauth.pkinit.certs;

import junit.framework.TestCase;
import org.bouncycastle.jce.provider.BouncyCastleProvider;
import org.junit.Before;
import org.junit.Test;

import java.security.InvalidAlgorithmParameterException;
import java.security.NoSuchAlgorithmException;
@@ -45,7 +45,7 @@
* @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
* @version $Rev$, $Date$
*/
public class CertificateChainFactoryTest extends TestCase {
public class CertificateChainFactoryTest {

@Before
public void setUp() {
@@ -64,6 +64,7 @@ public void setUp() {
*
* @throws Exception
*/
@Test
public void testClientChain() throws Exception {
X509Certificate[] clientChain = CertificateChainFactory.getClientChain();

@@ -80,6 +81,7 @@ public void testClientChain() throws Exception {
*
* @throws Exception
*/
@Test
public void testKdcChain() throws Exception {
X509Certificate[] kdcChain = CertificateChainFactory.getKdcChain();

@@ -24,6 +24,8 @@

import static org.assertj.core.api.Assertions.assertThat;

import org.junit.Test;

/**
* This is just for my experimental tweaking, so pleas bear it.
*/
@@ -73,7 +75,8 @@ private void test(TestCase tc) {
/**
* This is just for my experimental tweaking, so pleas bear it.
*/
//@Test
@Test
@org.junit.Ignore
public void testCase1() {
TestCase tc = new TestCase("ATHENA.MIT.EDUraeburn",
"password", "70617373776f7264415448454e412e4d49542e4544557261656275726e",
@@ -19,7 +19,7 @@
*/
package org.apache.kerby.kerberos.kerb.crypto.dh;

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

/**
* "When using the Diffie-Hellman key agreement method, implementations MUST
@@ -30,23 +30,25 @@
* @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
* @version $Rev$, $Date$
*/
public class DhGroupTest extends TestCase {
public class DhGroupTest extends org.junit.Assert {
/**
* Tests that the translation of the hex representation of the prime modulus
* resulted in the expected bit length.
*/
@Test
public void testPrimeBitLengths() {
TestCase.assertEquals(1024, DhGroup.MODP_GROUP2.getP().bitLength());
TestCase.assertEquals(2048, DhGroup.MODP_GROUP14.getP().bitLength());
TestCase.assertEquals(4096, DhGroup.MODP_GROUP16.getP().bitLength());
assertEquals(1024, DhGroup.MODP_GROUP2.getP().bitLength());
assertEquals(2048, DhGroup.MODP_GROUP14.getP().bitLength());
assertEquals(4096, DhGroup.MODP_GROUP16.getP().bitLength());
}

/**
* Tests the generator values.
*/
@Test
public void testGeneratorValues() {
TestCase.assertEquals(2, DhGroup.MODP_GROUP2.getG().intValue());
TestCase.assertEquals(2, DhGroup.MODP_GROUP14.getG().intValue());
TestCase.assertEquals(2, DhGroup.MODP_GROUP16.getG().intValue());
assertEquals(2, DhGroup.MODP_GROUP2.getG().intValue());
assertEquals(2, DhGroup.MODP_GROUP14.getG().intValue());
assertEquals(2, DhGroup.MODP_GROUP16.getG().intValue());
}
}
@@ -20,9 +20,8 @@
package org.apache.kerby.kerberos.kerb.crypto.dh;


import junit.framework.TestCase;

import java.util.Arrays;
import org.junit.Test;


/**
@@ -36,7 +35,7 @@
* @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
* @version $Rev$, $Date$
*/
public class OctetString2KeyTest extends TestCase {
public class OctetString2KeyTest extends org.junit.Assert {
/**
* Set 1:
* =====
@@ -64,6 +63,7 @@ public class OctetString2KeyTest extends TestCase {
* 5e e5 0d 67 5c 80 9f e5 9e 4a 77 62 c5 4b 65 83
* 75 47 ea fb 15 9b d8 cd c7 5f fc a5 91 1e 4c 41
*/
@Test
public void testSet1() {
byte[] inputOctetString = new byte[16 * 16];

@@ -101,6 +101,7 @@ public void testSet1() {
* ac f7 70 7c 08 97 3d df db 27 cd 36 14 42 cc fb
* a3 55 c8 88 4c b4 72 f3 7d a6 36 d0 7d 56 78 7e
*/
@Test
public void testSet2() {
byte[] inputOctetString = new byte[16 * 8];

@@ -138,6 +139,7 @@ public void testSet2() {
* c4 42 da 58 5f cb 80 e4 3b 47 94 6f 25 40 93 e3
* 73 29 d9 90 01 38 0d b7 83 71 db 3a cf 5c 79 7e
*/
@Test
public void testSet3() {
byte[] inputOctetString =
{(byte) 0x00, (byte) 0x01, (byte) 0x02, (byte) 0x03, (byte) 0x04, (byte) 0x05, (byte) 0x06,
@@ -193,6 +195,7 @@ public void testSet3() {
* 00 53 95 3b 84 c8 96 f4 eb 38 5c 3f 2e 75 1c 4a
* 59 0e d6 ff ad ca 6f f6 4f 47 eb eb 8d 78 0f fc
*/
@Test
public void testSet4() {
byte[] inputOctetString =
{(byte) 0x00, (byte) 0x01, (byte) 0x02, (byte) 0x03, (byte) 0x04, (byte) 0x05, (byte) 0x06,

0 comments on commit c69285a

Please sign in to comment.