Issue #23507 context-propagation now uses junit5 instead of junit4
- tests are still mostly commented out, but the module compiles at least
diff --git a/nucleus/core/context-propagation/pom.xml b/nucleus/core/context-propagation/pom.xml
index ba1e2f9..009d091 100644
--- a/nucleus/core/context-propagation/pom.xml
+++ b/nucleus/core/context-propagation/pom.xml
@@ -52,12 +52,7 @@
<groupId>org.glassfish.hk2</groupId>
<artifactId>hk2</artifactId>
</dependency>
- <dependency>
- <groupId>org.glassfish.main.core</groupId>
- <artifactId>kernel</artifactId>
- <version>${project.version}</version>
- <scope>test</scope>
- </dependency>
+
<dependency>
<groupId>org.glassfish.main.tests</groupId>
<artifactId>utils</artifactId>
@@ -65,9 +60,23 @@
<scope>test</scope>
</dependency>
<dependency>
+ <groupId>org.junit.jupiter</groupId>
+ <artifactId>junit-jupiter-engine</artifactId>
+ </dependency>
+ <dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.jmockit</groupId>
+ <artifactId>jmockit</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.glassfish.main.core</groupId>
+ <artifactId>kernel</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<build>
diff --git a/nucleus/core/context-propagation/src/test/java/org/glassfish/contextpropagation/ContextViewTest.java b/nucleus/core/context-propagation/src/test/java/org/glassfish/contextpropagation/ContextViewTest.java
index 7c94ba5..c508dd8 100644
--- a/nucleus/core/context-propagation/src/test/java/org/glassfish/contextpropagation/ContextViewTest.java
+++ b/nucleus/core/context-propagation/src/test/java/org/glassfish/contextpropagation/ContextViewTest.java
@@ -1,5 +1,6 @@
/*
* Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2021 Contributors to the Eclipse Foundation
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -16,19 +17,7 @@
package org.glassfish.contextpropagation;
-import static org.junit.Assert.assertEquals;
-import java.util.EnumSet;
-
-//import org.glassfish.contextpropagation.adaptors.BootstrapUtils;
-import org.glassfish.contextpropagation.spi.ContextMapHelper;
-import org.glassfish.contextpropagation.wireadapters.glassfish.DefaultWireAdapter;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.Ignore;
-import org.junit.Test;
-
-@Ignore
public class ContextViewTest {
diff --git a/nucleus/core/context-propagation/src/test/java/org/glassfish/contextpropagation/LocationTest.java b/nucleus/core/context-propagation/src/test/java/org/glassfish/contextpropagation/LocationTest.java
index e7eecf6..377c783 100644
--- a/nucleus/core/context-propagation/src/test/java/org/glassfish/contextpropagation/LocationTest.java
+++ b/nucleus/core/context-propagation/src/test/java/org/glassfish/contextpropagation/LocationTest.java
@@ -1,5 +1,6 @@
/*
* Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2021 Contributors to the Eclipse Foundation
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -16,24 +17,6 @@
package org.glassfish.contextpropagation;
-import static org.junit.Assert.assertEquals;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-
-//import mockit.Deencapsulation;
-
-//import org.glassfish.contextpropagation.adaptors.BootstrapUtils;
-//import org.glassfish.contextpropagation.adaptors.MockLoggerAdapter;
-//import org.glassfish.contextpropagation.adaptors.TestableThread;
-import org.glassfish.contextpropagation.internal.ViewImpl;
-import org.glassfish.contextpropagation.spi.ContextMapHelper;
-import org.glassfish.contextpropagation.wireadapters.glassfish.DefaultWireAdapter;
-import org.junit.BeforeClass;
-import org.junit.Ignore;
-import org.junit.Test;
-
-@Ignore
public class LocationTest {
// @BeforeClass
diff --git a/nucleus/core/context-propagation/src/test/java/org/glassfish/contextpropagation/PropagationModeTest.java b/nucleus/core/context-propagation/src/test/java/org/glassfish/contextpropagation/PropagationModeTest.java
index fc2f510..0f4f3a8 100644
--- a/nucleus/core/context-propagation/src/test/java/org/glassfish/contextpropagation/PropagationModeTest.java
+++ b/nucleus/core/context-propagation/src/test/java/org/glassfish/contextpropagation/PropagationModeTest.java
@@ -1,5 +1,6 @@
/*
* Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2021 Contributors to the Eclipse Foundation
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -16,27 +17,27 @@
package org.glassfish.contextpropagation;
-import static org.junit.Assert.assertEquals;
-
import java.util.EnumSet;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
public class PropagationModeTest {
- @Test
- public void testFromOrdinal() {
- PropagationMode[] modes = PropagationMode.values();
- for (int i = 0; i < modes.length; i++) {
- assertEquals(modes[i], PropagationMode.fromOrdinal(modes[i].ordinal()));
+ @Test
+ public void testFromOrdinal() {
+ PropagationMode[] modes = PropagationMode.values();
+ for (PropagationMode mode : modes) {
+ assertEquals(mode, PropagationMode.fromOrdinal(mode.ordinal()));
+ }
}
- }
- @Test
- public void testDefaultSet() {
- assertEquals(EnumSet.of(PropagationMode.THREAD, PropagationMode.RMI,
- PropagationMode.SOAP, PropagationMode.JMS_QUEUE,
- PropagationMode.MIME_HEADER), PropagationMode.defaultSet());
- }
+
+ @Test
+ public void testDefaultSet() {
+ assertEquals(EnumSet.of(PropagationMode.THREAD, PropagationMode.RMI, PropagationMode.SOAP,
+ PropagationMode.JMS_QUEUE, PropagationMode.MIME_HEADER), PropagationMode.defaultSet());
+ }
}
diff --git a/nucleus/core/context-propagation/src/test/java/org/glassfish/contextpropagation/adaptors/BootstrapUtils.java b/nucleus/core/context-propagation/src/test/java/org/glassfish/contextpropagation/adaptors/BootstrapUtils.java
index 7cc0754..9eff64a 100644
--- a/nucleus/core/context-propagation/src/test/java/org/glassfish/contextpropagation/adaptors/BootstrapUtils.java
+++ b/nucleus/core/context-propagation/src/test/java/org/glassfish/contextpropagation/adaptors/BootstrapUtils.java
@@ -1,5 +1,6 @@
/*
* Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2021 Contributors to the Eclipse Foundation
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -16,69 +17,72 @@
package org.glassfish.contextpropagation.adaptors;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.fail;
-
import java.util.Arrays;
import java.util.EnumSet;
import java.util.HashSet;
-//import mockit.Deencapsulation;
-
import org.glassfish.contextpropagation.ContextMap;
import org.glassfish.contextpropagation.ContextViewFactory;
import org.glassfish.contextpropagation.InsufficientCredentialException;
import org.glassfish.contextpropagation.PropagationMode;
import org.glassfish.contextpropagation.View;
import org.glassfish.contextpropagation.ViewCapable;
-import org.glassfish.contextpropagation.bootstrap.ContextBootstrap;
import org.glassfish.contextpropagation.internal.Utils.ContextMapAdditionalAccessors;
import org.glassfish.contextpropagation.spi.ContextMapHelper;
-import org.glassfish.contextpropagation.wireadapters.WireAdapter;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
public class BootstrapUtils {
- private static class MyViewCapable implements ViewCapable {
- View view;
- public MyViewCapable(View aView) {
- view = aView;
- view.put(".value", "a value", PropagationMode.defaultSet());
+ private static class MyViewCapable implements ViewCapable {
+
+ View view;
+
+ public MyViewCapable(View aView) {
+ view = aView;
+ view.put(".value", "a value", PropagationMode.defaultSet());
+ }
+
+
+ public String getValue() {
+ return view.get(".value");
+ }
}
- public String getValue() {
- return view.get(".value");
+
+ public static void populateMap() throws InsufficientCredentialException {
+ ContextMap wcMap = ContextMapHelper.getScopeAwareContextMap();
+ wcMap.put("true", true, PropagationMode.defaultSet());
+ wcMap.put("string", "string", PropagationMode.defaultSet());
+ wcMap.put("one", 1L, PropagationMode.defaultSet());
+ ((ContextMapAdditionalAccessors) wcMap).putAscii("ascii", "ascii", PropagationMode.defaultSet());
+ ((ContextMapAdditionalAccessors) wcMap).putSerializable("serializable", new HashSet<>(Arrays.asList("foo")),
+ PropagationMode.defaultSet());
+ Byte byteValue = (byte) 'b';
+ wcMap.put("byte", byteValue, PropagationMode.defaultSet());
+
+ // View Capable Stuff
+ // 1 - Create the factory (assumes that you have already created a ViewCapable class
+ ContextViewFactory viewCapableFactory = new ContextViewFactory() {
+
+ @Override
+ public ViewCapable createInstance(View view) {
+ return new MyViewCapable(view);
+ }
+
+
+ @Override
+ public EnumSet<PropagationMode> getPropagationModes() {
+ return PropagationMode.defaultSet();
+ }
+ };
+ // 2 - Register the factory
+ ContextMapHelper.registerContextFactoryForPrefixNamed("view capable", viewCapableFactory);
+ // 3 - Create the ViewCapable instance
+ wcMap.createViewCapable("view capable");
+ assertEquals("a value", ((MyViewCapable) wcMap.get("view capable")).getValue());
+
+ wcMap.get("ascii");
}
- }
-
- public static void populateMap() throws InsufficientCredentialException {
- ContextMap wcMap = ContextMapHelper.getScopeAwareContextMap();
- wcMap.put("true", true, PropagationMode.defaultSet());
- wcMap.put("string", "string", PropagationMode.defaultSet());
- wcMap.put("one", 1L, PropagationMode.defaultSet());
- ((ContextMapAdditionalAccessors) wcMap).putAscii("ascii", "ascii", PropagationMode.defaultSet());
- ((ContextMapAdditionalAccessors) wcMap).putSerializable("serializable", new HashSet<String>(Arrays.asList("foo")), PropagationMode.defaultSet());
- wcMap.put("byte", (byte) 'b', PropagationMode.defaultSet());
-
- // View Capable Stuff
- // 1 - Create the factory (assumes that you have already created a ViewCapable class
- ContextViewFactory viewCapableFactory = new ContextViewFactory() {
- @Override
- public ViewCapable createInstance(View view) {
- return new MyViewCapable(view);
- }
- @Override
- public EnumSet<PropagationMode> getPropagationModes() {
- return PropagationMode.defaultSet();
- }
- };
- // 2 - Register the factory
- ContextMapHelper.registerContextFactoryForPrefixNamed(
- "view capable", viewCapableFactory);
- // 3 - Create the ViewCapable instance
- wcMap.createViewCapable("view capable");
- assertEquals("a value", ((MyViewCapable) wcMap.get("view capable")).getValue());
-
- wcMap.get("ascii");
- }
// public static void bootstrap(WireAdapter wireAdapter) {
// reset();
diff --git a/nucleus/core/context-propagation/src/test/java/org/glassfish/contextpropagation/adaptors/MockLoggerAdapter.java b/nucleus/core/context-propagation/src/test/java/org/glassfish/contextpropagation/adaptors/MockLoggerAdapter.java
index 68f15bb..bf87e81 100644
--- a/nucleus/core/context-propagation/src/test/java/org/glassfish/contextpropagation/adaptors/MockLoggerAdapter.java
+++ b/nucleus/core/context-propagation/src/test/java/org/glassfish/contextpropagation/adaptors/MockLoggerAdapter.java
@@ -1,5 +1,6 @@
/*
* Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2021 Contributors to the Eclipse Foundation
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -17,45 +18,55 @@
package org.glassfish.contextpropagation.adaptors;
import org.glassfish.contextpropagation.bootstrap.LoggerAdapter;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
public class MockLoggerAdapter implements LoggerAdapter {
- // TODO TIP: Change the Level constant to control what is logged, use null to reduce output to a minimum
- static final Level LOGGING_LEVEL = null; // Level.WARN;
- @Override
- public boolean isLoggable(Level level) {
- return _isLoggable(level);
- }
+ // TODO TIP: Change the Level constant to control what is logged, use null to reduce output to a minimum
+ static final Level LOGGING_LEVEL = null; // Level.WARN;
- @Override
- public void log(Level level, MessageID messageID, Object... args) {
- System.out.println(format(messageID.defaultMessage, args));
+ @Override
+ public boolean isLoggable(Level level) {
+ return _isLoggable(level);
+ }
- }
- private String format(String defaultMessage, Object... args) {
- String formatString = defaultMessage.replaceAll("%([0-9]*)", "%$1\\$s"); // $1 refers to the group %1 is equivalent to %1$s
- return String.format(formatString, args);
- }
+ @Override
+ public void log(Level level, MessageID messageID, Object... args) {
+ System.out.println(format(messageID.defaultMessage, args));
- @Override
- public void log(Level level, Throwable t, MessageID messageID, Object... args) {
- log(level, messageID, args);
- t.printStackTrace();
- }
+ }
- @Test
- public void testFormat() {
- debug(format("arg 1:%1, arg2: %2", "one", "two"));
- }
- private static boolean _isLoggable(Level level) {
- return LOGGING_LEVEL != null && level.ordinal() <= LOGGING_LEVEL.ordinal();
- }
+ private String format(String defaultMessage, Object... args) {
+ // $1 refers to the group %1 is equivalent to %1$s
+ String formatString = defaultMessage.replaceAll("%([0-9]*)", "%$1\\$s");
+ return String.format(formatString, args);
+ }
- public static void debug(String s) {
- if (_isLoggable(Level.DEBUG)) System.out.println(s);
- }
+
+ @Override
+ public void log(Level level, Throwable t, MessageID messageID, Object... args) {
+ log(level, messageID, args);
+ t.printStackTrace();
+ }
+
+
+ @Test
+ public void testFormat() {
+ debug(format("arg 1:%1, arg2: %2", "one", "two"));
+ }
+
+
+ private static boolean _isLoggable(Level level) {
+ return LOGGING_LEVEL != null && level.ordinal() <= LOGGING_LEVEL.ordinal();
+ }
+
+
+ public static void debug(String s) {
+ if (_isLoggable(Level.DEBUG)) {
+ System.out.println(s);
+ }
+ }
}
diff --git a/nucleus/core/context-propagation/src/test/java/org/glassfish/contextpropagation/adaptors/RecordingLoggerAdapter.java b/nucleus/core/context-propagation/src/test/java/org/glassfish/contextpropagation/adaptors/RecordingLoggerAdapter.java
index 454a0a9..6a43c16 100644
--- a/nucleus/core/context-propagation/src/test/java/org/glassfish/contextpropagation/adaptors/RecordingLoggerAdapter.java
+++ b/nucleus/core/context-propagation/src/test/java/org/glassfish/contextpropagation/adaptors/RecordingLoggerAdapter.java
@@ -1,5 +1,6 @@
/*
* Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2021 Contributors to the Eclipse Foundation
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -16,49 +17,51 @@
package org.glassfish.contextpropagation.adaptors;
-import static org.junit.Assert.assertArrayEquals;
-import static org.junit.Assert.assertEquals;
-
import org.glassfish.contextpropagation.bootstrap.LoggerAdapter;
+import static org.junit.jupiter.api.Assertions.assertArrayEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
public class RecordingLoggerAdapter implements LoggerAdapter {
- Level lastLevel;
- MessageID lastMessageID;
- Object[] lastArgs;
- Throwable lastThrowable;
- @Override
- public boolean isLoggable(Level level) {
- return true;
- }
+ Level lastLevel;
+ MessageID lastMessageID;
+ Object[] lastArgs;
+ Throwable lastThrowable;
- @Override
- public void log(Level level, MessageID messageID, Object... args) {
- lastLevel = level;
- lastMessageID = messageID;
- lastArgs = args;
- lastThrowable = null;
- }
+ @Override
+ public boolean isLoggable(Level level) {
+ return true;
+ }
- @Override
- public void log(Level level, Throwable t, MessageID messageID,
- Object... args) {
- lastLevel = level;
- lastMessageID = messageID;
- lastArgs = args;
- lastThrowable = t;
- }
- public void verify(Level level, Throwable t, MessageID messageID,
- Object... args) {
- assertEquals(lastLevel, level);
- assertEquals(lastThrowable, t);
- assertEquals(lastMessageID, messageID);
- assertArrayEquals(lastArgs, args);
- lastLevel = null;
- lastThrowable = null;
- lastMessageID = null;
- lastArgs = null;
- }
+ @Override
+ public void log(Level level, MessageID messageID, Object... args) {
+ lastLevel = level;
+ lastMessageID = messageID;
+ lastArgs = args;
+ lastThrowable = null;
+ }
+
+
+ @Override
+ public void log(Level level, Throwable t, MessageID messageID, Object... args) {
+ lastLevel = level;
+ lastMessageID = messageID;
+ lastArgs = args;
+ lastThrowable = t;
+ }
+
+
+ public void verify(Level level, Throwable t, MessageID messageID, Object... args) {
+ assertEquals(lastLevel, level);
+ assertEquals(lastThrowable, t);
+ assertEquals(lastMessageID, messageID);
+ assertArrayEquals(lastArgs, args);
+ lastLevel = null;
+ lastThrowable = null;
+ lastMessageID = null;
+ lastArgs = null;
+ }
}
diff --git a/nucleus/core/context-propagation/src/test/java/org/glassfish/contextpropagation/adaptors/TestableThread.java b/nucleus/core/context-propagation/src/test/java/org/glassfish/contextpropagation/adaptors/TestableThread.java
index 2cc60ce..947cab5 100644
--- a/nucleus/core/context-propagation/src/test/java/org/glassfish/contextpropagation/adaptors/TestableThread.java
+++ b/nucleus/core/context-propagation/src/test/java/org/glassfish/contextpropagation/adaptors/TestableThread.java
@@ -1,5 +1,6 @@
/*
* Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2021 Contributors to the Eclipse Foundation
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -16,43 +17,48 @@
package org.glassfish.contextpropagation.adaptors;
-import org.junit.ComparisonFailure;
-import org.junit.runner.notification.StoppedByUserException;
-
public abstract class TestableThread extends Thread {
- final Throwable[] throwableHolder = new Throwable[1];
- public TestableThread() { super(); }
+ final Throwable[] throwableHolder = new Throwable[1];
- @SuppressWarnings("serial")
- public synchronized void startJoinAndCheckForFailures() {
- start();
- try {
- join();
- } catch (InterruptedException e) {
- throwableHolder[0] = e;
+ public TestableThread() {
+ super();
}
- if (throwableHolder[0] != null) {
- if (throwableHolder[0] instanceof ComparisonFailure) {
- throw (ComparisonFailure) throwableHolder[0];
- } else {
- throw (StoppedByUserException) new StoppedByUserException() {
- @Override public String getMessage() {
- return throwableHolder[0].getMessage();
- }
- }.initCause(throwableHolder[0]);
- }
- }
- }
- @Override
- public void run() {
- try {
- runTest();
- } catch (Throwable t) {
- throwableHolder[0] = t;
- }
- }
- protected abstract void runTest() throws Exception;
+ @SuppressWarnings("serial")
+ public synchronized void startJoinAndCheckForFailures() {
+ start();
+ try {
+ join();
+ } catch (InterruptedException e) {
+ throwableHolder[0] = e;
+ }
+ if (throwableHolder[0] != null) {
+ if (throwableHolder[0] instanceof AssertionError) {
+ throw (AssertionError) throwableHolder[0];
+ } else {
+ throw (RuntimeException) new RuntimeException() {
+
+ @Override
+ public String getMessage() {
+ return throwableHolder[0].getMessage();
+ }
+ }.initCause(throwableHolder[0]);
+ }
+ }
+ }
+
+
+ @Override
+ public void run() {
+ try {
+ runTest();
+ } catch (Throwable t) {
+ throwableHolder[0] = t;
+ }
+ }
+
+
+ protected abstract void runTest() throws Exception;
}
diff --git a/nucleus/core/context-propagation/src/test/java/org/glassfish/contextpropagation/internal/AccessControlledMapFinderTest.java b/nucleus/core/context-propagation/src/test/java/org/glassfish/contextpropagation/internal/AccessControlledMapFinderTest.java
index 4279252..aa49325 100644
--- a/nucleus/core/context-propagation/src/test/java/org/glassfish/contextpropagation/internal/AccessControlledMapFinderTest.java
+++ b/nucleus/core/context-propagation/src/test/java/org/glassfish/contextpropagation/internal/AccessControlledMapFinderTest.java
@@ -1,5 +1,6 @@
/*
* Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2021 Contributors to the Eclipse Foundation
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -16,18 +17,6 @@
package org.glassfish.contextpropagation.internal;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-
-//import org.glassfish.contextpropagation.adaptors.BootstrapUtils;
-import org.glassfish.contextpropagation.internal.Utils.AccessControlledMapFinder;
-import org.glassfish.contextpropagation.wireadapters.glassfish.DefaultWireAdapter;
-import org.junit.Before;
-import org.junit.Ignore;
-import org.junit.Test;
-
-@Ignore
public class AccessControlledMapFinderTest {
// static AccessControlledMapFinder mapFinder = new AccessControlledMapFinder();
//
diff --git a/nucleus/core/context-propagation/src/test/java/org/glassfish/contextpropagation/internal/AccessControlledMapTest.java b/nucleus/core/context-propagation/src/test/java/org/glassfish/contextpropagation/internal/AccessControlledMapTest.java
index d7355b8..990e05b 100644
--- a/nucleus/core/context-propagation/src/test/java/org/glassfish/contextpropagation/internal/AccessControlledMapTest.java
+++ b/nucleus/core/context-propagation/src/test/java/org/glassfish/contextpropagation/internal/AccessControlledMapTest.java
@@ -1,5 +1,6 @@
/*
* Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2021 Contributors to the Eclipse Foundation
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -16,30 +17,6 @@
package org.glassfish.contextpropagation.internal;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-
-import java.util.EnumSet;
-import java.util.Iterator;
-
-import org.glassfish.contextpropagation.InsufficientCredentialException;
-import org.glassfish.contextpropagation.PropagationMode;
-//import org.glassfish.contextpropagation.adaptors.BootstrapUtils;
-//import org.glassfish.contextpropagation.adaptors.MockLoggerAdapter;
-//import org.glassfish.contextpropagation.adaptors.MockThreadLocalAccessor;
-import org.glassfish.contextpropagation.bootstrap.ContextAccessController;
-import org.glassfish.contextpropagation.bootstrap.ContextBootstrap;
-import org.glassfish.contextpropagation.internal.AccessControlledMap.ContextAccessLevel;
-import org.glassfish.contextpropagation.internal.Entry.ContextType;
-import org.glassfish.contextpropagation.wireadapters.glassfish.DefaultWireAdapter;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.Ignore;
-import org.junit.Test;
-
-@Ignore
public class AccessControlledMapTest {
// AccessControlledMap acm;
// SimpleMap sm;
diff --git a/nucleus/core/context-propagation/src/test/java/org/glassfish/contextpropagation/internal/ContextMapImplTest.java b/nucleus/core/context-propagation/src/test/java/org/glassfish/contextpropagation/internal/ContextMapImplTest.java
index 3958577..305a30e 100644
--- a/nucleus/core/context-propagation/src/test/java/org/glassfish/contextpropagation/internal/ContextMapImplTest.java
+++ b/nucleus/core/context-propagation/src/test/java/org/glassfish/contextpropagation/internal/ContextMapImplTest.java
@@ -1,5 +1,6 @@
/*
* Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2021 Contributors to the Eclipse Foundation
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -16,36 +17,6 @@
package org.glassfish.contextpropagation.internal;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-
-import java.util.EnumSet;
-import java.util.Iterator;
-
-//import mockit.Deencapsulation;
-
-import org.glassfish.contextpropagation.ContextMap;
-import org.glassfish.contextpropagation.ContextViewFactory;
-import org.glassfish.contextpropagation.InsufficientCredentialException;
-import org.glassfish.contextpropagation.Location;
-import org.glassfish.contextpropagation.PropagationMode;
-import org.glassfish.contextpropagation.View;
-import org.glassfish.contextpropagation.ViewCapable;
-//import org.glassfish.contextpropagation.adaptors.BootstrapUtils;
-//import org.glassfish.contextpropagation.adaptors.MockLoggerAdapter;
-import org.glassfish.contextpropagation.internal.Entry.ContextType;
-import org.glassfish.contextpropagation.internal.Utils.AccessControlledMapFinder;
-import org.glassfish.contextpropagation.spi.ContextMapHelper;
-import org.glassfish.contextpropagation.wireadapters.glassfish.DefaultWireAdapter;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.Ignore;
-import org.junit.Test;
-
-@Ignore
public class ContextMapImplTest {
// private static Entry DUMMY_ENTRY;
// private static EnumSet<PropagationMode> PROP_MODES = PropagationMode.defaultSet();
diff --git a/nucleus/core/context-propagation/src/test/java/org/glassfish/contextpropagation/internal/ContextMapPropagatorTest.java b/nucleus/core/context-propagation/src/test/java/org/glassfish/contextpropagation/internal/ContextMapPropagatorTest.java
index 6eed3c5..e625829 100644
--- a/nucleus/core/context-propagation/src/test/java/org/glassfish/contextpropagation/internal/ContextMapPropagatorTest.java
+++ b/nucleus/core/context-propagation/src/test/java/org/glassfish/contextpropagation/internal/ContextMapPropagatorTest.java
@@ -1,5 +1,6 @@
/*
* Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2021 Contributors to the Eclipse Foundation
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -16,17 +17,9 @@
package org.glassfish.contextpropagation.internal;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNotSame;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
+import org.junit.jupiter.api.extension.ExtendWith;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.util.EnumSet;
+import mockit.integration.junit5.JMockitExtension;
//import mockit.Deencapsulation;
/*import mockit.Expectations;
@@ -34,27 +27,12 @@
import mockit.NonStrictExpectations;
import mockit.integration.junit4.JMockit;*/
-import org.glassfish.contextpropagation.ContextMap;
-import org.glassfish.contextpropagation.InsufficientCredentialException;
-import org.glassfish.contextpropagation.Location;
-import org.glassfish.contextpropagation.PropagationMode;
-//import org.glassfish.contextpropagation.adaptors.BootstrapUtils;
-//import org.glassfish.contextpropagation.adaptors.TestableThread;
-import org.glassfish.contextpropagation.internal.Entry.ContextType;
-import org.glassfish.contextpropagation.spi.ContextMapPropagator;
-import org.glassfish.contextpropagation.wireadapters.WireAdapter;
-import org.glassfish.contextpropagation.wireadapters.glassfish.DefaultWireAdapter;
-import org.junit.Before;
-import org.junit.Ignore;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-/*
+
+/**
* Behavioral tests to check the ContextMapPropagator is properly driving the WireAdapter
- *
*/
-//@RunWith(JMockit.class)
-@Ignore
+@ExtendWith(JMockitExtension.class)
public class ContextMapPropagatorTest {
// ContextMapPropagator propagator;
// ContextMap cm;
diff --git a/nucleus/core/context-propagation/src/test/java/org/glassfish/contextpropagation/internal/EntryTest.java b/nucleus/core/context-propagation/src/test/java/org/glassfish/contextpropagation/internal/EntryTest.java
index e35cf0a..657739d 100644
--- a/nucleus/core/context-propagation/src/test/java/org/glassfish/contextpropagation/internal/EntryTest.java
+++ b/nucleus/core/context-propagation/src/test/java/org/glassfish/contextpropagation/internal/EntryTest.java
@@ -1,5 +1,6 @@
/*
* Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2021 Contributors to the Eclipse Foundation
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -16,84 +17,84 @@
package org.glassfish.contextpropagation.internal;
-import static org.junit.Assert.assertEquals;
-
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.EnumSet;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicLong;
-//import mockit.Deencapsulation;
-
import org.glassfish.contextpropagation.PropagationMode;
import org.glassfish.contextpropagation.internal.Entry.ContextType;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import static org.glassfish.contextpropagation.internal.Entry.ContextType.ASCII_STRING;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertThrows;
public class EntryTest {
- private static final boolean IS_ORIGIN = true;
- private static final boolean ALLOW_ALL_TO_READ = true;
+ private static final boolean IS_ORIGIN = true;
+ private static final boolean ALLOW_ALL_TO_READ = true;
- @Test
- public void validatel() {
- createContext("value", PropagationMode.defaultSet(), ContextType.ASCII_STRING, IS_ORIGIN, ALLOW_ALL_TO_READ).validate();
- }
-
- @Test(expected=IllegalStateException.class)
- public void validateNullValue() {
- createContext(null, PropagationMode.defaultSet(), ContextType.ASCII_STRING, IS_ORIGIN, ALLOW_ALL_TO_READ).validate();
- }
-
- @Test(expected=IllegalStateException.class)
- public void validateNullPropMode() {
- createContext("value", null, ContextType.ASCII_STRING, IS_ORIGIN, ALLOW_ALL_TO_READ).validate();
- }
-
- @Test(expected=IllegalStateException.class)
- public void validateNullContextType() {
- createContext("value", PropagationMode.defaultSet(), null, IS_ORIGIN, ALLOW_ALL_TO_READ).validate();
- }
-
- @Test(expected=IllegalStateException.class)
- public void validateNullISOriginator() {
- createContext("value", PropagationMode.defaultSet(), ContextType.ASCII_STRING, (Boolean) null, ALLOW_ALL_TO_READ).validate();
- }
-
- @Test(expected=IllegalStateException.class)
- public void validateNullAllowAllToRead() {
- createContext("value", PropagationMode.defaultSet(), ContextType.ASCII_STRING, IS_ORIGIN, null).validate();
- }
+ @Test
+ public void validateOk() {
+ createContext("value", PropagationMode.defaultSet(), ASCII_STRING, IS_ORIGIN, ALLOW_ALL_TO_READ).validate();
+ }
- private Entry createContext(String value,
- EnumSet<PropagationMode> propModes, ContextType type,
- Boolean isOrigin, Boolean allowAllToRead) {
- Entry entry = new Entry(value, propModes, type);
- return entry.init(isOrigin, allowAllToRead);
- }
+ @Test
+ public void validateNullValue() {
+ Entry context = createContext(null, PropagationMode.defaultSet(), ASCII_STRING, IS_ORIGIN, ALLOW_ALL_TO_READ);
+ assertThrows(IllegalStateException.class, () -> context.validate());
+ }
- @Test
- public void testToContextTypeFromNumberClass() {
- assertEquals(ContextType.ATOMICINTEGER, ContextType.fromNumberClass(AtomicInteger.class));
- assertEquals(ContextType.ATOMICLONG, ContextType.fromNumberClass(AtomicLong.class));
- assertEquals(ContextType.BIGDECIMAL, ContextType.fromNumberClass(BigDecimal.class));
- assertEquals(ContextType.BIGINTEGER, ContextType.fromNumberClass(BigInteger.class));
- assertEquals(ContextType.BYTE, ContextType.fromNumberClass(Byte.class));
- assertEquals(ContextType.DOUBLE, ContextType.fromNumberClass(Double.class));
- assertEquals(ContextType.FLOAT, ContextType.fromNumberClass(Float.class));
- assertEquals(ContextType.INT, ContextType.fromNumberClass(Integer.class));
- assertEquals(ContextType.LONG, ContextType.fromNumberClass(Long.class));
- assertEquals(ContextType.SHORT, ContextType.fromNumberClass(Short.class));
- }
-// @Test
-// public void testToContextTypeOrdinal() {
-// ContextType[] byOrdinal = Deencapsulation.getField(ContextType.class, "byOrdinal");
-// for (int i = 0; i < byOrdinal.length; i++) {
-// assertEquals(i, ContextType.fromOrdinal(i).ordinal());
-// }
-// assertEquals(ContextType.values().length, byOrdinal.length);
-// }
+ @Test
+ public void validateNullPropMode() {
+ Entry context = createContext("value", null, ASCII_STRING, IS_ORIGIN, ALLOW_ALL_TO_READ);
+ assertThrows(IllegalStateException.class, () -> context.validate());
+ }
+
+ @Test
+ public void validateNullContextType() {
+ Entry context = createContext("value", PropagationMode.defaultSet(), null, IS_ORIGIN, ALLOW_ALL_TO_READ);
+ assertThrows(IllegalStateException.class, () -> context.validate());
+ }
+
+
+ @Test
+ public void validateNullISOriginator() {
+ Entry context = createContext("value", PropagationMode.defaultSet(), ASCII_STRING, (Boolean) null,
+ ALLOW_ALL_TO_READ);
+ assertThrows(IllegalStateException.class, () -> context.validate());
+ }
+
+
+ @Test
+ public void validateNullAllowAllToRead() {
+ Entry context = createContext("value", PropagationMode.defaultSet(), ASCII_STRING, IS_ORIGIN, null);
+ assertThrows(IllegalStateException.class, () -> context.validate());
+ }
+
+
+ private Entry createContext(String value, EnumSet<PropagationMode> propModes, ContextType type, Boolean isOrigin,
+ Boolean allowAllToRead) {
+ Entry entry = new Entry(value, propModes, type);
+ return entry.init(isOrigin, allowAllToRead);
+ }
+
+
+ @Test
+ public void testToContextTypeFromNumberClass() {
+ assertEquals(ContextType.ATOMICINTEGER, ContextType.fromNumberClass(AtomicInteger.class));
+ assertEquals(ContextType.ATOMICLONG, ContextType.fromNumberClass(AtomicLong.class));
+ assertEquals(ContextType.BIGDECIMAL, ContextType.fromNumberClass(BigDecimal.class));
+ assertEquals(ContextType.BIGINTEGER, ContextType.fromNumberClass(BigInteger.class));
+ assertEquals(ContextType.BYTE, ContextType.fromNumberClass(Byte.class));
+ assertEquals(ContextType.DOUBLE, ContextType.fromNumberClass(Double.class));
+ assertEquals(ContextType.FLOAT, ContextType.fromNumberClass(Float.class));
+ assertEquals(ContextType.INT, ContextType.fromNumberClass(Integer.class));
+ assertEquals(ContextType.LONG, ContextType.fromNumberClass(Long.class));
+ assertEquals(ContextType.SHORT, ContextType.fromNumberClass(Short.class));
+ }
}
diff --git a/nucleus/core/context-propagation/src/test/java/org/glassfish/contextpropagation/internal/SimpleMapTest.java b/nucleus/core/context-propagation/src/test/java/org/glassfish/contextpropagation/internal/SimpleMapTest.java
index 472363e..457e7c6 100644
--- a/nucleus/core/context-propagation/src/test/java/org/glassfish/contextpropagation/internal/SimpleMapTest.java
+++ b/nucleus/core/context-propagation/src/test/java/org/glassfish/contextpropagation/internal/SimpleMapTest.java
@@ -1,5 +1,6 @@
/*
* Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2021 Contributors to the Eclipse Foundation
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -16,36 +17,6 @@
package org.glassfish.contextpropagation.internal;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-
-import java.util.EnumSet;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.NoSuchElementException;
-
-import org.glassfish.contextpropagation.ContextLifecycle;
-import org.glassfish.contextpropagation.PropagationMode;
-import org.glassfish.contextpropagation.ViewCapable;
-//import org.glassfish.contextpropagation.adaptors.BootstrapUtils;
-//import org.glassfish.contextpropagation.adaptors.MockContextAccessController;
-//import org.glassfish.contextpropagation.adaptors.MockThreadLocalAccessor;
-//import org.glassfish.contextpropagation.adaptors.RecordingLoggerAdapter;
-import org.glassfish.contextpropagation.bootstrap.ContextBootstrap;
-import org.glassfish.contextpropagation.bootstrap.LoggerAdapter.Level;
-import org.glassfish.contextpropagation.bootstrap.LoggerAdapter.MessageID;
-import org.glassfish.contextpropagation.internal.Entry.ContextType;
-import org.glassfish.contextpropagation.internal.SimpleMap.Filter;
-import org.glassfish.contextpropagation.wireadapters.glassfish.DefaultWireAdapter;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.Ignore;
-import org.junit.Test;
-
-@Ignore
public class SimpleMapTest {
// SimpleMap sm;
// static RecordingLoggerAdapter logger;
diff --git a/nucleus/core/context-propagation/src/test/java/org/glassfish/contextpropagation/internal/UtilsTest.java b/nucleus/core/context-propagation/src/test/java/org/glassfish/contextpropagation/internal/UtilsTest.java
index 61a5f70..bf1fa9f 100644
--- a/nucleus/core/context-propagation/src/test/java/org/glassfish/contextpropagation/internal/UtilsTest.java
+++ b/nucleus/core/context-propagation/src/test/java/org/glassfish/contextpropagation/internal/UtilsTest.java
@@ -1,5 +1,6 @@
/*
* Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2021 Contributors to the Eclipse Foundation
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -16,30 +17,10 @@
package org.glassfish.contextpropagation.internal;
-import static org.junit.Assert.assertNotNull;
-
-import java.util.Collections;
-import java.util.EnumSet;
-import java.util.HashMap;
-import java.util.Map;
-
//import mockit.Deencapsulation;
-import org.glassfish.contextpropagation.ContextViewFactory;
-import org.glassfish.contextpropagation.PropagationMode;
-import org.glassfish.contextpropagation.View;
-import org.glassfish.contextpropagation.ViewCapable;
-//import org.glassfish.contextpropagation.adaptors.BootstrapUtils;
-//import org.glassfish.contextpropagation.adaptors.RecordingLoggerAdapter;
-import org.glassfish.contextpropagation.bootstrap.ContextBootstrap;
-import org.glassfish.contextpropagation.bootstrap.LoggerAdapter.Level;
-import org.glassfish.contextpropagation.bootstrap.LoggerAdapter.MessageID;
-import org.glassfish.contextpropagation.wireadapters.glassfish.DefaultWireAdapter;
-import org.junit.BeforeClass;
-import org.junit.Ignore;
-import org.junit.Test;
-@Ignore
+
public class UtilsTest {
// @BeforeClass
// public static void setupClass() {
diff --git a/nucleus/core/context-propagation/src/test/java/org/glassfish/contextpropagation/internal/ViewImplTest.java b/nucleus/core/context-propagation/src/test/java/org/glassfish/contextpropagation/internal/ViewImplTest.java
index f820793..6a18cd8 100644
--- a/nucleus/core/context-propagation/src/test/java/org/glassfish/contextpropagation/internal/ViewImplTest.java
+++ b/nucleus/core/context-propagation/src/test/java/org/glassfish/contextpropagation/internal/ViewImplTest.java
@@ -1,5 +1,6 @@
/*
* Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2021 Contributors to the Eclipse Foundation
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -16,21 +17,10 @@
package org.glassfish.contextpropagation.internal;
-import static org.junit.Assert.assertEquals;
-
-import java.io.Serializable;
-
//import mockit.Deencapsulation;
-import org.glassfish.contextpropagation.PropagationMode;
-//import org.glassfish.contextpropagation.adaptors.BootstrapUtils;
-import org.glassfish.contextpropagation.internal.Entry.ContextType;
-import org.glassfish.contextpropagation.wireadapters.glassfish.DefaultWireAdapter;
-import org.junit.BeforeClass;
-import org.junit.Ignore;
-import org.junit.Test;
-@Ignore
+
public class ViewImplTest {
// static ViewImpl view;
// static SimpleMap sm;
diff --git a/nucleus/core/context-propagation/src/test/java/org/glassfish/contextpropagation/weblogic/workarea/PropagationTest.java b/nucleus/core/context-propagation/src/test/java/org/glassfish/contextpropagation/weblogic/workarea/PropagationTest.java
index ca79ec5..14d48dd 100644
--- a/nucleus/core/context-propagation/src/test/java/org/glassfish/contextpropagation/weblogic/workarea/PropagationTest.java
+++ b/nucleus/core/context-propagation/src/test/java/org/glassfish/contextpropagation/weblogic/workarea/PropagationTest.java
@@ -1,5 +1,6 @@
/*
* Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2021 Contributors to the Eclipse Foundation
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -16,34 +17,6 @@
package org.glassfish.contextpropagation.weblogic.workarea;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.ObjectInput;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutput;
-import java.io.ObjectOutputStream;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Set;
-
-import org.glassfish.contextpropagation.InsufficientCredentialException;
-//import org.glassfish.contextpropagation.adaptors.MockLoggerAdapter;
-//import org.glassfish.contextpropagation.adaptors.TestableThread;
-import org.glassfish.contextpropagation.internal.Utils;
-//import org.glassfish.contextpropagation.weblogic.workarea.spi.WorkContextMapInterceptor;
-//import org.glassfish.contextpropagation.weblogic.workarea.utils.WorkContextInputAdapter;
-//import org.glassfish.contextpropagation.weblogic.workarea.utils.WorkContextOutputAdapter;
-//import org.glassfish.contextpropagation.wireadapters.wls.MySerializable;
-import org.glassfish.contextpropagation.wireadapters.wls.WLSWireAdapterTest;
-import org.junit.BeforeClass;
-import org.junit.Ignore;
-import org.junit.Test;
-
-@Ignore
public class PropagationTest {
// public static WorkContextMap wcMap;
//
diff --git a/nucleus/core/context-propagation/src/test/java/org/glassfish/contextpropagation/wireadapters/CatalogTest.java b/nucleus/core/context-propagation/src/test/java/org/glassfish/contextpropagation/wireadapters/CatalogTest.java
index 8aad24e..3c2b6c3 100644
--- a/nucleus/core/context-propagation/src/test/java/org/glassfish/contextpropagation/wireadapters/CatalogTest.java
+++ b/nucleus/core/context-propagation/src/test/java/org/glassfish/contextpropagation/wireadapters/CatalogTest.java
@@ -1,5 +1,6 @@
/*
* Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2021 Contributors to the Eclipse Foundation
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -16,9 +17,9 @@
package org.glassfish.contextpropagation.wireadapters;
-import static org.junit.Assert.*;
+import org.junit.jupiter.api.Test;
-import org.junit.Test;
+import static org.junit.jupiter.api.Assertions.assertEquals;
public class CatalogTest {
@@ -38,7 +39,8 @@
assertEquals((byte) 0xFF, bytes[5]);
}
- @Test public void testSetMeta() {
+ @Test
+ public void testSetMeta() {
Catalog cat = new Catalog();
cat.setMeta(0xABCD1234);
assertEquals((short) 0xABCD, cat.start);
diff --git a/nucleus/core/context-propagation/src/test/java/org/glassfish/contextpropagation/wireadapters/PositionAwareObjectOutputStreamTest.java b/nucleus/core/context-propagation/src/test/java/org/glassfish/contextpropagation/wireadapters/PositionAwareObjectOutputStreamTest.java
index 1ecbdbf..8453208 100644
--- a/nucleus/core/context-propagation/src/test/java/org/glassfish/contextpropagation/wireadapters/PositionAwareObjectOutputStreamTest.java
+++ b/nucleus/core/context-propagation/src/test/java/org/glassfish/contextpropagation/wireadapters/PositionAwareObjectOutputStreamTest.java
@@ -1,5 +1,6 @@
/*
* Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2021 Contributors to the Eclipse Foundation
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -16,23 +17,10 @@
package org.glassfish.contextpropagation.wireadapters;
-import static org.junit.Assert.assertArrayEquals;
-
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.ObjectOutputStream;
-import java.util.LinkedList;
-import java.util.List;
-
//import mockit.Deencapsulation;
-//import org.glassfish.contextpropagation.adaptors.MockLoggerAdapter;
-import org.glassfish.contextpropagation.internal.Utils;
-import org.junit.Before;
-import org.junit.Ignore;
-import org.junit.Test;
-@Ignore
+
public class PositionAwareObjectOutputStreamTest {
//
// @Test
diff --git a/nucleus/core/context-propagation/src/test/java/org/glassfish/contextpropagation/wireadapters/glassfish/DefaultWireAdapterTest.java b/nucleus/core/context-propagation/src/test/java/org/glassfish/contextpropagation/wireadapters/glassfish/DefaultWireAdapterTest.java
index d1e5765..16a9192 100644
--- a/nucleus/core/context-propagation/src/test/java/org/glassfish/contextpropagation/wireadapters/glassfish/DefaultWireAdapterTest.java
+++ b/nucleus/core/context-propagation/src/test/java/org/glassfish/contextpropagation/wireadapters/glassfish/DefaultWireAdapterTest.java
@@ -1,5 +1,6 @@
/*
* Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2021 Contributors to the Eclipse Foundation
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -16,42 +17,10 @@
package org.glassfish.contextpropagation.wireadapters.glassfish;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.util.Map;
-
//import mockit.Deencapsulation;
-import org.glassfish.contextpropagation.ContextMap;
-import org.glassfish.contextpropagation.InsufficientCredentialException;
-import org.glassfish.contextpropagation.PropagationMode;
-import org.glassfish.contextpropagation.SerializableContextFactory;
-//import org.glassfish.contextpropagation.adaptors.BootstrapUtils;
-//import org.glassfish.contextpropagation.adaptors.MockLoggerAdapter;
-//import org.glassfish.contextpropagation.adaptors.TestableThread;
-import org.glassfish.contextpropagation.internal.Utils;
-import org.glassfish.contextpropagation.spi.ContextMapHelper;
-import org.glassfish.contextpropagation.spi.ContextMapPropagator;
-import org.glassfish.contextpropagation.weblogic.workarea.PropagationTest;
-import org.glassfish.contextpropagation.weblogic.workarea.PropertyReadOnlyException;
-import org.glassfish.contextpropagation.wireadapters.AbstractWireAdapter;
-import org.glassfish.contextpropagation.wireadapters.Catalog;
-import org.glassfish.contextpropagation.wireadapters.WireAdapter;
-import org.glassfish.contextpropagation.wireadapters.wls.MyWLSContext;
-import org.glassfish.contextpropagation.wireadapters.wls.WLSWireAdapter;
-import org.junit.Before;
-import org.junit.Ignore;
-import org.junit.Test;
-@Ignore
+
public class DefaultWireAdapterTest {
// ContextMap wcMap;
//
diff --git a/nucleus/core/context-propagation/src/test/java/org/glassfish/contextpropagation/wireadapters/glassfish/WirePropagationTest.java b/nucleus/core/context-propagation/src/test/java/org/glassfish/contextpropagation/wireadapters/glassfish/WirePropagationTest.java
index d173f5f..e2ab71d 100644
--- a/nucleus/core/context-propagation/src/test/java/org/glassfish/contextpropagation/wireadapters/glassfish/WirePropagationTest.java
+++ b/nucleus/core/context-propagation/src/test/java/org/glassfish/contextpropagation/wireadapters/glassfish/WirePropagationTest.java
@@ -1,5 +1,6 @@
/*
* Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2021 Contributors to the Eclipse Foundation
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -16,21 +17,6 @@
package org.glassfish.contextpropagation.wireadapters.glassfish;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-
-import org.glassfish.contextpropagation.InsufficientCredentialException;
-import org.glassfish.contextpropagation.PropagationMode;
-//import org.glassfish.contextpropagation.adaptors.BootstrapUtils;
-//import org.glassfish.contextpropagation.adaptors.MockLoggerAdapter;
-import org.glassfish.contextpropagation.internal.Utils;
-import org.glassfish.contextpropagation.spi.ContextMapHelper;
-import org.glassfish.contextpropagation.spi.ContextMapPropagator;
-import org.junit.BeforeClass;
-import org.junit.Ignore;
-import org.junit.Test;
-
-@Ignore
public class WirePropagationTest {
// @BeforeClass
diff --git a/nucleus/core/context-propagation/src/test/java/org/glassfish/contextpropagation/wireadapters/wls/WLSWireAdapterTest.java b/nucleus/core/context-propagation/src/test/java/org/glassfish/contextpropagation/wireadapters/wls/WLSWireAdapterTest.java
index 579e318..b4e972b 100644
--- a/nucleus/core/context-propagation/src/test/java/org/glassfish/contextpropagation/wireadapters/wls/WLSWireAdapterTest.java
+++ b/nucleus/core/context-propagation/src/test/java/org/glassfish/contextpropagation/wireadapters/wls/WLSWireAdapterTest.java
@@ -1,5 +1,6 @@
/*
* Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2021 Contributors to the Eclipse Foundation
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -16,48 +17,10 @@
package org.glassfish.contextpropagation.wireadapters.wls;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-
-import java.io.BufferedInputStream;
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.ObjectInput;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutput;
-import java.io.ObjectOutputStream;
-import java.io.Serializable;
-import java.util.EnumSet;
-
//import mockit.Deencapsulation;
-import org.glassfish.contextpropagation.ContextMap;
-import org.glassfish.contextpropagation.InsufficientCredentialException;
-import org.glassfish.contextpropagation.PropagationMode;
-import org.glassfish.contextpropagation.SerializableContextFactory;
-import org.glassfish.contextpropagation.SerializableContextFactory.WLSContext;
-//import org.glassfish.contextpropagation.adaptors.BootstrapUtils;
-//import org.glassfish.contextpropagation.adaptors.MockLoggerAdapter;
-import org.glassfish.contextpropagation.internal.AccessControlledMap;
-import org.glassfish.contextpropagation.internal.Entry;
-import org.glassfish.contextpropagation.internal.Utils;
-import org.glassfish.contextpropagation.internal.Utils.PrivilegedWireAdapterAccessor;
-import org.glassfish.contextpropagation.spi.ContextMapHelper;
-import org.glassfish.contextpropagation.spi.ContextMapPropagator;
-import org.glassfish.contextpropagation.weblogic.workarea.PropagationTest;
-import org.glassfish.contextpropagation.weblogic.workarea.PropertyReadOnlyException;
-import org.glassfish.contextpropagation.wireadapters.AbstractWireAdapter;
-import org.glassfish.contextpropagation.wireadapters.Catalog;
-import org.glassfish.contextpropagation.wireadapters.WireAdapter;
-import org.glassfish.contextpropagation.wireadapters.wls.WLSWireAdapter.ClassNames;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.Ignore;
-import org.junit.Test;
-@Ignore
+
public class WLSWireAdapterTest {
// WLSWireAdapter adapter = new WLSWireAdapter();
//