You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@depot.apache.org by aj...@apache.org on 2004/05/02 17:58:53 UTC

svn commit: rev 10491 - in incubator/depot/trunk/update: . src/java src/java/org/apache/depot/update/util/text src/java/org/apache/depot/update/util/xml src/test/org/apache/depot/update/util/xml

Author: ajack
Date: Sun May  2 10:58:52 2004
New Revision: 10491

Modified:
   incubator/depot/trunk/update/.svnignore
   incubator/depot/trunk/update/src/java/depot-update.properties
   incubator/depot/trunk/update/src/java/org/apache/depot/update/util/text/MessageConstants.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/util/xml/XMLGrouperElement.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/util/xml/XMLHandler.java
   incubator/depot/trunk/update/src/test/org/apache/depot/update/util/xml/XMLParserTests.java
   incubator/depot/trunk/update/src/test/org/apache/depot/update/util/xml/test.xml
Log:
1) Ignore build.number
2) Slowly, slowly, slowly wok through unit tests (more to do)


Modified: incubator/depot/trunk/update/.svnignore
==============================================================================
--- incubator/depot/trunk/update/.svnignore	(original)
+++ incubator/depot/trunk/update/.svnignore	Sun May  2 10:58:52 2004
@@ -1,4 +1,5 @@
 build
+build.number
 dist
 .project
 .classpath

Modified: incubator/depot/trunk/update/src/java/depot-update.properties
==============================================================================
--- incubator/depot/trunk/update/src/java/depot-update.properties	(original)
+++ incubator/depot/trunk/update/src/java/depot-update.properties	Sun May  2 10:58:52 2004
@@ -12,9 +12,20 @@
 #
 # @groupComment 
 
+# @translated true @created 2004-05-02 @modified 2004-05-02 @creator Adam Jack @modifier Adam Jack
+# @{2} 
+# @{1} 
+# @{0} 
+# @comment 
+GET_GROUP_MANIFEST=Get\ manifest\ for\ group\ {1}\ from\ repository\ {0}\ using\ {2}
 # @translated true @created 2003-10-06 @modified 2003-10-06 @creator Anou Manavalan @modifier Anou Manavalan
 # @comment 
 NO_TARGET_REPOSITORY=No\ target\ repository\ specified
+# @translated true @created 2004-05-02 @modified 2004-05-02 @creator Unknown @modifier Unknown
+# @{1} 
+# @{0} 
+# @comment 
+INITIALIZE_FAILED=Initialize\ failed\ for\ {0}\ giving\ {1}
 
 #
 # @group ResourceGroup
@@ -108,3 +119,12 @@
 VERSION_SELECTOR=Version\ Selector
 # @translated true @created 2003-09-22 @modified 2003-09-22
 WRONG_TYPE=Wrong\ type\ of\ object\ provided\ [{0}],\ Expected\ [{1}]
+
+#
+# @group XMLGroup
+#
+# @groupComment XML Handling
+
+# @translated true @created 2004-05-02 @modified 2004-05-02 @creator Adam Jack @modifier Adam Jack
+# @comment 
+XML_BEAN_ERROR=XML\ Bean\ Error

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/util/text/MessageConstants.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/util/text/MessageConstants.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/util/text/MessageConstants.java	Sun May  2 10:58:52 2004
@@ -54,7 +54,7 @@
 	public static final String LIST_RESOURCES = "LIST_RESOURCES";
 	public static final String LIST_SPECIFIERS = "LIST_SPECIFIERS";
 	public static final String GET_GROUP_MANIFEST = "GET_GROUP_MANIFEST";
-	public static final String DELETE_RESOURCE = "DELETE_RESOURCES";
+	public static final String DELETE_RESOURCE = "DELETE_RESOURCE";
 	public static final String PUBLISH_RESOURCE = "PUBLISH_RESOURCE";
 
 	public static final String INITIALIZE_FAILED = "INITIALIZE_FAILED";
@@ -63,7 +63,7 @@
 	public static final String LIST_SPECIFIERS_FAILED =
 		"LIST_SPECIFIERS_FAILED";
 	public static final String DELETE_RESOURCE_FAILED =
-		"DELETE_RESOURCES_FAILED";
+		"DELETE_RESOURCE_FAILED";
 	public static final String PUBLISH_RESOURCE_FAILED =
 		"PUBLISH_RESOURCE_FAILED";
 
@@ -104,6 +104,8 @@
 	public static final String CHILD_VRL_SELECTOR = "CHILD_VRL_SELECTOR";
 	public static final String MATCHING_VRL_SELECTOR = "MATCHING_VRL_SELECTOR";
 	public static final String PROTOCOL_VRL_SELECTOR = "PROTOCOL_VRL_SELECTOR";
+		
+	public static final String XML_BEAN_ERROR = "XML_BEAN_ERROR";
 
 	// For introspection, see below...
 	private MessageConstants() {

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/util/xml/XMLGrouperElement.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/util/xml/XMLGrouperElement.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/util/xml/XMLGrouperElement.java	Sun May  2 10:58:52 2004
@@ -28,9 +28,5 @@
 	 */
 	public XMLGrouperElement() {
 		super();
-		// TODO Auto-generated constructor stub
-	}
-
-	public static void main(String[] args) {
 	}
 }

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/util/xml/XMLHandler.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/util/xml/XMLHandler.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/util/xml/XMLHandler.java	Sun May  2 10:58:52 2004
@@ -22,6 +22,8 @@
 import org.apache.depot.common.log.Logger;
 import org.apache.depot.common.util.envsafe.ClassLoaderContext;
 import org.apache.depot.update.impl.ReferenceManager;
+import org.apache.depot.update.util.text.MessageConstants;
+import org.apache.depot.update.util.text.Messages;
 import org.xml.sax.Attributes;
 import org.xml.sax.Locator;
 import org.xml.sax.SAXException;
@@ -62,6 +64,9 @@
 		Attributes attributes)
 		throws SAXParseException {
 		try {
+			
+			Logger.getLogger().debug("startElement : " + qname);
+
 			if (tag.equals(XMLTagConstants.PROPERTY_XML_TAG)) {
 				// add the property to the xmlEntryTable
 				setAttributesToEntryTable(attributes);
@@ -82,8 +87,10 @@
 					clazzName = (String) m_xmlEntryTable.get(tag);
 				}
 
-				//:TODO: log this?
 				if (null != clazzName)
+
+					Logger.getLogger().debug("Class : " + clazzName);
+				
 					// if it is the XMLGrouperElement
 					if (!clazzName
 						.equals(
@@ -97,6 +104,9 @@
 						String refId =
 							attributes.getValue(XMLTagConstants.XML_TAG_REF_ID);
 
+						Logger.getLogger().debug("TagId : " + tagId);
+						Logger.getLogger().debug("RefId : " + refId);
+						
 						if (tagId == null) {
 							throw new Exception(
 								"No Id for the xml entry " + tag);
@@ -395,7 +405,7 @@
 				}
 		}
 		catch (Exception exception) {
-			Logger.getLogger().error("XML_BEAN_ERROR", exception);
+			Logger.getLogger().error(Messages.getString(MessageConstants.XML_BEAN_ERROR), exception);
 			throw new SAXParseException(
 				exception.getLocalizedMessage(),
 				m_context.getLocator(),

Modified: incubator/depot/trunk/update/src/test/org/apache/depot/update/util/xml/XMLParserTests.java
==============================================================================
--- incubator/depot/trunk/update/src/test/org/apache/depot/update/util/xml/XMLParserTests.java	(original)
+++ incubator/depot/trunk/update/src/test/org/apache/depot/update/util/xml/XMLParserTests.java	Sun May  2 10:58:52 2004
@@ -21,12 +21,22 @@
 
 import junit.framework.TestCase;
 
+import org.apache.depot.common.log.Logger;
 import org.apache.depot.common.util.envsafe.ClassLoaderContext;
 
 public class XMLParserTests extends TestCase {
 
 	public XMLParserTests(String name) {
 		super(name);
+	}	
+
+	/* (non-Javadoc)
+	 * @see junit.framework.TestCase#setUp()
+	 */
+	protected void setUp() throws Exception {
+		super.setUp();
+		
+		Logger.testInit();
 	}
 
 	public void testXMLParse() throws Exception {

Modified: incubator/depot/trunk/update/src/test/org/apache/depot/update/util/xml/test.xml
==============================================================================
--- incubator/depot/trunk/update/src/test/org/apache/depot/update/util/xml/test.xml	(original)
+++ incubator/depot/trunk/update/src/test/org/apache/depot/update/util/xml/test.xml	Sun May  2 10:58:52 2004
@@ -1,5 +1,5 @@
 <?xml version="1.0"?>
+<!-- Test File -->
 <parent attribute1="att1" attribute2="att2">
-	<child childAttribute="childAtt" >
-	</child>
+	<child childAttribute="childAtt" />
 </parent>