ace-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1357570 [12/34] - in /ace/sandbox/marrs: cnf/ cnf/ext/ cnf/lib/ cnf/releaserepo/ cnf/repo/ cnf/repo/.obrcache/ cnf/repo/.obrcache/http%3A%2F%2Fbundles.bndtools.org.s3.amazonaws.com%2Fcom.jcraft.jsch/ cnf/repo/.obrcache/http%3A%2F%2Fbundles...
Date Thu, 05 Jul 2012 12:10:06 GMT
Added: ace/sandbox/marrs/org.apache.ace.client.repository.helper.base/test-output/old/index.html
URL: http://svn.apache.org/viewvc/ace/sandbox/marrs/org.apache.ace.client.repository.helper.base/test-output/old/index.html?rev=1357570&view=auto
==============================================================================
--- ace/sandbox/marrs/org.apache.ace.client.repository.helper.base/test-output/old/index.html (added)
+++ ace/sandbox/marrs/org.apache.ace.client.repository.helper.base/test-output/old/index.html Thu Jul  5 12:09:30 2012
@@ -0,0 +1,9 @@
+<html>
+<head><title>Test results</title><link href="./testng.css" rel="stylesheet" type="text/css" />
+<link href="./my-testng.css" rel="stylesheet" type="text/css" />
+</head><body>
+<h2><p align='center'>Test results</p></h2>
+<table border='1' width='100%' class='main-page'><tr><th>Suite</th><th>Passed</th><th>Failed</th><th>Skipped</th><th>testng.xml</th></tr>
+<tr align='center' class='invocation-passed'><td><em>Total</em></td><td><em>7</em></td><td><em>0</em></td><td><em>0</em></td><td>&nbsp;</td></tr>
+<tr align='center' class='invocation-passed'><td><a href='Default suite/index.html'>Default suite</a></td>
+<td>7</td><td>0</td><td>0</td><td><a href='Default suite/testng.xml.html'>Link</a></td></tr></table></body></html>

Added: ace/sandbox/marrs/org.apache.ace.client.repository.helper.base/test-output/passed.png
URL: http://svn.apache.org/viewvc/ace/sandbox/marrs/org.apache.ace.client.repository.helper.base/test-output/passed.png?rev=1357570&view=auto
==============================================================================
Binary file - no diff available.

Propchange: ace/sandbox/marrs/org.apache.ace.client.repository.helper.base/test-output/passed.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: ace/sandbox/marrs/org.apache.ace.client.repository.helper.base/test-output/skipped.png
URL: http://svn.apache.org/viewvc/ace/sandbox/marrs/org.apache.ace.client.repository.helper.base/test-output/skipped.png?rev=1357570&view=auto
==============================================================================
Binary file - no diff available.

Propchange: ace/sandbox/marrs/org.apache.ace.client.repository.helper.base/test-output/skipped.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: ace/sandbox/marrs/org.apache.ace.client.repository.helper.base/test-output/testng-reports.css
URL: http://svn.apache.org/viewvc/ace/sandbox/marrs/org.apache.ace.client.repository.helper.base/test-output/testng-reports.css?rev=1357570&view=auto
==============================================================================
--- ace/sandbox/marrs/org.apache.ace.client.repository.helper.base/test-output/testng-reports.css (added)
+++ ace/sandbox/marrs/org.apache.ace.client.repository.helper.base/test-output/testng-reports.css Thu Jul  5 12:09:30 2012
@@ -0,0 +1,302 @@
+body {
+    margin: 0px 0px 5px 5px;
+}
+
+ul {
+    margin: 0px;
+}
+
+li {
+    list-style-type: none;
+}
+
+a {
+    text-decoration: none;
+}
+
+a:hover {
+    text-decoration: underline;
+}
+
+.navigator-selected {
+    background: #ffa500;
+}
+
+.wrapper {
+    overflow: hidden;
+}
+
+.navigator-root {
+    margin-top: 60px;
+    float: left;
+    width: 400px;
+    height: 100%;
+    overflow-y: auto;
+}
+
+.main-panel-root {
+    margin-top: 60px;
+}
+
+.suite {
+    margin: 0px 10px 10px 0px;
+    background-color: #fff8dc;
+}
+
+.suite-name {
+    padding-left: 10px;
+    font-size: 25px;
+    font-family: Times;
+}
+
+.main-panel-header {
+    padding: 5px;
+    background-color: #9FB4D9; //afeeee;
+    font-family: monospace;
+    font-size: 18px;
+}
+
+.main-panel-content {
+    padding: 5px;
+    margin-bottom: 10px;
+    background-color: #DEE8FC; //d0ffff;
+}
+
+.rounded-window {
+    border-radius: 10px;
+    border-style: solid;
+    border-width: 1px;
+}
+
+.rounded-window-top {
+    border-top-right-radius: 10px 10px;
+    border-top-left-radius: 10px 10px;
+    border-style: solid;
+    border-width: 1px;
+}
+
+.light-rounded-window-top {
+    border-top-right-radius: 10px 10px;
+    border-top-left-radius: 10px 10px;
+}
+
+.rounded-window-bottom {
+    border-style: solid;
+    border-width: 0px 1px 1px 1px;
+    border-bottom-right-radius: 10px 10px;
+    border-bottom-left-radius: 10px 10px;
+}
+
+.method-name {
+    font-size: 12px;
+    font-family: monospace;
+}
+
+.method-content {
+    border-style: solid;
+    border-width: 0px 0px 1px 0px;
+    margin-bottom: 10;
+    padding-bottom: 5px;
+    width: 80%;
+}
+
+.parameters {
+    font-size: 14px;
+    font-family: monospace;
+}
+
+.stack-trace {
+    white-space: pre;
+    font-family: monospace;
+    font-size: 12px;
+    margin-top: 0px;
+    margin-left: 20px;
+}
+
+.testng-xml {
+    font-family: monospace;
+}
+
+.method-list-content {
+    margin-left: 10px;
+}
+
+.navigator-suite-content {
+    margin-left: 10px;
+    font: 12px 'Lucida Grande';
+}
+
+.suite-section-title {
+    margin-top: 10px;
+    width: 80%;
+    border-style: solid;
+    border-width: 1px 0px 0px 0px;
+    font-family: Times;
+    font-size: 18px;
+    font-weight: bold;
+}
+
+.suite-section-content {
+    list-style-image: url(bullet_point.png);
+}
+
+.top-banner-root {
+    position: fixed;
+    width: 100%;
+    padding: 5px;
+    margin: 0px 0px 5px 0px;
+    height: 45px;
+    background-color: #0066ff;
+    font-family: Times;
+    color: #fff;
+    text-align: center;
+}
+
+.top-banner-title-font {
+    font-size: 25px;
+}
+
+.test-name {
+    font-family: 'Lucida Grande';
+    font-size: 16px;
+}
+
+.suite-icon {
+    padding: 5px;
+    float: right;
+    height: 20;
+}
+
+.test-group {
+    font: 20px 'Lucida Grande';
+    margin: 5px 5px 10px 5px;
+    border-width: 0px 0px 1px 0px;
+    border-style: solid;
+    padding: 5px;
+}
+
+.test-group-name {
+    font-weight: bold;
+}
+
+.method-in-group {
+    font-size: 16px;
+    margin-left: 80px;
+}
+
+table.google-visualization-table-table {
+    width: 100%;
+}
+
+.reporter-method-name {
+    font-size: 14px;
+    font-family: monospace;
+}
+
+.reporter-method-output-div {
+    padding: 5px;
+    margin: 0px 0px 5px 20px;
+    font-size: 12px;
+    font-family: monospace;
+    border-width: 0px 0px 0px 1px;
+    border-style: solid;
+}
+
+.ignored-class-div {
+    font-size: 14px;
+    font-family: monospace;
+}
+
+.ignored-methods-div {
+    padding: 5px;
+    margin: 0px 0px 5px 20px;
+    font-size: 12px;
+    font-family: monospace;
+    border-width: 0px 0px 0px 1px;
+    border-style: solid;
+}
+
+.border-failed {
+    border-top-left-radius: 10px 10px;
+    border-bottom-left-radius: 10px 10px;
+    border-style: solid;
+    border-width: 0px 0px 0px 10px;
+    border-color: #f00;
+}
+
+.border-skipped {
+    border-top-left-radius: 10px 10px;
+    border-bottom-left-radius: 10px 10px;
+    border-style: solid;
+    border-width: 0px 0px 0px 10px;
+    border-color: #edc600;
+}
+
+.border-passed {
+    border-top-left-radius: 10px 10px;
+    border-bottom-left-radius: 10px 10px;
+    border-style: solid;
+    border-width: 0px 0px 0px 10px;
+    border-color: #19f52d;
+}
+
+.times-div {
+    text-align: center;
+    padding: 5px;
+}
+
+.suite-total-time {
+    font: 16px 'Lucida Grande';
+}
+
+.configuration-suite {
+    margin-left: 20px;
+}
+
+.configuration-test {
+    margin-left: 40px;
+}
+
+.configuration-class {
+    margin-left: 60px;
+}
+
+.configuration-method {
+    margin-left: 80px;
+}
+
+.test-method {
+    margin-left: 100px;
+}
+
+.chronological-class {
+    background-color: #0ccff;
+    border-style: solid;
+    border-width: 0px 0px 1px 1px;
+}
+
+.method-start {
+    float: right;
+}
+
+.chronological-class-name {
+    padding: 0px 0px 0px 5px;
+    color: #008;
+}
+
+.after, .before, .test-method {
+    font-family: monospace;
+    font-size: 14px;
+}
+
+.navigator-suite-header {
+    font-size: 22px;
+    margin: 0px 10px 5px 0px;
+    background-color: #deb887;
+    text-align: center;
+}
+
+.collapse-all-icon {
+    padding: 5px;
+    float: right;
+}

Added: ace/sandbox/marrs/org.apache.ace.client.repository.helper.base/test-output/testng-reports.js
URL: http://svn.apache.org/viewvc/ace/sandbox/marrs/org.apache.ace.client.repository.helper.base/test-output/testng-reports.js?rev=1357570&view=auto
==============================================================================
--- ace/sandbox/marrs/org.apache.ace.client.repository.helper.base/test-output/testng-reports.js (added)
+++ ace/sandbox/marrs/org.apache.ace.client.repository.helper.base/test-output/testng-reports.js Thu Jul  5 12:09:30 2012
@@ -0,0 +1,130 @@
+$(document).ready(function() {
+    $('a.navigator-link').click(function() {
+        // Extract the panel for this link
+        var panel = getPanelName($(this));
+
+        // Mark this link as currently selected
+        $('.navigator-link').parent().removeClass('navigator-selected');
+        $(this).parent().addClass('navigator-selected');
+
+        showPanel(panel);
+    });
+
+    installMethodHandlers('failed');
+    installMethodHandlers('skipped');
+    installMethodHandlers('passed', true); // hide passed methods by default
+
+    $('a.method').click(function() {
+        showMethod($(this));
+        return false;
+    });
+
+    // Hide all the panels and display the first one (do this last
+    // to make sure the click() will invoke the listeners)
+    $('.panel').hide();
+    $('.navigator-link').first().click();
+
+    // Collapse/expand the suites
+    $('a.collapse-all-link').click(function() {
+        var contents = $('.navigator-suite-content');
+        if (contents.css('display') == 'none') {
+            contents.show();
+        } else {
+            contents.hide();
+        }
+    });
+
+    // Keep the navigator div always visible
+    var $scrollingDiv = $(".navigator-root");
+    $(window).scroll(function() {
+        $scrollingDiv.css('height', $(window).height() - 65);
+        $scrollingDiv.stop()
+            .animate({"marginTop": ($(window).scrollTop() + 60) + "px"} );
+    });
+});
+
+// The handlers that take care of showing/hiding the methods
+function installMethodHandlers(name, hide) {
+    function getContent(t) {
+    return $('.method-list-content.' + name + "." + t.attr('panel-name'));
+    }
+
+    function getHideLink(t, name) {
+        var s = 'a.hide-methods.' + name + "." + t.attr('panel-name');
+        return $(s);
+    }
+
+    function getShowLink(t, name) {
+        return $('a.show-methods.' + name + "." + t.attr('panel-name'));
+    }
+
+    function getMethodPanelClassSel(element, name) {
+        var panelName = getPanelName(element);
+    var sel = '.' + panelName + "-class-" + name;
+        return $(sel);
+    }
+
+    $('a.hide-methods.' + name).click(function() {
+        var w = getContent($(this));
+        w.hide();
+        getHideLink($(this), name).hide();
+        getShowLink($(this), name).show();
+    getMethodPanelClassSel($(this), name).hide();
+    });
+
+    $('a.show-methods.' + name).click(function() {
+        var w = getContent($(this));
+        w.show();
+        getHideLink($(this), name).show();
+        getShowLink($(this), name).hide();
+    showPanel(getPanelName($(this)));
+    getMethodPanelClassSel($(this), name).show();
+    });
+
+    if (hide) {
+        $('a.hide-methods.' + name).click();
+    } else {
+        $('a.show-methods.' + name).click();
+    }
+}
+
+function getHashForMethod(element) {
+    return element.attr('hash-for-method');
+}
+
+function getPanelName(element) {
+    return element.attr('panel-name');
+}
+
+function showPanel(panelName) {
+    $('.panel').hide();
+    var panel = $('.panel[panel-name="' + panelName + '"]');
+    panel.show();
+}
+
+function showMethod(element) {
+    var hashTag = getHashForMethod(element);
+    var panelName = getPanelName(element);
+    showPanel(panelName);
+    var current = document.location.href;
+    var base = current.substring(0, current.indexOf('#'))
+    document.location.href = base + '#' + hashTag;
+    var newPosition = $(document).scrollTop() - 65;
+    $(document).scrollTop(newPosition);
+}
+
+function drawTable() {
+    for (var i = 0; i < suiteTableInitFunctions.length; i++) {
+        window[suiteTableInitFunctions[i]]();
+    }
+
+    for (var k in window.suiteTableData) {
+        var v = window.suiteTableData[k];
+        var div = v.tableDiv;
+        var data = v.tableData
+        var table = new google.visualization.Table(document.getElementById(div));
+        table.draw(data, {
+            showRowNumber : false
+        });
+    }
+}

Added: ace/sandbox/marrs/org.apache.ace.client.repository.helper.base/test-output/testng-results.xml
URL: http://svn.apache.org/viewvc/ace/sandbox/marrs/org.apache.ace.client.repository.helper.base/test-output/testng-results.xml?rev=1357570&view=auto
==============================================================================
--- ace/sandbox/marrs/org.apache.ace.client.repository.helper.base/test-output/testng-results.xml (added)
+++ ace/sandbox/marrs/org.apache.ace.client.repository.helper.base/test-output/testng-results.xml Thu Jul  5 12:09:30 2012
@@ -0,0 +1,80 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<testng-results skipped="0" failed="0" total="7" passed="7">
+  <reporter-output>
+  </reporter-output>
+  <suite name="Default suite" duration-ms="238" started-at="2012-07-04T23:13:36Z" finished-at="2012-07-04T23:13:37Z">
+    <groups>
+      <group name="unit">
+        <method signature="VelocityArtifactPreprocessorTest.testNeedsNewVersionChangedTemplateOk()[pri:0, instance:org.apache.ace.client.repository.helper.base.VelocityArtifactPreprocessorTest@64633e5e]" name="testNeedsNewVersionChangedTemplateOk" class="org.apache.ace.client.repository.helper.base.VelocityArtifactPreprocessorTest"/>
+        <method signature="VelocityArtifactPreprocessorTest.testNeedsNewVersionEmptyTemplateOk()[pri:0, instance:org.apache.ace.client.repository.helper.base.VelocityArtifactPreprocessorTest@64633e5e]" name="testNeedsNewVersionEmptyTemplateOk" class="org.apache.ace.client.repository.helper.base.VelocityArtifactPreprocessorTest"/>
+        <method signature="VelocityArtifactPreprocessorTest.testNeedsNewVersionNonExistingTemplateOk()[pri:0, instance:org.apache.ace.client.repository.helper.base.VelocityArtifactPreprocessorTest@64633e5e]" name="testNeedsNewVersionNonExistingTemplateOk" class="org.apache.ace.client.repository.helper.base.VelocityArtifactPreprocessorTest"/>
+        <method signature="VelocityArtifactPreprocessorTest.testNeedsNewVersionUnchangedTemplateOk()[pri:0, instance:org.apache.ace.client.repository.helper.base.VelocityArtifactPreprocessorTest@64633e5e]" name="testNeedsNewVersionUnchangedTemplateOk" class="org.apache.ace.client.repository.helper.base.VelocityArtifactPreprocessorTest"/>
+        <method signature="VelocityArtifactPreprocessorTest.testPreprocessExistingNoTemplateOk()[pri:0, instance:org.apache.ace.client.repository.helper.base.VelocityArtifactPreprocessorTest@64633e5e]" name="testPreprocessExistingNoTemplateOk" class="org.apache.ace.client.repository.helper.base.VelocityArtifactPreprocessorTest"/>
+        <method signature="VelocityArtifactPreprocessorTest.testPreprocessExistingRealTemplateOk()[pri:0, instance:org.apache.ace.client.repository.helper.base.VelocityArtifactPreprocessorTest@64633e5e]" name="testPreprocessExistingRealTemplateOk" class="org.apache.ace.client.repository.helper.base.VelocityArtifactPreprocessorTest"/>
+        <method signature="VelocityArtifactPreprocessorTest.testPreprocessNonExistingTemplateOk()[pri:0, instance:org.apache.ace.client.repository.helper.base.VelocityArtifactPreprocessorTest@64633e5e]" name="testPreprocessNonExistingTemplateOk" class="org.apache.ace.client.repository.helper.base.VelocityArtifactPreprocessorTest"/>
+      </group> <!-- unit -->
+    </groups>
+    <test name="Default test" duration-ms="238" started-at="2012-07-04T23:13:36Z" finished-at="2012-07-04T23:13:37Z">
+      <class name="org.apache.ace.client.repository.helper.base.VelocityArtifactPreprocessorTest">
+        <test-method status="PASS" signature="setUp()[pri:0, instance:org.apache.ace.client.repository.helper.base.VelocityArtifactPreprocessorTest@64633e5e]" name="setUp" is-config="true" duration-ms="7" started-at="2012-07-04T23:13:36Z" finished-at="2012-07-04T23:13:36Z">
+        </test-method> <!-- setUp -->
+        <test-method status="PASS" signature="testNeedsNewVersionChangedTemplateOk()[pri:0, instance:org.apache.ace.client.repository.helper.base.VelocityArtifactPreprocessorTest@64633e5e]" name="testNeedsNewVersionChangedTemplateOk" duration-ms="202" started-at="2012-07-04T23:13:36Z" finished-at="2012-07-04T23:13:37Z">
+        </test-method> <!-- testNeedsNewVersionChangedTemplateOk -->
+        <test-method status="PASS" signature="testNeedsNewVersionEmptyTemplateOk()[pri:0, instance:org.apache.ace.client.repository.helper.base.VelocityArtifactPreprocessorTest@64633e5e]" name="testNeedsNewVersionEmptyTemplateOk" duration-ms="1" started-at="2012-07-04T23:13:37Z" finished-at="2012-07-04T23:13:37Z">
+        </test-method> <!-- testNeedsNewVersionEmptyTemplateOk -->
+        <test-method status="PASS" signature="testNeedsNewVersionNonExistingTemplateOk()[pri:0, instance:org.apache.ace.client.repository.helper.base.VelocityArtifactPreprocessorTest@64633e5e]" name="testNeedsNewVersionNonExistingTemplateOk" duration-ms="1" started-at="2012-07-04T23:13:37Z" finished-at="2012-07-04T23:13:37Z">
+        </test-method> <!-- testNeedsNewVersionNonExistingTemplateOk -->
+        <test-method status="PASS" signature="testNeedsNewVersionUnchangedTemplateOk()[pri:0, instance:org.apache.ace.client.repository.helper.base.VelocityArtifactPreprocessorTest@64633e5e]" name="testNeedsNewVersionUnchangedTemplateOk" duration-ms="2" started-at="2012-07-04T23:13:37Z" finished-at="2012-07-04T23:13:37Z">
+        </test-method> <!-- testNeedsNewVersionUnchangedTemplateOk -->
+        <test-method status="PASS" signature="testPreprocessExistingNoTemplateOk()[pri:0, instance:org.apache.ace.client.repository.helper.base.VelocityArtifactPreprocessorTest@64633e5e]" name="testPreprocessExistingNoTemplateOk" duration-ms="2" started-at="2012-07-04T23:13:37Z" finished-at="2012-07-04T23:13:37Z">
+        </test-method> <!-- testPreprocessExistingNoTemplateOk -->
+        <test-method status="PASS" signature="testPreprocessExistingRealTemplateOk()[pri:0, instance:org.apache.ace.client.repository.helper.base.VelocityArtifactPreprocessorTest@64633e5e]" name="testPreprocessExistingRealTemplateOk" duration-ms="2" started-at="2012-07-04T23:13:37Z" finished-at="2012-07-04T23:13:37Z">
+        </test-method> <!-- testPreprocessExistingRealTemplateOk -->
+        <test-method status="PASS" signature="testPreprocessNonExistingTemplateOk()[pri:0, instance:org.apache.ace.client.repository.helper.base.VelocityArtifactPreprocessorTest@64633e5e]" name="testPreprocessNonExistingTemplateOk" duration-ms="1" started-at="2012-07-04T23:13:37Z" finished-at="2012-07-04T23:13:37Z">
+          <exception class="java.io.FileNotFoundException">
+            <message>
+              <![CDATA[/path/to/nowhere-1341436417162 (No such file or directory)]]>
+            </message>
+            <full-stacktrace>
+              <![CDATA[java.io.FileNotFoundException: /path/to/nowhere-1341436417162 (No such file or directory)
+	at java.io.FileInputStream.open(Native Method)
+	at java.io.FileInputStream.<init>(FileInputStream.java:120)
+	at java.io.FileInputStream.<init>(FileInputStream.java:79)
+	at sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:70)
+	at sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:161)
+	at org.apache.ace.client.repository.helper.base.VelocityArtifactPreprocessor.getBytesFromUrl(VelocityArtifactPreprocessor.java:274)
+	at org.apache.ace.client.repository.helper.base.VelocityArtifactPreprocessor.getArtifactAsBytes(VelocityArtifactPreprocessor.java:258)
+	at org.apache.ace.client.repository.helper.base.VelocityArtifactPreprocessor.preprocess(VelocityArtifactPreprocessor.java:116)
+	at org.apache.ace.client.repository.helper.base.VelocityArtifactPreprocessorTest.testPreprocessNonExistingTemplateOk(VelocityArtifactPreprocessorTest.java:164)
+	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.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:80)
+	at org.testng.internal.Invoker.invokeMethod(Invoker.java:702)
+	at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:894)
+	at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1219)
+	at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127)
+	at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
+	at org.testng.TestRunner.privateRun(TestRunner.java:767)
+	at org.testng.TestRunner.run(TestRunner.java:617)
+	at org.testng.SuiteRunner.runTest(SuiteRunner.java:334)
+	at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:329)
+	at org.testng.SuiteRunner.privateRun(SuiteRunner.java:291)
+	at org.testng.SuiteRunner.run(SuiteRunner.java:240)
+	at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:53)
+	at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:87)
+	at org.testng.TestNG.runSuitesSequentially(TestNG.java:1192)
+	at org.testng.TestNG.runSuitesLocally(TestNG.java:1117)
+	at org.testng.TestNG.run(TestNG.java:1025)
+	at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:109)
+	at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:202)
+	at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:173)
+]]>
+            </full-stacktrace>
+          </exception> <!-- java.io.FileNotFoundException -->
+        </test-method> <!-- testPreprocessNonExistingTemplateOk -->
+      </class> <!-- org.apache.ace.client.repository.helper.base.VelocityArtifactPreprocessorTest -->
+    </test> <!-- Default test -->
+  </suite> <!-- Default suite -->
+</testng-results>

Added: ace/sandbox/marrs/org.apache.ace.client.repository.helper.base/test-output/testng.css
URL: http://svn.apache.org/viewvc/ace/sandbox/marrs/org.apache.ace.client.repository.helper.base/test-output/testng.css?rev=1357570&view=auto
==============================================================================
--- ace/sandbox/marrs/org.apache.ace.client.repository.helper.base/test-output/testng.css (added)
+++ ace/sandbox/marrs/org.apache.ace.client.repository.helper.base/test-output/testng.css Thu Jul  5 12:09:30 2012
@@ -0,0 +1,9 @@
+.invocation-failed,  .test-failed  { background-color: #DD0000; }
+.invocation-percent, .test-percent { background-color: #006600; }
+.invocation-passed,  .test-passed  { background-color: #00AA00; }
+.invocation-skipped, .test-skipped { background-color: #CCCC00; }
+
+.main-page {
+  font-size: x-large;
+}
+

Added: ace/sandbox/marrs/org.apache.ace.client.repository.helper.base/test/org/apache/ace/client/repository/helper/base/VelocityArtifactPreprocessorTest.java
URL: http://svn.apache.org/viewvc/ace/sandbox/marrs/org.apache.ace.client.repository.helper.base/test/org/apache/ace/client/repository/helper/base/VelocityArtifactPreprocessorTest.java?rev=1357570&view=auto
==============================================================================
--- ace/sandbox/marrs/org.apache.ace.client.repository.helper.base/test/org/apache/ace/client/repository/helper/base/VelocityArtifactPreprocessorTest.java (added)
+++ ace/sandbox/marrs/org.apache.ace.client.repository.helper.base/test/org/apache/ace/client/repository/helper/base/VelocityArtifactPreprocessorTest.java Thu Jul  5 12:09:30 2012
@@ -0,0 +1,202 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.ace.client.repository.helper.base;
+
+import static org.apache.ace.test.utils.TestUtils.UNIT;
+
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.net.URL;
+import java.net.URLConnection;
+
+import org.apache.ace.client.repository.helper.PropertyResolver;
+import org.apache.ace.connectionfactory.ConnectionFactory;
+import org.osgi.service.useradmin.User;
+import org.testng.annotations.BeforeTest;
+import org.testng.annotations.Test;
+import static org.testng.Assert.*;
+
+/**
+ * Test cases for {@link VelocityArtifactPreprocessor}.
+ */
+public class VelocityArtifactPreprocessorTest {
+    
+    private static final String TARGET = "target";
+    private static final String VERSION1 = "1.0.0";
+    
+    private URL m_obrUrl;
+    private PropertyResolver m_resolver;
+    
+    @BeforeTest
+    public void setUp() throws Exception {
+        m_obrUrl = new URL("file://" + System.getProperty("java.io.tmpdir"));
+        
+        m_resolver = new PropertyResolver() {
+            public String get(String key) {
+                return "msg".equals(key) ? "Hello World!" : null;
+            }
+        };
+    }
+
+    /**
+     * Test case for {@link VelocityArtifactPreprocessor#needsNewVersion(String, PropertyResolver, String, String)}
+     */
+    @Test(groups = { UNIT })
+    public void testNeedsNewVersionChangedTemplateOk() throws Exception {
+        final VelocityArtifactPreprocessor vap = createProcessor();
+        
+        String url = createArtifact("Message: [$context.msg]");
+
+        // "upload" a new version...
+        vap.preprocess(url, m_resolver, TARGET, VERSION1, m_obrUrl);
+        
+        boolean result = vap.needsNewVersion(url, m_resolver, TARGET, VERSION1);
+        assertFalse(result); // no new version is needed...
+        
+        updateArtifact(url, "Another message: [$context.msg2]");
+        
+        result = vap.needsNewVersion(url, m_resolver, TARGET, VERSION1);
+        assertFalse(result); // no new version is needed; original artifact is cached indefinitely...
+    }
+
+    /**
+     * Test case for {@link VelocityArtifactPreprocessor#needsNewVersion(String, PropertyResolver, String, String)}
+     */
+    @Test(groups = { UNIT })
+    public void testNeedsNewVersionEmptyTemplateOk() throws Exception {
+        final VelocityArtifactPreprocessor vap = createProcessor();
+        
+        String url = createArtifact("");
+
+        // "upload" a new version...
+        vap.preprocess(url, m_resolver, TARGET, VERSION1, m_obrUrl);
+
+        boolean result = vap.needsNewVersion(url, m_resolver, TARGET, VERSION1);
+        assertFalse(result); // no new version is needed...
+    }
+
+    /**
+     * Test case for {@link VelocityArtifactPreprocessor#needsNewVersion(String, PropertyResolver, String, String)}
+     */
+    @Test(groups = { UNIT })
+    public void testNeedsNewVersionNonExistingTemplateOk() throws Exception {
+        final VelocityArtifactPreprocessor vap = createProcessor();
+        
+        // Should be something that really doesn't exist somehow...
+        String url = "file:///path/to/nowhere-" + System.currentTimeMillis();
+
+        boolean result = vap.needsNewVersion(url, m_resolver, TARGET, VERSION1);
+        assertTrue(result); // always true for non-existing templates...
+    }
+
+    /**
+     * Test case for {@link VelocityArtifactPreprocessor#needsNewVersion(String, PropertyResolver, String, String)}
+     */
+    @Test(groups = { UNIT })
+    public void testNeedsNewVersionUnchangedTemplateOk() throws Exception {
+        final VelocityArtifactPreprocessor vap = createProcessor();
+        
+        String url = createArtifact("Message: [$context.msg]");
+        
+        boolean result = vap.needsNewVersion(url, m_resolver, TARGET, VERSION1);
+        assertTrue(result); // nothing uploaded yet; new version is needed...
+
+        // "upload" a new version...
+        vap.preprocess(url, m_resolver, TARGET, VERSION1, m_obrUrl);
+
+        result = vap.needsNewVersion(url, m_resolver, TARGET, VERSION1);
+        assertFalse(result); // no new version is needed...
+    }
+
+    /**
+     * Test case for {@link VelocityArtifactPreprocessor#preprocess(String, PropertyResolver, String, String, java.net.URL)}
+     */
+    @Test(groups = { UNIT })
+    public void testPreprocessExistingNoTemplateOk() throws Exception {
+        String url = createArtifact("Message: [context.msg]");
+        
+        String newUrl = createProcessor().preprocess(url, m_resolver, TARGET, VERSION1, m_obrUrl);
+        assertNotNull(newUrl);
+        // Verify that it is *not* uploaded...
+        assertEquals(url, newUrl);
+    }
+
+    /**
+     * Test case for {@link VelocityArtifactPreprocessor#preprocess(String, PropertyResolver, String, String, java.net.URL)}
+     */
+    @Test(groups = { UNIT })
+    public void testPreprocessExistingRealTemplateOk() throws Exception {
+        String url = createArtifact("Message: [$context.msg]");
+        
+        String newUrl = createProcessor().preprocess(url, m_resolver, TARGET, VERSION1, m_obrUrl);
+        assertNotNull(newUrl);
+        // Verify that it is actually uploaded...
+        assertFalse(newUrl.equals(url));
+        // Verify that it is actually uploaded to our (fake) OBR...
+        assertTrue(newUrl.startsWith(m_obrUrl.toExternalForm()));
+    }
+
+    /**
+     * Test case for {@link VelocityArtifactPreprocessor#preprocess(String, PropertyResolver, String, String, java.net.URL)}
+     */
+    @Test(groups = { UNIT }, expectedExceptions = { IOException.class })
+    public void testPreprocessNonExistingTemplateOk() throws Exception {
+        // Should be something that really doesn't exist somehow...
+        String url = "file:///path/to/nowhere-" + System.currentTimeMillis();
+        
+        createProcessor().preprocess(url, m_resolver, TARGET, VERSION1, m_obrUrl);
+    }
+
+    private String createArtifact(String string) throws IOException {
+        File tmpFile = File.createTempFile("vap", "vm");
+        tmpFile.delete();
+        tmpFile.deleteOnExit();
+        
+        FileWriter writer = new FileWriter(tmpFile);
+        writer.write(string);
+        writer.flush();
+        writer.close();
+
+        return tmpFile.toURI().toURL().toExternalForm();
+    }
+
+    private VelocityArtifactPreprocessor createProcessor() {
+        return new VelocityArtifactPreprocessor(new ConnectionFactory() {
+            public URLConnection createConnection(URL url, User user) throws IOException {
+                return createConnection(url);
+            }
+
+            public URLConnection createConnection(URL url) throws IOException {
+                return url.openConnection();
+            }
+        });
+    }
+
+    private String updateArtifact(String url, String string) throws IOException {
+        URL uri = new URL(url);
+        
+        FileWriter writer = new FileWriter(uri.getFile());
+        writer.write(string);
+        writer.flush();
+        writer.close();
+
+        return url;
+    }
+}

Added: ace/sandbox/marrs/org.apache.ace.client.repository.helper.bundle/.classpath
URL: http://svn.apache.org/viewvc/ace/sandbox/marrs/org.apache.ace.client.repository.helper.bundle/.classpath?rev=1357570&view=auto
==============================================================================
--- ace/sandbox/marrs/org.apache.ace.client.repository.helper.bundle/.classpath (added)
+++ ace/sandbox/marrs/org.apache.ace.client.repository.helper.bundle/.classpath Thu Jul  5 12:09:30 2012
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="src" path="src"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+	<classpathentry kind="con" path="aQute.bnd.classpath.container"/>
+	<classpathentry kind="output" path="bin"/>
+</classpath>

Added: ace/sandbox/marrs/org.apache.ace.client.repository.helper.bundle/.project
URL: http://svn.apache.org/viewvc/ace/sandbox/marrs/org.apache.ace.client.repository.helper.bundle/.project?rev=1357570&view=auto
==============================================================================
--- ace/sandbox/marrs/org.apache.ace.client.repository.helper.bundle/.project (added)
+++ ace/sandbox/marrs/org.apache.ace.client.repository.helper.bundle/.project Thu Jul  5 12:09:30 2012
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>org.apache.ace.client.repository.helper.bundle</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>bndtools.core.bndbuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+		<nature>bndtools.core.bndnature</nature>
+	</natures>
+</projectDescription>

Added: ace/sandbox/marrs/org.apache.ace.client.repository.helper.bundle/bnd.bnd
URL: http://svn.apache.org/viewvc/ace/sandbox/marrs/org.apache.ace.client.repository.helper.bundle/bnd.bnd?rev=1357570&view=auto
==============================================================================
--- ace/sandbox/marrs/org.apache.ace.client.repository.helper.bundle/bnd.bnd (added)
+++ ace/sandbox/marrs/org.apache.ace.client.repository.helper.bundle/bnd.bnd Thu Jul  5 12:09:30 2012
@@ -0,0 +1,7 @@
+-buildpath: osgi.core,\
+	osgi.cmpn,\
+	org.apache.felix.dependencymanager,\
+	org.apache.ace.client.repository.api;version=latest
+Private-Package: org.apache.ace.client.repository.helper.bundle.impl,\
+	org.apache.ace.util
+Bundle-Activator: org.apache.ace.client.repository.helper.bundle.impl.Activator
\ No newline at end of file

Added: ace/sandbox/marrs/org.apache.ace.client.repository.helper.bundle/build.xml
URL: http://svn.apache.org/viewvc/ace/sandbox/marrs/org.apache.ace.client.repository.helper.bundle/build.xml?rev=1357570&view=auto
==============================================================================
--- ace/sandbox/marrs/org.apache.ace.client.repository.helper.bundle/build.xml (added)
+++ ace/sandbox/marrs/org.apache.ace.client.repository.helper.bundle/build.xml Thu Jul  5 12:09:30 2012
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project name="project" default="build"> 
+	<import file="../cnf/build.xml"/>
+</project>

Added: ace/sandbox/marrs/org.apache.ace.client.repository.helper.bundle/pom.xml
URL: http://svn.apache.org/viewvc/ace/sandbox/marrs/org.apache.ace.client.repository.helper.bundle/pom.xml?rev=1357570&view=auto
==============================================================================
--- ace/sandbox/marrs/org.apache.ace.client.repository.helper.bundle/pom.xml (added)
+++ ace/sandbox/marrs/org.apache.ace.client.repository.helper.bundle/pom.xml Thu Jul  5 12:09:30 2012
@@ -0,0 +1,77 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+    <!--
+
+        Licensed to the Apache Software Foundation (ASF) under one or more
+        contributor license agreements.  See the NOTICE file distributed with
+        this work for additional information regarding copyright ownership.
+        The ASF licenses this file to You under the Apache License, Version 2.0
+        (the "License"); you may not use this file except in compliance with
+        the License.  You may obtain a copy of the License at
+
+           http://www.apache.org/licenses/LICENSE-2.0
+
+        Unless required by applicable law or agreed to in writing, software
+        distributed under the License is distributed on an "AS IS" BASIS,
+        WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+        See the License for the specific language governing permissions and
+        limitations under the License.
+    -->
+
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>org.apache.ace</groupId>
+        <artifactId>ace-pom</artifactId>
+        <version>0.8.1-SNAPSHOT</version>
+        <relativePath>../pom/pom.xml</relativePath>
+    </parent>
+
+    <version>0.8.1-SNAPSHOT</version>
+    <artifactId>org.apache.ace.client.repository.helper.bundle</artifactId>
+    <packaging>bundle</packaging>
+
+    <name>Apache ACE :: Client :: Repository :: Helper :: Bundle</name>
+    <description>Artifact recognizer and helper for bundles.</description>
+
+    <scm>
+        <connection>scm:svn:http://svn.apache.org/repos/asf/ace/trunk/ace-client-repository-helper-bundle</connection>
+        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/ace/trunk/ace-client-repository-helper-bundle</developerConnection>
+        <url>http://svn.apache.org/repos/asf/ace/trunk/ace-client-repository-helper-bundle</url>
+    </scm>
+
+    <properties>
+        <import.package>
+            org.apache.ace.client.repository;version=${project.version},
+            org.apache.ace.client.repository.helper;version=${project.version},
+            org.apache.ace.client.repository.object;version=${project.version},
+            *
+        </import.package>
+        <private.package>
+            org.apache.ace.client.repository.helper.bundle.impl,
+            org.apache.ace.util
+        </private.package>
+        <bundle.activator>org.apache.ace.client.repository.helper.bundle.impl.Activator</bundle.activator>
+    </properties>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.ace</groupId>
+            <artifactId>org.apache.ace.client.repository.api</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.osgi</groupId>
+            <artifactId>org.osgi.core</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.osgi</groupId>
+            <artifactId>org.osgi.compendium</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.felix</groupId>
+            <artifactId>org.apache.felix.dependencymanager</artifactId>
+        </dependency>
+    </dependencies>
+
+</project>

Added: ace/sandbox/marrs/org.apache.ace.client.repository.helper.bundle/src/org/apache/ace/client/repository/helper/bundle/impl/Activator.java
URL: http://svn.apache.org/viewvc/ace/sandbox/marrs/org.apache.ace.client.repository.helper.bundle/src/org/apache/ace/client/repository/helper/bundle/impl/Activator.java?rev=1357570&view=auto
==============================================================================
--- ace/sandbox/marrs/org.apache.ace.client.repository.helper.bundle/src/org/apache/ace/client/repository/helper/bundle/impl/Activator.java (added)
+++ ace/sandbox/marrs/org.apache.ace.client.repository.helper.bundle/src/org/apache/ace/client/repository/helper/bundle/impl/Activator.java Thu Jul  5 12:09:30 2012
@@ -0,0 +1,57 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.ace.client.repository.helper.bundle.impl;
+
+import java.util.Dictionary;
+import java.util.Hashtable;
+
+import org.apache.ace.client.repository.helper.ArtifactHelper;
+import org.apache.ace.client.repository.helper.ArtifactRecognizer;
+import org.apache.ace.client.repository.helper.bundle.BundleHelper;
+import org.apache.ace.client.repository.object.ArtifactObject;
+import org.apache.felix.dm.DependencyActivatorBase;
+import org.apache.felix.dm.DependencyManager;
+import org.osgi.framework.BundleContext;
+
+/**
+ * Activator class for the Bundle ArtifactHelper.
+ */
+public class Activator extends DependencyActivatorBase {
+
+    @Override
+    public synchronized void init(BundleContext context, DependencyManager manager) throws Exception {
+        Dictionary<String, String> props = new Hashtable<String, String>();
+        props.put(ArtifactObject.KEY_MIMETYPE, BundleHelper.MIMETYPE);
+        BundleHelperImpl helperImpl = new BundleHelperImpl();
+        manager.add(createComponent()
+            .setInterface(ArtifactHelper.class.getName(), props)
+            .setImplementation(helperImpl));
+        manager.add(createComponent()
+            .setInterface(ArtifactRecognizer.class.getName(), null)
+            .setImplementation(helperImpl));
+        manager.add(createComponent()
+            .setInterface(BundleHelper.class.getName(), null)
+            .setImplementation(helperImpl));
+    }
+
+    @Override
+    public synchronized void destroy(BundleContext context, DependencyManager manager) throws Exception {
+        // Nothing to do
+    }
+}
\ No newline at end of file

Added: ace/sandbox/marrs/org.apache.ace.client.repository.helper.bundle/src/org/apache/ace/client/repository/helper/bundle/impl/BundleHelperImpl.java
URL: http://svn.apache.org/viewvc/ace/sandbox/marrs/org.apache.ace.client.repository.helper.bundle/src/org/apache/ace/client/repository/helper/bundle/impl/BundleHelperImpl.java?rev=1357570&view=auto
==============================================================================
--- ace/sandbox/marrs/org.apache.ace.client.repository.helper.bundle/src/org/apache/ace/client/repository/helper/bundle/impl/BundleHelperImpl.java (added)
+++ ace/sandbox/marrs/org.apache.ace.client.repository.helper.bundle/src/org/apache/ace/client/repository/helper/bundle/impl/BundleHelperImpl.java Thu Jul  5 12:09:30 2012
@@ -0,0 +1,282 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.ace.client.repository.helper.bundle.impl;
+
+import java.io.IOException;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.jar.Attributes;
+import java.util.jar.JarInputStream;
+import java.util.jar.Manifest;
+
+import org.apache.ace.client.repository.RepositoryUtil;
+import org.apache.ace.client.repository.helper.ArtifactHelper;
+import org.apache.ace.client.repository.helper.ArtifactPreprocessor;
+import org.apache.ace.client.repository.helper.ArtifactRecognizer;
+import org.apache.ace.client.repository.helper.ArtifactResource;
+import org.apache.ace.client.repository.helper.bundle.BundleHelper;
+import org.apache.ace.client.repository.object.ArtifactObject;
+import org.apache.ace.util.VersionRange;
+import org.osgi.framework.Version;
+
+/**
+ * BundleHelperImpl provides the Artifact Repository with Helper and Recognizer services.
+ */
+public class BundleHelperImpl implements ArtifactRecognizer, BundleHelper {
+    /** A custom <code>Comparator</code>, used to sort bundles in increasing version */
+    private static final Comparator <ArtifactObject> BUNDLE_COMPARATOR = new Comparator<ArtifactObject>() {
+        public int compare(ArtifactObject left, ArtifactObject right) {
+            Version vLeft = new Version(left.getAttribute(BundleHelper.KEY_VERSION));
+            Version vRight = new Version(right.getAttribute(BundleHelper.KEY_VERSION));
+            return vRight.compareTo(vLeft);
+        }
+    };
+
+    /*
+     * From ArtifactHelper
+     */
+    public boolean canUse(ArtifactObject object) {
+        if (object == null) {
+            return false;
+        }
+        return (object.getMimetype().equals(MIMETYPE));
+    }
+
+    public <TYPE extends ArtifactObject> String getAssociationFilter(TYPE obj, Map<String, String> properties) {
+        /*
+         * Creates an endpoint filter for an association. If there is a KEY_ASSOCIATION_VERSIONSTATEMENT, a filter
+         * will be created that matches exactly the given range.
+         */
+        if ((properties != null) && properties.containsKey(KEY_ASSOCIATION_VERSIONSTATEMENT)) {
+            String versions = properties.get(KEY_ASSOCIATION_VERSIONSTATEMENT);
+            VersionRange versionRange = null;
+            try {
+                versionRange = VersionRange.parse(versions);
+            }
+            catch (IllegalArgumentException iae) {
+                throw new IllegalArgumentException("version " + ((versions != null) ? versions + " " : "(null) ") + "cannot be parsed into a valid version range statement.");
+            }
+
+            StringBuilder bundleStatement = new StringBuilder("(&(" + KEY_SYMBOLICNAME + "=" + RepositoryUtil.escapeFilterValue(obj.getAttribute(KEY_SYMBOLICNAME)) + ")");
+
+            bundleStatement.append("(" + KEY_VERSION + ">=" + versionRange.getLow() + ")");
+            if (!versionRange.isLowInclusive()) {
+                bundleStatement.append("(!(" + KEY_VERSION + "=" + versionRange.getLow() + "))");
+            }
+
+            if (versionRange.getHigh() != null) {
+                bundleStatement.append("(" + KEY_VERSION + "<=" + versionRange.getHigh() + ")");
+                if (!versionRange.isHighInclusive()) {
+                    bundleStatement.append("(!(" + KEY_VERSION + "=" + versionRange.getHigh() + "))");
+                }
+            }
+
+            bundleStatement.append(")");
+
+            return bundleStatement.toString();
+        }
+        else
+        {
+            if (obj.getAttribute(KEY_VERSION) != null) {
+                return "(&(" + KEY_SYMBOLICNAME + "=" + RepositoryUtil.escapeFilterValue(obj.getAttribute(KEY_SYMBOLICNAME)) + ")(" + KEY_VERSION + "=" + RepositoryUtil.escapeFilterValue(obj.getAttribute(KEY_VERSION)) + "))";
+            }
+            else {
+                return "(&(" + KEY_SYMBOLICNAME + "=" + RepositoryUtil.escapeFilterValue(obj.getAttribute(KEY_SYMBOLICNAME)) + ")(!(" + KEY_VERSION + "=*)))";
+            }
+        }
+    }
+
+    public <TYPE extends ArtifactObject> int getCardinality(TYPE obj, Map<String, String> properties) {
+        /* Normally, all objects that match the filter given by the previous version should be part of the
+         * association. However, when a version statement has been given, only one should be used. */
+        if ((properties != null) && properties.containsKey(BundleHelper.KEY_ASSOCIATION_VERSIONSTATEMENT)) {
+            return 1;
+        }
+        else {
+            return Integer.MAX_VALUE;
+        }
+    }
+
+    public Comparator<ArtifactObject> getComparator() {
+        return BUNDLE_COMPARATOR;
+    }
+
+    public Map<String, String> checkAttributes(Map<String, String> attributes) {
+        return normalizeVersion(attributes);
+    }
+
+    /**
+     * For the filter to work correctly, we need to make sure the version statement is an
+     * OSGi version.
+     */
+    private static Map<String, String> normalizeVersion(Map<String, String> input) {
+        String version = input.get(KEY_VERSION);
+        if (version != null) {
+            try {
+                Version theVersion = new Version(version);
+                input.put(KEY_VERSION, theVersion.toString());
+            }
+            catch (IllegalArgumentException iae) {
+                throw new IllegalArgumentException("The version statement in the bundle cannot be parsed to a valid version.", iae);
+            }
+        }
+
+        return input;
+    }
+
+    /*
+     * From BundleHelper
+     */
+    public String[] getDefiningKeys() {
+        return new String[] {KEY_SYMBOLICNAME, KEY_VERSION};
+    }
+
+    public String[] getMandatoryAttributes() {
+        return new String[] {KEY_SYMBOLICNAME};
+    }
+
+    public String getResourceProcessorPIDs(ArtifactObject object) {
+        ensureBundle(object);
+        return object.getAttribute(KEY_RESOURCE_PROCESSOR_PID);
+    }
+
+    public String getSymbolicName(ArtifactObject object) {
+        ensureBundle(object);
+        return object.getAttribute(KEY_SYMBOLICNAME);
+    }
+
+    public String getName(ArtifactObject object) {
+        ensureBundle(object);
+        return object.getAttribute(KEY_NAME);
+    }
+
+    public String getVersion(ArtifactObject object) {
+        ensureBundle(object);
+        return object.getAttribute(KEY_VERSION);
+    }
+
+    public String getVendor(ArtifactObject object) {
+        ensureBundle(object);
+        return object.getAttribute(KEY_VENDOR);
+    }
+
+    public boolean isResourceProcessor(ArtifactObject object) {
+        ensureBundle(object);
+        return object.getAttribute(KEY_RESOURCE_PROCESSOR_PID) != null;
+    }
+
+    private void ensureBundle(ArtifactObject object) {
+        if ((object == null) || !object.getMimetype().equals(MIMETYPE)) {
+            throw new IllegalArgumentException("This ArtifactObject cannot be handled by a BundleHelper.");
+        }
+    }
+
+    /*
+     * From ArtifactRecognizer
+     */
+    public boolean canHandle(String mimetype) {
+        return MIMETYPE.equals(mimetype);
+    }
+
+    public Map<String, String> extractMetaData(ArtifactResource artifact) throws IllegalArgumentException {
+        /*
+         * Opens the URL as a Jar input stream, gets the manifest, and extracts headers from there.
+         */
+        JarInputStream jis = null;
+        try {
+            jis = new JarInputStream(artifact.openStream());
+
+            Attributes manifestAttributes = jis.getManifest().getMainAttributes();
+            Map<String, String> result = new HashMap<String, String>();
+
+            for (String key : new String[] {KEY_NAME, KEY_SYMBOLICNAME, KEY_VERSION, KEY_VENDOR, KEY_RESOURCE_PROCESSOR_PID}) {
+                String value = manifestAttributes.getValue(key);
+                if (value != null) {
+                    result.put(key, value);
+                }
+            }
+
+            if (result.get(KEY_VERSION) == null) {
+                result.put(KEY_VERSION, "0.0.0");
+            }
+
+            result.put(ArtifactHelper.KEY_MIMETYPE, MIMETYPE);
+            result.put(ArtifactObject.KEY_PROCESSOR_PID, "");
+            String name = manifestAttributes.getValue(KEY_NAME);
+            String version = manifestAttributes.getValue(KEY_VERSION);
+            if (name == null) {
+                name = manifestAttributes.getValue(KEY_SYMBOLICNAME);
+            }
+            result.put(ArtifactObject.KEY_ARTIFACT_NAME, name + (version == null ? "" : "-" + version));
+
+            return result;
+        }
+        catch (Exception e) {
+            throw new IllegalArgumentException("Error extracting metadata from artifact.", e);
+        }
+        finally {
+            try {
+                jis.close();
+            }
+            catch (IOException e) {
+                // Too bad.
+            }
+        }
+    }
+
+    public String recognize(ArtifactResource artifact) {
+        /*
+         * Tries to find out whether this artifact is a bundle by (a) trying to open it as a
+         * jar, (b) trying to extract the manifest, and (c) checking whether that manifest
+         * contains a Bundle-SymbolicName header.
+         */
+        JarInputStream jis = null;
+        try {
+            jis = new JarInputStream(artifact.openStream());
+
+            Manifest manifest = jis.getManifest();
+
+            Attributes mainAttributes = manifest.getMainAttributes();
+            if (mainAttributes.getValue(KEY_SYMBOLICNAME) != null) {
+                return MIMETYPE;
+            }
+        }
+        catch (Exception e) {
+            return null;
+        }
+        finally {
+            try {
+                jis.close();
+            }
+            catch (Exception e) {
+                // Too bad.
+            }
+        }
+        return null;
+    }
+
+    public ArtifactPreprocessor getPreprocessor() {
+        return null;
+    }
+    
+    public String getExtension(ArtifactResource artifact) {
+        return ".jar";
+    }
+}
\ No newline at end of file

Added: ace/sandbox/marrs/org.apache.ace.client.repository.helper.configuration/.classpath
URL: http://svn.apache.org/viewvc/ace/sandbox/marrs/org.apache.ace.client.repository.helper.configuration/.classpath?rev=1357570&view=auto
==============================================================================
--- ace/sandbox/marrs/org.apache.ace.client.repository.helper.configuration/.classpath (added)
+++ ace/sandbox/marrs/org.apache.ace.client.repository.helper.configuration/.classpath Thu Jul  5 12:09:30 2012
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="src" path="src"/>
+	<classpathentry kind="src" output="bin_test" path="test"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+	<classpathentry kind="con" path="org.testng.TESTNG_CONTAINER"/>
+	<classpathentry kind="con" path="aQute.bnd.classpath.container"/>
+	<classpathentry kind="output" path="bin"/>
+</classpath>

Added: ace/sandbox/marrs/org.apache.ace.client.repository.helper.configuration/.project
URL: http://svn.apache.org/viewvc/ace/sandbox/marrs/org.apache.ace.client.repository.helper.configuration/.project?rev=1357570&view=auto
==============================================================================
--- ace/sandbox/marrs/org.apache.ace.client.repository.helper.configuration/.project (added)
+++ ace/sandbox/marrs/org.apache.ace.client.repository.helper.configuration/.project Thu Jul  5 12:09:30 2012
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>org.apache.ace.client.repository.helper.configuration</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>bndtools.core.bndbuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+		<nature>bndtools.core.bndnature</nature>
+	</natures>
+</projectDescription>

Added: ace/sandbox/marrs/org.apache.ace.client.repository.helper.configuration/bnd.bnd
URL: http://svn.apache.org/viewvc/ace/sandbox/marrs/org.apache.ace.client.repository.helper.configuration/bnd.bnd?rev=1357570&view=auto
==============================================================================
--- ace/sandbox/marrs/org.apache.ace.client.repository.helper.configuration/bnd.bnd (added)
+++ ace/sandbox/marrs/org.apache.ace.client.repository.helper.configuration/bnd.bnd Thu Jul  5 12:09:30 2012
@@ -0,0 +1,10 @@
+-buildpath: org.apache.ace.client.repository.api;version=latest,\
+	org.apache.ace.client.repository.helper.base;version=latest,\
+	org.apache.ace.connectionfactory;version=latest,\
+	osgi.core,\
+	osgi.cmpn,\
+	org.apache.felix.dependencymanager
+Private-Package: org.apache.ace.client.repository.helper.configuration.impl
+Bundle-Activator: org.apache.ace.client.repository.helper.configuration.impl.Activator
+Export-Package: org.apache.ace.client.repository.helper.configuration
+Deployment-ProvidesResourceProcessor: org.osgi.deployment.rp.autoconf

Added: ace/sandbox/marrs/org.apache.ace.client.repository.helper.configuration/build.xml
URL: http://svn.apache.org/viewvc/ace/sandbox/marrs/org.apache.ace.client.repository.helper.configuration/build.xml?rev=1357570&view=auto
==============================================================================
--- ace/sandbox/marrs/org.apache.ace.client.repository.helper.configuration/build.xml (added)
+++ ace/sandbox/marrs/org.apache.ace.client.repository.helper.configuration/build.xml Thu Jul  5 12:09:30 2012
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project name="project" default="build"> 
+	<import file="../cnf/build.xml"/>
+</project>

Added: ace/sandbox/marrs/org.apache.ace.client.repository.helper.configuration/pom.xml
URL: http://svn.apache.org/viewvc/ace/sandbox/marrs/org.apache.ace.client.repository.helper.configuration/pom.xml?rev=1357570&view=auto
==============================================================================
--- ace/sandbox/marrs/org.apache.ace.client.repository.helper.configuration/pom.xml (added)
+++ ace/sandbox/marrs/org.apache.ace.client.repository.helper.configuration/pom.xml Thu Jul  5 12:09:30 2012
@@ -0,0 +1,91 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+    <!--
+
+        Licensed to the Apache Software Foundation (ASF) under one or more
+        contributor license agreements.  See the NOTICE file distributed with
+        this work for additional information regarding copyright ownership.
+        The ASF licenses this file to You under the Apache License, Version 2.0
+        (the "License"); you may not use this file except in compliance with
+        the License.  You may obtain a copy of the License at
+
+           http://www.apache.org/licenses/LICENSE-2.0
+
+        Unless required by applicable law or agreed to in writing, software
+        distributed under the License is distributed on an "AS IS" BASIS,
+        WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+        See the License for the specific language governing permissions and
+        limitations under the License.
+    -->
+
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>org.apache.ace</groupId>
+        <artifactId>ace-pom</artifactId>
+        <version>0.8.1-SNAPSHOT</version>
+        <relativePath>../pom/pom.xml</relativePath>
+    </parent>
+
+    <version>0.8.1-SNAPSHOT</version>
+    <artifactId>org.apache.ace.client.repository.helper.configuration</artifactId>
+    <packaging>bundle</packaging>
+
+    <name>Apache ACE :: Client :: Repository :: Helper :: Configuration</name>
+    <description>Artifact recognizer and helper for metatype compliant AutoConf configuration files.</description>
+
+    <scm>
+        <connection>scm:svn:http://svn.apache.org/repos/asf/ace/trunk/ace-client-repository-helper-configuration</connection>
+        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/ace/trunk/ace-client-repository-helper-configuration</developerConnection>
+        <url>http://svn.apache.org/repos/asf/ace/trunk/ace-client-repository-helper-configuration</url>
+    </scm>
+
+    <properties>
+        <bundle.activator>org.apache.ace.client.repository.helper.configuration.impl.Activator</bundle.activator>
+        <export.package>
+            org.apache.ace.client.repository.helper.configuration;version=${project.version}
+        </export.package>
+        <import.package>
+            !org.apache.ace.client.repository.helper.configuration,
+            org.apache.ace.client.repository.helper;version=${project.version},
+            org.apache.ace.client.repository.helper.base;version=${project.version},
+            org.apache.ace.client.repository.object;version=${project.version},
+            *
+        </import.package>
+        <private.package>
+            org.apache.ace.client.repository.helper.configuration.impl
+        </private.package>
+        <deployment.providesresourceprocessor>
+            org.osgi.deployment.rp.autoconf
+        </deployment.providesresourceprocessor>
+    </properties>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.ace</groupId>
+            <artifactId>org.apache.ace.client.repository.api</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.ace</groupId>
+            <artifactId>org.apache.ace.client.repository.helper.base</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.ace</groupId>
+            <artifactId>org.apache.ace.connectionfactory</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.osgi</groupId>
+            <artifactId>org.osgi.core</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.osgi</groupId>
+            <artifactId>org.osgi.compendium</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.felix</groupId>
+            <artifactId>org.apache.felix.dependencymanager</artifactId>
+        </dependency>
+    </dependencies>
+
+</project>

Added: ace/sandbox/marrs/org.apache.ace.client.repository.helper.configuration/src/org/apache/ace/client/repository/helper/configuration/ConfigurationHelper.java
URL: http://svn.apache.org/viewvc/ace/sandbox/marrs/org.apache.ace.client.repository.helper.configuration/src/org/apache/ace/client/repository/helper/configuration/ConfigurationHelper.java?rev=1357570&view=auto
==============================================================================
--- ace/sandbox/marrs/org.apache.ace.client.repository.helper.configuration/src/org/apache/ace/client/repository/helper/configuration/ConfigurationHelper.java (added)
+++ ace/sandbox/marrs/org.apache.ace.client.repository.helper.configuration/src/org/apache/ace/client/repository/helper/configuration/ConfigurationHelper.java Thu Jul  5 12:09:30 2012
@@ -0,0 +1,30 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.ace.client.repository.helper.configuration;
+
+import org.apache.ace.client.repository.helper.ArtifactHelper;
+
+/**
+ * Definitions for ConfigurationHelper,used to treat an artifact as an AutoConf file.
+ */
+public interface ConfigurationHelper extends ArtifactHelper {
+    public static final String KEY_FILENAME = "filename";
+    public static final String MIMETYPE = "application/xml:osgi-autoconf";
+    public static final String PROCESSOR = "org.osgi.deployment.rp.autoconf";
+}
\ No newline at end of file

Added: ace/sandbox/marrs/org.apache.ace.client.repository.helper.configuration/src/org/apache/ace/client/repository/helper/configuration/impl/Activator.java
URL: http://svn.apache.org/viewvc/ace/sandbox/marrs/org.apache.ace.client.repository.helper.configuration/src/org/apache/ace/client/repository/helper/configuration/impl/Activator.java?rev=1357570&view=auto
==============================================================================
--- ace/sandbox/marrs/org.apache.ace.client.repository.helper.configuration/src/org/apache/ace/client/repository/helper/configuration/impl/Activator.java (added)
+++ ace/sandbox/marrs/org.apache.ace.client.repository.helper.configuration/src/org/apache/ace/client/repository/helper/configuration/impl/Activator.java Thu Jul  5 12:09:30 2012
@@ -0,0 +1,57 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.ace.client.repository.helper.configuration.impl;
+
+import java.util.Dictionary;
+import java.util.Hashtable;
+
+import org.apache.ace.client.repository.helper.ArtifactHelper;
+import org.apache.ace.client.repository.helper.ArtifactRecognizer;
+import org.apache.ace.client.repository.helper.configuration.ConfigurationHelper;
+import org.apache.ace.client.repository.object.ArtifactObject;
+import org.apache.ace.connectionfactory.ConnectionFactory;
+import org.apache.felix.dm.DependencyActivatorBase;
+import org.apache.felix.dm.DependencyManager;
+import org.osgi.framework.BundleContext;
+
+/**
+ * Activator class for the Configuration ArtifactHelper.
+ */
+public class Activator extends DependencyActivatorBase {
+
+    @Override
+    public synchronized void init(BundleContext context, DependencyManager manager) throws Exception {
+        Dictionary<String, String> props = new Hashtable<String, String>();
+        props.put(ArtifactObject.KEY_MIMETYPE, ConfigurationHelper.MIMETYPE);
+
+        ConfigurationHelperImpl helperImpl = new ConfigurationHelperImpl();
+        manager.add(createComponent()
+            .setInterface(new String[] { ArtifactHelper.class.getName(), ArtifactRecognizer.class.getName() }, props)
+            .setImplementation(helperImpl)
+            .add(createServiceDependency()
+                .setService(ConnectionFactory.class)
+                .setRequired(true))
+            );
+    }
+
+    @Override
+    public synchronized void destroy(BundleContext context, DependencyManager manager) throws Exception {
+        // Nothing to do
+    }
+}
\ No newline at end of file

Added: ace/sandbox/marrs/org.apache.ace.client.repository.helper.configuration/src/org/apache/ace/client/repository/helper/configuration/impl/ConfigurationHelperImpl.java
URL: http://svn.apache.org/viewvc/ace/sandbox/marrs/org.apache.ace.client.repository.helper.configuration/src/org/apache/ace/client/repository/helper/configuration/impl/ConfigurationHelperImpl.java?rev=1357570&view=auto
==============================================================================
--- ace/sandbox/marrs/org.apache.ace.client.repository.helper.configuration/src/org/apache/ace/client/repository/helper/configuration/impl/ConfigurationHelperImpl.java (added)
+++ ace/sandbox/marrs/org.apache.ace.client.repository.helper.configuration/src/org/apache/ace/client/repository/helper/configuration/impl/ConfigurationHelperImpl.java Thu Jul  5 12:09:30 2012
@@ -0,0 +1,189 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.ace.client.repository.helper.configuration.impl;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+
+import org.apache.ace.client.repository.helper.ArtifactPreprocessor;
+import org.apache.ace.client.repository.helper.ArtifactRecognizer;
+import org.apache.ace.client.repository.helper.ArtifactResource;
+import org.apache.ace.client.repository.helper.base.VelocityArtifactPreprocessor;
+import org.apache.ace.client.repository.helper.configuration.ConfigurationHelper;
+import org.apache.ace.client.repository.object.ArtifactObject;
+import org.apache.ace.connectionfactory.ConnectionFactory;
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXException;
+import org.xml.sax.helpers.DefaultHandler;
+
+public class ConfigurationHelperImpl implements ArtifactRecognizer, ConfigurationHelper {
+
+    // known valid metatype namespaces
+    private static final String NAMESPACE_1_0 = "http://www.osgi.org/xmlns/metatype/v1.0.0";
+    private static final String NAMESPACE_1_1 = "http://www.osgi.org/xmlns/metatype/v1.1.0";
+    private static final String NAMESPACE_1_2 = "http://www.osgi.org/xmlns/metatype/v1.2.0";
+
+    private final SAXParserFactory m_saxParserFactory;
+
+    // Injected by Dependency Manager
+    private volatile ConnectionFactory m_connectionFactory;
+    // Created in #start()
+    private volatile VelocityArtifactPreprocessor m_artifactPreprocessor;
+
+    public ConfigurationHelperImpl() {
+        m_saxParserFactory = SAXParserFactory.newInstance();
+        m_saxParserFactory.setNamespaceAware(false);
+        m_saxParserFactory.setValidating(false);
+    }
+    
+    public boolean canHandle(String mimetype) {
+        return MIMETYPE.equals(mimetype);
+    }
+
+    public Map<String, String> extractMetaData(ArtifactResource artifact) throws IllegalArgumentException {
+        Map<String, String> result = new HashMap<String, String>();
+        result.put(ArtifactObject.KEY_PROCESSOR_PID, PROCESSOR);
+        result.put(ArtifactObject.KEY_MIMETYPE, MIMETYPE);
+        String name = new File(artifact.getURL().getFile()).getName();
+        String key = KEY_FILENAME + "-";
+        int idx = name.indexOf(key);
+        if (idx > -1) {
+            int endIdx = name.indexOf("-", idx + key.length());
+            name = name.substring(idx + key.length(), (endIdx > -1) ? endIdx : (name.length() - getExtension(artifact).length()));
+        }
+        result.put(ArtifactObject.KEY_ARTIFACT_NAME, name);
+        result.put(KEY_FILENAME, name);
+        return result;
+    }
+
+    public String recognize(ArtifactResource artifact) {
+        MetaDataNamespaceCollector handler = new MetaDataNamespaceCollector();
+        InputStream input = null;
+        try {
+            input = artifact.openStream();
+            SAXParser parser = m_saxParserFactory.newSAXParser();
+            parser.parse(input, handler);
+        }
+        catch (Exception e) {
+            String namespace = handler.getMetaDataNamespace();
+            if (namespace != null
+                && (namespace.equals(NAMESPACE_1_0)
+                    || namespace.equals(NAMESPACE_1_1)
+                    || namespace.equals(NAMESPACE_1_2))) {
+                return MIMETYPE;
+            }
+        }
+        finally {
+            if (input != null) {
+                try {
+                    input.close();
+                }
+                catch (IOException e) {}
+            }
+        }
+        return null;
+    }
+
+    public boolean canUse(ArtifactObject object) {
+        return MIMETYPE.equals(object.getMimetype());
+    }
+
+    public Map<String, String> checkAttributes(Map<String, String> attributes) {
+        // All necessary checks will be done by the constructor using getMandatoryAttributes.
+        return attributes;
+    }
+
+    public <TYPE extends ArtifactObject> String getAssociationFilter(TYPE obj, Map<String, String> properties) {
+        return "(" + KEY_FILENAME + "=" + obj.getAttribute(KEY_FILENAME) + ")";
+    }
+
+    public <TYPE extends ArtifactObject> int getCardinality(TYPE obj, Map<String, String> properties) {
+        return Integer.MAX_VALUE;
+    }
+
+    public Comparator<ArtifactObject> getComparator() {
+        return null;
+    }
+
+    public String[] getDefiningKeys() {
+        return new String[] {KEY_FILENAME};
+    }
+
+    public String[] getMandatoryAttributes() {
+        return new String[] {KEY_FILENAME};
+    }
+
+    public ArtifactPreprocessor getPreprocessor() {
+        return m_artifactPreprocessor;
+    }
+    
+    public String getExtension(ArtifactResource artifact) {
+        return ".xml";
+    }
+
+    /**
+     * Called by dependency manager upon start of this component.
+     */
+    protected void start() {
+        m_artifactPreprocessor = new VelocityArtifactPreprocessor(m_connectionFactory);
+    }
+
+    /**
+     * Called by dependency manager upon stopping of this component.
+     */
+    protected void stop() {
+        m_artifactPreprocessor = null;
+        
+    }
+
+    static class MetaDataNamespaceCollector extends DefaultHandler {
+
+        private String m_metaDataNameSpace = "";
+
+        public String getMetaDataNamespace() {
+            return m_metaDataNameSpace;
+        }
+
+        @Override
+        public void startElement(String uri, String localName, String qName, Attributes attributes)
+            throws SAXException {
+            if (qName.equals("MetaData") || qName.endsWith(":MetaData")) {
+                String nsAttributeQName = "xmlns";
+                if (qName.endsWith(":MetaData")) {
+                    nsAttributeQName = "xmlns" + ":" + qName.split(":")[0];
+                }
+                for (int i = 0; i < attributes.getLength(); i++) {
+                    if (attributes.getQName(i).equals(nsAttributeQName)) {
+                        m_metaDataNameSpace = attributes.getValue(i);
+                    }
+                }
+            }
+            // first element is expected to have been the MetaData
+            // root so we can now terminate processing.
+            throw new SAXException("Done");
+        }
+    }
+}
\ No newline at end of file

Added: ace/sandbox/marrs/org.apache.ace.client.repository.helper.configuration/src/org/apache/ace/client/repository/helper/configuration/packageinfo
URL: http://svn.apache.org/viewvc/ace/sandbox/marrs/org.apache.ace.client.repository.helper.configuration/src/org/apache/ace/client/repository/helper/configuration/packageinfo?rev=1357570&view=auto
==============================================================================
--- ace/sandbox/marrs/org.apache.ace.client.repository.helper.configuration/src/org/apache/ace/client/repository/helper/configuration/packageinfo (added)
+++ ace/sandbox/marrs/org.apache.ace.client.repository.helper.configuration/src/org/apache/ace/client/repository/helper/configuration/packageinfo Thu Jul  5 12:09:30 2012
@@ -0,0 +1 @@
+version 1.0
\ No newline at end of file

Added: ace/sandbox/marrs/org.apache.ace.client.repository.helper.configuration/test-output/Default suite/Default test.html
URL: http://svn.apache.org/viewvc/ace/sandbox/marrs/org.apache.ace.client.repository.helper.configuration/test-output/Default%20suite/Default%20test.html?rev=1357570&view=auto
==============================================================================
--- ace/sandbox/marrs/org.apache.ace.client.repository.helper.configuration/test-output/Default suite/Default test.html (added)
+++ ace/sandbox/marrs/org.apache.ace.client.repository.helper.configuration/test-output/Default suite/Default test.html Thu Jul  5 12:09:30 2012
@@ -0,0 +1,104 @@
+<html>
+<head>
+<title>TestNG:  Default test</title>
+<link href="../testng.css" rel="stylesheet" type="text/css" />
+<link href="../my-testng.css" rel="stylesheet" type="text/css" />
+
+<style type="text/css">
+.log { display: none;} 
+.stack-trace { display: none;} 
+</style>
+<script type="text/javascript">
+<!--
+function flip(e) {
+  current = e.style.display;
+  if (current == 'block') {
+    e.style.display = 'none';
+    return 0;
+  }
+  else {
+    e.style.display = 'block';
+    return 1;
+  }
+}
+
+function toggleBox(szDivId, elem, msg1, msg2)
+{
+  var res = -1;  if (document.getElementById) {
+    res = flip(document.getElementById(szDivId));
+  }
+  else if (document.all) {
+    // this is the way old msie versions work
+    res = flip(document.all[szDivId]);
+  }
+  if(elem) {
+    if(res == 0) elem.innerHTML = msg1; else elem.innerHTML = msg2;
+  }
+
+}
+
+function toggleAllBoxes() {
+  if (document.getElementsByTagName) {
+    d = document.getElementsByTagName('div');
+    for (i = 0; i < d.length; i++) {
+      if (d[i].className == 'log') {
+        flip(d[i]);
+      }
+    }
+  }
+}
+
+// -->
+</script>
+
+</head>
+<body>
+<h2 align='center'>Default test</h2><table border='1' align="center">
+<tr>
+<td>Tests passed/Failed/Skipped:</td><td>5/0/0</td>
+</tr><tr>
+<td>Started on:</td><td>Wed Jul 04 11:37:46 CEST 2012</td>
+</tr>
+<tr><td>Total time:</td><td>0 seconds (44 ms)</td>
+</tr><tr>
+<td>Included groups:</td><td></td>
+</tr><tr>
+<td>Excluded groups:</td><td></td>
+</tr>
+</table><p/>
+<small><i>(Hover the method name to see the test class name)</i></small><p/>
+<table width='100%' border='1' class='invocation-passed'>
+<tr><td colspan='4' align='center'><b>PASSED TESTS</b></td></tr>
+<tr><td><b>Test method</b></td>
+<td width="30%"><b>Exception</b></td>
+<td width="10%"><b>Time (seconds)</b></td>
+<td><b>Instance</b></td>
+</tr>
+<tr>
+<td title='org.apache.ace.client.repository.helper.configuration.impl.ConfigurationHelperImplTest.testCanHandleCommentBeforeRoot()'><b>testCanHandleCommentBeforeRoot</b><br>Test class: org.apache.ace.client.repository.helper.configuration.impl.ConfigurationHelperImplTest</td>
+<td></td>
+<td>0</td>
+<td>org.apache.ace.client.repository.helper.configuration.impl.ConfigurationHelperImplTest@26b4e29b</td></tr>
+<tr>
+<td title='org.apache.ace.client.repository.helper.configuration.impl.ConfigurationHelperImplTest.testNamespace10Recognized()'><b>testNamespace10Recognized</b><br>Test class: org.apache.ace.client.repository.helper.configuration.impl.ConfigurationHelperImplTest</td>
+<td></td>
+<td>0</td>
+<td>org.apache.ace.client.repository.helper.configuration.impl.ConfigurationHelperImplTest@26b4e29b</td></tr>
+<tr>
+<td title='org.apache.ace.client.repository.helper.configuration.impl.ConfigurationHelperImplTest.testNamespace11Recognized()'><b>testNamespace11Recognized</b><br>Test class: org.apache.ace.client.repository.helper.configuration.impl.ConfigurationHelperImplTest</td>
+<td></td>
+<td>0</td>
+<td>org.apache.ace.client.repository.helper.configuration.impl.ConfigurationHelperImplTest@26b4e29b</td></tr>
+<tr>
+<td title='org.apache.ace.client.repository.helper.configuration.impl.ConfigurationHelperImplTest.testNamespace12Recognized()'><b>testNamespace12Recognized</b><br>Test class: org.apache.ace.client.repository.helper.configuration.impl.ConfigurationHelperImplTest</td>
+<td></td>
+<td>0</td>
+<td>org.apache.ace.client.repository.helper.configuration.impl.ConfigurationHelperImplTest@26b4e29b</td></tr>
+<tr>
+<td title='org.apache.ace.client.repository.helper.configuration.impl.ConfigurationHelperImplTest.testNamespace13NotRecognized()'><b>testNamespace13NotRecognized</b><br>Test class: org.apache.ace.client.repository.helper.configuration.impl.ConfigurationHelperImplTest</td>
+<td></td>
+<td>0</td>
+<td>org.apache.ace.client.repository.helper.configuration.impl.ConfigurationHelperImplTest@26b4e29b</td></tr>
+</table><p>
+</body>
+</html>
\ No newline at end of file

Added: ace/sandbox/marrs/org.apache.ace.client.repository.helper.configuration/test-output/Default suite/Default test.xml
URL: http://svn.apache.org/viewvc/ace/sandbox/marrs/org.apache.ace.client.repository.helper.configuration/test-output/Default%20suite/Default%20test.xml?rev=1357570&view=auto
==============================================================================
--- ace/sandbox/marrs/org.apache.ace.client.repository.helper.configuration/test-output/Default suite/Default test.xml (added)
+++ ace/sandbox/marrs/org.apache.ace.client.repository.helper.configuration/test-output/Default suite/Default test.xml Thu Jul  5 12:09:30 2012
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated by org.testng.reporters.JUnitXMLReporter -->
+<testsuite hostname="Marcels-MacBook-Pro.local" name="Default test" tests="5" failures="0" timestamp="4 Jul 2012 09:37:46 GMT" time="0.044" errors="0">
+  <testcase name="testCanHandleCommentBeforeRoot" time="0.017" classname="org.apache.ace.client.repository.helper.configuration.impl.ConfigurationHelperImplTest"/>
+  <testcase name="testNamespace10Recognized" time="0.0040" classname="org.apache.ace.client.repository.helper.configuration.impl.ConfigurationHelperImplTest"/>
+  <testcase name="testNamespace11Recognized" time="0.0030" classname="org.apache.ace.client.repository.helper.configuration.impl.ConfigurationHelperImplTest"/>
+  <testcase name="testNamespace12Recognized" time="0.0030" classname="org.apache.ace.client.repository.helper.configuration.impl.ConfigurationHelperImplTest"/>
+  <testcase name="testNamespace13NotRecognized" time="0.0030" classname="org.apache.ace.client.repository.helper.configuration.impl.ConfigurationHelperImplTest"/>
+</testsuite> <!-- Default test -->

Added: ace/sandbox/marrs/org.apache.ace.client.repository.helper.configuration/test-output/Default suite/testng-failed.xml
URL: http://svn.apache.org/viewvc/ace/sandbox/marrs/org.apache.ace.client.repository.helper.configuration/test-output/Default%20suite/testng-failed.xml?rev=1357570&view=auto
==============================================================================
--- ace/sandbox/marrs/org.apache.ace.client.repository.helper.configuration/test-output/Default suite/testng-failed.xml (added)
+++ ace/sandbox/marrs/org.apache.ace.client.repository.helper.configuration/test-output/Default suite/testng-failed.xml Thu Jul  5 12:09:30 2012
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
+<suite name="Failed suite [Default suite]">
+  <test name="Default test(failed)" preserve-order="true">
+    <classes>
+      <class name="org.apache.ace.client.repository.helper.configuration.impl.ConfigurationHelperImplTest">
+        <methods>
+          <include name="testNamespace10Recognized"/>
+          <include name="testNamespace12Recognized"/>
+          <include name="testNamespace11Recognized"/>
+          <include name="testCanHandleCommentBeforeRoot"/>
+        </methods>
+      </class> <!-- org.apache.ace.client.repository.helper.configuration.impl.ConfigurationHelperImplTest -->
+    </classes>
+  </test> <!-- Default test(failed) -->
+</suite> <!-- Failed suite [Default suite] -->



Mime
View raw message