-
Notifications
You must be signed in to change notification settings - Fork 800
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13312 from chamilaadhi/oom-test
OOM Test case
- Loading branch information
Showing
2 changed files
with
41 additions
and
0 deletions.
There are no files selected for viewing
40 changes: 40 additions & 0 deletions
40
...n/tests-backend/src/test/java/org/wso2/am/integration/tests/logging/OOMLogsCheckTest.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,40 @@ | ||
/* | ||
* Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. | ||
* | ||
* WSO2 LLC. licenses this file to you under the Apache License, | ||
* Version 2.0 (the "License"); you may not use this file except | ||
* in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
package org.wso2.am.integration.tests.logging; | ||
|
||
import static org.junit.Assert.assertFalse; | ||
|
||
import java.io.File; | ||
|
||
import org.testng.annotations.Test; | ||
import org.wso2.am.integration.tests.api.lifecycle.APIManagerLifecycleBaseTest; | ||
import org.wso2.carbon.utils.ServerConstants; | ||
|
||
public class OOMLogsCheckTest extends APIManagerLifecycleBaseTest { | ||
@Test(groups = { "wso2.am" }, description = "Test whether a heapdump is generated due to OOM issue") | ||
public void testAvailabilityOfHeapDumpTestcase() throws Exception { | ||
String heapdumpFile = System.getProperty(ServerConstants.CARBON_HOME) + File.separator + "repository" | ||
+ File.separator + "logs" + File.separator + "heap-dump.hprof"; | ||
|
||
File file = new File(heapdumpFile); | ||
assertFalse("A Heapdump file is present in " + heapdumpFile + ". This possibly indicates an issue during startup / OSGi resolution.", file.exists()); | ||
|
||
} | ||
|
||
} |
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