Ejemplo n.º 1
0
  public void setUp() {
    Configuration config = SupportConfigFactory.getConfiguration();
    ConfigurationVariantStream variant = new ConfigurationVariantStream();
    variant.setTypeVariance(ConfigurationVariantStream.TypeVariance.ANY);
    config.addVariantStream("MyVariantStream", variant);
    assertTrue(config.isVariantStreamExists("MyVariantStream"));

    epService = EPServiceProviderManager.getDefaultProvider(config);
    epService.initialize();
    listener = new SupportUpdateListener();

    // assert type metadata
    EventTypeSPI type =
        (EventTypeSPI)
            ((EPServiceProviderSPI) epService)
                .getValueAddEventService()
                .getValueAddProcessor("MyVariantStream")
                .getValueAddEventType();
    assertEquals(null, type.getMetadata().getOptionalApplicationType());
    assertEquals(null, type.getMetadata().getOptionalSecondaryNames());
    assertEquals("MyVariantStream", type.getMetadata().getPrimaryName());
    assertEquals("MyVariantStream", type.getMetadata().getPublicName());
    assertEquals("MyVariantStream", type.getName());
    assertEquals(EventTypeMetadata.TypeClass.VARIANT, type.getMetadata().getTypeClass());
    assertEquals(true, type.getMetadata().isApplicationConfigured());
    assertEquals(true, type.getMetadata().isApplicationPreConfigured());
    assertEquals(true, type.getMetadata().isApplicationPreConfiguredStatic());

    EventType[] valueAddTypes =
        ((EPServiceProviderSPI) epService).getValueAddEventService().getValueAddedTypes();
    assertEquals(1, valueAddTypes.length);
    assertSame(type, valueAddTypes[0]);

    assertEquals(0, type.getPropertyNames().length);
    assertEquals(0, type.getPropertyDescriptors().length);
  }
 @Override
 public void addVariantStream(String arg0, ConfigurationVariantStream arg1) {
   m_esperconfig.addVariantStream(arg0, arg1);
 }