Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id B0498200B55 for ; Sun, 31 Jul 2016 22:06:04 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id A2C5E160A81; Sun, 31 Jul 2016 20:06:04 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id C6E98160A61 for ; Sun, 31 Jul 2016 22:06:03 +0200 (CEST) Received: (qmail 39436 invoked by uid 500); 31 Jul 2016 20:06:03 -0000 Mailing-List: contact commits-help@pirk.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@pirk.incubator.apache.org Delivered-To: mailing list commits@pirk.incubator.apache.org Received: (qmail 39427 invoked by uid 99); 31 Jul 2016 20:06:03 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 31 Jul 2016 20:06:03 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 76B81180567 for ; Sun, 31 Jul 2016 20:06:02 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -4.646 X-Spam-Level: X-Spam-Status: No, score=-4.646 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-1.426] autolearn=disabled Received: from mx2-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id YX3B3VecqcNA for ; Sun, 31 Jul 2016 20:06:00 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx2-lw-us.apache.org (ASF Mail Server at mx2-lw-us.apache.org) with SMTP id E446F5F249 for ; Sun, 31 Jul 2016 20:05:59 +0000 (UTC) Received: (qmail 39394 invoked by uid 99); 31 Jul 2016 20:05:59 -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; Sun, 31 Jul 2016 20:05:59 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id D921DE1101; Sun, 31 Jul 2016 20:05:58 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: eawilliams@apache.org To: commits@pirk.incubator.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: incubator-pirk git commit: [PIRK-36]: Ensure Schema Properties and Registries are Reset at the Beginning of Relevant Tests -- closes apache/incubator-pirk#38 Date: Sun, 31 Jul 2016 20:05:58 +0000 (UTC) archived-at: Sun, 31 Jul 2016 20:06:04 -0000 Repository: incubator-pirk Updated Branches: refs/heads/master 0237de6dd -> 9d7b46d66 [PIRK-36]: Ensure Schema Properties and Registries are Reset at the Beginning of Relevant Tests -- closes apache/incubator-pirk#38 Project: http://git-wip-us.apache.org/repos/asf/incubator-pirk/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-pirk/commit/9d7b46d6 Tree: http://git-wip-us.apache.org/repos/asf/incubator-pirk/tree/9d7b46d6 Diff: http://git-wip-us.apache.org/repos/asf/incubator-pirk/diff/9d7b46d6 Branch: refs/heads/master Commit: 9d7b46d660fd8019e6787ffdb754ca949dc30fd1 Parents: 0237de6 Author: eawilliams Authored: Sun Jul 31 16:05:43 2016 -0400 Committer: eawilliams Committed: Sun Jul 31 16:05:43 2016 -0400 ---------------------------------------------------------------------- src/test/java/test/general/PaillierTest.java | 26 +++++++++++--------- .../java/test/general/PartitionUtilsTest.java | 5 ---- .../java/test/general/QueryParserUtilsTest.java | 24 ++++++++++++++---- .../wideskies/standalone/StandaloneTest.java | 25 +++++++++++++++++-- 4 files changed, 56 insertions(+), 24 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-pirk/blob/9d7b46d6/src/test/java/test/general/PaillierTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/test/general/PaillierTest.java b/src/test/java/test/general/PaillierTest.java index abb50fa..833798a 100644 --- a/src/test/java/test/general/PaillierTest.java +++ b/src/test/java/test/general/PaillierTest.java @@ -27,6 +27,7 @@ import java.util.Random; import org.apache.pirk.encryption.Paillier; import org.apache.pirk.utils.PIRException; import org.apache.pirk.utils.SystemConfiguration; +import org.junit.BeforeClass; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -39,22 +40,23 @@ public class PaillierTest { private static final Logger logger = LoggerFactory.getLogger(PaillierTest.class); - private BigInteger p = null; // large prime - private BigInteger q = null; // large prime - private BigInteger N = null; // N=pq, RSA modulus - private BigInteger NSquared = null; // N^2 - private BigInteger lambdaN = null; // lambda(N) = lcm(p-1,q-1) + private static BigInteger p = null; // large prime + private static BigInteger q = null; // large prime + private static BigInteger N = null; // N=pq, RSA modulus + private static BigInteger NSquared = null; // N^2 + private static BigInteger lambdaN = null; // lambda(N) = lcm(p-1,q-1) - private int bitLength = 0; // bit length of the modulus N - private int certainty = 64; // prob that new BigInteger values represents primes will exceed (1 - (1/2)^certainty) + private static int bitLength = 0; // bit length of the modulus N + private static int certainty = 64; // prob that new BigInteger values represents primes will exceed (1 - (1/2)^certainty) - private BigInteger r1 = null; // random number in (Z/NZ)* - private BigInteger r2 = null; // random number in (Z/NZ)* + private static BigInteger r1 = null; // random number in (Z/NZ)* + private static BigInteger r2 = null; // random number in (Z/NZ)* - private BigInteger m1 = null; // message to encrypt - private BigInteger m2 = null; // message to encrypt + private static BigInteger m1 = null; // message to encrypt + private static BigInteger m2 = null; // message to encrypt - public PaillierTest() + @BeforeClass + public static void setup() { p = BigInteger.valueOf(7); q = BigInteger.valueOf(17); http://git-wip-us.apache.org/repos/asf/incubator-pirk/blob/9d7b46d6/src/test/java/test/general/PartitionUtilsTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/test/general/PartitionUtilsTest.java b/src/test/java/test/general/PartitionUtilsTest.java index f226cb5..2c85406 100644 --- a/src/test/java/test/general/PartitionUtilsTest.java +++ b/src/test/java/test/general/PartitionUtilsTest.java @@ -39,11 +39,6 @@ public class PartitionUtilsTest { private static final Logger logger = LoggerFactory.getLogger(PartitionUtilsTest.class); - public PartitionUtilsTest() - { - PrimitiveTypePartitioner primitivePartitioner = new PrimitiveTypePartitioner(); - } - @Test public void testMask() { http://git-wip-us.apache.org/repos/asf/incubator-pirk/blob/9d7b46d6/src/test/java/test/general/QueryParserUtilsTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/test/general/QueryParserUtilsTest.java b/src/test/java/test/general/QueryParserUtilsTest.java index 9a086f8..669a347 100644 --- a/src/test/java/test/general/QueryParserUtilsTest.java +++ b/src/test/java/test/general/QueryParserUtilsTest.java @@ -33,6 +33,8 @@ import org.apache.pirk.utils.QueryParserUtils; import org.apache.pirk.utils.StringUtils; import org.apache.pirk.utils.SystemConfiguration; import org.json.simple.JSONObject; +import org.junit.AfterClass; +import org.junit.BeforeClass; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -44,16 +46,18 @@ public class QueryParserUtilsTest { private static final Logger logger = LoggerFactory.getLogger(QueryParserUtilsTest.class); - private MapWritable doc = null; // MapWritable with arrays in json string representation - private MapWritable docWAW = null; // MapWritable with arrays as WritableArrayWritable objects - private Map docMap = null; // arrays as ArrayList + private static MapWritable doc = null; // MapWritable with arrays in json string representation + private static MapWritable docWAW = null; // MapWritable with arrays as WritableArrayWritable objects + private static Map docMap = null; // arrays as ArrayList - private DataSchema dSchema = null; + private static DataSchema dSchema = null; - public QueryParserUtilsTest() throws Exception + @BeforeClass + public static void setup() throws Exception { ArrayList dataElementsJSON = Inputs.createJSONDataElements(); + // Reset the schema properties and registries DataSchemaRegistry.clearRegistry(); QuerySchemaRegistry.clearRegistry(); SystemConfiguration.setProperty("data.schemas", "none"); @@ -72,6 +76,16 @@ public class QueryParserUtilsTest docMap = StringUtils.jsonStringToMap(dataElementsJSON.get(0).toJSONString(), dSchema); } + @AfterClass + public static void teardown() + { + // Reset the schema properties and registries + DataSchemaRegistry.clearRegistry(); + QuerySchemaRegistry.clearRegistry(); + SystemConfiguration.setProperty("data.schemas", "none"); + SystemConfiguration.setProperty("query.schemas", "none"); + } + @Test public void testSingleQuery() { http://git-wip-us.apache.org/repos/asf/incubator-pirk/blob/9d7b46d6/src/test/java/test/wideskies/standalone/StandaloneTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/test/wideskies/standalone/StandaloneTest.java b/src/test/java/test/wideskies/standalone/StandaloneTest.java index 4b52981..b4fd255 100644 --- a/src/test/java/test/wideskies/standalone/StandaloneTest.java +++ b/src/test/java/test/wideskies/standalone/StandaloneTest.java @@ -20,11 +20,15 @@ package test.wideskies.standalone; import java.util.ArrayList; +import org.apache.pirk.schema.data.DataSchemaRegistry; +import org.apache.pirk.schema.query.QuerySchemaRegistry; import org.apache.pirk.schema.query.filter.StopListFilter; import org.apache.pirk.test.utils.BaseTests; import org.apache.pirk.test.utils.Inputs; import org.apache.pirk.utils.SystemConfiguration; import org.json.simple.JSONObject; +import org.junit.AfterClass; +import org.junit.BeforeClass; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -45,10 +49,17 @@ public class StandaloneTest private static final String STOPLIST_FILE = "testStopListFile"; - private String stopListFileProp = null; + private static String stopListFileProp = null; - public StandaloneTest() throws Exception + @BeforeClass + public static void setup() throws Exception { + // Reset the schema properties and registries + DataSchemaRegistry.clearRegistry(); + QuerySchemaRegistry.clearRegistry(); + SystemConfiguration.setProperty("data.schemas", "none"); + SystemConfiguration.setProperty("query.schemas", "none"); + // Create the stoplist file stopListFileProp = SystemConfiguration.getProperty("pir.stopListFile"); SystemConfiguration.setProperty("pir.stopListFile", STOPLIST_FILE); @@ -60,6 +71,16 @@ public class StandaloneTest Inputs.createSchemaFiles(StopListFilter.class.getName()); } + @AfterClass + public static void teardown() + { + // Reset the schema properties and registries + DataSchemaRegistry.clearRegistry(); + QuerySchemaRegistry.clearRegistry(); + SystemConfiguration.setProperty("data.schemas", "none"); + SystemConfiguration.setProperty("query.schemas", "none"); + } + @Test public void runTests() throws Exception {