Examples of IConfiguration


Examples of org.pentaho.platform.api.engine.IConfiguration

  }

  @Test
  public void testDriverClassesToForceMetaTwoEntries() throws IOException {
    ISystemConfig sysConfig = mock( ISystemConfig.class );
    IConfiguration config = mock( IConfiguration.class );
    String className = "test";
    String className2 = "test2";
    when( sysConfig.getConfiguration( SqlMetadataQueryExec.CONFIG_ID ) ).thenReturn( config );
    Properties props = mock( Properties.class );
    when( config.getProperties() ).thenReturn( props );
    when( props.getProperty( eq( SqlMetadataQueryExec.FORCE_DB_META_CLASSES_PROP ), anyString() ) ).thenReturn(
        " , " + className + " , " + className2 + " ,,, " );
    SqlMetadataQueryExec sqlMetadataQueryExec = new SqlMetadataQueryExec( sysConfig );
    assertEquals( 2, sqlMetadataQueryExec.driverClassesToForceMeta.size() );
    assertTrue( sqlMetadataQueryExec.driverClassesToForceMeta.contains( className ) );
View Full Code Here

Examples of org.pentaho.platform.api.engine.IConfiguration

  }

  @Test
  public void testDriverClassesToForceMetaNullProps() throws IOException {
    ISystemConfig sysConfig = mock( ISystemConfig.class );
    IConfiguration config = mock( IConfiguration.class );
    when( sysConfig.getConfiguration( SqlMetadataQueryExec.CONFIG_ID ) ).thenReturn( config );
    SqlMetadataQueryExec sqlMetadataQueryExec = new SqlMetadataQueryExec( sysConfig );
    assertEquals( 0, sqlMetadataQueryExec.driverClassesToForceMeta.size() );
  }
View Full Code Here

Examples of org.pentaho.platform.api.engine.IConfiguration

  }

  @Test
  public void testDriverClassesToForceMetaIOE() throws IOException {
    ISystemConfig sysConfig = mock( ISystemConfig.class );
    IConfiguration config = mock( IConfiguration.class );
    when( sysConfig.getConfiguration( SqlMetadataQueryExec.CONFIG_ID ) ).thenReturn( config );
    when( config.getProperties() ).thenThrow( new IOException() );
    SqlMetadataQueryExec sqlMetadataQueryExec = new SqlMetadataQueryExec( sysConfig );
    assertEquals( 0, sqlMetadataQueryExec.driverClassesToForceMeta.size() );
  }
View Full Code Here

Examples of org.pentaho.platform.api.engine.IConfiguration

  public SqlMetadataQueryExec( ISystemConfig systemConfig ) {
    String[] forceDbMetaClasses = new String[] {};
    if ( systemConfig != null ) {
      try {
        IConfiguration config = systemConfig.getConfiguration( CONFIG_ID );
        if ( config != null ) {
          Properties props = config.getProperties();
          if ( props != null ) {
            forceDbMetaClasses = props.getProperty( FORCE_DB_META_CLASSES_PROP, "" ).split( "," );
          }
        }
      } catch ( IOException e ) {
View Full Code Here

Examples of org.testng.internal.IConfiguration

    {
      try
      {
        final Field field = SuiteRunner.class.getDeclaredField("m_configuration");
        field.setAccessible(true);
        final IConfiguration conf = (IConfiguration) field.get(iSuite);
//        Reporter.log(iSuite.getName() + ": " + conf.getConfigurationListeners().size(), true);
        Assert.assertEquals(conf.getConfigurationListeners().size(), 1);
      }
      catch (final Exception e)
      {
        throw new RuntimeException(e);
      }
View Full Code Here

Examples of org.testng.internal.annotations.IConfiguration

                                             tm,
                                             null,
                                             System.currentTimeMillis(),
                                             System.currentTimeMillis());

      IConfiguration configurationAnnotation= null;
      try {
        Object[] instances= tm.getInstances();
        if (instances == null || instances.length == 0) instances = new Object[] { instance };
        Class objectClass= instances[0].getClass();
        Method method= tm.getMethod();
View Full Code Here

Examples of org.testng.internal.annotations.IConfiguration

    List<ITestNGMethod> vResult = new ArrayList<ITestNGMethod>();
   
    Set<Method> methods = ClassHelper.getAvailableMethods(clazz);

    for(Method m : methods) {
      IConfiguration configuration = AnnotationHelper.findConfiguration(m_annotationFinder, m);

      if(null == configuration) {
        continue;
      }
     
      boolean create = false;
      boolean isBeforeSuite = false;
      boolean isAfterSuite = false;
      boolean isBeforeTest = false;
      boolean isAfterTest = false;
      boolean isBeforeClass = false;
      boolean isAfterClass = false;
      boolean isBeforeTestMethod = false;
      boolean isAfterTestMethod = false;
      String[] beforeGroups = null;
      String[] afterGroups = null;
     
      switch(configurationType) {
        case BEFORE_SUITE:
          create = configuration.getBeforeSuite();
          isBeforeSuite = true;
          break;
        case AFTER_SUITE:
          create = configuration.getAfterSuite();
          isAfterSuite = true;
          break;
        case BEFORE_TEST:
          create = configuration.getBeforeTest();
          isBeforeTest = true;
          break;
        case AFTER_TEST:
          create = configuration.getAfterTest();
          isAfterTest = true;
          break;
        case BEFORE_CLASS:
          create = configuration.getBeforeTestClass();
          isBeforeClass = true;
          break;
        case AFTER_CLASS:
          create = configuration.getAfterTestClass();
          isAfterClass = true;
          break;
        case BEFORE_TESTMETHOD:
          create = configuration.getBeforeTestMethod();
          isBeforeTestMethod = true;
          break;
        case AFTER_TESTMETHOD:
          create = configuration.getAfterTestMethod();
          isAfterTestMethod = true;
          break;
        case BEFORE_GROUPS:
          beforeGroups = configuration.getBeforeGroups();
          create = beforeGroups.length > 0;
          isBeforeTestMethod = true;
          break;
        case AFTER_GROUPS:
          afterGroups = configuration.getAfterGroups();
          create = afterGroups.length > 0;
          isBeforeTestMethod = true;
          break;
      }
   
View Full Code Here

Examples of org.testng.internal.annotations.IConfiguration

    return m_inheritGroupsFromTestClass;
  }
 
  private void init() {
    IAnnotation a = AnnotationHelper.findConfiguration(m_annotationFinder, m_method);
    IConfiguration annotation = (IConfiguration) a;
    if (a != null) {
      m_inheritGroupsFromTestClass = annotation.getInheritGroups();
      setDescription(annotation.getDescription());
    }

    if (annotation != null && annotation.isFakeConfiguration()) {
     if (annotation.getBeforeSuite()) initGroups(IBeforeSuite.class)
     if (annotation.getAfterSuite()) initGroups(IAfterSuite.class)
     if (annotation.getBeforeTest()) initGroups(IBeforeTest.class)
     if (annotation.getAfterTest()) initGroups(IAfterTest.class)
     if (annotation.getBeforeGroups().length != 0) initGroups(IBeforeGroups.class)
     if (annotation.getAfterGroups().length != 0) initGroups(IAfterGroups.class);
     if (annotation.getBeforeTestClass()) initGroups(IBeforeClass.class)
     if (annotation.getAfterTestClass()) initGroups(IAfterClass.class)
     if (annotation.getBeforeTestMethod()) initGroups(IBeforeMethod.class)
     if (annotation.getAfterTestMethod()) initGroups(IAfterMethod.class)
    }
    else {
      initGroups(IConfiguration.class);
    }
View Full Code Here

Examples of org.testng.internal.annotations.IConfiguration

     
      //
      // @Configuration method
      //
      else {
        IConfiguration annotation = AnnotationHelper.findConfiguration(finder, m);
        if (annotation.getAlwaysRun()) {
          in = true;
        }
        else {
          in = includeMethod(AnnotationHelper.findTest(finder, m),
              runInfo, tm, forTests, unique, outIncludedMethods);
View Full Code Here

Examples of org.testng.internal.annotations.IConfiguration

  public static String[] dependentGroupsForThisMethodForConfiguration(Method m,
                                                                      IAnnotationFinder finder) {
    String[] result = {};

    // Collect groups on the method
    IConfiguration tm = AnnotationHelper.findConfiguration(finder, m);
    if (null != tm) {
      result = tm.getDependsOnGroups();
    }

    return result;
  }
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.