@@ -0,0 +1,2441 @@
+/*%0A *  Licensed to the Apache Software Foundation (ASF) under one or more%0A *  contributor license agreements.  See the NOTICE file distributed with%0A *  this work for additional information regarding copyright ownership.%0A *  The ASF licenses this file to You under the Apache License, Version 2.0%0A *  (the %22License%22); you may not use this file except in compliance with%0A *  the License.  You may obtain a copy of the License at%0A *%0A *     http://www.apache.org/licenses/LICENSE-2.0%0A *%0A *  Unless required by applicable law or agreed to in writing, software%0A *  distributed under the License is distributed on an %22AS IS%22 BASIS,%0A *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A *  See the License for the specific language governing permissions and%0A *  limitations under the License.%0A */%0A%0A/**%0A* @author Boris V. Kuznetsov%0A* @version $Revision$%0A*/%0A%0Apackage java.security;%0A%0Aimport org.apache.harmony.security.tests.support.MySignature1;%0A%0Aimport junit.framework.TestCase;%0A%0A/**%0A * Tests for %3Ccode%3ESignature%3C/code%3E constructor and methods%0A * %0A */%0Apublic class Signature_Impl1Test extends TestCase %7B%0A%0A%09/*%0A%09 * Class under test for int sign(byte%5B%5D, int, int)%0A%09 */%0A%09public void testSignbyteArrayintint() throws Exception %7B%0A%09%09MySignature1 s = new MySignature1(%22ABC%22);%0A%09%09byte%5B%5D b = new byte%5B8%5D;%0A%09%09try %7B%0A%09%09%09s.sign(b, 0, 5);%0A%09%09%09fail(%22No expected SignatureException 1%22);%0A%09%09%7D catch (SignatureException e) %7B%09%09%0A%09%09%7D%0A%09%09%0A        s.initVerify(new MyPublicKey());%0A%09%09%0A%09%09try %7B%0A%09%09%09s.sign(b, 0, 5);%0A%09%09%09fail(%22No expected SignatureException 1%22);%0A%09%09%7D catch (SignatureException e) %7B%09%09%0A%09%09%7D%0A%09%09%0A        s.initSign(new MyPrivateKey());%0A        s.sign(b, 0, 5);%0A        assertEquals(%22state%22, Signature.SIGN, s.getState());%0A        assertTrue(%22sign() failed%22, s.runEngineSign);%0A%09%7D%0A%0A%09/*%0A%09 * Class under test for String toString()%0A%09 */%0A%09public void testToString() %7B%0A        MySignature1 s = new MySignature1(%22ABC%22);%0A        assertEquals(%22toString() failed%22, %22SIGNATURE ABC state: UNINITIALIZED%22,%0A                s.toString());%0A    %7D%0A%0A    private class MyKey implements Key %7B%0A        public String getFormat() %7B%0A            return %22123%22;%0A        %7D%0A        public byte%5B%5D getEncoded() %7B%0A            return null;%0A        %7D%0A        public String getAlgorithm() %7B%0A            return %22aaa%22;%0A        %7D       %0A    %7D%0A    %0A    private class MyPublicKey extends MyKey implements PublicKey %7B%7D%0A%0A    private class MyPrivateKey extends MyKey implements PrivateKey %7B%7D%0A%0A%7D%0A

Fix JUnit style