[JBoss JIRA] (SHRINKWRAP-496) Implement CacheUrlAsset
by Aslak Knutsen (JIRA)
[ https://issues.jboss.org/browse/SHRINKWRAP-496?page=com.atlassian.jira.pl... ]
Aslak Knutsen edited comment on SHRINKWRAP-496 at 11/30/15 6:17 PM:
--------------------------------------------------------------------
It could technically be implemented as a Handler, but I don't think we have any way to globally register a Handler. Or register it dynamically for that matter.
{code}
archive.addHandlers(new ArchiveEventHandler() {
public void handle(ArchiveEvent event) {
if(event.getAsset() instanceOf URLAsset) {
// lookup cache / cache content
event.setHandledAsset(new FileAsset(cachedFile));
}
}
})
{code}
was (Author: aslak):
It could technically be implemented as a Handler, but I don't think we have any way to globally register a Handler. Or register it dynamically for that matter.
{code}
archive.addHandlers(new ArchiveEventHandler() {
public void handle(ArchiveEvent event) {
if(event.getAsset() instanceOf URLAsset) {
// lookup cache / cache content
event.setHandledAsset(new FIleAsset(cachedFile));
}
}
})
{code}
> Implement CacheUrlAsset
> -----------------------
>
> Key: SHRINKWRAP-496
> URL: https://issues.jboss.org/browse/SHRINKWRAP-496
> Project: ShrinkWrap
> Issue Type: Feature Request
> Components: api
> Affects Versions: 1.2.3
> Reporter: Alex Soto
> Priority: Minor
>
> In ShrinkWrap UrlAsset downloaded an asset from a URL, which can be external and then it creates the Archive element with that info. The problem is that sometimes you might want to download a big file (2MB) to put inside an Archive, and this means that for each test class that you execute you end up by downloading this file.
> A possible solution could be create a CacheUrlAsset that downloads the content and stores it in {java.io.tmp}/shrinkwrap so in successive calls before downloading the file again, it can take it directly from cache directory.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 4 months
[JBoss JIRA] (SHRINKWRAP-496) Implement CacheUrlAsset
by Aslak Knutsen (JIRA)
[ https://issues.jboss.org/browse/SHRINKWRAP-496?page=com.atlassian.jira.pl... ]
Aslak Knutsen commented on SHRINKWRAP-496:
------------------------------------------
It could technically be implemented as a Handler, but I don't think we have any way to globally register a Handler. Or register it dynamically for that matter.
{code}
archive.addHandlers(new ArchiveEventHandler() {
public void handle(ArchiveEvent event) {
if(event.getAsset() instanceOf URLAsset) {
// lookup cache / cache content
event.setHandledAsset(new FIleAsset(cachedFile));
}
}
})
{code}
> Implement CacheUrlAsset
> -----------------------
>
> Key: SHRINKWRAP-496
> URL: https://issues.jboss.org/browse/SHRINKWRAP-496
> Project: ShrinkWrap
> Issue Type: Feature Request
> Components: api
> Affects Versions: 1.2.3
> Reporter: Alex Soto
> Priority: Minor
>
> In ShrinkWrap UrlAsset downloaded an asset from a URL, which can be external and then it creates the Archive element with that info. The problem is that sometimes you might want to download a big file (2MB) to put inside an Archive, and this means that for each test class that you execute you end up by downloading this file.
> A possible solution could be create a CacheUrlAsset that downloads the content and stores it in {java.io.tmp}/shrinkwrap so in successive calls before downloading the file again, it can take it directly from cache directory.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 4 months
[JBoss JIRA] (SHRINKWRAP-496) Implement CacheUrlAsset
by Karel Piwko (JIRA)
[ https://issues.jboss.org/browse/SHRINKWRAP-496?page=com.atlassian.jira.pl... ]
Karel Piwko commented on SHRINKWRAP-496:
----------------------------------------
My original plan was to have Arquillian Spacelift to be able to download and cache artifact in Maven repo. However, it was never implemented :-(. Maybe kindly asking [~mjobanek] would do the job :-).
I like [~alrubinger] comment about reproducibility. However, most of the testing assumes that the same holds for Maven, Gradle and such and these tools are also caching - but they have an option to force update. That said, it seems more reasonable to me to have such functionality not a part of SW but rather as an extension to it.
> Implement CacheUrlAsset
> -----------------------
>
> Key: SHRINKWRAP-496
> URL: https://issues.jboss.org/browse/SHRINKWRAP-496
> Project: ShrinkWrap
> Issue Type: Feature Request
> Components: api
> Affects Versions: 1.2.3
> Reporter: Alex Soto
> Priority: Minor
>
> In ShrinkWrap UrlAsset downloaded an asset from a URL, which can be external and then it creates the Archive element with that info. The problem is that sometimes you might want to download a big file (2MB) to put inside an Archive, and this means that for each test class that you execute you end up by downloading this file.
> A possible solution could be create a CacheUrlAsset that downloads the content and stores it in {java.io.tmp}/shrinkwrap so in successive calls before downloading the file again, it can take it directly from cache directory.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 5 months
[JBoss JIRA] (SHRINKDESC-164) BeansDescriptor.exportAsString() yields empty xmlns attributes in child elements when Saxon is present on classpath
by Ralf Battenfeld (JIRA)
[ https://issues.jboss.org/browse/SHRINKDESC-164?page=com.atlassian.jira.pl... ]
Ralf Battenfeld commented on SHRINKDESC-164:
--------------------------------------------
Ok, I can reproduce this but only if I add the saxon dependencies directly.
> BeansDescriptor.exportAsString() yields empty xmlns attributes in child elements when Saxon is present on classpath
> -------------------------------------------------------------------------------------------------------------------
>
> Key: SHRINKDESC-164
> URL: https://issues.jboss.org/browse/SHRINKDESC-164
> Project: ShrinkWrap Descriptors
> Issue Type: Bug
> Affects Versions: 2.0.0-alpha-7, 2.0.0-alpha-8
> Environment: Apache Maven 3.2.5 (12a6b3acb947671f09b81f49094c53f426d8cea1; 2014-12-14T18:29:23+01:00)
> Maven home: C:\Program Files\apache-maven-3.2.5
> Java version: 1.7.0_80, vendor: Oracle Corporation
> Java home: C:\Develop\CCS\jdk1.7.0_80\jre
> Default locale: de_DE, platform encoding: Cp1252
> OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows"
> Reporter: Falko M.
> Attachments: SHRINKDESC-164-screenshot1.PNG, SHRINKDESC-164-screenshot2.PNG, SHRINKDESC-164-testproject.zip
>
>
> When an existing {{beans.xml}} with child elements like {{alternatives}} is loaded via {{Descriptors.importAs(BeansDescriptor.class).fromStream(...)}} *and [SAXON|http://saxon.sourceforge.net/] is on the classpath*, {{.exportAsString()}} yields child elements like the following :
> {noformat}<alternatives xmlns="">{noformat}
> This causes deployment warning in JBoss7 like (truncated):
> {noformat}
> WARN [org.jboss.weld.deployer] JBAS016011: .../META-INF/beans.xml:5 cvc-complex-type.2.4.a: Invalid content was found starting with element 'alternatives'. One of '{"http://java.sun.com/xml/ns/javaee":interceptors, "http://java.sun.com/xml/ns/javaee":decorators, "http://java.sun.com/xml/ns/javaee":alternatives, WC[##other:"http://java.sun.com/xml/ns/javaee"]}' is expected.
> {noformat}
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 5 months
[JBoss JIRA] (SHRINKDESC-164) BeansDescriptor.exportAsString() yields empty xmlns attributes in child elements when Saxon is present on classpath
by Ralf Battenfeld (JIRA)
[ https://issues.jboss.org/browse/SHRINKDESC-164?page=com.atlassian.jira.pl... ]
Ralf Battenfeld commented on SHRINKDESC-164:
--------------------------------------------
Thanks a lot for the details. I am back from holidays and can work on this.
> BeansDescriptor.exportAsString() yields empty xmlns attributes in child elements when Saxon is present on classpath
> -------------------------------------------------------------------------------------------------------------------
>
> Key: SHRINKDESC-164
> URL: https://issues.jboss.org/browse/SHRINKDESC-164
> Project: ShrinkWrap Descriptors
> Issue Type: Bug
> Affects Versions: 2.0.0-alpha-7, 2.0.0-alpha-8
> Environment: Apache Maven 3.2.5 (12a6b3acb947671f09b81f49094c53f426d8cea1; 2014-12-14T18:29:23+01:00)
> Maven home: C:\Program Files\apache-maven-3.2.5
> Java version: 1.7.0_80, vendor: Oracle Corporation
> Java home: C:\Develop\CCS\jdk1.7.0_80\jre
> Default locale: de_DE, platform encoding: Cp1252
> OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows"
> Reporter: Falko M.
> Attachments: SHRINKDESC-164-screenshot1.PNG, SHRINKDESC-164-screenshot2.PNG, SHRINKDESC-164-testproject.zip
>
>
> When an existing {{beans.xml}} with child elements like {{alternatives}} is loaded via {{Descriptors.importAs(BeansDescriptor.class).fromStream(...)}} *and [SAXON|http://saxon.sourceforge.net/] is on the classpath*, {{.exportAsString()}} yields child elements like the following :
> {noformat}<alternatives xmlns="">{noformat}
> This causes deployment warning in JBoss7 like (truncated):
> {noformat}
> WARN [org.jboss.weld.deployer] JBAS016011: .../META-INF/beans.xml:5 cvc-complex-type.2.4.a: Invalid content was found starting with element 'alternatives'. One of '{"http://java.sun.com/xml/ns/javaee":interceptors, "http://java.sun.com/xml/ns/javaee":decorators, "http://java.sun.com/xml/ns/javaee":alternatives, WC[##other:"http://java.sun.com/xml/ns/javaee"]}' is expected.
> {noformat}
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 5 months
[JBoss JIRA] (SHRINKDESC-163) Deal with descriptors with multiple possible roots better
by Toby Crawley (JIRA)
[ https://issues.jboss.org/browse/SHRINKDESC-163?page=com.atlassian.jira.pl... ]
Toby Crawley commented on SHRINKDESC-163:
-----------------------------------------
Ralf: sorry for the late reply - the API that you demonstrate in the module-absent test works for me.
> Deal with descriptors with multiple possible roots better
> ---------------------------------------------------------
>
> Key: SHRINKDESC-163
> URL: https://issues.jboss.org/browse/SHRINKDESC-163
> Project: ShrinkWrap Descriptors
> Issue Type: Feature Request
> Affects Versions: 2.0.0-alpha-8
> Reporter: Toby Crawley
> Assignee: Ralf Battenfeld
>
> When implementing SHRINKDESC-162, I created three different
> descriptors for module.xml ({{ModuleDescriptor}},
> {{ModuleAliasDescriptor}}, {{ModuleAbsentDescriptor}}) corresponding to
> the three root elements listed in the xsd ({{module}}, {{module-alias}},
> {{module-absent}}). This works fine if you are generating a module.xml,
> but if you are loading in an existing file, you don't know without
> looking at the file contents to know which type to instantiate.
> It would be swell if there was a way for descriptors to support
> multiple roots and do the correct thing. Or does that already exist
> and I missed it?
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 5 months
[JBoss JIRA] (SHRINKDESC-164) BeansDescriptor.exportAsString() yields empty xmlns attributes in child elements when Saxon is present on classpath
by Falko M. (JIRA)
[ https://issues.jboss.org/browse/SHRINKDESC-164?page=com.atlassian.jira.pl... ]
Falko M. edited comment on SHRINKDESC-164 at 11/14/15 12:26 PM:
----------------------------------------------------------------
Please see the two attached console screenshots, I highlighted the relevant parts.
PS: This is the output I get with {{-PsaxonHE}}
was (Author: famod):
Please see the two attached console screenshots, I highlighted the relevant parts.
> BeansDescriptor.exportAsString() yields empty xmlns attributes in child elements when Saxon is present on classpath
> -------------------------------------------------------------------------------------------------------------------
>
> Key: SHRINKDESC-164
> URL: https://issues.jboss.org/browse/SHRINKDESC-164
> Project: ShrinkWrap Descriptors
> Issue Type: Bug
> Affects Versions: 2.0.0-alpha-7, 2.0.0-alpha-8
> Environment: Apache Maven 3.2.5 (12a6b3acb947671f09b81f49094c53f426d8cea1; 2014-12-14T18:29:23+01:00)
> Maven home: C:\Program Files\apache-maven-3.2.5
> Java version: 1.7.0_80, vendor: Oracle Corporation
> Java home: C:\Develop\CCS\jdk1.7.0_80\jre
> Default locale: de_DE, platform encoding: Cp1252
> OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows"
> Reporter: Falko M.
> Attachments: SHRINKDESC-164-screenshot1.PNG, SHRINKDESC-164-screenshot2.PNG, SHRINKDESC-164-testproject.zip
>
>
> When an existing {{beans.xml}} with child elements like {{alternatives}} is loaded via {{Descriptors.importAs(BeansDescriptor.class).fromStream(...)}} *and [SAXON|http://saxon.sourceforge.net/] is on the classpath*, {{.exportAsString()}} yields child elements like the following :
> {noformat}<alternatives xmlns="">{noformat}
> This causes deployment warning in JBoss7 like (truncated):
> {noformat}
> WARN [org.jboss.weld.deployer] JBAS016011: .../META-INF/beans.xml:5 cvc-complex-type.2.4.a: Invalid content was found starting with element 'alternatives'. One of '{"http://java.sun.com/xml/ns/javaee":interceptors, "http://java.sun.com/xml/ns/javaee":decorators, "http://java.sun.com/xml/ns/javaee":alternatives, WC[##other:"http://java.sun.com/xml/ns/javaee"]}' is expected.
> {noformat}
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 5 months
[JBoss JIRA] (SHRINKDESC-164) BeansDescriptor.exportAsString() yields empty xmlns attributes in child elements when Saxon is present on classpath
by Falko M. (JIRA)
[ https://issues.jboss.org/browse/SHRINKDESC-164?page=com.atlassian.jira.pl... ]
Falko M. edited comment on SHRINKDESC-164 at 11/14/15 12:25 PM:
----------------------------------------------------------------
Please see the two attached console screenshots, I highlighted the relevant parts.
was (Author: famod):
Please see the following console screenshots:
!SHRINKDESC-164-screenshot1.PNG|thumbnail!
> BeansDescriptor.exportAsString() yields empty xmlns attributes in child elements when Saxon is present on classpath
> -------------------------------------------------------------------------------------------------------------------
>
> Key: SHRINKDESC-164
> URL: https://issues.jboss.org/browse/SHRINKDESC-164
> Project: ShrinkWrap Descriptors
> Issue Type: Bug
> Affects Versions: 2.0.0-alpha-7, 2.0.0-alpha-8
> Environment: Apache Maven 3.2.5 (12a6b3acb947671f09b81f49094c53f426d8cea1; 2014-12-14T18:29:23+01:00)
> Maven home: C:\Program Files\apache-maven-3.2.5
> Java version: 1.7.0_80, vendor: Oracle Corporation
> Java home: C:\Develop\CCS\jdk1.7.0_80\jre
> Default locale: de_DE, platform encoding: Cp1252
> OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows"
> Reporter: Falko M.
> Attachments: SHRINKDESC-164-screenshot1.PNG, SHRINKDESC-164-screenshot2.PNG, SHRINKDESC-164-testproject.zip
>
>
> When an existing {{beans.xml}} with child elements like {{alternatives}} is loaded via {{Descriptors.importAs(BeansDescriptor.class).fromStream(...)}} *and [SAXON|http://saxon.sourceforge.net/] is on the classpath*, {{.exportAsString()}} yields child elements like the following :
> {noformat}<alternatives xmlns="">{noformat}
> This causes deployment warning in JBoss7 like (truncated):
> {noformat}
> WARN [org.jboss.weld.deployer] JBAS016011: .../META-INF/beans.xml:5 cvc-complex-type.2.4.a: Invalid content was found starting with element 'alternatives'. One of '{"http://java.sun.com/xml/ns/javaee":interceptors, "http://java.sun.com/xml/ns/javaee":decorators, "http://java.sun.com/xml/ns/javaee":alternatives, WC[##other:"http://java.sun.com/xml/ns/javaee"]}' is expected.
> {noformat}
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 5 months
[JBoss JIRA] (SHRINKDESC-164) BeansDescriptor.exportAsString() yields empty xmlns attributes in child elements when Saxon is present on classpath
by Falko M. (JIRA)
[ https://issues.jboss.org/browse/SHRINKDESC-164?page=com.atlassian.jira.pl... ]
Falko M. edited comment on SHRINKDESC-164 at 11/14/15 12:24 PM:
----------------------------------------------------------------
Please see the following console screenshots:
!SHRINKDESC-164-screenshot1.PNG|thumbnail!
was (Author: famod):
Please see the following console screenshots:
!SHRINKDESC-164-screenshot1.PNG!
!SHRINKDESC-164-screenshot2.PNG!
> BeansDescriptor.exportAsString() yields empty xmlns attributes in child elements when Saxon is present on classpath
> -------------------------------------------------------------------------------------------------------------------
>
> Key: SHRINKDESC-164
> URL: https://issues.jboss.org/browse/SHRINKDESC-164
> Project: ShrinkWrap Descriptors
> Issue Type: Bug
> Affects Versions: 2.0.0-alpha-7, 2.0.0-alpha-8
> Environment: Apache Maven 3.2.5 (12a6b3acb947671f09b81f49094c53f426d8cea1; 2014-12-14T18:29:23+01:00)
> Maven home: C:\Program Files\apache-maven-3.2.5
> Java version: 1.7.0_80, vendor: Oracle Corporation
> Java home: C:\Develop\CCS\jdk1.7.0_80\jre
> Default locale: de_DE, platform encoding: Cp1252
> OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows"
> Reporter: Falko M.
> Attachments: SHRINKDESC-164-screenshot1.PNG, SHRINKDESC-164-screenshot2.PNG, SHRINKDESC-164-testproject.zip
>
>
> When an existing {{beans.xml}} with child elements like {{alternatives}} is loaded via {{Descriptors.importAs(BeansDescriptor.class).fromStream(...)}} *and [SAXON|http://saxon.sourceforge.net/] is on the classpath*, {{.exportAsString()}} yields child elements like the following :
> {noformat}<alternatives xmlns="">{noformat}
> This causes deployment warning in JBoss7 like (truncated):
> {noformat}
> WARN [org.jboss.weld.deployer] JBAS016011: .../META-INF/beans.xml:5 cvc-complex-type.2.4.a: Invalid content was found starting with element 'alternatives'. One of '{"http://java.sun.com/xml/ns/javaee":interceptors, "http://java.sun.com/xml/ns/javaee":decorators, "http://java.sun.com/xml/ns/javaee":alternatives, WC[##other:"http://java.sun.com/xml/ns/javaee"]}' is expected.
> {noformat}
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 5 months
[JBoss JIRA] (SHRINKDESC-164) BeansDescriptor.exportAsString() yields empty xmlns attributes in child elements when Saxon is present on classpath
by Falko M. (JIRA)
[ https://issues.jboss.org/browse/SHRINKDESC-164?page=com.atlassian.jira.pl... ]
Falko M. updated SHRINKDESC-164:
--------------------------------
Attachment: SHRINKDESC-164-screenshot2.PNG
SHRINKDESC-164-screenshot1.PNG
Please see the following console screenshots:
!SHRINKDESC-164-screenshot1.PNG!
!SHRINKDESC-164-screenshot2.PNG!
> BeansDescriptor.exportAsString() yields empty xmlns attributes in child elements when Saxon is present on classpath
> -------------------------------------------------------------------------------------------------------------------
>
> Key: SHRINKDESC-164
> URL: https://issues.jboss.org/browse/SHRINKDESC-164
> Project: ShrinkWrap Descriptors
> Issue Type: Bug
> Affects Versions: 2.0.0-alpha-7, 2.0.0-alpha-8
> Environment: Apache Maven 3.2.5 (12a6b3acb947671f09b81f49094c53f426d8cea1; 2014-12-14T18:29:23+01:00)
> Maven home: C:\Program Files\apache-maven-3.2.5
> Java version: 1.7.0_80, vendor: Oracle Corporation
> Java home: C:\Develop\CCS\jdk1.7.0_80\jre
> Default locale: de_DE, platform encoding: Cp1252
> OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows"
> Reporter: Falko M.
> Attachments: SHRINKDESC-164-screenshot1.PNG, SHRINKDESC-164-screenshot2.PNG, SHRINKDESC-164-testproject.zip
>
>
> When an existing {{beans.xml}} with child elements like {{alternatives}} is loaded via {{Descriptors.importAs(BeansDescriptor.class).fromStream(...)}} *and [SAXON|http://saxon.sourceforge.net/] is on the classpath*, {{.exportAsString()}} yields child elements like the following :
> {noformat}<alternatives xmlns="">{noformat}
> This causes deployment warning in JBoss7 like (truncated):
> {noformat}
> WARN [org.jboss.weld.deployer] JBAS016011: .../META-INF/beans.xml:5 cvc-complex-type.2.4.a: Invalid content was found starting with element 'alternatives'. One of '{"http://java.sun.com/xml/ns/javaee":interceptors, "http://java.sun.com/xml/ns/javaee":decorators, "http://java.sun.com/xml/ns/javaee":alternatives, WC[##other:"http://java.sun.com/xml/ns/javaee"]}' is expected.
> {noformat}
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 5 months