use of com.mesosphere.sdk.dcos.ResourceRefinementCapabilityContext in project dcos-commons by mesosphere.
the class ResourceBuilderTest method testFromExistingScalarResource.
@Test
public void testFromExistingScalarResource() {
testFromExistingScalarResource(Optional.empty());
testFromExistingScalarResource(Optional.of("baz"));
ResourceRefinementCapabilityContext context = new ResourceRefinementCapabilityContext(Capabilities.getInstance());
try {
testFromExistingScalarResource(Optional.empty());
testFromExistingScalarResource(Optional.of("baz"));
} finally {
context.reset();
}
}
use of com.mesosphere.sdk.dcos.ResourceRefinementCapabilityContext in project dcos-commons by mesosphere.
the class ResourceBuilderTest method testExistingFromResourceSpec.
@Test
public void testExistingFromResourceSpec() {
testExistingFromResourceSpec(Optional.empty());
testExistingFromResourceSpec(Optional.of("bar"));
ResourceRefinementCapabilityContext context = new ResourceRefinementCapabilityContext(Capabilities.getInstance());
try {
testExistingFromResourceSpec(Optional.empty());
testExistingFromResourceSpec(Optional.of("bar"));
} finally {
context.reset();
}
}
use of com.mesosphere.sdk.dcos.ResourceRefinementCapabilityContext in project dcos-commons by mesosphere.
the class ResourceBuilderTest method testNewFromResourceSpec.
/*
name: "cpus"
type: SCALAR
scalar {
value: 1.0
}
role: "*"
reservations {
principal: "test-principal"
labels {
labels {
key: "resource_id"
value: "e9edd178-f7dd-4472-b58b-3a3ff7ed51ac"
}
}
role: "test-role"
}
*/
@Test
public void testNewFromResourceSpec() {
testNewFromResourceSpec(Optional.empty());
testNewFromResourceSpec(Optional.of("/path/to/namespace"));
ResourceRefinementCapabilityContext context = new ResourceRefinementCapabilityContext(Capabilities.getInstance());
try {
testNewFromResourceSpec(Optional.empty());
testNewFromResourceSpec(Optional.of("/path/to/namespace"));
} finally {
context.reset();
}
}
use of com.mesosphere.sdk.dcos.ResourceRefinementCapabilityContext in project dcos-commons by mesosphere.
the class DefaultCapabilitiesTestSuite method beforeAllSuites.
@BeforeClass
public static final void beforeAllSuites() throws Exception {
Capabilities capabilities = mock(Capabilities.class);
when(capabilities.supportsGpuResource()).thenReturn(true);
when(capabilities.supportsCNINetworking()).thenReturn(true);
when(capabilities.supportsNamedVips()).thenReturn(true);
when(capabilities.supportsRLimits()).thenReturn(true);
when(capabilities.supportsPreReservedResources()).thenReturn(true);
when(capabilities.supportsFileBasedSecrets()).thenReturn(true);
when(capabilities.supportsEnvBasedSecretsProtobuf()).thenReturn(true);
when(capabilities.supportsEnvBasedSecretsDirectiveLabel()).thenReturn(true);
context = new ResourceRefinementCapabilityContext(capabilities);
}
use of com.mesosphere.sdk.dcos.ResourceRefinementCapabilityContext in project dcos-commons by mesosphere.
the class ResourceBuilderTest method testExistingFromRootVolumeSpec.
@Test
public void testExistingFromRootVolumeSpec() {
testExistingFromRootVolumeSpec(Optional.empty());
testExistingFromRootVolumeSpec(Optional.of("/path/to/namespace"));
ResourceRefinementCapabilityContext context = new ResourceRefinementCapabilityContext(Capabilities.getInstance());
try {
testExistingFromRootVolumeSpec(Optional.empty());
testExistingFromRootVolumeSpec(Optional.of("/path/to/namespace"));
} finally {
context.reset();
}
}
Aggregations