@Test public void testMain() { String inputFilename = "src/test/resources/psm_sli.xmi"; String name = "assessmentTitle"; String[] args = new String[]{inputFilename, name}; final StringBuffer stringBuffer = new StringBuffer(); PrintStream stdOut = System.out; PrintStream myOut = new PrintStream(new OutputStream() { @Override public void write(int b) throws IOException { stringBuffer.append((char) b); } }); System.setOut(myOut); WhereUsedCmdLine.main(args); System.setOut(stdOut); assertFalse(stringBuffer.toString().equals("")); }
public static void main(final String[] args) { String inputFilename = (args.length == 2) ? args[0] : DEFAULT_INPUT_FILENAME; String name = (args.length == 2) ? args[1] : DEFAULT_NAME; try { final Model model = XmiReader.readModel(inputFilename); final ModelIndex index = new DefaultModelIndex(model); @SuppressWarnings("deprecation") final Set<ModelElement> matches = index.lookupByName(new QName(name)); for (final ModelElement match : matches) { LOG.info("name : " + name + " => " + match); showUsage(index, match.getId(), " "); } } catch (final FileNotFoundException e) { throw new EdFiSLIRuntimeException(e); } }
WhereUsedCmdLine { public static void main(final String[] args) { String inputFilename = (args.length == 2) ? args[0] : DEFAULT_INPUT_FILENAME; String name = (args.length == 2) ? args[1] : DEFAULT_NAME; try { final Model model = XmiReader.readModel(inputFilename); final ModelIndex index = new DefaultModelIndex(model); @SuppressWarnings("deprecation") final Set<ModelElement> matches = index.lookupByName(new QName(name)); for (final ModelElement match : matches) { LOG.info("name : " + name + " => " + match); showUsage(index, match.getId(), " "); } } catch (final FileNotFoundException e) { throw new EdFiSLIRuntimeException(e); } } }
WhereUsedCmdLine { public static void main(final String[] args) { String inputFilename = (args.length == 2) ? args[0] : DEFAULT_INPUT_FILENAME; String name = (args.length == 2) ? args[1] : DEFAULT_NAME; try { final Model model = XmiReader.readModel(inputFilename); final ModelIndex index = new DefaultModelIndex(model); @SuppressWarnings("deprecation") final Set<ModelElement> matches = index.lookupByName(new QName(name)); for (final ModelElement match : matches) { LOG.info("name : " + name + " => " + match); showUsage(index, match.getId(), " "); } } catch (final FileNotFoundException e) { throw new EdFiSLIRuntimeException(e); } } WhereUsedCmdLine(); }
WhereUsedCmdLine { public static void main(final String[] args) { String inputFilename = (args.length == 2) ? args[0] : DEFAULT_INPUT_FILENAME; String name = (args.length == 2) ? args[1] : DEFAULT_NAME; try { final Model model = XmiReader.readModel(inputFilename); final ModelIndex index = new DefaultModelIndex(model); @SuppressWarnings("deprecation") final Set<ModelElement> matches = index.lookupByName(new QName(name)); for (final ModelElement match : matches) { LOG.info("name : " + name + " => " + match); showUsage(index, match.getId(), " "); } } catch (final FileNotFoundException e) { throw new EdFiSLIRuntimeException(e); } } WhereUsedCmdLine(); static void main(final String[] args); }
WhereUsedCmdLine { public static void main(final String[] args) { String inputFilename = (args.length == 2) ? args[0] : DEFAULT_INPUT_FILENAME; String name = (args.length == 2) ? args[1] : DEFAULT_NAME; try { final Model model = XmiReader.readModel(inputFilename); final ModelIndex index = new DefaultModelIndex(model); @SuppressWarnings("deprecation") final Set<ModelElement> matches = index.lookupByName(new QName(name)); for (final ModelElement match : matches) { LOG.info("name : " + name + " => " + match); showUsage(index, match.getId(), " "); } } catch (final FileNotFoundException e) { throw new EdFiSLIRuntimeException(e); } } WhereUsedCmdLine(); static void main(final String[] args); static final String DEFAULT_INPUT_FILENAME; static final String DEFAULT_NAME; }