forked from OpenLiberty/open-liberty
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue OpenLiberty#30638 test that requests server dump and captures i…
…ntrospector output
- Loading branch information
Showing
3 changed files
with
120 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
...data.internal_fat_errorpaths/fat/src/test/jakarta/data/errpaths/DataIntrospectorTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2025 IBM Corporation and others. | ||
* All rights reserved. This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License 2.0 | ||
* which accompanies this distribution, and is available at | ||
* http://www.eclipse.org/legal/epl-2.0/ | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Contributors: | ||
* IBM Corporation - initial API and implementation | ||
*******************************************************************************/ | ||
package test.jakarta.data.errpaths; | ||
|
||
import static org.junit.Assert.assertEquals; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
|
||
import componenttest.custom.junit.runner.FATRunner; | ||
import componenttest.topology.utils.FATServletClient; | ||
|
||
/** | ||
* Contains tests that make assertions on the Jakarta Data introspector output. | ||
* The introspector runs at the end of DataErrPathsTest before stopping the server | ||
* so that it contains the state of a running server, and guaranteeing that it is | ||
* available to these tests. | ||
*/ | ||
@RunWith(FATRunner.class) | ||
public class DataIntrospectorTest extends FATServletClient { | ||
/** | ||
* Jakarta Data introspector output is captured during DataErrPathsTest.tearDown | ||
*/ | ||
static final List<String> introspectorOutput = new ArrayList<>(); | ||
|
||
/** | ||
* Verify that introspector output was obtained. | ||
*/ | ||
@Test | ||
public void testIntrospectorOutputObtained() { | ||
assertEquals(false, introspectorOutput.isEmpty()); | ||
|
||
// To view output, from the test results page, follow the System.out link | ||
// and search for "testIntrospectorOutputObtained" | ||
for (String line : introspectorOutput) | ||
System.out.println(line); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters