java.util.Map

Here are the examples of the java api class java.util.Map taken from open source projects.

1. Navigator#createOperatorMap()

Project: incubator-freemarker
Source File: Navigator.java
View license
private Map createOperatorMap() {
    Map map = new HashMap();
    map.put("_attributes", new AttributesOp());
    map.put("@*", map.get("_attributes"));
    map.put("_children", new ChildrenOp());
    map.put("*", map.get("_children"));
    map.put("_descendantOrSelf", new DescendantOrSelfOp());
    map.put("_descendant", new DescendantOp());
    map.put("_document", new DocumentOp());
    map.put("_doctype", new DocumentTypeOp());
    map.put("_ancestor", new AncestorOp());
    map.put("_ancestorOrSelf", new AncestorOrSelfOp());
    map.put("_content", new ContentOp());
    map.put("_name", new LocalNameOp());
    map.put("_nsprefix", new NamespacePrefixOp());
    map.put("_nsuri", new NamespaceUriOp());
    map.put("_parent", new ParentOp());
    map.put("_qname", new QualifiedNameOp());
    map.put("_text", new TextOp());
    map.put("_type", new TypeOp());
    return map;
}

2. JavaModelManager#getDefaultOptionsNoInitialization()

Project: che
Source File: JavaModelManager.java
View license
// Do not modify without modifying getDefaultOptions()
private Hashtable getDefaultOptionsNoInitialization() {
    // compiler defaults
    Map defaultOptionsMap = new CompilerOptions().getMap();
    // Override some compiler defaults
    defaultOptionsMap.put(org.eclipse.jdt.core.JavaCore.COMPILER_LOCAL_VARIABLE_ATTR, org.eclipse.jdt.core.JavaCore.GENERATE);
    defaultOptionsMap.put(org.eclipse.jdt.core.JavaCore.COMPILER_CODEGEN_UNUSED_LOCAL, org.eclipse.jdt.core.JavaCore.PRESERVE);
    defaultOptionsMap.put(org.eclipse.jdt.core.JavaCore.COMPILER_TASK_TAGS, org.eclipse.jdt.core.JavaCore.DEFAULT_TASK_TAGS);
    defaultOptionsMap.put(org.eclipse.jdt.core.JavaCore.COMPILER_TASK_PRIORITIES, org.eclipse.jdt.core.JavaCore.DEFAULT_TASK_PRIORITIES);
    defaultOptionsMap.put(org.eclipse.jdt.core.JavaCore.COMPILER_TASK_CASE_SENSITIVE, org.eclipse.jdt.core.JavaCore.ENABLED);
    defaultOptionsMap.put(org.eclipse.jdt.core.JavaCore.COMPILER_DOC_COMMENT_SUPPORT, org.eclipse.jdt.core.JavaCore.ENABLED);
    defaultOptionsMap.put(org.eclipse.jdt.core.JavaCore.COMPILER_PB_FORBIDDEN_REFERENCE, org.eclipse.jdt.core.JavaCore.ERROR);
    // Builder settings
    //$NON-NLS-1$
    defaultOptionsMap.put(org.eclipse.jdt.core.JavaCore.CORE_JAVA_BUILD_RESOURCE_COPY_FILTER, "");
    defaultOptionsMap.put(org.eclipse.jdt.core.JavaCore.CORE_JAVA_BUILD_INVALID_CLASSPATH, org.eclipse.jdt.core.JavaCore.ABORT);
    defaultOptionsMap.put(org.eclipse.jdt.core.JavaCore.CORE_JAVA_BUILD_DUPLICATE_RESOURCE, org.eclipse.jdt.core.JavaCore.WARNING);
    defaultOptionsMap.put(org.eclipse.jdt.core.JavaCore.CORE_JAVA_BUILD_CLEAN_OUTPUT_FOLDER, org.eclipse.jdt.core.JavaCore.CLEAN);
    // JavaCore settings
    defaultOptionsMap.put(org.eclipse.jdt.core.JavaCore.CORE_JAVA_BUILD_ORDER, org.eclipse.jdt.core.JavaCore.IGNORE);
    defaultOptionsMap.put(org.eclipse.jdt.core.JavaCore.CORE_INCOMPLETE_CLASSPATH, org.eclipse.jdt.core.JavaCore.ERROR);
    defaultOptionsMap.put(org.eclipse.jdt.core.JavaCore.CORE_CIRCULAR_CLASSPATH, org.eclipse.jdt.core.JavaCore.ERROR);
    defaultOptionsMap.put(org.eclipse.jdt.core.JavaCore.CORE_INCOMPATIBLE_JDK_LEVEL, org.eclipse.jdt.core.JavaCore.IGNORE);
    defaultOptionsMap.put(org.eclipse.jdt.core.JavaCore.CORE_OUTPUT_LOCATION_OVERLAPPING_ANOTHER_SOURCE, org.eclipse.jdt.core.JavaCore.ERROR);
    defaultOptionsMap.put(org.eclipse.jdt.core.JavaCore.CORE_ENABLE_CLASSPATH_EXCLUSION_PATTERNS, org.eclipse.jdt.core.JavaCore.ENABLED);
    defaultOptionsMap.put(org.eclipse.jdt.core.JavaCore.CORE_ENABLE_CLASSPATH_MULTIPLE_OUTPUT_LOCATIONS, org.eclipse.jdt.core.JavaCore.ENABLED);
    // Formatter settings
    defaultOptionsMap.putAll(DefaultCodeFormatterConstants.getEclipseDefaultSettings());
    // CodeAssist settings
    defaultOptionsMap.put(org.eclipse.jdt.core.JavaCore.CODEASSIST_VISIBILITY_CHECK, org.eclipse.jdt.core.JavaCore.DISABLED);
    defaultOptionsMap.put(org.eclipse.jdt.core.JavaCore.CODEASSIST_DEPRECATION_CHECK, org.eclipse.jdt.core.JavaCore.DISABLED);
    defaultOptionsMap.put(org.eclipse.jdt.core.JavaCore.CODEASSIST_IMPLICIT_QUALIFICATION, org.eclipse.jdt.core.JavaCore.DISABLED);
    //$NON-NLS-1$
    defaultOptionsMap.put(org.eclipse.jdt.core.JavaCore.CODEASSIST_FIELD_PREFIXES, "");
    //$NON-NLS-1$
    defaultOptionsMap.put(org.eclipse.jdt.core.JavaCore.CODEASSIST_STATIC_FIELD_PREFIXES, "");
    //$NON-NLS-1$
    defaultOptionsMap.put(org.eclipse.jdt.core.JavaCore.CODEASSIST_STATIC_FINAL_FIELD_PREFIXES, "");
    //$NON-NLS-1$
    defaultOptionsMap.put(org.eclipse.jdt.core.JavaCore.CODEASSIST_LOCAL_PREFIXES, "");
    //$NON-NLS-1$
    defaultOptionsMap.put(org.eclipse.jdt.core.JavaCore.CODEASSIST_ARGUMENT_PREFIXES, "");
    //$NON-NLS-1$
    defaultOptionsMap.put(org.eclipse.jdt.core.JavaCore.CODEASSIST_FIELD_SUFFIXES, "");
    //$NON-NLS-1$
    defaultOptionsMap.put(org.eclipse.jdt.core.JavaCore.CODEASSIST_STATIC_FIELD_SUFFIXES, "");
    //$NON-NLS-1$
    defaultOptionsMap.put(org.eclipse.jdt.core.JavaCore.CODEASSIST_STATIC_FINAL_FIELD_SUFFIXES, "");
    //$NON-NLS-1$
    defaultOptionsMap.put(org.eclipse.jdt.core.JavaCore.CODEASSIST_LOCAL_SUFFIXES, "");
    //$NON-NLS-1$
    defaultOptionsMap.put(org.eclipse.jdt.core.JavaCore.CODEASSIST_ARGUMENT_SUFFIXES, "");
    defaultOptionsMap.put(org.eclipse.jdt.core.JavaCore.CODEASSIST_FORBIDDEN_REFERENCE_CHECK, org.eclipse.jdt.core.JavaCore.ENABLED);
    defaultOptionsMap.put(org.eclipse.jdt.core.JavaCore.CODEASSIST_DISCOURAGED_REFERENCE_CHECK, org.eclipse.jdt.core.JavaCore.DISABLED);
    defaultOptionsMap.put(org.eclipse.jdt.core.JavaCore.CODEASSIST_CAMEL_CASE_MATCH, org.eclipse.jdt.core.JavaCore.ENABLED);
    defaultOptionsMap.put(org.eclipse.jdt.core.JavaCore.CODEASSIST_SUGGEST_STATIC_IMPORTS, org.eclipse.jdt.core.JavaCore.ENABLED);
    // Time out for parameter names
    //$NON-NLS-1$
    defaultOptionsMap.put(org.eclipse.jdt.core.JavaCore.TIMEOUT_FOR_PARAMETER_NAME_FROM_ATTACHED_JAVADOC, "50");
    return new Hashtable(defaultOptionsMap);
}

3. NodeListModel#createOperations()

View license
private static final Map createOperations() {
    Map map = new HashMap();
    map.put("_ancestor", new AncestorOp());
    map.put("_ancestorOrSelf", new AncestorOrSelfOp());
    map.put("_attributes", ALL_ATTRIBUTES_OP);
    map.put("_children", ALL_CHILDREN_OP);
    map.put("_cname", new CanonicalNameOp());
    map.put("_content", new ContentOp());
    map.put("_descendant", new DescendantOp());
    map.put("_descendantOrSelf", new DescendantOrSelfOp());
    map.put("_document", new DocumentOp());
    map.put("_doctype", new DocTypeOp());
    map.put("_name", new NameOp());
    map.put("_nsprefix", new NamespacePrefixOp());
    map.put("_nsuri", new NamespaceUriOp());
    map.put("_parent", new ParentOp());
    map.put("_qname", new QNameOp());
    map.put("_text", new TextOp());
    return map;
}

4. DefaultAtomicTypeConverterProvider#registerDefaultAtomicTypeConverters()

View license
protected Map registerDefaultAtomicTypeConverters() {
    Map converters = new HashMap();
    converters.put(String.class, StringTypeConverterImpl.class);
    converters.put(InputStream.class, BinaryTypeConverterImpl.class);
    converters.put(long.class, LongTypeConverterImpl.class);
    converters.put(Long.class, LongTypeConverterImpl.class);
    converters.put(int.class, IntTypeConverterImpl.class);
    converters.put(Integer.class, IntTypeConverterImpl.class);
    converters.put(double.class, DoubleTypeConverterImpl.class);
    converters.put(Double.class, DoubleTypeConverterImpl.class);
    converters.put(boolean.class, BooleanTypeConverterImpl.class);
    converters.put(Boolean.class, BooleanTypeConverterImpl.class);
    converters.put(Calendar.class, CalendarTypeConverterImpl.class);
    converters.put(GregorianCalendar.class, CalendarTypeConverterImpl.class);
    converters.put(Date.class, UtilDateTypeConverterImpl.class);
    converters.put(byte[].class, ByteArrayTypeConverterImpl.class);
    converters.put(Timestamp.class, TimestampTypeConverterImpl.class);
    return converters;
}

5. GradebookFrameworkServiceImpl#getHardDefaultLetterMapping()

View license
private Map getHardDefaultLetterMapping() {
    Map gradeMap = new HashMap();
    gradeMap.put("A+", Double.valueOf(100));
    gradeMap.put("A", Double.valueOf(95));
    gradeMap.put("A-", Double.valueOf(90));
    gradeMap.put("B+", Double.valueOf(87));
    gradeMap.put("B", Double.valueOf(83));
    gradeMap.put("B-", Double.valueOf(80));
    gradeMap.put("C+", Double.valueOf(77));
    gradeMap.put("C", Double.valueOf(73));
    gradeMap.put("C-", Double.valueOf(70));
    gradeMap.put("D+", Double.valueOf(67));
    gradeMap.put("D", Double.valueOf(63));
    gradeMap.put("D-", Double.valueOf(60));
    gradeMap.put("F", Double.valueOf(0.0));
    return gradeMap;
}

6. StandardTuner#writeAllProperties()

Project: Priam
Source File: StandardTuner.java
View license
public void writeAllProperties(String yamlLocation, String hostname, String seedProvider) throws IOException {
    DumperOptions options = new DumperOptions();
    options.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK);
    Yaml yaml = new Yaml(options);
    File yamlFile = new File(yamlLocation);
    Map map = (Map) yaml.load(new FileInputStream(yamlFile));
    map.put("cluster_name", config.getAppName());
    map.put("storage_port", config.getStoragePort());
    map.put("ssl_storage_port", config.getSSLStoragePort());
    map.put("start_rpc", config.isThriftEnabled());
    map.put("rpc_port", config.getThriftPort());
    map.put("start_native_transport", config.isNativeTransportEnabled());
    map.put("native_transport_port", config.getNativeTransportPort());
    map.put("listen_address", hostname);
    map.put("rpc_address", hostname);
    //Dont bootstrap in restore mode
    if (!Restore.isRestoreEnabled(config)) {
        map.put("auto_bootstrap", config.getAutoBoostrap());
    } else {
        map.put("auto_bootstrap", false);
    }
    map.put("saved_caches_directory", config.getCacheLocation());
    map.put("commitlog_directory", config.getCommitLogLocation());
    map.put("data_file_directories", Lists.newArrayList(config.getDataFileLocation()));
    boolean enableIncremental = (config.getBackupHour() >= 0 && config.isIncrBackup()) && (CollectionUtils.isEmpty(config.getBackupRacs()) || config.getBackupRacs().contains(config.getRac()));
    map.put("incremental_backups", enableIncremental);
    map.put("endpoint_snitch", getSnitch());
    map.put("in_memory_compaction_limit_in_mb", config.getInMemoryCompactionLimit());
    map.put("compaction_throughput_mb_per_sec", config.getCompactionThroughput());
    map.put("partitioner", derivePartitioner(map.get("partitioner").toString(), config.getPartitioner()));
    map.put("memtable_total_space_in_mb", config.getMemtableTotalSpaceMB());
    map.put("stream_throughput_outbound_megabits_per_sec", config.getStreamingThroughputMB());
    map.put("multithreaded_compaction", config.getMultithreadedCompaction());
    map.put("max_hint_window_in_ms", config.getMaxHintWindowInMS());
    map.put("hinted_handoff_throttle_in_kb", config.getHintedHandoffThrottleKb());
    map.put("authenticator", config.getAuthenticator());
    map.put("authorizer", config.getAuthorizer());
    map.put("internode_compression", config.getInternodeCompression());
    map.put("dynamic_snitch", config.isDynamicSnitchEnabled());
    map.put("concurrent_reads", config.getConcurrentReadsCnt());
    map.put("concurrent_writes", config.getConcurrentWritesCnt());
    map.put("concurrent_compactors", config.getConcurrentCompactorsCnt());
    map.put("rpc_server_type", config.getRpcServerType());
    map.put("index_interval", config.getIndexInterval());
    List<?> seedp = (List) map.get("seed_provider");
    Map<String, String> m = (Map<String, String>) seedp.get(0);
    m.put("class_name", seedProvider);
    configfureSecurity(map);
    configureGlobalCaches(config, map);
    //force to 1 until vnodes are properly supported
    map.put("num_tokens", 1);
    addExtraCassParams(map);
    logger.info(yaml.dump(map));
    yaml.dump(map, new FileWriter(yamlFile));
    configureCommitLogBackups();
}

7. ArithmeticTests#testMath44b()

Project: mvel
Source File: ArithmeticTests.java
View license
public void testMath44b() {
    String expression = "a+b/c*d*e*f%g*h-i*j*k";
    double res = 6d + 8d / 9d * 1d * 9d * 10d % 4d * 4d - 4d * 6d * 3d;
    Serializable s = compileExpression(expression);
    Map vars = new HashMap();
    vars.put("a", 6d);
    vars.put("b", 8d);
    vars.put("c", 9d);
    vars.put("d", 1d);
    vars.put("e", 9d);
    vars.put("f", 10d);
    vars.put("g", 4d);
    vars.put("h", 4d);
    vars.put("i", 4d);
    vars.put("j", 6d);
    vars.put("k", 3d);
    assertEquals(res, executeExpression(s, vars));
}

8. CSVReader#getDefaultColumnMap()

Project: sakai
Source File: CSVReader.java
View license
/**
	 * Get the default column map for CSV files.
	 */
public Map getDefaultColumnMap() {
    Map columnMap = new HashMap();
    columnMap.put(GenericCalendarImporter.LOCATION_DEFAULT_COLUMN_HEADER, GenericCalendarImporter.LOCATION_PROPERTY_NAME);
    columnMap.put(GenericCalendarImporter.ITEM_TYPE_DEFAULT_COLUMN_HEADER, GenericCalendarImporter.ITEM_TYPE_PROPERTY_NAME);
    columnMap.put(GenericCalendarImporter.FREQUENCY_DEFAULT_COLUMN_HEADER, GenericCalendarImporter.FREQUENCY_PROPERTY_NAME);
    columnMap.put(GenericCalendarImporter.DURATION_DEFAULT_COLUMN_HEADER, GenericCalendarImporter.DURATION_PROPERTY_NAME);
    columnMap.put(GenericCalendarImporter.START_TIME_DEFAULT_COLUMN_HEADER, GenericCalendarImporter.START_TIME_CSV_PROPERTY_NAME);
    columnMap.put(GenericCalendarImporter.DATE_DEFAULT_COLUMN_HEADER, GenericCalendarImporter.DATE_CSV_PROPERTY_NAME);
    columnMap.put(GenericCalendarImporter.DESCRIPTION_DEFAULT_COLUMN_HEADER, GenericCalendarImporter.DESCRIPTION_PROPERTY_NAME);
    columnMap.put(GenericCalendarImporter.TITLE_DEFAULT_COLUMN_HEADER, GenericCalendarImporter.TITLE_PROPERTY_NAME);
    columnMap.put(GenericCalendarImporter.INTERVAL_DEFAULT_COLUMN_HEADER, GenericCalendarImporter.INTERVAL_PROPERTY_NAME);
    columnMap.put(GenericCalendarImporter.ENDS_DEFAULT_COLUMN_HEADER, GenericCalendarImporter.ENDS_PROPERTY_NAME);
    columnMap.put(GenericCalendarImporter.REPEAT_DEFAULT_COLUMN_HEADER, GenericCalendarImporter.REPEAT_PROPERTY_NAME);
    return columnMap;
}

9. MockConnection#newProfile()

Project: spacewalk
Source File: MockConnection.java
View license
private String newProfile() {
    Map profile = new HashMap();
    String uid = random();
    String key = random();
    profile.put("uid", uid);
    log.debug("PROFILE: Created w/ uid " + uid + "returing handle " + key);
    profiles.add(profile);
    profileMap.put(key, profile);
    profile.put("virt_bridge", "xenb0");
    profile.put("virt_cpus", Integer.valueOf(1));
    profile.put("virt_type", KickstartVirtualizationType.XEN_FULLYVIRT);
    profile.put("virt_path", "/tmp/foo");
    profile.put("virt_file_size", Integer.valueOf(8));
    profile.put("virt_ram", Integer.valueOf(512));
    profile.put("kernel_options", new HashMap());
    profile.put("kernel_options_post", new HashMap());
    profile.put("ks_meta", new HashMap());
    profile.put("redhat_management_key", "");
    return key;
}

10. MockConnection#newDistro()

Project: spacewalk
Source File: MockConnection.java
View license
private String newDistro() {
    String uid = random();
    Map distro = new HashMap();
    String key = random();
    distro.put("uid", uid);
    log.debug("DISTRO: Created w/ uid " + uid + "returing handle " + key);
    distros.add(distro);
    distroMap.put(key, distro);
    distro.put("virt_bridge", "xenb0");
    distro.put("virt_cpus", Integer.valueOf(1));
    distro.put("virt_type", KickstartVirtualizationType.XEN_FULLYVIRT);
    distro.put("virt_path", "/tmp/foo");
    distro.put("virt_file_size", Integer.valueOf(8));
    distro.put("virt_ram", Integer.valueOf(512));
    distro.put("kernel_options", new HashMap());
    distro.put("kernel_options_post", new HashMap());
    distro.put("ks_meta", new HashMap());
    distro.put("redhat_management_key", "");
    return key;
}

11. IvyPatternHelper#substitute()

Project: ant-ivy
Source File: IvyPatternHelper.java
View license
public static String substitute(String pattern, String org, String module, String branch, String revision, String artifact, String type, String ext, String conf, ArtifactOrigin origin, Map extraAttributes) {
    Map tokens = new HashMap(extraAttributes == null ? Collections.EMPTY_MAP : extraAttributes);
    tokens.put(ORGANISATION_KEY, org == null ? "" : org);
    tokens.put(ORGANISATION_KEY2, org == null ? "" : org);
    tokens.put(MODULE_KEY, module == null ? "" : module);
    tokens.put(BRANCH_KEY, branch == null ? "" : branch);
    tokens.put(REVISION_KEY, revision == null ? "" : revision);
    tokens.put(ARTIFACT_KEY, artifact == null ? module : artifact);
    tokens.put(TYPE_KEY, type == null ? "jar" : type);
    tokens.put(EXT_KEY, ext == null ? "jar" : ext);
    tokens.put(CONF_KEY, conf == null ? "default" : conf);
    tokens.put(ORIGINAL_ARTIFACTNAME_KEY, origin == null ? new OriginalArtifactNameValue(org, module, branch, revision, artifact, type, ext) : new OriginalArtifactNameValue(origin));
    return substituteTokens(pattern, tokens);
}

12. collection_writer_header#getObjects()

Project: cello
Source File: collection_writer_header.java
View license
@Override
public ArrayList<Map> getObjects() {
    ArrayList<Map> objects = new ArrayList<>();
    Date date = new Date();
    Map obj = new LinkedHashMap();
    obj.put("collection", "header");
    obj.put("description", "TetR homologs: PhlF, SrpR, BM3R1, HlyIIR, BetI, AmtR, AmeR");
    obj.put("version", "Eco1C1G1T0");
    obj.put("date", date.toString());
    obj.put("author", new String[] { "Bryan Der" });
    obj.put("organism", "Escherichia coli NEB 10-beta");
    obj.put("genome", "NEB 10 ?(ara-leu) 7697 araD139 fhuA ?lacX74 galK16 galE15 e14- ?80dlacZ?M15  recA1 relA1 endA1 nupG  rpsL (StrR) rph spoT1 ?(mrr-hsdRMS-mcrBC)");
    obj.put("media", "M9 minimal media composed of M9 media salts (6.78 g/L Na2HPO4, 3 g/L KH2PO4, 1 g/L NH4Cl, 0.5 g/L NaCl, 0.34 g/L thiamine hydrochloride, 0.4% D-glucose, 0.2% Casamino acids, 2 mM MgSO4, and 0.1 mM CaCl2; kanamycin (50 ug/ml), spectinomycin (50 ug/ml)");
    obj.put("temperature", "37");
    obj.put("growth", "Inoculation: Individual colonies into M9 media, 16 hours overnight in plate shaker.  Dilution: Next day, cells dilute ~200-fold into M9 media with antibiotics, growth for 3 hours.  Induction: Cells diluted ~650-fold into M9 media with antibiotics.  Growth: shaking incubator for 5 hours.  Arrest protein production: PBS and 2mg/ml kanamycin.  Measurement: flow cytometry, data processing for RPU normalization.");
    objects.add(obj);
    return objects;
}

13. collection_writer_header#getObjects()

Project: cello
Source File: collection_writer_header.java
View license
@Override
public ArrayList<Map> getObjects() {
    ArrayList<Map> objects = new ArrayList<>();
    Date date = new Date();
    Map obj = new LinkedHashMap();
    obj.put("collection", "header");
    obj.put("description", "TetR homologs: PhlF, SrpR, BM3R1, HlyIIR, BetI, AmtR, AmeR, QacR, IcaRA, LitR, PsrA, LmrA");
    obj.put("version", "Eco1C1G1T1");
    obj.put("date", date.toString());
    obj.put("author", new String[] { "Bryan Der" });
    obj.put("organism", "Escherichia coli NEB 10-beta");
    obj.put("genome", "NEB 10 ?(ara-leu) 7697 araD139 fhuA ?lacX74 galK16 galE15 e14- ?80dlacZ?M15  recA1 relA1 endA1 nupG  rpsL (StrR) rph spoT1 ?(mrr-hsdRMS-mcrBC)");
    obj.put("media", "M9 minimal media composed of M9 media salts (6.78 g/L Na2HPO4, 3 g/L KH2PO4, 1 g/L NH4Cl, 0.5 g/L NaCl, 0.34 g/L thiamine hydrochloride, 0.4% D-glucose, 0.2% Casamino acids, 2 mM MgSO4, and 0.1 mM CaCl2; kanamycin (50 ug/ml), spectinomycin (50 ug/ml)");
    obj.put("temperature", "37");
    obj.put("growth", "Inoculation: Individual colonies into M9 media, 16 hours overnight in plate shaker.  Dilution: Next day, cells dilute ~200-fold into M9 media with antibiotics, growth for 3 hours.  Induction: Cells diluted ~650-fold into M9 media with antibiotics.  Growth: shaking incubator for 5 hours.  Arrest protein production: PBS and 2mg/ml kanamycin.  Measurement: flow cytometry, data processing for RPU normalization.");
    objects.add(obj);
    return objects;
}

14. collection_writer_header#getObjects()

Project: cello
Source File: collection_writer_header.java
View license
@Override
public ArrayList<Map> getObjects() {
    ArrayList<Map> objects = new ArrayList<>();
    Date date = new Date();
    Map obj = new LinkedHashMap();
    obj.put("collection", "header");
    obj.put("description", "CRISRPi NOR/NOT gates, maximum of 5");
    obj.put("version", "Eco2C2G2T2");
    obj.put("date", date.toString());
    obj.put("author", new String[] { "Bryan Der" });
    obj.put("organism", "Escherichia coli strain K-12 substrain MG1655");
    obj.put("genome", "K-12 MG1655* [F-kilvG- rfb-50 rph-1 D(araCBAD) D(LacI)]");
    obj.put("media", "Cells were grown in LB Miller broth (Difco, MI, 90003-350) for overnight growth and cloning, and MOPS EZ Rich Defined Medium (Teknova, CA, M2105) with 0.4% glycerol carbon source for measurement experiments.  Ampicillin (100 lg/ml), kanamycin (50 lg/ml), and spectinomycin sulfate (50 lg/ml) were used to maintain plasmids. Arabinose (Sigma Aldrich, MO, A3256), 2,4-diacetylphloroglucinol (Santa Cruz Biotechnology, TX, CAS 2161-86-6), and anhydrotetracycline (aTc) (Sigma Aldrich, MO, 37919) were used as chemical inducers. The fluorescent protein reporters YFP (Cormack et al, 1996) and mRFP1 (Campbell et al, 2002) were measured with cytometry to determine gene expression.");
    obj.put("temperature", "37");
    obj.put("growth", "Escherichia coli MG1655* cells were transformed with three plasmids encoding: (i) inducible dCas9, (ii) one or more sgRNAs, and (iii) a fluorescent reporter. Cells were plated on LB agar plates with appropriate antibiotics. Transformed colonies were inoculated intoMOPS EZ Rich Defined Medium with 0.4% glycerol and appropriate antibiotics and were then grown overnight in V-bottom 96-well plates (Nunc, Roskilde, Denmark, 249952) in an ELMI Digital Thermos Microplates shaker incubator (Elmi Ltd, Riga, Latvia) at 1,000 rpm and 37C. The next day, cultures were diluted 180-fold into EZ Rich Medium with antibiotics and grown with the same shaking incubator parameters for 3 h. At 3 h, cells were diluted 700-fold into EZ Rich Medium with antibiotics and inducers. The cells were grown using the same shaking incubator parameters for 6 h. For cytometry measurements, 40 ll of the cell culture was added to 160 ll of phosphate-buffered saline with 0.5 mg/ml kanamycin to arrest cell growth. The cells were placed in a 4C refrigerator for 1 h to allow the fluorophores to mature prior to cytometry analysis.");
    objects.add(obj);
    return objects;
}

15. collection_writer_header#getObjects()

Project: cello
Source File: collection_writer_header.java
View license
@Override
public ArrayList<Map> getObjects() {
    ArrayList<Map> objects = new ArrayList<>();
    Date date = new Date();
    Map obj = new LinkedHashMap();
    obj.put("collection", "header");
    obj.put("description", "7 TetR homologs (NOR/NOT), 2 Activator-Chaperones (AND)");
    obj.put("version", "Eco3C3G3T3");
    obj.put("date", date.toString());
    obj.put("author", new String[] { "Bryan Der" });
    obj.put("organism", "Escherichia coli NEB 10-beta");
    obj.put("genome", "NEB 10 ?(ara-leu) 7697 araD139 fhuA ?lacX74 galK16 galE15 e14- ?80dlacZ?M15  recA1 relA1 endA1 nupG  rpsL (StrR) rph spoT1 ?(mrr-hsdRMS-mcrBC)");
    obj.put("media", "M9 minimal media composed of M9 media salts (6.78 g/L Na2HPO4, 3 g/L KH2PO4, 1 g/L NH4Cl, 0.5 g/L NaCl, 0.34 g/L thiamine hydrochloride, 0.4% D-glucose, 0.2% Casamino acids, 2 mM MgSO4, and 0.1 mM CaCl2; kanamycin (50 ug/ml), spectinomycin (50 ug/ml)");
    obj.put("temperature", "37");
    obj.put("growth", "Inoculation: Individual colonies into M9 media, 16 hours overnight in plate shaker.  Dilution: Next day, cells dilute ~200-fold into M9 media with antibiotics, growth for 3 hours.  Induction: Cells diluted ~650-fold into M9 media with antibiotics.  Growth: shaking incubator for 5 hours.  Arrest protein production: PBS and 2mg/ml kanamycin.  Measurement: flow cytometry, data processing for RPU normalization.");
    objects.add(obj);
    return objects;
}

16. collection_writer_header#getObjects()

Project: cello
Source File: collection_writer_header.java
View license
@Override
public ArrayList<Map> getObjects() {
    ArrayList<Map> objects = new ArrayList<>();
    Date date = new Date();
    Map obj = new LinkedHashMap();
    obj.put("collection", "header");
    obj.put("description", "TetR homologs: Jonghyeon's from 2014 that Chris Barnes used.");
    obj.put("version", "EcoCB1");
    obj.put("date", date.toString());
    obj.put("author", new String[] { "Bryan Der" });
    obj.put("organism", "Escherichia coli NEB 10-beta");
    obj.put("genome", "NEB 10 ?(ara-leu) 7697 araD139 fhuA ?lacX74 galK16 galE15 e14- ?80dlacZ?M15  recA1 relA1 endA1 nupG  rpsL (StrR) rph spoT1 ?(mrr-hsdRMS-mcrBC)");
    obj.put("media", "M9 minimal media composed of M9 media salts (6.78 g/L Na2HPO4, 3 g/L KH2PO4, 1 g/L NH4Cl, 0.5 g/L NaCl, 0.34 g/L thiamine hydrochloride, 0.4% D-glucose, 0.2% Casamino acids, 2 mM MgSO4, and 0.1 mM CaCl2; kanamycin (50 ug/ml), spectinomycin (50 ug/ml)");
    obj.put("temperature", "37");
    obj.put("growth", "Inoculation: Individual colonies into M9 media, 16 hours overnight in plate shaker.  Dilution: Next day, cells dilute ~200-fold into M9 media with antibiotics, growth for 3 hours.  Induction: Cells diluted ~650-fold into M9 media with antibiotics.  Growth: shaking incubator for 5 hours.  Arrest protein production: PBS and 2mg/ml kanamycin.  Measurement: flow cytometry, data processing for RPU normalization.");
    objects.add(obj);
    return objects;
}

17. collection_writer_header#getObjects()

Project: cello
Source File: collection_writer_header.java
View license
@Override
public ArrayList<Map> getObjects() {
    ArrayList<Map> objects = new ArrayList<>();
    Date date = new Date();
    Map obj = new LinkedHashMap();
    obj.put("collection", "header");
    obj.put("description", "TetR homologs: PhlF, SrpR, BM3R1, HlyIIR, BetI, AmtR, AmeR, QacR, IcaRA");
    obj.put("version", "EcoJS4ib");
    obj.put("date", date.toString());
    obj.put("author", new String[] { "Bryan Der" });
    obj.put("organism", "Escherichia coli NEB 10-beta");
    obj.put("genome", "NEB 10 ?(ara-leu) 7697 araD139 fhuA ?lacX74 galK16 galE15 e14- ?80dlacZ?M15  recA1 relA1 endA1 nupG  rpsL (StrR) rph spoT1 ?(mrr-hsdRMS-mcrBC)");
    obj.put("media", "M9 minimal media composed of M9 media salts (6.78 g/L Na2HPO4, 3 g/L KH2PO4, 1 g/L NH4Cl, 0.5 g/L NaCl, 0.34 g/L thiamine hydrochloride, 0.4% D-glucose, 0.2% Casamino acids, 2 mM MgSO4, and 0.1 mM CaCl2; kanamycin (50 ug/ml), spectinomycin (50 ug/ml)");
    obj.put("temperature", "37");
    obj.put("growth", "Inoculation: Individual colonies into M9 media, 16 hours overnight in plate shaker.  Dilution: Next day, cells dilute ~200-fold into M9 media with antibiotics, growth for 3 hours.  Induction: Cells diluted ~650-fold into M9 media with antibiotics.  Growth: shaking incubator for 5 hours.  Arrest protein production: PBS and 2mg/ml kanamycin.  Measurement: flow cytometry, data processing for RPU normalization.");
    objects.add(obj);
    return objects;
}

18. collection_writer_header#getObjects()

Project: cello
Source File: collection_writer_header.java
View license
@Override
public ArrayList<Map> getObjects() {
    ArrayList<Map> objects = new ArrayList<>();
    Date date = new Date();
    Map obj = new LinkedHashMap();
    obj.put("collection", "header");
    obj.put("description", "LacI and TetR for IWBDA AND4 demo");
    obj.put("version", "v1");
    obj.put("date", date.toString());
    obj.put("author", new String[] { "Bryan Der" });
    obj.put("organism", "Escherichia coli");
    obj.put("genome", "");
    obj.put("media", "");
    obj.put("temperature", "37");
    obj.put("growth", "");
    objects.add(obj);
    return objects;
}

19. OnCancelConfigTest#shouldSetPrimitiveAttributesForNantTask()

Project: gocd
Source File: OnCancelConfigTest.java
View license
@Test
public void shouldSetPrimitiveAttributesForNantTask() {
    Map hashMap = new HashMap();
    hashMap.put(OnCancelConfig.ON_CANCEL_OPTIONS, "nant");
    Map valueMap = new HashMap();
    valueMap.put(BuildTask.BUILD_FILE, "default.build");
    valueMap.put(BuildTask.TARGET, "compile");
    valueMap.put(BuildTask.WORKING_DIRECTORY, "pwd");
    valueMap.put(NantTask.NANT_PATH, "/usr/bin/nant");
    hashMap.put(OnCancelConfig.NANT_ON_CANCEL, valueMap);
    hashMap.put(OnCancelConfig.EXEC_ON_CANCEL, new HashMap());
    hashMap.put(OnCancelConfig.ANT_ON_CANCEL, new HashMap());
    hashMap.put(OnCancelConfig.RAKE_ON_CANCEL, new HashMap());
    when(taskFactory.taskInstanceFor(new NantTask().getTaskType())).thenReturn(new NantTask());
    OnCancelConfig cancelConfig = OnCancelConfig.create(hashMap, taskFactory);
    NantTask expectedNantTask = new NantTask();
    expectedNantTask.setBuildFile("default.build");
    expectedNantTask.setTarget("compile");
    expectedNantTask.setWorkingDirectory("pwd");
    expectedNantTask.setNantPath("/usr/bin/nant");
    assertThat((NantTask) cancelConfig.getTask(), is(expectedNantTask));
}

20. XcodeProjectWriter#createPBXNativeTarget()

View license
/**
   * Create PBXNativeTarget.
   * 
   * @param name
   *          name.
   * @param buildConfigurationList
   *          build configuration list.
   * @param buildPhases
   *          build phases.
   * @param buildRules
   *          build rules.
   * @param dependencies
   *          dependencies.
   * @param productInstallPath
   *          product install path.
   * @param productName
   *          product name.
   * @param productReference
   *          file reference for product.
   * @param productType
   *          product type.
   * @return native target.
   */
private static PBXObjectRef createPBXNativeTarget(final String name, final PBXObjectRef buildConfigurationList, final List buildPhases, final List buildRules, final List dependencies, final String productInstallPath, final String productName, final PBXObjectRef productReference, final String productType) {
    final Map map = new HashMap();
    map.put("isa", "PBXNativeTarget");
    map.put("buildConfigurationList", buildConfigurationList);
    map.put("buildPhases", buildPhases);
    map.put("buildRules", buildRules);
    map.put("dependencies", dependencies);
    map.put("name", name);
    map.put("productInstallPath", productInstallPath);
    map.put("productName", productName);
    map.put("productReference", productReference);
    map.put("productType", productType);
    return new PBXObjectRef(map);
}

21. InstantiationTest#getTypedObjectASObjectTypes()

Project: flex-blazeds
Source File: InstantiationTest.java
View license
public Map getTypedObjectASObjectTypes(ASObject aso) {
    Map typeMap = new HashMap();
    typeMap.put("main", aso.getType());
    Object obj = aso.get("theCollection");
    Object[] theCollection = (Object[]) obj;
    typeMap.put("theCollection0", ((ASObject) theCollection[0]).getType());
    typeMap.put("theCollection1", ((ASObject) theCollection[1]).getType());
    typeMap.put("theCollection2.0", ((ASObject) ((ArrayList) theCollection[2]).get(0)).getType());
    typeMap.put("theCollection2.1", ((ASObject) ((ArrayList) theCollection[2]).get(1)).getType());
    typeMap.put("mapbook", ((ASObject) ((ASObject) aso.get("map")).get("book")).getType());
    typeMap.put("hashmap", ((ASObject) ((ASObject) aso.get("map")).get("hashmap")).getType());
    typeMap.put("me", ((ASObject) aso.get("me")).getType());
    typeMap.put("map", ((ASObject) aso.get("map")).getType());
    return typeMap;
}

22. AbstractTaskTest#shouldBeAbleToRemoveOnCancelConfig()

Project: gocd
Source File: AbstractTaskTest.java
View license
@Test
public void shouldBeAbleToRemoveOnCancelConfig() {
    AbstractTask task = new ExecTask();
    task.setCancelTask(new ExecTask());
    Map cancelTaskAttributes = new HashMap();
    cancelTaskAttributes.put(ExecTask.COMMAND, "ls");
    cancelTaskAttributes.put(ExecTask.ARG_LIST_STRING, "-la");
    Map onCancelConfigAttributes = new HashMap();
    onCancelConfigAttributes.put(OnCancelConfig.EXEC_ON_CANCEL, cancelTaskAttributes);
    Map cancelConfigAttributes = new HashMap();
    cancelConfigAttributes.put(OnCancelConfig.ON_CANCEL_OPTIONS, "exec");
    Map actualTaskAttributes = new HashMap();
    actualTaskAttributes.put(AbstractTask.HAS_CANCEL_TASK, "0");
    actualTaskAttributes.put(AbstractTask.ON_CANCEL_CONFIG, cancelConfigAttributes);
    task.setConfigAttributes(actualTaskAttributes);
    assertThat(task.hasCancelTask(), is(false));
}

23. DelegatedAccessEntityProviderImpl#getEntity()

View license
public Object getEntity(EntityReference ref) {
    String siteRef = "/site/" + ref.getId();
    String nodeId = getFirstNodeId(siteRef, DelegatedAccessConstants.HIERARCHY_ID);
    if (nodeId == null) {
        throw new IllegalArgumentException("NodeId for Site: " + ref + " doesn't exist");
    }
    NodeModel node = projectLogic.getNodeModel(nodeId, DelegatedAccessConstants.SHOPPING_PERIOD_USER);
    if (node == null) {
        throw new IllegalArgumentException("NodeId: " + nodeId + " doesn't exist");
    }
    Map valuesMap = new HashMap<String, String>();
    valuesMap.put("shoppingStartDate", node.getNodeShoppingPeriodStartDate());
    valuesMap.put("shoppingEndDate", node.getNodeShoppingPeriodEndDate());
    valuesMap.put("shoppingRealm", node.getNodeAccessRealmRole()[0]);
    valuesMap.put("shoppingRole", node.getNodeAccessRealmRole()[1]);
    valuesMap.put("directAccess", node.isDirectAccess());
    valuesMap.put("revokeInstructorEditable", node.getNodeShoppingPeriodRevokeInstructorEditable());
    valuesMap.put("revokeInstructorPublicOpt", node.getNodeShoppingPeriodRevokeInstructorPublicOpt());
    valuesMap.put("shoppingShowAuthTools", node.getNodeRestrictedAuthTools());
    valuesMap.put("shoppingShowPublicTools", node.getNodeRestrictedPublicTools());
    return valuesMap;
}

24. MockConnection#newSystem()

Project: spacewalk
Source File: MockConnection.java
View license
private String newSystem() {
    Map profile = new HashMap();
    String key = random();
    profile.put("uid", random());
    Map interfaces = new HashMap();
    Map iface = new HashMap();
    iface.put("mac_address", NetworkInterfaceTest.TEST_MAC);
    iface.put("ip_address", "127.0.0.1");
    interfaces.put("eth0", iface);
    profile.put("interfaces", interfaces);
    systems.add(profile);
    systemMap.put(key, profile);
    profile.put("ks_meta", new HashMap());
    profile.put("redhat_management_key", "");
    return key;
}

25. UnsafeMethods#createPrimitiveClassesMap()

View license
private static Map createPrimitiveClassesMap() {
    Map map = new HashMap();
    map.put("boolean", Boolean.TYPE);
    map.put("byte", Byte.TYPE);
    map.put("char", Character.TYPE);
    map.put("short", Short.TYPE);
    map.put("int", Integer.TYPE);
    map.put("long", Long.TYPE);
    map.put("float", Float.TYPE);
    map.put("double", Double.TYPE);
    return map;
}

26. ConfigurationFactory#saveNewConfigChannel()

Project: spacewalk
Source File: ConfigurationFactory.java
View license
/**
     * Save a new configuration channel.
     * Note, this method uses a stored procedure, so it must be used for all newly
     * created configuration channels.
     * @param channel The channel object to persist.
     */
public static void saveNewConfigChannel(ConfigChannel channel) {
    CallableMode m = ModeFactory.getCallableMode("config_queries", "create_new_config_channel");
    Map inParams = new HashMap();
    Map outParams = new HashMap();
    inParams.put("org_id_in", channel.getOrgId());
    inParams.put("type_in", channel.getConfigChannelType().getLabel());
    inParams.put("name_in", channel.getName());
    inParams.put("label_in", channel.getLabel());
    inParams.put("description_in", channel.getDescription());
    //Outparam
    outParams.put("channelId", new Integer(Types.NUMERIC));
    Map result = m.execute(inParams, outParams);
    Long channelId = (Long) result.get("channelId");
    channel.setId(channelId);
}

27. ConfigFileData#makeValidationMap()

Project: spacewalk
Source File: ConfigFileData.java
View license
/**
     * Basically returns a map equating ConfigFileForm's form fieldnames
     * to values from config file data.. This is needed by the RHnValidationHelper
     * while matching values against xsds..
     * @return a map with key = ConfigFIleForms keys, & value = ConfigFIleData values..
     */
protected Map makeValidationMap() {
    Map map = new HashMap();
    map.put(ConfigFileForm.REV_UID, getOwner());
    map.put(ConfigFileForm.REV_GID, getGroup());
    map.put(ConfigFileForm.REV_PERMS, getPermissions());
    map.put(ConfigFileForm.REV_SELINUX_CTX, getSelinuxCtx());
    map.put(ConfigFileForm.REV_SYMLINK_TARGET_PATH, getSelinuxCtx());
    map.put(ConfigFileForm.REV_MACROSTART, getMacroStart());
    map.put(ConfigFileForm.REV_MACROEND, getMacroEnd());
    map.put(ConfigFileForm.REV_BINARY, isBinary());
    return map;
}

28. Timeout#getScriptSymbols()

Project: tapestry4
Source File: Timeout.java
View license
public Map getScriptSymbols() {
    int nSessionTime = getSessionTime();
    int nTimeToMessage = nSessionTime - getWarningTime();
    if (nTimeToMessage < 0)
        nTimeToMessage = 0;
    int nRemainingTime = nSessionTime - nTimeToMessage;
    int nAutoProlongTime = nSessionTime - getAutoProlongTime();
    Map mapSymbols = new HashMap();
    mapSymbols.put("confirmTimeout", new Integer(nTimeToMessage * 1000));
    mapSymbols.put("expirationTimeout", new Integer(nRemainingTime * 1000));
    mapSymbols.put("prolongSessionPeriod", new Integer(nAutoProlongTime * 1000));
    mapSymbols.put("confirmMessage", getWarningMessage());
    mapSymbols.put("expirationMessage", getExpirationMessage());
    mapSymbols.put("disableWarning", new Boolean(getDisableWarning()));
    mapSymbols.put("disableAutoProlong", new Boolean(getDisableAutoProlong()));
    mapSymbols.put("expirationFunction", getExpirationFunction());
    return mapSymbols;
}

29. DynamicBrokersReaderTest#setUp()

View license
@Before
public void setUp() throws Exception {
    server = new TestingServer();
    String connectionString = server.getConnectString();
    Map conf = new HashMap();
    conf.put(Config.STORM_ZOOKEEPER_SESSION_TIMEOUT, 1000);
    conf.put(Config.STORM_ZOOKEEPER_CONNECTION_TIMEOUT, 1000);
    conf.put(Config.STORM_ZOOKEEPER_RETRY_TIMES, 4);
    conf.put(Config.STORM_ZOOKEEPER_RETRY_INTERVAL, 5);
    ExponentialBackoffRetry retryPolicy = new ExponentialBackoffRetry(1000, 3);
    zookeeper = CuratorFrameworkFactory.newClient(connectionString, retryPolicy);
    dynamicBrokersReader = new DynamicBrokersReader(conf, connectionString, masterPath, topic);
    Map conf2 = new HashMap();
    conf2.putAll(conf);
    conf2.put("kafka.topic.wildcard.match", true);
    wildCardBrokerReader = new DynamicBrokersReader(conf2, connectionString, masterPath, "^test.*$");
    zookeeper.start();
}

30. DeleteTableCommand#execute()

Project: camel
Source File: DeleteTableCommand.java
View license
@Override
public void execute() {
    TableDescription tableDescription = ddbClient.deleteTable(new DeleteTableRequest(determineTableName())).getTableDescription();
    Map tmp = new HashMap<>();
    tmp.put(DdbConstants.PROVISIONED_THROUGHPUT, tableDescription.getProvisionedThroughput());
    tmp.put(DdbConstants.CREATION_DATE, tableDescription.getCreationDateTime());
    tmp.put(DdbConstants.ITEM_COUNT, tableDescription.getItemCount());
    tmp.put(DdbConstants.KEY_SCHEMA, tableDescription.getKeySchema());
    tmp.put(DdbConstants.TABLE_NAME, tableDescription.getTableName());
    tmp.put(DdbConstants.TABLE_SIZE, tableDescription.getTableSizeBytes());
    tmp.put(DdbConstants.TABLE_STATUS, tableDescription.getTableStatus());
    addToResults(tmp);
}

31. OnCancelConfigTest#shouldSetPrimitiveAttributesForExecTask()

Project: gocd
Source File: OnCancelConfigTest.java
View license
@Test
public void shouldSetPrimitiveAttributesForExecTask() {
    Map hashMap = new HashMap();
    hashMap.put(OnCancelConfig.ON_CANCEL_OPTIONS, "exec");
    Map valueMap = new HashMap();
    valueMap.put(ExecTask.COMMAND, "ls");
    valueMap.put(ExecTask.ARGS, "blah");
    valueMap.put(ExecTask.WORKING_DIR, "pwd");
    hashMap.put(OnCancelConfig.EXEC_ON_CANCEL, valueMap);
    hashMap.put(OnCancelConfig.ANT_ON_CANCEL, new HashMap());
    ExecTask execTask = new ExecTask();
    when(taskFactory.taskInstanceFor(execTask.getTaskType())).thenReturn(execTask);
    OnCancelConfig cancelConfig = OnCancelConfig.create(hashMap, taskFactory);
    assertThat((ExecTask) cancelConfig.getTask(), is(new ExecTask("ls", "blah", "pwd")));
}

32. OnCancelConfigTest#shouldSetPrimitiveAttributesForAntTask()

Project: gocd
Source File: OnCancelConfigTest.java
View license
@Test
public void shouldSetPrimitiveAttributesForAntTask() {
    Map hashMap = new HashMap();
    hashMap.put(OnCancelConfig.ON_CANCEL_OPTIONS, "ant");
    Map valueMap = new HashMap();
    valueMap.put(BuildTask.BUILD_FILE, "build.xml");
    valueMap.put(BuildTask.TARGET, "blah");
    valueMap.put(BuildTask.WORKING_DIRECTORY, "pwd");
    hashMap.put(OnCancelConfig.ANT_ON_CANCEL, valueMap);
    hashMap.put(OnCancelConfig.EXEC_ON_CANCEL, new HashMap());
    when(taskFactory.taskInstanceFor(new AntTask().getTaskType())).thenReturn(new AntTask());
    OnCancelConfig cancelConfig = OnCancelConfig.create(hashMap, taskFactory);
    AntTask expectedAntTask = new AntTask();
    expectedAntTask.setBuildFile("build.xml");
    expectedAntTask.setTarget("blah");
    expectedAntTask.setWorkingDirectory("pwd");
    assertThat((AntTask) cancelConfig.getTask(), is(expectedAntTask));
}

33. OnCancelConfigTest#shouldSetPrimitiveAttributesForRakeTask()

Project: gocd
Source File: OnCancelConfigTest.java
View license
@Test
public void shouldSetPrimitiveAttributesForRakeTask() {
    Map hashMap = new HashMap();
    hashMap.put(OnCancelConfig.ON_CANCEL_OPTIONS, "rake");
    Map valueMap = new HashMap();
    valueMap.put(BuildTask.BUILD_FILE, "rakefile");
    valueMap.put(BuildTask.TARGET, "build");
    valueMap.put(BuildTask.WORKING_DIRECTORY, "pwd");
    hashMap.put(OnCancelConfig.RAKE_ON_CANCEL, valueMap);
    hashMap.put(OnCancelConfig.EXEC_ON_CANCEL, new HashMap());
    when(taskFactory.taskInstanceFor(new RakeTask().getTaskType())).thenReturn(new RakeTask());
    OnCancelConfig cancelConfig = OnCancelConfig.create(hashMap, taskFactory);
    RakeTask expectedRakeTask = new RakeTask();
    expectedRakeTask.setBuildFile("rakefile");
    expectedRakeTask.setTarget("build");
    expectedRakeTask.setWorkingDirectory("pwd");
    assertThat((RakeTask) cancelConfig.getTask(), is(expectedRakeTask));
}

34. JsonSerializerTest#testSimpleMap()

Project: jodd
Source File: JsonSerializerTest.java
View license
// ---------------------------------------------------------------- tests
@Test
public void testSimpleMap() {
    Map map = new LinkedHashMap();
    map.put("one", "uno");
    map.put("two", "duo");
    JsonSerializer jsonSerializer = new JsonSerializer();
    String json = jsonSerializer.serialize(map);
    assertEquals("{\"one\":\"uno\",\"two\":\"duo\"}", json);
    map = new LinkedHashMap();
    map.put("one", Long.valueOf(173));
    map.put("two", Double.valueOf(7.89));
    map.put("three", Boolean.TRUE);
    map.put("four", null);
    map.put("five", "new\nline");
    jsonSerializer = new JsonSerializer();
    json = jsonSerializer.serialize(map);
    assertEquals("{\"one\":173,\"two\":7.89,\"three\":true,\"four\":null,\"five\":\"new\\nline\"}", json);
}

35. LocalUtils#getLocalBaseConf()

Project: jstorm
Source File: LocalUtils.java
View license
public static Map getLocalBaseConf() {
    JStormUtils.setLocalMode(true);
    Map conf = new HashMap();
    conf.put(Config.STORM_CLUSTER_MODE, "local");
    conf.put(Config.TOPOLOGY_SKIP_MISSING_KRYO_REGISTRATIONS, true);
    conf.put(Config.ZMQ_LINGER_MILLIS, 0);
    conf.put(Config.TOPOLOGY_ENABLE_MESSAGE_TIMEOUTS, false);
    conf.put(Config.TOPOLOGY_TRIDENT_BATCH_EMIT_INTERVAL_MILLIS, 50);
    ConfigExtension.setSpoutDelayRunSeconds(conf, 0);
    ConfigExtension.setTaskCleanupTimeoutSec(conf, 0);
    ConfigExtension.setTopologyDebugRecvTuple(conf, true);
    conf.put(Config.TOPOLOGY_DEBUG, true);
    conf.put(ConfigExtension.TOPOLOGY_BACKPRESSURE_ENABLE, false);
    return conf;
}

36. ContextTest#test_netty()

Project: jstorm
Source File: ContextTest.java
View license
@Test
public void test_netty() {
    Map storm_conf = Maps.newHashMap();
    storm_conf.put(Config.STORM_MESSAGING_TRANSPORT, "com.alibaba.jstorm.message.netty.NettyContext");
    storm_conf.put(Config.STORM_MESSAGING_NETTY_BUFFER_SIZE, 1024);
    storm_conf.put(Config.STORM_MESSAGING_NETTY_MAX_RETRIES, 10);
    storm_conf.put(Config.STORM_MESSAGING_NETTY_MIN_SLEEP_MS, 1000);
    storm_conf.put(Config.STORM_MESSAGING_NETTY_MAX_SLEEP_MS, 5000);
    storm_conf.put(Config.STORM_MESSAGING_NETTY_SERVER_WORKER_THREADS, 1);
    storm_conf.put(Config.STORM_MESSAGING_NETTY_CLIENT_WORKER_THREADS, 1);
    IContext context = TransportFactory.makeContext(storm_conf);
    Assert.assertNotNull(context);
}

37. ArithmeticTests#testMath34()

Project: mvel
Source File: ArithmeticTests.java
View license
public void testMath34() {
    String expression = "a+b-c*d*x/y-z+10";
    Map map = new HashMap();
    map.put("a", 200);
    map.put("b", 100);
    map.put("c", 150);
    map.put("d", 2);
    map.put("x", 400);
    map.put("y", 300);
    map.put("z", 75);
    Serializable s = compileExpression(expression);
    assertEquals((double) 200 + 100 - 150 * 2 * 400 / 300 - 75 + 10, executeExpression(s, map));
}

38. XcodeProjectWriter#createPBXProject()

View license
/**
   * Create PBXProject.
   * 
   * @param buildConfigurationList
   *          build configuration list.
   * @param mainGroup
   *          main group.
   * @param projectDirPath
   *          project directory path.
   * @param targets
   *          targets.
   * @param projectRoot
   *          projectRoot directory relative to
   * @return project.
   */
private static PBXObjectRef createPBXProject(final PBXObjectRef buildConfigurationList, final PBXObjectRef mainGroup, final String projectDirPath, final String projectRoot, final List targets) {
    final Map map = new HashMap();
    map.put("isa", "PBXProject");
    map.put("buildConfigurationList", buildConfigurationList.getID());
    map.put("hasScannedForEncodings", "0");
    map.put("mainGroup", mainGroup.getID());
    map.put("projectDirPath", projectDirPath);
    map.put("targets", targets);
    map.put("projectRoot", projectRoot);
    return new PBXObjectRef(map);
}

39. XmlRpcStructFactory#getXmlRpcWorkflowTask()

Project: oodt
Source File: XmlRpcStructFactory.java
View license
/**
   * <p>
   * Gets an XML-RPC version of the {@link WorkflowTask} to send over the wire.
   * </p>
   * 
   * @param t
   *          The WorkflowTask to obtain an XML-RPC HashMap from.
   * @return an XML-RPC version of the {@link WorkflowTask} to send over the
   *         wire.
   */
public static Map getXmlRpcWorkflowTask(WorkflowTask t) {
    Map task = new Hashtable();
    task.put("class", t.getTaskInstanceClassName());
    task.put("id", t.getTaskId());
    task.put("name", t.getTaskName());
    task.put("order", String.valueOf(t.getOrder()));
    task.put("conditions", getXmlRpcWorkflowConditions(t.getConditions()));
    task.put("configuration", getXmlRpcWorkflowTaskConfiguration(t.getTaskConfig()));
    task.put("requiredMetFields", getXmlRpcWorkflowTaskReqMetFields(t.getRequiredMetFields()));
    return task;
}

40. XmlRpcStructFactory#getXmlRpcWorkflowCondition()

Project: oodt
Source File: XmlRpcStructFactory.java
View license
/**
   * <p>
   * Gets an XML-RPC {@link HashMap} representation of the
   * {@link WorkflowCondition} to send over the wire.
   * </p>
   * 
   * @param c
   *          The WorkflowCondition to turn into an XML-RPC HashMap.
   * @return an XML-RPC {@link HashMap} representation of the
   *         {@link WorkflowCondition} to send over the wire.
   */
public static Map getXmlRpcWorkflowCondition(WorkflowCondition c) {
    Map condition = new Hashtable();
    condition.put("class", c.getConditionInstanceClassName());
    condition.put("id", c.getConditionId());
    condition.put("name", c.getConditionName());
    condition.put("order", String.valueOf(c.getOrder()));
    condition.put("timeout", String.valueOf(c.getTimeoutSeconds()));
    condition.put("optional", String.valueOf(c.isOptional()));
    condition.put("configuration", getXmlRpcWorkflowConditionConfig(c.getCondConfig()));
    return condition;
}

41. MapBuilder#of()

Project: react-native
Source File: MapBuilder.java
View license
/**
   * Returns map containing the given entries.
   */
public static <K, V> Map<K, V> of(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6, K k7, V v7) {
    Map map = of();
    map.put(k1, v1);
    map.put(k2, v2);
    map.put(k3, v3);
    map.put(k4, v4);
    map.put(k5, v5);
    map.put(k6, v6);
    map.put(k7, v7);
    return map;
}

42. MockCharonPortal#includeTool()

Project: sakai
Source File: MockCharonPortal.java
View license
protected Map includeTool() throws IOException {
    Map toolMap = new HashMap();
    toolMap.put("toolUrl", "toolUrl");
    toolMap.put("toolPlacementIDJS", "Main_" + System.currentTimeMillis());
    toolMap.put("toolTitle", "titleString");
    toolMap.put("toolShowResetButton", Boolean.valueOf(true));
    toolMap.put("toolShowHelpButton", Boolean.valueOf(true));
    toolMap.put("toolHelpActionUrl", "helpActionUrl");
    toolMap.put("toolResetActionUrl", "toolResetActionUrl");
    return toolMap;
}

43. AssertTest#mapAssertEquals()

Project: testng
Source File: AssertTest.java
View license
@Test
public void mapAssertEquals() {
    Map expected = Maps.newHashMap();
    Map actual = Maps.newHashMap();
    expected.put(null, "a");
    expected.put("a", "a");
    expected.put("b", "c");
    actual.put("b", "c");
    actual.put(null, "a");
    actual.put("a", "a");
    Assert.assertEquals(actual, expected);
}

44. ConfigSQLExecutorTest#updateWithMapParams()

Project: bboss
Source File: ConfigSQLExecutorTest.java
View license
@Test
public void updateWithMapParams() throws SQLException {
    Map datas = new HashMap();
    datas.put("id", 139);
    datas.put("fieldName", "updateWithMapParams139");
    List<Map> params_ = new ArrayList<Map>();
    params_.add(datas);
    datas = new HashMap();
    datas.put("id", 140);
    datas.put("fieldName", "updateWithMapParams140");
    params_.add(datas);
    datas = new HashMap();
    datas.put("id", 141);
    datas.put("fieldName", "updateWithMapParams141");
    params_.add(datas);
    executor.updateBeans("updatesqltemplate", params_);
//		 result = (List<ListBean>) SQLExecutor.queryListBeanWithDBName(ListBean.class,"dbname","sql", params);
//		 System.out.println(result.size());
}

45. SiteProfileManager#buildKey()

Project: cocoon
Source File: SiteProfileManager.java
View license
protected Map buildKey(String category, String profileType, UserInfo info, boolean load) {
    final StringBuffer config = new StringBuffer(profileType);
    config.append('-');
    config.append(category);
    config.append('-');
    if (load) {
        config.append("load");
    } else {
        config.append("save");
    }
    final String uri = (String) info.getConfigurations().get(config.toString());
    final Map key = new LinkedMap(6);
    key.put("baseuri", uri);
    key.put("separator", "?");
    key.put("portal", info.getPortalName());
    key.put("layout", info.getLayoutKey());
    key.put("type", category);
    key.put("site", this.getSiteName());
    return key;
}

46. EclipseJavaCompilerSettings#toNativeSettings()

View license
Map toNativeSettings() {
    final Map map = new HashMap(defaultEclipseSettings);
    map.put(CompilerOptions_OPTION_SuppressWarnings, isWarnings() ? CompilerOptions_GENERATE : CompilerOptions_DO_NOT_GENERATE);
    map.put(CompilerOptions_OPTION_ReportDeprecation, isDeprecations() ? CompilerOptions_GENERATE : CompilerOptions_DO_NOT_GENERATE);
    map.put(CompilerOptions_OPTION_TargetPlatform, toNativeVersion(getTargetVersion()));
    map.put(CompilerOptions_OPTION_Source, toNativeVersion(getSourceVersion()));
    map.put(CompilerOptions_OPTION_Compliance, toNativeVersion(getSourceVersion()));
    map.put(CompilerOptions_OPTION_Encoding, getSourceEncoding());
    return map;
}

47. FactPopulatorTest#testMVELPopulate()

Project: drools
Source File: FactPopulatorTest.java
View license
@Test
public void testMVELPopulate() throws Exception {
    Object q = MVEL.eval("new " + DumbFact.class.getName() + "()");
    Map m = new HashMap();
    m.put("obj", q);
    m.put("val", "mike");
    MVEL.eval("obj.name = val", m);
    m = new HashMap();
    m.put("obj", q);
    m.put("val", "42");
    MVEL.eval("obj.age = val", m);
    m = new HashMap();
    m.put("obj", q);
    m.put("val", "44");
    MVEL.eval("obj.number = val", m);
    DumbFact d = (DumbFact) q;
    assertEquals("mike", d.getName());
    assertEquals(42, d.getAge());
    assertEquals(new Long(44), d.getNumber());
}

48. PopulatingWithMVELTest#testMVELPopulate()

Project: drools
Source File: PopulatingWithMVELTest.java
View license
@Test
public void testMVELPopulate() throws Exception {
    Object q = MVEL.eval("new org.drools.workbench.models.testscenarios.backend.DumbFact()");
    Map m = new HashMap();
    m.put("obj", q);
    m.put("val", "mike");
    MVEL.eval("obj.name = val", m);
    m = new HashMap();
    m.put("obj", q);
    m.put("val", "42");
    MVEL.eval("obj.age = val", m);
    m = new HashMap();
    m.put("obj", q);
    m.put("val", "44");
    MVEL.eval("obj.number = val", m);
    DumbFact d = (DumbFact) q;
    assertEquals("mike", d.getName());
    assertEquals(42, d.getAge());
    assertEquals(new Long(44), d.getNumber());
}

49. JdkTypeToJsonTest#testMapWithFilterInclude()

View license
@Test
public void testMapWithFilterInclude() {
    TestSettings cfg = new TestSettings();
    cfg.setProperty("es.mapping.include", "key, nested.a*");
    Map nested = new LinkedHashMap();
    nested.put("aaa", "bbb");
    nested.put("ccc", "ddd");
    nested.put("axx", "zzz");
    Map map = new LinkedHashMap();
    map.put("key", "value");
    map.put("nested", nested);
    assertEquals("{\"key\":\"value\",\"nested\":{\"aaa\":\"bbb\",\"axx\":\"zzz\"}}", jdkTypeToJson(map, cfg));
}

50. JdkTypeToJsonTest#testMapWithFilterExclude()

View license
@Test
public void testMapWithFilterExclude() {
    TestSettings cfg = new TestSettings();
    cfg.setProperty("es.mapping.exclude", "key, nested.xxx");
    Map nested = new LinkedHashMap();
    nested.put("aaa", "bbb");
    nested.put("ccc", "ddd");
    nested.put("xxx", "zzz");
    Map map = new LinkedHashMap();
    map.put("key", "value");
    map.put("nested", nested);
    assertEquals("{\"nested\":{\"aaa\":\"bbb\",\"ccc\":\"ddd\"}}", jdkTypeToJson(map, cfg));
}

51. AbstractWebModuleTest#setUpStaticContentServlet()

Project: geronimo
Source File: AbstractWebModuleTest.java
View license
protected void setUpStaticContentServlet() throws Exception {
    GBeanData staticContentServletGBeanData = new GBeanData(JettyServletHolder.GBEAN_INFO);
    staticContentServletGBeanData.setAttribute("servletName", "default");
    staticContentServletGBeanData.setAttribute("servletClass", "org.mortbay.jetty.servlet.Default");
    Map staticContentServletInitParams = new HashMap();
    staticContentServletInitParams.put("acceptRanges", "true");
    staticContentServletInitParams.put("dirAllowed", "true");
    staticContentServletInitParams.put("putAllowed", "false");
    staticContentServletInitParams.put("delAllowed", "false");
    staticContentServletInitParams.put("redirectWelcome", "false");
    staticContentServletInitParams.put("minGzipLength", "8192");
    staticContentServletGBeanData.setAttribute("initParams", staticContentServletInitParams);
    staticContentServletGBeanData.setAttribute("loadOnStartup", new Integer(0));
    staticContentServletGBeanData.setAttribute("servletMappings", Collections.singleton(new String("/")));
    ObjectName staticContentServletObjectName = NameFactory.getComponentName(null, null, null, NameFactory.WEB_MODULE, null, (String) staticContentServletGBeanData.getAttribute("servletName"), NameFactory.SERVLET, moduleContext);
    staticContentServletGBeanData.setName(staticContentServletObjectName);
    staticContentServletGBeanData.setReferencePattern("JettyServletRegistration", webModuleName);
    start(staticContentServletGBeanData);
}

52. JobConfig#setConfigAttributes()

Project: gocd
Source File: JobConfig.java
View license
public void setConfigAttributes(Object attributes, TaskFactory taskFactory) {
    Map attributesMap = (Map) attributes;
    if (attributesMap.containsKey(NAME)) {
        String nameString = (String) attributesMap.get(NAME);
        jobName = nameString == null ? null : new CaseInsensitiveString(nameString);
    }
    if (attributesMap.containsKey(TASKS)) {
        tasks.setConfigAttributes(attributesMap.get(TASKS), taskFactory);
    }
    if (attributesMap.containsKey(ENVIRONMENT_VARIABLES)) {
        variables.setConfigAttributes(attributesMap.get(ENVIRONMENT_VARIABLES));
    }
    if (attributesMap.containsKey(TABS)) {
        tabs.setConfigAttributes(attributesMap.get(TABS));
    }
    if (attributesMap.containsKey(RESOURCES)) {
        resources.importFromCsv((String) attributesMap.get(RESOURCES));
    }
    if (attributesMap.containsKey(ARTIFACT_PLANS)) {
        artifactPlans.setConfigAttributes(attributesMap.get(ARTIFACT_PLANS));
    }
    setTimeoutAttribute(attributesMap);
    setJobRunTypeAttribute(attributesMap);
}

53. ArithmeticTests#testMath34_Interpreted()

Project: mvel
Source File: ArithmeticTests.java
View license
public void testMath34_Interpreted() {
    String expression = "a+b-c*x/y-z";
    Map map = new HashMap();
    map.put("a", 200);
    map.put("b", 100);
    map.put("c", 150);
    map.put("x", 400);
    map.put("y", 300);
    map.put("z", 75);
    assertEquals((double) 200 + 100 - 150 * 400 / 300 - 75, MVEL.eval(expression, map));
}

54. ArithmeticTests#testMath35()

Project: mvel
Source File: ArithmeticTests.java
View license
public void testMath35() {
    String expression = "b/x/b/b*y+a";
    Map map = new HashMap();
    map.put("a", 10);
    map.put("b", 20);
    map.put("c", 30);
    map.put("x", 40);
    map.put("y", 50);
    map.put("z", 60);
    assertNumEquals(20d / 40d / 20d / 20d * 50d + 10d, executeExpression(compileExpression(expression), map));
}

55. ArithmeticTests#testMath35_Interpreted()

Project: mvel
Source File: ArithmeticTests.java
View license
public void testMath35_Interpreted() {
    String expression = "b/x/b/b*y+a";
    Map map = new HashMap();
    map.put("a", 10);
    map.put("b", 20);
    map.put("c", 30);
    map.put("x", 40);
    map.put("y", 50);
    map.put("z", 60);
    assertNumEquals(20d / 40d / 20d / 20d * 50d + 10d, MVEL.eval(expression, map));
}

56. ArithmeticTests#testMath36()

Project: mvel
Source File: ArithmeticTests.java
View license
public void testMath36() {
    String expression = "b/x*z/a+x-b+x-b/z+y";
    Map map = new HashMap();
    map.put("a", 10);
    map.put("b", 20);
    map.put("c", 30);
    map.put("x", 40);
    map.put("y", 50);
    map.put("z", 60);
    Serializable s = compileExpression(expression);
    assertNumEquals(20d / 40d * 60d / 10d + 40d - 20d + 40d - 20d / 60d + 50d, executeExpression(s, map));
}

57. ArithmeticTests#testMath37()

Project: mvel
Source File: ArithmeticTests.java
View license
public void testMath37() {
    String expression = "x+a*a*c/x*b*z+x/y-b";
    Map map = new HashMap();
    map.put("a", 10);
    map.put("b", 20);
    map.put("c", 30);
    map.put("x", 2);
    map.put("y", 2);
    map.put("z", 60);
    Serializable s = compileExpression(expression);
    assertNumEquals(2d + 10d * 10d * 30d / 2d * 20d * 60d + 2d / 2d - 20d, executeExpression(s, map));
}

58. PackageEvrFactory#lookupPackageEvr()

Project: spacewalk
Source File: PackageEvrFactory.java
View license
/**
     * Commit a PackageEvr via stored proc - lookup_evr
     * @param evrIn PackageEvr to commit to db
     * @return Returns a new/committed PackageEvr object.
     */
private static Long lookupPackageEvr(String epoch, String version, String release) {
    CallableMode m = ModeFactory.getCallableMode("Package_queries", "lookup_evr");
    Map inParams = new HashMap();
    inParams.put("epoch", epoch);
    inParams.put("version", version);
    inParams.put("release", release);
    Map outParams = new HashMap();
    outParams.put("evrId", new Integer(Types.NUMERIC));
    Map result = m.execute(inParams, outParams);
    return (Long) result.get("evrId");
}

59. UserManager#verifyChannelRole()

Project: spacewalk
Source File: UserManager.java
View license
private static boolean verifyChannelRole(Long userId, Channel channel, String role) {
    CallableMode m = ModeFactory.getCallableMode("Channel_queries", "verify_channel_role");
    Map inParams = new HashMap();
    inParams.put("cid", channel.getId());
    inParams.put("user_id", userId);
    inParams.put("role", role);
    Map outParams = new HashMap();
    outParams.put("result", new Integer(Types.VARCHAR));
    Map result = m.execute(inParams, outParams);
    return result.get("result") == null;
}

60. TestScript#testAntSyntax()

Project: tapestry3
Source File: TestScript.java
View license
public void testAntSyntax() throws Exception {
    Map form = new HashMap();
    form.put("name", "gallahad");
    Map component = new HashMap();
    component.put("form", form);
    component.put("name", "lancelot");
    Map symbols = new HashMap();
    symbols.put("component", component);
    execute("ant-syntax.script", symbols);
    assertSymbol(symbols, "functionName", "gallahad_lancelot");
    assertSymbol(symbols, "incomplete1", "Incomplete: $");
    assertSymbol(symbols, "incomplete2", "Incomplete: ${");
    assertSymbol(symbols, "nopath", "This ${} ends up as literal.");
    assertSymbol(symbols, "OGNL", "This is a brace: }.");
}

61. TestScript#testAntSyntax()

Project: tapestry4
Source File: TestScript.java
View license
public void testAntSyntax() throws Exception {
    Map form = new HashMap();
    form.put("name", "gallahad");
    Map component = new HashMap();
    component.put("form", form);
    component.put("name", "lancelot");
    Map symbols = new HashMap();
    symbols.put("component", component);
    execute("ant-syntax.script", symbols);
    assertSymbol(symbols, "functionName", "gallahad_lancelot");
    assertSymbol(symbols, "incomplete1", "Incomplete: $");
    assertSymbol(symbols, "incomplete2", "Incomplete: ${");
    assertSymbol(symbols, "nopath", "This ${} ends up as literal.");
    assertSymbol(symbols, "OGNL", "This is a brace: }.");
}

62. ModuleRevisionIdTest#testEncodeDecodeToString()

Project: ant-ivy
Source File: ModuleRevisionIdTest.java
View license
public void testEncodeDecodeToString() {
    testEncodeDecodeToString(ModuleRevisionId.newInstance("org", "name", "revision"));
    testEncodeDecodeToString(ModuleRevisionId.newInstance("org", "name", ""));
    testEncodeDecodeToString(ModuleRevisionId.newInstance("org.jayasoft", "name-post", "1.0"));
    testEncodeDecodeToString(ModuleRevisionId.newInstance("org/jayasoft", "pre/name", "1.0-dev8/2"));
    Map extraAttributes = new HashMap();
    extraAttributes.put("extra", "extravalue");
    extraAttributes.put("att/name", "att/value");
    extraAttributes.put("att.name", "att.value");
    extraAttributes.put("att<name", "att<value");
    testEncodeDecodeToString(ModuleRevisionId.newInstance("org/jayasoft", "pre/name", "1.0-dev8/2", extraAttributes));
    extraAttributes.put("nullatt", null);
    testEncodeDecodeToString(ModuleRevisionId.newInstance("org/jayasoft", "pre/name", "1.0-dev8/2", extraAttributes));
}

63. DispatchXMessageDataSourceTests#testDataSourceWithTXTPlusTwoAttachments()

View license
@Test
public void testDataSourceWithTXTPlusTwoAttachments() throws Exception {
    Dispatch<DataSource> dispatch = getDispatch();
    Map attachments = new HashMap();
    Map requestContext = dispatch.getRequestContext();
    requestContext.put(MessageContext.OUTBOUND_MESSAGE_ATTACHMENTS, attachments);
    attachments.put(UIDGenerator.generateContentId(), new DataHandler(attachmentDS));
    attachments.put(UIDGenerator.generateContentId(), new DataHandler(imageDS));
    DataSource request = txtDS;
    DataSource response = dispatch.invoke(request);
    assertTrue(response != null);
    assertThat(response.getContentType()).isEqualTo("text/plain");
    String req = new String(getStreamAsByteArray(request.getInputStream()));
    String res = new String(getStreamAsByteArray(response.getInputStream()));
    assertEquals(req, res);
    Map attachments2 = (Map) dispatch.getResponseContext().get(MessageContext.INBOUND_MESSAGE_ATTACHMENTS);
    assertTrue(attachments2 != null);
    assertEquals(attachments2.size(), 2);
}

64. ScanCommand#execute()

Project: camel
Source File: ScanCommand.java
View license
@Override
public void execute() {
    ScanResult result = ddbClient.scan(new ScanRequest().withTableName(determineTableName()).withScanFilter(determineScanFilter()));
    Map tmp = new HashMap<>();
    tmp.put(DdbConstants.ITEMS, result.getItems());
    tmp.put(DdbConstants.LAST_EVALUATED_KEY, result.getLastEvaluatedKey());
    tmp.put(DdbConstants.CONSUMED_CAPACITY, result.getConsumedCapacity());
    tmp.put(DdbConstants.COUNT, result.getCount());
    tmp.put(DdbConstants.SCANNED_COUNT, result.getScannedCount());
    addToResults(tmp);
}

65. collection_writer_logic_constraints#getObjects()

View license
@Override
public ArrayList<Map> getObjects() {
    ArrayList<Map> objects = new ArrayList<>();
    Map nor = new LinkedHashMap();
    nor.put("type", "NOR");
    nor.put("max_instances", 5);
    ArrayList<Map> gate_type_constraints = new ArrayList<Map>();
    gate_type_constraints.add(nor);
    Map obj = new LinkedHashMap();
    obj.put("collection", "logic_constraints");
    obj.put("available_gates", gate_type_constraints);
    objects.add(obj);
    return objects;
}

66. collection_writer_measurement_std#getObjects()

View license
@Override
public ArrayList<Map> getObjects() {
    ArrayList<Map> objects = new ArrayList<>();
    ArrayList<String> plasmid_genbank = Util.fileLines(getRootPath() + "/resources/plasmids/pAN1717.ape");
    Map obj = new LinkedHashMap();
    obj.put("collection", "measurement_std");
    obj.put("signal_carrier_units", "RPU");
    obj.put("normalization_instructions", "The following equation converts the median YFP fluorescence to RPU.  RPU = (YFP  YFP0)/(YFPRPU  YFP0), where YFP is the median fluorescence of the cells of interest, YFP0 is the median autofluorescence, and YFPRPU is the median fluorescence of the cells containing the measurement standard plasmid");
    obj.put("plasmid_description", "p15A plasmid backbone with kanamycin resistance and a YFP expression cassette. Upstream isulation by terminator L3S3P21\n" + "and a 5-promoter spacer.  Promoter BBa_J23101, ribozyme RiboJ, RBS BBa_B0064 drives constitutive YFP expression, with transcriptional termination by L3S3P21.");
    obj.put("plasmid_sequence", plasmid_genbank);
    objects.add(obj);
    return objects;
}

67. collection_writer_measurement_std#getObjects()

View license
@Override
public ArrayList<Map> getObjects() {
    ArrayList<Map> objects = new ArrayList<>();
    ArrayList<String> plasmid_genbank = Util.fileLines("resources/plasmids/pAN1717.ape");
    String plasmid_genbank_string = "";
    for (String s : plasmid_genbank) {
        plasmid_genbank_string += s + "\n";
    }
    Map obj = new LinkedHashMap();
    obj.put("collection", "measurement_std");
    obj.put("signal_carrier_units", "RPU");
    obj.put("normalization_instructions", "The following equation converts the median YFP fluorescence to RPU.  RPU = (YFP  YFP0)/(YFPRPU  YFP0), where YFP is the median fluorescence of the cells of interest, YFP0 is the median autofluorescence, and YFPRPU is the median fluorescence of the cells containing the measurement standard plasmid");
    obj.put("plasmid_description", "p15A plasmid backbone with kanamycin resistance and a YFP expression cassette. Upstream isulation by terminator L3S3P21\n" + "and a 5-promoter spacer.  Promoter BBa_J23101, ribozyme RiboJ, RBS BBa_B0064 drives constitutive YFP expression, with transcriptional termination by L3S3P21.");
    obj.put("plasmid_sequence", plasmid_genbank);
    objects.add(obj);
    return objects;
}

68. collection_writer_measurement_std#getObjects()

View license
@Override
public ArrayList<Map> getObjects() {
    ArrayList<Map> objects = new ArrayList<>();
    ArrayList<String> plasmid_genbank = Util.fileLines("resources/plasmids/pAN1717.ape");
    String plasmid_genbank_string = "";
    for (String s : plasmid_genbank) {
        plasmid_genbank_string += s + "\n";
    }
    Map obj = new LinkedHashMap();
    obj.put("collection", "measurement_std");
    obj.put("signal_carrier_units", "RPU");
    obj.put("normalization_instructions", "The following equation converts the median YFP fluorescence to RPU.  RPU = (YFP  YFP0)/(YFPRPU  YFP0), where YFP is the median fluorescence of the cells of interest, YFP0 is the median autofluorescence, and YFPRPU is the median fluorescence of the cells containing the measurement standard plasmid");
    obj.put("plasmid_description", "p15A plasmid backbone with kanamycin resistance and a YFP expression cassette. Upstream isulation by terminator L3S3P21\n" + "and a 5-promoter spacer.  Promoter BBa_J23101, ribozyme RiboJ, RBS BBa_B0064 drives constitutive YFP expression, with transcriptional termination by L3S3P21.");
    obj.put("plasmid_sequence", plasmid_genbank);
    objects.add(obj);
    return objects;
}

69. collection_writer_logic_constraints#getObjects()

View license
@Override
public ArrayList<Map> getObjects() {
    ArrayList<Map> objects = new ArrayList<>();
    Map nor = new LinkedHashMap();
    nor.put("type", "NOT");
    nor.put("max_instances", 2);
    ArrayList<Map> gate_type_constraints = new ArrayList<Map>();
    gate_type_constraints.add(nor);
    Map obj = new LinkedHashMap();
    obj.put("collection", "logic_constraints");
    obj.put("available_gates", gate_type_constraints);
    objects.add(obj);
    return objects;
}

70. collection_writer_measurement_std#getObjects()

View license
@Override
public ArrayList<Map> getObjects() {
    ArrayList<Map> objects = new ArrayList<>();
    Map obj = new LinkedHashMap();
    obj.put("collection", "measurement_std");
    obj.put("signal_carrier_units", "RPU");
    obj.put("normalization_instructions", "");
    obj.put("plasmid_description", "");
    obj.put("plasmid_sequence", "");
    objects.add(obj);
    return objects;
}

71. UISystemProperties#getDebugData()

View license
/**
    * @see org.alfresco.web.ui.common.component.debug.BaseDebugComponent#getDebugData()
    */
@SuppressWarnings("unchecked")
public Map getDebugData() {
    // note: sort properties
    Map properties = new TreeMap();
    // add the jvm system properties
    Map systemProperties = System.getProperties();
    properties.putAll(systemProperties);
    // add heap size properties
    properties.put("heap.size", formatBytes(Runtime.getRuntime().totalMemory()));
    properties.put("heap.maxsize", formatBytes(Runtime.getRuntime().maxMemory()));
    properties.put("heap.free", formatBytes(Runtime.getRuntime().freeMemory()));
    return properties;
}

72. ScriptContent#executeScript()

Project: email-ext-plugin
Source File: ScriptContent.java
View license
/**
     * Executes a script and returns the last value as a String
     *
     * @param build the build to act on
     * @param scriptStream the script input stream
     * @return a String containing the toString of the last item in the script
     * @throws IOException
     */
private String executeScript(AbstractBuild<?, ?> build, TaskListener listener, InputStream scriptStream) throws IOException {
    String result = "";
    Map binding = new HashMap<>();
    ExtendedEmailPublisherDescriptor descriptor = Jenkins.getActiveInstance().getDescriptorByType(ExtendedEmailPublisherDescriptor.class);
    binding.put("build", build);
    binding.put("it", new ScriptContentBuildWrapper(build));
    binding.put("project", build.getParent());
    binding.put("rooturl", descriptor.getHudsonUrl());
    binding.put("logger", listener.getLogger());
    GroovyShell shell = createEngine(descriptor, binding);
    Object res = shell.evaluate(new InputStreamReader(scriptStream, descriptor.getCharset()));
    if (res != null) {
        result = res.toString();
    }
    return result;
}

73. ConfigContextTest#shouldGetTaskPluginAttributeMap()

Project: gocd
Source File: ConfigContextTest.java
View license
@Test
public void shouldGetTaskPluginAttributeMap() throws Exception {
    Map pluginAttributeMap = new HashMap();
    Map taskMap = new HashMap();
    taskMap.put("message", "hi");
    pluginAttributeMap.put("task", taskMap);
    pluginAttributeMap.put("nontask", "other");
    ConfigContext ctx = new ConfigContext(null, pluginAttributeMap);
    Map returnedTaskMap = ctx.getTaskPluginAttributeMap();
    assertFalse(returnedTaskMap.containsKey("nontask"));
    assertEquals(taskMap.get("message"), returnedTaskMap.get("message"));
}

74. JobInstanceSqlMapDao#findJobHistoryPage()

Project: gocd
Source File: JobInstanceSqlMapDao.java
View license
public JobInstances findJobHistoryPage(String pipelineName, String stageName, String jobConfigName, int count, int offset) {
    Map params = new HashMap();
    params.put("pipelineName", pipelineName);
    params.put("stageName", stageName);
    params.put("jobConfigName", jobConfigName);
    params.put("count", count);
    params.put("offset", offset);
    List<JobInstance> results = (List<JobInstance>) getSqlMapClientTemplate().queryForList("findJobHistoryPage", params);
    return new JobInstances(results);
}

75. RetainedWithTest#createMapChildren()

Project: j2objc
Source File: RetainedWithTest.java
View license
@AutoreleasePool
private void createMapChildren(MapFactory factory, List<Integer> objectCodes) {
    // Use separate maps for each of the views to ensure that each view type is strengthening its
    // reference to the map.
    Map m1 = factory.newMap();
    Map m2 = factory.newMap();
    Map m3 = factory.newMap();
    ValueType v = new ValueType();
    m1.put(factory.getKey(), v);
    m2.put(factory.getKey(), v);
    m3.put(factory.getKey(), v);
    keys = m1.keySet();
    values = m2.values();
    entrySet = m3.entrySet();
    objectCodes.add(System.identityHashCode(v));
}

76. DeepEqualityTest#simpleTest()

Project: ode
Source File: DeepEqualityTest.java
View license
@SuppressWarnings({ "rawtypes", "unchecked" })
@Test
public void simpleTest() throws Exception {
    Map m1 = new HashMap();
    QName n1 = new QName("localpart");
    URI u1 = new URI("urn://a/uri");
    m1.put(u1, n1);
    DebugInfo d1 = new DebugInfo("/a/path", 0, 1, m1);
    m1.put("cyclic", d1);
    Map m2 = new HashMap();
    QName n2 = new QName("localpart");
    URI u2 = new URI("urn://a/uri");
    m2.put(u2, n2);
    DebugInfo d2 = new DebugInfo("/a/path", 0, 1, m2);
    m2.put("cyclic", d2);
    DeepEqualityHelper de = new DeepEqualityHelper();
    de.addCustomComparator(new ExtensibeImplEqualityComp());
    assertEquals(Boolean.TRUE, de.deepEquals(m1, m2));
}

77. PactMultiProviderTest#doTest()

Project: pact-jvm
Source File: PactMultiProviderTest.java
View license
private void doTest(String path, String json) throws IOException {
    Assert.assertEquals(new ConsumerClient(mockTestProvider.getConfig().url()).options("/second"), 200);
    Map expectedResponse = new HashMap();
    expectedResponse.put("responsetest", true);
    expectedResponse.put("name", "harry");
    assertEquals(new ConsumerClient(mockTestProvider.getConfig().url()).getAsMap(path, ""), expectedResponse);
    Map expectedResponse2 = new HashMap();
    expectedResponse2.put("responsetest", true);
    expectedResponse2.put("name", "larry");
    assertEquals(new ConsumerClient(mockTestProvider2.getConfig().url()).putAsMap("/", json), expectedResponse2);
}

78. UriBuilderTest#testEncodedMapTest3()

Project: Resteasy
Source File: UriBuilderTest.java
View license
/**
    * from TCK 1.1
    */
@Test
public void testEncodedMapTest3() throws Exception {
    Map maps = new HashMap();
    maps.put("x", null);
    maps.put("y", "/path-absolute/test1");
    maps.put("z", "fred@example.com");
    maps.put("w", "path-rootless/test2");
    maps.put("u", "extra");
    String expected_path = "path-rootless/test2/x%yz//path-absolute/test1/fred@example.com/x%yz";
    try {
        URI uri = UriBuilder.fromPath("").path("{w}/{x}/{y}/{z}/{x}").buildFromEncodedMap(maps);
        throw new Exception("Test Failed: expected IllegalArgumentException not thrown");
    } catch (IllegalArgumentException ex) {
    }
}

79. UriBuilderTest#testEncodedMapTest4()

Project: Resteasy
Source File: UriBuilderTest.java
View license
@Test
public void testEncodedMapTest4() throws Exception {
    StringBuffer sb = new StringBuffer();
    boolean pass = true;
    URI uri;
    Map maps = new HashMap();
    maps.put("x", "x%yz");
    maps.put("y", "/path-absolute/test1");
    maps.put("z", "fred@example.com");
    maps.put("w", "path-rootless/test2");
    maps.put("u", "extra");
    String expected_path = "path-rootless/test2/x%yz//path-absolute/test1/fred@example.com/x%yz";
    try {
        uri = UriBuilder.fromPath("").path("{w}/{v}/{x}/{y}/{z}/{x}").buildFromEncodedMap(maps);
        throw new Exception("Test Failed: expected IllegalArgumentException not thrown");
    } catch (IllegalArgumentException ex) {
    }
}

80. UriBuilderTest#testBuildFromMapTest3()

Project: Resteasy
Source File: UriBuilderTest.java
View license
@Test
public void testBuildFromMapTest3() throws Exception {
    StringBuffer sb = new StringBuffer();
    boolean pass = true;
    URI uri;
    Map maps = new HashMap();
    maps.put("x", null);
    maps.put("y", "/path-absolute/test1");
    maps.put("z", "fred@example.com");
    maps.put("w", "path-rootless/test2");
    maps.put("u", "extra");
    String expected_path = "path-rootless/test2/x%yz//path-absolute/test1/fred@example.com/x%yz";
    try {
        uri = UriBuilder.fromPath("").path("{w}/{x}/{y}/{z}/{x}").buildFromMap(maps);
        throw new Exception("Test Failed: expected IllegalArgumentException not thrown");
    } catch (IllegalArgumentException ex) {
    }
}

81. UriBuilderTest#testBuildFromMapTest4()

Project: Resteasy
Source File: UriBuilderTest.java
View license
@Test
public void testBuildFromMapTest4() throws Exception {
    StringBuffer sb = new StringBuffer();
    boolean pass = true;
    URI uri;
    Map maps = new HashMap();
    maps.put("x", "x%yz");
    maps.put("y", "/path-absolute/test1");
    maps.put("z", "fred@example.com");
    maps.put("w", "path-rootless/test2");
    maps.put("u", "extra");
    String expected_path = "path-rootless/test2/x%yz//path-absolute/test1/fred@example.com/x%yz";
    try {
        uri = UriBuilder.fromPath("").path("{w}/{v}/{x}/{y}/{z}/{x}").buildFromMap(maps);
        throw new Exception("Test Failed: expected IllegalArgumentException not thrown");
    } catch (IllegalArgumentException ex) {
    }
}

82. TestDynaActionForm#setupComplexProperties()

Project: sonarqube
Source File: TestDynaActionForm.java
View license
// ------------------------------------------------------ Protected Methods
/**
     * Set up the complex properties that cannot be configured from the
     * initial value expression.
     */
protected void setupComplexProperties() {
    List listIndexed = new ArrayList();
    listIndexed.add("String 0");
    listIndexed.add("String 1");
    listIndexed.add("String 2");
    listIndexed.add("String 3");
    listIndexed.add("String 4");
    dynaForm.set("listIndexed", listIndexed);
    Map mappedProperty = new HashMap();
    mappedProperty.put("First Key", "First Value");
    mappedProperty.put("Second Key", "Second Value");
    dynaForm.set("mappedProperty", mappedProperty);
    Map mappedIntProperty = new HashMap();
    mappedIntProperty.put("One", new Integer(1));
    mappedIntProperty.put("Two", new Integer(2));
    dynaForm.set("mappedIntProperty", mappedIntProperty);
}

83. ChecksumFactory#safeCreate()

Project: spacewalk
Source File: ChecksumFactory.java
View license
/**
     * Lookup a checksum and if not exists, it is created.
     * @param hash to lookup Checksum for
     * @param hashType to lookup Checksum for
     * @return Checksum
     */
public static Checksum safeCreate(String hash, String hashType) {
    if (hash == null || hashType == null) {
        return null;
    }
    // Lookup existing or create new checksum
    CallableMode m = ModeFactory.getCallableMode("checksum_queries", "create_new_checksum");
    Map inParams = new HashMap();
    Map outParams = new HashMap();
    inParams.put("checksum_in", hash);
    inParams.put("checksum_type_in", hashType);
    //Outparam
    outParams.put("checksumId", new Integer(Types.NUMERIC));
    Map result = m.execute(inParams, outParams);
    Long checksumId = (Long) result.get("checksumId");
    if (checksumId == null) {
        throw new IllegalArgumentException("Unknown checksum type: " + hashType + ")");
    }
    return lookupById(checksumId);
}

84. ConfigurationManager#accessToObject()

Project: spacewalk
Source File: ConfigurationManager.java
View license
private boolean accessToObject(Long uid, String name, Long oid, String mode) {
    log.debug("accessToObject :: uid: " + uid + " name: " + name + " oid: " + oid + " mode: " + mode);
    CallableMode m = ModeFactory.getCallableMode("config_queries", mode);
    Map inParams = new HashMap();
    inParams.put("user_id", uid);
    inParams.put(name, oid);
    Map outParams = new HashMap();
    outParams.put("access", new Integer(Types.NUMERIC));
    Map result = m.execute(inParams, outParams);
    int access = ((Long) result.get("access")).intValue();
    return (access == 1);
}

85. XTile#getScriptSymbols()

Project: tapestry4
Source File: XTile.java
View license
public Map getScriptSymbols() {
    ILink link = getService().getLink(false, this);
    Map result = new HashMap();
    result.put("sendFunctionName", getSendName());
    result.put("receiveFunctionName", getReceiveName());
    result.put("errorFunctionName", getErrorName());
    result.put("disableCaching", getDisableCaching() ? "true" : null);
    result.put("url", link.getURL());
    return result;
}

86. ActionService#getLink()

Project: tapestry4
Source File: ActionService.java
View license
public ILink getLink(boolean post, Object parameter) {
    Defense.isAssignable(parameter, ActionServiceParameter.class, "parameter");
    ActionServiceParameter asp = (ActionServiceParameter) parameter;
    IComponent component = asp.getComponent();
    IPage activePage = _requestCycle.getPage();
    IPage componentPage = component.getPage();
    Map parameters = new HashMap();
    boolean stateful = _request.getSession(false) != null;
    parameters.put(ServiceConstants.COMPONENT, component.getIdPath());
    parameters.put(ServiceConstants.PAGE, activePage.getPageName());
    parameters.put(ServiceConstants.CONTAINER, activePage == componentPage ? null : componentPage.getPageName());
    parameters.put(ACTION, asp.getActionId());
    parameters.put(ServiceConstants.SESSION, stateful ? "T" : null);
    return _linkFactory.constructLink(this, post, parameters, true);
}

87. JdbcClientTest#setup()

View license
@Before
public void setup() {
    Map map = Maps.newHashMap();
    //com.mysql.jdbc.jdbc2.optional.MysqlDataSource
    map.put("dataSourceClassName", "org.hsqldb.jdbc.JDBCDataSource");
    //jdbc:mysql://localhost/test
    map.put("dataSource.url", "jdbc:hsqldb:mem:test");
    //root
    map.put("dataSource.user", "SA");
    //password
    map.put("dataSource.password", "");
    ConnectionProvider connectionProvider = new HikariCPConnectionProvider(map);
    connectionProvider.prepare();
    int queryTimeoutSecs = 60;
    this.client = new JdbcClient(connectionProvider, queryTimeoutSecs);
    client.executeSql("create table user_details (id integer, user_name varchar(100), created_timestamp TIMESTAMP)");
}

88. DispatchXMessageDataSourceTests#testDataSourceWithImagePlusAttachment()

View license
@Test
public void testDataSourceWithImagePlusAttachment() throws Exception {
    Dispatch<DataSource> dispatch = getDispatch();
    Map attachments = new HashMap();
    Map requestContext = dispatch.getRequestContext();
    requestContext.put(MessageContext.OUTBOUND_MESSAGE_ATTACHMENTS, attachments);
    attachments.put(UIDGenerator.generateContentId(), new DataHandler(attachmentDS));
    DataSource request = imageDS;
    DataSource response = dispatch.invoke(request);
    assertTrue(response != null);
    assertThat(response.getContentType()).isEqualTo("image/jpeg");
    assertTrue(Arrays.equals(getStreamAsByteArray(request.getInputStream()), getStreamAsByteArray(response.getInputStream())));
    Map attachments2 = (Map) dispatch.getResponseContext().get(MessageContext.INBOUND_MESSAGE_ATTACHMENTS);
    assertTrue(attachments2 != null);
    assertEquals(attachments2.size(), 1);
}

89. SimpleCrossFilter#getScriptParas()

Project: beetl2.0
Source File: SimpleCrossFilter.java
View license
protected Map getScriptParas(HttpServletRequest request, HttpServletResponse response) {
    Map map = new HashMap();
    Enumeration<String> attrs = request.getAttributeNames();
    while (attrs.hasMoreElements()) {
        String attrName = attrs.nextElement();
        map.put(attrName, request.getAttribute(attrName));
    }
    WebVariable webVariable = new WebVariable();
    webVariable.setRequest(request);
    webVariable.setResponse(response);
    webVariable.setSession(request.getSession());
    map.put("session", new SessionWrapper(request, webVariable.getSession()));
    map.put("servlet", webVariable);
    map.put("request", request);
    map.put("ctxPath", request.getContextPath());
    return map;
}

90. QueryCommand#execute()

Project: camel
Source File: QueryCommand.java
View license
@Override
public void execute() {
    QueryResult result = ddbClient.query(new QueryRequest().withTableName(determineTableName()).withAttributesToGet(determineAttributeNames()).withConsistentRead(determineConsistentRead()).withExclusiveStartKey(determineStartKey()).withKeyConditions(determineKeyConditions()).withExclusiveStartKey(determineStartKey()).withLimit(determineLimit()).withScanIndexForward(determineScanIndexForward()));
    Map tmp = new HashMap<>();
    tmp.put(DdbConstants.ITEMS, result.getItems());
    tmp.put(DdbConstants.LAST_EVALUATED_KEY, result.getLastEvaluatedKey());
    tmp.put(DdbConstants.CONSUMED_CAPACITY, result.getConsumedCapacity());
    tmp.put(DdbConstants.COUNT, result.getCount());
    addToResults(tmp);
}

91. YamlUpdater#setSeeds()

Project: CassJMeter
Source File: YamlUpdater.java
View license
@SuppressWarnings("unchecked")
public void setSeeds(Set<String> seeds) {
    List<?> seedp = (List) map.get("seed_provider");
    Map m = (Map) seedp.get(0);
    m.put("class_name", "org.apache.cassandra.locator.SimpleSeedProvider");
    List lst = Lists.newArrayList();
    Map map = new HashMap();
    map.put("seeds", StringUtils.join(seeds, ","));
    lst.add(map);
    m.put("parameters", lst);
}

92. RewriteAppenderTest#testMapPolicy()

Project: chainsaw
Source File: RewriteAppenderTest.java
View license
public void testMapPolicy() throws Exception {
    configure("map.xml");
    Logger logger = Logger.getLogger(RewriteAppenderTest.class);
    logger.info("Message 0");
    MDC.put("p1", "Hola");
    Map msg = new TreeMap();
    msg.put("p1", "Hello");
    msg.put("p2", "World");
    msg.put("x1", "Mundo");
    logger.info(msg);
    msg.put("message", "Message 1");
    logger.info(msg);
    assertTrue(Compare.compare(RewriteAppenderTest.class, "temp", "map.log"));
}

93. LiveFile#serialize()

Project: datacollector
Source File: LiveFile.java
View license
/**
   * Serializes the <code>LiveFile</code> as a string.
   *
   * @return the serialized string representation of the <code>LiveFile</code>.
   */
@SuppressWarnings("unchecked")
public String serialize() {
    Map map = new LinkedHashMap();
    map.put("path", path.toString());
    map.put("headHash", headHash);
    map.put("headLen", headLen);
    map.put("inode", iNode);
    try {
        return OBJECT_MAPPER.writeValueAsString(map);
    } catch (Exception ex) {
        throw new RuntimeException(Utils.format("Unexpected exception: {}", ex.toString()), ex);
    }
}

94. PlatformMetaSearchMessenger#listAllPopularTemplates()

View license
public static templateInfo[] listAllPopularTemplates(String extension_key, String fud) throws PlatformMessengerException {
    Map parameters = new HashMap();
    if (extension_key != null) {
        parameters.put("extension_key", extension_key);
    }
    parameters.put("fud", fud);
    parameters.put("page-num", new Long(1));
    parameters.put("items-per-page", new Long(MAX_TEMPLATE_LIST));
    Map reply = dispatcher.syncInvoke(OP_LIST_POPULAR_TEMPLATES, parameters);
    return (getTemplatesInfo(reply));
}

95. PlatformMetaSearchMessenger#listFeaturedTemplates()

View license
public static templateInfo[] listFeaturedTemplates(String extension_key, String fud) throws PlatformMessengerException {
    Map parameters = new HashMap();
    if (extension_key != null) {
        parameters.put("extension_key", extension_key);
    }
    parameters.put("fud", fud);
    parameters.put("page-num", new Long(1));
    parameters.put("items-per-page", new Long(MAX_TEMPLATE_LIST));
    Map reply = dispatcher.syncInvoke(OP_LIST_FEATURED_TEMPLATES, parameters);
    return (getTemplatesInfo(reply));
}

96. TestMapEventNested#getTestData()

Project: esper
Source File: TestMapEventNested.java
View license
private Map<String, Object> getTestData() {
    Map nestedNested = new HashMap<String, Object>();
    nestedNested.put("n1n1", "def");
    Map nested = new HashMap<String, Object>();
    nested.put("n1", "abc");
    nested.put("n2", nestedNested);
    Map<String, Object> map = new HashMap<String, Object>();
    map.put("nested", nested);
    return map;
}

97. ConfigureTest#testConfiguration()

Project: fabric8
Source File: ConfigureTest.java
View license
@Test
public void testConfiguration() throws Exception {
    ProjectConfig config = new ProjectConfig();
    config.setCodeReview(true);
    Map map = new HashMap();
    map.put("codeReview", false);
    ProjectConfigs.configureProperties(config, map);
    assertThat(config.getCodeReview()).describedAs("codeReview").isFalse();
    map.put("codeReview", "true");
    ProjectConfigs.configureProperties(config, map);
    assertThat(config.getCodeReview()).describedAs("codeReview").isTrue();
    map.put("codeReview", "false");
    ProjectConfigs.configureProperties(config, map);
    assertThat(config.getCodeReview()).describedAs("codeReview").isFalse();
    map.put("codeReview", true);
    ProjectConfigs.configureProperties(config, map);
    assertThat(config.getCodeReview()).describedAs("codeReview").isTrue();
}

98. MapConverterTest#fromNestedMap_shouldCreateString()

Project: fitnesse
Source File: MapConverterTest.java
View license
@Test
public void fromNestedMap_shouldCreateString() {
    Map nestedMap = new LinkedHashMap();
    nestedMap.put("a", null);
    nestedMap.put(Arrays.asList("b", "c", "d"), "listValue");
    nestedMap.put("listKey", Arrays.asList("e", "f"));
    nestedMap.put(null, true);
    String actual = converter.toString(nestedMap);
    // check without considering whitespace
    assertEquals("<table class=\"hash_table\"> <tr class=\"hash_row\"> <td class=\"hash_key\">a</td> <td class=\"hash_value\">null</td> </tr> <tr class=\"hash_row\"> <td class=\"hash_key\">[b, c, d]</td> <td class=\"hash_value\">listValue</td> </tr> <tr class=\"hash_row\"> <td class=\"hash_key\">listKey</td> <td class=\"hash_value\">[e, f]</td> </tr> <tr class=\"hash_row\"> <td class=\"hash_key\">null</td> <td class=\"hash_value\">true</td> </tr> </table>", actual.replaceAll("\\s+", " "));
}

99. EnterpriseNamingContextTest#testList()

View license
public void testList() throws Exception {
    Map map = new HashMap();
    map.put("one", new Integer(1));
    map.put("two", new Integer(2));
    map.put("three", new Integer(3));
    Context context = EnterpriseNamingContext.createEnterpriseNamingContext(map);
    Map result = toListResults(context.list(""));
    assertEquals(4, result.size());
    assertEquals(Integer.class.getName(), result.get("one"));
    assertEquals(Integer.class.getName(), result.get("two"));
    assertEquals(Integer.class.getName(), result.get("three"));
    assertNotNull(result.get("env"));
    result = toListBindingResults(context.listBindings(""));
    assertEquals(4, result.size());
    assertEquals(new Integer(1), result.get("one"));
    assertEquals(new Integer(2), result.get("two"));
    assertEquals(new Integer(3), result.get("three"));
    assertNotNull(result.get("env"));
}

100. GeronimoServerBehaviourDelegate#getServerConnection()

View license
public MBeanServerConnection getServerConnection() throws Exception {
    Map map = new HashMap();
    String user = getGeronimoServer().getAdminID();
    String password = getGeronimoServer().getAdminPassword();
    map.put("jmx.remote.credentials", new String[] { user, password });
    map.put("java.naming.factory.initial", "com.sun.jndi.rmi.registry.RegistryContextFactory");
    map.put("java.naming.factory.url.pkgs", "org.apache.geronimo.naming");
    map.put("java.naming.provider.url", "rmi://" + getServer().getHost() + ":1099");
    String url = getGeronimoServer().getJMXServiceURL();
    if (url != null) {
        try {
            JMXServiceURL address = new JMXServiceURL(url);
            JMXConnector jmxConnector = JMXConnectorFactory.connect(address, map);
            MBeanServerConnection connection = jmxConnector.getMBeanServerConnection();
            Trace.trace(Trace.INFO, "Connected to kernel. " + url);
            return connection;
        } catch (MalformedURLException e) {
            e.printStackTrace();
        }
    }
    return null;
}