migrate from MyFaces CODI to DeltaSpike == WELD-001303: No active contexts for scope type org.apache.deltaspike.core.api.scope.WindowScoped

2016-02-01 Thread Stephen More
I have a MyFaces CODI application that utilizes WindowScoped beans. ( Session per tab - so thankful for that. ) I have been able to create url links that navigate to jsf pages using a servlet. (

Re: migrate from MyFaces CODI to DeltaSpike == WELD-001303: No active contexts for scope type org.apache.deltaspike.core.api.scope.WindowScoped

2016-02-01 Thread Stephen More
> if the window-id doesn't exist already (= first/initial get-request), you > can generate and use any random value. > (in this case please also have a look at deltaspike.window-id.max_length - > see JsfBaseConfig) > > regards, > gerhard > > > > 2016-02-01 23:49 GM

Re: Adding DeltaSpike support to Jglue CDI-Unit

2016-07-05 Thread Stephen More
he previous hints and check the required dependencies (see > e.g. [2]) to enable the jsf-support for junit-tests. > > regards, > gerhard > > [1] https://github.com/os890/javase-cdi-ds-project-template > [2] > https://github.com/CDIatWork/IdeaFork/blob/master/ideafork_ee6/pom.xml

Re: Adding DeltaSpike support to Jglue CDI-Unit

2016-07-06 Thread Stephen More
; MyFaces, DeltaSpike and OpenWebBeans > > > > 2016-07-05 21:56 GMT+02:00 Stephen More <stephen.m...@gmail.com>: > > > I finally got to the bottom of the issue - but is it a bug or a feature ? > > > > My runtime beans file is: src/main/webapp/WEB-INF/beans.xml

Re: Adding DeltaSpike support to Jglue CDI-Unit

2016-07-05 Thread Stephen More
i stephen, > > please provide a link to an example which illustrates the issue. > > regards, > gerhard > > > > 2016-07-05 17:29 GMT+02:00 Stephen More <stephen.m...@gmail.com>: > > > Here is a non-working example: > > https://github.com/mores/maven-exampl

Example unit testing a servlet that uses injection

2017-02-27 Thread Stephen More
I have been using org.apache.deltaspike.testcontrol.api.junit.CdiTestRunner to test JSF backing beans and everything seems to be working well. At this point I am struggling how to test a plain old servlet that uses injection, are there any examples anywhere ? Here is what I currently have:

Re: Example unit testing a servlet that uses injection

2017-02-28 Thread Stephen More
> hi stephen, > > please file a jira-ticket for such an improvement. > > thx & regards, > gerhard > > > > 2017-02-28 13:38 GMT+01:00 Stephen More <stephen.m...@gmail.com>: > > > The current - non working test code can be found here: > > https:/

Re: Example unit testing a servlet that uses injection

2017-02-28 Thread Stephen More
https://issues.apache.org/jira/browse/DELTASPIKE-1236 has been created to track this. On Tue, Feb 28, 2017 at 9:24 AM, Stephen More <stephen.m...@gmail.com> wrote: > Sure, I will file a jira ticket, now that I have confirmation that this is > not supposed to work out of the box

Re: Example unit testing a servlet that uses injection

2017-02-28 Thread Stephen More
> regards, > gerhard > > > > 2017-02-28 15:34 GMT+01:00 Stephen More <stephen.m...@gmail.com>: > > > https://issues.apache.org/jira/browse/DELTASPIKE-1236 has been created > to > > track this. > > > > On Tue, Feb 28, 2017 at 9:24 AM, Stephen More &l

Re: Some CdiTestRunner tests not compatible with other tests

2017-03-19 Thread Stephen More
your choice as well as some scopes,... > (the rest is up to the cdi-container you are using.) > > regards, > gerhard > > > > 2017-03-16 21:14 GMT+01:00 Stephen More <stephen.m...@gmail.com>: > > > Here is some additional info: > > weld: 2.4.2.Final > &

Re: Example unit testing a servlet that uses injection

2017-03-20 Thread Stephen More
rhard > > [1] http://deltaspike.apache.org/documentation/core.html#BeanProvider > > > > 2017-02-28 18:26 GMT+01:00 Stephen More <stephen.m...@gmail.com>: > > > Where can I find an example of using BeanProvider to test a servlet using > > injection ? > > >

Re: Example unit testing a servlet that uses injection

2017-03-20 Thread Stephen More
This marks the completion of this thread. My Sample test now works for a Named bean AND servlet using Faces Messages. Needed to leverage classes from package org.apache.myfaces.test.mock Thanks for your help Gerhard. On Mon, Mar 20, 2017 at 8:28 PM, Stephen More <stephen.m...@gmail.com>

Re: Example unit testing a servlet that uses injection

2017-03-15 Thread Stephen More
ause of the use of mockito. We provide some > mocking support OOTB, would that help? > > http://deltaspike.apache.org/documentation/test-control. > html#MockFrameworks > > John > > On Tue, Feb 28, 2017 at 7:38 AM Stephen More <stephen.m...@gmail.com> > wrote: > > &

evaluation of Exclude onExpression

2017-03-16 Thread Stephen More
Here is the gist of what I was trying to do: @RunWith( CdiTestRunner.class ) Test { @Before init() { System.setProperty( "key", "value" ); } @Test testOne() { // testing @Exclude( onExpression = "key!=value" ) } } It seems this

Re: Some CdiTestRunner tests not compatible with other tests

2017-03-16 Thread Stephen More
(ContextBeanInstance.java:83) at org.jboss.weld.bean.proxy.ProxyMethodHandler.getInstance(ProxyMethodHandler.java:125) Should I file a bug report for this issue ? On Thu, Mar 16, 2017 at 3:20 PM, Stephen More <stephen.m...@gmail.com> wrote: > I am running into a strange problem > &g

Problems injecting a mocked interface

2018-04-12 Thread Stephen More
I made a fork of: https://github.com/os890/javase-cdi-ds-project-template/tree/mock-demo which can be found here: https://github.com/mores/javase-cdi-ds-project-template/tree/mockingInterface When I run this test I get: injectionTest(org.os890.cdi.test.SimpleMockTest):

Re: Problems injecting a mocked interface

2018-04-12 Thread Stephen More
It seems this was a simple fix: -BeanInterface applicationScopedBean = mock(BeanInterface.class); +BeanInterface applicationScopedBean = mock(ApplicationScopedBean.class); On Thu, Apr 12, 2018 at 12:06 PM, Stephen More <stephen.m...@gmail.com> wrote: > I ma

CdiTestRunner - how to test Mocked Dependent Beans

2018-04-12 Thread Stephen More
My real problem turns out to be an issue with Injecting Mock Dependent Beans I made a fork of: https://github.com/os890/javase-cdi-ds-project-template/tree/mock-demo which can be found here: https://github.com/mores/javase-cdi-ds-project-template/tree/mockingInterface

Re: CdiTestRunner - how to test Mocked Dependent Beans

2018-04-13 Thread Stephen More
; http://www.irian.at > > Your JavaEE powerhouse - > JavaEE Consulting, Development and > Courses in English and German > > Professional Support for Apache > MyFaces, DeltaSpike and OpenWebBeans > > > > 2018-04-12 22:27 GMT+02:00 Stephen More <stephen.m...@gmai

CdiTestRunner with multiple versions of @Alternative / beans.xml

2018-04-14 Thread Stephen More
I have a need to run some unit tests with @Alternative - mockedVersionA and other tests with @Alternative - mockedVersionB and other tests with @Alternative - mockedVersionC It looks like Arquillian can handle this utilizing ShrinkWrap and @Deployment addAsManifestResource(

Re: CdiTestRunner with multiple versions of @Alternative / beans.xml

2018-04-16 Thread Stephen More
/apache/deltaspike/test/testcontrol/uc020/DefaultTestService.java > > > > http://www.irian.at > > Your JavaEE powerhouse - > JavaEE Consulting, Development and > Courses in English and German > > Professional Support for Apache > MyFaces, DeltaSpike and OpenWebBeans > > 2

Re: CdiTestRunner with multiple versions of @Alternative / beans.xml

2018-04-15 Thread Stephen More
test- > control/impl/src/test/java/org/apache/deltaspike/test/testcontrol/uc016 > > > > http://www.irian.at > > Your JavaEE powerhouse - > JavaEE Consulting, Development and > Courses in English and German > > Professional Support for Apache > MyFaces, DeltaS

Re: CdiTestRunner with multiple versions of @Alternative / beans.xml

2018-04-16 Thread Stephen More
ted:<[result-a]> but was:<[default-result]> On Mon, Apr 16, 2018 at 8:22 AM, Stephen More <stephen.m...@gmail.com> wrote: > Usually I work on multiple tasks at a time, and I might not communicate as > well as I should. I will try to be a little more verbose. > > Before I

Re: CdiTestRunner with multiple versions of @Alternative / beans.xml

2018-04-16 Thread Stephen More
; > http://www.irian.at > > Your JavaEE powerhouse - > JavaEE Consulting, Development and > Courses in English and German > > Professional Support for Apache > MyFaces, DeltaSpike and OpenWebBeans > > 2018-04-15 21:02 GMT+02:00 Stephen More <stephen.m...@gmail

Re: CdiTestRunner with multiple versions of @Alternative / beans.xml

2018-04-15 Thread Stephen More
> http://www.irian.at > > Your JavaEE powerhouse - > JavaEE Consulting, Development and > Courses in English and German > > Professional Support for Apache > MyFaces, DeltaSpike and OpenWebBeans > > > > 2018-04-15 14:41 GMT+02:00 Stephen More <stephen.m..

Re: CdiTestRunner with multiple versions of @Alternative / beans.xml

2018-04-16 Thread Stephen More
t to have a reference > for similar questions. > > regards, > gerhard > > > > http://www.irian.at > > Your JavaEE powerhouse - > JavaEE Consulting, Development and > Courses in English and German > > Professional Support for Apache > MyFaces, DeltaSpike an

Re: Differently secured JSF pages

2019-08-21 Thread Stephen More
IMO this is not a deltaspike issue. For security take a look at https://www.pac4j.org/ Usually you have 1 page that logs in all users - Authentication Then you assign roles to that user - Authorization To secure your page utilize isUserInRole(*"ADMIN");*