Examples of listBindings()


Examples of javax.naming.Context.listBindings()

    ResolveResult r = findContextFor(name);
    Context ctx = (Context) r.getResolvedObj();
    String rname = r.getRemainingName().toString();

    // List the correct Context
    return ctx.listBindings(rname);
  }

  /**
   * Destroys the named context and removes it from the namespace.
   * Any attributes associated with the name are also removed.
View Full Code Here

Examples of javax.naming.Context.listBindings()

      redeployNaming();
     
      Context ctx2 = new InitialContext(env);
      try
      {
         NamingEnumeration list = ctx2.listBindings(ObjectBinder.SUBCONTEXT_NAME);
         assertNotNull("NamingEnumeration returned", list);
         assertTrue("NamingEnumeration has entry", list.hasMoreElements());
         Binding binding = (Binding) list.next();
         assertEquals(ObjectBinder.NAME, binding.getName());
      }
View Full Code Here

Examples of javax.naming.Context.listBindings()

  public BindingEnumeration enumeration()
  {
    try {
      Context ctx = getContext();
      return new ContextEnumeration(ctx.listBindings(""));
    } catch (NamingException e) {
      throw anvil.script.Context.getInstance().exception(e);
    }
  }
View Full Code Here

Examples of javax.naming.Context.listBindings()

            cursor.dispose();
        }
        environmentEntryBuilder.buildNaming(doc, null, null, componentContext);
        Context context = EnterpriseNamingContext.createEnterpriseNamingContext(NamingBuilder.JNDI_KEY.get(componentContext));
        Set actual = new HashSet();
        for (NamingEnumeration e = context.listBindings("env"); e.hasMore();) {
            NameClassPair pair = (NameClassPair) e.next();
            actual.add(pair.getName());
        }
        Set expected = new HashSet(Arrays.asList(new String[]{"string", "char", "byte", "short", "int", "long", "float", "double", "boolean"}));
        assertEquals(expected, actual);
View Full Code Here

Examples of javax.naming.Context.listBindings()

        builder.addEnvEntry("double", Double.class.getName(), doubleVal.toString(), null);
        builder.addEnvEntry("boolean", Boolean.class.getName(), booleanVal.toString(), null);

        Context context = EnterpriseNamingContext.createEnterpriseNamingContext(builder.getContext());
        Set actual = new HashSet();
        for (NamingEnumeration e = context.listBindings("env"); e.hasMore();) {
            NameClassPair pair = (NameClassPair) e.next();
            actual.add(pair.getName());
        }
        Set expected = new HashSet(Arrays.asList(new String[]{"string", "char", "byte", "short", "int", "long", "float", "double", "boolean"}));
        assertEquals(expected, actual);
View Full Code Here

Examples of javax.naming.Context.listBindings()

        assertEquals(Integer.class.getName(), result.get("one"));
        assertEquals(Integer.class.getName(), result.get("two"));
        assertEquals(Integer.class.getName(), result.get("three"));
        assertNotNull(result.get("env"));

        result = toListBindingResults(context.listBindings(""));
        assertEquals(4, result.size());
        assertEquals(new Integer(1), result.get("one"));
        assertEquals(new Integer(2), result.get("two"));
        assertEquals(new Integer(3), result.get("three"));
        assertNotNull(result.get("env"));
View Full Code Here

Examples of javax.naming.Context.listBindings()

        assertEquals(3, result.size());
        assertEquals(Integer.class.getName(), result.get("one"));
        assertEquals(Integer.class.getName(), result.get("two"));
        assertEquals(Integer.class.getName(), result.get("three"));

        result = toListBindingResults(context.listBindings("a/b/c/d/e"));
        assertEquals(3, result.size());
        assertEquals(new Integer(1), result.get("one"));
        assertEquals(new Integer(2), result.get("two"));
        assertEquals(new Integer(3), result.get("three"));
View Full Code Here

Examples of javax.naming.Context.listBindings()

        assertEquals(3, result.size());
        assertEquals(Integer.class.getName(), result.get("one"));
        assertEquals(Integer.class.getName(), result.get("two"));
        assertEquals(Integer.class.getName(), result.get("three"));

        result = toListBindingResults(nestedContext.listBindings("d/e"));
        assertEquals(3, result.size());
        assertEquals(new Integer(1), result.get("one"));
        assertEquals(new Integer(2), result.get("two"));
        assertEquals(new Integer(3), result.get("three"));
    }
View Full Code Here

Examples of javax.naming.Context.listBindings()

            Context context = new InitialContext(props);

            assertNameClassPair(context.list(""));
            assertNameClassPair(context.list("ejb"));

            assertBindings(context.listBindings(""));
            assertBindings(context.listBindings("ejb"));

        } finally {
            serviceDaemon.stop();
            OpenEJB.destroy();
View Full Code Here

Examples of javax.naming.Context.listBindings()

            assertNameClassPair(context.list(""));
            assertNameClassPair(context.list("ejb"));

            assertBindings(context.listBindings(""));
            assertBindings(context.listBindings("ejb"));

        } finally {
            serviceDaemon.stop();
            OpenEJB.destroy();
        }
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.