@Test (dependsOnMethods = "testAddSpec") public void testGetSpec() throws Exception { FlowSpec result = (FlowSpec) this.specStore.getSpec(this.uri1); Assert.assertEquals(result, this.flowSpec1); Collection<Spec> specs = this.specStore.getSpecs(); Assert.assertEquals(specs.size(), 2); Assert.assertTrue(specs.contains(this.flowSpec1)); Assert.assertTrue(specs.contains(this.flowSpec2)); Iterator<URI> uris = this.specStore.getSpecURIs(); Assert.assertTrue(Iterators.contains(uris, this.uri1)); Assert.assertTrue(Iterators.contains(uris, this.uri2)); FlowSpecSearchObject flowSpecSearchObject = FlowSpecSearchObject.builder().flowGroup("fg1").build(); specs = this.specStore.getSpecs(flowSpecSearchObject); Assert.assertEquals(specs.size(), 1); Assert.assertTrue(specs.contains(this.flowSpec1)); flowSpecSearchObject = FlowSpecSearchObject.builder().flowName("fn2").build(); specs = this.specStore.getSpecs(flowSpecSearchObject); Assert.assertEquals(specs.size(), 1); Assert.assertTrue(specs.contains(this.flowSpec2)); flowSpecSearchObject = FlowSpecSearchObject.builder().flowName("fg1").flowGroup("fn2").build(); specs = this.specStore.getSpecs(flowSpecSearchObject); Assert.assertEquals(specs.size(), 0); flowSpecSearchObject = FlowSpecSearchObject.builder().propertyFilter("key=value").build(); specs = this.specStore.getSpecs(flowSpecSearchObject); Assert.assertEquals(specs.size(), 1); Assert.assertTrue(specs.contains(this.flowSpec1)); flowSpecSearchObject = FlowSpecSearchObject.builder().propertyFilter("converter=value2").build(); specs = this.specStore.getSpecs(flowSpecSearchObject); Assert.assertEquals(specs.size(), 1); Assert.assertTrue(specs.contains(this.flowSpec2)); flowSpecSearchObject = FlowSpecSearchObject.builder().propertyFilter("key3").build(); specs = this.specStore.getSpecs(flowSpecSearchObject); Assert.assertEquals(specs.size(), 2); Assert.assertTrue(specs.contains(this.flowSpec1)); Assert.assertTrue(specs.contains(this.flowSpec2)); flowSpecSearchObject = FlowSpecSearchObject.builder().propertyFilter("config.with.dot=value4").build(); specs = this.specStore.getSpecs(flowSpecSearchObject); Assert.assertEquals(specs.size(), 1); Assert.assertTrue(specs.contains(this.flowSpec1)); }
@Override public Spec getSpec(URI specUri, String version) throws IOException, SpecNotFoundException { return getSpec(specUri); }
MysqlSpecStore extends InstrumentedSpecStore { @Override public Spec getSpec(URI specUri, String version) throws IOException, SpecNotFoundException { return getSpec(specUri); } }
MysqlSpecStore extends InstrumentedSpecStore { @Override public Spec getSpec(URI specUri, String version) throws IOException, SpecNotFoundException { return getSpec(specUri); } MysqlSpecStore(Config config, SpecSerDe specSerDe); }
MysqlSpecStore extends InstrumentedSpecStore { @Override public Spec getSpec(URI specUri, String version) throws IOException, SpecNotFoundException { return getSpec(specUri); } MysqlSpecStore(Config config, SpecSerDe specSerDe); @Override boolean existsImpl(URI specUri); @Override void addSpecImpl(Spec spec); void addSpec(Spec spec, String tagValue); @Override boolean deleteSpec(Spec spec); @Override boolean deleteSpecImpl(URI specUri); @Override boolean deleteSpec(URI specUri, String version); @Override // TODO : this method is not doing what the contract is in the SpecStore interface Spec updateSpecImpl(Spec spec); @Override Spec getSpecImpl(URI specUri); Collection<Spec> getSpecsImpl(SpecSearchObject specSearchObject); @Override Spec getSpec(URI specUri, String version); @Override Collection<Spec> getAllVersionsOfSpec(URI specUri); @Override Collection<Spec> getSpecsImpl(); @Override Iterator<URI> getSpecURIsImpl(); @Override Iterator<URI> getSpecURIsWithTag(String tag); @Override Optional<URI> getSpecStoreURI(); }
MysqlSpecStore extends InstrumentedSpecStore { @Override public Spec getSpec(URI specUri, String version) throws IOException, SpecNotFoundException { return getSpec(specUri); } MysqlSpecStore(Config config, SpecSerDe specSerDe); @Override boolean existsImpl(URI specUri); @Override void addSpecImpl(Spec spec); void addSpec(Spec spec, String tagValue); @Override boolean deleteSpec(Spec spec); @Override boolean deleteSpecImpl(URI specUri); @Override boolean deleteSpec(URI specUri, String version); @Override // TODO : this method is not doing what the contract is in the SpecStore interface Spec updateSpecImpl(Spec spec); @Override Spec getSpecImpl(URI specUri); Collection<Spec> getSpecsImpl(SpecSearchObject specSearchObject); @Override Spec getSpec(URI specUri, String version); @Override Collection<Spec> getAllVersionsOfSpec(URI specUri); @Override Collection<Spec> getSpecsImpl(); @Override Iterator<URI> getSpecURIsImpl(); @Override Iterator<URI> getSpecURIsWithTag(String tag); @Override Optional<URI> getSpecStoreURI(); static final String CONFIG_PREFIX; static final String DEFAULT_TAG_VALUE; }