Package org.jboss.naming

Examples of org.jboss.naming.JNDIBindings


               return super.resolveEntity(publicId, systemId);
            }
         }
      });

      JNDIBindings bindings = (JNDIBindings) unmarshaller.unmarshal(is2,
         new SchemaBindingResolver(){
            public String getBaseURI()
            {
               throw new UnsupportedOperationException("getBaseURI is not implemented.");
            }

            public void setBaseURI(String baseURI)
            {
               throw new UnsupportedOperationException("setBaseURI is not implemented.");
            }

            public SchemaBinding resolve(String nsUri, String baseURI, String schemaLocation)
            {
               return XsdBinder.bind(url.toExternalForm() + schemaLocation, this);
            }

            public LSInput resolveAsLSInput(String nsUri, String baseUri, String schemaLocation)
            {
               throw new UnsupportedOperationException("resolveAsLSInput is not implemented.");
            }
         });

      is2.close();

      // Validate the bindings
      JNDIBinding[] values = bindings.getBindings();
      assertTrue("There are 5 bindings("+values.length+")", values.length == 5);

      JNDIBinding key1 = values[0];
      assertTrue("values[0] name is ctx1/key1", key1.getName().equals("ctx1/key1"));
      assertTrue("values[0] is string of value1", key1.getText().equals("value1"));
View Full Code Here


      schemaBinding.setIgnoreUnresolvedFieldOrClass(false);

      Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();

      URL xml = getResource("xml/naming/testBindings.xml");
      JNDIBindings bindings = (JNDIBindings)unmarshaller.unmarshal(xml.openStream(), schemaBinding);
      JNDIBinding[] values = bindings.getBindings();
      assertTrue("There are 5 bindings("+values.length+")", values.length == 5);

      JNDIBinding key1 = values[0];
      assertTrue("values[0] name is ctx1/key1", key1.getName().equals("ctx1/key1"));
      assertTrue("values[0] is string of value1", key1.getText().equals("value1"));
View Full Code Here

TOP

Related Classes of org.jboss.naming.JNDIBindings

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.