A Cdi Portable Extension Example adding a custom @FactModel based on Drools #439

Closed
wants to merge 3 commits into
from

Conversation

Projects
None yet
7 participants
@marcobattaglia

This is a Quick-Start showing how to augment javaEE6 adding a simple Drools based extension to decouple business logic and presentation layer. It uses Arquillian Drone to test.

@LightGuard

View changes

cdi-portable-extension-drools/README.md
+JSF view is managed by a portable extension as a Fact registered in a ksession, so that the rule engine acts as
+the decoupled logic system behind the presentation layer.
+
+In this project developer could manage the ksession and its scope using a producer.

This comment has been minimized.

Show comment Hide comment
@LightGuard

LightGuard Feb 14, 2013

Owner

Missing something in this sentence. "a" developer perhaps

@LightGuard

LightGuard Feb 14, 2013

Owner

Missing something in this sentence. "a" developer perhaps

@LightGuard

View changes

cdi-portable-extension-drools/pom.xml
+ <artifactId>drools-compiler</artifactId>
+ <version>[5.3.0.Final]</version>
+ </dependency>
+

This comment has been minimized.

Show comment Hide comment
@LightGuard

LightGuard Feb 14, 2013

Owner

If we don't already have a BOM which includes Drools, we need one. Then these can go away.

@LightGuard

LightGuard Feb 14, 2013

Owner

If we don't already have a BOM which includes Drools, we need one. Then these can go away.

@LightGuard

View changes

cdi-portable-extension-drools/pom.xml
+ <groupId>org.apache.deltaspike.core</groupId>
+ <artifactId>deltaspike-core-api</artifactId>
+ <version>LATEST</version>
+ </dependency>

This comment has been minimized.

Show comment Hide comment
@LightGuard

LightGuard Feb 14, 2013

Owner

This should be using a version defined in a BOM

@LightGuard

LightGuard Feb 14, 2013

Owner

This should be using a version defined in a BOM

@LightGuard

View changes

cdi-portable-extension-drools/pom.xml
+ <artifactId>deltaspike-core-impl</artifactId>
+ <version>LATEST</version>
+ <scope>runtime</scope>
+ </dependency>

This comment has been minimized.

Show comment Hide comment
@LightGuard

LightGuard Feb 14, 2013

Owner

Same as above

@LightGuard

LightGuard Feb 14, 2013

Owner

Same as above

@LightGuard

View changes

cdi-portable-extension-drools/pom.xml
+ <groupId>org.jboss.weld</groupId>
+ <artifactId>weld-core-test-arquillian</artifactId>
+ <version>1.1.10.Final</version>
+ <scope>test</scope>

This comment has been minimized.

Show comment Hide comment
@LightGuard

LightGuard Feb 14, 2013

Owner

Is this needed if you're going to be deploying to the server?

@LightGuard

LightGuard Feb 14, 2013

Owner

Is this needed if you're going to be deploying to the server?

This comment has been minimized.

Show comment Hide comment
@marcobattaglia

marcobattaglia Feb 15, 2013

Without weld dependency test fails. Perhaps there is an error in test file. I'm checking. Thanx

@marcobattaglia

marcobattaglia Feb 15, 2013

Without weld dependency test fails. Perhaps there is an error in test file. I'm checking. Thanx

This comment has been minimized.

Show comment Hide comment
@LightGuard

LightGuard Feb 15, 2013

Owner

That's very odd. Looking at the test classes, if you're running with the arq-jbossas-managed or arq-jbossas-remote profiles things should be fine.

@LightGuard

LightGuard Feb 15, 2013

Owner

That's very odd. Looking at the test classes, if you're running with the arq-jbossas-managed or arq-jbossas-remote profiles things should be fine.

This comment has been minimized.

Show comment Hide comment
@marcobattaglia

marcobattaglia Feb 15, 2013

My test is annotated as
@test
@runasclient
I've added weld-core-test-arquillian as documented here ("you have to specify the dependency on container adapter") http://arquillian.org/guides/functional_testing_using_drone/#set_up_drone. I can try a workaround.

@marcobattaglia

marcobattaglia Feb 15, 2013

My test is annotated as
@test
@runasclient
I've added weld-core-test-arquillian as documented here ("you have to specify the dependency on container adapter") http://arquillian.org/guides/functional_testing_using_drone/#set_up_drone. I can try a workaround.

This comment has been minimized.

Show comment Hide comment
@LightGuard

LightGuard Feb 15, 2013

Owner

Are you wanting to test in AS / EAP or a stand-alone weld container (Weld
SE)?

On Fri, Feb 15, 2013 at 9:52 AM, marcobattaglia notifications@github.comwrote:

In cdi-portable-extension-drools/pom.xml:

  •               <groupId>org.mortbay.jetty</groupId>
    
  •               <artifactId>servlet-api-2.5</artifactId>
    
  •           </exclusion>
    
  •       </exclusions>
    
  •   </dependency>
    
  •   <dependency>
    
  •       <groupId>org.slf4j</groupId>
    
  •       <artifactId>slf4j-simple</artifactId>
    
  •       <version>1.6.4</version>
    
  •       <scope>test</scope>
    
  •   </dependency>
    
  •   <dependency>
    
  •       <groupId>org.jboss.weld</groupId>
    
  •       <artifactId>weld-core-test-arquillian</artifactId>
    
  •       <version>1.1.10.Final</version>
    
  •       <scope>test</scope>
    

My test is annotated as
@test https://github.com/Test
@runasclient
I've added weld-core-test-arquillian as documented here ("you have to
specify the dependency on container adapter")
http://arquillian.org/guides/functional_testing_using_drone/#set_up_drone.
I can try a workaround.


Reply to this email directly or view it on GitHubhttps://github.com/jboss-jdf/jboss-as-quickstart/pull/439/files#r3031472.

Jason Porter
http://en.gravatar.com/lightguardjp

@LightGuard

LightGuard Feb 15, 2013

Owner

Are you wanting to test in AS / EAP or a stand-alone weld container (Weld
SE)?

On Fri, Feb 15, 2013 at 9:52 AM, marcobattaglia notifications@github.comwrote:

In cdi-portable-extension-drools/pom.xml:

  •               <groupId>org.mortbay.jetty</groupId>
    
  •               <artifactId>servlet-api-2.5</artifactId>
    
  •           </exclusion>
    
  •       </exclusions>
    
  •   </dependency>
    
  •   <dependency>
    
  •       <groupId>org.slf4j</groupId>
    
  •       <artifactId>slf4j-simple</artifactId>
    
  •       <version>1.6.4</version>
    
  •       <scope>test</scope>
    
  •   </dependency>
    
  •   <dependency>
    
  •       <groupId>org.jboss.weld</groupId>
    
  •       <artifactId>weld-core-test-arquillian</artifactId>
    
  •       <version>1.1.10.Final</version>
    
  •       <scope>test</scope>
    

My test is annotated as
@test https://github.com/Test
@runasclient
I've added weld-core-test-arquillian as documented here ("you have to
specify the dependency on container adapter")
http://arquillian.org/guides/functional_testing_using_drone/#set_up_drone.
I can try a workaround.


Reply to this email directly or view it on GitHubhttps://github.com/jboss-jdf/jboss-as-quickstart/pull/439/files#r3031472.

Jason Porter
http://en.gravatar.com/lightguardjp

This comment has been minimized.

Show comment Hide comment
@marcobattaglia

marcobattaglia Feb 15, 2013

I'm testing in AS/EAP. The strange thing is that it runs with provided but not with runtime. It seems that this dependency simple activates the reference to the external jboss container, infact without it my jboss doesn't start (using arq-jbossas-managed) or my app isn't deployed (using arq-jbossas-remote). The question is: weld-core-test-arquillian is only an adapter that interacts with an external container or is it the whole container?
Thanx

@marcobattaglia

marcobattaglia Feb 15, 2013

I'm testing in AS/EAP. The strange thing is that it runs with provided but not with runtime. It seems that this dependency simple activates the reference to the external jboss container, infact without it my jboss doesn't start (using arq-jbossas-managed) or my app isn't deployed (using arq-jbossas-remote). The question is: weld-core-test-arquillian is only an adapter that interacts with an external container or is it the whole container?
Thanx

This comment has been minimized.

Show comment Hide comment
@LightGuard

LightGuard Feb 15, 2013

Owner

This seems very odd to me, but I'm not familiar with Drone

@LightGuard

LightGuard Feb 15, 2013

Owner

This seems very odd to me, but I'm not familiar with Drone

This comment has been minimized.

Show comment Hide comment
@aslakknutsen

aslakknutsen Feb 15, 2013

This dependency should not be there. This is the Weld Core Test Suite, not the container. If it's needed it's only because you've got 'something' else wrong and this artifacts transitive deps 'fix' it.

@aslakknutsen

aslakknutsen Feb 15, 2013

This dependency should not be there. This is the Weld Core Test Suite, not the container. If it's needed it's only because you've got 'something' else wrong and this artifacts transitive deps 'fix' it.

This comment has been minimized.

Show comment Hide comment
@marcobattaglia

marcobattaglia Feb 15, 2013

OK. I check to resolve these dependencies in a better way and I'll commit. Thanx

@marcobattaglia

marcobattaglia Feb 15, 2013

OK. I check to resolve these dependencies in a better way and I'll commit. Thanx

@LightGuard

View changes

cdi-portable-extension-drools/resources/arquillian.xml
+ <!-- Uncomment to have test archives exported to the file system for inspection -->
+ <engine>
+ <property name="deploymentExportPath">target/</property>
+ </engine>

This comment has been minimized.

Show comment Hide comment
@LightGuard

LightGuard Feb 14, 2013

Owner

This should be commented out by default

@LightGuard

LightGuard Feb 14, 2013

Owner

This should be commented out by default

@LightGuard

View changes

.../main/java/org/jboss/as/quickstarts/cdi/drools/extension/FactMethod.java
+
+ public FactMethod() {
+ // TODO Auto-generated constructor stub
+ }

This comment has been minimized.

Show comment Hide comment
@LightGuard

LightGuard Feb 14, 2013

Owner

The ctor could be removed

@LightGuard

LightGuard Feb 14, 2013

Owner

The ctor could be removed

@LightGuard

View changes

.../main/java/org/jboss/as/quickstarts/cdi/drools/extension/FactMethod.java
+ }
+
+ @AroundInvoke
+

This comment has been minimized.

Show comment Hide comment
@LightGuard

LightGuard Feb 14, 2013

Owner

Remove the space

@LightGuard

LightGuard Feb 14, 2013

Owner

Remove the space

@LightGuard

View changes

cdi-portable-extension-drools/resources/arquillian.xml
+ <!--<property name="jbossHome">/path/to/jboss/as</property> -->
+ <!--</configuration> -->
+ </container>
+</arquillian>

This comment has been minimized.

Show comment Hide comment
@LightGuard

LightGuard Feb 14, 2013

Owner

After going through all of the files, why is this one here? The one in src/test/resources should be the only one needed.

@LightGuard

LightGuard Feb 14, 2013

Owner

After going through all of the files, why is this one here? The one in src/test/resources should be the only one needed.

@aslakknutsen

View changes

...tarts/jboss_as_cdi_portable_extension_drools/CdiExtensionDroolsTest.java
+ }
+
+ @Drone
+ DefaultSelenium browser;

This comment has been minimized.

Show comment Hide comment
@aslakknutsen

aslakknutsen Feb 15, 2013

Any good reason to use DefaultSelenium instead of the newer WebDriver API?

@aslakknutsen

aslakknutsen Feb 15, 2013

Any good reason to use DefaultSelenium instead of the newer WebDriver API?

@aslakknutsen

View changes

cdi-portable-extension-drools/pom.xml
+ <artifactId>servlet-api-2.5</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>

This comment has been minimized.

Show comment Hide comment
@aslakknutsen

aslakknutsen Feb 15, 2013

Replace all arquillian-drone* and org.selenium* with the drone-webdriver-depchain.

org.jboss.arquillian.extension:arquillian-drone-webdriver-depchain

@aslakknutsen

aslakknutsen Feb 15, 2013

Replace all arquillian-drone* and org.selenium* with the drone-webdriver-depchain.

org.jboss.arquillian.extension:arquillian-drone-webdriver-depchain

@aslakknutsen

View changes

cdi-portable-extension-drools/README.md
+
+Results :
+
+Tests run: 1, Failures: 0, Errors: 0, Skipped: 0

This comment has been minimized.

Show comment Hide comment
@aslakknutsen

aslakknutsen Feb 15, 2013

Missing spacing to include full output in markdown 'source block'

@aslakknutsen

aslakknutsen Feb 15, 2013

Missing spacing to include full output in markdown 'source block'

@aslakknutsen

View changes

cdi-portable-extension-drools/README.md
+22:42:37.962 INFO - Got result: OK,true on session 2f1327a4691e40af9af285ee7bb0461e
+....
+22:42:38.254 INFO - Got result: OK on session 2f1327a4691e40af9af285ee7bb0461e
+Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 27.014 sec

This comment has been minimized.

Show comment Hide comment
@aslakknutsen

aslakknutsen Feb 15, 2013

Missing spacing to include full output in markdown 'source block'

@aslakknutsen

aslakknutsen Feb 15, 2013

Missing spacing to include full output in markdown 'source block'

@aslakknutsen

View changes

cdi-portable-extension-drools/pom.xml
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.arquillian</groupId>
+ <artifactId>arquillian-bom</artifactId>

This comment has been minimized.

Show comment Hide comment
@aslakknutsen

aslakknutsen Feb 15, 2013

Arquillian-bom should be included and managed by jboss-javaee-6.0-with-tools already, so this is not needed.

@aslakknutsen

aslakknutsen Feb 15, 2013

Arquillian-bom should be included and managed by jboss-javaee-6.0-with-tools already, so this is not needed.

+ </dependency>
+ <dependency>
+ <groupId>org.jboss.arquillian.extension</groupId>
+ <artifactId>arquillian-drone-bom</artifactId>

This comment has been minimized.

Show comment Hide comment
@aslakknutsen

aslakknutsen Feb 15, 2013

Arquillian-drone-bom should be included and managed by jboss-javaee-6.0-with-tools already, so this is not needed.

@aslakknutsen

aslakknutsen Feb 15, 2013

Arquillian-drone-bom should be included and managed by jboss-javaee-6.0-with-tools already, so this is not needed.

@aslakknutsen

View changes

...tarts/jboss_as_cdi_portable_extension_drools/CdiExtensionDroolsTest.java
+ "org.drools:knowledge-api",
+ "org.drools:drools-core",
+ "org.drools:drools-compiler",
+ "org.seleniumhq.selenium:selenium-java").resolveAsFiles()

This comment has been minimized.

Show comment Hide comment
@aslakknutsen

aslakknutsen Feb 15, 2013

seleniumhq should not be needed in the deployment, it's a client side lib

@aslakknutsen

aslakknutsen Feb 15, 2013

seleniumhq should not be needed in the deployment, it's a client side lib

@aslakknutsen

View changes

...tarts/jboss_as_cdi_portable_extension_drools/CdiExtensionDroolsTest.java
+
+
+ @Test
+ @RunAsClient

This comment has been minimized.

Show comment Hide comment
@aslakknutsen

aslakknutsen Feb 15, 2013

@runasclient not needed here since @Deployment.testable = false . RunAsClient is the only available run mode in this case so its inferred.

@aslakknutsen

aslakknutsen Feb 15, 2013

@runasclient not needed here since @Deployment.testable = false . RunAsClient is the only available run mode in this case so its inferred.

@aslakknutsen

View changes

.../main/java/org/jboss/as/quickstarts/cdi/drools/extension/FactMethod.java
+public class FactMethod {
+ @Inject @RuleSession RuleSessionManager rsession;
+
+ @AroundInvoke

This comment has been minimized.

Show comment Hide comment
@aslakknutsen

aslakknutsen Feb 16, 2013

formatting is a bit off here

@aslakknutsen

aslakknutsen Feb 16, 2013

formatting is a bit off here

@aslakknutsen

View changes

...ls/src/main/java/org/jboss/as/quickstarts/model/RuleSessionProducer.java
+public class RuleSessionProducer {
+
+ @Produces @RuleSession @ConversationScoped
+ RuleSessionManager getRuleSessionManager(){

This comment has been minimized.

Show comment Hide comment
@aslakknutsen

aslakknutsen Feb 16, 2013

formatting is a bit off here

@aslakknutsen

aslakknutsen Feb 16, 2013

formatting is a bit off here

@aslakknutsen

View changes

cdi-portable-extension-drools/src/main/resources/SimpleRule.drl
+ when
+ $lineItem:LineItem(discount == 0.0, value > 0 );
+ then
+ modify($lineItem){

This comment has been minimized.

Show comment Hide comment
@aslakknutsen

aslakknutsen Feb 16, 2013

formatting is a bit off here

@aslakknutsen

aslakknutsen Feb 16, 2013

formatting is a bit off here

@aslakknutsen

View changes

...g/jboss/as/quickstarts/cdi/drools/extension/LineItemInjectionTarget.java
+ }
+
+ @Override
+ public Set<InjectionPoint> getInjectionPoints() {

This comment has been minimized.

Show comment Hide comment
@aslakknutsen

aslakknutsen Feb 16, 2013

this class has a different indent level then the others

@aslakknutsen

aslakknutsen Feb 16, 2013

this class has a different indent level then the others

@sgilda

View changes

cdi-portable-extension-drools/README.md
+ProcessAnnotatedType and interceptor bindings from CDI, and AnnotatedTypeBuilder from DeltaSpike
+to demonstrate how you can augment JavaEE6 with custom extension. A model of a
+JSF view is managed by a portable extension as a Fact registered in a ksession, so that the rule engine acts as
+the decoupled logic system behind the presentation layer.

This comment has been minimized.

Show comment Hide comment
@sgilda

sgilda Mar 4, 2013

Contributor

Hi Marco, would you mind removing the carriage-returns from these and other lines in this file. We only use line feeds for paragraphs because the HTML can render strangely when you use them.

@sgilda

sgilda Mar 4, 2013

Contributor

Hi Marco, would you mind removing the carriage-returns from these and other lines in this file. We only use line feeds for paragraphs because the HTML can render strangely when you use them.

@sgilda

View changes

cdi-portable-extension-drools/src/test/resources/arquillian.xml
+ <!--<property name="jbossHome">/jbossHome/path</property>-->
+ <!--</configuration> -->
+ </container>
+</arquillian>

This comment has been minimized.

Show comment Hide comment
@sgilda

sgilda Mar 4, 2013

Contributor

Please see the ktchensink/src/test/resource/arquillian.xml file for the new container configuration section. It should look like this:

<!-- Example configuration for a remote JBoss Enterprise Application Platform 6 or AS 7 instance -->
<container qualifier="jboss" default="true">
    <!-- By default, arquillian will use the JBOSS_HOME environment variable.  Alternatively, the configuration below can be uncommented. -->
    <!--<configuration> -->
    <!--<property name="jbossHome">/path/to/jboss/as</property> -->
    <!--</configuration> -->
</container>
@sgilda

sgilda Mar 4, 2013

Contributor

Please see the ktchensink/src/test/resource/arquillian.xml file for the new container configuration section. It should look like this:

<!-- Example configuration for a remote JBoss Enterprise Application Platform 6 or AS 7 instance -->
<container qualifier="jboss" default="true">
    <!-- By default, arquillian will use the JBOSS_HOME environment variable.  Alternatively, the configuration below can be uncommented. -->
    <!--<configuration> -->
    <!--<property name="jbossHome">/path/to/jboss/as</property> -->
    <!--</configuration> -->
</container>
@sgilda

View changes

cdi-portable-extension-drools/pom.xml
+
+
+ <version.jboss.arquillian>1.2.0.Alpha1</version.jboss.arquillian>
+ <version.org.jboss.arquillian.drone>1.2.0.Alpha1</version.org.jboss.arquillian.drone>

This comment has been minimized.

Show comment Hide comment
@sgilda

sgilda Mar 4, 2013

Contributor

@rafabene :

  • Do we use Alpha1 versions?
  • Did you combine all the arquillian property names into just one property?
@sgilda

sgilda Mar 4, 2013

Contributor

@rafabene :

  • Do we use Alpha1 versions?
  • Did you combine all the arquillian property names into just one property?
@sgilda

View changes

cdi-portable-extension-drools/README.md
+
+For more information, see [Use JBoss Developer Studio or Eclipse to Run the Quickstarts](../README.md#useeclipse)
+
+Investigate the Console Output

This comment has been minimized.

Show comment Hide comment
@sgilda

sgilda Mar 4, 2013

Contributor

I would like to see this section ditrectly below the Run the Arquillian Tests section. When you run the command, you want to immediately understand the output. After that, you can talk about running tests from JDBS.

@sgilda

sgilda Mar 4, 2013

Contributor

I would like to see this section ditrectly below the Run the Arquillian Tests section. When you run the command, you want to immediately understand the output. After that, you can talk about running tests from JDBS.

@sgilda

View changes

cdi-portable-extension-drools/README.md
+The session uses a rule inside the classpath, but you can load rules from an url or
+from a repository (i.e. guvnor in BRMS).
+
+Test is built by Arquillian Drone using selenium in a trasparent way.

This comment has been minimized.

Show comment Hide comment
@sgilda

sgilda Mar 4, 2013

Contributor

s/selenium/Selenium
s/trasparent/transparent

@sgilda

sgilda Mar 4, 2013

Contributor

s/selenium/Selenium
s/trasparent/transparent

@sgilda

This comment has been minimized.

Show comment Hide comment
@sgilda

sgilda Mar 4, 2013

Contributor

I tested this and it works great! I made a few comments in the files. I had a few other general comments:

  • I don't see any comments in any of the classes or methods. Could you add comments where it's not clear? :-)
  • We can't assume that developers will be familiar with Drools, BRMS, or DeltaSpike. I would like the README file to go into a little more detail about this example and maybe a description of some of the files and classes and what they do.
    • For example:
      -You might want to point out the rule definition in src/main/resources/SimpleRule.drl and that it gives a 10% discount for items greater than 0.
    • Which files in the cdi/drools/extension are important and why?
Contributor

sgilda commented Mar 4, 2013

I tested this and it works great! I made a few comments in the files. I had a few other general comments:

  • I don't see any comments in any of the classes or methods. Could you add comments where it's not clear? :-)
  • We can't assume that developers will be familiar with Drools, BRMS, or DeltaSpike. I would like the README file to go into a little more detail about this example and maybe a description of some of the files and classes and what they do.
    • For example:
      -You might want to point out the rule definition in src/main/resources/SimpleRule.drl and that it gives a 10% discount for items greater than 0.
    • Which files in the cdi/drools/extension are important and why?
@marcobattaglia

This comment has been minimized.

Show comment Hide comment
@marcobattaglia

marcobattaglia Mar 4, 2013

Thank you very much for your suggestion!
I'm starting to work on.

Thank you very much for your suggestion!
I'm starting to work on.

@sgilda

This comment has been minimized.

Show comment Hide comment
@sgilda

sgilda Mar 13, 2013

Contributor

@marcobattaglia : Would you mind squashing the commits down to just 1 commit? :-)

Contributor

sgilda commented Mar 13, 2013

@marcobattaglia : Would you mind squashing the commits down to just 1 commit? :-)

@sgilda

View changes

cdi-portable-extension-drools/README.md
+
+This project demonstrates a simple CDI Portable Extension and some of the SPI classes used to complete that task. This particular extension explores InjectionTarget, ProcessAnnotatedType, interceptor bindings from CDI, and AnnotatedTypeBuilder from DeltaSpike to demonstrate how you can augment JavaEE6 with custom extension. The presentation layer and business layer are well decoupled and the business logic is augmented by Drools as rule engine. In Drools' philosophy the world is a whole of facts that interact each other by rules. Our little world, behind the JSF page, is made up of billable LineItems that are modified by economic rules (see resources/SimpleRule.drl), so that adding or removing a LineItem the rule engine triggers an action. To obtain this behaviour our managed beans are promoted to be facts using an amazing feature of CDI: portable extension (see DroolsExtension.java and LineItemInjectionTarget.java). The rules are defined inside a knowledge session, which scope is managed by a producer (in this case ksession lives inside a ConversationScope). You could also load rules from an url or from a repository (i.e. guvnor in BRMS), so that your repository acts as a single point of truth and it manages the logic of your application's world; from a business point of view you will be able to change economic rules without changing application code.
+
+Test is built by Arquillian Drone using selenium in a trasparent way.

This comment has been minimized.

Show comment Hide comment
@sgilda

sgilda Mar 13, 2013

Contributor

Should Selenium be capitalized?
typo: s/trasparent/transparent

@sgilda

sgilda Mar 13, 2013

Contributor

Should Selenium be capitalized?
typo: s/trasparent/transparent

@sgilda

View changes

cdi-portable-extension-drools/README.md
+What is it?
+-----------
+
+This project demonstrates a simple CDI Portable Extension and some of the SPI classes used to complete that task. This particular extension explores InjectionTarget, ProcessAnnotatedType, interceptor bindings from CDI, and AnnotatedTypeBuilder from DeltaSpike to demonstrate how you can augment JavaEE6 with custom extension. The presentation layer and business layer are well decoupled and the business logic is augmented by Drools as rule engine. In Drools' philosophy the world is a whole of facts that interact each other by rules. Our little world, behind the JSF page, is made up of billable LineItems that are modified by economic rules (see resources/SimpleRule.drl), so that adding or removing a LineItem the rule engine triggers an action. To obtain this behaviour our managed beans are promoted to be facts using an amazing feature of CDI: portable extension (see DroolsExtension.java and LineItemInjectionTarget.java). The rules are defined inside a knowledge session, which scope is managed by a producer (in this case ksession lives inside a ConversationScope). You could also load rules from an url or from a repository (i.e. guvnor in BRMS), so that your repository acts as a single point of truth and it manages the logic of your application's world; from a business point of view you will be able to change economic rules without changing application code.

This comment has been minimized.

Show comment Hide comment
@sgilda

sgilda Mar 13, 2013

Contributor

Now the paragraph is harder to read. Sorry about that. Maybe this could be broken down into a couple of paragraphs as follows?

This project demonstrates a simple CDI Portable Extension and some of the SPI classes used to complete that task. This particular extension explores InjectionTarget, ProcessAnnotatedType, interceptor bindings from CDI, and AnnotatedTypeBuilder from DeltaSpike to demonstrate how you can augment Java EE 6 with custom extensions.

The presentation layer and business layer are well decoupled and the business logic is augmented by the Drools as the rule engine. In Drools' philosophy, the world is a whole of facts that interact each other by rules.

Our little world, behind the JSF page, is made up of billable LineItems that are modified by economic rules defined in resources/SimpleRule.drl. When you add or remove a LineItem, the rule engine triggers an action. To obtain this behavior, our managed beans are promoted to be facts using an amazing feature of CDI: portable extension. The implementation can be found in DroolsExtension.java and LineItemInjectionTarget.java. The rules are defined inside a knowledge session whose scope is managed by a producer. In this case, ksession lives inside a ConversationScope.

You can also load rules from an URL or from a repository or guvnor in BRMS. Your repository then acts as a single point of truth and manages the logic of your application's world. From a business point of view, this means you can change economic rules without changing application code.

@sgilda

sgilda Mar 13, 2013

Contributor

Now the paragraph is harder to read. Sorry about that. Maybe this could be broken down into a couple of paragraphs as follows?

This project demonstrates a simple CDI Portable Extension and some of the SPI classes used to complete that task. This particular extension explores InjectionTarget, ProcessAnnotatedType, interceptor bindings from CDI, and AnnotatedTypeBuilder from DeltaSpike to demonstrate how you can augment Java EE 6 with custom extensions.

The presentation layer and business layer are well decoupled and the business logic is augmented by the Drools as the rule engine. In Drools' philosophy, the world is a whole of facts that interact each other by rules.

Our little world, behind the JSF page, is made up of billable LineItems that are modified by economic rules defined in resources/SimpleRule.drl. When you add or remove a LineItem, the rule engine triggers an action. To obtain this behavior, our managed beans are promoted to be facts using an amazing feature of CDI: portable extension. The implementation can be found in DroolsExtension.java and LineItemInjectionTarget.java. The rules are defined inside a knowledge session whose scope is managed by a producer. In this case, ksession lives inside a ConversationScope.

You can also load rules from an URL or from a repository or guvnor in BRMS. Your repository then acts as a single point of truth and manages the logic of your application's world. From a business point of view, this means you can change economic rules without changing application code.

This comment has been minimized.

Show comment Hide comment
@marcobattaglia

marcobattaglia Mar 13, 2013

ok I've committed. Sorry I don't understand when you ask to squashing the commit down to 1. I use git commit -a and then git push. Could you give me a tip about how to do ? Thanx

@marcobattaglia

marcobattaglia Mar 13, 2013

ok I've committed. Sorry I don't understand when you ask to squashing the commit down to 1. I use git commit -a and then git push. Could you give me a tip about how to do ? Thanx

@sgilda

This comment has been minimized.

Show comment Hide comment
@sgilda

sgilda Mar 13, 2013

Contributor

@marcobattaglia : This should help: http://stackoverflow.com/questions/5189560/how-can-i-squash-my-last-x-commits-together-using-git

My nick on IRC is sgilda. If you need help, ping me on freenode channel #jboss-jdf if you run into a problem or need help.

Contributor

sgilda commented Mar 13, 2013

@marcobattaglia : This should help: http://stackoverflow.com/questions/5189560/how-can-i-squash-my-last-x-commits-together-using-git

My nick on IRC is sgilda. If you need help, ping me on freenode channel #jboss-jdf if you run into a problem or need help.

@pmuir

View changes

.../java/org/jboss/as/quickstarts/cdi/drools/extension/DroolsExtension.java
+ .getLogger(DroolsExtension.class.getName());
+
+/*
+ * Managed bean lifecycle is managed by weld that raise

This comment has been minimized.

Show comment Hide comment
@pmuir

pmuir Mar 13, 2013

Contributor

s/weld/cdi/

@pmuir

pmuir Mar 13, 2013

Contributor

s/weld/cdi/

@pmuir

View changes

cdi-portable-extension-drools/README.md
+Level: Intermediate
+Technologies: CDI, DeltaSpike, Drools, Arquillian Drone
+Summary: Creating a basic CDI extension with a custom @FactModel annotation that interacts with Rule Engine
+Target Product: WFK

This comment has been minimized.

Show comment Hide comment
@pmuir

pmuir Mar 13, 2013

Contributor

The target product for this needs to be BRMS.

@pmuir

pmuir Mar 13, 2013

Contributor

The target product for this needs to be BRMS.

+ <maven.compiler.target>1.6</maven.compiler.target>
+ <maven.compiler.source>1.6</maven.compiler.source>
+
+ <version.jboss.drools>5.5.0.Final</version.jboss.drools>

This comment has been minimized.

Show comment Hide comment
@pmuir

pmuir Mar 13, 2013

Contributor

this needs moving to a BOM

@pmuir

pmuir Mar 13, 2013

Contributor

this needs moving to a BOM

This comment has been minimized.

Show comment Hide comment
@marcobattaglia

marcobattaglia Apr 4, 2013

Sorry I don't know how to create a BOM on a public maven repository.

@marcobattaglia

marcobattaglia Apr 4, 2013

Sorry I don't know how to create a BOM on a public maven repository.

This comment has been minimized.

Show comment Hide comment
@sgilda

sgilda Apr 4, 2013

Contributor

@marcobattaglia : let me know if the instructions below are not sufficient. :-)

@sgilda

sgilda Apr 4, 2013

Contributor

@marcobattaglia : let me know if the instructions below are not sufficient. :-)

This comment has been minimized.

Show comment Hide comment
@marcobattaglia

marcobattaglia Apr 5, 2013

Hi S Gilda
I've prepared a BOM: https://github.com/marcobattaglia/jboss-bom/tree/jboss-javaee-6.0-with-drools/jboss-javaee-6.0-with-drools-expert
In this POM we have three dependencies to drools expert. If you consider that it's ok I'll pull a request.
Thank you.

@marcobattaglia

marcobattaglia Apr 5, 2013

Hi S Gilda
I've prepared a BOM: https://github.com/marcobattaglia/jboss-bom/tree/jboss-javaee-6.0-with-drools/jboss-javaee-6.0-with-drools-expert
In this POM we have three dependencies to drools expert. If you consider that it's ok I'll pull a request.
Thank you.

This comment has been minimized.

Show comment Hide comment
@sgilda

sgilda Apr 8, 2013

Contributor

I am not a BOM exper, so I'll have to defer to @pmuir or @rafabene.

The only thing I question is why you named it -with-drools-expert rather than -with-drools. Does it need the -expert suffix?

Go ahead and issue the pull so someone can review it for you. :-)

@sgilda

sgilda Apr 8, 2013

Contributor

I am not a BOM exper, so I'll have to defer to @pmuir or @rafabene.

The only thing I question is why you named it -with-drools-expert rather than -with-drools. Does it need the -expert suffix?

Go ahead and issue the pull so someone can review it for you. :-)

This comment has been minimized.

Show comment Hide comment
@marcobattaglia

marcobattaglia Apr 8, 2013

-expert suffix because Drools project consists out of several projects. I have linked only the dependencies related to Drools Expert that is the core of rule engine. Request just pulled.

@marcobattaglia

marcobattaglia Apr 8, 2013

-expert suffix because Drools project consists out of several projects. I have linked only the dependencies related to Drools Expert that is the core of rule engine. Request just pulled.

+ <version.jboss.drools>5.5.0.Final</version.jboss.drools>
+
+ <version.jboss.arquillian>1.1.1.Final</version.jboss.arquillian>
+ <version.org.jboss.arquillian.drone>1.1.1.Final</version.org.jboss.arquillian.drone>

This comment has been minimized.

Show comment Hide comment
@pmuir

pmuir Mar 13, 2013

Contributor

This needs moving to a BOM.

@pmuir

pmuir Mar 13, 2013

Contributor

This needs moving to a BOM.

@pmuir

View changes

.../java/org/jboss/as/quickstarts/cdi/drools/extension/DroolsExtension.java
+ * - ProcessInjectionTarget raises when a managed bean is injected
+ * - ProcessAnnotatedType raises before the container builds its metamodel
+ */
+ void beforeBeanDiscovery(@Observes BeforeBeanDiscovery bbd, BeanManager bm) {

This comment has been minimized.

Show comment Hide comment
@pmuir

pmuir Mar 13, 2013

Contributor

This seems a bit redundant?

@pmuir

pmuir Mar 13, 2013

Contributor

This seems a bit redundant?

@pmuir

View changes

.../main/java/org/jboss/as/quickstarts/cdi/drools/extension/FactMethod.java
+
+@Interceptor
+@FactMethodBinding
+public class FactMethod {

This comment has been minimized.

Show comment Hide comment
@pmuir

pmuir Mar 13, 2013

Contributor

The whitespace here is unusual - you probably want to run the formatter over the whole thing

@pmuir

pmuir Mar 13, 2013

Contributor

The whitespace here is unusual - you probably want to run the formatter over the whole thing

This comment has been minimized.

Show comment Hide comment
@pmuir

pmuir Mar 13, 2013

Contributor

Also, we conventionally name an interceptor something like FactMethodInterceptor

@pmuir

pmuir Mar 13, 2013

Contributor

Also, we conventionally name an interceptor something like FactMethodInterceptor

@pmuir

View changes

...g/jboss/as/quickstarts/cdi/drools/extension/LineItemInjectionTarget.java
+ /*
+ * During injection this method adds the FactModel to ksession.
+ * In this way the managed bean become a fact and the rule engine
+ * can apply rules to it. *

This comment has been minimized.

Show comment Hide comment
@pmuir

pmuir Mar 13, 2013

Contributor

trailing *

@pmuir

pmuir Mar 13, 2013

Contributor

trailing *

@pmuir

View changes

...g/jboss/as/quickstarts/cdi/drools/extension/LineItemInjectionTarget.java
+ * @see javax.enterprise.inject.spi.InjectionTarget#inject(java.lang.Object, javax.enterprise.context.spi.CreationalContext)
+ */
+ @Override
+ public void inject(X instance, CreationalContext<X> ctx) {

This comment has been minimized.

Show comment Hide comment
@pmuir

pmuir Mar 13, 2013

Contributor

Shouldn't this be done in produce()?

@pmuir

pmuir Mar 13, 2013

Contributor

Shouldn't this be done in produce()?

@marcobattaglia

This comment has been minimized.

Show comment Hide comment
@marcobattaglia

marcobattaglia May 22, 2013

@sgilda I've committed after reformatting and cleaning up all project. This project is related to jboss-javaee-6.0-with-drools project under http://github.com:jboss-jdf/jboss-bom. It's important that both projects will be available together. In the pom.xml file (the parent) of all jboss-javaee-6.0-with-XXX projects I have added version.org.jboss.drools property and everything needed to include the drool's bom (as suggested by Rafael). Please check about versions of BOM projects. The general version.jboss.bom used in my quickstart project is the 1.0.4.Final, but the version of jboss-javaee-6.0-with-drools is 1.0.7-SNAPSHOT. I think that something has to be added in maven repo.
I'm available for any questions. bye

@sgilda I've committed after reformatting and cleaning up all project. This project is related to jboss-javaee-6.0-with-drools project under http://github.com:jboss-jdf/jboss-bom. It's important that both projects will be available together. In the pom.xml file (the parent) of all jboss-javaee-6.0-with-XXX projects I have added version.org.jboss.drools property and everything needed to include the drool's bom (as suggested by Rafael). Please check about versions of BOM projects. The general version.jboss.bom used in my quickstart project is the 1.0.4.Final, but the version of jboss-javaee-6.0-with-drools is 1.0.7-SNAPSHOT. I think that something has to be added in maven repo.
I'm available for any questions. bye

@sgilda

This comment has been minimized.

Show comment Hide comment
@sgilda

sgilda May 22, 2013

Contributor

@marcobattaglia : Thanks for the update. I think I'll wait for @rafabene to comment on the BOM updates when he gets back from vacation.

Contributor

sgilda commented May 22, 2013

@marcobattaglia : Thanks for the update. I think I'll wait for @rafabene to comment on the BOM updates when he gets back from vacation.

@rafabene

This comment has been minimized.

Show comment Hide comment
@rafabene

rafabene May 31, 2013

Contributor

Just FIY the -with-drools BOM was merged to our repo!

Contributor

rafabene commented May 31, 2013

Just FIY the -with-drools BOM was merged to our repo!

@marcobattaglia

This comment has been minimized.

Show comment Hide comment
@marcobattaglia

marcobattaglia May 31, 2013

@rafabene Thank you !

@rafabene Thank you !

@sgilda

This comment has been minimized.

Show comment Hide comment
@sgilda

sgilda May 31, 2013

Contributor

@rafabene: Thanks!

@marobattaglia: Would you mind squashing the commits? :-)

Contributor

sgilda commented May 31, 2013

@rafabene: Thanks!

@marobattaglia: Would you mind squashing the commits? :-)

newCdiExampleProject
Added explicit check on @FactModel annotation presence
before augmenting class.
Only for educational purpose.

Removed duplicated file arquillian.xml
Commented arquillian.xml optional tags
Removed unused void constructor in org/jboss/as/quickstarts/cdi/drools/extension/FactMethod.java
Update uncorrect english grammar syntax in README.md ;-)

Slimming POM.xml and test class

Slimming pom.xml and test class

Blank spaces are removed from README.md

Removing return carridge for a better html view

Updated the new container configuration section

Added some comments to classes, methods, rule.
Extended description of README.md explaining better Drools and added references to more significant classes
Re-organized rules to having an example closer to real sistuations.
Added three tests to check results of adding and removing basket items.
Now there are three rules: Normal, Silver and Gold that defines three levels of discount.
It's a little bit complex, but it is more realistic and readable than the previous version.

Capitalized s of Selenium

Organized in different paragraphs

Deleted first row

modified READ.ME: The target product is BRMS
modified LineItemInjectionTarget .PMuir has suggested to augment a factmodel inside produce(CreationalContext<X> ctx) method. In produceMethod rsession is still null. I've moved this code inside postconstruct method. This guarantees a mapping one to one from factModel and its fact rapresentation in ksession. Deleted "*" char in wrong position.
modified DroolsExtension comments
modified RuleSessionManager: added correct access modfier, added comments
modified Changed the  name of FactMethod to FactMethodInterceptor
modified RuleSessionManager: used a generated serialVersionNumber, added comments
modified Manager set as private some fields. Simplified the production and injection of baskeItem.
modified OrderBuilder: comments added.
modified files of resources to be loaded into arquillian .war a  generated ar file

Simplified the expression "behind the JSF page, is made up of..."
Added emphasis on Test section
Corrected /s/taht/that

Added references to drools bom

Added bom references to drools

Added jboss-javaee-6.0-with-drools bom reference

Code formatted and cleaned up

Example part is been indented
@rafabene

This comment has been minimized.

Show comment Hide comment
@rafabene

rafabene Jun 4, 2013

Contributor

JBoss BOM 1.0.7.CR2 released with -with-drools BOM

Contributor

rafabene commented Jun 4, 2013

JBoss BOM 1.0.7.CR2 released with -with-drools BOM

@sgilda

This comment has been minimized.

Show comment Hide comment
@sgilda

sgilda Jun 13, 2013

Contributor

@rafabene : I just tried this.
First, I got this error:
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project org.jboss.as.quickstarts:jboss-as-cdi-add-interceptor-binding:7.1.2-SNAPSHOT (/home/sgilda/GitRepos/quickstart-jdf/cdi-portable-extension-drools/pom.xml) has 4 errors
[ERROR] Non-resolvable import POM: Could not find artifact org.jboss.bom:jboss-javaee-6.0-with-drools:pom:1.0.4.Final in central (http://repo.maven.apache.org/maven2) @ line 86, column 17 -> [Help 2]
[ERROR] 'dependencies.dependency.version' for org.drools:knowledge-api:jar is missing. @ line 146, column 16
[ERROR] 'dependencies.dependency.version' for org.drools:drools-core:jar is missing. @ line 150, column 15
[ERROR] 'dependencies.dependency.version' for org.drools:drools-compiler:jar is missing. @ line 154, column 15

Baed upon your comment above, I modified the pom file as follows: <version.jboss.bom>1.0.7.CR2</version.jboss.bom>

Then I get this error:
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project org.jboss.as.quickstarts:jboss-as-cdi-add-interceptor-binding:7.1.2-SNAPSHOT (/home/sgilda/GitRepos/quickstart-jdf/cdi-portable-extension-drools/pom.xml) has 4 errors
[ERROR] Non-resolvable import POM: Could not find artifact org.jboss.bom:jboss-javaee-6.0-with-drools:pom:1.0.7.CR2 in central (http://repo.maven.apache.org/maven2) @ line 86, column 17 -> [Help 2]
[ERROR] 'dependencies.dependency.version' for org.drools:knowledge-api:jar is missing. @ line 146, column 16
[ERROR] 'dependencies.dependency.version' for org.drools:drools-core:jar is missing. @ line 150, column 15
[ERROR] 'dependencies.dependency.version' for org.drools:drools-compiler:jar is missing. @ line 154, column 15

Am I modifying the wrong thing?

Contributor

sgilda commented Jun 13, 2013

@rafabene : I just tried this.
First, I got this error:
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project org.jboss.as.quickstarts:jboss-as-cdi-add-interceptor-binding:7.1.2-SNAPSHOT (/home/sgilda/GitRepos/quickstart-jdf/cdi-portable-extension-drools/pom.xml) has 4 errors
[ERROR] Non-resolvable import POM: Could not find artifact org.jboss.bom:jboss-javaee-6.0-with-drools:pom:1.0.4.Final in central (http://repo.maven.apache.org/maven2) @ line 86, column 17 -> [Help 2]
[ERROR] 'dependencies.dependency.version' for org.drools:knowledge-api:jar is missing. @ line 146, column 16
[ERROR] 'dependencies.dependency.version' for org.drools:drools-core:jar is missing. @ line 150, column 15
[ERROR] 'dependencies.dependency.version' for org.drools:drools-compiler:jar is missing. @ line 154, column 15

Baed upon your comment above, I modified the pom file as follows: <version.jboss.bom>1.0.7.CR2</version.jboss.bom>

Then I get this error:
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project org.jboss.as.quickstarts:jboss-as-cdi-add-interceptor-binding:7.1.2-SNAPSHOT (/home/sgilda/GitRepos/quickstart-jdf/cdi-portable-extension-drools/pom.xml) has 4 errors
[ERROR] Non-resolvable import POM: Could not find artifact org.jboss.bom:jboss-javaee-6.0-with-drools:pom:1.0.7.CR2 in central (http://repo.maven.apache.org/maven2) @ line 86, column 17 -> [Help 2]
[ERROR] 'dependencies.dependency.version' for org.drools:knowledge-api:jar is missing. @ line 146, column 16
[ERROR] 'dependencies.dependency.version' for org.drools:drools-core:jar is missing. @ line 150, column 15
[ERROR] 'dependencies.dependency.version' for org.drools:drools-compiler:jar is missing. @ line 154, column 15

Am I modifying the wrong thing?

@rafabene

This comment has been minimized.

Show comment Hide comment
@rafabene

rafabene Jun 13, 2013

Contributor

Sorry!

The new nexus version and the release script become incompatible and the artifacts were not publishing and reporting errors. That's why I'm working on https://issues.jboss.org/browse/JDF-364 - You can use 1.0.7.CR4 which is available on Maven Central.

Contributor

rafabene commented Jun 13, 2013

Sorry!

The new nexus version and the release script become incompatible and the artifacts were not publishing and reporting errors. That's why I'm working on https://issues.jboss.org/browse/JDF-364 - You can use 1.0.7.CR4 which is available on Maven Central.

@marcobattaglia

This comment has been minimized.

Show comment Hide comment
@marcobattaglia

marcobattaglia Jun 21, 2013

@sgilda
Hi, do you need any helps about it? Do I have to change something in the code?
Please tell me.
bye

@sgilda
Hi, do you need any helps about it? Do I have to change something in the code?
Please tell me.
bye

@sgilda

This comment has been minimized.

Show comment Hide comment
@sgilda

sgilda Jun 21, 2013

Contributor

@marcobattaglia : I will try the 1.0.7.CR5 version of the JBoss BOM and let you know.

Contributor

sgilda commented Jun 21, 2013

@marcobattaglia : I will try the 1.0.7.CR5 version of the JBoss BOM and let you know.

@sgilda

This comment has been minimized.

Show comment Hide comment
@sgilda

sgilda Jun 21, 2013

Contributor

@marcobattaglia , @rafabene : I updated the pom.xml file to use <version.jboss.bom>1.0.7.CR5</version.jboss.bom> and tested it again.

When I run the tests, I get 7 compilation errors:

    [INFO] 7 errors 
    [INFO] -------------------------------------------------------------
    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD FAILURE
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: 4.541s
    [INFO] Finished at: Fri Jun 21 13:32:28 EDT 2013
    [INFO] Final Memory: 37M/325M
    [INFO] ------------------------------------------------------------------------
    [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.1:testCompile (default-testCompile) on project jboss-as-cdi-add-interceptor-binding: Compilation failure: Compilation failure:
    [ERROR] /home/sgilda/GitRepos/quickstart-jdf/cdi-portable-extension-drools/src/test/java/org/jboss/as/quickstarts/jboss_as_cdi_portable_extension_drools/CdiExtensionDroolsTest.java:[17,40] error: cannot find symbol
    [ERROR] 
    [ERROR] package org.jboss.shrinkwrap.resolver.api
    [ERROR] /home/sgilda/GitRepos/quickstart-jdf/cdi-portable-extension-drools/src/test/java/org/jboss/as/quickstarts/jboss_as_cdi_portable_extension_drools/CdiExtensionDroolsTest.java:[18,46] error: cannot find symbol
    [ERROR] 
    [ERROR] package org.jboss.shrinkwrap.resolver.api.maven
    [ERROR] /home/sgilda/GitRepos/quickstart-jdf/cdi-portable-extension-drools/src/test/java/org/jboss/as/quickstarts/jboss_as_cdi_portable_extension_drools/CdiExtensionDroolsTest.java:[17,40] error: cannot find symbol
    [ERROR] 
    [ERROR] package org.jboss.shrinkwrap.resolver.api
    [ERROR] /home/sgilda/GitRepos/quickstart-jdf/cdi-portable-extension-drools/src/test/java/org/jboss/as/quickstarts/jboss_as_cdi_portable_extension_drools/CdiExtensionDroolsTest.java:[18,46] error: cannot find symbol
    [ERROR] 
    [ERROR] package org.jboss.shrinkwrap.resolver.api.maven
    [ERROR] /home/sgilda/GitRepos/quickstart-jdf/cdi-portable-extension-drools/src/test/java/org/jboss/as/quickstarts/jboss_as_cdi_portable_extension_drools/CdiExtensionDroolsTest.java:[29,8] error: cannot find symbol
    [ERROR] 
    [ERROR] class CdiExtensionDroolsTest
    [ERROR] /home/sgilda/GitRepos/quickstart-jdf/cdi-portable-extension-drools/src/test/java/org/jboss/as/quickstarts/jboss_as_cdi_portable_extension_drools/CdiExtensionDroolsTest.java:[30,12] error: cannot find symbol
    [ERROR] 
    [ERROR] class CdiExtensionDroolsTest
    [ERROR] /home/sgilda/GitRepos/quickstart-jdf/cdi-portable-extension-drools/src/test/java/org/jboss/as/quickstarts/jboss_as_cdi_portable_extension_drools/CdiExtensionDroolsTest.java:[29,43] error: cannot find symbol
Contributor

sgilda commented Jun 21, 2013

@marcobattaglia , @rafabene : I updated the pom.xml file to use <version.jboss.bom>1.0.7.CR5</version.jboss.bom> and tested it again.

When I run the tests, I get 7 compilation errors:

    [INFO] 7 errors 
    [INFO] -------------------------------------------------------------
    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD FAILURE
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: 4.541s
    [INFO] Finished at: Fri Jun 21 13:32:28 EDT 2013
    [INFO] Final Memory: 37M/325M
    [INFO] ------------------------------------------------------------------------
    [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.1:testCompile (default-testCompile) on project jboss-as-cdi-add-interceptor-binding: Compilation failure: Compilation failure:
    [ERROR] /home/sgilda/GitRepos/quickstart-jdf/cdi-portable-extension-drools/src/test/java/org/jboss/as/quickstarts/jboss_as_cdi_portable_extension_drools/CdiExtensionDroolsTest.java:[17,40] error: cannot find symbol
    [ERROR] 
    [ERROR] package org.jboss.shrinkwrap.resolver.api
    [ERROR] /home/sgilda/GitRepos/quickstart-jdf/cdi-portable-extension-drools/src/test/java/org/jboss/as/quickstarts/jboss_as_cdi_portable_extension_drools/CdiExtensionDroolsTest.java:[18,46] error: cannot find symbol
    [ERROR] 
    [ERROR] package org.jboss.shrinkwrap.resolver.api.maven
    [ERROR] /home/sgilda/GitRepos/quickstart-jdf/cdi-portable-extension-drools/src/test/java/org/jboss/as/quickstarts/jboss_as_cdi_portable_extension_drools/CdiExtensionDroolsTest.java:[17,40] error: cannot find symbol
    [ERROR] 
    [ERROR] package org.jboss.shrinkwrap.resolver.api
    [ERROR] /home/sgilda/GitRepos/quickstart-jdf/cdi-portable-extension-drools/src/test/java/org/jboss/as/quickstarts/jboss_as_cdi_portable_extension_drools/CdiExtensionDroolsTest.java:[18,46] error: cannot find symbol
    [ERROR] 
    [ERROR] package org.jboss.shrinkwrap.resolver.api.maven
    [ERROR] /home/sgilda/GitRepos/quickstart-jdf/cdi-portable-extension-drools/src/test/java/org/jboss/as/quickstarts/jboss_as_cdi_portable_extension_drools/CdiExtensionDroolsTest.java:[29,8] error: cannot find symbol
    [ERROR] 
    [ERROR] class CdiExtensionDroolsTest
    [ERROR] /home/sgilda/GitRepos/quickstart-jdf/cdi-portable-extension-drools/src/test/java/org/jboss/as/quickstarts/jboss_as_cdi_portable_extension_drools/CdiExtensionDroolsTest.java:[30,12] error: cannot find symbol
    [ERROR] 
    [ERROR] class CdiExtensionDroolsTest
    [ERROR] /home/sgilda/GitRepos/quickstart-jdf/cdi-portable-extension-drools/src/test/java/org/jboss/as/quickstarts/jboss_as_cdi_portable_extension_drools/CdiExtensionDroolsTest.java:[29,43] error: cannot find symbol
@sgilda

This comment has been minimized.

Show comment Hide comment
@sgilda

sgilda Jun 21, 2013

Contributor

@marcobattaglia :
First, in the pom.xml file, you need to update the <version.jboss.bom> version to 1.0.7.CR5.

@LightGuard helped me with the compile issues. It appears the shrinkwrap resolver API as changed as well. He was able to figure out DependencyResolvers was changed to Resolvers. So when I changed the import in CdiExtensionDroolsTest.java from import org.jboss.shrinkwrap.resolver.api.DependencyResolvers; to import org.jboss.shrinkwrap.resolver.api.Resolvers;, it went from 7 compile errors down to 5 compile errors.

It appears the import org.jboss.shrinkwrap.resolver.api.maven.MavenDependencyResolver; class is no longer in the package either. Jason searched and found a helpful link here:
https://github.com/shrinkwrap/resolver/blob/2.0.0-beta-5/impl-maven/src/test/java/org/jboss/shrinkwrap/resolver/impl/maven/integration/PomDependenciesUnitTestCase.java

Jason also found these links:

He suggested you might want to talk to Karel if you have any questions.

Hope this helps!

Contributor

sgilda commented Jun 21, 2013

@marcobattaglia :
First, in the pom.xml file, you need to update the <version.jboss.bom> version to 1.0.7.CR5.

@LightGuard helped me with the compile issues. It appears the shrinkwrap resolver API as changed as well. He was able to figure out DependencyResolvers was changed to Resolvers. So when I changed the import in CdiExtensionDroolsTest.java from import org.jboss.shrinkwrap.resolver.api.DependencyResolvers; to import org.jboss.shrinkwrap.resolver.api.Resolvers;, it went from 7 compile errors down to 5 compile errors.

It appears the import org.jboss.shrinkwrap.resolver.api.maven.MavenDependencyResolver; class is no longer in the package either. Jason searched and found a helpful link here:
https://github.com/shrinkwrap/resolver/blob/2.0.0-beta-5/impl-maven/src/test/java/org/jboss/shrinkwrap/resolver/impl/maven/integration/PomDependenciesUnitTestCase.java

Jason also found these links:

He suggested you might want to talk to Karel if you have any questions.

Hope this helps!

@LightGuard

This comment has been minimized.

Show comment Hide comment
@LightGuard

LightGuard Jun 21, 2013

Owner

You may also find the README at https://github.com/shrinkwrap/resolver/tree/master helpful.

Owner

LightGuard commented Jun 21, 2013

You may also find the README at https://github.com/shrinkwrap/resolver/tree/master helpful.

@sgilda

This comment has been minimized.

Show comment Hide comment
@sgilda

sgilda Aug 2, 2013

Contributor

@marcobattaglia : Have you had a chance to look at this yet?

Contributor

sgilda commented Aug 2, 2013

@marcobattaglia : Have you had a chance to look at this yet?

@sgilda

This comment has been minimized.

Show comment Hide comment
@sgilda

sgilda Aug 2, 2013

Contributor

Sent email 8/2/2013.

Contributor

sgilda commented Aug 2, 2013

Sent email 8/2/2013.

@marcobattaglia

This comment has been minimized.

Show comment Hide comment
@marcobattaglia

marcobattaglia Aug 2, 2013

@sgilda Next week, yes. Sorry I was very busy implementing my first extension for JBoss EAP 6.

@sgilda Next week, yes. Sorry I was very busy implementing my first extension for JBoss EAP 6.

@sgilda

This comment has been minimized.

Show comment Hide comment
@sgilda

sgilda Aug 2, 2013

Contributor

@marcobattaglia : Understood. Just wanted to get a status update. No pressure :-)

Contributor

sgilda commented Aug 2, 2013

@marcobattaglia : Understood. Just wanted to get a status update. No pressure :-)

@sgilda

This comment has been minimized.

Show comment Hide comment
@sgilda

sgilda Aug 7, 2013

Contributor

@marcobattaglia : I just tested this. It compile fine now, but the tests fail. The log is below. Any idea what is wrong?


T E S T S

Running org.jboss.as.quickstarts.jboss_as_cdi_portable_extension_drools.CdiExtensionDroolsTest
16:26:24.205 INFO - Command request: getNewBrowserSession[*firefox, http://localhost:8080, ] on session null
16:26:24.211 INFO - creating new remote session
16:26:24.325 WARN - Caution: '/usr/bin/firefox': file is a script file, not a real executable. The browser environment is no longer fully under RC control
16:26:24.329 INFO - Allocated session dc9710470ad6472fa35ab990f1cc4c96 for http://localhost:8080, launching...
jar:file:/home/sgilda/.m2/repository/org/seleniumhq/selenium/selenium-server/2.29.0/selenium-server-2.29.0.jar!/customProfileDirCUSTFFCHROME
16:26:24.366 INFO - Preparing Firefox profile...
16:26:30.429 INFO - Launching Firefox...
16:26:33.610 INFO - Got result: OK,dc9710470ad6472fa35ab990f1cc4c96 on session dc9710470ad6472fa35ab990f1cc4c96
16:26:33.619 INFO - Command request: setSpeed[0, ] on session dc9710470ad6472fa35ab990f1cc4c96
16:26:33.620 INFO - Got result: OK on session dc9710470ad6472fa35ab990f1cc4c96
16:26:33.624 INFO - Command request: setTimeout[60000, ] on session dc9710470ad6472fa35ab990f1cc4c96
16:26:33.664 INFO - Got result: OK on session dc9710470ad6472fa35ab990f1cc4c96
16:26:33.735 INFO - Command request: open[http://127.0.0.1:8080/test/index.xhtml, ] on session dc9710470ad6472fa35ab990f1cc4c96
16:26:33.735 WARN - you appear to be changing domains from http://localhost:8080 to http://127.0.0.1:8080/test/index.xhtml
this may lead to a 'Permission denied' from the browser (unless it is running as *iehta or *chrome,
or alternatively the selenium server is running in proxy injection mode)
16:26:35.557 INFO - Got result: OK on session dc9710470ad6472fa35ab990f1cc4c96
16:26:35.560 INFO - Command request: type[id=form:txtDescription, demo] on session dc9710470ad6472fa35ab990f1cc4c96
16:26:35.574 INFO - Got result: OK on session dc9710470ad6472fa35ab990f1cc4c96
16:26:35.577 INFO - Command request: type[id=form:txtPrice, 24] on session dc9710470ad6472fa35ab990f1cc4c96
16:26:35.592 INFO - Got result: OK on session dc9710470ad6472fa35ab990f1cc4c96
16:26:35.595 INFO - Command request: click[id=form:btnBuy, ] on session dc9710470ad6472fa35ab990f1cc4c96
16:26:35.633 INFO - Got result: ERROR: Command execution failure. Please search the user group at https://groups.google.com/forum/#!forum/selenium-users for error details from the log window. The error message is: Value does not implement interface Event. on session dc9710470ad6472fa35ab990f1cc4c96
16:26:35.669 INFO - Command request: type[id=form:txtPrice, 100] on session dc9710470ad6472fa35ab990f1cc4c96
16:26:35.681 INFO - Got result: OK on session dc9710470ad6472fa35ab990f1cc4c96
16:26:35.686 INFO - Command request: click[id=form:btnBuy, ] on session dc9710470ad6472fa35ab990f1cc4c96
16:26:35.709 INFO - Got result: ERROR: Command execution failure. Please search the user group at https://groups.google.com/forum/#!forum/selenium-users for error details from the log window. The error message is: Value does not implement interface Event. on session dc9710470ad6472fa35ab990f1cc4c96
16:26:35.738 INFO - Command request: type[id=form:txtPrice, 100] on session dc9710470ad6472fa35ab990f1cc4c96
16:26:35.749 INFO - Got result: OK on session dc9710470ad6472fa35ab990f1cc4c96
16:26:35.754 INFO - Command request: click[id=form:btnBuy, ] on session dc9710470ad6472fa35ab990f1cc4c96
16:26:35.770 INFO - Got result: ERROR: Command execution failure. Please search the user group at https://groups.google.com/forum/#!forum/selenium-users for error details from the log window. The error message is: Value does not implement interface Event. on session dc9710470ad6472fa35ab990f1cc4c96
16:26:35.823 INFO - Command request: click[xpath=//tr[last()]/td/input, ] on session dc9710470ad6472fa35ab990f1cc4c96
16:26:35.833 INFO - Got result: ERROR: Command execution failure. Please search the user group at https://groups.google.com/forum/#!forum/selenium-users for error details from the log window. The error message is: Value does not implement interface Event. on session dc9710470ad6472fa35ab990f1cc4c96
16:26:36.020 INFO - Command request: close[, ] on session dc9710470ad6472fa35ab990f1cc4c96
16:26:36.114 INFO - Got result: OK on session dc9710470ad6472fa35ab990f1cc4c96
16:26:36.118 INFO - Command request: testComplete[, ] on session dc9710470ad6472fa35ab990f1cc4c96
16:26:36.118 INFO - Killing Firefox...
16:26:36.176 INFO - Got result: OK on session dc9710470ad6472fa35ab990f1cc4c96
Tests run: 4, Failures: 0, Errors: 4, Skipped: 0, Time elapsed: 20.838 sec <<< FAILURE!

Results :

Tests in error:
assertFilledUnderOneHundred(org.jboss.as.quickstarts.jboss_as_cdi_portable_extension_drools.CdiExtensionDroolsTest): ERROR: Command execution failure. Please search the user group at https://groups.google.com/forum/#!forum/selenium-users for error details from the log window. The error message is: Value does not implement interface Event.
assertFilledOverOneHundred(org.jboss.as.quickstarts.jboss_as_cdi_portable_extension_drools.CdiExtensionDroolsTest): ERROR: Command execution failure. Please search the user group at https://groups.google.com/forum/#!forum/selenium-users for error details from the log window. The error message is: Value does not implement interface Event.
assertFilledOverTwoHundred(org.jboss.as.quickstarts.jboss_as_cdi_portable_extension_drools.CdiExtensionDroolsTest): ERROR: Command execution failure. Please search the user group at https://groups.google.com/forum/#!forum/selenium-users for error details from the log window. The error message is: Value does not implement interface Event.
assertFilledNewlyUnderOneHundred(org.jboss.as.quickstarts.jboss_as_cdi_portable_extension_drools.CdiExtensionDroolsTest): ERROR: Command execution failure. Please search the user group at https://groups.google.com/forum/#!forum/selenium-users for error details from the log window. The error message is: Value does not implement interface Event.

Tests run: 4, Failures: 0, Errors: 4, Skipped: 0

Contributor

sgilda commented Aug 7, 2013

@marcobattaglia : I just tested this. It compile fine now, but the tests fail. The log is below. Any idea what is wrong?


T E S T S

Running org.jboss.as.quickstarts.jboss_as_cdi_portable_extension_drools.CdiExtensionDroolsTest
16:26:24.205 INFO - Command request: getNewBrowserSession[*firefox, http://localhost:8080, ] on session null
16:26:24.211 INFO - creating new remote session
16:26:24.325 WARN - Caution: '/usr/bin/firefox': file is a script file, not a real executable. The browser environment is no longer fully under RC control
16:26:24.329 INFO - Allocated session dc9710470ad6472fa35ab990f1cc4c96 for http://localhost:8080, launching...
jar:file:/home/sgilda/.m2/repository/org/seleniumhq/selenium/selenium-server/2.29.0/selenium-server-2.29.0.jar!/customProfileDirCUSTFFCHROME
16:26:24.366 INFO - Preparing Firefox profile...
16:26:30.429 INFO - Launching Firefox...
16:26:33.610 INFO - Got result: OK,dc9710470ad6472fa35ab990f1cc4c96 on session dc9710470ad6472fa35ab990f1cc4c96
16:26:33.619 INFO - Command request: setSpeed[0, ] on session dc9710470ad6472fa35ab990f1cc4c96
16:26:33.620 INFO - Got result: OK on session dc9710470ad6472fa35ab990f1cc4c96
16:26:33.624 INFO - Command request: setTimeout[60000, ] on session dc9710470ad6472fa35ab990f1cc4c96
16:26:33.664 INFO - Got result: OK on session dc9710470ad6472fa35ab990f1cc4c96
16:26:33.735 INFO - Command request: open[http://127.0.0.1:8080/test/index.xhtml, ] on session dc9710470ad6472fa35ab990f1cc4c96
16:26:33.735 WARN - you appear to be changing domains from http://localhost:8080 to http://127.0.0.1:8080/test/index.xhtml
this may lead to a 'Permission denied' from the browser (unless it is running as *iehta or *chrome,
or alternatively the selenium server is running in proxy injection mode)
16:26:35.557 INFO - Got result: OK on session dc9710470ad6472fa35ab990f1cc4c96
16:26:35.560 INFO - Command request: type[id=form:txtDescription, demo] on session dc9710470ad6472fa35ab990f1cc4c96
16:26:35.574 INFO - Got result: OK on session dc9710470ad6472fa35ab990f1cc4c96
16:26:35.577 INFO - Command request: type[id=form:txtPrice, 24] on session dc9710470ad6472fa35ab990f1cc4c96
16:26:35.592 INFO - Got result: OK on session dc9710470ad6472fa35ab990f1cc4c96
16:26:35.595 INFO - Command request: click[id=form:btnBuy, ] on session dc9710470ad6472fa35ab990f1cc4c96
16:26:35.633 INFO - Got result: ERROR: Command execution failure. Please search the user group at https://groups.google.com/forum/#!forum/selenium-users for error details from the log window. The error message is: Value does not implement interface Event. on session dc9710470ad6472fa35ab990f1cc4c96
16:26:35.669 INFO - Command request: type[id=form:txtPrice, 100] on session dc9710470ad6472fa35ab990f1cc4c96
16:26:35.681 INFO - Got result: OK on session dc9710470ad6472fa35ab990f1cc4c96
16:26:35.686 INFO - Command request: click[id=form:btnBuy, ] on session dc9710470ad6472fa35ab990f1cc4c96
16:26:35.709 INFO - Got result: ERROR: Command execution failure. Please search the user group at https://groups.google.com/forum/#!forum/selenium-users for error details from the log window. The error message is: Value does not implement interface Event. on session dc9710470ad6472fa35ab990f1cc4c96
16:26:35.738 INFO - Command request: type[id=form:txtPrice, 100] on session dc9710470ad6472fa35ab990f1cc4c96
16:26:35.749 INFO - Got result: OK on session dc9710470ad6472fa35ab990f1cc4c96
16:26:35.754 INFO - Command request: click[id=form:btnBuy, ] on session dc9710470ad6472fa35ab990f1cc4c96
16:26:35.770 INFO - Got result: ERROR: Command execution failure. Please search the user group at https://groups.google.com/forum/#!forum/selenium-users for error details from the log window. The error message is: Value does not implement interface Event. on session dc9710470ad6472fa35ab990f1cc4c96
16:26:35.823 INFO - Command request: click[xpath=//tr[last()]/td/input, ] on session dc9710470ad6472fa35ab990f1cc4c96
16:26:35.833 INFO - Got result: ERROR: Command execution failure. Please search the user group at https://groups.google.com/forum/#!forum/selenium-users for error details from the log window. The error message is: Value does not implement interface Event. on session dc9710470ad6472fa35ab990f1cc4c96
16:26:36.020 INFO - Command request: close[, ] on session dc9710470ad6472fa35ab990f1cc4c96
16:26:36.114 INFO - Got result: OK on session dc9710470ad6472fa35ab990f1cc4c96
16:26:36.118 INFO - Command request: testComplete[, ] on session dc9710470ad6472fa35ab990f1cc4c96
16:26:36.118 INFO - Killing Firefox...
16:26:36.176 INFO - Got result: OK on session dc9710470ad6472fa35ab990f1cc4c96
Tests run: 4, Failures: 0, Errors: 4, Skipped: 0, Time elapsed: 20.838 sec <<< FAILURE!

Results :

Tests in error:
assertFilledUnderOneHundred(org.jboss.as.quickstarts.jboss_as_cdi_portable_extension_drools.CdiExtensionDroolsTest): ERROR: Command execution failure. Please search the user group at https://groups.google.com/forum/#!forum/selenium-users for error details from the log window. The error message is: Value does not implement interface Event.
assertFilledOverOneHundred(org.jboss.as.quickstarts.jboss_as_cdi_portable_extension_drools.CdiExtensionDroolsTest): ERROR: Command execution failure. Please search the user group at https://groups.google.com/forum/#!forum/selenium-users for error details from the log window. The error message is: Value does not implement interface Event.
assertFilledOverTwoHundred(org.jboss.as.quickstarts.jboss_as_cdi_portable_extension_drools.CdiExtensionDroolsTest): ERROR: Command execution failure. Please search the user group at https://groups.google.com/forum/#!forum/selenium-users for error details from the log window. The error message is: Value does not implement interface Event.
assertFilledNewlyUnderOneHundred(org.jboss.as.quickstarts.jboss_as_cdi_portable_extension_drools.CdiExtensionDroolsTest): ERROR: Command execution failure. Please search the user group at https://groups.google.com/forum/#!forum/selenium-users for error details from the log window. The error message is: Value does not implement interface Event.

Tests run: 4, Failures: 0, Errors: 4, Skipped: 0

@marcobattaglia

This comment has been minimized.

Show comment Hide comment
@marcobattaglia

marcobattaglia Aug 7, 2013

Ahiaiaii. On my fedora it works fine, so that I think it's a problem of timing and/or browser/selenium. I will do a check
thank you

Ahiaiaii. On my fedora it works fine, so that I think it's a problem of timing and/or browser/selenium. I will do a check
thank you

@marcobattaglia

This comment has been minimized.

Show comment Hide comment
@marcobattaglia

marcobattaglia Aug 12, 2013

@sgilda
I've found this:
http://code.google.com/p/selenium/issues/detail?id=5554

it seems to be an issue related to selenium (the client tester) with the new version of firefox (Aurora). The click event is not recognized. The selenium library 2.34 solves this problem. Our selenium library is 2.29 and it is loaded by :
<dependency>
<groupId>org.jboss.arquillian.extension</groupId>
<artifactId>arquillian-drone-selenium-depchain</artifactId>
<type>pom</type>
<scope>test</scope>
</dependency>
I've also tried to do an upgrade to WebDrive but without good result. In this case my firefox (version 20.0) alerts plugin not supported.
What is your firefox version?
If it is Aurora could you try to change pom in this way:
<version.org.jboss.arquillian.drone>1.2.0.Alpha2</version.org.jboss.arquillian.drone>
instead
<version.org.jboss.arquillian.drone>1.1.1.Final<version.org.jboss.arquillian.drone>
before lauching test?
Thank you

@sgilda
I've found this:
http://code.google.com/p/selenium/issues/detail?id=5554

it seems to be an issue related to selenium (the client tester) with the new version of firefox (Aurora). The click event is not recognized. The selenium library 2.34 solves this problem. Our selenium library is 2.29 and it is loaded by :
<dependency>
<groupId>org.jboss.arquillian.extension</groupId>
<artifactId>arquillian-drone-selenium-depchain</artifactId>
<type>pom</type>
<scope>test</scope>
</dependency>
I've also tried to do an upgrade to WebDrive but without good result. In this case my firefox (version 20.0) alerts plugin not supported.
What is your firefox version?
If it is Aurora could you try to change pom in this way:
<version.org.jboss.arquillian.drone>1.2.0.Alpha2</version.org.jboss.arquillian.drone>
instead
<version.org.jboss.arquillian.drone>1.1.1.Final<version.org.jboss.arquillian.drone>
before lauching test?
Thank you

@sgilda

This comment has been minimized.

Show comment Hide comment
@sgilda

sgilda Aug 13, 2013

Contributor

@marcobattaglia : I'm using Firefox 22.0 on Fedora 19. It appears that Firefox 22 is not supported by Selenium RC.

I also found these links that talk about my error: 'Value does not implement interface Event.'

Does this quickstart require Firefox? Chrome is my default browser.
What happens if a developer doesn't have Firefox installed?

Contributor

sgilda commented Aug 13, 2013

@marcobattaglia : I'm using Firefox 22.0 on Fedora 19. It appears that Firefox 22 is not supported by Selenium RC.

I also found these links that talk about my error: 'Value does not implement interface Event.'

Does this quickstart require Firefox? Chrome is my default browser.
What happens if a developer doesn't have Firefox installed?

@marcobattaglia

This comment has been minimized.

Show comment Hide comment
@marcobattaglia

marcobattaglia Aug 14, 2013

src/test/resources/arquillian.xml --> tag browserCapabilities. ... You can choose another browser to test.

src/test/resources/arquillian.xml --> tag browserCapabilities. ... You can choose another browser to test.

@sgilda

This comment has been minimized.

Show comment Hide comment
@sgilda

sgilda Aug 14, 2013

Contributor

I changed that file to the following:

    <extension qualifier="webdriver">
       <property name="browserCapabilities">chrome</property>
    </extension>

Yet, I still see that it opens Firefox and I get the same error:

08:18:34.959 INFO - Command request: getNewBrowserSession[*firefox, http://localhost:8080, ] on session null
08:18:34.980 INFO - creating new remote session
08:18:35.040 WARN - Caution: '/usr/bin/firefox': file is a script file, not a real executable. The browser environment is no longer fully under RC control
08:18:35.044 INFO - Allocated session 9d63a5e93cf7478aa35d2046f29ea3d5 for http://localhost:8080, launching...
jar:file:/home/sgilda/.m2/repository/org/seleniumhq/selenium/selenium-server/2.29.0/selenium-server-2.29.0.jar!/customProfileDirCUSTFFCHROME
08:18:35.088 INFO - Preparing Firefox profile...
08:18:36.944 INFO - Launching Firefox...

I assume I did not change it correctly. Still investigating.

UPDATE: Found this doc: https://docs.jboss.org/author/display/ARQ/Drone
Under "Selenium 2 (WebDriver) configuration", I see "chrome" in the list of valid values, so this should be correct and should have worked.

Contributor

sgilda commented Aug 14, 2013

I changed that file to the following:

    <extension qualifier="webdriver">
       <property name="browserCapabilities">chrome</property>
    </extension>

Yet, I still see that it opens Firefox and I get the same error:

08:18:34.959 INFO - Command request: getNewBrowserSession[*firefox, http://localhost:8080, ] on session null
08:18:34.980 INFO - creating new remote session
08:18:35.040 WARN - Caution: '/usr/bin/firefox': file is a script file, not a real executable. The browser environment is no longer fully under RC control
08:18:35.044 INFO - Allocated session 9d63a5e93cf7478aa35d2046f29ea3d5 for http://localhost:8080, launching...
jar:file:/home/sgilda/.m2/repository/org/seleniumhq/selenium/selenium-server/2.29.0/selenium-server-2.29.0.jar!/customProfileDirCUSTFFCHROME
08:18:35.088 INFO - Preparing Firefox profile...
08:18:36.944 INFO - Launching Firefox...

I assume I did not change it correctly. Still investigating.

UPDATE: Found this doc: https://docs.jboss.org/author/display/ARQ/Drone
Under "Selenium 2 (WebDriver) configuration", I see "chrome" in the list of valid values, so this should be correct and should have worked.

@sgilda

This comment has been minimized.

Show comment Hide comment
@sgilda

sgilda Aug 14, 2013

Contributor

Found an example showing '*googlechrome' on this website: http://arquillian.org/guides/functional_testing_using_drone/

Tried that and I still see it trying to open Firefox:
08:29:22.384 INFO - Command request: getNewBrowserSession[*firefox, http://localhost:8080, ] on session null
08:29:22.393 INFO - creating new remote session
08:29:22.463 WARN - Caution: '/usr/bin/firefox': file is a script file, not a real executable. The browser environment is no longer fully under RC control
08:29:22.466 INFO - Allocated session c5d9783a3a3049f8a2a90668d540f160 for http://localhost:8080, launching...
jar:file:/home/sgilda/.m2/repository/org/seleniumhq/selenium/selenium-server/2.29.0/selenium-server-2.29.0.jar!/customProfileDirCUSTFFCHROME
08:29:22.503 INFO - Preparing Firefox profile...
08:29:23.709 INFO - Launching Firefox...

I can see that it generates the correct XML in the target directory:
target/test-classes/arquillian.xml: *googlechrome

Also ried it with and without the leading *.
I am testing against JBoss AS 7.1.1.

Contributor

sgilda commented Aug 14, 2013

Found an example showing '*googlechrome' on this website: http://arquillian.org/guides/functional_testing_using_drone/

Tried that and I still see it trying to open Firefox:
08:29:22.384 INFO - Command request: getNewBrowserSession[*firefox, http://localhost:8080, ] on session null
08:29:22.393 INFO - creating new remote session
08:29:22.463 WARN - Caution: '/usr/bin/firefox': file is a script file, not a real executable. The browser environment is no longer fully under RC control
08:29:22.466 INFO - Allocated session c5d9783a3a3049f8a2a90668d540f160 for http://localhost:8080, launching...
jar:file:/home/sgilda/.m2/repository/org/seleniumhq/selenium/selenium-server/2.29.0/selenium-server-2.29.0.jar!/customProfileDirCUSTFFCHROME
08:29:22.503 INFO - Preparing Firefox profile...
08:29:23.709 INFO - Launching Firefox...

I can see that it generates the correct XML in the target directory:
target/test-classes/arquillian.xml: *googlechrome

Also ried it with and without the leading *.
I am testing against JBoss AS 7.1.1.

@marcobattaglia

This comment has been minimized.

Show comment Hide comment
@marcobattaglia

marcobattaglia Aug 14, 2013

@sgilda
I think we have two problems:

  1. it doesn't work with the new version of firefox: in particular this browser.click("id=form:btnBuy"); doesn't work because there is an issue and selenium libraries must be updated to 2.34.0 version
  2. We cannot launch chrome because browserCapabilities tag seems to not work or something is wrong in the configuration

In more:
3) there are a lot of new features related to arquillian drone ( https://gist.github.com/kpiwko/1848342 ). I think that the more interesting is about executing multiple drones (firefox and chrome for example).

We can work to add the new features of arquillian drone in this quickstart resolving 1) and 2) .
I need only to know if it is possible without breaking dependencies version, because kpiwko in this link (https://gist.github.com/kpiwko/1848342) suggests to remove Java EE 6 Spec BOM file with a Java EE 6 + Tools BOM from pom.xml

Before starting please tell me what do you think about it.
The alternative is to resolve points 1 and 2, without adding point 3.
Thank you

@sgilda
I think we have two problems:

  1. it doesn't work with the new version of firefox: in particular this browser.click("id=form:btnBuy"); doesn't work because there is an issue and selenium libraries must be updated to 2.34.0 version
  2. We cannot launch chrome because browserCapabilities tag seems to not work or something is wrong in the configuration

In more:
3) there are a lot of new features related to arquillian drone ( https://gist.github.com/kpiwko/1848342 ). I think that the more interesting is about executing multiple drones (firefox and chrome for example).

We can work to add the new features of arquillian drone in this quickstart resolving 1) and 2) .
I need only to know if it is possible without breaking dependencies version, because kpiwko in this link (https://gist.github.com/kpiwko/1848342) suggests to remove Java EE 6 Spec BOM file with a Java EE 6 + Tools BOM from pom.xml

Before starting please tell me what do you think about it.
The alternative is to resolve points 1 and 2, without adding point 3.
Thank you

@sgilda

This comment has been minimized.

Show comment Hide comment
@sgilda

sgilda Aug 14, 2013

Contributor

@pmuir, @rafabene : This is way over my head. Can either of you respond?

Contributor

sgilda commented Aug 14, 2013

@pmuir, @rafabene : This is way over my head. Can either of you respond?

@rafabene

This comment has been minimized.

Show comment Hide comment
@rafabene

rafabene Aug 16, 2013

Contributor

I think this gist https://gist.github.com/kpiwko/1848342 is a little bit out of date. I made some updates on -with-tools BOM to permit it work with ShrinkWrap resolver: jboss-developer/jboss-eap-boms@a2fb096 I think this solved also the problem with Drone too

It worth try using Drone + -with-tools BOM. If it didn't work we should fix the BOM.

Contributor

rafabene commented Aug 16, 2013

I think this gist https://gist.github.com/kpiwko/1848342 is a little bit out of date. I made some updates on -with-tools BOM to permit it work with ShrinkWrap resolver: jboss-developer/jboss-eap-boms@a2fb096 I think this solved also the problem with Drone too

It worth try using Drone + -with-tools BOM. If it didn't work we should fix the BOM.

@sgilda

This comment has been minimized.

Show comment Hide comment
@sgilda

sgilda Aug 19, 2013

Contributor

@marcobattaglia : We will be closing all outstanding quickstart pull requests this week so we can reorganize the quickstarts. Do you think you'll be able to finish this one up in the next day or two? I'm still not clear how to get it to use Chrome instead of Firefox.

I think the new Arquillian features (your issue 3.) could be added down the road, don't you? I think there are plans to enhance many of the existing quickstarts with regards to Arquillian tests.

Contributor

sgilda commented Aug 19, 2013

@marcobattaglia : We will be closing all outstanding quickstart pull requests this week so we can reorganize the quickstarts. Do you think you'll be able to finish this one up in the next day or two? I'm still not clear how to get it to use Chrome instead of Firefox.

I think the new Arquillian features (your issue 3.) could be added down the road, don't you? I think there are plans to enhance many of the existing quickstarts with regards to Arquillian tests.

@marcobattaglia

This comment has been minimized.

Show comment Hide comment
@marcobattaglia

marcobattaglia Aug 19, 2013

@sgilda @rafabene :
ok. we can remove issue3.

Issue1: It can be resolved by updating selenium version to 2.34 (both selenium server library and selenium) Now the arquillian-drone-bom is using version 2.29.This version has got a bug with the new version of firefox: it cannot simulate a click in the browser!

Issue2: It's correct that only firefox browser works, because the DefaultSelenium Drone has got only firefox as BrowserCapabilities. In order to have other browser the Drone must be changed to WebDriver. It has actually some issue with Firefox (http://stackoverflow.com/questions/15814695/selenium-webdriver-does-not-connect-with-firefox-20) and another upgrade will be required.

Conclusion:
If you want it's possible to resolve issue1 by changing arquillian-drone-bom in order to use the new version of selenium, or we can to change test in normal test without using a browser Drone.

@sgilda @rafabene :
ok. we can remove issue3.

Issue1: It can be resolved by updating selenium version to 2.34 (both selenium server library and selenium) Now the arquillian-drone-bom is using version 2.29.This version has got a bug with the new version of firefox: it cannot simulate a click in the browser!

Issue2: It's correct that only firefox browser works, because the DefaultSelenium Drone has got only firefox as BrowserCapabilities. In order to have other browser the Drone must be changed to WebDriver. It has actually some issue with Firefox (http://stackoverflow.com/questions/15814695/selenium-webdriver-does-not-connect-with-firefox-20) and another upgrade will be required.

Conclusion:
If you want it's possible to resolve issue1 by changing arquillian-drone-bom in order to use the new version of selenium, or we can to change test in normal test without using a browser Drone.

@sgilda

This comment has been minimized.

Show comment Hide comment
@sgilda

sgilda Aug 20, 2013

Contributor

@marcobattaglia : We need to resolve issue #1 before merging. What would need to be done to upgrade to Selenium 2.34? Is this a BOM file change or something else?

Contributor

sgilda commented Aug 20, 2013

@marcobattaglia : We need to resolve issue #1 before merging. What would need to be done to upgrade to Selenium 2.34? Is this a BOM file change or something else?

@marcobattaglia

This comment has been minimized.

Show comment Hide comment
@marcobattaglia

marcobattaglia Aug 20, 2013

@sgilda
In jboss-javaee-6.0-with-tools-1.0.7-SNAPSHOT.pom

is imported as dependency org.jboss.arquillian.extension

<dependency>
<groupId>org.jboss.arquillian.extension</groupId>
<artifactId>arquillian-drone-selenium-depchain</artifactId>
<version>${version.org.jboss.arquillian.extension.drone}</version>
<type>pom</type>
</dependency>

this imports:
selenium-api version: 2.29.0
selenium-java version: 2.29.0
selenium-server version: 2.29.0
selenium-remote-driver version: 2.29.0
selenium-support version: 2.29.0
selenium-safari-driver version: 2.29.0

These versions have to be upgraded to 2.34
I have tested the error on version 22 on firefox and there is no workaround, all events simulated on browser by selenium version 2.29 don't work.

I think the bug on click event is a serious bug and it justify an upgrade of arquillian bom.

Thank you for all your helps during these months

Bye

@sgilda
In jboss-javaee-6.0-with-tools-1.0.7-SNAPSHOT.pom

is imported as dependency org.jboss.arquillian.extension

<dependency>
<groupId>org.jboss.arquillian.extension</groupId>
<artifactId>arquillian-drone-selenium-depchain</artifactId>
<version>${version.org.jboss.arquillian.extension.drone}</version>
<type>pom</type>
</dependency>

this imports:
selenium-api version: 2.29.0
selenium-java version: 2.29.0
selenium-server version: 2.29.0
selenium-remote-driver version: 2.29.0
selenium-support version: 2.29.0
selenium-safari-driver version: 2.29.0

These versions have to be upgraded to 2.34
I have tested the error on version 22 on firefox and there is no workaround, all events simulated on browser by selenium version 2.29 don't work.

I think the bug on click event is a serious bug and it justify an upgrade of arquillian bom.

Thank you for all your helps during these months

Bye

@pmuir

This comment has been minimized.

Show comment Hide comment
@pmuir

pmuir Aug 20, 2013

Contributor

As this is a totally new quick start, it should be easy to apply against the new repo structure as well, with a simple mv :-)

Contributor

pmuir commented Aug 20, 2013

As this is a totally new quick start, it should be easy to apply against the new repo structure as well, with a simple mv :-)

@sgilda

This comment has been minimized.

Show comment Hide comment
@sgilda

sgilda Aug 20, 2013

Contributor

@pmuir: I'm not clear what you mean.
Should we update the BOM?
Should we wait to merge this after the reorg?
Should we ???
:-)

Contributor

sgilda commented Aug 20, 2013

@pmuir: I'm not clear what you mean.
Should we update the BOM?
Should we wait to merge this after the reorg?
Should we ???
:-)

@pmuir

This comment has been minimized.

Show comment Hide comment
@pmuir

pmuir Aug 20, 2013

Contributor

@sgilda, I mean it would be easy to merge this one after the reorg, as it's a new quickstart :-)

Contributor

pmuir commented Aug 20, 2013

@sgilda, I mean it would be easy to merge this one after the reorg, as it's a new quickstart :-)

@marcobattaglia

This comment has been minimized.

Show comment Hide comment
@marcobattaglia

marcobattaglia Aug 20, 2013

it's ok for me. I can work also on new arquillian drones in order to have multiple browsers to test.

it's ok for me. I can work also on new arquillian drones in order to have multiple browsers to test.

@sgilda

This comment has been minimized.

Show comment Hide comment
@sgilda

sgilda Aug 20, 2013

Contributor

@marcobattaglia : Sounds good. I'll close the pull for now and you can submit it after the reorg is complete. Thanks!

:

Contributor

sgilda commented Aug 20, 2013

@marcobattaglia : Sounds good. I'll close the pull for now and you can submit it after the reorg is complete. Thanks!

:

@sgilda sgilda closed this Aug 20, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment