Examples of encode()


Examples of org.hornetq.jms.persistence.config.PersistedConnectionFactory.encode()

     
      size = persistedCF.getEncodeSize();

      buffer = HornetQBuffers.fixedBuffer(size);
     
      persistedCF.encode(buffer);
     
      assertEquals(size, buffer.writerIndex());
     
   }
  

Examples of org.hornetq.jms.server.config.ConnectionFactoryConfiguration.encode()

      int size = config.getEncodeSize();

      HornetQBuffer buffer = HornetQBuffers.fixedBuffer(size);

      config.encode(buffer);

      assertEquals(size, buffer.writerIndex());
     
      PersistedConnectionFactory persistedCF = new PersistedConnectionFactory(config);
     

Examples of org.hornetq.jms.server.config.impl.ConnectionFactoryConfigurationImpl.encode()

      int size = config.getEncodeSize();

      HornetQBuffer buffer = HornetQBuffers.fixedBuffer(size);

      config.encode(buffer);

      assertEquals(size, buffer.writerIndex());
     
      PersistedConnectionFactory persistedCF = new PersistedConnectionFactory(config);
     

Examples of org.hornetq.utils.DefaultSensitiveStringCodec.encode()

      String password1 = "helloworld1";
      String password2 = "helloworld2";
      String password3 = "helloworld3";
     
      DefaultSensitiveStringCodec codec = new DefaultSensitiveStringCodec();
      String mask1 = (String)codec.encode(password1);
      String mask2 = (String)codec.encode(password2);
      String mask3 = (String)codec.encode(password3);
     
      String config = maskedPasswordXml.replace("PASSWORD_TOKEN1", mask1);
      config = config.replace("PASSWORD_TOKEN2", mask2);

Examples of org.hornetq.utils.TypedProperties.encode()

   public void testEncodeDecodeEmpty() throws Exception
   {
      TypedProperties emptyProps = new TypedProperties();

      HornetQBuffer buffer = HornetQBuffers.dynamicBuffer(1024);
      emptyProps.encode(buffer);

      Assert.assertEquals(props.getEncodeSize(), buffer.writerIndex());

      TypedProperties decodedProps = new TypedProperties();
      decodedProps.decode(buffer);

Examples of org.infinispan.protostream.EnumMarshaller.encode()

         out.writeRawBytes(bytes);
      } else if (t instanceof Enum) {
         // use an enum encoder
         EnumMarshaller enumMarshaller = (EnumMarshaller) ctx.getMarshaller((Class<Enum>) t.getClass());
         out.writeString(WRAPPED_DESCRIPTOR_FULL_NAME, enumMarshaller.getTypeName());
         out.writeEnum(WRAPPED_ENUM, enumMarshaller.encode((Enum) t));
      } else {
         // this is either an unknown primitive type or a message type
         // try to use a message marshaller
         BaseMarshaller marshaller = ctx.getMarshaller(t.getClass());
         out.writeString(WRAPPED_DESCRIPTOR_FULL_NAME, marshaller.getTypeName());

Examples of org.jboss.dna.common.text.FilenameEncoder.encode()

    public void shouldEncodeDirectoryNames() {
        // Set up an encoder and make sure that the names for the index and workspace can't be used as file system names ...
        FilenameEncoder encoder = new FilenameEncoder();
        index = "some/special::/\nindex(name)";
        workspace = "some/special::/\nworkspace(name)/illegalInWindows:\\/?%*|\"'<>.txt";
        assertThat(index, is(not(encoder.encode(index))));
        assertThat(workspace, is(not(encoder.encode(workspace))));

        config = LuceneConfigurations.using(tempArea, null, encoder, encoder);
        assertThat(config, is(notNullValue()));
        directory = getDirectory(config, workspace, index);

Examples of org.jboss.dna.common.text.Jsr283Encoder.encode()

        assertThat(path.getString(namespaceRegistry), is("/a/b/c"));
        assertThat(path.getString(namespaceRegistry, encoder), is("/a/b/c"));
        assertThat(path.getString(namespaceRegistry, encoder, delimEncoder), is("\\/a\\/b\\/c"));

        path = pathFactory.create("/dna:a/b/c");
        assertThat(path.getString(encoder), is("/{" + encoder.encode(DnaLexicon.Namespace.URI) + "}a/{}b/{}c"));
        assertThat(path.getString(null, encoder, delimEncoder), is("\\/\\{" + encoder.encode(DnaLexicon.Namespace.URI)
                                                                   + "\\}a\\/\\{\\}b\\/\\{\\}c"));
        assertThat(path.getString(namespaceRegistry), is("/dna:a/b/c"));
        assertThat(path.getString(namespaceRegistry, encoder), is("/dna:a/b/c"));
        assertThat(path.getString(namespaceRegistry, encoder, delimEncoder), is("\\/dna\\:a\\/b\\/c"));

Examples of org.jboss.dna.common.text.TextEncoder.encode()

    @Test
    public void shouldAlwaysReturnPathWithSingleSlashForGetString() {
        NamespaceRegistry registry = mock(NamespaceRegistry.class);
        TextEncoder encoder = mock(TextEncoder.class);
        stub(encoder.encode("/")).toReturn("/");
        assertThat(root.getString(), is("/"));
        assertThat(root.getString(registry), is("/"));
        assertThat(root.getString(registry, encoder), is("/"));
        assertThat(root.getString(registry, encoder, encoder), is("/"));
        assertThat(root.getString(encoder), is("/"));

Examples of org.jboss.netty.handler.codec.http.CookieEncoder.encode()

                // Reset the cookies if necessary.
                CookieEncoder cookieEncoder = new CookieEncoder(true);
                for (Cookie cookie : cookies) {
                    cookieEncoder.addCookie(cookie);
                }
                response.addHeader(SET_COOKIE, cookieEncoder.encode());
            }
        }

        // Write the response.
        ChannelFuture future = e.getChannel().write(response);
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.