jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fschumac...@apache.org
Subject [jmeter] branch master updated: Add test for disabled constructor
Date Thu, 29 Oct 2020 19:24:52 GMT
This is an automated email from the ASF dual-hosted git repository.

fschumacher pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/jmeter.git


The following commit(s) were added to refs/heads/master by this push:
     new 4984d47  Add test for disabled constructor
4984d47 is described below

commit 4984d47f8f66a84876b1ec54a4775466122275c3
Author: Felix Schumacher <felix.schumacher@internetallee.de>
AuthorDate: Thu Oct 29 20:24:29 2020 +0100

    Add test for disabled constructor
---
 .../org/apache/jmeter/util/SecurityProviderLoaderTest.java  | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/src/core/src/test/java/org/apache/jmeter/util/SecurityProviderLoaderTest.java
b/src/core/src/test/java/org/apache/jmeter/util/SecurityProviderLoaderTest.java
index 83d31c6..a03a268 100644
--- a/src/core/src/test/java/org/apache/jmeter/util/SecurityProviderLoaderTest.java
+++ b/src/core/src/test/java/org/apache/jmeter/util/SecurityProviderLoaderTest.java
@@ -17,6 +17,8 @@
 
 package org.apache.jmeter.util;
 
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
 import java.security.Provider;
 import java.security.Security;
 import java.util.Arrays;
@@ -40,6 +42,17 @@ public class SecurityProviderLoaderTest {
     }
 
     @Test
+    public void utilityClassTest() throws Exception {
+        Constructor<SecurityProviderLoader> privateConstructor = SecurityProviderLoader.class.getDeclaredConstructor();
+        privateConstructor.setAccessible(true);
+        try {
+            privateConstructor.newInstance();
+        } catch (InvocationTargetException e) {
+            Assert.assertEquals(IllegalStateException.class, e.getCause().getClass());
+        }
+    }
+
+    @Test
     public void addSecurityProviderTest() {
         removeAllDummyProviders();
         Provider[] providers = Security.getProviders();


Mime
View raw message