Maven Unit tests with EOF

2020-01-22 Thread Aaron Rosenzweig via Webobjects-dev
Hi, I’m trying to run maven unit tests with the surefire plugin that make use of EOF but it’s not working out. I can run them in Eclipse with a direct launch as a bundless build and it works. I make a call in the static initializer of the test case to: ERXExtensions.initApp(ACUnitTestingApplic

Re: Maven Unit tests with EOF

2020-01-22 Thread Paul Hoadley via Webobjects-dev
Hi Aaron, On 23 Jan 2020, at 03:39, Aaron Rosenzweig via Webobjects-dev wrote: > I think because it is wanting to treat it as a bundle but it isn’t and so… > I’m not sure where to go from here. Any advice? I have no advice for your specific problem, but on the off chance you haven't heard of

Re: Maven Unit tests with EOF

2020-01-22 Thread Henrique Prange via Webobjects-dev
Hey Aaron, This error rings a bell. I don't recall all the details. It looks like the collectMainProps method is trying to find the Properties file of your project in the wrong place. When you build your project in Eclipse with WOLips, it generates a build folder containing your project's WOA

Re: Maven Unit tests with EOF

2020-01-22 Thread Aaron Rosenzweig via Webobjects-dev
Markus, moin moin! Yes it’s been a long time :-) Thanks for the tip - I located the thread you mentioned where Hugi recommended "JarResourceRequestHandler()” - I think he might be onto something with respect to Jars but that particular thing is for serving static resources not for NSBundle. I’d

Re: Maven Unit tests with EOF

2020-01-22 Thread Dennis Scheffer via Webobjects-dev
Hi everyone, > // That's the main bundle when running tests from Eclipse > Path mainBundlePath = Paths.get("build/your-project.woa"); > > if (Files.notExists(mainBundlePath)) { > // Maven doesn't create a build directory. The WOA bundle goes into the > target folder instead. > mainBundlePath

Re: Maven Unit tests with EOF

2020-01-23 Thread Aaron Rosenzweig via Webobjects-dev
Dennis that is a good point, At the moment I have not cleaned and the product is there but it’s not working but your point is still well taken. In Jenkins, in the cloud, it will do a clean and I really should be doing a clean every time so the product won’t be there to test with… there won’t be

Re: Maven Unit tests with EOF

2020-01-23 Thread Aaron Rosenzweig via Webobjects-dev
Hey everybody, I noticed that “NSBundle.java” is defined in ERFoundation and also JavaFoundation… It appears we aren’t using ERXPatcher to replace it and that might not even be an option… so you have to have ERFoundation loaded first for it to override. I do have it that way and Maven is doin

Re: Maven Unit tests with EOF

2020-01-23 Thread Dennis Scheffer via Webobjects-dev
> Cloning a “company” EO and testing unique constraints in SQL - is heavier > than testing an “isCamelCase()” function but lighter than selenium. Maybe we > have to do it in failsafe but it feels closer to regular unit tests that > should fire every time there is a checkin to the repo. In other

Re: Maven Unit tests with EOF

2020-01-23 Thread Aaron Rosenzweig via Webobjects-dev
Hi Dennis - I hadn’t thought of that - we could have a fast failsafe and then a slow one run at different times. Thanks! good idea. AARON ROSENZWEIG / Chat 'n Bike e: aa...@chatnbike.com t: (301) 956-2319 > On

Re: Maven Unit tests with EOF

2020-01-23 Thread Aaron Rosenzweig via Webobjects-dev
Riddle me this… how can you get a class not defined error from the class itself? java.lang.NoClassDefFoundError: Could not initialize class com.webobjects.foundation.NSBundle at com.webobjects.foundation.NSBundle.mainBundle(NSBundle.java:526) You are already in NSBundle.mainBundle() and

Re: Maven Unit tests with EOF

2020-01-23 Thread Aaron Rosenzweig via Webobjects-dev
I tried this call: NSBundle MYBUNDLE = NSBundle.mainBundle(); It fails immediately with: java.lang.NoClassDefFoundError: Could not initialize class com.webobjects.foundation.NSBundle I’m suspecting it has to do with the static initializer of NSBundle. AARON ROSENZWEIG / Chat 'n Bike

Re: Maven Unit tests with EOF

2020-01-23 Thread Jesse Tayler via Webobjects-dev
Isn’t that what you get with some java version mismatch ?? > On Jan 23, 2020, at 11:41 AM, Aaron Rosenzweig via Webobjects-dev > wrote: > > I tried this call: > > NSBundle MYBUNDLE = NSBundle.mainBundle(); > > It fails immediately with: > java.lang.NoClassDefFoundError: Could not initialize c

Re: Maven Unit tests with EOF

2020-01-23 Thread Aaron Rosenzweig via Webobjects-dev
Jesse you are correct. If you are compiling for one java version but running on another… you can get java.lang.NoClassDefFoundError - that’s because the object you used at compile time might not be available in that other runtime. While the error is the same, this feels different but your point

Re: Maven Unit tests with EOF

2020-01-23 Thread Chuck Hill via Webobjects-dev
That error is definitely a static initializer or block throwing. Nothing else is output? > On Jan 23, 2020, at 8:41 AM, Aaron Rosenzweig via Webobjects-dev > wrote: > > I tried this call: > > NSBundle MYBUNDLE = NSBundle.mainBundle(); > > It fails immediately with: > java.lang.NoClassDefFo

Re: Maven Unit tests with EOF

2020-01-23 Thread Aaron Rosenzweig via Webobjects-dev
Thanks Chuck, Maven likes to swallow things but I put the flags to not trim stack traces and to divert standard out but I haven’t gotten anything additional. I still might have missed a flag. I thought maybe I could add some logger statements into the WOnder version of NSBundle that replaces

Re: Maven Unit tests with EOF

2020-02-12 Thread Paul Hoadley via Webobjects-dev
Hi Aaron, I don't know whether you went on to solve your problem here, but I've just spent a few hours of my life that I'll never get back debugging something similar. I had just built a new framework from scratch, and WOUnit testing under maven-surefire-plugin failed, with WOUnit complaining t

Re: Maven Unit tests with EOF

2020-02-12 Thread Aaron Rosenzweig via Webobjects-dev
Thanks Paul, That’s an insightful reply! If I understand you right you are using the surefire plugin but setting the nature for Maven to find the files? That’s a neat way to do it. I think that nature was there for people who wanted to build with Maven inside of eclipse, but you can use it th

Re: Maven Unit tests with EOF

2020-02-12 Thread Paul Hoadley via Webobjects-dev
Hi Aaron, On 13 Feb 2020, at 14:14, Aaron Rosenzweig wrote: > If I understand you right you are using the surefire plugin but setting the > nature for Maven to find the files? That’s a neat way to do it. They're basically unrelated, they just happen to intersect here. When unit tests are run,