Search in sources :

Example 1 with GobblinScopeInstance

use of org.apache.gobblin.broker.gobblin_scopes.GobblinScopeInstance in project incubator-gobblin by apache.

the class GobblinBrokerCreationTest method testFailIfSubBrokerAtHigherScope.

@Test
public void testFailIfSubBrokerAtHigherScope() throws Exception {
    Config config = ConfigFactory.empty();
    SharedResourcesBrokerImpl<GobblinScopeTypes> topBroker = SharedResourcesBrokerFactory.createDefaultTopLevelBroker(config, GobblinScopeTypes.GLOBAL.defaultScopeInstance());
    SharedResourcesBrokerImpl<GobblinScopeTypes> jobBroker = topBroker.newSubscopedBuilder(new JobScopeInstance("myJob", "job123")).build();
    try {
        jobBroker.newSubscopedBuilder(new GobblinScopeInstance(GobblinScopeTypes.INSTANCE, "instance")).build();
        Assert.fail();
    } catch (IllegalArgumentException iae) {
    // expected
    }
}
Also used : GobblinScopeTypes(org.apache.gobblin.broker.gobblin_scopes.GobblinScopeTypes) GobblinScopeInstance(org.apache.gobblin.broker.gobblin_scopes.GobblinScopeInstance) JobScopeInstance(org.apache.gobblin.broker.gobblin_scopes.JobScopeInstance) Config(com.typesafe.config.Config) Test(org.testng.annotations.Test)

Aggregations

Config (com.typesafe.config.Config)1 GobblinScopeInstance (org.apache.gobblin.broker.gobblin_scopes.GobblinScopeInstance)1 GobblinScopeTypes (org.apache.gobblin.broker.gobblin_scopes.GobblinScopeTypes)1 JobScopeInstance (org.apache.gobblin.broker.gobblin_scopes.JobScopeInstance)1 Test (org.testng.annotations.Test)1