Return-Path: X-Original-To: apmail-directory-commits-archive@www.apache.org Delivered-To: apmail-directory-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D171118234 for ; Fri, 11 Dec 2015 06:58:22 +0000 (UTC) Received: (qmail 86667 invoked by uid 500); 11 Dec 2015 06:58:20 -0000 Delivered-To: apmail-directory-commits-archive@directory.apache.org Received: (qmail 86601 invoked by uid 500); 11 Dec 2015 06:58:20 -0000 Mailing-List: contact commits-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@directory.apache.org Delivered-To: mailing list commits@directory.apache.org Received: (qmail 86535 invoked by uid 99); 11 Dec 2015 06:58:20 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 11 Dec 2015 06:58:20 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id C8D8FE03C8; Fri, 11 Dec 2015 06:58:19 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: plusplusjiajia@apache.org To: commits@directory.apache.org Message-Id: <8d1abf121e864c28ae4567d3c472aed3@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: directory-kerby git commit: Add the GeneralName test. Date: Fri, 11 Dec 2015 06:58:19 +0000 (UTC) Repository: directory-kerby Updated Branches: refs/heads/master 4816806a2 -> 10c110c0e Add the GeneralName test. Project: http://git-wip-us.apache.org/repos/asf/directory-kerby/repo Commit: http://git-wip-us.apache.org/repos/asf/directory-kerby/commit/10c110c0 Tree: http://git-wip-us.apache.org/repos/asf/directory-kerby/tree/10c110c0 Diff: http://git-wip-us.apache.org/repos/asf/directory-kerby/diff/10c110c0 Branch: refs/heads/master Commit: 10c110c0eaa4aad6955be5a0b77f04484935095b Parents: 4816806 Author: plusplusjiajia Authored: Fri Dec 11 15:05:01 2015 +0800 Committer: plusplusjiajia Committed: Fri Dec 11 15:05:01 2015 +0800 ---------------------------------------------------------------------- .../org/apache/kerby/cms/TestGeneralName.java | 47 ++++++++++++++++++++ 1 file changed, 47 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/10c110c0/kerby-pkix/src/test/java/org/apache/kerby/cms/TestGeneralName.java ---------------------------------------------------------------------- diff --git a/kerby-pkix/src/test/java/org/apache/kerby/cms/TestGeneralName.java b/kerby-pkix/src/test/java/org/apache/kerby/cms/TestGeneralName.java new file mode 100644 index 0000000..46c996d --- /dev/null +++ b/kerby-pkix/src/test/java/org/apache/kerby/cms/TestGeneralName.java @@ -0,0 +1,47 @@ +/** + * 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.kerby.cms; + +import org.apache.kerby.asn1.Asn1; +import org.apache.kerby.asn1.util.HexUtil; +import org.apache.kerby.x509.type.GeneralName; +import org.junit.Assert; +import org.junit.Test; + +import java.io.IOException; + +public class TestGeneralName { + private static final byte[] ipv4 = HexUtil.hex2bytes("87040a090800"); + + @Test + public void testIpAddress() throws IOException { + try { + Asn1.dump(ipv4, true); + GeneralName generalName = new GeneralName(); + //TO BE FIXED + //10.9.8.0 +// generalName.decode(ipv4); + + } catch (Exception e) { + e.printStackTrace(); + Assert.fail(); + } + } +}