Permalink
Browse files

ISPN-1844 Revert to old schema location and update for 5.2

  • Loading branch information...
1 parent b7d52d3 commit f9acae78abaf182da44f361e3472db2596277922 @galderz galderz committed with maniksurtani Feb 8, 2012
Showing with 66 additions and 154 deletions.
  1. +0 −2 .gitignore
  2. +0 −9 bin/utils.py
  3. +2 −2 cachestore/remote/src/test/resources/remote-cl-config.xml
  4. +2 −2 cdi/extension/src/test/resources/infinispan.xml
  5. +1 −1 core/pom.xml
  6. +11 −2 core/src/main/java/org/infinispan/configuration/parsing/Namespace.java
  7. +1 −1 core/src/main/java/org/infinispan/configuration/parsing/ParseUtils.java
  8. +0 −86 core/src/main/java/org/infinispan/util/JaxbSchemaGenerator.java
  9. +2 −2 core/src/main/resources/config-samples/distributed-ec2.xml
  10. +2 −2 core/src/main/resources/config-samples/distributed-udp.xml
  11. +2 −2 core/src/main/resources/config-samples/sample.xml
  12. +1 −1 core/src/main/resources/{infinispan-5.1.xsd → schema/infinispan-config-5.2.xsd}
  13. +1 −2 core/src/test/java/org/infinispan/configuration/ConfigurationUnitTest.java
  14. +2 −2 core/src/test/java/org/infinispan/test/TestingUtil.java
  15. +2 −2 core/src/test/resources/configs/all.xml
  16. +2 −2 core/src/test/resources/configs/batching.xml
  17. +2 −2 core/src/test/resources/configs/deprecated-elements.xml
  18. +2 −2 core/src/test/resources/configs/named-cache-test.xml
  19. +2 −2 core/src/test/resources/configs/no-xa-config.xml
  20. +2 −2 core/src/test/resources/configs/recovery-enabled-config.xml
  21. +2 −2 core/src/test/resources/configs/string-property-replaced.xml
  22. +2 −2 demos/ec2/src/main/resources/config-samples/ec2-demo/infinispan-ec2-config.xml
  23. +2 −2 demos/gridfs-webdav/src/main/webapp/WEB-INF/classes/infinispan.xml
  24. +2 −2 demos/gui/src/main/resources/config-samples/gui-demo-cache-config.xml
  25. +2 −2 demos/gui/src/main/resources/config-samples/relay1.xml
  26. +2 −2 demos/gui/src/main/resources/config-samples/relay2.xml
  27. +2 −2 query/src/test/resources/configuration-parsing-test-enbledInDefault.xml
  28. +2 −2 query/src/test/resources/configuration-parsing-test.xml
  29. +2 −2 server/rest/src/test/resources/test-config.xml
  30. +2 −2 spring/src/test/resources/org/infinispan/spring/provider/named-async-cache.xml
  31. +3 −2 spring/src/test/resources/org/infinispan/spring/provider/sample/books-infinispan-config.xml
  32. +2 −2 spring/src/test/resources/org/infinispan/spring/support/embedded/comprehensive-infinispan-config.xml
  33. +2 −2 spring/src/test/resources/org/infinispan/spring/support/embedded/named-async-cache.xml
View
@@ -28,8 +28,6 @@ PutObjectStoreDirHere
ObjectStore
# generated rhq plugin xml
rhq-plugin.xml
-# generated schema
-core/src/main/resources/schema
# Compiled python files
*.pyc
# Jandex generated indexes
View
@@ -380,15 +380,6 @@ def maven_build_distribution(version):
c.insert(0, '-q')
c.insert(0, 'mvn')
subprocess.check_call(c)
-
- print "Verifying build"
- # Check contents of XSD in core/target/classes/schema/infinispan-config-{VMajor.VMinor}.xsd
- fn = "core/target/classes/schema/infinispan-config-%s.%s.xsd" % ('5', '0')
- if os.path.isfile(fn):
- f = open(fn)
- xsd = f.read()
- f.close()
- xsd.find("urn:infinispan:config:5.0")
def get_version_pattern():
@@ -23,8 +23,8 @@
-->
<infinispan
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="urn:infinispan:config:5.1 http://www.infinispan.org/schemas/infinispan-config-5.1.xsd"
- xmlns="urn:infinispan:config:5.1">
+ xsi:schemaLocation="urn:infinispan:config:5.2 http://www.infinispan.org/schemas/infinispan-config-5.2.xsd"
+ xmlns="urn:infinispan:config:5.2">
<default>
<jmxStatistics enabled="false"/>
@@ -21,9 +21,9 @@
~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-->
-<infinispan xmlns="urn:infinispan:config:5.1"
+<infinispan xmlns="urn:infinispan:config:5.2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="urn:infinispan:config:5.1 http://docs.jboss.org/infinispan/schemas/infinispan-config-5.1.xsd">
+ xsi:schemaLocation="urn:infinispan:config:5.2 http://docs.jboss.org/infinispan/schemas/infinispan-config-5.2.xsd">
<default>
<eviction maxEntries="1000" />
</default>
View
@@ -250,7 +250,7 @@
<argument>"XML Schema for Infinispan"</argument>
<argument>-o</argument>
<argument>${project.build.directory}/xsd_doc</argument>
- <argument>${basedir}/src/main/resources/infinispan-5.1.xsd</argument>
+ <argument>${basedir}/src/main/resources/schema/infinispan-config-5.2.xsd</argument>
</arguments>
</configuration>
</plugin>
@@ -42,12 +42,21 @@
// configuration versions, oldest to newest
INFINISPAN_5_0("urn:infinispan:config:5.0"),
- INFINISPAN_5_1("urn:infinispan:config:5.1");
+ INFINISPAN_5_1("urn:infinispan:config:5.1"),
+ INFINISPAN_5_2("urn:infinispan:config:5.2");
/**
* The current namespace version.
*/
- public static final Namespace CURRENT = INFINISPAN_5_1;
+ public static final Namespace CURRENT = INFINISPAN_5_2;
+
+ private static final Namespace[] SUPPORTED_NAMESPACES = new Namespace[] {
+ INFINISPAN_5_2, INFINISPAN_5_1, INFINISPAN_5_0, NONE};
+
+ public boolean isSupported() {
+ for (Namespace ns : SUPPORTED_NAMESPACES) if (this == ns) return true;
+ return false;
+ }
private final String name;
@@ -45,7 +45,7 @@ public static Element nextElement(XMLStreamReader reader) throws XMLStreamExcept
return null;
}
Namespace readerNS = Namespace.forUri(reader.getNamespaceURI());
- if ( !(readerNS == Namespace.INFINISPAN_5_1 || readerNS == Namespace.INFINISPAN_5_0 || readerNS == Namespace.NONE)) {
+ if (!readerNS.isSupported()) {
throw unexpectedElement(reader);
}
return Element.forName(reader.getLocalName());
@@ -1,86 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2009 Red Hat Inc. and/or its affiliates and other
- * contributors as indicated by the @author tags. All rights reserved.
- * See the copyright.txt in the distribution for a full listing of
- * individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.infinispan.util;
-
-import java.io.File;
-import java.io.IOException;
-
-import javax.xml.bind.JAXBContext;
-import javax.xml.bind.SchemaOutputResolver;
-import javax.xml.transform.Result;
-import javax.xml.transform.stream.StreamResult;
-
-import org.infinispan.Version;
-import org.infinispan.config.InfinispanConfiguration;
-
-/**
- * Generates XML schema using JAXB annotations from our configuration class hierarchy.
- *
- * @author Vladimir Blagojevic
- * @since 4.0
- */
-public class JaxbSchemaGenerator {
-
- public static void main(String[] args) throws Exception {
- try {
- File baseDir = new File(System.getProperty("user.dir"));
- if (args.length > 0) {
- String dir = args[0];
- if (dir != null && dir.length() > 0) {
- baseDir = new File(dir);
- }
- }
-
- if (!baseDir.exists())
- baseDir.mkdirs();
-
- System.out.println("Generating schema file in " + baseDir.getAbsolutePath());
- try {
- JAXBContext context = JAXBContext.newInstance(InfinispanConfiguration.class);
- context.generateSchema(new InfinispanSchemaOutputResolver(baseDir));
- System.out.println("Generated schema file successfully");
- } catch (Exception e) {
- System.err.println("Failed generating schema file " + e);
- e.printStackTrace(System.err);
- }
- } catch (Exception e) {
- System.err.println("Failed generating schema file " + e);
- e.printStackTrace(System.err);
- }
- }
-
- static class InfinispanSchemaOutputResolver extends SchemaOutputResolver {
- private File dir;
-
- private InfinispanSchemaOutputResolver(File dir) {
- super();
- this.dir = dir;
- }
-
- public Result createOutput(String namespaceUri, String suggestedFileName) throws IOException {
- String fname = String.format("infinispan-config-%s.xsd", Version.MAJOR_MINOR);
- System.out.printf("Using file name %s for schema%n", fname);
- return new StreamResult(new File(dir, fname));
- }
- }
-}
@@ -20,8 +20,8 @@
<infinispan
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="urn:infinispan:config:5.1 http://www.infinispan.org/schemas/infinispan-config-5.1.xsd"
- xmlns="urn:infinispan:config:5.1">
+ xsi:schemaLocation="urn:infinispan:config:5.2 http://www.infinispan.org/schemas/infinispan-config-5.2.xsd"
+ xmlns="urn:infinispan:config:5.2">
<global>
<transport>
@@ -20,8 +20,8 @@
<infinispan
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="urn:infinispan:config:5.1 http://www.infinispan.org/schemas/infinispan-config-5.1.xsd"
- xmlns="urn:infinispan:config:5.1">
+ xsi:schemaLocation="urn:infinispan:config:5.2 http://www.infinispan.org/schemas/infinispan-config-5.2.xsd"
+ xmlns="urn:infinispan:config:5.2">
<global>
<transport>
@@ -24,8 +24,8 @@
<infinispan
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="urn:infinispan:config:5.1 http://www.infinispan.org/schemas/infinispan-config-5.1.xsd"
- xmlns="urn:infinispan:config:5.1">
+ xsi:schemaLocation="urn:infinispan:config:5.2 http://www.infinispan.org/schemas/infinispan-config-5.2.xsd"
+ xmlns="urn:infinispan:config:5.2">
<!--
******************************************************************************************************************
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" version="1.0" targetNamespace="urn:infinispan:config:5.1" xmlns:tns="urn:infinispan:config:5.1" xmlns:xs="http://www.w3.org/2001/XMLSchema">
+<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" version="1.0" targetNamespace="urn:infinispan:config:5.2" xmlns:tns="urn:infinispan:config:5.2" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="infinispan">
<xs:annotation>
@@ -26,7 +26,6 @@
import static org.infinispan.transaction.TransactionMode.NON_TRANSACTIONAL;
import static org.testng.Assert.assertEquals;
-import java.io.File;
import java.net.URL;
import javax.xml.XMLConstants;
@@ -209,7 +208,7 @@ public void testClusterNameNull(){
@Test
public void testSchema() throws Exception {
FileLookup lookup = FileLookupFactory.newInstance();
- URL schemaFile = lookup.lookupFileLocation("infinispan-5.1.xsd", Thread.currentThread().getContextClassLoader());
+ URL schemaFile = lookup.lookupFileLocation("schema/infinispan-config-5.2.xsd", Thread.currentThread().getContextClassLoader());
Source xmlFile = new StreamSource(lookup.lookupFile("configs/all.xml", Thread.currentThread().getContextClassLoader()));
SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI).newSchema(schemaFile).newValidator().validate(xmlFile);
}
@@ -89,8 +89,8 @@
public static final String TEST_PATH = "target" + separator + "tempFiles";
public static final String INFINISPAN_START_TAG = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<infinispan\n" +
" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n" +
- " xsi:schemaLocation=\"urn:infinispan:config:5.1 http://www.infinispan.org/schemas/infinispan-config-5.1.xsd\"\n" +
- " xmlns=\"urn:infinispan:config:5.1\">";
+ " xsi:schemaLocation=\"urn:infinispan:config:5.2 http://www.infinispan.org/schemas/infinispan-config-5.2.xsd\"\n" +
+ " xmlns=\"urn:infinispan:config:5.2\">";
public static final String INFINISPAN_START_TAG_40 = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<infinispan\n" +
" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n" +
" xsi:schemaLocation=\"urn:infinispan:config:4.0 http://www.infinispan.org/schemas/infinispan-config-4.0.xsd\"\n" +
@@ -23,8 +23,8 @@
-->
<infinispan
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="urn:infinispan:config:5.1 ../../../../src/main/resources/infinispan-5.1.xsd"
- xmlns="urn:infinispan:config:5.1">
+ xsi:schemaLocation="urn:infinispan:config:5.2 http://www.infinispan.org/schemas/infinispan-config-5.2.xsd"
+ xmlns="urn:infinispan:config:5.2">
<global>
<asyncListenerExecutor factory="com.acme.Factory">
@@ -23,8 +23,8 @@
-->
<infinispan xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="urn:infinispan:config:5.1 http://www.infinispan.org/schemas/infinispan-config-5.1.xsd"
- xmlns="urn:infinispan:config:5.1">
+ xsi:schemaLocation="urn:infinispan:config:5.2 http://www.infinispan.org/schemas/infinispan-config-5.2.xsd"
+ xmlns="urn:infinispan:config:5.2">
<default>
<transaction cacheStopTimeout="2"/>
@@ -24,8 +24,8 @@
<infinispan
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="urn:infinispan:config:5.1 http://www.infinispan.org/schemas/infinispan-config-5.1.xsd"
- xmlns="urn:infinispan:config:5.1">
+ xsi:schemaLocation="urn:infinispan:config:5.2 http://www.infinispan.org/schemas/infinispan-config-5.2.xsd"
+ xmlns="urn:infinispan:config:5.2">
<default>
<lazyDeserialization enabled="true"/>
@@ -23,8 +23,8 @@
-->
<infinispan
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="urn:infinispan:config:5.1 http://www.infinispan.org/schemas/infinispan-config-5.1.xsd"
- xmlns="urn:infinispan:config:5.1">
+ xsi:schemaLocation="urn:infinispan:config:5.2 http://www.infinispan.org/schemas/infinispan-config-5.2.xsd"
+ xmlns="urn:infinispan:config:5.2">
<global>
@@ -24,8 +24,8 @@
<infinispan
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="urn:infinispan:config:5.1 http://www.infinispan.org/schemas/infinispan-config-5.1.xsd"
- xmlns="urn:infinispan:config:5.1">
+ xsi:schemaLocation="urn:infinispan:config:5.2 http://www.infinispan.org/schemas/infinispan-config-5.2.xsd"
+ xmlns="urn:infinispan:config:5.2">
<global>
@@ -24,8 +24,8 @@
<infinispan
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="urn:infinispan:config:5.1 http://www.infinispan.org/schemas/infinispan-config-5.1.xsd"
- xmlns="urn:infinispan:config:5.1">
+ xsi:schemaLocation="urn:infinispan:config:5.2 http://www.infinispan.org/schemas/infinispan-config-5.2.xsd"
+ xmlns="urn:infinispan:config:5.2">
<global>
@@ -23,8 +23,8 @@
-->
<infinispan
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="urn:infinispan:config:5.1 http://www.infinispan.org/schemas/infinispan-config-5.1.xsd"
- xmlns="urn:infinispan:config:5.1">
+ xsi:schemaLocation="urn:infinispan:config:5.2 http://www.infinispan.org/schemas/infinispan-config-5.2.xsd"
+ xmlns="urn:infinispan:config:5.2">
<!-- *************************** -->
<!-- System-wide global settings -->
@@ -22,8 +22,8 @@
~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-->
<infinispan xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="urn:infinispan:config:5.1 http://www.infinispan.org/schemas/infinispan-config-5.1.xsd"
- xmlns="urn:infinispan:config:5.1">
+ xsi:schemaLocation="urn:infinispan:config:5.2 http://www.infinispan.org/schemas/infinispan-config-5.2.xsd"
+ xmlns="urn:infinispan:config:5.2">
<global>
<asyncListenerExecutor
@@ -23,8 +23,8 @@
-->
<infinispan
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="urn:infinispan:config:5.1 http://www.infinispan.org/schemas/infinispan-config-5.1.xsd"
- xmlns="urn:infinispan:config:5.1">
+ xsi:schemaLocation="urn:infinispan:config:5.2 http://www.infinispan.org/schemas/infinispan-config-5.2.xsd"
+ xmlns="urn:infinispan:config:5.2">
<global>
<transport clusterName="WebDavGridFS" />
<globalJmxStatistics enabled="true"/>
@@ -23,8 +23,8 @@
-->
<infinispan
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="urn:infinispan:config:5.1 http://www.infinispan.org/schemas/infinispan-config-5.1.xsd"
- xmlns="urn:infinispan:config:5.1">
+ xsi:schemaLocation="urn:infinispan:config:5.2 http://www.infinispan.org/schemas/infinispan-config-5.2.xsd"
+ xmlns="urn:infinispan:config:5.2">
<global>
<transport clusterName="demoCluster"/>
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<infinispan
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="urn:infinispan:config:5.1 http://www.infinispan.org/schemas/infinispan-config-5.1.xsd"
- xmlns="urn:infinispan:config:5.1">
+ xsi:schemaLocation="urn:infinispan:config:5.2 http://www.infinispan.org/schemas/infinispan-config-5.2.xsd"
+ xmlns="urn:infinispan:config:5.2">
<global>
<transport clusterName="demoCluster1">
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<infinispan
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="urn:infinispan:config:5.1 http://www.infinispan.org/schemas/infinispan-config-5.1.xsd"
- xmlns="urn:infinispan:config:5.1">
+ xsi:schemaLocation="urn:infinispan:config:5.2 http://www.infinispan.org/schemas/infinispan-config-5.2.xsd"
+ xmlns="urn:infinispan:config:5.2">
<global>
<transport clusterName="demoCluster2">
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<infinispan xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="urn:infinispan:config:5.1 http://www.infinispan.org/schemas/infinispan-config-5.1.xsd"
- xmlns="urn:infinispan:config:5.1">
+ xsi:schemaLocation="urn:infinispan:config:5.2 http://www.infinispan.org/schemas/infinispan-config-5.2.xsd"
+ xmlns="urn:infinispan:config:5.2">
<default>
<indexing enabled="true">
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<infinispan xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="urn:infinispan:config:5.1 http://www.infinispan.org/schemas/infinispan-config-5.1.xsd"
- xmlns="urn:infinispan:config:5.1">
+ xsi:schemaLocation="urn:infinispan:config:5.2 http://www.infinispan.org/schemas/infinispan-config-5.2.xsd"
+ xmlns="urn:infinispan:config:5.2">
<default>
<indexing enabled="false" />
Oops, something went wrong.

0 comments on commit f9acae7

Please sign in to comment.