You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commons-dev@ws.apache.org by di...@apache.org on 2006/09/11 19:31:37 UTC
svn commit: r442273 - in /webservices/commons/trunk/modules/XmlSchema/src:
main/java/org/apache/ws/commons/schema/ test/java/tests/
Author: dims
Date: Mon Sep 11 10:31:36 2006
New Revision: 442273
URL: http://svn.apache.org/viewvc?view=rev&rev=442273
Log:
Fix for WSCOMMONS-51 - Facet classes missing toString method
Modified:
webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/XmlSchemaEnumerationFacet.java
webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/XmlSchemaFractionDigitsFacet.java
webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/XmlSchemaLengthFacet.java
webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/XmlSchemaMaxExclusiveFacet.java
webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/XmlSchemaMaxInclusiveFacet.java
webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/XmlSchemaMaxLengthFacet.java
webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/XmlSchemaMinExclusiveFacet.java
webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/XmlSchemaMinInclusiveFacet.java
webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/XmlSchemaMinLengthFacet.java
webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/XmlSchemaPatternFacet.java
webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/XmlSchemaTotalDigitsFacet.java
webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/XmlSchemaWhiteSpaceFacet.java
webservices/commons/trunk/modules/XmlSchema/src/test/java/tests/FacetsTest.java
Modified: webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/XmlSchemaEnumerationFacet.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/XmlSchemaEnumerationFacet.java?view=diff&rev=442273&r1=442272&r2=442273
==============================================================================
--- webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/XmlSchemaEnumerationFacet.java (original)
+++ webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/XmlSchemaEnumerationFacet.java Mon Sep 11 10:31:36 2006
@@ -1,35 +1,47 @@
-/*
- * Copyright 2004,2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ws.commons.schema;
-
-/**
- * Class for defining enumeration facets. Represents the World Wide
- * Web Consortium (W3C) enumeration facet.
- */
-
-public class XmlSchemaEnumerationFacet extends XmlSchemaFacet {
-
- /**
- * Creates new XmlSchemaEnumerationFacet
- */
- public XmlSchemaEnumerationFacet() {
- }
-
- public XmlSchemaEnumerationFacet(Object value, boolean fixed) {
- super(value, fixed);
- }
-}
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ws.commons.schema;
+
+/**
+ * Class for defining enumeration facets. Represents the World Wide
+ * Web Consortium (W3C) enumeration facet.
+ */
+
+public class XmlSchemaEnumerationFacet extends XmlSchemaFacet {
+
+ /**
+ * Creates new XmlSchemaEnumerationFacet
+ */
+ public XmlSchemaEnumerationFacet() {
+ }
+
+ public XmlSchemaEnumerationFacet(Object value, boolean fixed) {
+ super(value, fixed);
+ }
+
+ public String toString(String prefix, int tab) {
+ StringBuffer xml = new StringBuffer();
+ for (int i = 0; i < tab; i++) {
+ xml.append("\t");
+ }
+ xml.append("<enumeration value=\""
+ + (String)super.getValue() + "\" ");
+ xml.append("fixed=\"" + super.isFixed() + "\"/>\n");
+ return xml.toString();
+ }
+
+}
Modified: webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/XmlSchemaFractionDigitsFacet.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/XmlSchemaFractionDigitsFacet.java?view=diff&rev=442273&r1=442272&r2=442273
==============================================================================
--- webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/XmlSchemaFractionDigitsFacet.java (original)
+++ webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/XmlSchemaFractionDigitsFacet.java Mon Sep 11 10:31:36 2006
@@ -1,36 +1,47 @@
-/*
- * Copyright 2004,2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ws.commons.schema;
-
-/**
- * Class for defining fractionDigits facets. Represents the World Wide
- * Web Consortium (W3C) fractionDigits facet.
- */
-
-public class XmlSchemaFractionDigitsFacet extends XmlSchemaNumericFacet {
-
- /**
- * Creates new XmlSchemaFractionDigitsFacet
- */
- public XmlSchemaFractionDigitsFacet() {
- }
-
- public XmlSchemaFractionDigitsFacet(Object value, boolean fixed) {
- super(value, fixed);
- }
-
-}
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ws.commons.schema;
+
+/**
+ * Class for defining fractionDigits facets. Represents the World Wide
+ * Web Consortium (W3C) fractionDigits facet.
+ */
+
+public class XmlSchemaFractionDigitsFacet extends XmlSchemaNumericFacet {
+
+ /**
+ * Creates new XmlSchemaFractionDigitsFacet
+ */
+ public XmlSchemaFractionDigitsFacet() {
+ }
+
+ public XmlSchemaFractionDigitsFacet(Object value, boolean fixed) {
+ super(value, fixed);
+ }
+
+ public String toString(String prefix, int tab) {
+ StringBuffer xml = new StringBuffer();
+ for (int i = 0; i < tab; i++) {
+ xml.append("\t");
+ }
+ xml.append("<fractionDigits value=\""
+ + (String)super.getValue() + "\" ");
+ xml.append("fixed=\"" + super.isFixed() + "\"/>\n");
+ return xml.toString();
+ }
+
+}
Modified: webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/XmlSchemaLengthFacet.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/XmlSchemaLengthFacet.java?view=diff&rev=442273&r1=442272&r2=442273
==============================================================================
--- webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/XmlSchemaLengthFacet.java (original)
+++ webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/XmlSchemaLengthFacet.java Mon Sep 11 10:31:36 2006
@@ -1,35 +1,47 @@
-/*
- * Copyright 2004,2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ws.commons.schema;
-
-/**
- * Class for defining length facets. Represents the World Wide Web
- * Consortium (W3C) length facet.
- */
-
-public class XmlSchemaLengthFacet extends XmlSchemaNumericFacet {
-
- /**
- * Creates new XmlSchemaLengthFacet
- */
- public XmlSchemaLengthFacet() {
- }
-
- public XmlSchemaLengthFacet(Object value, boolean fixed) {
- super(value, fixed);
- }
-}
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ws.commons.schema;
+
+/**
+ * Class for defining length facets. Represents the World Wide Web
+ * Consortium (W3C) length facet.
+ */
+
+public class XmlSchemaLengthFacet extends XmlSchemaNumericFacet {
+
+ /**
+ * Creates new XmlSchemaLengthFacet
+ */
+ public XmlSchemaLengthFacet() {
+ }
+
+ public XmlSchemaLengthFacet(Object value, boolean fixed) {
+ super(value, fixed);
+ }
+
+ public String toString(String prefix, int tab) {
+ StringBuffer xml = new StringBuffer();
+ for (int i = 0; i < tab; i++) {
+ xml.append("\t");
+ }
+ xml.append("<length value=\""
+ + (String)super.getValue() + "\" ");
+ xml.append("fixed=\"" + super.isFixed() + "\"/>\n");
+ return xml.toString();
+ }
+
+}
Modified: webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/XmlSchemaMaxExclusiveFacet.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/XmlSchemaMaxExclusiveFacet.java?view=diff&rev=442273&r1=442272&r2=442273
==============================================================================
--- webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/XmlSchemaMaxExclusiveFacet.java (original)
+++ webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/XmlSchemaMaxExclusiveFacet.java Mon Sep 11 10:31:36 2006
@@ -1,35 +1,47 @@
-/*
- * Copyright 2004,2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ws.commons.schema;
-
-/**
- * Class for defining maxExclusive facets. Represents the World Wide
- * Web Consortium (W3C) maxExclusive facet.
- */
-
-public class XmlSchemaMaxExclusiveFacet extends XmlSchemaFacet {
-
- /**
- * Creates new XmlSchemaMaxExclusiveFacet
- */
- public XmlSchemaMaxExclusiveFacet() {
- }
-
- public XmlSchemaMaxExclusiveFacet(Object value, boolean fixed) {
- super(value, fixed);
- }
-}
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ws.commons.schema;
+
+/**
+ * Class for defining maxExclusive facets. Represents the World Wide
+ * Web Consortium (W3C) maxExclusive facet.
+ */
+
+public class XmlSchemaMaxExclusiveFacet extends XmlSchemaFacet {
+
+ /**
+ * Creates new XmlSchemaMaxExclusiveFacet
+ */
+ public XmlSchemaMaxExclusiveFacet() {
+ }
+
+ public XmlSchemaMaxExclusiveFacet(Object value, boolean fixed) {
+ super(value, fixed);
+ }
+
+ public String toString(String prefix, int tab) {
+ StringBuffer xml = new StringBuffer();
+ for (int i = 0; i < tab; i++) {
+ xml.append("\t");
+ }
+ xml.append("<maxExclusive value=\""
+ + (String)super.getValue() + "\" ");
+ xml.append("fixed=\"" + super.isFixed() + "\"/>\n");
+ return xml.toString();
+ }
+
+}
Modified: webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/XmlSchemaMaxInclusiveFacet.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/XmlSchemaMaxInclusiveFacet.java?view=diff&rev=442273&r1=442272&r2=442273
==============================================================================
--- webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/XmlSchemaMaxInclusiveFacet.java (original)
+++ webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/XmlSchemaMaxInclusiveFacet.java Mon Sep 11 10:31:36 2006
@@ -1,35 +1,47 @@
-/*
- * Copyright 2004,2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ws.commons.schema;
-
-/**
- * Class for defining maxInclusive facets. Represents the World
- * Wide Web Consortium (W3C) maxInclusive facet.
- */
-
-public class XmlSchemaMaxInclusiveFacet extends XmlSchemaFacet {
-
- /**
- * Creates new XmlSchemaMaxInclusiveFacet
- */
- public XmlSchemaMaxInclusiveFacet() {
- }
-
- public XmlSchemaMaxInclusiveFacet(Object value, boolean fixed) {
- super(value, fixed);
- }
-}
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ws.commons.schema;
+
+/**
+ * Class for defining maxInclusive facets. Represents the World
+ * Wide Web Consortium (W3C) maxInclusive facet.
+ */
+
+public class XmlSchemaMaxInclusiveFacet extends XmlSchemaFacet {
+
+ /**
+ * Creates new XmlSchemaMaxInclusiveFacet
+ */
+ public XmlSchemaMaxInclusiveFacet() {
+ }
+
+ public XmlSchemaMaxInclusiveFacet(Object value, boolean fixed) {
+ super(value, fixed);
+ }
+
+ public String toString(String prefix, int tab) {
+ StringBuffer xml = new StringBuffer();
+ for (int i = 0; i < tab; i++) {
+ xml.append("\t");
+ }
+ xml.append("<maxInclusive value=\""
+ + (String)super.getValue() + "\" ");
+ xml.append("fixed=\"" + super.isFixed() + "\"/>\n");
+ return xml.toString();
+ }
+
+}
Modified: webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/XmlSchemaMaxLengthFacet.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/XmlSchemaMaxLengthFacet.java?view=diff&rev=442273&r1=442272&r2=442273
==============================================================================
--- webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/XmlSchemaMaxLengthFacet.java (original)
+++ webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/XmlSchemaMaxLengthFacet.java Mon Sep 11 10:31:36 2006
@@ -1,35 +1,47 @@
-/*
- * Copyright 2004,2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ws.commons.schema;
-
-/**
- * Class for defining maxLength facets. Represents the World Wide
- * Web Consortium (W3C) maxLength facet.
- */
-
-public class XmlSchemaMaxLengthFacet extends XmlSchemaNumericFacet {
-
- /**
- * Creates new XmlSchemaMaxLengthFacet
- */
- public XmlSchemaMaxLengthFacet() {
- }
-
- public XmlSchemaMaxLengthFacet(Object value, boolean fixed) {
- super(value, fixed);
- }
-}
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ws.commons.schema;
+
+/**
+ * Class for defining maxLength facets. Represents the World Wide
+ * Web Consortium (W3C) maxLength facet.
+ */
+
+public class XmlSchemaMaxLengthFacet extends XmlSchemaNumericFacet {
+
+ /**
+ * Creates new XmlSchemaMaxLengthFacet
+ */
+ public XmlSchemaMaxLengthFacet() {
+ }
+
+ public XmlSchemaMaxLengthFacet(Object value, boolean fixed) {
+ super(value, fixed);
+ }
+
+ public String toString(String prefix, int tab) {
+ StringBuffer xml = new StringBuffer();
+ for (int i = 0; i < tab; i++) {
+ xml.append("\t");
+ }
+ xml.append("<maxLength value=\""
+ + (String)super.getValue() + "\" ");
+ xml.append("fixed=\"" + super.isFixed() + "\"/>\n");
+ return xml.toString();
+ }
+
+}
Modified: webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/XmlSchemaMinExclusiveFacet.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/XmlSchemaMinExclusiveFacet.java?view=diff&rev=442273&r1=442272&r2=442273
==============================================================================
--- webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/XmlSchemaMinExclusiveFacet.java (original)
+++ webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/XmlSchemaMinExclusiveFacet.java Mon Sep 11 10:31:36 2006
@@ -1,36 +1,47 @@
-/*
- * Copyright 2004,2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ws.commons.schema;
-
-/**
- * Class for defining minExclusive facets. Represents the World
- * Wide Web Consortium (W3C) minExclusive facet.
- */
-
-public class XmlSchemaMinExclusiveFacet extends XmlSchemaFacet {
-
- /**
- * Creates new XmlSchemaMinExclusive
- */
- public XmlSchemaMinExclusiveFacet() {
- }
-
- public XmlSchemaMinExclusiveFacet(Object value, boolean fixed) {
- super(value, fixed);
- }
-
-}
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ws.commons.schema;
+
+/**
+ * Class for defining minExclusive facets. Represents the World
+ * Wide Web Consortium (W3C) minExclusive facet.
+ */
+
+public class XmlSchemaMinExclusiveFacet extends XmlSchemaFacet {
+
+ /**
+ * Creates new XmlSchemaMinExclusive
+ */
+ public XmlSchemaMinExclusiveFacet() {
+ }
+
+ public XmlSchemaMinExclusiveFacet(Object value, boolean fixed) {
+ super(value, fixed);
+ }
+
+ public String toString(String prefix, int tab) {
+ StringBuffer xml = new StringBuffer();
+ for (int i = 0; i < tab; i++) {
+ xml.append("\t");
+ }
+ xml.append("<minExclusive value=\""
+ + (String)super.getValue() + "\" ");
+ xml.append("fixed=\"" + super.isFixed() + "\"/>\n");
+ return xml.toString();
+ }
+
+}
Modified: webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/XmlSchemaMinInclusiveFacet.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/XmlSchemaMinInclusiveFacet.java?view=diff&rev=442273&r1=442272&r2=442273
==============================================================================
--- webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/XmlSchemaMinInclusiveFacet.java (original)
+++ webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/XmlSchemaMinInclusiveFacet.java Mon Sep 11 10:31:36 2006
@@ -1,35 +1,47 @@
-/*
- * Copyright 2004,2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ws.commons.schema;
-
-/**
- * Class for defining minInclusive facets. Represents the World Wide
- * Web Consortium (W3C) minInclusive facet.
- */
-
-public class XmlSchemaMinInclusiveFacet extends XmlSchemaFacet {
-
- /**
- * Creates new XmlSchemaMinInclusive
- */
- public XmlSchemaMinInclusiveFacet() {
- }
-
- public XmlSchemaMinInclusiveFacet(Object value, boolean fixed) {
- super(value, fixed);
- }
-}
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ws.commons.schema;
+
+/**
+ * Class for defining minInclusive facets. Represents the World Wide
+ * Web Consortium (W3C) minInclusive facet.
+ */
+
+public class XmlSchemaMinInclusiveFacet extends XmlSchemaFacet {
+
+ /**
+ * Creates new XmlSchemaMinInclusive
+ */
+ public XmlSchemaMinInclusiveFacet() {
+ }
+
+ public XmlSchemaMinInclusiveFacet(Object value, boolean fixed) {
+ super(value, fixed);
+ }
+
+ public String toString(String prefix, int tab) {
+ StringBuffer xml = new StringBuffer();
+ for (int i = 0; i < tab; i++) {
+ xml.append("\t");
+ }
+ xml.append("<minInclusive value=\""
+ + (String)super.getValue() + "\" ");
+ xml.append("fixed=\"" + super.isFixed() + "\"/>\n");
+ return xml.toString();
+ }
+
+}
Modified: webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/XmlSchemaMinLengthFacet.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/XmlSchemaMinLengthFacet.java?view=diff&rev=442273&r1=442272&r2=442273
==============================================================================
--- webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/XmlSchemaMinLengthFacet.java (original)
+++ webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/XmlSchemaMinLengthFacet.java Mon Sep 11 10:31:36 2006
@@ -1,35 +1,47 @@
-/*
- * Copyright 2004,2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ws.commons.schema;
-
-/**
- * Class for defining minLength facets. Represents the World Wide
- * Web Consortium (W3C) minLength facet.
- */
-
-public class XmlSchemaMinLengthFacet extends XmlSchemaNumericFacet {
-
- /**
- * Creates new XmlSchemaMinLengthFacet
- */
- public XmlSchemaMinLengthFacet() {
- }
-
- public XmlSchemaMinLengthFacet(Object value, boolean fixed) {
- super(value, fixed);
- }
-}
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ws.commons.schema;
+
+/**
+ * Class for defining minLength facets. Represents the World Wide
+ * Web Consortium (W3C) minLength facet.
+ */
+
+public class XmlSchemaMinLengthFacet extends XmlSchemaNumericFacet {
+
+ /**
+ * Creates new XmlSchemaMinLengthFacet
+ */
+ public XmlSchemaMinLengthFacet() {
+ }
+
+ public XmlSchemaMinLengthFacet(Object value, boolean fixed) {
+ super(value, fixed);
+ }
+
+ public String toString(String prefix, int tab) {
+ StringBuffer xml = new StringBuffer();
+ for (int i = 0; i < tab; i++) {
+ xml.append("\t");
+ }
+ xml.append("<minLength value=\""
+ + (String)super.getValue() + "\" ");
+ xml.append("fixed=\"" + super.isFixed() + "\"/>\n");
+ return xml.toString();
+ }
+
+}
Modified: webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/XmlSchemaPatternFacet.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/XmlSchemaPatternFacet.java?view=diff&rev=442273&r1=442272&r2=442273
==============================================================================
--- webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/XmlSchemaPatternFacet.java (original)
+++ webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/XmlSchemaPatternFacet.java Mon Sep 11 10:31:36 2006
@@ -1,35 +1,47 @@
-/*
- * Copyright 2004,2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ws.commons.schema;
-
-/**
- * Class for defining pattern facets. Represents the World Wide
- * Web Consortium (W3C) pattern facet.
- */
-
-public class XmlSchemaPatternFacet extends XmlSchemaFacet {
-
- /**
- * Creates new XmlSchemaPatternFacet
- */
- public XmlSchemaPatternFacet() {
- }
-
- public XmlSchemaPatternFacet(Object value, boolean fixed) {
- super(value, fixed);
- }
-}
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ws.commons.schema;
+
+/**
+ * Class for defining pattern facets. Represents the World Wide
+ * Web Consortium (W3C) pattern facet.
+ */
+
+public class XmlSchemaPatternFacet extends XmlSchemaFacet {
+
+ /**
+ * Creates new XmlSchemaPatternFacet
+ */
+ public XmlSchemaPatternFacet() {
+ }
+
+ public XmlSchemaPatternFacet(Object value, boolean fixed) {
+ super(value, fixed);
+ }
+
+ public String toString(String prefix, int tab) {
+ StringBuffer xml = new StringBuffer();
+ for (int i = 0; i < tab; i++) {
+ xml.append("\t");
+ }
+ xml.append("<pattern value=\""
+ + (String)super.getValue() + "\" ");
+ xml.append("fixed=\"" + super.isFixed() + "\"/>\n");
+ return xml.toString();
+ }
+
+}
Modified: webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/XmlSchemaTotalDigitsFacet.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/XmlSchemaTotalDigitsFacet.java?view=diff&rev=442273&r1=442272&r2=442273
==============================================================================
--- webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/XmlSchemaTotalDigitsFacet.java (original)
+++ webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/XmlSchemaTotalDigitsFacet.java Mon Sep 11 10:31:36 2006
@@ -1,35 +1,47 @@
-/*
- * Copyright 2004,2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ws.commons.schema;
-
-/**
- * Class for defining totalDigits facets. Represents the World Wide
- * Web Consortium (W3C) totalDigits facet.
- */
-
-public class XmlSchemaTotalDigitsFacet extends XmlSchemaNumericFacet {
-
- /**
- * Creates new XmlSchemaTotalDigitsFacet
- */
- public XmlSchemaTotalDigitsFacet() {
- }
-
- public XmlSchemaTotalDigitsFacet(Object value, boolean fixed) {
- super(value, fixed);
- }
-}
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ws.commons.schema;
+
+/**
+ * Class for defining totalDigits facets. Represents the World Wide
+ * Web Consortium (W3C) totalDigits facet.
+ */
+
+public class XmlSchemaTotalDigitsFacet extends XmlSchemaNumericFacet {
+
+ /**
+ * Creates new XmlSchemaTotalDigitsFacet
+ */
+ public XmlSchemaTotalDigitsFacet() {
+ }
+
+ public XmlSchemaTotalDigitsFacet(Object value, boolean fixed) {
+ super(value, fixed);
+ }
+
+ public String toString(String prefix, int tab) {
+ StringBuffer xml = new StringBuffer();
+ for (int i = 0; i < tab; i++) {
+ xml.append("\t");
+ }
+ xml.append("<totalDigits value=\""
+ + (String)super.getValue() + "\" ");
+ xml.append("fixed=\"" + super.isFixed() + "\"/>\n");
+ return xml.toString();
+ }
+
+}
Modified: webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/XmlSchemaWhiteSpaceFacet.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/XmlSchemaWhiteSpaceFacet.java?view=diff&rev=442273&r1=442272&r2=442273
==============================================================================
--- webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/XmlSchemaWhiteSpaceFacet.java (original)
+++ webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/XmlSchemaWhiteSpaceFacet.java Mon Sep 11 10:31:36 2006
@@ -1,39 +1,51 @@
-/*
- * Copyright 2004,2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/*
- * XmlSchemaWhiteSpaceFacet.java
- */
-
-package org.apache.ws.commons.schema;
-
-/**
- * Class for defining whiteSpace facets. Represents the World Wide
- * Web Consortium (W3C) whiteSpace facet.
- */
-
-public class XmlSchemaWhiteSpaceFacet extends XmlSchemaFacet {
-
- /**
- * Creates new XmlSchemaWhiteSpaceFacet
- */
- public XmlSchemaWhiteSpaceFacet() {
- }
-
- public XmlSchemaWhiteSpaceFacet(Object value, boolean fixed) {
- super(value, fixed);
- }
-}
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * XmlSchemaWhiteSpaceFacet.java
+ */
+
+package org.apache.ws.commons.schema;
+
+/**
+ * Class for defining whiteSpace facets. Represents the World Wide
+ * Web Consortium (W3C) whiteSpace facet.
+ */
+
+public class XmlSchemaWhiteSpaceFacet extends XmlSchemaFacet {
+
+ /**
+ * Creates new XmlSchemaWhiteSpaceFacet
+ */
+ public XmlSchemaWhiteSpaceFacet() {
+ }
+
+ public XmlSchemaWhiteSpaceFacet(Object value, boolean fixed) {
+ super(value, fixed);
+ }
+
+ public String toString(String prefix, int tab) {
+ StringBuffer xml = new StringBuffer();
+ for (int i = 0; i < tab; i++) {
+ xml.append("\t");
+ }
+ xml.append("<whiteSpace value=\""
+ + (String)super.getValue() + "\" ");
+ xml.append("fixed=\"" + super.isFixed() + "\"/>\n");
+ return xml.toString();
+ }
+
+}
Modified: webservices/commons/trunk/modules/XmlSchema/src/test/java/tests/FacetsTest.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/XmlSchema/src/test/java/tests/FacetsTest.java?view=diff&rev=442273&r1=442272&r2=442273
==============================================================================
--- webservices/commons/trunk/modules/XmlSchema/src/test/java/tests/FacetsTest.java (original)
+++ webservices/commons/trunk/modules/XmlSchema/src/test/java/tests/FacetsTest.java Mon Sep 11 10:31:36 2006
@@ -1,3 +1,20 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ * Copyright 2006 International Business Machines Corp.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
package tests;
import java.io.FileInputStream;
@@ -33,24 +50,6 @@
import org.apache.ws.commons.schema.XmlSchemaElement;
import org.apache.ws.commons.schema.XmlSchemaObjectCollection;
-/*
- * Copyright 2004,2005 The Apache Software Foundation.
- * Copyright 2006 International Business Machines Corp.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * @author Brent Ulbricht
- */
public class FacetsTest extends TestCase {
/**
@@ -106,9 +105,17 @@
if (o instanceof XmlSchemaLengthFacet) {
assertEquals("5", ((XmlSchemaLengthFacet)o).getValue());
assertEquals(false, ((XmlSchemaLengthFacet)o).isFixed());
+ String toStr = ((XmlSchemaLengthFacet)o).toString("xsd", 1);
+ assertTrue("The toString(String, int) method did not contain "
+ + "\"length\", but did contain: " + toStr,
+ toStr.indexOf("length value=\"5\"") != -1);
} else if (o instanceof XmlSchemaPatternFacet) {
assertEquals("\\d{5}", ((XmlSchemaPatternFacet)o).getValue());
assertEquals(false, ((XmlSchemaPatternFacet)o).isFixed());
+ String toStr = ((XmlSchemaPatternFacet)o).toString("xsd", 1);
+ assertTrue("The toString(String, int) method did not contain "
+ + "\"pattern\", but did contain: " + toStr,
+ toStr.indexOf("pattern value=\"\\d{5}\"") != -1);
} else {
fail("Unexpected object encountered: " + o.getClass().getName());
}
@@ -171,6 +178,10 @@
if (o instanceof XmlSchemaPatternFacet) {
assertEquals("\\d{15}", ((XmlSchemaPatternFacet)o).getValue());
assertEquals(false, ((XmlSchemaPatternFacet)o).isFixed());
+ String toStr = ((XmlSchemaPatternFacet)o).toString("xsd", 1);
+ assertTrue("The toString(String, int) method did not contain "
+ + "\"pattern\", but did contain: " + toStr,
+ toStr.indexOf("pattern value=\"\\d{15}\"") != -1);
} else {
fail("Unexpected object encountered: " + o.getClass().getName());
}
@@ -233,6 +244,10 @@
if (o instanceof XmlSchemaTotalDigitsFacet) {
assertEquals("3", ((XmlSchemaTotalDigitsFacet)o).getValue());
assertEquals(false, ((XmlSchemaTotalDigitsFacet)o).isFixed());
+ String toStr = ((XmlSchemaTotalDigitsFacet)o).toString("xsd", 1);
+ assertTrue("The toString(String, int) method did not contain "
+ + "\"totalDigits\", but did contain: " + toStr,
+ toStr.indexOf("totalDigits value=\"3\"") != -1);
} else {
fail("Unexpected object encountered: " + o.getClass().getName());
}
@@ -297,9 +312,17 @@
if (o instanceof XmlSchemaMaxInclusiveFacet) {
assertEquals("100", ((XmlSchemaMaxInclusiveFacet)o).getValue());
assertEquals(true, ((XmlSchemaMaxInclusiveFacet)o).isFixed());
+ String toStr = ((XmlSchemaMaxInclusiveFacet)o).toString("xsd", 1);
+ assertTrue("The toString(String, int) method did not contain "
+ + "\"maxInclusive\", but did contain: " + toStr,
+ toStr.indexOf("maxInclusive value=\"100\"") != -1);
} else if (o instanceof XmlSchemaMinInclusiveFacet) {
assertEquals("0", ((XmlSchemaMinInclusiveFacet)o).getValue());
assertEquals(false, ((XmlSchemaMinInclusiveFacet)o).isFixed());
+ String toStr = ((XmlSchemaMinInclusiveFacet)o).toString("xsd", 1);
+ assertTrue("The toString(String, int) method did not contain "
+ + "\"minInclusive\", but did contain: " + toStr,
+ toStr.indexOf("minInclusive value=\"0\"") != -1);
} else {
fail("Unexpected object encountered: " + o.getClass().getName());
}
@@ -364,9 +387,17 @@
if (o instanceof XmlSchemaMaxExclusiveFacet) {
assertEquals("200", ((XmlSchemaMaxExclusiveFacet)o).getValue());
assertEquals(false, ((XmlSchemaMaxExclusiveFacet)o).isFixed());
+ String toStr = ((XmlSchemaMaxExclusiveFacet)o).toString("xsd", 1);
+ assertTrue("The toString(String, int) method did not contain "
+ + "\"maxExclusive\", but did contain: " + toStr,
+ toStr.indexOf("maxExclusive value=\"200\"") != -1);
} else if (o instanceof XmlSchemaMinExclusiveFacet) {
assertEquals("1", ((XmlSchemaMinExclusiveFacet)o).getValue());
assertEquals(false, ((XmlSchemaMinExclusiveFacet)o).isFixed());
+ String toStr = ((XmlSchemaMinExclusiveFacet)o).toString("xsd", 1);
+ assertTrue("The toString(String, int) method did not contain "
+ + "\"minExclusive\", but did contain: " + toStr,
+ toStr.indexOf("minExclusive value=\"1\"") != -1);
} else {
fail("Unexpected object encountered: " + o.getClass().getName());
}
@@ -429,6 +460,10 @@
if (o instanceof XmlSchemaWhiteSpaceFacet) {
assertEquals("collapse", ((XmlSchemaWhiteSpaceFacet)o).getValue());
assertEquals(false, ((XmlSchemaWhiteSpaceFacet)o).isFixed());
+ String toStr = ((XmlSchemaWhiteSpaceFacet)o).toString("xsd", 1);
+ assertTrue("The toString(String, int) method did not contain "
+ + "\"minExclusive\", but did contain: " + toStr,
+ toStr.indexOf("whiteSpace value=\"collapse\"") != -1);
} else {
fail("Unexpected object encountered: " + o.getClass().getName());
}
@@ -493,9 +528,17 @@
if (o instanceof XmlSchemaFractionDigitsFacet) {
assertEquals("2", ((XmlSchemaFractionDigitsFacet)o).getValue());
assertEquals(false, ((XmlSchemaFractionDigitsFacet)o).isFixed());
+ String toStr = ((XmlSchemaFractionDigitsFacet)o).toString("xsd", 1);
+ assertTrue("The toString(String, int) method did not contain "
+ + "\"fractionDigits\", but did contain: " + toStr,
+ toStr.indexOf("fractionDigits value=\"2\"") != -1);
} else if (o instanceof XmlSchemaTotalDigitsFacet) {
assertEquals("3", ((XmlSchemaTotalDigitsFacet)o).getValue());
assertEquals(false, ((XmlSchemaTotalDigitsFacet)o).isFixed());
+ String toStr = ((XmlSchemaTotalDigitsFacet)o).toString("xsd", 1);
+ assertTrue("The toString(String, int) method did not contain "
+ + "\"totalDigits\", but did contain: " + toStr,
+ toStr.indexOf("totalDigits value=\"3\"") != -1);
} else {
fail("Unexpected object encountered: " + o.getClass().getName());
}
@@ -560,9 +603,17 @@
if (o instanceof XmlSchemaMinLengthFacet) {
assertEquals("45", ((XmlSchemaMinLengthFacet)o).getValue());
assertEquals(false, ((XmlSchemaMinLengthFacet)o).isFixed());
+ String toStr = ((XmlSchemaMinLengthFacet)o).toString("xsd", 1);
+ assertTrue("The toString(String, int) method did not contain "
+ + "\"minExclusive\", but did contain: " + toStr,
+ toStr.indexOf("minLength value=\"45\"") != -1);
} else if (o instanceof XmlSchemaMaxLengthFacet) {
assertEquals("205", ((XmlSchemaMaxLengthFacet)o).getValue());
assertEquals(false, ((XmlSchemaMaxLengthFacet)o).isFixed());
+ String toStr = ((XmlSchemaMaxLengthFacet)o).toString("xsd", 1);
+ assertTrue("The toString(String, int) method did not contain "
+ + "\"maxLength\", but did contain: " + toStr,
+ toStr.indexOf("maxLength value=\"205\"") != -1);
} else {
fail("Unexpected object encountered: " + o.getClass().getName());
}
@@ -627,6 +678,16 @@
assertTrue("Atempted to remove an enumeration with the value of "
+ "\"" + value + "\", but the value was not in the set.",
s.remove(value));
+ String toStr = xsef.toString("xsd", 1);
+ if (value.equals("Field")) {
+ assertTrue("The toString(String, int) method did not contain "
+ + "\"enumeration\", but did contain: " + toStr,
+ toStr.indexOf("enumeration value=\"Field\"") != -1);
+ } else if (value.equals("Separator")) {
+ assertTrue("The toString(String, int) method did not contain "
+ + "\"enumeration\", but did contain: " + toStr,
+ toStr.indexOf("enumeration value=\"Separator\"") != -1);
+ }
}
assertTrue("The set should have been empty, but instead contained: "
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: commons-dev-help@ws.apache.org