<commit_before>package org.jboss.webbeans.test;

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;

import javax.webbeans.UnproxyableDependencyException;
import javax.webbeans.manager.Bean;

import org.jboss.webbeans.test.beans.FinalTuna;
import org.jboss.webbeans.test.beans.Fox;
import org.jboss.webbeans.test.beans.Tuna;
import org.jboss.webbeans.test.beans.TunedTuna;
import org.jboss.webbeans.test.util.Util;
import org.jboss.webbeans.util.ClientProxy;
import org.testng.annotations.Test;

@SpecVersion("PDR")
public class ClientProxyTest extends AbstractTest
{

   @Test(groups = "clientProxy")
   @SpecAssertion(section = { "4.4", "4.8" })
   public void testClientProxyUsedForNormalScope()
   {
      Bean<Tuna> tunaBean = Util.createSimpleBean(Tuna.class, manager);
      Tuna tuna = manager.getInstance(tunaBean);
      assert ClientProxy.isProxy(tuna);
   }

   @Test(groups = "clientProxy")
   @SpecAssertion(section = { "4.4", "4.8" })
   public void testClientProxyNotUsedForPseudoScope()
   {
      Bean<Fox> foxBean = Util.createSimpleBean(Fox.class, manager);
      Fox fox = manager.getInstance(foxBean);
      assert !ClientProxy.isProxy(fox);
   }

   private byte[] serializeBean(Object instance) throws IOException {
      ByteArrayOutputStream bytes = new ByteArrayOutputStream();
      ObjectOutputStream out = new ObjectOutputStream(bytes);
      out.writeObject(instance);
      return bytes.toByteArray();<commit_msg>fix import<commit_after>package org.jboss.webbeans.test;

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;

import javax.webbeans.UnproxyableDependencyException;
import javax.webbeans.manager.Bean;

import org.jboss.webbeans.bean.proxy.ClientProxy;
import org.jboss.webbeans.test.beans.FinalTuna;
import org.jboss.webbeans.test.beans.Fox;
import org.jboss.webbeans.test.beans.Tuna;
import org.jboss.webbeans.test.beans.TunedTuna;
import org.jboss.webbeans.test.util.Util;
import org.testng.annotations.Test;

@SpecVersion("PDR")
public class ClientProxyTest extends AbstractTest
{

   @Test(groups = "clientProxy")
   @SpecAssertion(section = { "4.4", "4.8" })
   public void testClientProxyUsedForNormalScope()
   {
      Bean<Tuna> tunaBean = Util.createSimpleBean(Tuna.class, manager);
      Tuna tuna = manager.getInstance(tunaBean);
      assert ClientProxy.isProxy(tuna);
   }

   @Test(groups = "clientProxy")
   @SpecAssertion(section = { "4.4", "4.8" })
   public void testClientProxyNotUsedForPseudoScope()
   {
      Bean<Fox> foxBean = Util.createSimpleBean(Fox.class, manager);
      Fox fox = manager.getInstance(foxBean);
      assert !ClientProxy.isProxy(fox);
   }

   private byte[] serializeBean(Object instance) throws IOException {
      ByteArrayOutputStream bytes = new ByteArrayOutputStream();
      ObjectOutputStream out = new ObjectOutputStream(bytes);
      out.writeObject(instance);
      return bytes.toByteArray();
{'fraction_non_alphanumeric': 0.11387559808612441, 'fraction_numerical': 0.005103668261562998, 'mean_word_length': 4.775322283609577, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2405919', 'n_tokens_mistral': 998, 'n_tokens_neox': 961, 'n_words': 174}