Search in sources :

Example 86 with Enumeration

use of java.util.Enumeration in project XobotOS by xamarin.

the class LazyDERSequence method parse.

private void parse() {
    Enumeration en = new LazyDERConstructionEnumeration(encoded);
    while (en.hasMoreElements()) {
        addObject((DEREncodable) en.nextElement());
    }
    parsed = true;
}
Also used : Enumeration(java.util.Enumeration)

Example 87 with Enumeration

use of java.util.Enumeration in project hibernate-orm by hibernate.

the class LogHelper method logPersistenceUnitInformation.

public static void logPersistenceUnitInformation(PersistenceUnitDescriptor descriptor) {
    if (!log.isDebugEnabled()) {
        log.processingPersistenceUnitInfoName(descriptor.getName());
        return;
    }
    StringBuilder sb = new StringBuilder();
    sb.append("PersistenceUnitInfo [\n\t").append("name: ").append(descriptor.getName()).append("\n\t").append("persistence provider classname: ").append(descriptor.getProviderClassName()).append("\n\t").append("classloader: ").append(descriptor.getClassLoader()).append("\n\t").append("excludeUnlistedClasses: ").append(descriptor.isExcludeUnlistedClasses()).append("\n\t").append("JTA datasource: ").append(descriptor.getJtaDataSource()).append("\n\t").append("Non JTA datasource: ").append(descriptor.getNonJtaDataSource()).append("\n\t").append("Transaction type: ").append(descriptor.getTransactionType()).append("\n\t").append("PU root URL: ").append(descriptor.getPersistenceUnitRootUrl()).append("\n\t").append("Shared Cache Mode: ").append(descriptor.getSharedCacheMode()).append("\n\t").append("Validation Mode: ").append(descriptor.getValidationMode()).append("\n\t");
    sb.append("Jar files URLs [");
    List<URL> jarFileUrls = descriptor.getJarFileUrls();
    if (jarFileUrls != null) {
        for (URL url : jarFileUrls) {
            sb.append("\n\t\t").append(url);
        }
    }
    sb.append("]\n\t");
    sb.append("Managed classes names [");
    List<String> classNames = descriptor.getManagedClassNames();
    if (classNames != null) {
        for (String className : classNames) {
            sb.append("\n\t\t").append(className);
        }
    }
    sb.append("]\n\t");
    sb.append("Mapping files names [");
    List<String> mappingFiles = descriptor.getMappingFileNames();
    if (mappingFiles != null) {
        for (String file : mappingFiles) {
            sb.append("\n\t\t").append(file);
        }
    }
    sb.append("]\n\t");
    sb.append("Properties [");
    Properties properties = descriptor.getProperties();
    if (properties != null) {
        Enumeration names = properties.propertyNames();
        while (names.hasMoreElements()) {
            String name = (String) names.nextElement();
            sb.append("\n\t\t").append(name).append(": ").append(properties.getProperty(name));
        }
    }
    sb.append("]");
    log.debug(sb.toString());
}
Also used : Enumeration(java.util.Enumeration) Properties(java.util.Properties) URL(java.net.URL)

Example 88 with Enumeration

use of java.util.Enumeration in project powermock by powermock.

the class JUnit3TestSuiteChunkerImpl method tests.

public Enumeration<?> tests() {
    final List<Object> tests = new LinkedList<Object>();
    for (PowerMockJUnit3RunnerDelegate delegate : delegates) {
        final Enumeration<?> delegateTests = delegate.tests();
        while (delegateTests.hasMoreElements()) {
            tests.add(delegateTests.nextElement());
        }
    }
    Enumeration<?> allTests = new Enumeration<Object>() {

        private volatile int count = 0;

        public boolean hasMoreElements() {
            return count != tests.size();
        }

        public Object nextElement() {
            return tests.get(count++);
        }
    };
    return allTests;
}
Also used : Enumeration(java.util.Enumeration) PowerMockJUnit3RunnerDelegate(org.powermock.modules.junit3.internal.PowerMockJUnit3RunnerDelegate) LinkedList(java.util.LinkedList)

Example 89 with Enumeration

use of java.util.Enumeration in project camel by apache.

the class CamelKarafTestSupport method explode.

/*
    * Explode the dictionary into a ,-delimited list of key=value pairs
    */
private static String explode(Dictionary dictionary) {
    Enumeration keys = dictionary.keys();
    StringBuilder sb = new StringBuilder();
    while (keys.hasMoreElements()) {
        Object key = keys.nextElement();
        sb.append(String.format("%s=%s", key, dictionary.get(key)));
        if (keys.hasMoreElements()) {
            sb.append(", ");
        }
    }
    return sb.toString();
}
Also used : Enumeration(java.util.Enumeration)

Example 90 with Enumeration

use of java.util.Enumeration in project cassandra by apache.

the class CassandraXMLJUnitResultFormatter method startTestSuite.

/**
     * The whole testsuite started.
     * @param suite the testsuite.
     */
public void startTestSuite(final JUnitTest suite) {
    doc = getDocumentBuilder().newDocument();
    rootElement = doc.createElement(TESTSUITE);
    String n = suite.getName();
    //        if (n != null && !tag.isEmpty())
    //            n = n + "-" + tag;
    rootElement.setAttribute(ATTR_NAME, n == null ? UNKNOWN : n);
    //add the timestamp
    final String timestamp = DateUtils.format(new Date(), DateUtils.ISO8601_DATETIME_PATTERN);
    rootElement.setAttribute(TIMESTAMP, timestamp);
    //and the hostname.
    rootElement.setAttribute(HOSTNAME, getHostname());
    // Output properties
    final Element propsElement = doc.createElement(PROPERTIES);
    rootElement.appendChild(propsElement);
    final Properties props = suite.getProperties();
    if (props != null) {
        final Enumeration e = props.propertyNames();
        while (e.hasMoreElements()) {
            final String name = (String) e.nextElement();
            final Element propElement = doc.createElement(PROPERTY);
            propElement.setAttribute(ATTR_NAME, name);
            propElement.setAttribute(ATTR_VALUE, props.getProperty(name));
            propsElement.appendChild(propElement);
        }
    }
}
Also used : Enumeration(java.util.Enumeration) Element(org.w3c.dom.Element) Properties(java.util.Properties) Date(java.util.Date)

Aggregations

Enumeration (java.util.Enumeration)1418 IOException (java.io.IOException)247 ArrayList (java.util.ArrayList)183 File (java.io.File)122 Vector (java.util.Vector)98 Properties (java.util.Properties)97 HashMap (java.util.HashMap)96 List (java.util.List)89 URL (java.net.URL)74 HashSet (java.util.HashSet)71 Map (java.util.Map)71 Hashtable (java.util.Hashtable)70 Iterator (java.util.Iterator)70 Set (java.util.Set)67 InputStream (java.io.InputStream)62 ZipEntry (java.util.zip.ZipEntry)62 ServletContext (javax.servlet.ServletContext)55 ZipFile (java.util.zip.ZipFile)51 FileInputStream (java.io.FileInputStream)48 ServletException (javax.servlet.ServletException)46