@Test(expected = SailConfigException.class) public void testGetSailFail1() throws Exception { new HBaseSailFactory().getSail(new SailImplConfig() { @Override public String getType() { return "WrongType"; } @Override public long getIterationCacheSyncThreshold() { return 0; } @Override public void validate() throws SailConfigException { } @Override public Resource export(Model graph) { return null; } @Override public void parse(Model graph, Resource implNode) throws SailConfigException { } }); }
@Override public Sail getSail(SailImplConfig config) throws SailConfigException { if (!SAIL_TYPE.equals(config.getType())) { throw new SailConfigException("Invalid Sail type: " + config.getType()); } if (config instanceof HBaseSailConfig) { HBaseSailConfig hconfig = (HBaseSailConfig) config; HBaseSail sail = new HBaseSail(HBaseConfiguration.create(), hconfig.getTablespace(), hconfig.isCreate(), hconfig.getSplitBits(), hconfig.isPush(), hconfig.getEvaluationTimeout(), hconfig.getElasticIndexURL(), null); return sail; } else { throw new SailConfigException("Invalid configuration: " + config); } }
HBaseSailFactory implements SailFactory { @Override public Sail getSail(SailImplConfig config) throws SailConfigException { if (!SAIL_TYPE.equals(config.getType())) { throw new SailConfigException("Invalid Sail type: " + config.getType()); } if (config instanceof HBaseSailConfig) { HBaseSailConfig hconfig = (HBaseSailConfig) config; HBaseSail sail = new HBaseSail(HBaseConfiguration.create(), hconfig.getTablespace(), hconfig.isCreate(), hconfig.getSplitBits(), hconfig.isPush(), hconfig.getEvaluationTimeout(), hconfig.getElasticIndexURL(), null); return sail; } else { throw new SailConfigException("Invalid configuration: " + config); } } }
HBaseSailFactory implements SailFactory { @Override public Sail getSail(SailImplConfig config) throws SailConfigException { if (!SAIL_TYPE.equals(config.getType())) { throw new SailConfigException("Invalid Sail type: " + config.getType()); } if (config instanceof HBaseSailConfig) { HBaseSailConfig hconfig = (HBaseSailConfig) config; HBaseSail sail = new HBaseSail(HBaseConfiguration.create(), hconfig.getTablespace(), hconfig.isCreate(), hconfig.getSplitBits(), hconfig.isPush(), hconfig.getEvaluationTimeout(), hconfig.getElasticIndexURL(), null); return sail; } else { throw new SailConfigException("Invalid configuration: " + config); } }  }
HBaseSailFactory implements SailFactory { @Override public Sail getSail(SailImplConfig config) throws SailConfigException { if (!SAIL_TYPE.equals(config.getType())) { throw new SailConfigException("Invalid Sail type: " + config.getType()); } if (config instanceof HBaseSailConfig) { HBaseSailConfig hconfig = (HBaseSailConfig) config; HBaseSail sail = new HBaseSail(HBaseConfiguration.create(), hconfig.getTablespace(), hconfig.isCreate(), hconfig.getSplitBits(), hconfig.isPush(), hconfig.getEvaluationTimeout(), hconfig.getElasticIndexURL(), null); return sail; } else { throw new SailConfigException("Invalid configuration: " + config); } }  @Override String getSailType(); @Override SailImplConfig getConfig(); @Override Sail getSail(SailImplConfig config); }
HBaseSailFactory implements SailFactory { @Override public Sail getSail(SailImplConfig config) throws SailConfigException { if (!SAIL_TYPE.equals(config.getType())) { throw new SailConfigException("Invalid Sail type: " + config.getType()); } if (config instanceof HBaseSailConfig) { HBaseSailConfig hconfig = (HBaseSailConfig) config; HBaseSail sail = new HBaseSail(HBaseConfiguration.create(), hconfig.getTablespace(), hconfig.isCreate(), hconfig.getSplitBits(), hconfig.isPush(), hconfig.getEvaluationTimeout(), hconfig.getElasticIndexURL(), null); return sail; } else { throw new SailConfigException("Invalid configuration: " + config); } }  @Override String getSailType(); @Override SailImplConfig getConfig(); @Override Sail getSail(SailImplConfig config); static final String SAIL_TYPE; }