public void start() { Duration[] defaultLatchIntervals = {Duration.apply(1, TimeUnit.MINUTES)}; @SuppressWarnings("deprecation") AdminServiceFactory adminServiceFactory = new AdminServiceFactory( this.mPort, 20, List$.MODULE$.<StatsFactory>empty(), Option.<String>empty(), List$.MODULE$.<Regex>empty(), Map$.MODULE$.<String, CustomHttpHandler>empty(), JavaConversions .asScalaBuffer(Arrays.asList(defaultLatchIntervals)).toList() ); RuntimeEnvironment runtimeEnvironment = new RuntimeEnvironment(this); adminServiceFactory.apply(runtimeEnvironment); try { Properties properties = new Properties(); properties.load(this.getClass().getResource("build.properties").openStream()); String buildRevision = properties.getProperty("build_revision", "unknown"); LOG.info("build.properties build_revision: {}", properties.getProperty("build_revision", "unknown")); StatsUtil.setLabel("secor.build_revision", buildRevision); } catch (Throwable t) { LOG.error("Failed to load properties from build.properties", t); } } }
@Test public void scalaSparkContext() { List<String> jars = List$.MODULE$.empty(); Map<String, String> environment = Map$.MODULE$.empty(); new SparkContext(new SparkConf().setMaster("local").setAppName("name")).stop(); new SparkContext("local", "name", new SparkConf()).stop(); new SparkContext("local", "name").stop(); new SparkContext("local", "name", "sparkHome").stop(); new SparkContext("local", "name", "sparkHome", jars).stop(); new SparkContext("local", "name", "sparkHome", jars, environment).stop(); } }
@Test public void scalaSparkContext() { List<String> jars = List$.MODULE$.empty(); Map<String, String> environment = Map$.MODULE$.empty(); new SparkContext(new SparkConf().setMaster("local").setAppName("name")).stop(); new SparkContext("local", "name", new SparkConf()).stop(); new SparkContext("local", "name").stop(); new SparkContext("local", "name", "sparkHome").stop(); new SparkContext("local", "name", "sparkHome", jars).stop(); new SparkContext("local", "name", "sparkHome", jars, environment).stop(); } }
public void invokeAction(final String command, final Lookup context) throws IllegalArgumentException { if (COMMAND_SCALA_CONSOLE.equals(command)) { scala.collection.immutable.List<String> nil = scala.collection.immutable.List$.MODULE$.empty(); ScalaConsoleTopComponent.openInstance(project, nil, false, null); return;
public void startAdminHttpService() { try { Properties properties = new Properties(); properties.load(this.getClass().getResource("build.properties").openStream()); LOG.info("build.properties build_revision: {}", properties.getProperty("build_revision", "unknown")); } catch (Throwable t) { LOG.warn("Failed to load properties from build.properties", t); } Duration[] defaultLatchIntervals = {Duration.apply(1, TimeUnit.MINUTES)}; Iterator<Duration> durationIterator = Arrays.asList(defaultLatchIntervals).iterator(); @SuppressWarnings("deprecation") AdminServiceFactory adminServiceFactory = new AdminServiceFactory( this.port, 20, List$.MODULE$.empty(), Option.empty(), List$.MODULE$.empty(), Map$.MODULE$.empty(), JavaConversions.asScalaIterator(durationIterator).toList()); RuntimeEnvironment runtimeEnvironment = new RuntimeEnvironment(this); AdminHttpService service = adminServiceFactory.apply(runtimeEnvironment); for (Map.Entry<String, CustomHttpHandler> entry : this.customHttpHandlerMap.entrySet()) { service.httpServer().createContext(entry.getKey(), entry.getValue()); } }
/** * Create a test OData URI specifying the service root, entity set name * and the list of named expand path segments ($expand operation). * * @param serviceRoot The service root. * @param entitySetName The entity set name. * @param expandPathNames The list of named expand path segments. * @return The created test OData URI. */ public static ODataUri createODataUri(String serviceRoot, String entitySetName, String... expandPathNames) { scala.Option<String> none = scala.Option.apply(null); List<ExpandItem> expandItems = new ArrayList<>(); for (String expandPathName : expandPathNames) { ExpandPathSegment path = new NavigationPropertyExpandPathSegment(expandPathName, none); expandItems.add(new PathExpandItem(none, path, scala.collection.immutable.List$.MODULE$.empty())); } ExpandOption expandOption = new ExpandOption(asScalaList(expandItems)); List<QueryOption> queryOptions = new ArrayList<>(); queryOptions.add(expandOption); EntitySetPath entitySetPath = new EntitySetPath(entitySetName, null); ResourcePathUri resourcePathUri = new ResourcePathUri(entitySetPath, asScalaList(queryOptions)); return new ODataUri(serviceRoot, resourcePathUri); }
public void startAdminHttpService() { try { Properties properties = new Properties(); properties.load(this.getClass().getResource("build.properties").openStream()); LOG.info("build.properties build_revision: {}", properties.getProperty("build_revision", "unknown")); } catch (Throwable t) { LOG.warn("Failed to load properties from build.properties", t); } Duration[] defaultLatchIntervals = {Duration.apply(1, TimeUnit.MINUTES)}; Iterator<Duration> durationIterator = Arrays.asList(defaultLatchIntervals).iterator(); @SuppressWarnings("deprecation") AdminServiceFactory adminServiceFactory = new AdminServiceFactory( this.port, 20, List$.MODULE$.empty(), Option.empty(), List$.MODULE$.empty(), Map$.MODULE$.empty(), JavaConversions.asScalaIterator(durationIterator).toList()); RuntimeEnvironment runtimeEnvironment = new RuntimeEnvironment(this); AdminHttpService service = adminServiceFactory.apply(runtimeEnvironment); for (Map.Entry<String, CustomHttpHandler> entry : this.customHttpHandlerMap.entrySet()) { service.httpServer().createContext(entry.getKey(), entry.getValue()); } }
/** * Get the referenced entity for a given 'resource path' (entity id) and a 'property name'. * * @param entityIdResourcePath The given 'resource path' (entity id). * @param propertyName The given 'property name'. * @return The referenced entity. * @throws ODataException if unable to determine referenced entity */ protected Object getReferencedEntity(String entityIdResourcePath, String propertyName) throws ODataException { LOG.debug("getReferencedEntity: {}", entityIdResourcePath); ResourcePath resourcePath = uriParser.parseResourcePath(entityIdResourcePath, entityDataModel); ODataUri referencedEntityUri = new ODataUri("", new ResourcePathUri(resourcePath, List$.MODULE$.<QueryOption>empty())); Option<Object> opt = extractEntityWithKeys(referencedEntityUri, entityDataModel); if (!opt.isDefined()) { throw new ODataUnmarshallingException("Cannot determine referenced entity for navigation link " + "for property: " + propertyName + ", href=\"" + entityIdResourcePath + "\""); } return opt.get(); }
/** * Create a test OData URI specifying the service root, entity set name * and the list of named expand path segments ($expand operation). * * @param serviceRoot The service root. * @param entitySetName The entity set name. * @param expandPathNames The list of named expand path segments. * @return The created test OData URI. */ public static ODataUri createODataUri(String serviceRoot, String entitySetName, String... expandPathNames) { scala.Option<String> none = scala.Option.apply(null); List<ExpandItem> expandItems = new ArrayList<>(); for (String expandPathName : expandPathNames) { ExpandPathSegment path = new NavigationPropertyExpandPathSegment(expandPathName, none); expandItems.add(new PathExpandItem(none, path, scala.collection.immutable.List$.MODULE$.empty())); } ExpandOption expandOption = new ExpandOption(asScalaList(expandItems)); List<QueryOption> queryOptions = new ArrayList<>(); queryOptions.add(expandOption); EntitySetPath entitySetPath = new EntitySetPath(entitySetName, null); ResourcePathUri resourcePathUri = new ResourcePathUri(entitySetPath, asScalaList(queryOptions)); return new ODataUri(serviceRoot, resourcePathUri); }
/** * Get the referenced entity for a given 'resource path' (entity id) and a 'property name'. * * @param entityIdResourcePath The given 'resource path' (entity id). * @param propertyName The given 'property name'. * @return The referenced entity. * @throws ODataException if unable to determine referenced entity */ protected Object getReferencedEntity(String entityIdResourcePath, String propertyName) throws ODataException { LOG.debug("getReferencedEntity: {}", entityIdResourcePath); ResourcePath resourcePath = uriParser.parseResourcePath(entityIdResourcePath, entityDataModel); ODataUri referencedEntityUri = new ODataUri("", new ResourcePathUri(resourcePath, List$.MODULE$.<QueryOption>empty())); Option<Object> opt = extractEntityWithKeys(referencedEntityUri, entityDataModel); if (!opt.isDefined()) { throw new ODataUnmarshallingException("Cannot determine referenced entity for navigation link " + "for property: " + propertyName + ", href=\"" + entityIdResourcePath + "\""); } return opt.get(); }
public void start() { Duration[] defaultLatchIntervals = {Duration.apply(1, TimeUnit.MINUTES)}; @SuppressWarnings("deprecation") AdminServiceFactory adminServiceFactory = new AdminServiceFactory( this.mPort, 20, List$.MODULE$.<StatsFactory>empty(), Option.<String>empty(), List$.MODULE$.<Regex>empty(), Map$.MODULE$.<String, CustomHttpHandler>empty(), List.<Duration>fromArray(defaultLatchIntervals)); RuntimeEnvironment runtimeEnvironment = new RuntimeEnvironment(this); AdminHttpService service = adminServiceFactory.apply(runtimeEnvironment); for (Map.Entry<String, CustomHttpHandler> entry : this.mCustomHttpHandlerMap.entrySet()) { service.httpServer().createContext(entry.getKey(), entry.getValue()); } } }
private static <T> List<T> emptyList() { return List$.MODULE$.empty(); }
@Before public void setup() { reportCriteriaService = new ReportCriteriaServiceImpl(reportAggregatedDAO, customerAndProjectCriteriaFilter, userAndDepartmentCriteriaFilter, individualUserCriteriaSync, timesheetLockService, userDao, projectDao); when(timesheetLockService.findAll()).thenReturn(List$.MODULE$.<TimesheetLock>empty()); }
private static List<Duration> list(Duration ... ts) { List<Duration> result = List$.MODULE$.empty(); for (int i = ts.length; i > 0; i--) { result = new $colon$colon<>(ts[i - 1], result); } return result; }