com.google.common.collect.ImmutableList#of ( )源码实例Demo

下面列出了com.google.common.collect.ImmutableList#of ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: batfish   文件: ElasticsearchDomainTest.java
public Map<String, Configuration> loadAwsConfigurations() throws IOException {
  List<String> awsFilenames =
      ImmutableList.of(
          "ElasticsearchDomains.json",
          "SecurityGroups.json",
          "Subnets.json",
          "Vpcs.json",
          "NetworkAcls.json",
          "NetworkInterfaces.json",
          "Reservations.json");
  Batfish batfish =
      BatfishTestUtils.getBatfishFromTestrigText(
          TestrigText.builder()
              .setAwsFiles("org/batfish/representation/aws/test", awsFilenames)
              .build(),
          _folder);
  return batfish.loadConfigurations(batfish.getSnapshot());
}
 
源代码2 项目: presto   文件: RealAverageAggregation.java
protected RealAverageAggregation()
{
    super(
            new FunctionMetadata(
                    new Signature(
                            NAME,
                            ImmutableList.of(),
                            ImmutableList.of(),
                            REAL.getTypeSignature(),
                            ImmutableList.of(REAL.getTypeSignature()),
                            false),
                    true,
                    ImmutableList.of(new FunctionArgumentDefinition(false)),
                    false,
                    true,
                    "Returns the average value of the argument",
                    AGGREGATE),
            true,
            false);
}
 
源代码3 项目: buck   文件: ExopackageInstallerIntegrationTest.java
@Test
public void testExoNativeInstall() throws Exception {
  currentBuildState =
      new ExoState(
          "apk-content\n",
          createFakeManifest("manifest-content\n"),
          ImmutableList.of(),
          ImmutableSortedMap.of(
              "libs/" + SdkConstants.ABI_INTEL_ATOM + "/libone.so", "x86-libone\n",
              "libs/" + SdkConstants.ABI_INTEL_ATOM + "/libtwo.so", "x86-libtwo\n",
              "libs/" + SdkConstants.ABI_ARMEABI_V7A + "/libone.so", "armv7-libone\n",
              "libs/" + SdkConstants.ABI_ARMEABI_V7A + "/libtwo.so", "armv7-libtwo\n"),
          ImmutableList.of(),
          ImmutableList.of());

  checkExoInstall(1, 0, 2, 0, 0);
  // This should be checked already, but do it explicitly here too to make it clear
  // that we actually verify that the correct architecture libs are installed.
  assertTrue(devicePathExists("native-libs/armeabi-v7a/metadata.txt"));
  assertFalse(devicePathExists("native-libs/x86/metadata.txt"));
}
 
源代码4 项目: presto   文件: TestEffectivePredicateExtractor.java
@Test
public void testInnerJoinPropagatesPredicatesViaEquiConditions()
{
    Map<Symbol, ColumnHandle> leftAssignments = Maps.filterKeys(scanAssignments, Predicates.in(ImmutableList.of(A, B, C)));
    TableScanNode leftScan = tableScanNode(leftAssignments);

    Map<Symbol, ColumnHandle> rightAssignments = Maps.filterKeys(scanAssignments, Predicates.in(ImmutableList.of(D, E, F)));
    TableScanNode rightScan = tableScanNode(rightAssignments);

    FilterNode left = filter(leftScan, equals(AE, bigintLiteral(10)));

    // predicates on "a" column should be propagated to output symbols via join equi conditions
    PlanNode node = new JoinNode(
            newId(),
            JoinNode.Type.INNER,
            left,
            rightScan,
            ImmutableList.of(new JoinNode.EquiJoinClause(A, D)),
            ImmutableList.of(),
            rightScan.getOutputSymbols(),
            Optional.empty(),
            Optional.empty(),
            Optional.empty(),
            Optional.empty(),
            Optional.empty(),
            ImmutableMap.of(),
            Optional.empty());

    Expression effectivePredicate = effectivePredicateExtractor.extract(SESSION, node, TypeProvider.empty(), typeAnalyzer);

    assertEquals(
            normalizeConjuncts(effectivePredicate),
            normalizeConjuncts(equals(DE, bigintLiteral(10))));
}
 
源代码5 项目: druid-api   文件: JsonConfiguratorTest.java
@JsonCreator
protected MappableObject(
    @JsonProperty("prop1") final String prop1,
    @JsonProperty("prop1List") final List<String> prop1List
)
{
  this.prop1 = prop1;
  this.prop1List = prop1List == null ? ImmutableList.<String>of() : prop1List;
}
 
源代码6 项目: supl-client   文件: ReferenceTime.java
public static Collection<Asn1Tag> getPossibleFirstTags() {
  if (TAG_ReferenceTime != null) {
    return ImmutableList.of(TAG_ReferenceTime);
  } else {
    return Asn1Sequence.getPossibleFirstTags();
  }
}
 
源代码7 项目: supl-client   文件: BT_MeasurementElement_r13.java
public static Collection<Asn1Tag> getPossibleFirstTags() {
  if (TAG_BT_MeasurementElement_r13 != null) {
    return ImmutableList.of(TAG_BT_MeasurementElement_r13);
  } else {
    return Asn1Sequence.getPossibleFirstTags();
  }
}
 
public static Collection<Asn1Tag> getPossibleFirstTags() {
  if (TAG_velocityRequestedType != null) {
    return ImmutableList.of(TAG_velocityRequestedType);
  } else {
    return Asn1Null.getPossibleFirstTags();
  }
}
 
源代码9 项目: presto   文件: RowIndeterminateOperator.java
private RowIndeterminateOperator()
{
    super(INDETERMINATE,
            ImmutableList.of(withVariadicBound("T", "row")),
            ImmutableList.of(),
            BOOLEAN.getTypeSignature(),
            ImmutableList.of(new TypeSignature("T")),
            false);
}
 
源代码10 项目: brooklyn-server   文件: ByonLocationResolverTest.java
@Test
public void testMachinesObtainedInOrder() throws Exception {
    List<String> ips = ImmutableList.of("1.1.1.1", "1.1.1.6", "1.1.1.3", "1.1.1.4", "1.1.1.5");
    String spec = "byon(hosts=\""+Joiner.on(",").join(ips)+"\")";
    
    MachineProvisioningLocation<MachineLocation> ll = resolve(spec);

    for (String expected : ips) {
        MachineLocation obtained = ll.obtain(ImmutableMap.of());
        assertEquals(obtained.getAddress().getHostAddress(), expected);
    }
}
 
public static Collection<Asn1Tag> getPossibleFirstTags() {
  if (TAG_horizontalSpeedType != null) {
    return ImmutableList.of(TAG_horizontalSpeedType);
  } else {
    return Asn1Integer.getPossibleFirstTags();
  }
}
 
protected Builder(SearchTermViewServiceStubSettings settings) {
  super(settings);

  getSearchTermViewSettings = settings.getSearchTermViewSettings.toBuilder();

  unaryMethodSettingsBuilders =
      ImmutableList.<UnaryCallSettings.Builder<?, ?>>of(getSearchTermViewSettings);
}
 
源代码13 项目: Bats   文件: RelOptTableImpl.java
@Override
public List<RelReferentialConstraint> getReferentialConstraints() {
    if (table != null) {
        return table.getStatistic().getReferentialConstraints();
    }
    return ImmutableList.of();
}
 
源代码14 项目: intellij   文件: SourceDirectoryCalculatorTest.java
@Test
public void testCompetingPackageDeclarationWithEqualCountsPicksDefault() {
  mockInputStreamProvider
      .addFile(
          "/root/java/com/google/Bla.java", "package com.google.different;\n public class Bla {}")
      .addFile("/root/java/com/google/Foo.java", "package com.google;\n public class Foo {}");
  List<SourceArtifact> sourceArtifacts =
      ImmutableList.of(
          SourceArtifact.builder(TargetKey.forPlainTarget(LABEL))
              .setArtifactLocation(
                  ArtifactLocation.builder()
                      .setRelativePath("java/com/google/Foo.java")
                      .setIsSource(true))
              .build(),
          SourceArtifact.builder(TargetKey.forPlainTarget(LABEL))
              .setArtifactLocation(
                  ArtifactLocation.builder()
                      .setRelativePath("java/com/google/Bla.java")
                      .setIsSource(true))
              .build());
  ImmutableList<BlazeContentEntry> result =
      sourceDirectoryCalculator.calculateContentEntries(
          project,
          context,
          workspaceRoot,
          decoder,
          buildImportRoots(
              ImmutableList.of(new WorkspacePath("java/com/google")), ImmutableList.of()),
          sourceArtifacts,
          NO_MANIFESTS);
  issues.assertNoIssues();
  assertThat(result)
      .containsExactly(
          BlazeContentEntry.builder("/root/java/com/google")
              .addSource(
                  BlazeSourceDirectory.builder("/root/java/com/google")
                      .setPackagePrefix("com.google")
                      .build())
              .build());
}
 
protected Builder(GroupPlacementViewServiceStubSettings settings) {
  super(settings);

  getGroupPlacementViewSettings = settings.getGroupPlacementViewSettings.toBuilder();

  unaryMethodSettingsBuilders =
      ImmutableList.<UnaryCallSettings.Builder<?, ?>>of(getGroupPlacementViewSettings);
}
 
源代码16 项目: heroic   文件: BackendKeyUtils.java
SchemaBoundStatement gteToken(final BackendKeyFilter.GTEToken clause) {
    return new SchemaBoundStatement(columnToken + " >= ?", ImmutableList.of(clause.getToken()));
}
 
源代码17 项目: datacollector   文件: TestSDCClassloader.java
@Test(expected = ExceptionInInitializerError.class)
public void testBringMultipleStageLibsToFront() throws Exception {
  List<URL> urls = ImmutableList.of(new URL("file:///tmp/bar-1.jar"), new URL("file:///tmp/bar-X-1.jar"));
  Assert.assertEquals(urls, SDCClassLoader.bringStageAndProtoLibsToFront("bar", urls));
}
 
@Test
public void noTestAppSpecified() {
  setProjectView(
      "directories:",
      "  java/com/foo/app",
      "targets:",
      "  //java/com/foo/app:instrumentation_test",
      "android_sdk_platform: android-27");
  MockSdkUtil.registerSdk(workspace, "27");

  workspace.createFile(
      new WorkspacePath("java/com/foo/app/MainActivity.java"),
      "package com.foo.app",
      "import android.app.Activity;",
      "public class MainActivity extends Activity {}");

  workspace.createFile(
      new WorkspacePath("java/com/foo/app/Test.java"),
      "package com.foo.app",
      "public class Test {}");

  setTargetMap(
      android_binary("//java/com/foo/app:app").src("MainActivity.java"),
      android_binary("//java/com/foo/app:test_app")
          .src("Test.java")
          .instruments("//java/com/foo/app:app"),
      android_instrumentation_test("//java/com/foo/app:instrumentation_test"));
  runFullBlazeSync();

  MessageCollector messageCollector = new MessageCollector();
  BlazeContext context = new BlazeContext();
  context.addOutputSink(IssueOutput.class, messageCollector);

  BlazeInstrumentationTestApkBuildStep buildStep =
      new BlazeInstrumentationTestApkBuildStep(
          getProject(),
          Label.create("//java/com/foo/app:instrumentation_test"),
          ImmutableList.of());
  InstrumentorToTarget pair =
      buildStep.getInstrumentorToTargetPair(
          context, BlazeProjectDataManager.getInstance(getProject()).getBlazeProjectData());

  assertThat(pair).isNull();
  assertThat(messageCollector.getMessages()).hasSize(1);
  assertThat(messageCollector.getMessages().get(0))
      .contains(
          "No \"test_app\" in target definition for //java/com/foo/app:instrumentation_test.");
}
 
源代码19 项目: bazel   文件: CoreRules.java
@Override
public ImmutableList<RuleSet> requires() {
  return ImmutableList.of();
}
 
源代码20 项目: buck   文件: WindowsMl64Compiler.java
@Override
public ImmutableList<String> outputDependenciesArgs(String outputPath) {
  return ImmutableList.of();
}