incubator-aries-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hugh...@apache.org
Subject svn commit: r820722 [6/8] - in /incubator/aries/contrib: ./ ibm/ ibm/aries.image/ ibm/build/ ibm/build/buildtasks/ ibm/build/buildtasks/src/ ibm/build/buildtasks/src/com/ ibm/build/buildtasks/src/com/ibm/ ibm/build/buildtasks/src/com/ibm/aries/ ibm/bui...
Date Thu, 01 Oct 2009 17:19:21 GMT
Added: incubator/aries/contrib/ibm/com.ibm.osgi.jpa.unit.manager/unittest/resources/file16/META-INF/persistence.xml
URL: http://svn.apache.org/viewvc/incubator/aries/contrib/ibm/com.ibm.osgi.jpa.unit.manager/unittest/resources/file16/META-INF/persistence.xml?rev=820722&view=auto
==============================================================================
--- incubator/aries/contrib/ibm/com.ibm.osgi.jpa.unit.manager/unittest/resources/file16/META-INF/persistence.xml (added)
+++ incubator/aries/contrib/ibm/com.ibm.osgi.jpa.unit.manager/unittest/resources/file16/META-INF/persistence.xml Thu Oct  1 17:19:13 2009
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<persistence xmlns="http://java.sun.com/xml/ns/persistence"
+   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+   xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
+   version="1.0">
+
+  <persistence-unit name="alpha">
+  	<provider>no.such.Provider</provider>
+  	<properties>
+      <property name="osgi.jpa.provider.version" value="[1.0.0,2.0.0]"/>
+    </properties>
+  </persistence-unit>  
+  
+  <persistence-unit name="bravo">
+  	<provider>no.such.Provider</provider>
+  	<properties>
+      <property name="osgi.jpa.provider.version" value="[0.0.5,0.9.9]"/>
+    </properties>
+  </persistence-unit>
+  
+    <persistence-unit name="ch">
+  	<provider>no.such.Provider</provider>
+  	<properties>
+      <property name="osgi.jpa.provider.version" value="[1.0.0,1.9.9]"/>
+    </properties>
+  </persistence-unit>
+  
+</persistence>
\ No newline at end of file

Added: incubator/aries/contrib/ibm/com.ibm.osgi.jpa.unit.manager/unittest/resources/file17/META-INF/persistence.xml
URL: http://svn.apache.org/viewvc/incubator/aries/contrib/ibm/com.ibm.osgi.jpa.unit.manager/unittest/resources/file17/META-INF/persistence.xml?rev=820722&view=auto
==============================================================================
--- incubator/aries/contrib/ibm/com.ibm.osgi.jpa.unit.manager/unittest/resources/file17/META-INF/persistence.xml (added)
+++ incubator/aries/contrib/ibm/com.ibm.osgi.jpa.unit.manager/unittest/resources/file17/META-INF/persistence.xml Thu Oct  1 17:19:13 2009
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<persistence xmlns="http://java.sun.com/xml/ns/persistence"
+   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+   xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
+   version="1.0">
+
+  <persistence-unit name="alpha">
+  	<provider>no.such.Provider</provider>
+  	<properties>
+      <property name="osgi.jpa.provider.version" value="[1.0.0,1.0.1]"/>
+    </properties>
+  </persistence-unit>  
+  
+  <persistence-unit name="bravo">
+  	<provider>no.such.Provider</provider>
+  	<properties>
+      <property name="osgi.jpa.provider.version" value="[1.1.0,1.1.1]"/>
+    </properties>
+  </persistence-unit>
+  
+</persistence>
\ No newline at end of file

Added: incubator/aries/contrib/ibm/com.ibm.osgi.jpa.unit.manager/unittest/resources/file18/META-INF/persistence.xml
URL: http://svn.apache.org/viewvc/incubator/aries/contrib/ibm/com.ibm.osgi.jpa.unit.manager/unittest/resources/file18/META-INF/persistence.xml?rev=820722&view=auto
==============================================================================
--- incubator/aries/contrib/ibm/com.ibm.osgi.jpa.unit.manager/unittest/resources/file18/META-INF/persistence.xml (added)
+++ incubator/aries/contrib/ibm/com.ibm.osgi.jpa.unit.manager/unittest/resources/file18/META-INF/persistence.xml Thu Oct  1 17:19:13 2009
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<persistence xmlns="http://java.sun.com/xml/ns/persistence"
+   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+   xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
+   version="1.0">
+
+  <persistence-unit name="alpha">
+  	<provider>no.such.Provider</provider>
+  	<properties>
+      <property name="osgi.jpa.provider.version" value="[0.0.0,0.0.1]"/>
+    </properties>
+  </persistence-unit>  
+  
+  <persistence-unit name="bravo">
+  	<provider>no.such.Provider</provider>
+  	<properties>
+      <property name="osgi.jpa.provider.version" value="[1.1.0,1.1.1]"/>
+    </properties>
+  </persistence-unit>
+  
+</persistence>
\ No newline at end of file

Added: incubator/aries/contrib/ibm/com.ibm.osgi.jpa.unit.manager/unittest/resources/file19/META-INF/persistence.xml
URL: http://svn.apache.org/viewvc/incubator/aries/contrib/ibm/com.ibm.osgi.jpa.unit.manager/unittest/resources/file19/META-INF/persistence.xml?rev=820722&view=auto
==============================================================================
--- incubator/aries/contrib/ibm/com.ibm.osgi.jpa.unit.manager/unittest/resources/file19/META-INF/persistence.xml (added)
+++ incubator/aries/contrib/ibm/com.ibm.osgi.jpa.unit.manager/unittest/resources/file19/META-INF/persistence.xml Thu Oct  1 17:19:13 2009
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<persistence xmlns="http://java.sun.com/xml/ns/persistence"
+   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+   xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
+   version="1.0">
+
+  <persistence-unit name="alpha">
+  	<provider>no.such.Provider</provider>
+  	<properties>
+      <property name="osgi.jpa.provider.version" value="[0.0.0,0.0.1]"/>
+    </properties>
+  </persistence-unit>  
+  
+  <persistence-unit name="bravo">
+  	<provider>no.such.Provider</provider>
+  	<properties>
+      <property name="osgi.jpa.provider.version" value="[1.1.0,1.1.1]"/>
+    </properties>
+  </persistence-unit>
+
+  <persistence-unit name="charlie">
+  	<provider>no.such.Provider</provider>
+  	<properties>
+      <property name="osgi.jpa.provider.version" value="[0.0.0,0.6.1]"/>
+    </properties>
+  </persistence-unit>    
+</persistence>
\ No newline at end of file

Added: incubator/aries/contrib/ibm/com.ibm.osgi.jpa.unit.manager/unittest/resources/file2/META-INF/persistence.xml
URL: http://svn.apache.org/viewvc/incubator/aries/contrib/ibm/com.ibm.osgi.jpa.unit.manager/unittest/resources/file2/META-INF/persistence.xml?rev=820722&view=auto
==============================================================================
--- incubator/aries/contrib/ibm/com.ibm.osgi.jpa.unit.manager/unittest/resources/file2/META-INF/persistence.xml (added)
+++ incubator/aries/contrib/ibm/com.ibm.osgi.jpa.unit.manager/unittest/resources/file2/META-INF/persistence.xml Thu Oct  1 17:19:13 2009
@@ -0,0 +1,28 @@
+<persistence xmlns="http://java.sun.com/xml/ns/persistence"
+   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+   xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
+   version="1.0">
+
+  <!-- This is an empty persistence.xml file -->
+  
+  <!--   
+  <persistence-unit name="bravo" transaction-type="JTA">
+    <description>Persistence unit example2 for the unittest</description>
+    <provider>bravo.persistence.provider</provider>
+    <jta-data-source>bravo/jtaDS</jta-data-source>
+    <non-jta-data-source>bravo/nonJtaDS</non-jta-data-source>
+    <mapping-file>bravoMappingFile1.xml</mapping-file>
+    <mapping-file>bravoMappingFile2.xml</mapping-file>
+    <jar-file>bravoJarFile1.jar</jar-file>
+    <jar-file>bravoJarFile2.jar</jar-file>
+    <class>bravoClass1</class>
+    <class>bravoClass2</class>
+    <exclude-unlisted-classes/>
+    <properties>
+      <property name="some.prop" value="prop.value"/>
+      <property name="some.other.prop" value="another.prop.value"/>
+    </properties>
+  </persistence-unit> 
+  -->  
+  
+</persistence>
\ No newline at end of file

Added: incubator/aries/contrib/ibm/com.ibm.osgi.jpa.unit.manager/unittest/resources/file20/META-INF/persistence.xml
URL: http://svn.apache.org/viewvc/incubator/aries/contrib/ibm/com.ibm.osgi.jpa.unit.manager/unittest/resources/file20/META-INF/persistence.xml?rev=820722&view=auto
==============================================================================
--- incubator/aries/contrib/ibm/com.ibm.osgi.jpa.unit.manager/unittest/resources/file20/META-INF/persistence.xml (added)
+++ incubator/aries/contrib/ibm/com.ibm.osgi.jpa.unit.manager/unittest/resources/file20/META-INF/persistence.xml Thu Oct  1 17:19:13 2009
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<persistence xmlns="http://java.sun.com/xml/ns/persistence"
+   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+   xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
+   version="1.0">
+
+  <persistence-unit name="alpha">
+  	<provider>no.such.Provider</provider>
+  	<properties>
+      <property name="osgi.jpa.provider.version" value="[1.0.0,1.1.1]"/>
+    </properties>
+  </persistence-unit>  
+  
+  <persistence-unit name="bravo">
+  	<provider>no.such.Provider</provider>
+  	<properties>
+      <property name="osgi.jpa.provider.version" value="[0.0.0,0.0.1]"/>
+    </properties>
+  </persistence-unit>  
+  
+  <persistence-unit name="charlie">
+  	<provider>no.such.Provider</provider>
+  	<properties>
+      <property name="osgi.jpa.provider.version" value="[1.1.0,1.1.1]"/>
+    </properties>
+  </persistence-unit>
+  
+</persistence>
\ No newline at end of file

Added: incubator/aries/contrib/ibm/com.ibm.osgi.jpa.unit.manager/unittest/resources/file3/META-INF/persistence.xml
URL: http://svn.apache.org/viewvc/incubator/aries/contrib/ibm/com.ibm.osgi.jpa.unit.manager/unittest/resources/file3/META-INF/persistence.xml?rev=820722&view=auto
==============================================================================
--- incubator/aries/contrib/ibm/com.ibm.osgi.jpa.unit.manager/unittest/resources/file3/META-INF/persistence.xml (added)
+++ incubator/aries/contrib/ibm/com.ibm.osgi.jpa.unit.manager/unittest/resources/file3/META-INF/persistence.xml Thu Oct  1 17:19:13 2009
@@ -0,0 +1,28 @@
+<persistence xmlns="http://java.sun.com/xml/ns/persistence"
+   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+   xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
+   version="1.0">
+
+  <!-- This is an empty persistence.xml file -->
+  
+  <persistence-unit name="bravo" transaction-type="J_T_A">
+    <description>
+      <provider>bravo.persistence.provider</provider>
+    </description>
+    <jta-data-source>bravo/jtaDS</jta-data-source>
+    <non-jta-data-source>bravo/nonJtaDS</non-jta-data-source>
+    <mapping-file>bravoMappingFile1.xml</mapping-file>
+    <mapping-file>bravoMappingFile2.xml</mapping-file>
+    <jar-file>bravoJarFile1.jar</jar-file>
+    <jar-file>bravoJarFile2.jar</jar-file>
+    <class>bravoClass1</class>
+    <class>bravoClass2</class>
+    <exclude-unlisted-classes/>
+    <properties>
+      <property name="some.prop" value="prop.value"/>
+      <property name="some.other.prop" value="another.prop.value"/>
+    </properties>
+  </persistence-unit> 
+ 
+  
+</persistence>
\ No newline at end of file

Added: incubator/aries/contrib/ibm/com.ibm.osgi.jpa.unit.manager/unittest/resources/file4/META-INF/persistence.xml
URL: http://svn.apache.org/viewvc/incubator/aries/contrib/ibm/com.ibm.osgi.jpa.unit.manager/unittest/resources/file4/META-INF/persistence.xml?rev=820722&view=auto
==============================================================================
--- incubator/aries/contrib/ibm/com.ibm.osgi.jpa.unit.manager/unittest/resources/file4/META-INF/persistence.xml (added)
+++ incubator/aries/contrib/ibm/com.ibm.osgi.jpa.unit.manager/unittest/resources/file4/META-INF/persistence.xml Thu Oct  1 17:19:13 2009
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<persistence xmlns="http://java.sun.com/xml/ns/persistence"
+   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+   xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
+   version="1.0">
+
+  <persistence-unit name="alpha">
+  	<provider>no.such.Provider</provider>
+  </persistence-unit>  
+  
+</persistence>
\ No newline at end of file

Added: incubator/aries/contrib/ibm/com.ibm.osgi.jpa.unit.manager/unittest/resources/file5/META-INF/persistence.xml
URL: http://svn.apache.org/viewvc/incubator/aries/contrib/ibm/com.ibm.osgi.jpa.unit.manager/unittest/resources/file5/META-INF/persistence.xml?rev=820722&view=auto
==============================================================================
--- incubator/aries/contrib/ibm/com.ibm.osgi.jpa.unit.manager/unittest/resources/file5/META-INF/persistence.xml (added)
+++ incubator/aries/contrib/ibm/com.ibm.osgi.jpa.unit.manager/unittest/resources/file5/META-INF/persistence.xml Thu Oct  1 17:19:13 2009
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<persistence xmlns="http://java.sun.com/xml/ns/persistence"
+   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+   xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
+   version="1.0">
+
+  <persistence-unit name="alpha"/>
+  
+</persistence>
\ No newline at end of file

Added: incubator/aries/contrib/ibm/com.ibm.osgi.jpa.unit.manager/unittest/resources/file6/META-INF/persistence.xml
URL: http://svn.apache.org/viewvc/incubator/aries/contrib/ibm/com.ibm.osgi.jpa.unit.manager/unittest/resources/file6/META-INF/persistence.xml?rev=820722&view=auto
==============================================================================
--- incubator/aries/contrib/ibm/com.ibm.osgi.jpa.unit.manager/unittest/resources/file6/META-INF/persistence.xml (added)
+++ incubator/aries/contrib/ibm/com.ibm.osgi.jpa.unit.manager/unittest/resources/file6/META-INF/persistence.xml Thu Oct  1 17:19:13 2009
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<persistence xmlns="http://java.sun.com/xml/ns/persistence"
+   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+   xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
+   version="1.0">
+
+  <persistence-unit name="alpha">
+  	<provider>no.such.Provider</provider>
+  </persistence-unit>  
+
+  <persistence-unit name="bravo">
+  	<provider>no.such.Provider</provider>
+  </persistence-unit>  
+  
+</persistence>
\ No newline at end of file

Added: incubator/aries/contrib/ibm/com.ibm.osgi.jpa.unit.manager/unittest/resources/file7/META-INF/persistence.xml
URL: http://svn.apache.org/viewvc/incubator/aries/contrib/ibm/com.ibm.osgi.jpa.unit.manager/unittest/resources/file7/META-INF/persistence.xml?rev=820722&view=auto
==============================================================================
--- incubator/aries/contrib/ibm/com.ibm.osgi.jpa.unit.manager/unittest/resources/file7/META-INF/persistence.xml (added)
+++ incubator/aries/contrib/ibm/com.ibm.osgi.jpa.unit.manager/unittest/resources/file7/META-INF/persistence.xml Thu Oct  1 17:19:13 2009
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<persistence xmlns="http://java.sun.com/xml/ns/persistence"
+   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+   xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
+   version="1.0">
+
+  <persistence-unit name="bravo"/>
+
+  <persistence-unit name="alpha">
+  	<provider>no.such.Provider</provider>
+  </persistence-unit>  
+  
+</persistence>
\ No newline at end of file

Added: incubator/aries/contrib/ibm/com.ibm.osgi.jpa.unit.manager/unittest/resources/file8/META-INF/persistence.xml
URL: http://svn.apache.org/viewvc/incubator/aries/contrib/ibm/com.ibm.osgi.jpa.unit.manager/unittest/resources/file8/META-INF/persistence.xml?rev=820722&view=auto
==============================================================================
--- incubator/aries/contrib/ibm/com.ibm.osgi.jpa.unit.manager/unittest/resources/file8/META-INF/persistence.xml (added)
+++ incubator/aries/contrib/ibm/com.ibm.osgi.jpa.unit.manager/unittest/resources/file8/META-INF/persistence.xml Thu Oct  1 17:19:13 2009
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<persistence xmlns="http://java.sun.com/xml/ns/persistence"
+   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+   xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
+   version="1.0">
+
+  <persistence-unit name="alpha">
+  	<provider>no.such.Provider</provider>
+  </persistence-unit>  
+
+  <persistence-unit name="bravo">
+  	<provider>an.other.no.such.Provider</provider>
+  </persistence-unit>
+  
+</persistence>
\ No newline at end of file

Added: incubator/aries/contrib/ibm/com.ibm.osgi.jpa.unit.manager/unittest/resources/file9/META-INF/persistence.xml
URL: http://svn.apache.org/viewvc/incubator/aries/contrib/ibm/com.ibm.osgi.jpa.unit.manager/unittest/resources/file9/META-INF/persistence.xml?rev=820722&view=auto
==============================================================================
--- incubator/aries/contrib/ibm/com.ibm.osgi.jpa.unit.manager/unittest/resources/file9/META-INF/persistence.xml (added)
+++ incubator/aries/contrib/ibm/com.ibm.osgi.jpa.unit.manager/unittest/resources/file9/META-INF/persistence.xml Thu Oct  1 17:19:13 2009
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<persistence xmlns="http://java.sun.com/xml/ns/persistence"
+   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+   xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
+   version="1.0">
+
+  <persistence-unit name="alpha">
+  	<provider>no.such.Provider</provider>
+  	<properties>
+      <property name="osgi.jpa.provider.version" value="[1.0.0,1.0.0]"/>
+    </properties>
+  </persistence-unit>  
+  
+</persistence>
\ No newline at end of file

Added: incubator/aries/contrib/ibm/com.ibm.osgi.jpa.unit.manager/unittest/resources/jarfile/META-INF/persistence.xml
URL: http://svn.apache.org/viewvc/incubator/aries/contrib/ibm/com.ibm.osgi.jpa.unit.manager/unittest/resources/jarfile/META-INF/persistence.xml?rev=820722&view=auto
==============================================================================
--- incubator/aries/contrib/ibm/com.ibm.osgi.jpa.unit.manager/unittest/resources/jarfile/META-INF/persistence.xml (added)
+++ incubator/aries/contrib/ibm/com.ibm.osgi.jpa.unit.manager/unittest/resources/jarfile/META-INF/persistence.xml Thu Oct  1 17:19:13 2009
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<persistence xmlns="http://java.sun.com/xml/ns/persistence"
+   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+   xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
+   version="1.0">
+
+  <persistence-unit name="alpha"/>
+  
+</persistence>
\ No newline at end of file

Added: incubator/aries/contrib/ibm/com.ibm.osgi.utils/.aries
URL: http://svn.apache.org/viewvc/incubator/aries/contrib/ibm/com.ibm.osgi.utils/.aries?rev=820722&view=auto
==============================================================================
    (empty)

Added: incubator/aries/contrib/ibm/com.ibm.osgi.utils/.classpath
URL: http://svn.apache.org/viewvc/incubator/aries/contrib/ibm/com.ibm.osgi.utils/.classpath?rev=820722&view=auto
==============================================================================
--- incubator/aries/contrib/ibm/com.ibm.osgi.utils/.classpath (added)
+++ incubator/aries/contrib/ibm/com.ibm.osgi.utils/.classpath Thu Oct  1 17:19:13 2009
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="src" path="src"/>
+	<classpathentry kind="src" path="unittest"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
+	<classpathentry combineaccessrules="false" kind="src" path="/unittest.framework"/>
+	<classpathentry kind="output" path="build/classes"/>
+</classpath>

Added: incubator/aries/contrib/ibm/com.ibm.osgi.utils/.project
URL: http://svn.apache.org/viewvc/incubator/aries/contrib/ibm/com.ibm.osgi.utils/.project?rev=820722&view=auto
==============================================================================
--- incubator/aries/contrib/ibm/com.ibm.osgi.utils/.project (added)
+++ incubator/aries/contrib/ibm/com.ibm.osgi.utils/.project Thu Oct  1 17:19:13 2009
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>com.ibm.osgi.utils</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.ManifestBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.SchemaBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.pde.PluginNature</nature>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
+</projectDescription>

Added: incubator/aries/contrib/ibm/com.ibm.osgi.utils/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/incubator/aries/contrib/ibm/com.ibm.osgi.utils/META-INF/MANIFEST.MF?rev=820722&view=auto
==============================================================================
--- incubator/aries/contrib/ibm/com.ibm.osgi.utils/META-INF/MANIFEST.MF (added)
+++ incubator/aries/contrib/ibm/com.ibm.osgi.utils/META-INF/MANIFEST.MF Thu Oct  1 17:19:13 2009
@@ -0,0 +1,8 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Utils Plug-in
+Bundle-SymbolicName: com.ibm.osgi.utils
+Bundle-Version: 1.0.0
+Bundle-Vendor: IBM
+Import-Package: org.osgi.framework;version="1.3.0"
+Export-Package: com.ibm.osgi.util

Added: incubator/aries/contrib/ibm/com.ibm.osgi.utils/build.properties
URL: http://svn.apache.org/viewvc/incubator/aries/contrib/ibm/com.ibm.osgi.utils/build.properties?rev=820722&view=auto
==============================================================================
--- incubator/aries/contrib/ibm/com.ibm.osgi.utils/build.properties (added)
+++ incubator/aries/contrib/ibm/com.ibm.osgi.utils/build.properties Thu Oct  1 17:19:13 2009
@@ -0,0 +1,4 @@
+source.. = src/
+output.. = build/classes/
+bin.includes = META-INF/,\
+               .

Added: incubator/aries/contrib/ibm/com.ibm.osgi.utils/build.xml
URL: http://svn.apache.org/viewvc/incubator/aries/contrib/ibm/com.ibm.osgi.utils/build.xml?rev=820722&view=auto
==============================================================================
--- incubator/aries/contrib/ibm/com.ibm.osgi.utils/build.xml (added)
+++ incubator/aries/contrib/ibm/com.ibm.osgi.utils/build.xml Thu Oct  1 17:19:13 2009
@@ -0,0 +1,6 @@
+<!-- (C) Copyright IBM Corp. 2009 -->
+
+<project name="com.ibm.osgi.utils" default="build" basedir=".">
+  <property name="aries.image" value="true"/>
+  <import file="../build/imports/standard_imports.xml"/>
+</project>
\ No newline at end of file

Added: incubator/aries/contrib/ibm/com.ibm.osgi.utils/src/com/ibm/osgi/util/FragmentBuilder.java
URL: http://svn.apache.org/viewvc/incubator/aries/contrib/ibm/com.ibm.osgi.utils/src/com/ibm/osgi/util/FragmentBuilder.java?rev=820722&view=auto
==============================================================================
--- incubator/aries/contrib/ibm/com.ibm.osgi.utils/src/com/ibm/osgi/util/FragmentBuilder.java (added)
+++ incubator/aries/contrib/ibm/com.ibm.osgi.utils/src/com/ibm/osgi/util/FragmentBuilder.java Thu Oct  1 17:19:13 2009
@@ -0,0 +1,181 @@
+/*
+ * (C) Copyright IBM Corp. 2009
+ */
+package com.ibm.osgi.util;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.jar.Attributes;
+import java.util.jar.JarEntry;
+import java.util.jar.JarOutputStream;
+import java.util.jar.Manifest;
+
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.BundleException;
+import org.osgi.framework.Constants;
+
+public class FragmentBuilder
+{
+  private List<String> importPackages = new ArrayList<String>();
+  private List<String> exportPackages = new ArrayList<String>();
+  private Bundle hostBundle;
+  private String nameExtension;
+  private String fragmentName;
+  private Map<String,byte[]> files = new HashMap<String, byte[]>();
+  
+  public FragmentBuilder(Bundle host, String extension)
+  {
+    hostBundle = host;
+    nameExtension = extension;
+    
+    // make sure we have an initial '.'
+    if (!!!nameExtension.startsWith("."))
+      nameExtension = "."+nameExtension;
+  }
+  
+  public void setName(String name) {
+    fragmentName = name;
+  }
+  
+  public void addImports(String ... imports) {
+    importPackages.addAll(Arrays.asList(imports));
+  }
+  
+  public void addExports(String ... imports) {
+    exportPackages.addAll(Arrays.asList(imports));
+  }
+  
+  public void addImportsFromExports(Bundle exportBundle) {
+    String exportString = (String) exportBundle.getHeaders().get(
+        Constants.EXPORT_PACKAGE);
+    
+    if (exportString != null) {
+      String exportVersion = exportBundle.getVersion().toString();
+      String bundleConstraint = 
+        Constants.BUNDLE_SYMBOLICNAME_ATTRIBUTE + "=\"" + exportBundle.getSymbolicName() + "\"";
+      String bundleVersionConstraint = 
+        Constants.BUNDLE_VERSION_ATTRIBUTE + "=\"[" + exportVersion + "," + exportVersion + "]\"";
+
+      for (String export : exportString.split("\\s*,\\s*")) {
+        importPackages.add(convertExportToImport(export, bundleConstraint, bundleVersionConstraint));
+      }
+    }    
+  }
+
+  /**
+   * Filter out directives in the export statement
+   * @param exportStatement
+   * @return
+   */
+  private String convertExportToImport(String exportStatement, String bundleConstraint, String bundleVersionConstraint) 
+  {
+    StringBuffer result = new StringBuffer();
+    
+    for (String fragment : exportStatement.split("\\s*;\\s*")) {
+      int pos = fragment.indexOf('=');
+      
+      // similar to fragment.contains(":=") but looks for the first '=' and checks whether this is part of ':='
+      // in this way we will not be fooled by attributes like a="something:=strange"
+      if (!!!(pos > 0 && fragment.charAt(pos-1) == ':')) {
+        result.append(fragment);
+        result.append(';');
+      }
+    }
+    
+    result.append(bundleConstraint);
+    result.append(';');
+    result.append(bundleVersionConstraint);
+    
+    return result.toString();
+  }
+  
+  public void addFile(String path, byte[] content) {
+    files.put(path, content);
+  }
+  
+  public Bundle install(BundleContext ctx) throws IOException, BundleException
+  {
+    ByteArrayOutputStream baos = new ByteArrayOutputStream();
+    JarOutputStream jos = null;
+    
+    try {
+      jos = new JarOutputStream(baos, makeManifest());
+      addFileContent(jos);
+    }
+    finally {
+      if (jos != null) jos.close();
+      baos.close();
+    }
+    
+    byte[] inMemoryJar = baos.toByteArray();
+    ByteArrayInputStream bais = new ByteArrayInputStream(inMemoryJar);
+
+    return ctx.installBundle(getFragmentSymbolicName(), bais);
+  }
+  
+  private void addFileContent(JarOutputStream jos) throws IOException
+  {
+    for (Map.Entry<String, byte[]> entry : files.entrySet()) {
+      jos.putNextEntry(new JarEntry(entry.getKey()));
+      jos.write(entry.getValue());
+    }
+  }
+  
+  public String getFragmentSymbolicName() 
+  {
+    return hostBundle.getSymbolicName() + nameExtension;
+  }
+  
+  private Manifest makeManifest() 
+  {
+    String commonVersion = hostBundle.getVersion().toString();
+    String fragmentHost = hostBundle.getSymbolicName() + ";"+Constants.BUNDLE_VERSION_ATTRIBUTE+"=\"" + commonVersion + "\"";
+    
+    Manifest m = new Manifest();
+    Attributes manifestAttributes = m.getMainAttributes();
+    manifestAttributes.putValue(Attributes.Name.MANIFEST_VERSION.toString(), "1.0");
+    manifestAttributes.putValue(Constants.BUNDLE_MANIFESTVERSION, "2");
+    manifestAttributes.putValue(Constants.BUNDLE_SYMBOLICNAME, getFragmentSymbolicName());
+    if (fragmentName != null)
+      manifestAttributes.putValue(Constants.BUNDLE_NAME, fragmentName);
+    manifestAttributes.putValue(Constants.BUNDLE_VERSION, commonVersion);
+    manifestAttributes.putValue(Constants.BUNDLE_VENDOR, "IBM");
+    manifestAttributes.putValue(Constants.FRAGMENT_HOST, fragmentHost);
+    
+    addImportsAndExports(manifestAttributes);
+
+    return m;
+  }
+  
+  private void addImportsAndExports(Attributes attrs) {
+    if (!!!importPackages.isEmpty()) {
+      attrs.putValue(Constants.IMPORT_PACKAGE, joinStrings(importPackages, ','));
+    }
+    
+    if (!!!exportPackages.isEmpty()) {
+      attrs.putValue(Constants.EXPORT_PACKAGE, joinStrings(exportPackages, ','));
+    }
+  }
+  
+  private String joinStrings(List<String> strs, char separator) {
+    StringBuilder result = new StringBuilder();
+    boolean first = true;
+    for (String str : strs) {
+      if (first)
+        first = false;
+      else
+        result.append(separator);
+      
+      result.append(str);
+    }
+    
+    return result.toString();
+  }
+}

Added: incubator/aries/contrib/ibm/com.ibm.osgi.utils/unittest/com/ibm/osgi/util/FragmentUtilsTest.java
URL: http://svn.apache.org/viewvc/incubator/aries/contrib/ibm/com.ibm.osgi.utils/unittest/com/ibm/osgi/util/FragmentUtilsTest.java?rev=820722&view=auto
==============================================================================
--- incubator/aries/contrib/ibm/com.ibm.osgi.utils/unittest/com/ibm/osgi/util/FragmentUtilsTest.java (added)
+++ incubator/aries/contrib/ibm/com.ibm.osgi.utils/unittest/com/ibm/osgi/util/FragmentUtilsTest.java Thu Oct  1 17:19:13 2009
@@ -0,0 +1,112 @@
+/*
+ * (C) Copyright IBM Corp. 2009
+ */
+package com.ibm.osgi.util;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+import java.lang.reflect.Method;
+import java.util.Dictionary;
+import java.util.Hashtable;
+
+import mocks.BundleMock;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.Constants;
+import org.osgi.framework.Version;
+
+import com.ibm.aries.unittest.mocks.MethodCall;
+import com.ibm.aries.unittest.mocks.Skeleton;
+import com.ibm.osgi.util.FragmentBuilder;
+
+public class FragmentUtilsTest {
+
+  private Bundle hostBundle;
+  
+  @Before
+  public void setUp() throws Exception { 
+      hostBundle = Skeleton.newMock(new BundleMock("scooby.doo", new Hashtable<String, Object>()), Bundle.class);
+  }
+  
+  @SuppressWarnings("unchecked")
+  @Test
+  public void testFragmentCreation() throws Exception
+  {
+    Bundle exportBundle = makeBundleWithExports(
+        "export.bundle", "1.2.3", "export.package;version=\"1.0.0\";singleton:=true");
+    
+    Dictionary fragmentHeaders = makeFragmentFromExportBundle(exportBundle).getHeaders();
+    
+    assertNotNull("No headers in the fragment", fragmentHeaders);
+    
+    assertEquals("Wrong symbolicName", "scooby.doo.test.fragment", fragmentHeaders.get(Constants.BUNDLE_SYMBOLICNAME));
+    assertEquals("Wrong version", "0.0.0", fragmentHeaders.get(Constants.BUNDLE_VERSION));
+    assertEquals("Wrong Bundle manifest version", "2", fragmentHeaders.get(Constants.BUNDLE_MANIFESTVERSION));
+    assertEquals("Wrong Fragment host", "scooby.doo;bundle-version=\"0.0.0\"", fragmentHeaders.get(Constants.FRAGMENT_HOST));
+    assertEquals("Wrong Imports", 
+        "export.package;version=\"1.0.0\";bundle-symbolic-name=\"export.bundle\";bundle-version=\"[1.2.3,1.2.3]\"", 
+        fragmentHeaders.get(Constants.IMPORT_PACKAGE));
+  }
+  
+  private Bundle makeBundleWithExports(String symbolicName, String version, String exports) {
+    Hashtable<String,Object> headers = new Hashtable<String,Object>();
+    headers.put(Constants.BUNDLE_VERSION, version);
+    headers.put(Constants.EXPORT_PACKAGE, exports);
+    Bundle exportBundle = Skeleton.newMock(new BundleMock(symbolicName, headers), Bundle.class);
+    return exportBundle;
+  }
+  
+  private Bundle makeFragmentFromExportBundle(Bundle exportBundle) throws Exception {
+    FragmentBuilder builder = new FragmentBuilder(hostBundle, "test.fragment");
+    builder.setName("Test Fragment bundle");
+    builder.addImportsFromExports(exportBundle);
+    
+    return builder.install(hostBundle.getBundleContext());
+  }
+  
+  @Test
+  public void testManifestAttributes() throws Exception
+  {    
+    String fakeExportsListNoExtras = "no.such.export,no.such.export2";
+    String fakeExportsListAttrOnly = "no.such.export;version=\"1.1.1\",no.such.export2;version=\"2.2.2\"";
+    String fakeExportsListDirOnly = "no.such.export;uses:=\"some.other.thing\",no.such.export2;include:=\"some.thing\"";
+    String fakeExportsListMixed = "no.such.export;version=\"1.1.1\";uses:=\"some.other.thing\",no.such.export2;include:=\"some.thing\"";
+    String fakeExportsListFunkyAttr = "no.such.export;attribute=\"a:=\",no.such.export2;attributeTwo=\"b:=\";include:=\"some.thing\"";
+    
+    String expectedImportsListNoExtras = "no.such.export;bundle-symbolic-name=\"no.such.provider\";bundle-version=\"[1.1.1,1.1.1]\",no.such.export2;bundle-symbolic-name=\"no.such.provider\";bundle-version=\"[1.1.1,1.1.1]\"";
+    String expectedImportsListAttrOnly = "no.such.export;version=\"1.1.1\";bundle-symbolic-name=\"no.such.provider\";bundle-version=\"[1.1.1,1.1.1]\",no.such.export2;version=\"2.2.2\";bundle-symbolic-name=\"no.such.provider\";bundle-version=\"[1.1.1,1.1.1]\"";
+    String expectedImportsListDirOnly = "no.such.export;bundle-symbolic-name=\"no.such.provider\";bundle-version=\"[1.1.1,1.1.1]\",no.such.export2;bundle-symbolic-name=\"no.such.provider\";bundle-version=\"[1.1.1,1.1.1]\"";
+    String expectedImportsListMixed = "no.such.export;version=\"1.1.1\";bundle-symbolic-name=\"no.such.provider\";bundle-version=\"[1.1.1,1.1.1]\",no.such.export2;bundle-symbolic-name=\"no.such.provider\";bundle-version=\"[1.1.1,1.1.1]\"";
+    String expectedImportsListFunkyAttr = "no.such.export;attribute=\"a:=\";bundle-symbolic-name=\"no.such.provider\";bundle-version=\"[1.1.1,1.1.1]\",no.such.export2;attributeTwo=\"b:=\";bundle-symbolic-name=\"no.such.provider\";bundle-version=\"[1.1.1,1.1.1]\"";
+    
+
+    Bundle exportBundle = makeBundleWithExports("no.such.provider", "1.1.1", fakeExportsListNoExtras);
+    Dictionary headers = makeFragmentFromExportBundle(exportBundle).getHeaders();
+    assertEquals("Import list did not match expected value, expectedImportsListNoExtras", 
+        expectedImportsListNoExtras, headers.get(Constants.IMPORT_PACKAGE));
+
+    exportBundle = makeBundleWithExports("no.such.provider", "1.1.1", fakeExportsListAttrOnly);
+    headers = makeFragmentFromExportBundle(exportBundle).getHeaders();
+    assertEquals("Import list did not match expected value, expectedImportsListAttrOnly", 
+        expectedImportsListAttrOnly, headers.get(Constants.IMPORT_PACKAGE));
+    
+    exportBundle = makeBundleWithExports("no.such.provider", "1.1.1", fakeExportsListDirOnly);
+    headers = makeFragmentFromExportBundle(exportBundle).getHeaders();
+    assertEquals("Import list did not match expected value, expectedImportsListDirOnly", 
+        expectedImportsListDirOnly, headers.get(Constants.IMPORT_PACKAGE));
+    
+    exportBundle = makeBundleWithExports("no.such.provider", "1.1.1", fakeExportsListMixed);
+    headers = makeFragmentFromExportBundle(exportBundle).getHeaders();
+    assertEquals("Import list did not match expected value, expectedImportsListMixed", 
+        expectedImportsListMixed, headers.get(Constants.IMPORT_PACKAGE));
+
+    exportBundle = makeBundleWithExports("no.such.provider", "1.1.1", fakeExportsListFunkyAttr);
+    headers = makeFragmentFromExportBundle(exportBundle).getHeaders();
+    assertEquals("Import list did not match expected value, expectedImportsListFunkyAttr", 
+        expectedImportsListFunkyAttr, headers.get(Constants.IMPORT_PACKAGE));
+  }
+  
+}

Added: incubator/aries/contrib/ibm/prereqs/.aries
URL: http://svn.apache.org/viewvc/incubator/aries/contrib/ibm/prereqs/.aries?rev=820722&view=auto
==============================================================================
    (empty)

Added: incubator/aries/contrib/ibm/prereqs/.classpath
URL: http://svn.apache.org/viewvc/incubator/aries/contrib/ibm/prereqs/.classpath?rev=820722&view=auto
==============================================================================
--- incubator/aries/contrib/ibm/prereqs/.classpath (added)
+++ incubator/aries/contrib/ibm/prereqs/.classpath Thu Oct  1 17:19:13 2009
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+</classpath>

Added: incubator/aries/contrib/ibm/prereqs/.project
URL: http://svn.apache.org/viewvc/incubator/aries/contrib/ibm/prereqs/.project?rev=820722&view=auto
==============================================================================
--- incubator/aries/contrib/ibm/prereqs/.project (added)
+++ incubator/aries/contrib/ibm/prereqs/.project Thu Oct  1 17:19:13 2009
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>prereqs</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
+</projectDescription>

Added: incubator/aries/contrib/ibm/prereqs/ant/build.xml
URL: http://svn.apache.org/viewvc/incubator/aries/contrib/ibm/prereqs/ant/build.xml?rev=820722&view=auto
==============================================================================
--- incubator/aries/contrib/ibm/prereqs/ant/build.xml (added)
+++ incubator/aries/contrib/ibm/prereqs/ant/build.xml Thu Oct  1 17:19:13 2009
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- (C) Copyright IBM Corp. 2009 -->
+
+<project name="ant" default="copy" basedir=".">
+  <property name="file.name" value="ant.zip"/>
+  <property name="file.url" value="http://www.apache.org/dist/ant/binaries/apache-ant-1.7.1-bin.zip"/>
+  <import file="../../build/imports/download.xml"/>
+  
+  <target name="copy" depends="shouldDownload, download">
+    <unzip dest="." overwrite="false">
+      <fileset dir="${download.dir}">
+        <include name="*.zip"/>
+      </fileset>
+    </unzip>
+  </target>
+</project>
\ No newline at end of file

Added: incubator/aries/contrib/ibm/prereqs/build.xml
URL: http://svn.apache.org/viewvc/incubator/aries/contrib/ibm/prereqs/build.xml?rev=820722&view=auto
==============================================================================
--- incubator/aries/contrib/ibm/prereqs/build.xml (added)
+++ incubator/aries/contrib/ibm/prereqs/build.xml Thu Oct  1 17:19:13 2009
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- (C) Copyright IBM Corp. 2009 -->
+
+<project name="prereqs" default="build">
+  <target name="build" depends="download"/> 
+  <target name="download">
+  	<property name="download.root" value="../download"/>
+  	<ant antfile="build.xml" dir="junit" target="copy" inheritall="true">
+  	  <property name="download.dir" value="${download.root}/junit"/>
+  	</ant>  	
+    <ant antfile="build.xml" dir="findbugs" target="copy" inheritall="true">
+      <property name="download.dir" value="${download.root}/findbugs"/>
+    </ant>
+    <ant antfile="build.xml" dir="objectweb" target="copy" inheritall="true">
+      <property name="download.dir" value="${download.root}/objectweb"/>
+    </ant>  
+    <ant antfile="build.xml" dir="persistence" target="copy" inheritall="true">
+      <property name="download.dir" value="${download.root}/persistence"/>
+    </ant>    	
+    <ant antfile="build.xml" dir="osgi" target="copy" inheritall="false">
+      <property name="download.dir" value="${download.root}/osgi"/>
+    </ant>  	
+   </target>
+  
+  <target name="clean"/>
+  <target name="unittest"/>
+  <target name="unittestWithCoverage"/>
+</project>

Added: incubator/aries/contrib/ibm/prereqs/findbugs/build.xml
URL: http://svn.apache.org/viewvc/incubator/aries/contrib/ibm/prereqs/findbugs/build.xml?rev=820722&view=auto
==============================================================================
--- incubator/aries/contrib/ibm/prereqs/findbugs/build.xml (added)
+++ incubator/aries/contrib/ibm/prereqs/findbugs/build.xml Thu Oct  1 17:19:13 2009
@@ -0,0 +1,21 @@
+<!-- (C) Copyright IBM Corp. 2009 -->
+
+<project name="findbugs">
+  <property name="file.name" value="findbugs-1.3.8.zip"/>
+  <property name="file.url" value="http://downloads.sourceforge.net/project/findbugs/findbugs/1.3.8/findbugs-1.3.8.zip"/>
+  <import file="../../build/imports/download.xml"/>
+  
+  <target name="copy" depends="shouldDownload, download">
+    <unzip dest="." overwrite="false">
+      <fileset dir="${download.dir}">
+        <include name="*.zip"/>
+      </fileset>
+    </unzip>
+    
+    <copy todir="findbugs-1.3.8/plugin" failonerror="false">
+      <fileset dir="${download.dir}/plugin">
+        <include name="*.jar"/>
+      </fileset>
+    </copy>
+  </target>
+</project>
\ No newline at end of file

Added: incubator/aries/contrib/ibm/prereqs/junit/build.xml
URL: http://svn.apache.org/viewvc/incubator/aries/contrib/ibm/prereqs/junit/build.xml?rev=820722&view=auto
==============================================================================
--- incubator/aries/contrib/ibm/prereqs/junit/build.xml (added)
+++ incubator/aries/contrib/ibm/prereqs/junit/build.xml Thu Oct  1 17:19:13 2009
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- (C) Copyright IBM Corp. 2009 -->
+
+<project name="junit" default="copy" basedir=".">
+  <property name="file.name" value="junit-4.3.1.jar"/>
+  <property name="file.url" value="http://downloads.sourceforge.net/project/junit/junit/4.3.1/${file.name}"/>
+  <import file="../../build/imports/download.xml"/>
+  <target name="copy" depends="download">
+    <mkdir dir="lib"/>
+    <copy todir="./lib" file="${download.dir}/${file.name}"/>
+  </target>
+</project>
\ No newline at end of file

Added: incubator/aries/contrib/ibm/prereqs/objectweb/build.xml
URL: http://svn.apache.org/viewvc/incubator/aries/contrib/ibm/prereqs/objectweb/build.xml?rev=820722&view=auto
==============================================================================
--- incubator/aries/contrib/ibm/prereqs/objectweb/build.xml (added)
+++ incubator/aries/contrib/ibm/prereqs/objectweb/build.xml Thu Oct  1 17:19:13 2009
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- (C) Copyright IBM Corp. 2009 -->
+
+<project name="objectweb" default="copy" basedir=".">
+  <property name="file.name" value="asm-2.2.2.jar"/>
+  <property name="file.url" value="http://download.forge.objectweb.org/asm/${file.name}"/>
+	
+	  <property name="generated" value="${basedir}/generated"/>
+	
+  <import file="../../build/imports/download.xml"/>
+	
+  <target name="copy" depends="deleteOldStuff, download">
+  	<mkdir dir="${generated}/unpack"/>
+  	
+    <unzip dest="${generated}/unpack" overwrite="false">
+      <fileset dir="${download.dir}">
+        <include name="*.jar"/>
+      </fileset>
+    </unzip>
+  	
+   <manifest file="${generated}/MANIFEST.MF">
+           <attribute name="Built-By" value="Ant Task Adding Bundle Headers"/>
+   	       <attribute name="Bundle-Description" value="objectweb bundle with added bundle headers"/>
+   		   <attribute name="Bundle-SymbolicName" value="org.objectweb.asm"/>
+   	       <attribute name="Bundle-Version" value="2.2.2"/>
+   	       <attribute name="Bundle-ManifestVersion" value="2"/>
+           <attribute name="Export-Package" 
+           	value="org.objectweb.asm.signature;version=2.2.2,org.objectweb.asm.commons;version=2.2.2;uses:=org.objectweb.asm,org.objectweb.asm;version=2.2.2"/>
+   </manifest>
+  	
+  	
+  	<mkdir dir="${generated}"/>
+  	
+  	<jar destfile="${generated}/${file.name}" manifest="${generated}/MANIFEST.MF" >
+  	  <fileset dir="${generated}/unpack">
+  	    <include name="**"/>
+  	    <exclude name="**.jar"/>
+  	  </fileset>
+  	</jar>  	
+  	
+    <copy todir="./lib" file="${generated}/${file.name}"/>
+  </target>
+  	
+    <target name="deleteOldStuff" depends="shouldDownload" unless="skipDownload">
+      <delete includeemptydirs="true">
+        <fileset dir="${basedir}">
+          <include name="**/*"/>
+          <exclude name=".jazzignore"/>
+          <exclude name="build.xml"/>
+        </fileset>
+      </delete>
+    </target>  	
+  
+</project>
\ No newline at end of file

Added: incubator/aries/contrib/ibm/prereqs/osgi/build.xml
URL: http://svn.apache.org/viewvc/incubator/aries/contrib/ibm/prereqs/osgi/build.xml?rev=820722&view=auto
==============================================================================
--- incubator/aries/contrib/ibm/prereqs/osgi/build.xml (added)
+++ incubator/aries/contrib/ibm/prereqs/osgi/build.xml Thu Oct  1 17:19:13 2009
@@ -0,0 +1,26 @@
+<!-- (C) Copyright IBM Corp. 2009 -->
+
+<project name="osgi">
+  <property name="file.name" value="org.eclipse.osgi_3.5.1.R35x_v20090827.jar"/>
+  <property name="file.url" value="http://download.eclipse.org/equinox/drops/R-3.5.1-200909170800/${file.name}"/>
+
+  <import file="../../build/imports/download.xml"/>
+  
+  <target name="copy" depends="shouldDownload, download">     	
+    <copy todir="lib" failonerror="false">
+      <fileset dir="${download.dir}">
+        <include name="*.jar"/>
+      </fileset>
+    </copy>
+  	<copy todir="lib" failonerror="false">
+  	  <fileset dir="../objectweb/lib">
+        <include name="*.jar"/>
+      </fileset>
+    </copy>  	
+  	<copy todir="lib" failonerror="false">
+  	  <fileset dir="../persistence/lib">
+        <include name="*.jar"/>
+      </fileset>
+    </copy>  
+  </target>
+</project>

Added: incubator/aries/contrib/ibm/prereqs/persistence/build.xml
URL: http://svn.apache.org/viewvc/incubator/aries/contrib/ibm/prereqs/persistence/build.xml?rev=820722&view=auto
==============================================================================
--- incubator/aries/contrib/ibm/prereqs/persistence/build.xml (added)
+++ incubator/aries/contrib/ibm/prereqs/persistence/build.xml Thu Oct  1 17:19:13 2009
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- (C) Copyright IBM Corp. 2009 -->
+
+<project name="persistence" default="copy" basedir=".">
+  <property name="file.name" value="persistence-api-1.0.jar"/>
+  <property name="file.url" value="http://mirrors.ibiblio.org/pub/mirrors/maven2/javax/persistence/persistence-api/1.0/${file.name}"/>
+  <import file="../../build/imports/download.xml"/>
+	  
+	<property name="generated" value="${basedir}/generated"/>
+	
+  <target name="copy" depends="deleteOldStuff, download">
+	<mkdir dir="${generated}/unpack"/>
+	
+    <unzip dest="${generated}/unpack" overwrite="false">
+      <fileset dir="${download.dir}">
+        <include name="*.jar"/>
+      </fileset>
+    </unzip>
+	
+    <manifest file="${generated}/MANIFEST.MF">
+      <attribute name="Built-By" value="Ant Task Adding Bundle Headers"/>
+ 	  <attribute name="Bundle-Description" value="persistence api bundle with added bundle headers"/>
+ 	  <attribute name="Bundle-SymbolicName" value="javax.persistence"/>
+ 	  <attribute name="Bundle-Version" value="1.0.0"/>
+ 	  <attribute name="Bundle-ManifestVersion" value="2"/>
+      <attribute name="Export-Package" 
+        value="javax.persistence.spi;version=1.0.0,javax.persistence;version=1.0.0"/>
+      <attribute name="Import-Package" 
+       	value="javax.persistence.spi;version=1.0.0,javax.persistence;version=1.0.0"/> 	
+    </manifest>
+	
+	
+	<mkdir dir="${generated}"/>
+	
+	<jar destfile="${generated}/${file.name}" manifest="${generated}/MANIFEST.MF" >
+	  <fileset dir="${generated}/unpack">
+	    <include name="**"/>
+	    <exclude name="**.jar"/>
+	  </fileset>
+	</jar>  	
+	
+    <copy todir="./lib" file="${generated}/${file.name}"/>
+  </target>
+	
+  <target name="deleteOldStuff" depends="shouldDownload" unless="skipDownload">
+    <delete includeemptydirs="true">
+      <fileset dir="${basedir}">
+        <include name="**/*"/>
+        <exclude name=".jazzignore"/>
+        <exclude name="build.xml"/>
+      </fileset>
+    </delete>
+  </target>  	
+</project>
\ No newline at end of file

Added: incubator/aries/contrib/ibm/unittest.framework/.aries
URL: http://svn.apache.org/viewvc/incubator/aries/contrib/ibm/unittest.framework/.aries?rev=820722&view=auto
==============================================================================
    (empty)

Added: incubator/aries/contrib/ibm/unittest.framework/.classpath
URL: http://svn.apache.org/viewvc/incubator/aries/contrib/ibm/unittest.framework/.classpath?rev=820722&view=auto
==============================================================================
--- incubator/aries/contrib/ibm/unittest.framework/.classpath (added)
+++ incubator/aries/contrib/ibm/unittest.framework/.classpath Thu Oct  1 17:19:13 2009
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="src" output="build/classes" path="src"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
+	<classpathentry combineaccessrules="false" kind="src" path="/prereqs"/>
+	<classpathentry kind="lib" path="/prereqs/osgi/lib/org.eclipse.osgi_3.5.1.R35x_v20090827.jar"/>
+	<classpathentry kind="output" path="build/classes"/>
+</classpath>

Added: incubator/aries/contrib/ibm/unittest.framework/.fbprefs
URL: http://svn.apache.org/viewvc/incubator/aries/contrib/ibm/unittest.framework/.fbprefs?rev=820722&view=auto
==============================================================================
--- incubator/aries/contrib/ibm/unittest.framework/.fbprefs (added)
+++ incubator/aries/contrib/ibm/unittest.framework/.fbprefs Thu Oct  1 17:19:13 2009
@@ -0,0 +1,125 @@
+#FindBugs User Preferences
+#Fri Apr 24 11:10:54 BST 2009
+detectorAppendingToAnObjectOutputStream=AppendingToAnObjectOutputStream|true
+detectorBadAppletConstructor=BadAppletConstructor|false
+detectorBadResultSetAccess=BadResultSetAccess|true
+detectorBadSyntaxForRegularExpression=BadSyntaxForRegularExpression|true
+detectorBadUseOfReturnValue=BadUseOfReturnValue|true
+detectorBadlyOverriddenAdapter=BadlyOverriddenAdapter|true
+detectorBooleanReturnNull=BooleanReturnNull|true
+detectorCallToUnsupportedMethod=CallToUnsupportedMethod|true
+detectorCheckImmutableAnnotation=CheckImmutableAnnotation|true
+detectorCheckTypeQualifiers=CheckTypeQualifiers|true
+detectorCloneIdiom=CloneIdiom|true
+detectorComparatorIdiom=ComparatorIdiom|true
+detectorConfusedInheritance=ConfusedInheritance|true
+detectorConfusionBetweenInheritedAndOuterMethod=ConfusionBetweenInheritedAndOuterMethod|true
+detectorCrossSiteScripting=CrossSiteScripting|true
+detectorDoInsideDoPrivileged=DoInsideDoPrivileged|true
+detectorDontCatchIllegalMonitorStateException=DontCatchIllegalMonitorStateException|true
+detectorDontUseEnum=DontUseEnum|true
+detectorDroppedException=DroppedException|true
+detectorDumbMethodInvocations=DumbMethodInvocations|true
+detectorDumbMethods=DumbMethods|true
+detectorDuplicateBranches=DuplicateBranches|true
+detectorEmptyZipFileEntry=EmptyZipFileEntry|true
+detectorEqualsOperandShouldHaveClassCompatibleWithThis=EqualsOperandShouldHaveClassCompatibleWithThis|true
+detectorFinalizerNullsFields=FinalizerNullsFields|true
+detectorFindBadCast2=FindBadCast2|true
+detectorFindBadForLoop=FindBadForLoop|true
+detectorFindCircularDependencies=FindCircularDependencies|false
+detectorFindDeadLocalStores=FindDeadLocalStores|true
+detectorFindDoubleCheck=FindDoubleCheck|true
+detectorFindEmptySynchronizedBlock=FindEmptySynchronizedBlock|true
+detectorFindFieldSelfAssignment=FindFieldSelfAssignment|true
+detectorFindFinalizeInvocations=FindFinalizeInvocations|true
+detectorFindFloatEquality=FindFloatEquality|true
+detectorFindHEmismatch=FindHEmismatch|true
+detectorFindInconsistentSync2=FindInconsistentSync2|true
+detectorFindJSR166LockMonitorenter=FindJSR166LockMonitorenter|true
+detectorFindLocalSelfAssignment2=FindLocalSelfAssignment2|true
+detectorFindMaskedFields=FindMaskedFields|true
+detectorFindMismatchedWaitOrNotify=FindMismatchedWaitOrNotify|true
+detectorFindNakedNotify=FindNakedNotify|true
+detectorFindNonSerializableStoreIntoSession=FindNonSerializableStoreIntoSession|true
+detectorFindNonSerializableValuePassedToWriteObject=FindNonSerializableValuePassedToWriteObject|true
+detectorFindNonShortCircuit=FindNonShortCircuit|true
+detectorFindNullDeref=FindNullDeref|true
+detectorFindNullDerefsInvolvingNonShortCircuitEvaluation=FindNullDerefsInvolvingNonShortCircuitEvaluation|true
+detectorFindOpenStream=FindOpenStream|true
+detectorFindPuzzlers=FindPuzzlers|true
+detectorFindRefComparison=FindRefComparison|true
+detectorFindReturnRef=FindReturnRef|true
+detectorFindRunInvocations=FindRunInvocations|true
+detectorFindSelfComparison=FindSelfComparison|true
+detectorFindSelfComparison2=FindSelfComparison2|true
+detectorFindSleepWithLockHeld=FindSleepWithLockHeld|true
+detectorFindSpinLoop=FindSpinLoop|true
+detectorFindSqlInjection=FindSqlInjection|true
+detectorFindTwoLockWait=FindTwoLockWait|true
+detectorFindUncalledPrivateMethods=FindUncalledPrivateMethods|true
+detectorFindUnconditionalWait=FindUnconditionalWait|true
+detectorFindUninitializedGet=FindUninitializedGet|true
+detectorFindUnrelatedTypesInGenericContainer=FindUnrelatedTypesInGenericContainer|true
+detectorFindUnreleasedLock=FindUnreleasedLock|true
+detectorFindUnsatisfiedObligation=FindUnsatisfiedObligation|true
+detectorFindUnsyncGet=FindUnsyncGet|true
+detectorFindUselessControlFlow=FindUselessControlFlow|true
+detectorFormatStringChecker=FormatStringChecker|true
+detectorHugeSharedStringConstants=HugeSharedStringConstants|true
+detectorIDivResultCastToDouble=IDivResultCastToDouble|true
+detectorIncompatMask=IncompatMask|true
+detectorInconsistentAnnotations=InconsistentAnnotations|true
+detectorInefficientMemberAccess=InefficientMemberAccess|false
+detectorInefficientToArray=InefficientToArray|true
+detectorInfiniteLoop=InfiniteLoop|true
+detectorInfiniteRecursiveLoop=InfiniteRecursiveLoop|true
+detectorInfiniteRecursiveLoop2=InfiniteRecursiveLoop2|false
+detectorInheritanceUnsafeGetResource=InheritanceUnsafeGetResource|true
+detectorInitializationChain=InitializationChain|true
+detectorInstantiateStaticClass=InstantiateStaticClass|true
+detectorInvalidJUnitTest=InvalidJUnitTest|true
+detectorIteratorIdioms=IteratorIdioms|true
+detectorLazyInit=LazyInit|true
+detectorLoadOfKnownNullValue=LoadOfKnownNullValue|true
+detectorMethodReturnCheck=MethodReturnCheck|true
+detectorMultithreadedInstanceAccess=MultithreadedInstanceAccess|true
+detectorMutableLock=MutableLock|true
+detectorMutableStaticFields=MutableStaticFields|true
+detectorNaming=Naming|true
+detectorNumberConstructor=NumberConstructor|true
+detectorOverridingEqualsNotSymmetrical=OverridingEqualsNotSymmetrical|true
+detectorPreferZeroLengthArrays=PreferZeroLengthArrays|true
+detectorPublicSemaphores=PublicSemaphores|false
+detectorQuestionableBooleanAssignment=QuestionableBooleanAssignment|true
+detectorReadReturnShouldBeChecked=ReadReturnShouldBeChecked|true
+detectorRedundantInterfaces=RedundantInterfaces|true
+detectorRepeatedConditionals=RepeatedConditionals|true
+detectorRuntimeExceptionCapture=RuntimeExceptionCapture|true
+detectorSerializableIdiom=SerializableIdiom|true
+detectorStartInConstructor=StartInConstructor|true
+detectorStaticCalendarDetector=StaticCalendarDetector|true
+detectorStringConcatenation=StringConcatenation|true
+detectorSuperfluousInstanceOf=SuperfluousInstanceOf|true
+detectorSuspiciousThreadInterrupted=SuspiciousThreadInterrupted|true
+detectorSwitchFallthrough=SwitchFallthrough|true
+detectorSynchronizeAndNullCheckField=SynchronizeAndNullCheckField|true
+detectorSynchronizeOnClassLiteralNotGetClass=SynchronizeOnClassLiteralNotGetClass|true
+detectorSynchronizingOnContentsOfFieldToProtectField=SynchronizingOnContentsOfFieldToProtectField|true
+detectorURLProblems=URLProblems|true
+detectorUncallableMethodOfAnonymousClass=UncallableMethodOfAnonymousClass|true
+detectorUnnecessaryMath=UnnecessaryMath|true
+detectorUnreadFields=UnreadFields|true
+detectorUseObjectEquals=UseObjectEquals|false
+detectorUselessSubclassMethod=UselessSubclassMethod|false
+detectorVarArgsProblems=VarArgsProblems|true
+detectorVolatileUsage=VolatileUsage|true
+detectorWaitInLoop=WaitInLoop|true
+detectorWrongMapIterator=WrongMapIterator|true
+detectorXMLFactoryBypass=XMLFactoryBypass|true
+detector_threshold=2
+effort=default
+excludefilter0=findbugs.exclude.xml
+filter_settings=Medium|BAD_PRACTICE,CORRECTNESS,EXPERIMENTAL,I18N,MALICIOUS_CODE,MT_CORRECTNESS,PERFORMANCE,SECURITY,STYLE|false
+filter_settings_neg=|
+run_at_full_build=true

Added: incubator/aries/contrib/ibm/unittest.framework/.project
URL: http://svn.apache.org/viewvc/incubator/aries/contrib/ibm/unittest.framework/.project?rev=820722&view=auto
==============================================================================
--- incubator/aries/contrib/ibm/unittest.framework/.project (added)
+++ incubator/aries/contrib/ibm/unittest.framework/.project Thu Oct  1 17:19:13 2009
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>unittest.framework</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
+</projectDescription>

Added: incubator/aries/contrib/ibm/unittest.framework/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/incubator/aries/contrib/ibm/unittest.framework/META-INF/MANIFEST.MF?rev=820722&view=auto
==============================================================================
--- incubator/aries/contrib/ibm/unittest.framework/META-INF/MANIFEST.MF (added)
+++ incubator/aries/contrib/ibm/unittest.framework/META-INF/MANIFEST.MF Thu Oct  1 17:19:13 2009
@@ -0,0 +1,7 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Dummy manifest for eclipse to setup the classpath correctly
+Bundle-SymbolicName: unittest.framework
+Bundle-Version: 1.0.0
+Bundle-Vendor: IBM
+Import-Package: org.osgi.framework;version="1.5.0"

Added: incubator/aries/contrib/ibm/unittest.framework/build.xml
URL: http://svn.apache.org/viewvc/incubator/aries/contrib/ibm/unittest.framework/build.xml?rev=820722&view=auto
==============================================================================
--- incubator/aries/contrib/ibm/unittest.framework/build.xml (added)
+++ incubator/aries/contrib/ibm/unittest.framework/build.xml Thu Oct  1 17:19:13 2009
@@ -0,0 +1,14 @@
+<!-- (C) Copyright IBM Corp. 2009 -->
+
+<project name="unittest.framework" default="build">
+  <property name="publish.jar" value="true"/>
+  <import file="../build/imports/clean.xml"/>
+  <import file="../build/imports/standard_properties.xml"/>
+  <import file="../build/imports/standard_targets.xml"/>
+  <import file="../build/imports/findbugs.xml"/>
+    
+  <target name="unittest"/>
+  <target name="unittestWithCoverage"/>
+  <target name="componenttest"/>
+  <target name="tck"/>
+</project>
\ No newline at end of file

Added: incubator/aries/contrib/ibm/unittest.framework/findbugs.exclude.xml
URL: http://svn.apache.org/viewvc/incubator/aries/contrib/ibm/unittest.framework/findbugs.exclude.xml?rev=820722&view=auto
==============================================================================
--- incubator/aries/contrib/ibm/unittest.framework/findbugs.exclude.xml (added)
+++ incubator/aries/contrib/ibm/unittest.framework/findbugs.exclude.xml Thu Oct  1 17:19:13 2009
@@ -0,0 +1,7 @@
+<FindBugsFilter>
+   <!-- See http://findbugs.sourceforge.net/manual/filter.html for details of the syntax of this file -->
+   <Match>
+     <Class name="com.ibm.aries.unittest.mocks.MethodCall"/>
+     <Bug pattern="EI_EXPOSE_REP"/>
+   </Match>
+</FindBugsFilter>
\ No newline at end of file

Added: incubator/aries/contrib/ibm/unittest.framework/src/com/ibm/aries/unittest/junit/Assert.java
URL: http://svn.apache.org/viewvc/incubator/aries/contrib/ibm/unittest.framework/src/com/ibm/aries/unittest/junit/Assert.java?rev=820722&view=auto
==============================================================================
--- incubator/aries/contrib/ibm/unittest.framework/src/com/ibm/aries/unittest/junit/Assert.java (added)
+++ incubator/aries/contrib/ibm/unittest.framework/src/com/ibm/aries/unittest/junit/Assert.java Thu Oct  1 17:19:13 2009
@@ -0,0 +1,65 @@
+/*
+ * (C) Copyright IBM Corp. 2009
+ */
+package com.ibm.aries.unittest.junit;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+/**
+ * A library of useful assertion routines.
+ */
+public class Assert
+{
+  /**
+   * This method checks that the two objects have the same hashCode. If the
+   * equalsObjects parameter is true then the objects must also be .equals equal
+   * if the equalsObject parameter is false then they must not be .equals equal.
+   * 
+   * @param <T> 
+   * @param obj  the first object.
+   * @param obj2 the second object.
+   * @param equalObjects whether the objects are also equal.
+   */
+  public static <T> void assertHashCodeEquals(T obj, T obj2, boolean equalObjects)
+  {
+    assertEquals("The hashCodes were different, bad, bad, bad", obj.hashCode(), obj2.hashCode());
+    assertEquals("The two objects are not equal", equalObjects, obj.equals(obj2));
+  }
+
+  /**
+   * This method makes sure that the hashCodes are not equal. And that they
+   * are not .equals. This is because two objects of the same type cannot be
+   * .equals if they have different hashCodes.
+   * 
+   * @param <T> 
+   * @param obj
+   * @param obj2
+   */
+  public static <T> void assertHashCodeNotEquals(T obj, T obj2)
+  {
+    assertFalse("The the two hashCodes should be different: " + obj.hashCode() + ", " + obj2.hashCode(), obj.hashCode() == obj2.hashCode());
+    assertFalse("The two objects not equal", obj.equals(obj2));
+  }
+  
+  /**
+   * This method asserts that the equals contract is upheld by type T.
+   * 
+   * @param <T>
+   * @param info    an instance of T
+   * @param info2   a different instance of T that is .equal to info
+   * @param info3   an instance of T that is not equal to info
+   */
+  public static <T> void assertEqualsContract(T info, T info2, T info3)
+  {
+    Object other = new Object();
+    if (info.getClass() == Object.class) other = "A string";
+    
+    assertEquals(info, info);
+    assertFalse(info.equals(null));
+    assertTrue("Equals should be commutative", info.equals(info2) == info2.equals(info) && info2.equals(info3) == info3.equals(info2));
+    assertTrue("If two objects are equal, then they must both be equal (or not equal) to a third", info.equals(info3) == info2.equals(info3));
+    assertFalse("An object should not equal an object of a disparate type", info.equals(other));
+  }
+}
\ No newline at end of file

Added: incubator/aries/contrib/ibm/unittest.framework/src/com/ibm/aries/unittest/mocks/DefaultInvocationHandler.java
URL: http://svn.apache.org/viewvc/incubator/aries/contrib/ibm/unittest.framework/src/com/ibm/aries/unittest/mocks/DefaultInvocationHandler.java?rev=820722&view=auto
==============================================================================
--- incubator/aries/contrib/ibm/unittest.framework/src/com/ibm/aries/unittest/mocks/DefaultInvocationHandler.java (added)
+++ incubator/aries/contrib/ibm/unittest.framework/src/com/ibm/aries/unittest/mocks/DefaultInvocationHandler.java Thu Oct  1 17:19:13 2009
@@ -0,0 +1,96 @@
+/*
+ * (C) Copyright IBM Corp. 2004, 2009
+ */
+package com.ibm.aries.unittest.mocks;
+
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.Method;
+
+/**
+ * <p>This invocation handler is used by the Skeleton when nothing else is
+ *   matched. If the return type is an interface it creates a dynamic proxy
+ *   backed by the associated skeleton for return, if it is a class with a
+ *   default constructor that will be returned.
+ * </p>
+ */
+public class DefaultInvocationHandler implements InvocationHandler
+{
+  /** The skeleton this handler is associated with */
+  private Skeleton _s;
+  
+  /* ------------------------------------------------------------------------ */
+  /* DefaultInvocationHandler constructor                                    
+  /* ------------------------------------------------------------------------ */
+  /**
+   * Creates an instance called by the specified skeleton.
+   *
+   * @param s The caller.
+   */
+  public DefaultInvocationHandler(Skeleton s)
+  {
+    this._s = s;
+  }
+  
+  /* ------------------------------------------------------------------------ */
+  /* invoke method                                    
+  /* ------------------------------------------------------------------------ */
+  /**
+   * Invoked when no ReturnType or MethodCall Handlers are defined.
+   * 
+   * @param target     The target object that was invoked. 
+   * @param method     The method that was invoked.
+   * @param arguments  The arguments that were passed.
+   * @return           A proxy or null.
+   * @throws Throwable
+   */
+  public Object invoke(Object target, Method method, Object[] arguments)
+      throws Throwable
+  {
+    Class<?> returnType = method.getReturnType();
+    Object obj = null;
+    
+    if (returnType.isInterface())
+    {
+      obj = createProxy(new Class[] { returnType });
+    }
+    else 
+    {
+      try
+      {
+        obj = returnType.newInstance();
+      }
+      catch (Exception e)
+      {
+        // if this occurs then assume no default constructor was visible.
+      }
+    }
+    
+    return obj;
+  }
+  
+  /* ------------------------------------------------------------------------ */
+  /* createProxy method                                    
+  /* ------------------------------------------------------------------------ */
+  /**
+   * Creates and returns a proxy backed by the associated skeleton, that 
+   * implements the specified interfaces. Null is returned if the return
+   * type array contains non interfaces.
+   * 
+   * @param returnTypes The classes.
+   * @return            The proxy or null.
+   */
+  public Object createProxy(Class<?> ... returnTypes)
+  {
+    Object result = null;
+    
+    boolean allInterfaces = true;
+    for(int i = 0; (allInterfaces && i<returnTypes.length); i++)
+       allInterfaces = returnTypes[i].isInterface();
+    
+    if (allInterfaces)
+    {
+      result = _s.createMock(returnTypes);
+    }
+    return result;
+  }
+}

Added: incubator/aries/contrib/ibm/unittest.framework/src/com/ibm/aries/unittest/mocks/DefaultMethodCallHandlers.java
URL: http://svn.apache.org/viewvc/incubator/aries/contrib/ibm/unittest.framework/src/com/ibm/aries/unittest/mocks/DefaultMethodCallHandlers.java?rev=820722&view=auto
==============================================================================
--- incubator/aries/contrib/ibm/unittest.framework/src/com/ibm/aries/unittest/mocks/DefaultMethodCallHandlers.java (added)
+++ incubator/aries/contrib/ibm/unittest.framework/src/com/ibm/aries/unittest/mocks/DefaultMethodCallHandlers.java Thu Oct  1 17:19:13 2009
@@ -0,0 +1,123 @@
+/*
+ * (C) Copyright IBM Corp. 2004, 2009
+ */
+package com.ibm.aries.unittest.mocks;
+
+/**
+ * <p>This class contains method call handlers for some default method handling.
+ * </p>
+ *
+ * <p>This class provides handlers for the toString, equals and hashCode
+ *   methods. They reproduce the default Object implementations for dynamic
+ *   mock objects, these can be overridden.
+ * </p>
+ */
+public class DefaultMethodCallHandlers
+{
+  /** A MethodCall representing the equals method */
+  private static MethodCall _equals;
+  /** A MethodCall representing the toString method */
+  private static MethodCall _toString;
+  /** A MethodCall representing the hashCode method */
+  private static MethodCall _hashCode;
+
+  /* ------------------------------------------------------------------------ */
+  /* static initializer
+  /* ------------------------------------------------------------------------ */
+  static
+  {
+    _equals = new MethodCall(Object.class, "equals", new Object[] {Object.class});
+    _toString = new MethodCall(Object.class, "toString", new Object[0]);
+    _hashCode = new MethodCall(Object.class, "hashCode", new Object[0]);
+  }
+
+  /**
+   * The Default MethodCallHandler for the equals method, performs an == check.
+   */
+  public static final MethodCallHandler EQUALS_HANDLER = new MethodCallHandler()
+  {
+    public Object handle(MethodCall methodCall, Skeleton parent) throws Exception
+    {
+      Object obj = methodCall.getInvokedObject();
+      Object toObj = methodCall.getArguments()[0];
+      
+      if (toObj == null) return false;
+      
+      if(parent.getTemplateObject() != null){
+        try {
+          if(Skeleton.isSkeleton(toObj) &&Skeleton.getSkeleton(toObj).getTemplateObject() != null){
+            return parent.getTemplateObject().equals(Skeleton.getSkeleton(toObj).getTemplateObject());
+          } else {
+            return false;
+          }
+        } catch (IllegalArgumentException iae) {
+          return parent.getTemplateObject().equals(toObj);
+        }
+      }
+        
+
+      return obj == toObj ? Boolean.TRUE : Boolean.FALSE;
+    }
+  };
+
+  /**
+   * The Default MethodCallHandler for the toString method, reproduces
+   * <classname>@<hashCode>
+   */
+  public static final MethodCallHandler TOSTRING_HANDLER = new MethodCallHandler()
+  {
+    public Object handle(MethodCall methodCall, Skeleton parent) throws Exception
+    {
+      if(parent.getTemplateObject() != null)
+        return parent.getTemplateObject().toString();
+      Object obj = methodCall.getInvokedObject();
+      return obj.getClass().getName() + "@" + System.identityHashCode(obj);
+    }
+  };
+
+  /**
+   * The Default MethodCallHandler for the hashCode method, returns the
+   * identity hashCode.
+   */
+  public static final MethodCallHandler HASHCODE_HANDLER = new MethodCallHandler()
+  {
+    public Object handle(MethodCall methodCall, Skeleton parent) throws Exception
+    {
+      if(parent.getTemplateObject() != null)
+        return parent.getTemplateObject().hashCode();
+      
+      return Integer.valueOf(System.identityHashCode(methodCall.getInvokedObject()));
+    }
+  };
+
+  /* ------------------------------------------------------------------------ */
+  /* registerDefaultHandlers method
+  /* ------------------------------------------------------------------------ */
+  /**
+   * This method registers the DefaultMethodCall Handlers with the specified
+   * skeleton.
+   *
+   * @param s a skeleton
+   */
+  public static void registerDefaultHandlers(Skeleton s)
+  {
+    s.registerMethodCallHandler(_equals, EQUALS_HANDLER);
+    s.registerMethodCallHandler(_toString, TOSTRING_HANDLER);
+    s.registerMethodCallHandler(_hashCode, HASHCODE_HANDLER);
+  }
+
+  /* ------------------------------------------------------------------------ */
+  /* isDefaultMethodCall method
+  /* ------------------------------------------------------------------------ */
+  /**
+   * This method returns true if and only if the specified call represents a
+   * default method call.
+   *
+   * @param call the call
+   * @return see above.
+   */
+  public static boolean isDefaultMethodCall(MethodCall call)
+  {
+    return _toString.equals(call) || _equals.equals(call) || _hashCode.equals(call);
+  }
+}

Added: incubator/aries/contrib/ibm/unittest.framework/src/com/ibm/aries/unittest/mocks/DefaultReturnTypeHandlers.java
URL: http://svn.apache.org/viewvc/incubator/aries/contrib/ibm/unittest.framework/src/com/ibm/aries/unittest/mocks/DefaultReturnTypeHandlers.java?rev=820722&view=auto
==============================================================================
--- incubator/aries/contrib/ibm/unittest.framework/src/com/ibm/aries/unittest/mocks/DefaultReturnTypeHandlers.java (added)
+++ incubator/aries/contrib/ibm/unittest.framework/src/com/ibm/aries/unittest/mocks/DefaultReturnTypeHandlers.java Thu Oct  1 17:19:13 2009
@@ -0,0 +1,130 @@
+/*
+ * (C) Copyright IBM Corp. 2009
+ */
+package com.ibm.aries.unittest.mocks;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * <p>This class contains some return type handlers that provides some default behavior.</p>
+ */
+public class DefaultReturnTypeHandlers
+{
+  /** A handler for Longs */
+  public static final ReturnTypeHandler LONG_HANDLER = new ReturnTypeHandler() {
+    public Object handle(Class<?> class1, Skeleton parent)
+    {
+      return Long.valueOf(0);
+    }
+  };
+  /** A handler for Integers */
+  public static final ReturnTypeHandler INT_HANDLER = new ReturnTypeHandler() {
+    public Object handle(Class<?> class1, Skeleton parent)
+    {
+      return Integer.valueOf(0);
+    }
+  };
+  /** A handler for Shorts */
+  public static final ReturnTypeHandler SHORT_HANDLER = new ReturnTypeHandler() {
+    public Object handle(Class<?> class1, Skeleton parent)
+    {
+      return Short.valueOf((short)0);
+    }
+  };
+  /** A handler for Bytes */
+  public static final ReturnTypeHandler BYTE_HANDLER = new ReturnTypeHandler() {
+    public Object handle(Class<?> class1, Skeleton parent)
+    {
+      return Byte.valueOf((byte)0);
+    }
+  };
+  /** A handler for Characters */
+  public static final ReturnTypeHandler CHAR_HANDLER = new ReturnTypeHandler() {
+    public Object handle(Class<?> class1, Skeleton parent)
+    {
+      return Character.valueOf(' ');
+    }
+  };
+  /** A handler for Strings */
+  public static final ReturnTypeHandler STRING_HANDLER = new ReturnTypeHandler() {
+    public Object handle(Class<?> class1, Skeleton parent)
+    {
+      return "";
+    }
+  };
+  /** A handler for Lists */
+  public static final ReturnTypeHandler LIST_HANDLER = new ReturnTypeHandler() {
+    public Object handle(Class<?> class1, Skeleton parent)
+    {
+      return new ArrayList<Object>();
+    }
+  };
+  /** A handler for Maps */
+  public static final ReturnTypeHandler MAP_HANDLER = new ReturnTypeHandler() {
+    public Object handle(Class<?> class1, Skeleton parent)
+    {
+      return new HashMap<Object,Object>();
+    }
+  };
+  /** A handler for Setss */
+  public static final ReturnTypeHandler SET_HANDLER = new ReturnTypeHandler() {
+    public Object handle(Class<?> class1, Skeleton parent)
+    {
+      return new HashSet<Object>();
+    }
+  };
+  /** A handler for Floats */
+  public static final ReturnTypeHandler FLOAT_HANDLER = new ReturnTypeHandler() {
+    public Object handle(Class<?> class1, Skeleton parent)
+    {
+      return new Float(0.0f);
+    }
+  };
+  /** A handler for Doubles */
+  public static final ReturnTypeHandler DOUBLE_HANDLER = new ReturnTypeHandler() {
+    public Object handle(Class<?> class1, Skeleton parent)
+    {
+      return new Double(0.0d);
+    }
+  };
+  /** A handler for Booleans */
+  public static final ReturnTypeHandler BOOLEAN_HANDLER = new ReturnTypeHandler() {
+    public Object handle(Class<?> class1, Skeleton parent)
+    {
+      return Boolean.FALSE;
+    }
+  };
+  /**
+   * Register all the default handlers against the specified skeleton.
+   * 
+   * @param s the skeleton
+   */
+  public static void registerDefaultHandlers(Skeleton s)
+  {
+    s.registerReturnTypeHandler(Double.class, DOUBLE_HANDLER);
+    s.registerReturnTypeHandler(Float.class, FLOAT_HANDLER);
+    s.registerReturnTypeHandler(Long.class, LONG_HANDLER);
+    s.registerReturnTypeHandler(Integer.class, INT_HANDLER);
+    s.registerReturnTypeHandler(Short.class, SHORT_HANDLER);
+    s.registerReturnTypeHandler(Byte.class, BYTE_HANDLER);
+    s.registerReturnTypeHandler(Boolean.class, BOOLEAN_HANDLER);
+    s.registerReturnTypeHandler(Character.class, CHAR_HANDLER);
+    s.registerReturnTypeHandler(String.class, STRING_HANDLER);
+    s.registerReturnTypeHandler(List.class, LIST_HANDLER);
+    s.registerReturnTypeHandler(Map.class, MAP_HANDLER);
+    s.registerReturnTypeHandler(Set.class, SET_HANDLER);
+    s.registerReturnTypeHandler(double.class, DOUBLE_HANDLER);
+    s.registerReturnTypeHandler(float.class, FLOAT_HANDLER);
+    s.registerReturnTypeHandler(long.class, LONG_HANDLER);
+    s.registerReturnTypeHandler(int.class, INT_HANDLER);
+    s.registerReturnTypeHandler(short.class, SHORT_HANDLER);
+    s.registerReturnTypeHandler(byte.class, BYTE_HANDLER);
+    s.registerReturnTypeHandler(char.class, CHAR_HANDLER);
+    s.registerReturnTypeHandler(boolean.class, BOOLEAN_HANDLER);
+  }
+}
\ No newline at end of file

Added: incubator/aries/contrib/ibm/unittest.framework/src/com/ibm/aries/unittest/mocks/ExceptionListener.java
URL: http://svn.apache.org/viewvc/incubator/aries/contrib/ibm/unittest.framework/src/com/ibm/aries/unittest/mocks/ExceptionListener.java?rev=820722&view=auto
==============================================================================
--- incubator/aries/contrib/ibm/unittest.framework/src/com/ibm/aries/unittest/mocks/ExceptionListener.java (added)
+++ incubator/aries/contrib/ibm/unittest.framework/src/com/ibm/aries/unittest/mocks/ExceptionListener.java Thu Oct  1 17:19:13 2009
@@ -0,0 +1,28 @@
+/*
+ * (C) Copyright IBM Corp. 2005, 2009
+ */
+package com.ibm.aries.unittest.mocks;
+
+/**
+ * <p>This class receives notification that an exception has been thrown from
+ *   a mock object.
+ * </p>
+ *
+ * <p>SIB build component: sib.unittest.mediation</p>
+ *
+ * @author nottinga
+ * @version 1.1
+ * @since 1.0
+ */
+public interface ExceptionListener
+{
+  /* ------------------------------------------------------------------------ */
+  /* exceptionNotification method                                    
+  /* ------------------------------------------------------------------------ */
+  /**
+   * This method is called when an exception has been thrown from a mock.
+   * 
+   * @param t the exception or error thrown.
+   */
+  public void exceptionNotification(Throwable t);
+}
\ No newline at end of file



Mime
View raw message