greenlaw110 / greenscript

A tool help web developers manage javascript/css rendering, including minimize and dependence management
42 stars 24 forks source link

Memcached is not handled correctly #43

Open tazmaniax opened 12 years ago

tazmaniax commented 12 years ago

Hi Green,

Just turned on memcached for the first time as the Play! Cache implementation and immediately have a problem. Looking at GreenScriptPlugin.bufferLocator_.newBuffer(List resourceNames, String extension) it adds the buffer to cache before the buffer has actually been populated - the buffer is then subsequently populated. This might be fine with a pure single JVM memory solution but with memcached or any other distributed cache I suspect it won't work as it ends up just adding empty values to the cache.

My first impression is that Cache.set(..) in GreenScriptPlugin.bufferLocator_.newBuffer(...) needs to be moved out a new method, such as storeBuffer(BufferResource), and called separately at the end of Minimizer.minimize(List resourceNames) so buffer is stored in the Cache only once it has been populated. I know probably a few more things to be changed to accomodate this but that's the general gist.

I'll try and have a deeper look into what could be changed later today but I wanted to give you a heads up. I need this fixed asap because I have other code depending on memcached being configured as the Play! cache.

cheers, Chris

greenlaw110 commented 12 years ago

Hi Chris,

Thanks for reporting this issue. Unfortunately I am afraid I cannot work on it within this week. I am getting crazy on my own project right now. Sorry about that. I will try to spend some time on weekends on this issue.

Regards, Green

On Tue, Apr 3, 2012 at 9:12 PM, tazmaniax < reply@reply.github.com

wrote:

Hi Green,

Just turned on memcached for the first time as the Play! Cache implementation and immediately have a problem. Looking at GreenScriptPlugin.bufferLocator_.newBuffer(List resourceNames, String extension) it adds the buffer to cache before the buffer has actually been populated - the buffer is then subsequently populated. This might be fine with a pure single JVM memory solution but with memcached or any other distributed cache I suspect it won't work as it ends up just adding empty values to the cache.

My first impression is that Cache.set(..) in GreenScriptPlugin.bufferLocator_.newBuffer(...) needs to be moved out a new method, such as storeBuffer(BufferResource), and called separately at the end of Minimizer.minimize(List resourceNames) so buffer is stored in the Cache only once it has been populated. I know probably a few more things to be changed to accomodate this but that's the general gist.

I'll try and have a deeper look into what could be changed later today but I wanted to give you a heads up. I need this fixed asap because I have other code depending on memcached being configured as the Play! cache.

cheers, Chris


Reply to this email directly or view it on GitHub: https://github.com/greenlaw110/greenscript/issues/43

tazmaniax commented 12 years ago

Hi Green,

I'm going to have look into it now but I'm struggling with the new Mavenised version of the code and getting it to build in Eclipse - unfortunately I'm not too familiar with Maven. I have the core and play projects as two separate projects in my workspace now with the latest code from github. In the core module I did right click on the pom.xml and selected Run As -> Maven Install and got this:

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 15.630s
[INFO] Finished at: Tue Apr 03 18:20:03 BST 2012
[INFO] Final Memory: 7M/81M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.7.1:test (default-test) on project greenscript-core: There are test failures.
[ERROR] 
[ERROR] Please refer to /Users/chriswebb/git/greenscript/java/core/target/surefire-reports for the individual test results.
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

However compiled classes were outputted to the 'target' directory

I then did exactly the same to the play module, pom.xml -> right click -> Run As -> Maven Install and got this:

[INFO] Scanning for projects...
[WARNING] 
[WARNING] Some problems were encountered while building the effective model for com.github.greenlaw110.greenscript:greenscript-play:jar:1.2.8-SNAPSHOT
[WARNING] 'parent.relativePath' points at com.github.greenlaw110.greenscript:greenscript-parent instead of com.google.code.maven-play-plugin:play-module-default-parent, please verify your project structure @ line 24, column 13
[WARNING] 
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING] 
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING] 
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building Play! GreenScript Module 1.2.8-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[WARNING] The POM for com.github.greenlaw110.greenscript:greenscript-core:jar:1.2.8-SNAPSHOT is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.063s
[INFO] Finished at: Tue Apr 03 18:23:33 BST 2012
[INFO] Final Memory: 7M/81M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project greenscript-play: Could not resolve dependencies for project com.github.greenlaw110.greenscript:greenscript-play:jar:1.2.8-SNAPSHOT: Failure to find com.github.greenlaw110.greenscript:greenscript-core:jar:1.2.8-SNAPSHOT in http://maven-play-plugin.googlecode.com/svn/mavenrepo/snapshots was cached in the local repository, resolution will not be reattempted until the update interval of com.google.code.maven-play-plugin-snapshots has elapsed or updates are forced -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException

What happend to the good old simple Ant build? :) Any advice on how I can get the projects to build a module in Eclipse that I can then install locally into my Play project.

greenlaw110 commented 12 years ago

You will need to first go into java/core and run mvn install

On Wed, Apr 4, 2012 at 3:48 AM, tazmaniax < reply@reply.github.com

wrote:

Hi Green,

I'm going to have look into it now but I'm struggling with the new Mavenised version of the code and getting it to build in Eclipse - unfortunately I'm not too familiar with Maven. I have the core and play projects as two separate projects in my workspace now with the latest code from github. In the core module I did right click on the pom.xml and selected Run As -> Maven Install and got this:

[INFO]
------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 15.630s
[INFO] Finished at: Tue Apr 03 18:20:03 BST 2012
[INFO] Final Memory: 7M/81M
[INFO]
------------------------------------------------------------------------
[ERROR] Failed to execute goal
org.apache.maven.plugins:maven-surefire-plugin:2.7.1:test (default-test) on
project greenscript-core: There are test failures.
[ERROR]
[ERROR] Please refer to
/Users/chriswebb/git/greenscript/java/core/target/surefire-reports for the
individual test results.
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the
-e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions,
please read the following articles:
[ERROR] [Help 1]
http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

However compiled classes were outputted to the 'target' directory

I then did exactly the same to the play module, pom.xml -> right click -> Run As -> Maven Install and got this:

[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective
model for
com.github.greenlaw110.greenscript:greenscript-play:jar:1.2.8-SNAPSHOT
[WARNING] 'parent.relativePath' points at
com.github.greenlaw110.greenscript:greenscript-parent instead of
com.google.code.maven-play-plugin:play-module-default-parent, please verify
your project structure @ line 24, column 13
[WARNING]
[WARNING] It is highly recommended to fix these problems because they
threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support
building such malformed projects.
[WARNING]
[INFO]
[INFO]
------------------------------------------------------------------------
[INFO] Building Play! GreenScript Module 1.2.8-SNAPSHOT
[INFO]
------------------------------------------------------------------------
[WARNING] The POM for
com.github.greenlaw110.greenscript:greenscript-core:jar:1.2.8-SNAPSHOT is
missing, no dependency information available
[INFO]
------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 2.063s
[INFO] Finished at: Tue Apr 03 18:23:33 BST 2012
[INFO] Final Memory: 7M/81M
[INFO]
------------------------------------------------------------------------
[ERROR] Failed to execute goal on project greenscript-play: Could not
resolve dependencies for project
com.github.greenlaw110.greenscript:greenscript-play:jar:1.2.8-SNAPSHOT:
Failure to find
com.github.greenlaw110.greenscript:greenscript-core:jar:1.2.8-SNAPSHOT in
http://maven-play-plugin.googlecode.com/svn/mavenrepo/snapshots was
cached in the local repository, resolution will not be reattempted until
the update interval of com.google.code.maven-play-plugin-snapshots has
elapsed or updates are forced -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the
-e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions,
please read the following articles:
[ERROR] [Help 1]
http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException

What happend to the good old simple Ant build? :) Any advice on how I can get the projects to build a module in Eclipse that I can then install locally into my Play project.


Reply to this email directly or view it on GitHub: https://github.com/greenlaw110/greenscript/issues/43#issuecomment-4916012

tazmaniax commented 12 years ago

I got something very similar running "mvn install" from the command line:

tazmaniac:java chriswebb$ mvn -e install
[INFO] Error stacktraces are turned on.
[INFO] Scanning for projects...
[WARNING] 
[WARNING] Some problems were encountered while building the effective model for com.github.greenlaw110.greenscript:greenscript-play:jar:1.2.8-SNAPSHOT
[WARNING] 'parent.relativePath' points at com.github.greenlaw110.greenscript:greenscript-parent instead of com.google.code.maven-play-plugin:play-module-default-parent, please verify your project structure @ line 24, column 13
[WARNING] 
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING] 
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING] 
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO] 
[INFO] GreenScript Core
[INFO] Play! GreenScript Module
[INFO] GreenScript Maven Parent
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building GreenScript Core 1.2.8-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-resources-plugin:2.4.3:resources (default-resources) @ greenscript-core ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/chriswebb/git/greenscript/java/core/src/main/resources
[INFO] 
[INFO] --- maven-compiler-plugin:2.0.2:compile (default-compile) @ greenscript-core ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-resources-plugin:2.4.3:testResources (default-testResources) @ greenscript-core ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 11 resources
[INFO] 
[INFO] --- maven-compiler-plugin:2.0.2:testCompile (default-testCompile) @ greenscript-core ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-surefire-plugin:2.7.2:test (default-test) @ greenscript-core ---
[INFO] Surefire report directory: /Users/chriswebb/git/greenscript/java/core/target/surefire-reports

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running com.greenscriptool.DependenceManagerTest
Tests run: 6, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.098 sec
Running com.greenscriptool.MinimizerTest
Tests run: 5, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 9.003 sec <<< FAILURE!

Results :

Failed tests: 
  testProcessWithMinimizeEnabled(com.greenscriptool.MinimizerTest)

Tests run: 11, Failures: 1, Errors: 0, Skipped: 0

[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO] 
[INFO] GreenScript Core .................................. FAILURE [22.455s]
[INFO] Play! GreenScript Module .......................... SKIPPED
[INFO] GreenScript Maven Parent .......................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 22.641s
[INFO] Finished at: Wed Apr 04 00:33:07 BST 2012
[INFO] Final Memory: 4M/81M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.7.2:test (default-test) on project greenscript-core: There are test failures.
[ERROR] 
[ERROR] Please refer to /Users/chriswebb/git/greenscript/java/core/target/surefire-reports for the individual test results.
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.7.2:test (default-test) on project greenscript-core: There are test failures.

Please refer to /Users/chriswebb/git/greenscript/java/core/target/surefire-reports for the individual test results.
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:213)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:319)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: org.apache.maven.plugin.MojoFailureException: There are test failures.

Please refer to /Users/chriswebb/git/greenscript/java/core/target/surefire-reports for the individual test results.
    at org.apache.maven.plugin.surefire.SurefireHelper.reportExecution(SurefireHelper.java:74)
    at org.apache.maven.plugin.surefire.SurefirePlugin.execute(SurefirePlugin.java:642)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
    ... 19 more
[ERROR] 
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
tazmaniac:java chriswebb$ 

Here is the exception in target/surefire-reports/com.greenscriptool.MinimizerTest.txt:

testProcessWithMinimizeEnabled(com.greenscriptool.MinimizerTest)  Time elapsed: 7.407 sec  <<< FAILURE!
java.lang.AssertionError: 
    at org.junit.Assert.fail(Assert.java:91)
    at org.junit.Assert.assertTrue(Assert.java:43)
    at org.junit.Assert.assertFalse(Assert.java:68)
    at org.junit.Assert.assertFalse(Assert.java:79)
    at com.greenscriptool.MinimizerTest.testProcessWithMinimizeEnabled(MinimizerTest.java:124)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
    at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
    at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
    at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
    at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:35)
    at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:146)
    at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:97)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.maven.surefire.booter.ProviderFactory$ClassLoaderProxy.invoke(ProviderFactory.java:103)
    at $Proxy0.invoke(Unknown Source)
    at org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:145)
    at org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcess(SurefireStarter.java:87)
    at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:69)
greenlaw110 commented 12 years ago

hmm... something cause the unit test fail. My project can pass that ut. You need to check what has been changed against the unit test case.

On Wed, Apr 4, 2012 at 9:41 AM, tazmaniax < reply@reply.github.com

wrote:

I got something very similar running "mvn install" from the command line:

tazmaniac:java chriswebb$ mvn -e install
[INFO] Error stacktraces are turned on.
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective
model for
com.github.greenlaw110.greenscript:greenscript-play:jar:1.2.8-SNAPSHOT
[WARNING] 'parent.relativePath' points at
com.github.greenlaw110.greenscript:greenscript-parent instead of
com.google.code.maven-play-plugin:play-module-default-parent, please verify
your project structure @ line 24, column 13
[WARNING]
[WARNING] It is highly recommended to fix these problems because they
threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support
building such malformed projects.
[WARNING]
[INFO]
------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] GreenScript Core
[INFO] Play! GreenScript Module
[INFO] GreenScript Maven Parent
[INFO]
[INFO]
------------------------------------------------------------------------
[INFO] Building GreenScript Core 1.2.8-SNAPSHOT
[INFO]
------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.4.3:resources (default-resources) @
greenscript-core ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory
/Users/chriswebb/git/greenscript/java/core/src/main/resources
[INFO]
[INFO] --- maven-compiler-plugin:2.0.2:compile (default-compile) @
greenscript-core ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.4.3:testResources
(default-testResources) @ greenscript-core ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 11 resources
[INFO]
[INFO] --- maven-compiler-plugin:2.0.2:testCompile (default-testCompile) @
greenscript-core ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:2.7.2:test (default-test) @
greenscript-core ---
[INFO] Surefire report directory:
/Users/chriswebb/git/greenscript/java/core/target/surefire-reports

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running com.greenscriptool.DependenceManagerTest
Tests run: 6, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.098 sec
Running com.greenscriptool.MinimizerTest
Tests run: 5, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 9.003 sec
<<< FAILURE!

Results :

Failed tests:
 testProcessWithMinimizeEnabled(com.greenscriptool.MinimizerTest)

Tests run: 11, Failures: 1, Errors: 0, Skipped: 0

[INFO]
------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] GreenScript Core .................................. FAILURE
[22.455s]
[INFO] Play! GreenScript Module .......................... SKIPPED
[INFO] GreenScript Maven Parent .......................... SKIPPED
[INFO]
------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 22.641s
[INFO] Finished at: Wed Apr 04 00:33:07 BST 2012
[INFO] Final Memory: 4M/81M
[INFO]
------------------------------------------------------------------------
[ERROR] Failed to execute goal
org.apache.maven.plugins:maven-surefire-plugin:2.7.2:test (default-test) on
project greenscript-core: There are test failures.
[ERROR]
[ERROR] Please refer to
/Users/chriswebb/git/greenscript/java/core/target/surefire-reports for the
individual test results.
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute
goal org.apache.maven.plugins:maven-surefire-plugin:2.7.2:test
(default-test) on project greenscript-core: There are test failures.

Please refer to
/Users/chriswebb/git/greenscript/java/core/target/surefire-reports for the
individual test results.
        at
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:213)
       at
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
       at
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
       at
org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
       at
org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
       at
org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
       at
org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
       at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:319)
       at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
       at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
       at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
       at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:597)
       at
org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
       at
org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
       at
org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
       at
org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: org.apache.maven.plugin.MojoFailureException: There are test
failures.

Please refer to
/Users/chriswebb/git/greenscript/java/core/target/surefire-reports for the
individual test results.
        at
org.apache.maven.plugin.surefire.SurefireHelper.reportExecution(SurefireHelper.java:74)
       at
org.apache.maven.plugin.surefire.SurefirePlugin.execute(SurefirePlugin.java:642)
       at
org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
       at
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
       ... 19 more
[ERROR]
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions,
please read the following articles:
[ERROR] [Help 1]
http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
tazmaniac:java chriswebb$

Here is the exception in target/surefire-reports/com.greenscriptool.MinimizerTest.txt:

testProcessWithMinimizeEnabled(com.greenscriptool.MinimizerTest)  Time
elapsed: 7.407 sec  <<< FAILURE!
java.lang.AssertionError:
       at org.junit.Assert.fail(Assert.java:91)
       at org.junit.Assert.assertTrue(Assert.java:43)
       at org.junit.Assert.assertFalse(Assert.java:68)
       at org.junit.Assert.assertFalse(Assert.java:79)
       at
com.greenscriptool.MinimizerTest.testProcessWithMinimizeEnabled(MinimizerTest.java:124)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:597)
       at
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
       at
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
       at
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
       at
org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
       at
org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
       at
org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
       at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)
       at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
       at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
       at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
       at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
       at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
       at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
       at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
       at
org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:35)
       at
org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:146)
       at
org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:97)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:597)
       at
org.apache.maven.surefire.booter.ProviderFactory$ClassLoaderProxy.invoke(ProviderFactory.java:103)
       at $Proxy0.invoke(Unknown Source)
       at
org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:145)
       at
org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcess(SurefireStarter.java:87)
       at
org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:69)

Reply to this email directly or view it on GitHub: https://github.com/greenlaw110/greenscript/issues/43#issuecomment-4941854

tazmaniax commented 12 years ago

Ok, I'm getting the test failure against the latest from your master branch (0069f7089b5296777dfc0d381a5c23413ee9f51c). What version are you building against?

I'm looking at the test case now. To get it working in Eclipse I did "mvn eclipse:eclipse" - getting my Maven stripes :)

tazmaniax commented 12 years ago

I've stepped through the test in question and it looks like the test is no longer valid. The test is using com.greenscriptool.utils.FileCache which now uses the new logic to create the cache key based on the included resource so for the same set of resources the same cache key will always be generated regardless if the internal cache is enabled. I'm curious to know how the test is succeeding for you. I'm going to change the test to be assertTrue

greenlaw110 commented 12 years ago

I am almost synchronized with the latest master. The only different is the tag files which is not relevant to the UT:

c:\w_lgl>cd greenscript-1.2

c:\w_lgl\greenscript-1.2>git branch 1.2

c:\w_lgl\greenscript-1.2>git st

On branch master

Changed but not updated:

(use "git add/rm ..." to update what will be committed)

(use "git checkout -- ..." to discard changes in working

directory) #

modified: java/core/pom.xml

deleted:

java/play/app/views/tags/rythm/greenscript/closeTag_.html

deleted: java/play/app/views/tags/rythm/greenscript/css.html

deleted: java/play/app/views/tags/rythm/greenscript/gs_.html

deleted:

java/play/app/views/tags/rythm/greenscript/importCss.html

deleted: java/play/app/views/tags/rythm/greenscript/js.html

deleted: java/play/app/views/tags/rythm/greenscript/openTag_.html

deleted: java/play/app/views/tags/rythm/greenscript/output_.html

modified: java/play/pom.xml

#

Untracked files:

(use "git add ..." to include in what will be committed)

#

java/play/app/rythm/

push.bat

no changes added to commit (use "git add" and/or "git commit -a")

On Wed, Apr 4, 2012 at 8:30 PM, tazmaniax < reply@reply.github.com

wrote:

Ok, I'm getting the test failure against the latest from your master branch (0069f7089b5296777dfc0d381a5c23413ee9f51c). What version are you building against?

I'm looking at the test case now. To get it working in Eclipse I did "mvn eclipse:eclipse" - getting my Maven stripes :)


Reply to this email directly or view it on GitHub: https://github.com/greenlaw110/greenscript/issues/43#issuecomment-4950807

greenlaw110 commented 12 years ago

Strange, I can pass the test:

c:\w_lgl\greenscript-1.2\java\core>mvn test [INFO] Scanning for projects... [INFO]

[INFO]

[INFO] Building GreenScript Core 1.2.8a

[INFO]

[INFO] [INFO] --- maven-resources-plugin:2.4.3:resources (default-resources) @ greenscript-core --- [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] skip non existing resourceDirectory c:\w_lgl\greenscript-1.2\java\core\src\main\resources [INFO] [INFO] --- maven-compiler-plugin:2.0.2:compile (default-compile) @ greenscript-core --- [INFO] Nothing to compile - all classes are up to date [INFO] [INFO] --- maven-resources-plugin:2.4.3:testResources (default-testResources) @ greenscript-core --- [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] Copying 11 resources [INFO] [INFO] --- maven-compiler-plugin:2.0.2:testCompile (default-testCompile) @ greenscript-core --- [INFO] Nothing to compile - all classes are up to date [INFO]

[INFO] --- maven-surefire-plugin:2.5:test (default-test) @ greenscript-core

[INFO] Surefire report directory: c:\w_lgl\greenscript-1.2\java\core\target\surefire-reports


T E S T S

Running com.greenscriptool.DependenceManagerTest Tests run: 6, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.32 sec Running com.greenscriptool.MinimizerTest Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 3.334 sec

Results :

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

[INFO]

[INFO] BUILD SUCCESS

[INFO]

[INFO] Total time: 12.923s [INFO] Finished at: Wed Apr 04 21:03:36 EST 2012 [INFO] Final Memory: 3M/15M

[INFO]

On Wed, Apr 4, 2012 at 8:57 PM, tazmaniax < reply@reply.github.com

wrote:

I've stepped through the test in question and it looks like the test is no longer valid. The test is using com.greenscriptool.utils.FileCache which now uses the new logic to create the cache key based on the included resource so for the same set of resources the same cache key will always be generated regardless if the internal cache is enabled. I'm curious to know how the test is succeeding for you. I'm going to change the test to be assertTrue


Reply to this email directly or view it on GitHub: https://github.com/greenlaw110/greenscript/issues/43#issuecomment-4951118

tazmaniax commented 12 years ago

On a side note I had to remove many if not all of the @Override annotations because they were giving me a compile error in Eclipse on implemented interface methods. @Override is only supposed to be for when overring a superclass method and not for implementing interface methods. Must be a compile option configured by Eclipse but I couldn't find it in the preferences.

tazmaniax commented 12 years ago

so Maven install is working and all the necessary jar files are produced but how do I generate the Play! module? I can see this assembly-dist.xml which has all of the instructions but I don't know to kick that off? cheers

greenlaw110 commented 12 years ago

mvn package -Pdist

The module will be generated in the target folder.

On Wed, Apr 4, 2012 at 9:47 PM, tazmaniax < reply@reply.github.com

wrote:

so Maven install is working and all the necessary jar files are produced but how do I generate the Play! module? I can see this assembly-dist.xml which has all of the instructions but I don't know to kick that off? cheers


Reply to this email directly or view it on GitHub: https://github.com/greenlaw110/greenscript/issues/43#issuecomment-4951766

tazmaniax commented 12 years ago

The cache management is a bit confusing. There seems to be a both file cache and a memory cache both which can be configured independently and there are different places in the code which access these two caches in an inconsistent manner, e.g. GreenScriptPlugin.getInMemoryFileContent() always refers to the in-memory cache even if the minimizer was configured to have the in-memory disabled - not sure how that would work. Looks like it would more straight forward for a single cache implementation to be set on the Minimizer and that would be either a file or memory or whatever caching mechanism.

Anyway I started to try and unravel this a bit but got scared off so to address my immediate problem with Memcached I've come up with this minimal change:

  1. Add protected onClose() method to BufferResource that is called when the writer is closed.
  2. Updated GreenScriptPlugin.bufferLocator_.newBuffer(List resourceNames, String extension) to anonymously extend the BufferResource instance and define the onClose() method to do the Cache.set(...)

Now it looks like Memcached only serializes using toString() as that was the only part of BufferResource that was stored. As a result the return from the cache is a String which meant that I had to change IResourceLocator.locate(...) to return an Object rather than an IResource. This wasn't such a big deal as it's only called from GreenScriptPlugin.getInMemoryFileContent() which can deal with the return result as an Object - checks for existence and calls toString().

It's all a bit hacky but it works. So this is all working on my local dev machine and I'm not going to push to Heroku and see how it goes.

Running the app in development mode the CSS is minimized and stored in the cache with each request. Is this the same in production mode? Hopefully not.

tazmaniax commented 12 years ago

Hi Green,

Ignore the bit above about Memcached return a string version, that was my change. I've fixed it so it's back to returning an IResource (BufferResource)

Just sent you a pull request. All tested on Heroku (using a cluster of two dynos)

Running the app in development mode the CSS is minimized and stored in the cache with each request. Is this the same in production mode?

Something aside, when I start the application on Heroku, the first request returns this:

2012-04-05T09:36:36+00:00 app[web.1]: Apr 5, 2012 9:36:34 AM com.google.javascript.jscomp.LoggerErrorManager println
2012-04-05T09:36:36+00:00 app[web.1]: SEVERE: greenscript.js:35: ERROR - Parse error. Internet Explorer has a non-standard intepretation of trailing commas. Arrays will have the wrong length and objects will not parse at all.
2012-04-05T09:36:36+00:00 app[web.1]:               ]
2012-04-05T09:36:36+00:00 app[web.1]:                ^
2012-04-05T09:36:36+00:00 app[web.1]: 
2012-04-05T09:36:36+00:00 app[web.1]: Apr 5, 2012 9:36:36 AM com.google.javascript.jscomp.LoggerErrorManager printSummary
2012-04-05T09:36:36+00:00 app[web.1]: WARNING: 1 error(s), 0 warning(s)
greenlaw110 commented 12 years ago

Hi tazmaniax,

Thanks for your effort to solve this problem.

About "something aside", what is greenscript.js?

Green

On Thu, Apr 5, 2012 at 7:40 PM, tazmaniax < reply@reply.github.com

wrote:

Hi Green,

Ignore the bit above about Memcached return a string version, that was my change. I've fixed it so it's back to returning an IResource (BufferResource)

Just sent you a pull request. All tested on Heroku (using a cluster of two dynos)

Running the app in development mode the CSS is minimized and stored in the cache with each request. Is this the same in production mode?

Something aside, when I start the application on Heroku, the first request returns this:

2012-04-05T09:36:36+00:00 app[web.1]: Apr 5, 2012 9:36:34 AM
com.google.javascript.jscomp.LoggerErrorManager println
2012-04-05T09:36:36+00:00 app[web.1]: SEVERE: greenscript.js:35: ERROR -
Parse error. Internet Explorer has a non-standard intepretation of trailing
commas. Arrays will have the wrong length and objects will not parse at all.
2012-04-05T09:36:36+00:00 app[web.1]:                           ]
2012-04-05T09:36:36+00:00 app[web.1]:                            ^
2012-04-05T09:36:36+00:00 app[web.1]:
2012-04-05T09:36:36+00:00 app[web.1]: Apr 5, 2012 9:36:36 AM
com.google.javascript.jscomp.LoggerErrorManager printSummary
2012-04-05T09:36:36+00:00 app[web.1]: WARNING: 1 error(s), 0 warning(s)

Reply to this email directly or view it on GitHub: https://github.com/greenlaw110/greenscript/issues/43#issuecomment-4973442

tazmaniax commented 12 years ago

No idea, not part of our app. Very strange. I've seen it only recently.

fehmicansaglam commented 11 years ago

Hey @tazmaniax have you solved the Heroku problem? I am facing the same.