Search in sources :

Example 1 with API

use of org.apiguardian.api.API in project junit5 by junit-team.

the class ConsoleLauncher method execute.

@API(status = INTERNAL, since = "1.0")
public static ConsoleLauncherExecutionResult execute(PrintStream out, PrintStream err, String... args) {
    CommandLineOptionsParser parser = new JOptSimpleCommandLineOptionsParser();
    ConsoleLauncher consoleLauncher = new ConsoleLauncher(parser, out, err);
    return consoleLauncher.execute(args);
}
Also used : JOptSimpleCommandLineOptionsParser(org.junit.platform.console.options.JOptSimpleCommandLineOptionsParser) CommandLineOptionsParser(org.junit.platform.console.options.CommandLineOptionsParser) JOptSimpleCommandLineOptionsParser(org.junit.platform.console.options.JOptSimpleCommandLineOptionsParser) API(org.apiguardian.api.API)

Example 2 with API

use of org.apiguardian.api.API in project junit5 by junit-team.

the class TestIdentifier method from.

/**
 * Factory for creating a new {@link TestIdentifier} from a {@link TestDescriptor}.
 */
@API(status = INTERNAL, since = "1.0")
public static TestIdentifier from(TestDescriptor testDescriptor) {
    Preconditions.notNull(testDescriptor, "TestDescriptor must not be null");
    String uniqueId = testDescriptor.getUniqueId().toString();
    String displayName = testDescriptor.getDisplayName();
    TestSource source = testDescriptor.getSource().orElse(null);
    Set<TestTag> tags = testDescriptor.getTags();
    Type type = testDescriptor.getType();
    String parentId = testDescriptor.getParent().map(parentDescriptor -> parentDescriptor.getUniqueId().toString()).orElse(null);
    String legacyReportingName = testDescriptor.getLegacyReportingName();
    return new TestIdentifier(uniqueId, displayName, source, tags, type, parentId, legacyReportingName);
}
Also used : Preconditions(org.junit.platform.commons.util.Preconditions) ToStringBuilder(org.junit.platform.commons.util.ToStringBuilder) STABLE(org.apiguardian.api.API.Status.STABLE) TestSource(org.junit.platform.engine.TestSource) Set(java.util.Set) API(org.apiguardian.api.API) INTERNAL(org.apiguardian.api.API.Status.INTERNAL) Serializable(java.io.Serializable) Objects(java.util.Objects) Collections.unmodifiableSet(java.util.Collections.unmodifiableSet) Type(org.junit.platform.engine.TestDescriptor.Type) Optional(java.util.Optional) TestTag(org.junit.platform.engine.TestTag) TestDescriptor(org.junit.platform.engine.TestDescriptor) LinkedHashSet(java.util.LinkedHashSet) Type(org.junit.platform.engine.TestDescriptor.Type) TestSource(org.junit.platform.engine.TestSource) TestTag(org.junit.platform.engine.TestTag) API(org.apiguardian.api.API)

Example 3 with API

use of org.apiguardian.api.API in project jmeter by apache.

the class AbstractJMeterGuiComponent method wrapTitlePanel.

@API(status = EXPERIMENTAL, since = "5.2.0")
protected Container wrapTitlePanel(Container titlePanel) {
    VerticalPanel vp = new VerticalPanel();
    vp.add(titlePanel);
    return vp;
}
Also used : VerticalPanel(org.apache.jmeter.gui.util.VerticalPanel) API(org.apiguardian.api.API)

Example 4 with API

use of org.apiguardian.api.API in project jmeter by apache.

the class LogLevelCommand method getRootLevel.

@API(since = "5.3", status = API.Status.INTERNAL)
public static Level getRootLevel() {
    final LoggerContext loggerContext = LoggerContext.getContext(false);
    final LoggerConfig loggerConfig = loggerContext.getConfiguration().getRootLogger();
    return loggerConfig.getLevel();
}
Also used : LoggerContext(org.apache.logging.log4j.core.LoggerContext) LoggerConfig(org.apache.logging.log4j.core.config.LoggerConfig) API(org.apiguardian.api.API)

Example 5 with API

use of org.apiguardian.api.API in project jmeter by apache.

the class DynamicStyle method onLaFChange.

/**
 * Schedules an action to be executed after each Look and Feel change.
 * @param action action to execute
 * @return a handle that can be used to un-register the listener
 */
@API(since = "5.3", status = API.Status.EXPERIMENTAL)
public static Closeable onLaFChange(Runnable action) {
    // Explicit component update is required since the component already exists
    // and we can't want to wait for the next LaF change
    action.run();
    PropertyChangeListener listener = evt -> {
        if ("lookAndFeel".equals(evt.getPropertyName())) {
            // $NON-NLS-1$
            action.run();
        }
    };
    UIManager.addPropertyChangeListener(listener);
    return () -> UIManager.removePropertyChangeListener(listener);
}
Also used : JComponent(javax.swing.JComponent) UIManager(javax.swing.UIManager) Window(java.awt.Window) JPopupMenu(javax.swing.JPopupMenu) JMenu(javax.swing.JMenu) API(org.apiguardian.api.API) Component(java.awt.Component) ArrayList(java.util.ArrayList) Consumer(java.util.function.Consumer) List(java.util.List) PropertyChangeListener(java.beans.PropertyChangeListener) UnsupportedLookAndFeelException(javax.swing.UnsupportedLookAndFeelException) Closeable(java.io.Closeable) Map(java.util.Map) JTabbedPane(javax.swing.JTabbedPane) Container(java.awt.Container) Collections(java.util.Collections) WeakHashMap(java.util.WeakHashMap) PropertyChangeListener(java.beans.PropertyChangeListener) API(org.apiguardian.api.API)

Aggregations

API (org.apiguardian.api.API)13 ArrayList (java.util.ArrayList)4 Map (java.util.Map)4 Collections (java.util.Collections)3 Component (java.awt.Component)2 Window (java.awt.Window)2 PropertyChangeListener (java.beans.PropertyChangeListener)2 Collections.unmodifiableSet (java.util.Collections.unmodifiableSet)2 LinkedHashSet (java.util.LinkedHashSet)2 List (java.util.List)2 Optional (java.util.Optional)2 Set (java.util.Set)2 JComponent (javax.swing.JComponent)2 UIManager (javax.swing.UIManager)2 UnsupportedLookAndFeelException (javax.swing.UnsupportedLookAndFeelException)2 UndoManager (javax.swing.undo.UndoManager)2 FastClasspathScanner (io.github.lukehutch.fastclasspathscanner.FastClasspathScanner)1 ScanResult (io.github.lukehutch.fastclasspathscanner.scanner.ScanResult)1 Canvas (java.awt.Canvas)1 Color (java.awt.Color)1