Comments (14)
I'm sorry but I don't understand the description of the problem...
from testng-eclipse.
I have in Run Configuration for TestNG test VM argument
-Dlogistika.root.dir=${workspace_loc:gdit}/logistika-lib/work
Test is started in gdit directory a it calls System.getProperty("logistika.root.dir") and correct full path was returned.
After today's TerstNG plugin upgrade, test fails on FileNotFoundException because path returned now is relative and prefixed with project name (gdit)
from testng-eclipse.
Based on your description, I don't see anything that might be caused by the TestNG plug-in: you pass a property with -D and retrieve it with System.getProperty().
You might want to check how Eclipse expands ${workspace_loc:gdit}.
from testng-eclipse.
Quick test made me even more confused
@test
public void test() {
System.out.println("From test " + System.getProperty("logistika.root.dir"));
}
public static void main(String[] args) {
System.out.println("From main " + System.getProperty("logistika.root.dir"));
}
Sysout:
From test ${workspace_loc:gdit}/logistika-lib/work
From main W:\devel\project\gdit\trunk/logistika-lib/work
But we have been using this for moths...
Can I get older version of plugin somewhere?
from testng-eclipse.
Yes, as indicated in the Download section of the doc:
(these are update sites)
from testng-eclipse.
So after downgrade to TestNG 5.14.6.20110207_1250 it works again
Sysout:
From test W:\devel\project\gdit\trunk/logistika-lib/work
from testng-eclipse.
Still not working in 5.14.10.20110304_1036 :(
from testng-eclipse.
Still not working in 6.0.0.20110318_0929 :(
Why is this ticket it closed?
I guess we were left behind...
from testng-eclipse.
I've reproduced this problem when upgrading from the TestNG eclipse plugin from 5.12 to 6.0.1. Downgrading TestNG fixes the problem. Is there anything I can do to help get to the root cause of this issue?
from testng-eclipse.
I still have no idea what "gdit" means in this context. If I run this from TestNG, I get:
Property:${workspace_loc:gdit}/logistika-lib/work
If I run it as a Java application (printing the value of the system property in main), I get an error dialog saying "Variable references non-existent resource ${workspace_loc:gdit}.
Please give me something I can reproduce.
from testng-eclipse.
On Apr 28, 2011, at 5:35 PM, cbeust wrote:
I still have no idea what "gdit" means in this context. If I run
this from TestNG, I get:Property:${workspace_loc:gdit}/logistika-lib/work
If I run it as a Java application (printing the value of the system
property in main), I get an error dialog saying "Variable references
non-existent resource ${workspace_loc:gdit}.Please give me something I can reproduce.
The "gdit" is not important. It's just the name of an Eclipse project
in the user's workspace, and the workspace_loc expands to the path to
that project. Without the ":gdit" it expands to the path to the
current project, whatever that is. It's a standard eclipse variable.
The point is that under TestNG 5.12, the variable is expanded
correctly, just as it does in other launchers (Run, Debug, Profile,
Emma, etc). But under TestNG 6.0 (and 5.14 according to the other
commenter) the variables are not populated. So, something has changed
in the launch starting TestNG 5.14. I did a diff of testng-eclipse
5.12.0.6 vs 5.14.1.4 (git commits
ecbbaef and
41bb506) but I couldn't see anything
obvious that could cause the regression.
Chris
from testng-eclipse.
I'm looking into the issue but off the top of my head, I don't remember changing anything that might have impacted that. For some reason, Eclipse is no longer expanding the ${workspace:projectName} variable and I have no idea how to make it do that.
from testng-eclipse.
I'm also facing the problem described in this issue.
I checked the code on master branch and found the problem has been introduced in commit 495317e of org.testng.eclipse.launch.TestNGLaunchConfigurationDelegate.
In TestNGLaunchConfigurationDelegate the org.testng.eclipse.ui.util.ConfigurationHelper.getJvmArgs(ILaunchConfiguration) is used to get VM arguments instead of org.eclipse.jdt.launching.AbstractJavaLaunchConfigurationDelegate.getVMArguments(ILaunchConfiguration). AbstractJavaLaunchConfigurationDelegate performs a variable substitution.
The problem could be fixed by making the testng plugin dependent on org.eclipse.core.variable and perform variable substitution in ConfigurationHelper as shown in the patch below.
diff --git plugin.xml plugin.xml
index 4e6dfbc..e2aa999 100644
--- plugin.xml
+++ plugin.xml
@@ -37,6 +37,7 @@
<import plugin="org.eclipse.search"/>
<import plugin="org.eclipse.ltk.core.refactoring"/>
<import plugin="org.eclipse.ltk.ui.refactoring"/>
+ <import plugin="org.eclipse.core.variables"/>
</requires>
<extension-point id="reporterListenerContributorSchema" name="%reporterListenerContributor.name" schema="schema/reporterListenerContributorSchema.exsd"/>
diff --git src/main/org/testng/eclipse/ui/util/ConfigurationHelper.java src/main/org/testng/eclipse/ui/util/ConfigurationHelper.java
index ddeb12c..c8ef2c1 100644
--- src/main/org/testng/eclipse/ui/util/ConfigurationHelper.java
+++ src/main/org/testng/eclipse/ui/util/ConfigurationHelper.java
@@ -2,6 +2,7 @@
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.variables.VariablesPlugin;
import org.eclipse.debug.core.ILaunch;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationType;
@@ -151,6 +152,7 @@
try {
result = configuration.getAttribute(IJavaLaunchConfigurationConstants.ATTR_VM_ARGUMENTS,
result);
+ result = VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(result);
} catch (CoreException e) {
e.printStackTrace();
}
from testng-eclipse.
This looks good, could please you issue a pull request?
Thanks a lot for taking the time to figure this out!
from testng-eclipse.
Related Issues (20)
- The troubleshooting guide is out-to-date HOT 1
- slf4j and classpath issue HOT 7
- Multiple sessions are not initializing using testng with selenium 4
- Winappriver, TestNG is not working. HOT 1
- For what is worth, the [_Download_]z(https://testng.org/doc/download.html) page refers to:
- Can I ignore these files when I push to github? HOT 1
- TestNG P2 Composite contents errors
- Unable to install Testng plugin via Ansible HOT 2
- Incorrect vmargs when using mixed java versions HOT 2
- Getting Error while installing testNG using IBM RAD9 HOT 1
- does not working me in my eclipse HOT 1
- xml files are not visible after testng is downloaded
- not getting TestNG in RunAs. HOT 2
- TestNG suggestion not working HOT 2
- java.nio.file.FileAlreadyExistsException: jquery-3.6.0.min.js HOT 2
- Why do I have to be online to execute tests (java.net.UnknownHostException: testng.org) HOT 7
- An error occurred while instantiating class Tryagain1.sumValidation: Unable to make public Tryagain1.sumValidation() accessible: module Tryagain does not "exports Tryagain1" to module org.testng HOT 7
- Can't run tests in Eclipse. The option doesn't appear in the contextual menu HOT 5
- Latest testng 7.8.0 is not working with eclipse testng 7.4.0.202106051955 HOT 9
- Can you release a new testng-clipse formal version to support testng 7.8.0 HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from testng-eclipse.