public String getPlatformName() { return platform.getName(); }
public String getPlatformName() { return platform.getName(); }
protected String getSpecProviderName() { return "pipe-" + getPlatform().getName(); }
public static void makeSuites( TestPlatform testPlatform, Properties properties, Map<String, Pipe> pipes, TestSuite suite, Class type ) throws IllegalAccessException, InvocationTargetException, InstantiationException, IOException, ClassNotFoundException { for( String name : pipes.keySet() ) { if( isUNDEFINED( properties, name ) ) { LOG.debug( "skipping: {}", name ); continue; } // TestPlatform testPlatform = makeInstance( getPlatformClass( type.getClassLoader() ) ); // test platform dependencies not installed, so skip // if( testPlatform == null ) // continue; String platformName = testPlatform.getName(); String displayName = String.format( "%s[%s]", name, platformName ); PlatformTestCase platformTest = (PlatformTestCase) type.getConstructors()[ 0 ].newInstance( properties, displayName, name, pipes.get( name ) ); platformTest.installPlatform( testPlatform ); suite.addTest( platformTest ); } }
public static void makeSuites( TestPlatform testPlatform, Properties properties, Map<String, Pipe> pipes, TestSuite suite, Class type ) throws IllegalAccessException, InvocationTargetException, InstantiationException, IOException, ClassNotFoundException { for( String name : pipes.keySet() ) { if( isUNDEFINED( properties, name ) ) { LOG.debug( "skipping: {}", name ); continue; } // TestPlatform testPlatform = makeInstance( getPlatformClass( type.getClassLoader() ) ); // test platform dependencies not installed, so skip // if( testPlatform == null ) // continue; String platformName = testPlatform.getName(); String displayName = String.format( "%s[%s]", name, platformName ); PlatformTestCase platformTest = (PlatformTestCase) type.getConstructors()[ 0 ].newInstance( properties, displayName, name, pipes.get( name ) ); platformTest.installPlatform( testPlatform ); suite.addTest( platformTest ); } }
private void addPlatform( final Class<?> javaClass, Class<? extends TestPlatform> type, int ordinal, int size ) throws Throwable { if( javaClass.getAnnotation( Ignore.class ) != null ) // ignore this class { LOG.info( "ignoring test class: {}", javaClass.getCanonicalName() ); return; } final TestPlatform testPlatform = makeInstance( type ); // test platform dependencies not installed, so skip if( testPlatform == null ) return; final String platformName = testPlatform.getName(); if( !includes.isEmpty() && !includes.contains( platformName.toLowerCase() ) ) { LOG.info( "ignoring platform: {}", platformName ); return; } LOG.info( "adding test: {}, with platform: {}", javaClass.getName(), platformName ); PlatformSuite suiteAnnotation = javaClass.getAnnotation( PlatformSuite.class ); if( suiteAnnotation != null ) runners.add( makeSuiteRunner( javaClass, suiteAnnotation.method(), testPlatform ) ); else runners.add( makeClassRunner( javaClass, testPlatform, platformName, size != 1 ) ); }
private void addPlatform( final Class<?> javaClass, Class<? extends TestPlatform> type, int ordinal, int size ) throws Throwable { if( javaClass.getAnnotation( Ignore.class ) != null ) // ignore this class { LOG.info( "ignoring test class: {}", javaClass.getCanonicalName() ); return; } final TestPlatform testPlatform = makeInstance( type ); // test platform dependencies not installed, so skip if( testPlatform == null ) return; final String platformName = testPlatform.getName(); if( !includes.isEmpty() && !includes.contains( platformName.toLowerCase() ) ) { LOG.info( "ignoring platform: {}", platformName ); return; } LOG.info( "adding test: {}, with platform: {}", javaClass.getName(), platformName ); PlatformSuite suiteAnnotation = javaClass.getAnnotation( PlatformSuite.class ); if( suiteAnnotation != null ) runners.add( makeSuiteRunner( javaClass, suiteAnnotation.method(), testPlatform ) ); else runners.add( makeClassRunner( javaClass, testPlatform, platformName, size != 1 ) ); }
@Test public void testRenameProviderCLI() throws IOException { makeTestMavenRepo(); initCatalog(); catalog( "--schema", EXAMPLE_SCHEMA, "--add", getSchemaPath( EXAMPLE_SCHEMA ) ); catalog( "--repo", "testRepo", "--add", new File( getProviderPath( "repo" ) ).getAbsolutePath() ); catalog( "--schema", EXAMPLE_SCHEMA, "--provider", "--add", SPEC ); Collection<String> providerNames = getSchemaCatalog().getProviderNames( EXAMPLE_SCHEMA ); assertTrue( "provider " + getSpecProviderName() + " not added to catalog: " + providerNames.toString(), providerNames.contains( getSpecProviderName() ) ); catalog( "--schema", EXAMPLE_SCHEMA, "--provider", getSpecProviderName(), "--rename", "renamed-spec" ); assertFalse( "provider " + getSpecProviderName() + " still in catalog: " + providerNames.toString(), providerNames.contains( getSpecProviderName() ) ); assertTrue( "provider " + "renamed-spec" + " not in catalog: " + providerNames.toString(), providerNames.contains( "renamed-spec" ) ); ProviderDef providerDef = getSchemaCatalog().findProviderFor( EXAMPLE_SCHEMA, "renamed-spec" ); Map<String, String> providerProps = providerDef.getProperties(); String keyName = "cascading.bind.provider.pipe-" + getPlatform().getName() + ".format.tpsv.delimiter"; assertTrue( "renamed provider did not retain properties in " + providerProps.toString(), providerProps.containsKey( keyName ) ); assertEquals( "renamed provider did not retain value in " + providerProps.toString(), "|", providerProps.get( keyName ) ); }