new HashMap<String, Converter>() ) );
importer.setDefaultHandler( mockImportHandler );
FileInputStream in = new FileInputStream( new File( "test-res/ImportTest/steel-wheels.xmi" ) );
Log4JRepositoryImportLogger importLogger = new Log4JRepositoryImportLogger();
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
importLogger.startJob( outputStream, "", Level.DEBUG );
// With custom domain id
final IPlatformImportBundle bundle1 =
( new RepositoryFileImportBundle.Builder().input( in ).charSet( "UTF-8" ).hidden( false ).overwriteFile( true )
.name( "steel-wheels.xmi" ).comment( "Test Metadata Import" ).withParam( "domain-id",
"parameterized-domain-id" ) ).build();
try {
importer.setRepositoryImportLogger( importLogger );
importer.importFile( bundle1 );
String result = new String( outputStream.toByteArray() );
assertTrue( result.contains( "Error computing or retrieving mime-type" ) );
} catch ( PlatformImportException e ) {
e.printStackTrace();
return;
}
importLogger.endJob();
}