You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@composer.apache.org by ha...@apache.org on 2008/01/21 06:41:50 UTC
svn commit: r613775 [15/15] - in /incubator/composer: ./ core/ core/src/
core/src/java/ core/src/java/org/ core/src/java/org/apache/
core/src/java/org/apache/composer/ core/src/java/org/apache/composer/core/
core/src/java/org/apache/composer/core/adapt...
Added: incubator/composer/core/src/test/org/apache/composer/core/tck/MockFactory.java
URL: http://svn.apache.org/viewvc/incubator/composer/core/src/test/org/apache/composer/core/tck/MockFactory.java?rev=613775&view=auto
==============================================================================
--- incubator/composer/core/src/test/org/apache/composer/core/tck/MockFactory.java (added)
+++ incubator/composer/core/src/test/org/apache/composer/core/tck/MockFactory.java Sun Jan 20 22:41:26 2008
@@ -0,0 +1,38 @@
+/*****************************************************************************
+ * Copyright (C) PicoContainer Organization. All rights reserved. *
+ * ------------------------------------------------------------------------- *
+ * The software in this package is published under the terms of the BSD *
+ * style license a copy of which has been included with this distribution in *
+ * the LICENSE.txt file. *
+ * *
+ * Original code by Mauro Talevi *
+ *****************************************************************************/
+package org.apache.composer.core.tck;
+
+import org.jmock.Mockery;
+import org.jmock.lib.CamelCaseNamingScheme;
+
+public class MockFactory {
+
+ /**
+ * Returns a Mockery instance with a counting naming scheme.
+ * From jMock 2.4, default behaviour does not allow more than one mock with same name.
+ * This can be over-restrictive. A workaround is to append a counting integer.
+ *
+ * @return A Mockery instance
+ */
+ public static Mockery mockeryWithCountingNamingScheme() {
+ return new Mockery() {
+ {
+ setNamingScheme(new CamelCaseNamingScheme() {
+ private int count;
+
+ public String defaultNameFor(Class<?> typeToMock) {
+ count++;
+ return super.defaultNameFor(typeToMock) + count;
+ }
+ });
+ }
+ };
+ }
+}
Added: incubator/composer/core/src/test/org/apache/composer/core/testmodel/AlternativeTouchable.java
URL: http://svn.apache.org/viewvc/incubator/composer/core/src/test/org/apache/composer/core/testmodel/AlternativeTouchable.java?rev=613775&view=auto
==============================================================================
--- incubator/composer/core/src/test/org/apache/composer/core/testmodel/AlternativeTouchable.java (added)
+++ incubator/composer/core/src/test/org/apache/composer/core/testmodel/AlternativeTouchable.java Sun Jan 20 22:41:26 2008
@@ -0,0 +1,26 @@
+/*****************************************************************************
+ * Copyright (c) PicoContainer Organization. All rights reserved. *
+ * ------------------------------------------------------------------------- *
+ * The software in this package is published under the terms of the BSD *
+ * style license a copy of which has been included with this distribution in *
+ * the LICENSE.txt file. *
+ * *
+ * Idea by Rachel Davies, Original code by Aslak Hellesoy and Paul Hammant *
+ *****************************************************************************/
+
+package org.apache.composer.core.testmodel;
+
+import java.io.Serializable;
+
+
+/**
+ * @author steve.freeman@m3p.co.uk
+ */
+public class AlternativeTouchable implements Touchable, Serializable {
+
+ public boolean wasTouched = false;
+
+ public void touch() {
+ wasTouched = true;
+ }
+}
Added: incubator/composer/core/src/test/org/apache/composer/core/testmodel/CoupleBean.java
URL: http://svn.apache.org/viewvc/incubator/composer/core/src/test/org/apache/composer/core/testmodel/CoupleBean.java?rev=613775&view=auto
==============================================================================
--- incubator/composer/core/src/test/org/apache/composer/core/testmodel/CoupleBean.java (added)
+++ incubator/composer/core/src/test/org/apache/composer/core/testmodel/CoupleBean.java Sun Jan 20 22:41:26 2008
@@ -0,0 +1,32 @@
+/*****************************************************************************
+ * Copyright (C) PicoContainer Organization. All rights reserved. *
+ * ------------------------------------------------------------------------- *
+ * The software in this package is published under the terms of the BSD *
+ * style license a copy of which has been included with this distribution in *
+ * the LICENSE.txt file. *
+ * *
+ * Original code by *
+ *****************************************************************************/
+package org.apache.composer.core.testmodel;
+
+/**
+ *
+ * @author greg
+ */
+public final class CoupleBean {
+ private final PersonBean personA;
+ private final PersonBean personB;
+
+ public CoupleBean(PersonBean a, PersonBean b) {
+ this.personA = a;
+ this.personB = b;
+ }
+
+ public PersonBean getPersonA() {
+ return personA;
+ }
+
+ public PersonBean getPersonB() {
+ return personB;
+ }
+}
Added: incubator/composer/core/src/test/org/apache/composer/core/testmodel/CoupleBeanEditor.java
URL: http://svn.apache.org/viewvc/incubator/composer/core/src/test/org/apache/composer/core/testmodel/CoupleBeanEditor.java?rev=613775&view=auto
==============================================================================
--- incubator/composer/core/src/test/org/apache/composer/core/testmodel/CoupleBeanEditor.java (added)
+++ incubator/composer/core/src/test/org/apache/composer/core/testmodel/CoupleBeanEditor.java Sun Jan 20 22:41:26 2008
@@ -0,0 +1,44 @@
+/*****************************************************************************
+ * Copyright (C) PicoContainer Organization. All rights reserved. *
+ * ------------------------------------------------------------------------- *
+ * The software in this package is published under the terms of the BSD *
+ * style license a copy of which has been included with this distribution in *
+ * the LICENSE.txt file. *
+ * *
+ * Original code by *
+ *****************************************************************************/
+package org.apache.composer.core.testmodel;
+
+import java.beans.PropertyEditorSupport;
+
+/**
+ *
+ * @author greg
+ */
+public class CoupleBeanEditor extends PropertyEditorSupport {
+ private static final String PREFIX_A = "a's name:";
+ private static final String PREFIX_B = "b's name:";
+ private static final String SEPARATOR = ";";
+
+ public CoupleBeanEditor() {
+ super();
+ }
+
+ public void setAsText(String s) throws IllegalArgumentException {
+ int startA = s.indexOf(PREFIX_A);
+ int stopA = s.indexOf(SEPARATOR, startA+PREFIX_A.length());
+ int startB = s.indexOf(PREFIX_B, stopA + SEPARATOR.length());
+ int stopB = s.indexOf(SEPARATOR, startB+ PREFIX_B.length());
+ if (startA < 0 || stopA < 0 || startB < 0 || stopB < 0) {
+ throw new IllegalArgumentException("Can't parse " + s + " into a CoupleBean");
+ }
+ String nameA = s.substring(startA + PREFIX_A.length(), stopA);
+ String nameB = s.substring(startB + PREFIX_B.length(), stopB);
+
+ PersonBean a = new PersonBean();
+ a.setName(nameA);
+ PersonBean b = new PersonBean();
+ b.setName(nameB);
+ setValue(new CoupleBean(a, b));
+ }
+}
Added: incubator/composer/core/src/test/org/apache/composer/core/testmodel/DecoratedTouchable.java
URL: http://svn.apache.org/viewvc/incubator/composer/core/src/test/org/apache/composer/core/testmodel/DecoratedTouchable.java?rev=613775&view=auto
==============================================================================
--- incubator/composer/core/src/test/org/apache/composer/core/testmodel/DecoratedTouchable.java (added)
+++ incubator/composer/core/src/test/org/apache/composer/core/testmodel/DecoratedTouchable.java Sun Jan 20 22:41:26 2008
@@ -0,0 +1,25 @@
+/*****************************************************************************
+ * Copyright (C) PicoContainer Organization. All rights reserved. *
+ * ------------------------------------------------------------------------- *
+ * The software in this package is published under the terms of the BSD *
+ * style license a copy of which has been included with this distribution in *
+ * the LICENSE.txt file. *
+ * *
+ * Original code by *
+ *****************************************************************************/
+package org.apache.composer.core.testmodel;
+
+/**
+ * @author Thomas Heller
+ */
+public class DecoratedTouchable implements Touchable {
+ private final Touchable delegate;
+
+ public DecoratedTouchable(Touchable delegate) {
+ this.delegate = delegate;
+ }
+
+ public void touch() {
+ delegate.touch();
+ }
+}
Added: incubator/composer/core/src/test/org/apache/composer/core/testmodel/DependsOnTouchable.java
URL: http://svn.apache.org/viewvc/incubator/composer/core/src/test/org/apache/composer/core/testmodel/DependsOnTouchable.java?rev=613775&view=auto
==============================================================================
--- incubator/composer/core/src/test/org/apache/composer/core/testmodel/DependsOnTouchable.java (added)
+++ incubator/composer/core/src/test/org/apache/composer/core/testmodel/DependsOnTouchable.java Sun Jan 20 22:41:26 2008
@@ -0,0 +1,32 @@
+/*****************************************************************************
+ * Copyright (c) PicoContainer Organization. All rights reserved. *
+ * ------------------------------------------------------------------------- *
+ * The software in this package is published under the terms of the BSD *
+ * style license a copy of which has been included with this distribution in *
+ * the LICENSE.txt file. *
+ * *
+ * Idea by Rachel Davies, Original code by Aslak Hellesoy and Paul Hammant *
+ *****************************************************************************/
+
+package org.apache.composer.core.testmodel;
+
+import java.io.Serializable;
+
+import junit.framework.Assert;
+
+/**
+ * @author steve.freeman@m3p.co.uk
+ */
+public class DependsOnTouchable implements Serializable {
+ public final Touchable touchable;
+
+ public DependsOnTouchable(Touchable touchable) {
+ Assert.assertNotNull("Touchable cannot be passed in as null", touchable);
+ touchable.touch();
+ this.touchable = touchable;
+ }
+
+ public Touchable getTouchable() {
+ return touchable;
+ }
+}
Added: incubator/composer/core/src/test/org/apache/composer/core/testmodel/DependsOnTwoComponents.java
URL: http://svn.apache.org/viewvc/incubator/composer/core/src/test/org/apache/composer/core/testmodel/DependsOnTwoComponents.java?rev=613775&view=auto
==============================================================================
--- incubator/composer/core/src/test/org/apache/composer/core/testmodel/DependsOnTwoComponents.java (added)
+++ incubator/composer/core/src/test/org/apache/composer/core/testmodel/DependsOnTwoComponents.java Sun Jan 20 22:41:26 2008
@@ -0,0 +1,24 @@
+/*****************************************************************************
+ * Copyright (c) PicoContainer Organization. All rights reserved. *
+ * ------------------------------------------------------------------------- *
+ * The software in this package is published under the terms of the BSD *
+ * style license a copy of which has been included with this distribution in *
+ * the LICENSE.txt file. *
+ * *
+ * Idea by Rachel Davies, Original code by Aslak Hellesoy and Paul Hammant *
+ *****************************************************************************/
+
+package org.apache.composer.core.testmodel;
+
+import junit.framework.Assert;
+
+/**
+ * @author steve.freeman@m3p.co.uk
+ * was FlintstoneImpl
+ */
+public class DependsOnTwoComponents {
+ public DependsOnTwoComponents(Touchable Touchable, DependsOnTouchable fred) {
+ Assert.assertNotNull("Touchable cannot be passed in as null", Touchable);
+ Assert.assertNotNull("DependsOnTouchable cannot be passed in as null", fred);
+ }
+}
Added: incubator/composer/core/src/test/org/apache/composer/core/testmodel/Dictionary.java
URL: http://svn.apache.org/viewvc/incubator/composer/core/src/test/org/apache/composer/core/testmodel/Dictionary.java?rev=613775&view=auto
==============================================================================
--- incubator/composer/core/src/test/org/apache/composer/core/testmodel/Dictionary.java (added)
+++ incubator/composer/core/src/test/org/apache/composer/core/testmodel/Dictionary.java Sun Jan 20 22:41:26 2008
@@ -0,0 +1,17 @@
+/*****************************************************************************
+ * Copyright (c) PicoContainer Organization. All rights reserved. *
+ * ------------------------------------------------------------------------- *
+ * The software in this package is published under the terms of the BSD *
+ * style license a copy of which has been included with this distribution in *
+ * the LICENSE.txt file. *
+ * *
+ * Idea by Rachel Davies, Original code by Aslak Hellesoy and Paul Hammant *
+ *****************************************************************************/
+
+package org.apache.composer.core.testmodel;
+
+/**
+ * @author Aslak Hellesoy
+ */
+public interface Dictionary {
+}
Added: incubator/composer/core/src/test/org/apache/composer/core/testmodel/InaccessibleStartComponent.java
URL: http://svn.apache.org/viewvc/incubator/composer/core/src/test/org/apache/composer/core/testmodel/InaccessibleStartComponent.java?rev=613775&view=auto
==============================================================================
--- incubator/composer/core/src/test/org/apache/composer/core/testmodel/InaccessibleStartComponent.java (added)
+++ incubator/composer/core/src/test/org/apache/composer/core/testmodel/InaccessibleStartComponent.java Sun Jan 20 22:41:26 2008
@@ -0,0 +1,28 @@
+/*****************************************************************************
+ * Copyright (c) PicoContainer Organization. All rights reserved. *
+ * ------------------------------------------------------------------------- *
+ * The software in this package is published under the terms of the BSD *
+ * style license a copy of which has been included with this distribution in *
+ * the LICENSE.txt file. *
+ * *
+ * Idea by Rachel Davies, Original code by Aslak Hellesoy and Paul Hammant *
+ *****************************************************************************/
+
+package org.apache.composer.core.testmodel;
+
+import java.util.List;
+
+/**
+ * @author Steve.Freeman@m3p.co.uk
+ */
+public final class InaccessibleStartComponent {
+ private final List messages;
+
+ public InaccessibleStartComponent(List messages) {
+ this.messages = messages;
+ }
+
+ private final void start() {
+ messages.add("started");
+ }
+}
Added: incubator/composer/core/src/test/org/apache/composer/core/testmodel/NullLifecycle.java
URL: http://svn.apache.org/viewvc/incubator/composer/core/src/test/org/apache/composer/core/testmodel/NullLifecycle.java?rev=613775&view=auto
==============================================================================
--- incubator/composer/core/src/test/org/apache/composer/core/testmodel/NullLifecycle.java (added)
+++ incubator/composer/core/src/test/org/apache/composer/core/testmodel/NullLifecycle.java Sun Jan 20 22:41:26 2008
@@ -0,0 +1,25 @@
+/*****************************************************************************
+ * Copyright (c) PicoContainer Organization. All rights reserved. *
+ * ------------------------------------------------------------------------- *
+ * The software in this package is published under the terms of the BSD *
+ * style license a copy of which has been included with this distribution in *
+ * the license.html file. *
+ *****************************************************************************/
+package org.apache.composer.core.testmodel;
+
+import org.apache.composer.core.Disposable;
+import org.apache.composer.core.Startable;
+
+
+public class NullLifecycle implements Startable, Disposable {
+
+ public void start() {
+ }
+
+ public void stop() {
+ }
+
+ public void dispose() {
+ }
+
+}
\ No newline at end of file
Added: incubator/composer/core/src/test/org/apache/composer/core/testmodel/PersonBean.java
URL: http://svn.apache.org/viewvc/incubator/composer/core/src/test/org/apache/composer/core/testmodel/PersonBean.java?rev=613775&view=auto
==============================================================================
--- incubator/composer/core/src/test/org/apache/composer/core/testmodel/PersonBean.java (added)
+++ incubator/composer/core/src/test/org/apache/composer/core/testmodel/PersonBean.java Sun Jan 20 22:41:26 2008
@@ -0,0 +1,20 @@
+/*****************************************************************************
+ * Copyright (C) PicoContainer Organization. All rights reserved. *
+ * ------------------------------------------------------------------------- *
+ * The software in this package is published under the terms of the BSD *
+ * style license a copy of which has been included with this distribution in *
+ * the LICENSE.txt file. *
+ * *
+ * Original code by Joerg Schaible *
+ *****************************************************************************/
+package org.apache.composer.core.testmodel;
+
+public class PersonBean {
+ private String name;
+ public void setName(String name) {
+ this.name = name;
+ }
+ public String getName() {
+ return name;
+ }
+}
Added: incubator/composer/core/src/test/org/apache/composer/core/testmodel/PurseBean.java
URL: http://svn.apache.org/viewvc/incubator/composer/core/src/test/org/apache/composer/core/testmodel/PurseBean.java?rev=613775&view=auto
==============================================================================
--- incubator/composer/core/src/test/org/apache/composer/core/testmodel/PurseBean.java (added)
+++ incubator/composer/core/src/test/org/apache/composer/core/testmodel/PurseBean.java Sun Jan 20 22:41:26 2008
@@ -0,0 +1,20 @@
+/*****************************************************************************
+ * Copyright (C) PicoContainer Organization. All rights reserved. *
+ * ------------------------------------------------------------------------- *
+ * The software in this package is published under the terms of the BSD *
+ * style license a copy of which has been included with this distribution in *
+ * the LICENSE.txt file. *
+ * *
+ * Original code by Joerg Schaible *
+ *****************************************************************************/
+package org.apache.composer.core.testmodel;
+
+public class PurseBean {
+ PersonBean owner;
+ public PersonBean getOwner() {
+ return owner;
+ }
+ public void setOwner(PersonBean owner) {
+ this.owner = owner;
+ }
+}
Added: incubator/composer/core/src/test/org/apache/composer/core/testmodel/RecordingLifecycle.java
URL: http://svn.apache.org/viewvc/incubator/composer/core/src/test/org/apache/composer/core/testmodel/RecordingLifecycle.java?rev=613775&view=auto
==============================================================================
--- incubator/composer/core/src/test/org/apache/composer/core/testmodel/RecordingLifecycle.java (added)
+++ incubator/composer/core/src/test/org/apache/composer/core/testmodel/RecordingLifecycle.java Sun Jan 20 22:41:26 2008
@@ -0,0 +1,90 @@
+/*****************************************************************************
+ * Copyright (c) PicoContainer Organization. All rights reserved. *
+ * ------------------------------------------------------------------------- *
+ * The software in this package is published under the terms of the BSD *
+ * style license a copy of which has been included with this distribution in *
+ * the license.html file. *
+ * *
+ * Idea by Rachel Davies, Original code by Aslak Hellesoy and Paul Hammant *
+ *****************************************************************************/
+package org.apache.composer.core.testmodel;
+
+import static org.junit.Assert.assertNotNull;
+
+import org.apache.composer.core.Disposable;
+import org.apache.composer.core.Container;
+import org.apache.composer.core.Startable;
+
+
+public abstract class RecordingLifecycle implements Startable, Disposable {
+ private final StringBuffer recording;
+
+ protected RecordingLifecycle(StringBuffer recording) {
+ this.recording = recording;
+ }
+
+ public void start() {
+ recording.append("<").append(code());
+ }
+
+ public void stop() {
+ recording.append(code()).append(">");
+ }
+
+ public void dispose() {
+ recording.append("!").append(code());
+ }
+
+ public String recording() {
+ return recording.toString();
+ }
+
+ private String code() {
+ String name = getClass().getName();
+ int idx = Math.max(name.lastIndexOf('$'), name.lastIndexOf('.'));
+ return name.substring(idx + 1);
+ }
+
+ public interface Recorder extends Startable, Disposable {
+ String recording();
+ }
+
+ public static class One extends RecordingLifecycle implements Recorder {
+ public One(StringBuffer sb) {
+ super(sb);
+ }
+ }
+
+ public static class Two extends RecordingLifecycle {
+ public Two(StringBuffer sb, One one) {
+ super(sb);
+ assertNotNull(one);
+ }
+ }
+
+ public static class Three extends RecordingLifecycle {
+ public Three(StringBuffer sb, One one, Two two) {
+ super(sb);
+ assertNotNull(one);
+ assertNotNull(two);
+ }
+ }
+
+ public static class Four extends RecordingLifecycle {
+ public Four(StringBuffer sb, Two two, Three three, One one) {
+ super(sb);
+ assertNotNull(one);
+ assertNotNull(two);
+ assertNotNull(three);
+ }
+ }
+
+ public static class FiveTriesToBeMalicious extends RecordingLifecycle {
+ public FiveTriesToBeMalicious(StringBuffer sb, Container pc) {
+ super(sb);
+ assertNotNull(pc);
+ sb.append("Whao! Should not get instantiated!!");
+ }
+ }
+
+}
\ No newline at end of file
Added: incubator/composer/core/src/test/org/apache/composer/core/testmodel/SimpleTouchable.java
URL: http://svn.apache.org/viewvc/incubator/composer/core/src/test/org/apache/composer/core/testmodel/SimpleTouchable.java?rev=613775&view=auto
==============================================================================
--- incubator/composer/core/src/test/org/apache/composer/core/testmodel/SimpleTouchable.java (added)
+++ incubator/composer/core/src/test/org/apache/composer/core/testmodel/SimpleTouchable.java Sun Jan 20 22:41:26 2008
@@ -0,0 +1,26 @@
+/*****************************************************************************
+ * Copyright (c) PicoContainer Organization. All rights reserved. *
+ * ------------------------------------------------------------------------- *
+ * The software in this package is published under the terms of the BSD *
+ * style license a copy of which has been included with this distribution in *
+ * the LICENSE.txt file. *
+ * *
+ * Idea by Rachel Davies, Original code by Aslak Hellesoy and Paul Hammant *
+ *****************************************************************************/
+
+package org.apache.composer.core.testmodel;
+
+import java.io.Serializable;
+
+
+/**
+ * @author steve.freeman@m3p.co.uk
+ */
+public class SimpleTouchable implements Touchable, Serializable {
+
+ public boolean wasTouched = false;
+
+ public void touch() {
+ wasTouched = true;
+ }
+}
Added: incubator/composer/core/src/test/org/apache/composer/core/testmodel/Thesaurus.java
URL: http://svn.apache.org/viewvc/incubator/composer/core/src/test/org/apache/composer/core/testmodel/Thesaurus.java?rev=613775&view=auto
==============================================================================
--- incubator/composer/core/src/test/org/apache/composer/core/testmodel/Thesaurus.java (added)
+++ incubator/composer/core/src/test/org/apache/composer/core/testmodel/Thesaurus.java Sun Jan 20 22:41:26 2008
@@ -0,0 +1,17 @@
+/*****************************************************************************
+ * Copyright (c) PicoContainer Organization. All rights reserved. *
+ * ------------------------------------------------------------------------- *
+ * The software in this package is published under the terms of the BSD *
+ * style license a copy of which has been included with this distribution in *
+ * the LICENSE.txt file. *
+ * *
+ * Idea by Rachel Davies, Original code by Aslak Hellesoy and Paul Hammant *
+ *****************************************************************************/
+
+package org.apache.composer.core.testmodel;
+
+/**
+ * @author Aslak Hellesoy
+ */
+public interface Thesaurus {
+}
Added: incubator/composer/core/src/test/org/apache/composer/core/testmodel/Touchable.java
URL: http://svn.apache.org/viewvc/incubator/composer/core/src/test/org/apache/composer/core/testmodel/Touchable.java?rev=613775&view=auto
==============================================================================
--- incubator/composer/core/src/test/org/apache/composer/core/testmodel/Touchable.java (added)
+++ incubator/composer/core/src/test/org/apache/composer/core/testmodel/Touchable.java Sun Jan 20 22:41:26 2008
@@ -0,0 +1,18 @@
+/*****************************************************************************
+ * Copyright (c) PicoContainer Organization. All rights reserved. *
+ * ------------------------------------------------------------------------- *
+ * The software in this package is published under the terms of the BSD *
+ * style license a copy of which has been included with this distribution in *
+ * the LICENSE.txt file. *
+ * *
+ * Idea by Rachel Davies, Original code by Aslak Hellesoy and Paul Hammant *
+ *****************************************************************************/
+
+package org.apache.composer.core.testmodel;
+
+/**
+ * @author Steve.Freeman@m3p.co.uk
+ */
+public interface Touchable {
+ void touch();
+}
Added: incubator/composer/core/src/test/org/apache/composer/core/testmodel/Washable.java
URL: http://svn.apache.org/viewvc/incubator/composer/core/src/test/org/apache/composer/core/testmodel/Washable.java?rev=613775&view=auto
==============================================================================
--- incubator/composer/core/src/test/org/apache/composer/core/testmodel/Washable.java (added)
+++ incubator/composer/core/src/test/org/apache/composer/core/testmodel/Washable.java Sun Jan 20 22:41:26 2008
@@ -0,0 +1,17 @@
+/*****************************************************************************
+ * Copyright (C) PicoContainer Organization. All rights reserved. *
+ * ------------------------------------------------------------------------- *
+ * The software in this package is published under the terms of the BSD *
+ * style license a copy of which has been included with this distribution in *
+ * the LICENSE.txt file. *
+ * *
+ * Original code by *
+ *****************************************************************************/
+package org.apache.composer.core.testmodel;
+
+/**
+ * @author Aslak Hellesøy
+ */
+public interface Washable {
+ void wash();
+}
Added: incubator/composer/core/src/test/org/apache/composer/core/testmodel/WashableTouchable.java
URL: http://svn.apache.org/viewvc/incubator/composer/core/src/test/org/apache/composer/core/testmodel/WashableTouchable.java?rev=613775&view=auto
==============================================================================
--- incubator/composer/core/src/test/org/apache/composer/core/testmodel/WashableTouchable.java (added)
+++ incubator/composer/core/src/test/org/apache/composer/core/testmodel/WashableTouchable.java Sun Jan 20 22:41:26 2008
@@ -0,0 +1,21 @@
+/*****************************************************************************
+ * Copyright (C) PicoContainer Organization. All rights reserved. *
+ * ------------------------------------------------------------------------- *
+ * The software in this package is published under the terms of the BSD *
+ * style license a copy of which has been included with this distribution in *
+ * the LICENSE.txt file. *
+ * *
+ * Original code by *
+ *****************************************************************************/
+package org.apache.composer.core.testmodel;
+
+/**
+ * @author Aslak Hellesøy
+ */
+public class WashableTouchable implements Washable, Touchable {
+ public void touch() {
+ }
+
+ public void wash() {
+ }
+}
Added: incubator/composer/core/src/test/org/apache/composer/core/testmodel/Webster.java
URL: http://svn.apache.org/viewvc/incubator/composer/core/src/test/org/apache/composer/core/testmodel/Webster.java?rev=613775&view=auto
==============================================================================
--- incubator/composer/core/src/test/org/apache/composer/core/testmodel/Webster.java (added)
+++ incubator/composer/core/src/test/org/apache/composer/core/testmodel/Webster.java Sun Jan 20 22:41:26 2008
@@ -0,0 +1,22 @@
+/*****************************************************************************
+ * Copyright (C) PicoContainer Organization. All rights reserved. *
+ * ------------------------------------------------------------------------- *
+ * The software in this package is published under the terms of the BSD *
+ * style license a copy of which has been included with this distribution in *
+ * the LICENSE.txt file. *
+ * *
+ * Idea by Rachel Davies, Original code by Aslak Hellesoy and Paul Hammant *
+ *****************************************************************************/
+
+package org.apache.composer.core.testmodel;
+
+import java.util.List;
+
+/**
+ * @author Aslak Hellesoy
+ */
+public class Webster implements Dictionary, Thesaurus {
+ public Webster(List list) {
+ list.add("webster created");
+ }
+}
Added: incubator/composer/core/src/test/org/apache/composer/core/visitors/MethodCallingVisitorTest.java
URL: http://svn.apache.org/viewvc/incubator/composer/core/src/test/org/apache/composer/core/visitors/MethodCallingVisitorTest.java?rev=613775&view=auto
==============================================================================
--- incubator/composer/core/src/test/org/apache/composer/core/visitors/MethodCallingVisitorTest.java (added)
+++ incubator/composer/core/src/test/org/apache/composer/core/visitors/MethodCallingVisitorTest.java Sun Jan 20 22:41:26 2008
@@ -0,0 +1,107 @@
+/*****************************************************************************
+ * Copyright (C) PicoContainer Organization. All rights reserved. *
+ * ------------------------------------------------------------------------- *
+ * The software in this package is published under the terms of the BSD *
+ * style license a copy of which has been included with this distribution in *
+ * the LICENSE.txt file. *
+ *****************************************************************************/
+package org.apache.composer.core.visitors;
+
+import static org.junit.Assert.assertEquals;
+import static org.apache.composer.core.tck.MockFactory.mockeryWithCountingNamingScheme;
+
+import java.lang.reflect.Method;
+import java.util.LinkedList;
+import java.util.List;
+
+import org.jmock.Expectations;
+import org.jmock.Mockery;
+import org.jmock.Sequence;
+import org.jmock.integration.junit4.JMock;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.apache.composer.core.DefaultContainer;
+import org.apache.composer.core.MutableContainer;
+import org.apache.composer.core.ContainerVisitor;
+import org.apache.composer.core.behaviors.Caching;
+import org.apache.composer.core.testmodel.Touchable;
+
+
+/**
+ * @author Jörg Schaible
+ * @author Mauro Talevi
+ */
+@RunWith(JMock.class)
+public class MethodCallingVisitorTest {
+
+ private Mockery mockery = mockeryWithCountingNamingScheme();
+
+ private Method add;
+ private Method touch;
+
+ @Before
+ public void setUp() throws Exception {
+ add = List.class.getMethod("add", Object.class);
+ touch = Touchable.class.getMethod("touch", (Class[])null);
+ }
+
+ @Test public void testVisitorWillTraverseAndCall() throws Exception {
+ MutableContainer parent = new DefaultContainer(new Caching());
+ MutableContainer child = new DefaultContainer(new Caching());
+ parent.addChildContainer(child);
+ parent.addComponent(List.class, LinkedList.class);
+ child.addComponent(List.class, LinkedList.class);
+ List parentList = parent.getComponent(List.class);
+ List childList = child.getComponent(List.class);
+
+ assertEquals(0, parentList.size());
+ assertEquals(0, childList.size());
+
+ ContainerVisitor visitor = new MethodCallingVisitor(add, List.class, new Object[]{Boolean.TRUE});
+ visitor.traverse(parent);
+
+ assertEquals(1, parentList.size());
+ assertEquals(1, childList.size());
+ }
+
+ @Test public void testVisitsInInstantiationOrder() throws Exception {
+ final Touchable touchable1 = mockery.mock(Touchable.class);
+ final Touchable touchable2 = mockery.mock(Touchable.class);
+
+ final Sequence sequence = mockery.sequence("touching");
+ mockery.checking(new Expectations() {{
+ one(touchable1).touch(); inSequence(sequence);
+ one(touchable2).touch(); inSequence(sequence);
+ }});
+
+ MutableContainer parent = new DefaultContainer();
+ MutableContainer child = new DefaultContainer();
+ parent.addChildContainer(child);
+ parent.addComponent(touchable1);
+ child.addComponent(touchable2);
+
+ ContainerVisitor visitor = new MethodCallingVisitor(touch, Touchable.class, null);
+ visitor.traverse(parent);
+ }
+
+ @Test public void testVisitsInReverseInstantiationOrder() throws Exception {
+ final Touchable touchable1 = mockery.mock(Touchable.class);
+ final Touchable touchable2 = mockery.mock(Touchable.class);
+
+ final Sequence sequence = mockery.sequence("touching");
+ mockery.checking(new Expectations() {{
+ one(touchable2).touch(); inSequence(sequence);
+ one(touchable1).touch(); inSequence(sequence);
+ }});
+
+ MutableContainer parent = new DefaultContainer();
+ MutableContainer child = new DefaultContainer();
+ parent.addChildContainer(child);
+ parent.addComponent(touchable1);
+ child.addComponent(touchable2);
+
+ ContainerVisitor visitor = new MethodCallingVisitor(touch, Touchable.class, null, false);
+ visitor.traverse(parent);
+ }
+}
Added: incubator/composer/core/src/test/org/apache/composer/core/visitors/TraversalCheckingVisitorTest.java
URL: http://svn.apache.org/viewvc/incubator/composer/core/src/test/org/apache/composer/core/visitors/TraversalCheckingVisitorTest.java?rev=613775&view=auto
==============================================================================
--- incubator/composer/core/src/test/org/apache/composer/core/visitors/TraversalCheckingVisitorTest.java (added)
+++ incubator/composer/core/src/test/org/apache/composer/core/visitors/TraversalCheckingVisitorTest.java Sun Jan 20 22:41:26 2008
@@ -0,0 +1,142 @@
+/*****************************************************************************
+ * Copyright (C) PicoContainer Organization. All rights reserved. *
+ * ------------------------------------------------------------------------- *
+ * The software in this package is published under the terms of the BSD *
+ * style license a copy of which has been included with this distribution in *
+ * the LICENSE.txt file. *
+ *****************************************************************************/
+package org.apache.composer.core.visitors;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.apache.composer.core.ComponentAdapter;
+import org.apache.composer.core.DefaultContainer;
+import org.apache.composer.core.MutableContainer;
+import org.apache.composer.core.NameBinding;
+import org.apache.composer.core.Parameter;
+import org.apache.composer.core.Container;
+import org.apache.composer.core.ContainerVisitor;
+import org.apache.composer.core.injectors.ConstructorInjector;
+import org.apache.composer.core.injectors.SetterInjector;
+import org.apache.composer.core.lifecycle.NullLifecycleStrategy;
+import org.apache.composer.core.monitors.NullComponentMonitor;
+import org.apache.composer.core.parameters.ConstantParameter;
+
+/**
+ * @author Michael Rimov
+ */
+public class TraversalCheckingVisitorTest {
+
+ private MutableContainer pico;
+
+ private MutableContainer child;
+
+ private ComponentAdapter parentAdapter;
+
+ private ComponentAdapter childAdapter;
+
+ @Before
+ public void setUp() throws Exception {
+
+ pico = new DefaultContainer();
+ SetterInjector componentAdapter = new SetterInjector(StringBuffer.class, StringBuffer.class,
+ null, new NullComponentMonitor(), new NullLifecycleStrategy(),
+ "set", false);
+ parentAdapter = pico.addAdapter(componentAdapter).getComponentAdapter(StringBuffer.class, (NameBinding) null);
+ child = pico.makeChildContainer();
+ ConstructorInjector adapter = new ConstructorInjector(ArrayList.class, ArrayList.class, new Parameter[] {new ConstantParameter(3)}, new NullComponentMonitor(), new NullLifecycleStrategy(), false);
+ childAdapter = child.addAdapter(adapter).getComponentAdapter(ArrayList.class, (NameBinding) null);
+ }
+
+ @After
+ public void tearDown() throws Exception {
+ child = null;
+ pico = null;
+ parentAdapter = null;
+ childAdapter = null;
+ }
+
+ @Test public void testVisitComponentAdapter() {
+ final int numExpectedComponentAdapters = 2;
+ final List<ComponentAdapter> allAdapters = new ArrayList<ComponentAdapter>();
+
+ Set<ComponentAdapter> knownAdapters = new HashSet<ComponentAdapter>();
+ knownAdapters.add(parentAdapter);
+ knownAdapters.add(childAdapter);
+
+ ContainerVisitor containerCollector = new TraversalCheckingVisitor() {
+ public void visitComponentAdapter(ComponentAdapter adapter) {
+ super.visitComponentAdapter(adapter); //Calls checkTraversal for us.
+ allAdapters.add(adapter);
+ }
+ };
+ containerCollector.traverse(pico);
+
+ assertEquals(numExpectedComponentAdapters, allAdapters.size());
+
+ for (ComponentAdapter allAdapter : allAdapters) {
+ boolean knownAdapter = knownAdapters.remove(allAdapter);
+ assertTrue("Encountered unknown adapter in collection: " + allAdapters.toString(), knownAdapter);
+ }
+
+ assertTrue("All adapters should match known adapters.", knownAdapters.size() == 0);
+ }
+
+ @Test public void testVisitContainer() {
+ final List<Container> allContainers = new ArrayList<Container>();
+ final int expectedNumberOfContainers = 2;
+
+ ContainerVisitor containerCollector = new TraversalCheckingVisitor() {
+ public void visitContainer(Container pico) {
+ super.visitContainer(pico); //Calls checkTraversal for us.
+ allContainers.add(pico);
+ }
+ };
+
+ containerCollector.traverse(pico);
+
+ assertTrue(allContainers.size() == expectedNumberOfContainers);
+
+ Set<MutableContainer> knownContainers = new HashSet<MutableContainer>();
+ knownContainers.add(pico);
+ knownContainers.add(child);
+ for (Container oneContainer : allContainers) {
+ boolean knownContainer = knownContainers.remove(oneContainer);
+ assertTrue("Found a picocontainer that wasn't previously expected.", knownContainer);
+ }
+
+ assertTrue("All containers must match what is returned by traversal.",
+ knownContainers.size() == 0);
+
+ }
+
+
+ @Test public void testVisitParameter() {
+ final List allParameters = new ArrayList();
+
+ ContainerVisitor containerCollector = new TraversalCheckingVisitor() {
+ public void visitParameter(Parameter param) {
+ super.visitParameter(param); //Calls checkTraversal for us.
+ allParameters.add(param);
+ }
+ };
+
+ containerCollector.traverse(pico);
+
+ assertTrue(allParameters.size() == 1);
+ assertTrue(allParameters.get(0) instanceof ConstantParameter);
+ assertTrue( ( (ConstantParameter) allParameters.get(0)).resolveInstance(null, null, null, null, false, null) instanceof Integer);
+ assertEquals(3, ( (Integer) ( (ConstantParameter) allParameters.get(0)).resolveInstance(null, null,
+ null, null, false, null)).intValue());
+ }
+
+}
\ No newline at end of file
Added: incubator/composer/pom.xml
URL: http://svn.apache.org/viewvc/incubator/composer/pom.xml?rev=613775&view=auto
==============================================================================
--- incubator/composer/pom.xml (added)
+++ incubator/composer/pom.xml Sun Jan 20 22:41:26 2008
@@ -0,0 +1,417 @@
+<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/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.apache.composer</groupId>
+ <artifactId>apache-composer-parent</artifactId>
+ <name>Apache Composer Parent</name>
+ <version>1.0-SNAPSHOT</version>
+ <packaging>pom</packaging>
+ <url>http://www.apache.org</url>
+ <modules>
+ <module>core</module>
+ <module>tck</module>
+ </modules>
+ <organization>
+ <name>Apache</name>
+ <url>http://apache.org/</url>
+ </organization>
+ <inceptionYear>2007</inceptionYear>
+ <description>
+ <![CDATA[Please refer to the <a href="http://apache.org/">main website</a> for documentation.]]>
+ </description>
+ <issueManagement>
+ <system>JIRA</system>
+ <url>http://jira.codehaus.org/browse/PICO</url>
+ </issueManagement>
+ <licenses>
+ <license>
+ <url>
+ https://svn.codehaus.org/picocontainer/java/picocontainer/trunk/LICENSE.txt
+ </url>
+ <distribution>repo</distribution>
+ </license>
+ </licenses>
+ <scm>
+ <connection>scm:svn:https://svn.codehaus.org/picocontainer/java/2.x/trunk/pico</connection>
+ <developerConnection>scm:svn:https://svn.codehaus.org/picocontainer/java/2.x/trunk/pico</developerConnection>
+ <url>https://svn.codehaus.org/picocontainer/java/2.x/trunk/pico</url>
+ </scm>
+ <repositories>
+ <repository>
+ <id>codehaus-repository</id>
+ <name>Codehaus Repository</name>
+ <url>http://repository.codehaus.org</url>
+ </repository>
+ <repository>
+ <id>codehaus-snapshots-repository</id>
+ <name>Codehaus Snapshots Repository</name>
+ <url>http://snapshots.repository.codehaus.org</url>
+ </repository>
+ <repository>
+ <id>codehaus-dist-repository</id>
+ <name>Codehaus Dist Repository</name>
+ <url>http://dist.codehaus.org</url>
+ <layout>legacy</layout>
+ </repository>
+ <repository>
+ <layout>legacy</layout>
+ <id>astrogrid.org-repository</id>
+ <name>Astrogrid Repository</name>
+ <url>http://www.astrogrid.org/maven</url>
+ </repository>
+ </repositories>
+ <pluginRepositories>
+ <pluginRepository>
+ <id>codehaus-plugin-repository</id>
+ <name>Codehaus Plugin Repository</name>
+ <url>http://repository.codehaus.org</url>
+ </pluginRepository>
+ <pluginRepository>
+ <id>codehaus-plugin-snapshots-repository</id>
+ <name>Codehaus Plugin Snapshots Repository</name>
+ <url>http://snapshots.repository.codehaus.org</url>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ </pluginRepository>
+ <pluginRepository>
+ <id>apache-plugin-snapshots-repository</id>
+ <name>Apache Plugin Snapshots Repository</name>
+ <url>http://people.apache.org/repo/m2-snapshot-repository</url>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ </pluginRepository>
+ </pluginRepositories>
+ <distributionManagement>
+ <repository>
+ <id>codehaus.org</id>
+ <name>Codehaus Apache Composer Repository</name>
+ <url>dav:https://dav.codehaus.org/repository/picocontainer/</url>
+ </repository>
+ <snapshotRepository>
+ <id>codehaus.org</id>
+ <name>Codehaus Apache Composer Snapshot Repository</name>
+ <url>
+ dav:https://dav.codehaus.org/snapshots.repository/picocontainer/
+ </url>
+ </snapshotRepository>
+ <site>
+ <id>codehaus.org</id>
+ <url>dav:https://dav.codehaus.org/picocontainer/</url>
+ </site>
+ </distributionManagement>
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>${pom.groupId}</groupId>
+ <artifactId>apache-composer-core</artifactId>
+ <version>${pom.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>${pom.groupId}</groupId>
+ <artifactId>apache-composer-tck</artifactId>
+ <version>${pom.version}</version>
+ </dependency>
+ <!-- For paranamer -->
+ <dependency>
+ <groupId>com.thoughtworks.paranamer</groupId>
+ <artifactId>paranamer</artifactId>
+ <version>1.1</version>
+ </dependency>
+ <!-- For proxy -->
+ <dependency>
+ <groupId>asm</groupId>
+ <artifactId>asm</artifactId>
+ <version>3.0</version>
+ </dependency>
+ <dependency>
+ <groupId>proxytoys</groupId>
+ <artifactId>proxytoys</artifactId>
+ <version>0.2.1</version>
+ </dependency>
+ <!-- For monitors -->
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ <version>1.1.1</version>
+ </dependency>
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <version>1.2.8</version>
+ </dependency>
+ <dependency>
+ <groupId>prefuse</groupId>
+ <artifactId>prefuse</artifactId>
+ <version>2006.07.15</version>
+ </dependency>
+ <!-- For test -->
+ <dependency>
+ <groupId>org.jmock</groupId>
+ <artifactId>jmock-junit4</artifactId>
+ <version>2.4.0</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.thoughtworks.xstream</groupId>
+ <artifactId>xstream</artifactId>
+ <version>1.2.2</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>xpp3</groupId>
+ <artifactId>xpp3_min</artifactId>
+ <version>1.1.3.4.O</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>cglib</groupId>
+ <artifactId>cglib-nodep</artifactId>
+ <version>2.1_3</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+ <dependencies>
+ <!-- test scoped -->
+ <dependency>
+ <groupId>org.jmock</groupId>
+ <artifactId>jmock-junit4</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.thoughtworks.xstream</groupId>
+ <artifactId>xstream</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>xpp3</groupId>
+ <artifactId>xpp3_min</artifactId>
+ </dependency>
+ </dependencies>
+ <build>
+ <sourceDirectory>src/java</sourceDirectory>
+ <testSourceDirectory>src/test</testSourceDirectory>
+ <resources>
+ <resource>
+ <directory>src/java</directory>
+ <excludes>
+ <exclude>**/*.java</exclude>
+ </excludes>
+ </resource>
+ </resources>
+ <testResources>
+ <testResource>
+ <directory>src/test</directory>
+ <excludes>
+ <exclude>**/*.java</exclude>
+ </excludes>
+ </testResource>
+ </testResources>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>com.thoughtworks.paranamer</groupId>
+ <artifactId>paranamer-maven-plugin</artifactId>
+ <version>1.0.1</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>2.0.2</version>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ <encoding>UTF-8</encoding>
+ <optimize>false</optimize>
+ <debug>true</debug>
+ <showDeprecation>true</showDeprecation>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-source-plugin</artifactId>
+ <version>2.0.3</version>
+ <executions>
+ <execution>
+ <id>attach-sources</id>
+ <phase>package</phase>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <version>2.2</version>
+ <executions>
+ <execution>
+ <id>attach-javadocs</id>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <links>
+ <link>http://java.sun.com/j2se/1.5.0/docs/api/</link>
+ <link>http://proxytoys.codehaus.org/apidocs/</link>
+ <link>
+ http://jakarta.apache.org/commons/logging/commons-logging-1.0.4/docs/apidocs/
+ </link>
+ </links>
+ <stylesheet>maven</stylesheet>
+ <header>
+ <![CDATA[<img class="logo" src="http://www.picocontainer.org/images/pico-logo.png"></img>]]>
+ </header>
+ <linksource>true</linksource>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.4</version>
+ <configuration>
+ <junitArtifactName>junit:junit-dep</junitArtifactName>
+ <forkMode>once</forkMode>
+ <printSummary>true</printSummary>
+ <useFile>true</useFile>
+ <systemProperties>
+ <property>
+ <name>test.src.dir</name>
+ <value>${basedir}/src/test</value>
+ </property>
+ <property>
+ <name>java.awt.headless</name>
+ <value>true</value>
+ </property>
+ </systemProperties>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>cobertura-maven-plugin</artifactId>
+ <version>2.2</version>
+ <executions>
+ <execution>
+ <goals>
+ <goal>clean</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-release-plugin</artifactId>
+ <version>2.0-beta-7</version>
+ <configuration>
+ <autoVersionSubmodules>true</autoVersionSubmodules>
+ <preparationGoals>clean install</preparationGoals>
+ <tagBase>
+ https://svn.codehaus.org/picocontainer/java/2.x/tags/
+ </tagBase>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <version>2.1</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <version>2.0-alpha-4</version>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.xsite</groupId>
+ <artifactId>xsite-maven-plugin</artifactId>
+ <version>1.0-beta-9</version>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ </plugin>
+ </plugins>
+ <extensions>
+ <extension>
+ <groupId>org.apache.maven.wagon</groupId>
+ <artifactId>wagon-webdav</artifactId>
+ <version>1.0-beta-2</version>
+ </extension>
+ </extensions>
+ </build>
+ <profiles>
+ <profile>
+ <!-- No-test profile: equivalent to -Dmaven.test.skip=true -->
+ <id>nt</id>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ <profile>
+ <!-- reporting profile -->
+ <id>reporting</id>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-source-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+ <reporting>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-project-info-reports-plugin</artifactId>
+ <reportSets>
+ <reportSet>
+ <reports>
+ <report>dependencies</report>
+ <report>project-team</report>
+ <report>license</report>
+ <report>mailing-list</report>
+ <!--<report>scm</report>-->
+ </reports>
+ </reportSet>
+ </reportSets>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-report-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>cobertura-maven-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </reporting>
+ </profile>
+ <profile>
+ <!-- Distribution profile -->
+ <id>distribution</id>
+ <modules>
+ <module>distribution</module>
+ </modules>
+ </profile>
+ </profiles>
+</project>
\ No newline at end of file
Added: incubator/composer/tck/apache-composer-tck.iml
URL: http://svn.apache.org/viewvc/incubator/composer/tck/apache-composer-tck.iml?rev=613775&view=auto
==============================================================================
--- incubator/composer/tck/apache-composer-tck.iml (added)
+++ incubator/composer/tck/apache-composer-tck.iml Sun Jan 20 22:41:26 2008
@@ -0,0 +1,284 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module relativePaths="false" type="JAVA_MODULE" version="4">
+ <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_5" inherit-compiler-output="false">
+ <output url="file://$MODULE_DIR$/target/classes" />
+ <exclude-output />
+ <output-test url="file://$MODULE_DIR$/target/test-classes" />
+ <content url="file:///scm/oss/composer/composer/core/src/test">
+ <sourceFolder url="file:///scm/oss/composer/composer/core/src/test" isTestSource="false" />
+ </content>
+ <content url="file://$MODULE_DIR$">
+ <sourceFolder url="file://$MODULE_DIR$/src/java" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/src/test" isTestSource="true" />
+ </content>
+ <orderEntry type="inheritedJdk" />
+ <orderEntry type="sourceFolder" forTests="false" />
+ <orderEntry type="module-library" exported="">
+ <library name="com.thoughtworks.xstream:xstream:1.2.2">
+ <CLASSES>
+ <root url="jar://$M2_REPOSITORY$/com/thoughtworks/xstream/xstream/1.2.2/xstream-1.2.2.jar!/" />
+ </CLASSES>
+ <JAVADOC>
+ <root url="jar://$M2_REPOSITORY$/com/thoughtworks/xstream/xstream/1.2.2/xstream-1.2.2-javadoc.jar!/" />
+ </JAVADOC>
+ <SOURCES>
+ <root url="jar://$M2_REPOSITORY$/com/thoughtworks/xstream/xstream/1.2.2/xstream-1.2.2-sources.jar!/" />
+ </SOURCES>
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="junit:junit-dep:4.4">
+ <CLASSES>
+ <root url="jar://$M2_REPOSITORY$/junit/junit-dep/4.4/junit-dep-4.4.jar!/" />
+ </CLASSES>
+ <JAVADOC>
+ <root url="jar://$M2_REPOSITORY$/junit/junit-dep/4.4/junit-dep-4.4-javadoc.jar!/" />
+ </JAVADOC>
+ <SOURCES>
+ <root url="jar://$M2_REPOSITORY$/junit/junit-dep/4.4/junit-dep-4.4-sources.jar!/" />
+ </SOURCES>
+ </library>
+ </orderEntry>
+ <orderEntry type="module" module-name="apache-composer-core" exported="" />
+ <orderEntry type="module-library" exported="">
+ <library name="org.hamcrest:hamcrest-core:1.1">
+ <CLASSES>
+ <root url="jar://$M2_REPOSITORY$/org/hamcrest/hamcrest-core/1.1/hamcrest-core-1.1.jar!/" />
+ </CLASSES>
+ <JAVADOC>
+ <root url="jar://$M2_REPOSITORY$/org/hamcrest/hamcrest-core/1.1/hamcrest-core-1.1-javadoc.jar!/" />
+ </JAVADOC>
+ <SOURCES>
+ <root url="jar://$M2_REPOSITORY$/org/hamcrest/hamcrest-core/1.1/hamcrest-core-1.1-sources.jar!/" />
+ </SOURCES>
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="org.hamcrest:hamcrest-library:1.1">
+ <CLASSES>
+ <root url="jar://$M2_REPOSITORY$/org/hamcrest/hamcrest-library/1.1/hamcrest-library-1.1.jar!/" />
+ </CLASSES>
+ <JAVADOC>
+ <root url="jar://$M2_REPOSITORY$/org/hamcrest/hamcrest-library/1.1/hamcrest-library-1.1-javadoc.jar!/" />
+ </JAVADOC>
+ <SOURCES>
+ <root url="jar://$M2_REPOSITORY$/org/hamcrest/hamcrest-library/1.1/hamcrest-library-1.1-sources.jar!/" />
+ </SOURCES>
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="org.jmock:jmock-junit4:2.4.0">
+ <CLASSES>
+ <root url="jar://$M2_REPOSITORY$/org/jmock/jmock-junit4/2.4.0/jmock-junit4-2.4.0.jar!/" />
+ </CLASSES>
+ <JAVADOC>
+ <root url="jar://$M2_REPOSITORY$/org/jmock/jmock-junit4/2.4.0/jmock-junit4-2.4.0-javadoc.jar!/" />
+ </JAVADOC>
+ <SOURCES>
+ <root url="jar://$M2_REPOSITORY$/org/jmock/jmock-junit4/2.4.0/jmock-junit4-2.4.0-sources.jar!/" />
+ </SOURCES>
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="org.jmock:jmock:2.4.0">
+ <CLASSES>
+ <root url="jar://$M2_REPOSITORY$/org/jmock/jmock/2.4.0/jmock-2.4.0.jar!/" />
+ </CLASSES>
+ <JAVADOC>
+ <root url="jar://$M2_REPOSITORY$/org/jmock/jmock/2.4.0/jmock-2.4.0-javadoc.jar!/" />
+ </JAVADOC>
+ <SOURCES>
+ <root url="jar://$M2_REPOSITORY$/org/jmock/jmock/2.4.0/jmock-2.4.0-sources.jar!/" />
+ </SOURCES>
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="xpp3:xpp3_min:1.1.3.4.O">
+ <CLASSES>
+ <root url="jar://$M2_REPOSITORY$/xpp3/xpp3_min/1.1.3.4.O/xpp3_min-1.1.3.4.O.jar!/" />
+ </CLASSES>
+ <JAVADOC>
+ <root url="jar://$M2_REPOSITORY$/xpp3/xpp3_min/1.1.3.4.O/xpp3_min-1.1.3.4.O-javadoc.jar!/" />
+ </JAVADOC>
+ <SOURCES>
+ <root url="jar://$M2_REPOSITORY$/xpp3/xpp3_min/1.1.3.4.O/xpp3_min-1.1.3.4.O-sources.jar!/" />
+ </SOURCES>
+ </library>
+ </orderEntry>
+ <orderEntryProperties />
+ </component>
+ <component name="copyright">
+ <Base>
+ <setting name="state" value="2" />
+ </Base>
+ <LanguageOptions name="$TEMPLATE$">
+ <option name="templateOptions">
+ <value>
+ <option name="block" value="true" />
+ <option name="separateBefore" value="false" />
+ <option name="separateAfter" value="false" />
+ <option name="prefixLines" value="true" />
+ <option name="lenBefore" value="80" />
+ <option name="lenAfter" value="80" />
+ <option name="box" value="false" />
+ <option name="filler" value=" " />
+ </value>
+ </option>
+ <option name="notice" value="Copyright (c) &#36;today.year, Apache Composer Organization. All rights reserved. ------------------------------------------------------------------------- The software in this package is published under the terms of the BSD style license a copy of which has been included with this distribution in the LICENSE.txt file. " />
+ <option name="keyword" value="Copyright" />
+ <option name="fileTypeOverride" value="4" />
+ <option name="relativeBefore" value="true" />
+ <option name="addBlankAfter" value="true" />
+ <option name="fileLocation" value="1" />
+ <option name="useAlternate" value="false" />
+ </LanguageOptions>
+ <LanguageOptions name="CSS">
+ <option name="templateOptions">
+ <value>
+ <option name="block" value="true" />
+ <option name="separateBefore" value="false" />
+ <option name="separateAfter" value="false" />
+ <option name="prefixLines" value="true" />
+ <option name="lenBefore" value="80" />
+ <option name="lenAfter" value="80" />
+ <option name="box" value="false" />
+ <option name="filler" value=" " />
+ </value>
+ </option>
+ <option name="notice" value="Copyright (c) &#36;today.year, Your Corporation. All Rights Reserved." />
+ <option name="keyword" value="Copyright" />
+ <option name="fileTypeOverride" value="2" />
+ <option name="relativeBefore" value="true" />
+ <option name="addBlankAfter" value="true" />
+ <option name="fileLocation" value="1" />
+ <option name="useAlternate" value="false" />
+ </LanguageOptions>
+ <LanguageOptions name="HTML">
+ <option name="templateOptions">
+ <value>
+ <option name="block" value="true" />
+ <option name="separateBefore" value="false" />
+ <option name="separateAfter" value="false" />
+ <option name="prefixLines" value="true" />
+ <option name="lenBefore" value="80" />
+ <option name="lenAfter" value="80" />
+ <option name="box" value="false" />
+ <option name="filler" value=" " />
+ </value>
+ </option>
+ <option name="notice" value="Copyright (c) &#36;today.year, Your Corporation. All Rights Reserved." />
+ <option name="keyword" value="Copyright" />
+ <option name="fileTypeOverride" value="2" />
+ <option name="relativeBefore" value="true" />
+ <option name="addBlankAfter" value="true" />
+ <option name="fileLocation" value="1" />
+ <option name="useAlternate" value="false" />
+ </LanguageOptions>
+ <LanguageOptions name="JAVA">
+ <option name="templateOptions">
+ <value>
+ <option name="block" value="true" />
+ <option name="separateBefore" value="false" />
+ <option name="separateAfter" value="false" />
+ <option name="prefixLines" value="true" />
+ <option name="lenBefore" value="80" />
+ <option name="lenAfter" value="80" />
+ <option name="box" value="false" />
+ <option name="filler" value=" " />
+ </value>
+ </option>
+ <option name="notice" value="Copyright (c) &#36;today.year, Your Corporation. All Rights Reserved." />
+ <option name="keyword" value="Copyright" />
+ <option name="fileTypeOverride" value="2" />
+ <option name="relativeBefore" value="true" />
+ <option name="addBlankAfter" value="true" />
+ <option name="fileLocation" value="1" />
+ <option name="useAlternate" value="false" />
+ </LanguageOptions>
+ <LanguageOptions name="JSP">
+ <option name="templateOptions">
+ <value>
+ <option name="block" value="true" />
+ <option name="separateBefore" value="false" />
+ <option name="separateAfter" value="false" />
+ <option name="prefixLines" value="true" />
+ <option name="lenBefore" value="80" />
+ <option name="lenAfter" value="80" />
+ <option name="box" value="false" />
+ <option name="filler" value=" " />
+ </value>
+ </option>
+ <option name="notice" value="Copyright (c) &#36;today.year, Your Corporation. All Rights Reserved." />
+ <option name="keyword" value="Copyright" />
+ <option name="fileTypeOverride" value="2" />
+ <option name="relativeBefore" value="true" />
+ <option name="addBlankAfter" value="true" />
+ <option name="fileLocation" value="1" />
+ <option name="useAlternate" value="false" />
+ </LanguageOptions>
+ <LanguageOptions name="JavaScript">
+ <option name="templateOptions">
+ <value>
+ <option name="block" value="true" />
+ <option name="separateBefore" value="false" />
+ <option name="separateAfter" value="false" />
+ <option name="prefixLines" value="true" />
+ <option name="lenBefore" value="80" />
+ <option name="lenAfter" value="80" />
+ <option name="box" value="false" />
+ <option name="filler" value=" " />
+ </value>
+ </option>
+ <option name="notice" value="Copyright (c) &#36;today.year, Your Corporation. All Rights Reserved." />
+ <option name="keyword" value="Copyright" />
+ <option name="fileTypeOverride" value="2" />
+ <option name="relativeBefore" value="true" />
+ <option name="addBlankAfter" value="true" />
+ <option name="fileLocation" value="1" />
+ <option name="useAlternate" value="false" />
+ </LanguageOptions>
+ <LanguageOptions name="Properties">
+ <option name="templateOptions">
+ <value>
+ <option name="block" value="true" />
+ <option name="separateBefore" value="false" />
+ <option name="separateAfter" value="false" />
+ <option name="prefixLines" value="true" />
+ <option name="lenBefore" value="80" />
+ <option name="lenAfter" value="80" />
+ <option name="box" value="false" />
+ <option name="filler" value=" " />
+ </value>
+ </option>
+ <option name="notice" value="Copyright (c) &#36;today.year, Your Corporation. All Rights Reserved." />
+ <option name="keyword" value="Copyright" />
+ <option name="fileTypeOverride" value="2" />
+ <option name="relativeBefore" value="true" />
+ <option name="addBlankAfter" value="true" />
+ <option name="fileLocation" value="1" />
+ <option name="useAlternate" value="false" />
+ </LanguageOptions>
+ <LanguageOptions name="XML">
+ <option name="templateOptions">
+ <value>
+ <option name="block" value="true" />
+ <option name="separateBefore" value="false" />
+ <option name="separateAfter" value="false" />
+ <option name="prefixLines" value="true" />
+ <option name="lenBefore" value="80" />
+ <option name="lenAfter" value="80" />
+ <option name="box" value="false" />
+ <option name="filler" value=" " />
+ </value>
+ </option>
+ <option name="notice" value="Copyright (c) &#36;today.year, Your Corporation. All Rights Reserved." />
+ <option name="keyword" value="Copyright" />
+ <option name="fileTypeOverride" value="2" />
+ <option name="relativeBefore" value="true" />
+ <option name="addBlankAfter" value="true" />
+ <option name="fileLocation" value="1" />
+ <option name="useAlternate" value="false" />
+ </LanguageOptions>
+ </component>
+</module>
+
Added: incubator/composer/tck/pom.xml
URL: http://svn.apache.org/viewvc/incubator/composer/tck/pom.xml?rev=613775&view=auto
==============================================================================
--- incubator/composer/tck/pom.xml (added)
+++ incubator/composer/tck/pom.xml Sun Jan 20 22:41:26 2008
@@ -0,0 +1,54 @@
+<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/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.composer</groupId>
+ <artifactId>apache-composer-parent</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ </parent>
+ <artifactId>apache-composer-tck</artifactId>
+ <name>Apache Composer TCK</name>
+ <packaging>jar</packaging>
+ <dependencies>
+ <dependency>
+ <groupId>${pom.groupId}</groupId>
+ <artifactId>apache-composer-core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jmock</groupId>
+ <artifactId>jmock-junit4</artifactId>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.thoughtworks.xstream</groupId>
+ <artifactId>xstream</artifactId>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>xpp3</groupId>
+ <artifactId>xpp3_min</artifactId>
+ <scope>compile</scope>
+ </dependency>
+ </dependencies>
+ <build>
+ <sourceDirectory>../core/src/test</sourceDirectory>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <includes>
+ <include>
+ org/apache/composer/core/tck/**/*.java
+ </include>
+ <include>
+ org/apache/composer/core/testmodel/**/*.java
+ </include>
+ </includes>
+ <source>1.5</source>
+ <target>1.5</target>
+ <encoding>UTF-8</encoding>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
\ No newline at end of file