Package javax.management.modelmbean

Examples of javax.management.modelmbean.DescriptorSupport.toXMLString()


   public void testToXMLString() throws Exception
   {
      String[] fields = {"wine", "vineyard", "year", "price"};
      Object[] values = {"Amarone", "Allegrini", "1996", new Integer(90)};
      DescriptorSupport ds = new DescriptorSupport(fields, values);
      String xml = ds.toXMLString();
      assertTrue("Descriptor from XML != Descriptor", descriptorsEqual(ds, (new DescriptorSupport(xml))));

      fields = new String[]{"wine=Amarone", "vineyard=Allegrini", "year=1996"};
      ds = new DescriptorSupport(fields);
      xml = ds.toXMLString();
View Full Code Here


      String xml = ds.toXMLString();
      assertTrue("Descriptor from XML != Descriptor", descriptorsEqual(ds, (new DescriptorSupport(xml))));

      fields = new String[]{"wine=Amarone", "vineyard=Allegrini", "year=1996"};
      ds = new DescriptorSupport(fields);
      xml = ds.toXMLString();
      assertTrue("Descriptor from XML != Descriptor", descriptorsEqual(ds, (new DescriptorSupport(xml))));
   }

   public void testEmptyDescriptorToXMLString() throws Exception
   {
View Full Code Here

   }

   public void testEmptyDescriptorToXMLString() throws Exception
   {
      DescriptorSupport ds = new DescriptorSupport();
      String xml = ds.toXMLString();
      assertEquals("Unexpected xml: " + xml, xml, "<Descriptor></Descriptor>");
   }

   public void testGetFieldsUnknownName()
   {
View Full Code Here

      xmldescriptor.append("value=\"xyzzy\"");
      xmldescriptor.append(">");
      xmldescriptor.append("</field>");
      xmldescriptor.append("</Descriptor>");
      DescriptorSupport ds = new DescriptorSupport(xmldescriptor.toString());
      String xml = ds.toXMLString();
      assertTrue("Descriptor from XML != Descriptor", descriptorsEqual(ds, (new DescriptorSupport(xml))));
   }

   public void testXMLSpecialStringConstructor() throws Exception
   {
View Full Code Here

   public void testXMLSpecialStringConstructor() throws Exception
   {
      String[] fields = {"name=Lawrence", "nickname=(Larry)"};
      DescriptorSupport ds = new DescriptorSupport(fields);
      String xml = ds.toXMLString();
      DescriptorSupport xmlds = new DescriptorSupport(xml);
      assertTrue("Descriptors not equal", descriptorsEqual(ds, xmlds));
   }

   public void testXMLPrimitiveConstructor() throws Exception
View Full Code Here

      xmldescriptor.append("value=\"(null)\"");
      xmldescriptor.append(">");
      xmldescriptor.append("</field>");
      xmldescriptor.append("</Descriptor>");
      DescriptorSupport ds = new DescriptorSupport(xmldescriptor.toString());
      String xml = ds.toXMLString();
      assertTrue("Descriptor from XML != Descriptor", descriptorsEqual(ds, (new DescriptorSupport(xml))));
   }

   public void testXMLClassConstructor() throws Exception
   {
View Full Code Here

      xmldescriptor.append("value=\"(java.net.URL/http://mx4j.sourceforge.net)\"");
      xmldescriptor.append(">");
      xmldescriptor.append("</field>");
      xmldescriptor.append("</Descriptor>");
      DescriptorSupport ds = new DescriptorSupport(xmldescriptor.toString());
      String xml = ds.toXMLString();
      assertTrue("Descriptor from XML != Descriptor", descriptorsEqual(ds, (new DescriptorSupport(xml))));
   }

   public void testBogusXMLConstructor() throws Exception
   {
View Full Code Here

        ok &= caseTest(d1, "DescriptorSupport.setField");
        d1 = new DescriptorSupport(new String[] {"NAME=blah"});
        ok &= caseTest(new DescriptorSupport(d1),
                       "DescriptorSupport(Descriptor)");
        d1 = new DescriptorSupport(new String[] {"NAME=blah"});
        ok &= caseTest(new DescriptorSupport(d1.toXMLString()),
                       "DescriptorSupport(String)");
        d1 = new DescriptorSupport(new String[] {"NAME=blah"});
        ByteArrayOutputStream bos = new ByteArrayOutputStream();
        ObjectOutputStream oos = new ObjectOutputStream(bos);
        oos.writeObject(d1);
View Full Code Here

            final DescriptorSupport in =
                new DescriptorSupport(new String[] {"bloo"}, new Object[] {v});

            final String xml;
            try {
                xml = in.toXMLString();
            } catch (RuntimeOperationsException e) {
                final Throwable cause = e.getCause();
                if (cause instanceof IllegalArgumentException) {
                    System.out.println("OK: " + what + ": got a " +
                                       "RuntimeOperationsException wrapping " +
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.