Ejemplo n.º 1
0
  @Before
  public void setUp() throws Exception {

    PropertyConfigurator.configure(Utils.loadProperties(CONFIGS_TESTING_PROPERTIES));

    this.properties = Utils.loadProperties(CONFIGS_TESTING_PROPERTIES);

    injector =
        Guice.createInjector(
            new LogModule(properties),
            new SecurityModule(),
            new DatamodelImplModule(),
            new TestModule(),
            new AbstractModule() {

              @Override
              protected void configure() {
                Names.bindProperties(binder(), properties);
                bind(NetInfNodeConnection.class)
                    .annotatedWith(SecurityModule.Security.class)
                    .to(RemoteNodeConnection.class);
              }
            });

    this.messageReceiver = this.injector.getInstance(MessageReceiver.class);
    this.messageProcessor = this.injector.getInstance(MessageProcessorImp.class);
    this.dmFactory = this.injector.getInstance(DatamodelFactory.class);
    this.provider = this.injector.getProvider(Communicator.class);
    // this.mockErrorProvider = this.injector.getProvider(MockErrorCommunicator.class);

    this.messageQueue = new LinkedBlockingQueue<ESFEventMessage>();

    esfConnector =
        new AbstractEsfConnectorImp(dmFactory, messageReceiver, messageProcessor, host, port);
  }
Ejemplo n.º 2
0
 @Override
 public void setPublicMasterKey(PublicKey publicKey) {
   resetAttribute(
       DefinedAttributeIdentification.PUBLIC_KEY.getURI(),
       Utils.objectToString(publicKey),
       DefinedAttributePurpose.SYSTEM_ATTRIBUTE.getAttributePurpose());
 }
Ejemplo n.º 3
0
 public ChunkBothCacheModule() {
   super(Utils.loadProperties(NODE_PROPERTIES));
 }
Ejemplo n.º 4
0
 public MDHT12Module() {
   super(Utils.loadProperties(NODE_PROPERTIES));
 }
Ejemplo n.º 5
0
 @Override
 public PublicKey getPublicMasterKey() {
   return Utils.stringToPublicKey(
       getSingleAttribute(DefinedAttributeIdentification.PUBLIC_KEY.getURI())
           .getValue(String.class));
 }