-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
352 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
ff4j-spring-services/src/test/resources/applicationContext-test.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
#%L | ||
ff4j-store-jdbc | ||
%% | ||
Copyright (C) 2013 Ff4J | ||
%% | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
#L% | ||
--> | ||
|
||
<beans xmlns="http://www.springframework.org/schema/beans" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xmlns:context="http://www.springframework.org/schema/context" | ||
xmlns:util="http://www.springframework.org/schema/util" | ||
xmlns:jdbc="http://www.springframework.org/schema/jdbc" | ||
xmlns:tx="http://www.springframework.org/schema/tx" | ||
xmlns:p="http://www.springframework.org/schema/p" | ||
xsi:schemaLocation=" | ||
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd | ||
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd | ||
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd | ||
http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc.xsd | ||
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd" > | ||
|
||
<bean id="ff4j" class="org.ff4j.FF4j"> | ||
<constructor-arg index="0" type="java.lang.String" value="classpath:ff4j.xml"/> | ||
</bean> | ||
|
||
</beans> | ||
|
113 changes: 113 additions & 0 deletions
113
ff4j-store-ehcache/src/main/java/org/ff4j/store/EventRepositoryEhCache.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
package org.ff4j.store; | ||
|
||
/* | ||
* #%L | ||
* ff4j-store-ehcache | ||
* %% | ||
* Copyright (C) 2013 - 2017 FF4J | ||
* %% | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* #L% | ||
*/ | ||
|
||
import java.util.Map; | ||
import java.util.concurrent.TimeUnit; | ||
|
||
import org.ff4j.audit.Event; | ||
import org.ff4j.audit.EventQueryDefinition; | ||
import org.ff4j.audit.EventSeries; | ||
import org.ff4j.audit.MutableHitCount; | ||
import org.ff4j.audit.chart.TimeSeriesChart; | ||
import org.ff4j.audit.repository.AbstractEventRepository; | ||
import org.ff4j.audit.repository.EventRepository; | ||
|
||
/** | ||
* Provides implementation of {@link EventRepository} working with EHCACHE storage. | ||
* | ||
* @author Cedrick LUNVEN (@clunven) | ||
*/ | ||
public class EventRepositoryEhCache extends AbstractEventRepository { | ||
|
||
/** {@inheritDoc} */ | ||
@Override | ||
public boolean saveEvent(Event e) { | ||
return false; | ||
} | ||
|
||
/** {@inheritDoc} */ | ||
@Override | ||
public Event getEventByUUID(String uuid, Long timestamp) { | ||
return null; | ||
} | ||
|
||
@Override | ||
public Map<String, MutableHitCount> getFeatureUsageHitCount(EventQueryDefinition query) { | ||
// TODO Auto-generated method stub | ||
return null; | ||
} | ||
|
||
@Override | ||
public TimeSeriesChart getFeatureUsageHistory(EventQueryDefinition query, TimeUnit tu) { | ||
// TODO Auto-generated method stub | ||
return null; | ||
} | ||
|
||
@Override | ||
public EventSeries searchFeatureUsageEvents(EventQueryDefinition query) { | ||
// TODO Auto-generated method stub | ||
return null; | ||
} | ||
|
||
@Override | ||
public void purgeFeatureUsage(EventQueryDefinition query) { | ||
// TODO Auto-generated method stub | ||
|
||
} | ||
|
||
@Override | ||
public Map<String, MutableHitCount> getHostHitCount(EventQueryDefinition query) { | ||
// TODO Auto-generated method stub | ||
return null; | ||
} | ||
|
||
@Override | ||
public Map<String, MutableHitCount> getUserHitCount(EventQueryDefinition query) { | ||
// TODO Auto-generated method stub | ||
return null; | ||
} | ||
|
||
@Override | ||
public Map<String, MutableHitCount> getSourceHitCount(EventQueryDefinition query) { | ||
// TODO Auto-generated method stub | ||
return null; | ||
} | ||
|
||
@Override | ||
public EventSeries getAuditTrail(EventQueryDefinition query) { | ||
// TODO Auto-generated method stub | ||
return null; | ||
} | ||
|
||
@Override | ||
public void purgeAuditTrail(EventQueryDefinition query) { | ||
// TODO Auto-generated method stub | ||
|
||
} | ||
|
||
@Override | ||
public void createSchema() { | ||
// TODO Auto-generated method stub | ||
|
||
} | ||
|
||
} |
20 changes: 20 additions & 0 deletions
20
ff4j-store-springjdbc/src/main/java/org/ff4j/springjdbc/store/EventRepositorySpringJdbc.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
ff4j-store-springjdbc/src/main/java/org/ff4j/springjdbc/store/dto/HitCountDto.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
ff4j-store-springjdbc/src/main/java/org/ff4j/springjdbc/store/rowmapper/EventRowMapper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
...store-springjdbc/src/main/java/org/ff4j/springjdbc/store/rowmapper/HitCountRowMapper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
75 changes: 75 additions & 0 deletions
75
...store-springjdbc/src/test/java/org/ff4j/test/store/SpringJdbcFeatureStoreTestInitXml.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
package org.ff4j.test.store; | ||
|
||
/* | ||
* #%L | ||
* ff4j-store-springjdbc | ||
* %% | ||
* Copyright (C) 2013 - 2016 FF4J | ||
* %% | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* #L% | ||
*/ | ||
|
||
|
||
import org.ff4j.core.FeatureStore; | ||
import org.ff4j.springjdbc.store.FeatureStoreSpringJdbc; | ||
import org.junit.After; | ||
import org.junit.Before; | ||
import org.springframework.jdbc.datasource.embedded.EmbeddedDatabase; | ||
import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder; | ||
import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseType; | ||
|
||
/** | ||
* | ||
* @author <a href="mailto:[email protected]">Cedrick LUNVEN</a> | ||
*/ | ||
public class SpringJdbcFeatureStoreTestInitXml extends FeatureStoreTestSupport { | ||
|
||
/** DataBase. */ | ||
private EmbeddedDatabase db; | ||
|
||
/** Database builder. */ | ||
private EmbeddedDatabaseBuilder builder = null; | ||
|
||
/** {@inheritDoc} */ | ||
@Override | ||
protected FeatureStore initStore() { | ||
builder = new EmbeddedDatabaseBuilder(); | ||
db = builder.setType(EmbeddedDatabaseType.HSQL)// | ||
.addScript("classpath:schema-ddl.sql")// | ||
.addScript("classpath:ff-store.sql")// | ||
.build(); | ||
FeatureStoreSpringJdbc jdbcStore = new FeatureStoreSpringJdbc(); | ||
jdbcStore.setDataSource(db); | ||
jdbcStore.getJdbcTemplate(); | ||
return jdbcStore; | ||
} | ||
|
||
/** {@inheritDoc} */ | ||
@Override | ||
@Before | ||
public void setUp() throws Exception { | ||
super.setUp(); | ||
db = builder.setType(EmbeddedDatabaseType.HSQL).// | ||
addScript("classpath:schema-ddl.sql").// | ||
addScript("classpath:ff-store.sql") | ||
.build(); | ||
} | ||
|
||
/** {@inheritDoc} */ | ||
@After | ||
public void tearDown() throws Exception { | ||
db.shutdown(); | ||
} | ||
|
||
} |
21 changes: 21 additions & 0 deletions
21
ff4j-store-springjdbc/src/test/java/org/ff4j/test/store/SpringJdbcStoresCreateSchema.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
ff4j-store-springjdbc/src/test/java/org/ff4j/test/store/TestSpringJdbcErrors.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters