-
Notifications
You must be signed in to change notification settings - Fork 758
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 #15914 from riyafa/file
Migrate filepath to jballerina
- Loading branch information
Showing
13 changed files
with
299 additions
and
197 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
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
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
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
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
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
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
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
79 changes: 79 additions & 0 deletions
79
...b/filepath/src/test/java/org/ballerinalang/stdlib/filepath/JBallerinaTestInitializer.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,79 @@ | ||
/* | ||
* Copyright (c) 2019, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. | ||
* | ||
* WSO2 Inc. 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.ballerinalang.stdlib.filepath; | ||
|
||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
import org.testng.ITestContext; | ||
import org.testng.ITestListener; | ||
import org.testng.ITestResult; | ||
|
||
/** | ||
* A test suit listener for jballerina test cases initialization. | ||
* | ||
* @since 0.995.0 | ||
*/ | ||
public class JBallerinaTestInitializer implements ITestListener { | ||
|
||
private static Logger log = LoggerFactory.getLogger(JBallerinaTestInitializer.class); | ||
private static final String ENABLE_JBALLERINA_TESTS = "enableJBallerinaTests"; | ||
|
||
@Override | ||
public void onStart(ITestContext context) { | ||
String property = context.getCurrentXmlTest().getParameter(ENABLE_JBALLERINA_TESTS); | ||
if (property != null && Boolean.valueOf(property)) { | ||
log.info("JBallerina tests initialized..."); | ||
System.setProperty(ENABLE_JBALLERINA_TESTS, "true"); | ||
} | ||
} | ||
|
||
@Override | ||
public void onFinish(ITestContext context) { | ||
String property = context.getCurrentXmlTest().getParameter(ENABLE_JBALLERINA_TESTS); | ||
if (property != null && Boolean.valueOf(property)) { | ||
log.info("JBallerina tests disabled..."); | ||
System.clearProperty(ENABLE_JBALLERINA_TESTS); | ||
} | ||
} | ||
|
||
@Override | ||
public void onTestStart(ITestResult result) { | ||
//ignore | ||
} | ||
|
||
@Override | ||
public void onTestSuccess(ITestResult result) { | ||
//ignore | ||
} | ||
|
||
@Override | ||
public void onTestFailure(ITestResult result) { | ||
//ignore | ||
} | ||
|
||
@Override | ||
public void onTestSkipped(ITestResult result) { | ||
//ignore | ||
} | ||
|
||
@Override | ||
public void onTestFailedButWithinSuccessPercentage(ITestResult result) { | ||
//ignore | ||
} | ||
} |
Oops, something went wrong.