at.spardat.xma.test.TransformTest Maven / Gradle / Ivy
The newest version!
/*******************************************************************************
* Copyright (c) 2003, 2007 s IT Solutions AT Spardat GmbH .
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* s IT Solutions AT Spardat GmbH - initial API and implementation
*******************************************************************************/
/*
* @(#) $Id: TransformTest.java 2089 2007-11-28 13:56:13Z s3460 $
*
*
*
*
*
*/
package at.spardat.xma.test;
import java.util.Random;
import at.spardat.xma.session.Transform;
import junit.framework.Assert;
import junit.framework.TestCase;
/**
* @author s2877
* @since version_number
*/
public class TransformTest extends TestCase {
Random random = new Random();
{ random.setSeed(System.currentTimeMillis()); }
/**
* @param arg0
*/
public TransformTest(String arg0) {
super(arg0);
}
public static void main(String[] args) {
junit.awtui.TestRunner.run(TransformTest.class);
}
public void testGetTransformations() {
}
public void testGenerateHash() {
}
public void testCheckHash() {
}
public void testCompress() {
}
public void testDecompress() {
}
public void testDecode() {
byte[] data = new byte[random.nextInt(100)];
random.nextBytes(data);
Transform trans = new Transform();
byte[] transferData = trans.generateHash(data);
String transforms = trans.getTransformations();
byte[] received = Transform.decode(transforms,transferData);
Assert.assertEquals(data.length,received.length);
for(int i=0;i